Pure ESM monorepo using native TypeScript compiler instead of external bundlers 🌟
Node.js 18.3.0 or newer is required
NPM 8.12.1 or newer is required
git clone https://github.com/negezor/typescript-monorepo-boilerplate.git
cd typescript-monorepo-boilerplate
npm install
npm run build
- In
tsconfig.json
, change thepaths
from@template
to the one you need - Change the namespace in the
name
property of thepackage.json
file of each module
- In
package.json
, changeworkspaces
and path in scriptslint:eslint
&typescript:clean
- In
tsconfig.json
, change thepaths
- In
.gitignore
, change the# Build
place - In
jest.config.json
, change thetestMatch
pattern - In
.eslintrc.json
, change theoverrides
pattern for tests - Run
npm run update:tsconfig
for update tsconfig references
- Copy template structure
- Run
npm run update:tsconfig
for update tsconfig references - Run
npm install
for create new symlinks in node_modules
- Add to
package.json
dependency inpeerDependencies
- Run
npm run update:tsconfig
for update tsconfig references
If you see this error, then eslint does not include your files in linting, you can add your files in tsconfig.eslint.json
.
The full error looks something like this::
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: path/to/file.
The file must be included in at least one of the projects provided.
npm run build
- Starts the assembly of all packages in monorepo
npm run watch
- Waits for changes in each package and performs build. Used for development.
npm run test
- Runs tests for packages
npm run clean
- Cleans the entire TypeScript assembly
npm run build --workspaces
- Run build in all packages. More info
npm run build --workspace=name
- Run build in specific package. More info