-
Notifications
You must be signed in to change notification settings - Fork 2
Migrating packages to monorepo
Tomasz Pluskiewicz edited this page Aug 1, 2023
·
9 revisions
The process of integrating barnard packages to the monorepo is simple
For a hypothetical package barnard59-foobar
- Install
filter-repo
- Fresh-clone the original repository (assuming
/path/to/barnard59-foobar
) - Use it to rewrite history by moving all sources to
package/foobar
and renaming tagsgit filter-repo --to-subdirectory-filter packages/foobar --tag-rename v:barnard59-foobar@ --force
- Remove unwanted files. At least
.github
,yarn.lock/package-lock.json
- Adjust
package.json
. Typically all it takes is to remove some dev dependencies and shared config (lint-staged
, etc), and correct metadata - Commit
- Merge into a branch of barnard59
git checkout -b migrate-foobar git remote add foobar /path/to/barnard59-foobar git fetch foobar git merge foobar/master --allow-unrelated-histories npm i
npm run lint -- --fix
- Ensure
npm run test
succeeds - Add package to test matrix
- Add package to README
git push --follow-tags
- Create PR
- Transfer open issues
- Change the README to link to monorepo
- Archive original repo