-
-
Notifications
You must be signed in to change notification settings - Fork 59
Conversation
…solved See nodejs/node#3402 for more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. It adds a lot of complexity but it seems like it's unavoidable. Thanks for doing all the research and implementing a solution for the workspaces scenario.
default.nix
Outdated
@@ -45,12 +45,14 @@ in rec { | |||
|
|||
mkYarnModules = { | |||
name, | |||
pname, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case let's remove the name argument and also pass the version along the pname
default.nix
Outdated
phases = ["configurePhase" "buildPhase"]; | ||
buildInputs = [ yarn nodejs ] ++ extraBuildInputs; | ||
passAsFile = [ "workspaceJSON" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an obscure feature of nix. Do you mind using pkgs.writeText
to create a derivation out of workspaceJSON
and pass this instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
default.nix
Outdated
cp ${yarnLock} ./yarn.lock | ||
chmod +w ./yarn.lock | ||
chmod +w ./yarn.lock # ./package.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, fixing.
Done @zimbatm |
thanks! |
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.
This adds a new argument
workspaceDependencies
tomkYarnPackage
, the contents of which are added to a Yarn Workspace beforeyarn install
. Example:Notes:
workspaceDependencies
a -> b -> c
,a
does not need to explicitly depend onc
)mkYarnModules
and added back inmkYarnPackage
, to avoid re-running yarn after source-only changesThis (sort of) fixes #57.