Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Automatic Yarn Workspace import #59

Merged
merged 2 commits into from
Jun 27, 2018

Conversation

nightkr
Copy link
Contributor

@nightkr nightkr commented Jun 26, 2018

See #57 for the initial ticket. #58 adds the basic plumbing, but requires you to manually define the workspace. This will automatically import the "master" package.json and find all subpackages.

This is a bit more complicated than it has any right to be. Most of this is because it tries to implement Yarn's (and most shells') globbing behaviour. Maybe that should be moved to Nixpkgs' lib eventually, since it doesn't really have anything to do with Yarn in particular...

See nix-community#57 for the initial ticket. nix-community#58 adds the basic plumbing, but requires you to
manually define the workspace. This will automatically import the "master"
`package.json` and find all subpackages.
nightkr added a commit to Etimo/photo-garden that referenced this pull request Jun 26, 2018
This is thanks to the new `mkYarnWorkspace` (nix-community/yarn2nix#59)
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

The only potentially issue I can see is that the might implementation might create unnecessary rebuilds. Are all the packages rebuilt if the top-level package.json is being changed?

@nightkr
Copy link
Contributor Author

nightkr commented Jun 27, 2018

No, the top-level package.json is only used to discover the "real" packages. Those are then built exactly as if you had set up a #58 workspace manually. In my testing, migrating Etimo/photo-garden from #58 workspaces to mkYarnWorkspace didn't cause any of the packages to be rebuilt.

@zimbatm zimbatm merged commit d3b5e20 into nix-community:master Jun 27, 2018
@zimbatm
Copy link
Member

zimbatm commented Jun 27, 2018

thanks!

@qknight qknight mentioned this pull request Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants