react-cosmos / rfcs

Change requests for React Cosmos
MIT License
1 stars 2 forks source link

Link command for Cosmos contributors #20

Open ovidiuch opened 3 years ago

ovidiuch commented 3 years ago

A watch command that Cosmos contributors can use to link the Cosmos monorepo to another test repository on the same machine. Basically watching for changes in packages/$pkg/dist/(**/*) and automatically copying the changed files to /path/to/test/repo/node_modules/$pkg/dist/$1.

yarn/npm link doesn't work because some Cosmos modules look up dependencies at run-time relative to where the Cosmos modules are placed.

Command would look like this:

yarn link-dist /path/to/test/repo