A set of tools for adding exports maps to package.jsons in a monorepo.
- Clone this repo
git clone https://github.com/dzearing/patch-exports-maps
- Run the
extractImports.mjs
script from your repo root. This finds all TypeScript source files and builds up a dictionary of packages and the entry points referenced in the repo. Results are updated inpatch-exports-maps/data/package-exports.json
.
cd git/my-repo
node ../patch-exports-maps/extractImports.mjs
You can run this on multiple repos to build up the package-exports.json
dictionary.
- Once you're ready to add exports to packages, you can run the
updatePackages.mjs
script in your repo. It will glob all package.jsons and addexports
with the list.