Monorepo of typescript projects.
⚠️⚠️ NOTE! I started this repo as a way to learn about monorepo tooling (specifically, rush). Some of the packages in it have become reasonably popular, and reasonably stable. So, I'm going to slowly move them out into their own repos, one by one. Once all are moved out this repo will be archived. ⚠️⚠️
Packages are managed using rush. Make sure rush is installed:
npm install --global @microsoft/rush
Then install, build, lint and test with:
rush update
rush build
rush lint
rush test
rush update
should be run when updating the main branch too.
Add a dependency to a package (for example, adding lodash to fictional package in this monorepo some-pkg
):
cd packages/some-pkg
rush add --package lodash
rush add --package @types/lodash --dev
You can also manually edit package.json then run rush update
.
Create a new package:
cd packages
mkdir new-pkg
cd new-pkg
node ../../tools/rig/init # sets up package.json, .eslintrc.js, tsconfig.json, jest.config.js
Then open rush.json
, find the projects
array, and adda new entry: { "packageName": "new-pkg", "projectFolder": "packages/new-pkg" }
Publishing is automated, but kicked off manually. The process is:
rush change
command to create a changefile:
rush change
can also be run locally to add additional messages - but ideally the PR title would be descriptive enoughWhen a PR is merged, publishing is initiated by kicking off the publish worfklow:
rush publish
, which uses the changefiles merged with feature PRs, bumps versions and create git tagsCHANGELOG.json
files to create a GitHub releaseLinks to trees with previous iteration of publish instructions: