Skip to content

Doesn't seem to work well with monorepos #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
abhilashlr opened this issue May 17, 2020 · 3 comments
Open

Doesn't seem to work well with monorepos #3

abhilashlr opened this issue May 17, 2020 · 3 comments

Comments

@abhilashlr
Copy link

abhilashlr commented May 17, 2020

For a project folder structure like:

repo
|--- packages
|    |--- host-app => `ember deploy production` will be run in here
|    |--- addon-1
|    +--- addon-2
+--- node_modules/.bin/netlify

The deploy plugin is expecting the node_modules to be under host-app folder due to this line. Perhaps, workspaces/monorepos create the node_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 a devDependency of netlify.

@Exelord
Copy link
Member

Exelord commented May 18, 2020

Yep, we could find some solution for that :)

@abhilashlr
Copy link
Author

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 👍

@Exelord Exelord closed this as completed May 21, 2020
@MichalBryxi
Copy link

MichalBryxi commented Jul 18, 2020

👋 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.

@Exelord Exelord reopened this Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants