Skip to content
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

Add all monorepo packages as top-level deps #39218

Merged
merged 1 commit into from
Feb 3, 2020
Merged

Conversation

jsnajdr
Copy link
Member

@jsnajdr jsnajdr commented Feb 3, 2020

Add all packages in the monorepo as dependencies of the top-level package.json. Some of them already are there as devDependencies. Here we are adding the rest.

This is a workaround for NPM bug: npm/cli#750

How to test:
Do a clean (no node_modules) install (not ci) from the lockfile:

npm run distclean
npm install

Before this patch, the npm install failed to create symlinks to packages like @automattic/components and even removed the dependency from the lockfile.

After the patch, npm install should install everything just like npm ci and shouldn't change the lockfile at all.

@jsnajdr jsnajdr added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Build Packages labels Feb 3, 2020
@jsnajdr jsnajdr requested a review from a team February 3, 2020 16:31
@jsnajdr jsnajdr self-assigned this Feb 3, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

"requires": {
"babel-runtime": "^6.9.2",
"debug": "^3.1.0",
"@babel/runtime": "^7.8.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

iiiiinteresting

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's caused by the recent wpcom PRs that upgraded the package's dependencies, but not the lockfile.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, surprised npm ci wasn't yelling about it

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that npm ci doesn't look at the requires fields at all. It just blindly recreates the node_modules tree from the nested dependencies objects in the lockfile. For that, only the tree structure and the resolved and integrity fields are needed.

Copy link
Contributor

@blowery blowery left a comment

Choose a reason for hiding this comment

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

Tests out fine, looks good.

@jsnajdr jsnajdr merged commit 9d064f0 into master Feb 3, 2020
@jsnajdr jsnajdr deleted the update/package-json-deps branch February 3, 2020 17:13
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants