-
-
Notifications
You must be signed in to change notification settings - Fork 59
yarn workspaces #57
Comments
interestingly:
so i tried to use the global still, the point is when using
both of these two update: above assumption is probably wrong. yarn2nix probably uses the package.json to also select the dependencies required. |
top level package.jsonthe global
nested package.json
looking into https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/, this is how dependency resolving works:
which implies that we have to take the other workspace dependenciesturns out this was not enough as the workspace contains lots of nested libraries which have for now, this seems to be a far more complex issue then i expected it to be at first. |
maybe this is the solution: https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-focus
update: it is not, see yarnpkg/yarn#5864 (comment) |
i've been thinking to copy the node_modules path together as a post-yarn step using some code from https://github.com/ripeworks/workspace-pack experiment manual copyingwhat i tried:
summaryassembling a global |
using a 'hack' i was able to generate a standalone update: was able to 'update' a yarn.lock by removing all the bundled libraries:
now i get:
|
I've hacked in support for this as of https://github.com/teozkr/yarn2nix/tree/de4ddd1d117af93e8874d4dd4d27d97f70d83328. The basic idea is that we build each It's very hacky, breaks |
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.
@teozkr been looking into what you did with #58 and #59 and it seems interesting for our work. yet i don't understand how to use your code. the test is a little help but i don't understand how to adapt it to my problem either. a few questions:
|
@qknight: To build a package from the workspace you'll want some variant of: (mkYarnWorkspace {
src = ./.;
}).editoria-app
I have no idea what the |
@teozkr awesome, got it built. thanks so much! need to verify that it is working still. but the correct command was:
|
i've discovered yarn workspaces in the project https://gitlab.coko.foundation/editoria/editoria/tree/master and i assume this is currently not handled by
yarn2nix
.the problem is this:
editoria/package.json
(witheditoria/yarn.lock
) can be easily transformed into a node_package created byyarn2nix
editoria/packages/editoria-app/package.json
is a subdirectory/subproject which also uses theyarn.lock
from the top-level but then generates a differentnode_modules
output as it is based on a differentpackage.json
i'm not sure how to cover this use-case with
yarn2nix
but hopefully only requires a little patch foryarn2nix
. ideas?The text was updated successfully, but these errors were encountered: