A toolbox package that helps you quickly set up and easily manage your typescript dev loop for your library.
Inspired by lib-builder and ts-react-toolbox.
- Typescript
- Jest
- Linter
- Prettier
It does not include any frameworks.
The packet expect that your code will be in the src
folder.
The build command will generate files in the dist
. Files are compiled by as es-modules but there is dist/cjs
directory with common-js modules.
Unfortunately, the setup is a bit more involved than you might expect, as each library does it differently and has its own limitation. Additionally, some dev environments require config files to be set up in the project's root directory.
If you know how the set-up process could be improved, please open an issue or pull a request. All ideas and contributions are welcome!
npm install typescript-dev-loop --save-dev
# or
yarn add -D typescript-dev-loop
{
"extends": "./node_modules/typescript-dev-loop/config/tsconfig.json",
"include": [
"src"
],
"exclude": [
"dist",
"node_modules",
"src/**/*.test.ts"
]
}
{
"eslintConfig": {
"root": true,
"extends": "./node_modules/typescript-dev-loop/config/eslint.json"
}
}
import jest from "typescript-dev-loop/jest";
export default jest;
{
"scripts": {
"build": "tdl-build",
"prepack": "yarn build",
"lint": "tdl-lint",
"test": "tdl-test"
}
}
The MIT License © Marek Pazik