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

Lockfile contains deprecation message #5772

Open
alexeagle opened this issue Dec 8, 2022 · 1 comment
Open

Lockfile contains deprecation message #5772

alexeagle opened this issue Dec 8, 2022 · 1 comment

Comments

@alexeagle
Copy link

alexeagle commented Dec 8, 2022

pnpm version:

7.17.1

Code to reproduce the issue:

pnpm i @bazel/typescript (a few days ago when it was deprecated)
then
pnpm i @bazel/typescript now that the deprecation message got removed

Expected behavior:

The package was deprecated, then I published another version of it and npm no longer says that it's deprecated.
I would expect the lockfile to be unaffected by random changes from npm.

Actual behavior:

This causes the lockfile to be out-of-date if pnpm i:

$ git diff pnpm-lock.yaml
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0db7f9c15..8575c33c7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1275,7 +1275,6 @@ packages:
     id: registry.npmjs.org/@bazel/typescript/5.5.1
     name: '@bazel/typescript'
     version: 5.5.1
-    deprecated: This package is from build_bazel_rules_nodejs which is no longer maintained. Consider using https://github.com/aspect-build/rules_ts instead.
     hasBin: true
     requiresBuild: true
     peerDependencies:

Since npm doesn't have an immutability guarantee for this property of a package, I don't think it ought to appear in the lockfile. Is there some reason that copying the deprecation message into the lockfile is useful?

@zkochan
Copy link
Member

zkochan commented Dec 9, 2022

There are two reasons. One of the reasons is that on code reviews you can see deprecated packages.
The second reason is that when the lockfile is up-to-date, pnpm doesn't make requests to the server to download the metadata. So the only way to know if a package is deprecated is to store this info in the lockfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants