@theedoran/bootstrap
v4.4.4
Published
This package creates a TypeScript project from scratch, providing all the tools and configuration files needed to start write some code in a sensible way
Downloads
17
Maintainers
Readme
@theedoran/bootstrap
This package sets up a TypeScript project from scratch, providing all the tools and configuration files needed to start write some code in a sensible way.
Next.js support
This package works for Next.js too! Just init a new project with:
npx create-next-app@latest --ts --use-npm
...and then execute the install command below.
Usage
Init a new Node project if you haven't already done so (no need to do it for Next.js):
npm init -y
Then cd
in the new directory, and execute this command:
npx @theedoran/bootstrap@latest
Done!
What it does
This script executes other scripts and copies various configurations, in order:
It installs and configures Husky;
It installs:
- Both envs: typescript, @types/node, @commitlint/cli, @commitlint/config-conventional, lint-staged, eslint, eslint-config-prettier, @typescript-eslint/parser, @typescript-eslint/eslint-plugin, prettier as
devDependencies
- Node only: dotenv, module-alias as
dependencies
and @types/module-alias, ts-node, nodemon asdevDependencies
- Next.js only: @types/react, @types/react-dom, eslint-config-next, prettier-plugin-tailwindcss as
devDependencies
- Both envs: typescript, @types/node, @commitlint/cli, @commitlint/config-conventional, lint-staged, eslint, eslint-config-prettier, @typescript-eslint/parser, @typescript-eslint/eslint-plugin, prettier as
It installs and configures Commitizen with the cz-conventional-changelog adapter;
It configures these two
scripts
inpackages.json
(Node only):dev
->nodemon --watch 'src/**' --ext 'js,ts,json' --exec 'ts-node src/index.ts'
build
->tsc
It copies all the configuration files, for:
Visual Studio Code
TypeScript
Husky
Prettier
ESLint
Commitlint
lint-staged
- env vars (
.env.example
) - an
src
skeleton
License
This package is licensed under the MIT License.