Open abhilashlr opened 4 years ago
Yep, we could find some solution for that :)
Seems to be weird today for me that the same path node_modules/.bin/netlify
is available inside packages/host-app/
path 🤦 . Not sure what was the issue before. We can go ahead and close this and choose to reopen if I find the trace of this issue.
Thanks for your time @Exelord 👍
👋 This is a real issue. I am able to bypass this by putting following nohoist option into root package.json
. I tried various combinations and this seems to be the minimum viable set:
{
"name": "monorepo",
"private": true,
"workspaces": {
"packages": [
"frontend",
"monorepo-components"
],
"nohoist": [
"**/ember-cli-deploy-netlify-cli",
"**/netlify",
"**/ember-cli-deploy-netlify-cli/**",
"**/netlify/**"
]
},
}
Then I will get:
❯ ls -alh frontend/node_modules/.bin/netlify
lrwxr-xr-x 1 michal staff 22B 18 Jul 20:55 frontend/node_modules/.bin/netlify -> ../netlify-cli/bin/run
Documenting for future travelers.
But it would be better if the users of this library would not have to do such hacks.
For a project folder structure like:
The deploy plugin is expecting the node_modules to be under
host-app
folder due to this line. Perhaps, workspaces/monorepos create thenode_modules
at the root of the repo.The plugin should detect if it is run from a workspace configured ember app and if so, not expect it to have the
node_modules
but the root one.One possible solution I could think of is to use
npx
based commands for this same LoC and prevent the need for adevDependency
ofnetlify
.