Skip to content

web: Migrate to npm workspaces #6025

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

Merged
merged 1 commit into from
Jan 11, 2022
Merged

Conversation

relrelb
Copy link
Contributor

@relrelb relrelb commented Jan 10, 2022

lerna is a bit stale, and as such it currently has some outdated
dependencies which Dependabot warns on.
Fortunately, npm 7 supports monorepos natively, via "workspaces". So
simply replace lerna with this feature. The migration is pretty
neat and requires a very little invervention.

Because Node.js 14 comes with npm 6 by default, upgrade it manually
as shown in bahmutov/npm-install#103 (comment).

@torokati44
Copy link
Member

torokati44 commented Jan 10, 2022

Could this help with the CI failures: https://issueexplorer.com/issue/nextcloud/contacts/2352 ?

@torokati44
Copy link
Member

Some other places recommend passing --no-optional or --force to npm install and/or npm ci...

@relrelb relrelb changed the title web: Migrate to NPM workspaces web: Migrate to npm workspaces Jan 11, 2022
`lerna` is a bit stale, and as such it currently has some outdated
dependencies which Dependabot warns on.
Fortunately, npm 7 supports monorepos natively, via "workspaces". So
simply replace `lerna` with this feature. The migration is pretty
neat and requires a very little invervention.

Because Node.js 14 comes with npm 6 by default, upgrade it manually
as shown in bahmutov/npm-install#103 (comment).
Copy link
Member

@Herschel Herschel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Herschel Herschel merged commit 7f4f406 into ruffle-rs:master Jan 11, 2022
@relrelb relrelb deleted the npm_workspaces branch January 11, 2022 21:33
@@ -32,12 +37,11 @@
"webpack-cli": "^4.9.1"
},
"scripts": {
"bootstrap": "npm install && lerna bootstrap --hoist",
"build": "lerna run build --stream",
"build": "npm run build --workspaces",
"build:debug": "cross-env NODE_ENV=development CARGO_FEATURES=avm_debug npm run build",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the --workspaces argument also have been added on this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed because it uses build that does npm run build --workspaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks. It's still not entirely clear to me "which" build script where runs when and why. I might read up on it. Until then, I'll remove it from #5834.

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

Successfully merging this pull request may close these issues.

4 participants