Khải's Node.js monorepo
This repo hold many of my nodejs packages in one place for ease of management.
CI Build Status
Package requirements
- Node.js ≥ 8.9.0
Development
Development requirements
- Satisfies package requirements
- UNIX-like environment (Linux, macOS, FreeBSD, etc.)
- Package manager that supports monorepo: pnpm (Recommened), yarn
Install dependencies
Using pnpm
pnpm recursive link
Using yarn
yarn # or yarn install
Some important scripts
Most scripts are available in package.json
's scripts
object but some are only available through pnpx
/yarn exec
.
In the following section, pnpm run
/yarn run
is alternative to npm run
, pnpx
/yarn exec
is alternative to npx
.
Test
Normal tests:
pnpm test
Update jest snapshots:
pnpm test -- -u
Run TypeScript check:
pnpm run type-check
Clean TypeScript build
pnpm run clean-typescript-build
.npmignore
Generate pnpm run generate-npmignore
Mismatched local packages' version
Check for mismatched local packages' version:
pnpm run mismatched-versions
Update mismatches local packages' versions:
pnpx nested-wrkspc.prv verman mismatches -u .
Out-of-date external packages
Check for outdated packages:
pnpx nested-wrkspc.prv depman outdated .
Update outdated packages:
pnpx nested-wrkspc.prv depman outdated -u .
pnpm recursive link # or yarn install
Untested Features
- CLI subcommand
publish
in packagenested-workspace-helper
: Cannot mock npm registry in CLI environment. - CLI subcommand
dependency-management outdated
in packagenested-workspace-helper
: Cannot mock npm registry in CLI environment. - Entire package
git-ts
: It's too complicated to create a test friendly git repo. - Most of
random-org-http
: Testing over network is complicated.