Zero-config CLI for TypeScript package development
MIT License
Bot releases are hidden (Show)
An upstream cache bug that affected certain combinations of build formats has been fixed
(typescript) Error: ENOENT: no such file or directory, rename '[...]/my-lib/node_modules/.cache/rollup-plugin-typescript2/rpt2_4c61ae4392b9bd24f4d43d13a3f56419b8b5805d/code/cache_' -> '[...]/my-lib/node_modules/.cache/rollup-plugin-typescript2/rpt2_4c61ae4392b9bd24f4d43d13a3f56419b8b5805d/code/cache'
The built-in lodash
-> lodash-es
replacement no longer breaks imports of lodash/fp
eslint-config-react-app
has been resolvedPublished by agilgur5 about 4 years ago
Updated the required Node version from 8 to 10.
While previous versions of TSDX began deprecating support for Node 8, it was not officially dropped.
In this release, we have officially dropped Node 8: TSDX now requires Node 10+ as many dependencies that were upgraded similarly do.
This should not impact most users as Node 8 has been EoL for ~9 months now.
Many packages had already required Node 10+ and the vast majority already have support for it.
Most users are on Node 12 or Node 14 already.
Updated the Jest version used by tsdx test
from 24 to 25.
The main breaking change in Jest 25 is the upgrade of the default JSDOM environment from JSDOM v11 to JSDOM v15.
For most Jest users, this change either has no impact or will reduce configuration if you've manually set a more up-to-date jest-environment-jsdom
in your jest.config.js
.
In some rare cases, where code relied on the old version of JSDOM, this may result in breakage.
ts-jest
and jest-plugin-typeahead
have also been upgraded to support Jest 25.
babel-plugin-transform-async-to-promises
-> babel-plugin-polyfill-regenerator
async-to-promises
has been unmaintained for around a year now and has several correctness issues, many of which have affected TSDX users. For that reason, we've switched to using babel-plugin-polyfill-regenerator
instead, which will add a pure, non-polluting regenerator-runtime
polyfill if your targets
require it.
The vast majority of browsers (94.37%) now support async/await and generators with no polyfilling necessary, but the default preset-env
will add it. If you don't already have one, we recommend adding a .browserslistrc
(or preset-env
targets
) to specify the environments you're targeting.
This should be totally backward-compatible, but it may change the output quite a bit, including making bundles larger due to inclusion of regenerator-runtime
.
babel-plugin-macros
TSDX's internal Babel plugin ordering has changed, moving babel-plugin-macros
to be first.
This was done in order to support several use-cases like styled-components/macro
, which previously did not work due to the ordering.
This shouldn't really break anything, but there is an off chance it might have an impact on some rare builds.
babel-plugin-polyfill-regenerator
change above, TSDX now supports polyfilling generators out-of-the-box. Previously we only supported async/await with babel-plugin-transform-async-to-promises
and required users to configure their own plugins for generator polyfillingstyled-components/macro
support per above--max-warnings
flag has been added to tsdx lint
, which works the same as ESLint's --max-warnings
flag
size-limit
has been added to all templates for bundle analysis via NPM/Yarn scripts and a GitHub Actionbahmutov/npm-install
tsconfig.json
now set skipLibCheck
, forceConsistentCasingInFileNames
, and noEmit
tsc
for type-checking. skipLibCheck
will also greatly increase performance of tsc
's type-checkingtsconfig.json
now have detailed comments explaining nearly every configuration option in usepatch-package
is now officially listed as a customization option@babel/preset-env
was updated to the latest minor to support nullish coalescing and optional chaining without additional plugins, as well as to update the compatibility table.
preset-env
or Autoprefixer, as TSDX's internal test suite does, you may need to update those snapshots.yarn-deduplicate
, overall install size should have decreased a good bit--max-warnings
flag to tsdx lint
(#858) dd92fecpatch-package
reference to Customization section (#855) 08a8ef8https://github.com/formium/tsdx/compare/v0.13.3...v0.14.0
Apologies again for the delay on getting to v0.14.0
, COVID added a lot of stress and work had been busy, to say the least. Unfortunately I wasn't able to get to all the changes I wanted to into it, but v0.14.0 has been waiting long enough. Only two complex issues were left out and many more PRs added in, though not everything had made it into v0.13.x
either.
I also wanted to push Rollup 2, TS 4.0, Prettier 2, and ESLint upgrades into this, but the breaking changes in the changelog started getting too big, so I decided to wait a bit to split those changes across more releases to not throw too much breakage at users at once.
If you're wondering, all of my co-workers, my team, and I were suddenly laid off just over a week ago, so that's why I had time (and want to distract myself) to push out ~2 dozen PRs the past week π
Best wishes and stay safe to everyone!
Published by agilgur5 about 4 years ago
baseUrl
or paths
set in their tsconfig
, fixing a long-standing bughttps://github.com/formium/tsdx/compare/v0.13.2...v0.13.3
Apologies for the delay on releasing this and the delay on getting to v0.14.0
, COVID added a lot of stress and work has been busy, to say the least. I'm behind on all of my OSS repos, TSDX is actually the most maintained (but needs a lot more attention) π
v0.14.0
will be the next release, which will be a breaking change mostly due to updating dependencies' majors. I held back on it to get more into v0.13.x
before getting busy, but unfortunately I wasn't able to get to all the changes I wanted to into it, but v0.14.0 has been waiting long enough
Wishing everyone well! Please stay safe and please do your part to follow public health guidelines!
β Quoting from a Chromium release β :
Black Lives Matter. Saying this does not mean that other lives do not matter. It should not be controversial to say this. If I say Chromium updates matter, it does not mean that other Fedora packages do not matter, it means that a Chromium update is needed to fix this giant pile of severe security vulnerabilities, here, today, now: [...]
In making that analogy, I do not intend to trivialize BLM. In no way do I mean to compare the lives of people to a silly web browser update. People are infinitely important than software. But since I'm here to push this software update out, I am also choosing to say clearly and unambiguously that Black Lives Matter.
Open Source proves that many voices, many contributions, together can change the world. It depends on it. This is my voice.
Published by agilgur5 over 4 years ago
@types/jest
was moved to be a dependency instead of a devDependency. It has also been removed from the templates.
@types/jest
v25 but Jest v24.
semver
was also moved from devDependency to dependency. It's used in tsdx create
, so it was misplaced.tsconfig
compilerOptions
have been removed. strict
already includes all of these.https://github.com/jaredpalmer/tsdx/compare/v0.13.1...v0.13.2
Wishing everyone well during the pandemic! Please stay safe and please do your part to follow public health guidelines!
If you're looking for more ways to help out, there are many, many around and likely local initiatives where you live. I also included a small few I stumbled upon in the previous release postscript.
Another recent relevant one might be the shortage of COBOL programmers in the US. If you're a tech worker interested in helping out NJ (whether you know COBOL or not), there's a sign-up form here.
Published by agilgur5 over 4 years ago
tsconfig.json
include
was changed to remove test
from the array. This faulty include resulted in declarations being generated in dist/
for test files as well as slowing down builds. It was also the cause of TS errors around v0.13.0's change to rootDir: './src'
https://github.com/jaredpalmer/tsdx/compare/v0.13.0...v0.13.1
Wishing everyone well during the pandemic! Please stay safe and follow the guidelines of public health officials, for yourself, for your family, and for everyone else and their families!
There's also lots of ways to help out, here's just a few I've stumbled upon:
Published by agilgur5 over 4 years ago
tsconfig.json
rootDir
has been changed to ./src
. ./
is now deprecated and will give a warningtsdx.config.js
are now supported out-of-the-box (no more need for hacks like objectHashIgnoreUnknownHack
)--config
flag is now respectedtsconfig.json
's declarationDir
is now respectedsrc/index.jsx
will now be parsed as an entry file (previously only .ts
, .tsx
, and .js
were)esModuleInterop
should be properly read now for the purposes of configuring Rollup's esModule
/ CJS __esModule
-- a bug made it so these were always added previously. This does not impact parsing of esModuleInterop
for anything else, which worked correctly and still does.ts-jest
anymoretsdx.config.js
don't bug out anymoretsconfig.json
rootDir
has been changed to ./src
. ./
is now deprecated and will give a warningtsconfig.json
target
has been removed as it is not currently configurable (configured with @babel/preset-env
instead)src
is now included in package.json
files
to improve debuggingtest
script doesn't run Jest in interactive mode (#536) a2e4b78https://github.com/jaredpalmer/tsdx/compare/v0.12.3...v0.13.0
Sorry for the long delay on this release everyone, I was recently added as an official maintainer (a week ago) and just given publishing privileges (yesterday). See https://github.com/jaredpalmer/tsdx/issues/512 for more details.
Wishing everyone well during the pandemic!
tsdx test
no longer defaults to watch mode in interactive environments. This reverts previous behavior which caused bugs.Commits
https://github.com/jaredpalmer/tsdx/compare/v0.12.2...v0.12.3
Commits
https://github.com/jaredpalmer/tsdx/compare/v0.12.1...v0.12.2
transpileOnly
flagDescription
Rebuilds on any change
Usage
$ tsdx watch [options]
Options
-i, --entry Entry module(s)
--target Specify your target environment (default web)
--name Specify name exposed in UMD builds
--format Specify module format(s) (default cjs,esm)
--tsconfig Specify your custom tsconfig path (default <root-folder>/tsconfig.json)
--verbose Keep outdated console output in watch mode instead of clearing the screen
+ --onFirstSuccess Run a command on the first successful build
+ --onSuccess Run a command on a successful build
+ --onFailure Run a command on a failed build
--noClean Don't clean the dist folder
+ --transpileOnly Skip type checking
-h, --help Displays this message
Examples
$ tsdx watch --entry src/foo.tsx
$ tsdx watch --target node
$ tsdx watch --name Foo
$ tsdx watch --format cjs,esm,umd
$ tsdx watch --tsconfig ./tsconfig.foo.json
$ tsdx watch --noClean
+ $ tsdx watch --onFirstSuccess "echo The first successful build!"
+ $ tsdx watch --onSuccess "echo Successful build!"
+ $ tsdx watch --onFailure "The build failed!"
+ $ tsdx watch --transpileOnly
Commits
https://github.com/jaredpalmer/tsdx/compare/v0.12.0...v0.12.1
node_modules
, you can delete the .rts2_cache_xxx folders from root and remove them from your .gitignore filesprocess.env.CI
false
), tsdx test
now runs Jest in watch mode. Note: Most CI services set CI
env variable to true by default. Our implementation is exactly how create-react-app does it.tsdx test
will pass in cases where no tests exist"prepare"
task to package.json
scripts so that you can publish immediately. For those interested, I like to publish (TSDX) packages with np
to do this.Commits
detect
setting for eslint-plugin-react in react projects b6c3153https://github.com/jaredpalmer/tsdx/compare/v0.11.0...v0.12.0
rollup-plugin-typescript2
. TSDX now generates types properly--again. SORRY about that folks.--report-file
--noClean
option for watchCommits
https://github.com/jaredpalmer/tsdx/compare/v0.10.5...v0.11.0
Commits
https://github.com/jaredpalmer/tsdx/compare/v0.10.2...v0.10.3
tsdx create
will now default to an MIT licensetsdx create
will try to pull author info for package.json
from git and npm configs or fallback to a cute lil' prompt. This is to ensure that the bootstrapped package is publishable immediately.Commits
https://github.com/jaredpalmer/tsdx/compare/v0.10.1...v0.10.2
npx tsdx create
if you don't have TS installed globally)node_moudles/.cache/.progress-estimator
.Commits
https://github.com/jaredpalmer/tsdx/compare/v0.10.0...v0.10.1
system
to format
optionsjest.config.js
(it will merge with the defaults)dist
directory on tsdx build
eslint
depsCommits
https://github.com/jaredpalmer/tsdx/compare/v0.9.3...v0.10.0
tsdx lint
command no longer swallows errorsCommits
Commits
Commits
--extractErrors
has been changed to a boolean. It will just default to use a dummy URL in the ErrorProd.js
component.tsdx.config.js
. TSDX uses Rollup under the hood. The defaults are solid for most packages (Formik uses the defaults!). However, if you do wish to alter the rollup configuration, you can do so by creating a file called tsdx.config.js
at the root of your project like so:// Not transpiled with TypeScript or Babel, so use plain Es6/Node.js!
module.exports = {
// This function will run for each entry/format/env combination
rollup(config, options) {
return config; // always return a config.
},
};
The options
object contains the following:
export interface TsdxOptions {
// path to file
input: string;
// Safe name (for UMD)
name: string;
// JS target
target: 'node' | 'browser';
// Module format
format: 'cjs' | 'umd' | 'esm';
// Environment
env: 'development' | 'production';
// Path to tsconfig file
tsconfig?: string;
// Is opt-in invariant error extraction active?
extractErrors?: boolean;
// Is minifying?
minify?: boolean;
// Is this the very first rollup config (and thus should one-off metadata be extracted)?
writeMeta?: boolean;
}
const postcss = require('rollup-plugin-postcss');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
module.exports = {
rollup(config, options) {
config.plugins.push(
postcss({
plugins: [
autoprefixer(),
cssnano({
preset: 'default',
}),
],
inject: false,
// only write out CSS for the first bundle (avoids pointless extra files):
extract: !!options.writeMeta,
})
);
return config;
},
};
You can add your own .babelrc
to the root of your project and TSDX will merge it with its own babel transforms (which are mostly for optimization).
Commits
--extractErrors
flagtsconfig.json
--template
flag to tsdx create
So you can run npx tsdx create --template=react
now.testMatch
flag and made it overridable..tsdx lint
command with eslint x typescript x prettier.To take advantage of tsdx lint
, simply add a npm script to your package.json
like so.
{
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
+ "lint": "tsdx lint"
}
}
Commits
testMatch
to allow for other folder⦠(#159) f6ecdc9