Zero-config CLI for TypeScript package development
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
--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