0.0.8 • Published 5 years ago
@danielfsousa/cli v0.0.8
monorepo-typescript-lib-starter
Starter kit for monorepo libraries in Typescript.
If you are building a small library and don't want a monorepo checkout: danielfsousa/typescript-lib-starter
Usage
Click on the Use this template button on github or clone the repository and remove the .git folder:
git clone https://github.com/danielfsousa/monorepo-typescript-lib-starter --depth 1
cd monorepo-typescript-lib-starter
rm -rf .gitFeatures
- lerna for managing a monorepo
- RollupJS for multiple optimized bundles with tree shaking for UMD (browsers), CommonJS (Node.js) and ES Modules (module bundlers)
- Automatic types (*.d.ts) file generation
- Tests and coverage report generation using Jest
- ESlint with standard style for linting typescript and javascript files
- Prettier for code formatting
- Automatic documentation generation with TypeDoc and deployment to Github Pages
- Pre-commit hooks with husky and lint-staged for linting, code formatting, unit tests and commit message validation
- Codecov for consuming coverage reports
- Automatic releases and changelog, using lerna and Commitizen(https://conventionalcommits.org/en/v1.0.0/)
- CI/CD with Github Actions
- Pre-created examples for a CLI app and an isomorphic core library that runs on browsers, Node.js and Deno
Scripts
Execute the scripts from the root directory to run for all packages or inside a package folder to run only for that project.
npm run bootstrapSyslink packages and binariesnpm run cleanRemove generated code, typings and cachesnpm run commitCommit using conventional commit stylenpm run docsGenerate and open documentationnpm run formatFormat code using prettiernpm run format:checkCheck if code is following the prettier stylenpm run lintLints codenpm run lint:fixLints and tries to fix linting errorsnpm run publishBump packages versions based on the commits messages, edit the CHANGELOG file and publish a new release to npm and githubnpm run testRun test suite and generate coverage reportnpm run test:watchRun test suite in interactive watch modenpm run watchRun build script in watch mode
Git hooks
pre-commit: Lints, check your code style and runs associated unit tests for every staged filecommit-msg: Check if your commit message follows the Conventional Commits specification before every commit (you can runnpm run committo help you create a good commit message)