2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-08 22:30:59 +00:00
iconify/monorepo
2022-01-28 12:45:39 +02:00
..
src Add symlinks after installing packages 2022-01-28 12:45:39 +02:00
.gitignore Remove Lerna, use custom script instead 2022-01-27 21:16:43 +02:00
index.js Fix executing NPM on Windows 2022-01-28 12:24:48 +02:00
package-lock.json Remove Lerna, use custom script instead 2022-01-27 21:16:43 +02:00
package.json Reorganize monorepo helpers, support multiple actions 2022-01-28 11:24:29 +02:00
README.md Remove Lerna, use custom script instead 2022-01-27 21:16:43 +02:00
tsconfig.json Remove Lerna, use custom script instead 2022-01-27 21:16:43 +02:00

Fix links

Unfortunately, Lerna is not being actively developed and it has a lot of issues.

One of those issues is inability to create links for local dependencies that depend on other local dependencies.

This is a basic script does the same as Lerna, but with few differences:

  • It links everything, so dependencies of dependencies are correctly linked (broken in Lerna). For simplicity, it links everything.
  • It does not check versions. This means if you have multiple versions of the same package in monorepo, this script is not for you.

Requirements

Script requires:

  • NPM (not tested with other package managers)
  • Unix file system (TODO: test on Windows)

Script creates symbolic links for all local packages, except:

  • Packages with private set to true.
  • Packages without version number (assumed to be private).

Commands

  • bootstrap: runs npm install for all packages, then creates symbolic links.
  • link: creates symbolic links (can be used to fix links after messing with packages).
  • unlink: removes local symbolic links.
  • clean: removes node_modules in all packages.

Config file

This script usese lerna.json, where the only property that matters is packages.