fast-bake
v0.2.17
Published
Typescript project scripts runner
Downloads
81
Maintainers
Readme
fast-bake
Helper scripts for assembling backend typescript project.
Hides all setup steps for typescript, jest, prettier, eslint (etc) and have them unified in one place.
Usage
$ mkdir my-backend // create new directory
$ cd my-backend
$ npx fast-bake init // run "init" to copy template project
$ yarn build // build project with fast-bake scriptsThis would bootstrap backend express with fast-bake build scripts.
Installation
Adding to existing codebase:
yarn add fast-bakeModify package.json to execute required scripts:
{
"scripts": {
"build": "fast-bake build",
"test": "fast-bake test",
"start": "fast-bake start",
"lint": "fast-bake lint"
}
}Add required tsconfig.json file with contents:
{
"extends": "fast-bake/configs/tsconfig.json",
"include": ["src/**/*.ts"]
}Build script
- transpile all sources in
src/folder and write js files intodist/ src/index.tsis requiredtsconfig.jsonis required (so far)
Test script
- Runs
yarn lintin Check mode to notify about mistakes - Runs
jestfor all default test files insrc/folder in watch mode - If
env.CIis set, watch mode would not be enabled
Start script
Parallel processes executed:
nodemonfordist/folder and it would rundist/index.jswith delaytscin watch mode (same as for build step)
Lint script
Runs eslint and prettier for src/ folder and apply style and formatting changes
Init script
Copies sample project structure from template folder into current folder.
Development
Heavily inspired by react-scripts.
Some code approaches reused.
