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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated package-lock.json version fields #4060

Closed
nmussy opened this issue Sep 13, 2019 · 6 comments
Closed

Outdated package-lock.json version fields #4060

nmussy opened this issue Sep 13, 2019 · 6 comments
Assignees
Labels
effort/small Small work item 鈥撀爈ess than a day of effort feature-request A feature should be added or improved. management/devenv Related to CDK development/build environment

Comments

@nmussy
Copy link
Contributor

nmussy commented Sep 13, 2019

馃悰 Bug Report

What is the problem?

Every package's package-lock.json version field wasn't updated for the 1.8.0 release:

This causes changes when building the application

Reproduction Steps

./install.sh
git status

Environment

  • CDK CLI Version: 1.8.0
  • Module Version: 1.8.0
  • OS: all
  • Language: all

Other information

This probably should have been caught by #3451

@nmussy nmussy added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 13, 2019
@eladb
Copy link
Contributor

eladb commented Sep 13, 2019

Thanks for letting us know. No impact to end users, correct?

@nmussy
Copy link
Contributor Author

nmussy commented Sep 13, 2019

Not that I'm aware of, but I can't find a definitive answer. The packages are still published with the correct version.

I found relevant information from the lerna repository to avoid this in the future: lerna#1415

@SomayaB SomayaB added needs-reproduction This issue needs reproduction. management/devenv Related to CDK development/build environment labels Sep 13, 2019
@SomayaB SomayaB removed the needs-reproduction This issue needs reproduction. label Sep 13, 2019
@nmussy
Copy link
Contributor Author

nmussy commented Sep 18, 2019

I've attempted to fix this issue by adding this bootstrap command after the existing publish command:

npx lerna publish --force-publish=* --skip-npm --skip-git --repo-version ${ver}

npx lerna bootstrap --ignore-scripts -- --package-lock-only --no-audit

While this bumps the package-locks, it also removes dependencies, for example:

--- a/packages/@aws-cdk/aws-autoscaling-common/package-lock.json
+++ b/packages/@aws-cdk/aws-autoscaling-common/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "@aws-cdk/aws-autoscaling-common",
-  "version": "1.8.0",
+  "version": "1.9.0",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -25,18 +25,6 @@
       "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
       "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
       "dev": true
-    },
-    "cdk-build-tools": {
-      "version": "file:../../../tools/cdk-build-tools",
-      "dev": true
-    },
-    "cdk-integ-tools": {
-      "version": "file:../../../tools/cdk-integ-tools",
-      "dev": true
-    },
-    "pkglint": {
-      "version": "file:../../../tools/pkglint",
-      "dev": true
     }
   }
 }

@eladb
Copy link
Contributor

eladb commented Sep 18, 2019

I don't think these are important actually in package-lock files. @RomainMuller what do you think?

@nmussy nmussy mentioned this issue Sep 20, 2019
@RomainMuller
Copy link
Contributor

lerna bootstrap is insufficient as far as I know. It will not do anything with the private packages (which are referenced by path instead of version). Running lerna bootstrap does also not reliably update package-lock.json files as it turns out.

The install.sh script we have runs an additional pass after lerna bootstrap that caters for the private packages & makes sure the package-lock.json files are updated to the best of my understanding of what npm install would have done there.

@eladb eladb removed their assignment Sep 23, 2019
@eladb eladb removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 23, 2019
@NGL321 NGL321 added the chore label Sep 23, 2019
@nmussy nmussy mentioned this issue Sep 27, 2019
@SomayaB SomayaB added effort/small Small work item 鈥撀爈ess than a day of effort feature-request A feature should be added or improved. and removed chore labels Dec 30, 2019
@RomainMuller
Copy link
Contributor

We no longer use package-lock.json :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item 鈥撀爈ess than a day of effort feature-request A feature should be added or improved. management/devenv Related to CDK development/build environment
Projects
None yet
Development

No branches or pull requests

5 participants