-
Notifications
You must be signed in to change notification settings - Fork 15
Add Yarn Workspaces Support #9
Comments
I haven't used Two things:
One minor thing about your example: "liferay-npm-scripts" should be in Disclaimer: writing this at 5 AM at airport. |
I dug into yarn workspaces a bit and didn't necessarily find the answers I was looking for. I tried removing One issue I ran into was when trying to run
This does not fail when running here is the PR removing |
Thanks @bryceosterhaus! I'll be trying this out with https://github.com/jbalsas/liferay-portal/pull/1646... As a first step, the expectation is that developers could still run their tests or other scripts individually The only difference would be that with |
Fixes #9 - Remove npm-which package
In a Yarn workspace context, most
liferay-npm-scripts
will fail to run from within the workspaces.Using the attached simple project:
From root folder
yarn install
yarn workspace Foo run build
// works!From packages/Foo folder
npm run build
// fails!The main problem is that
liferay-npm-scripts
is the onlydevDependency
on the workspace, so yarn will only create that symlink in the/packages/Foo/node_modules/.bin
folder (as expected).The binaries for this package dependencies will end up in
/node_modules/liferay-npm-scripts/node_modules/.bin
, which are unreachable by npm-which that will only look inCWD
and above.A possible fix would be to have different
npm-which
resolutions:Note that scripts will work if ran from the root of the project with the
yarn workspace Foo run build
command.Since I've only had limited experience with Yarn, I'm not sure what exactly should be expected... @wincent, any thoughts?
yarn_workspaces.zip
The text was updated successfully, but these errors were encountered: