Closed Bug 1516352 Opened 6 years ago Closed 6 years ago

Avoid the need to re-run `yarn` when modifying a library

Categories

(Taskcluster :: Services, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dustin, Assigned: bstack)

References

Details

With the current monorepo arrangement, if service X has "taskcluster-lib-foo": "file:../libraries/foo" in its package.json, then `yarn` helpfully *copies* foo into services/X/node_modules/taskcluster-lib-foo. It will re-copy it when running `yarn`, but without a `yarn` run changes to tc-lib-foo won't be reflected in service X. Let's find a way to fix that, such that a change to something under libraries/ has immediate effect under services/. Note that this is not blocking the monorepo deployment.. it's something we can solve afterward.
It doesn't seem to re-copy automatically. You need to run `yarn clean` then `yarn` again.
Assignee: nobody → bstack
(In reply to Dustin J. Mitchell [:dustin] pronoun: he from comment #0) > With the current monorepo arrangement, if service X has > > "taskcluster-lib-foo": "file:../libraries/foo" > > in its package.json, then `yarn` helpfully *copies* foo into > services/X/node_modules/taskcluster-lib-foo. It will re-copy it when > running `yarn`, but without a `yarn` run changes to tc-lib-foo won't be > reflected in service X. I think what we want is the folder to be symlinked. npm seem to use the `file:` protocol whereas yarn uses `link:` to identify which packages to symlink. I see two options: 1. Switch `file:` to `link:`. I don't think the link protocol works with npm so something like `npm install` would fail, but that's okay since we use yarn. 2. Write a script[1] [1] https://github.com/milesj/beemo/blob/master/scripts/link-packages.sh
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Component: Platform and Services → Services
You need to log in before you can comment on or make changes to this bug.