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

[epic] warn users when altering package.json during publish #672

Closed
8 of 9 tasks
Tracked by #487
wraithgar opened this issue May 9, 2023 · 2 comments
Closed
8 of 9 tasks
Tracked by #487

[epic] warn users when altering package.json during publish #672

wraithgar opened this issue May 9, 2023 · 2 comments
Assignees
Labels

Comments

@wraithgar
Copy link
Member

wraithgar commented May 9, 2023

Epic

There is a lot of manipulation that read-package-json does when preparing a manifest for publishing. Not all of it can be removed but some if it can (such as typo corrections). In order to stop doing that in the next semver-major we need to identify which changes we can stop doing, and start warning the user about them now.

A command to apply the fixes needs to also exist to easily clear the warnings.

Tasks

@wraithgar wraithgar self-assigned this May 9, 2023
@wraithgar wraithgar added the epic label Jun 7, 2023
@wraithgar
Copy link
Member Author

wraithgar commented Jun 7, 2023

Decision record for what alterations are going to change in 9/10

bundledDependencies

npm 9 warns
npm pkg fix fixes
npm 10 throws

bundleDependencies

  • false
    • npm 9 warns
    • npm pkg fix fixes (deletes the attribute)
    • npm 10 throws

gypfile

  • npm 9 warns when doing this
  • npm 9 warning / 10 exception should direct folks to run npm pkg set scripts.install="node-gyp rebuild";npm pkg set gypfile=true --json
  • npm 10 errors if gypfile is not set to true or false if there is a gypfile present

keep the same logic to show a warning for npm 9 and make it error in npm 10 unless they set gypfile: true
action: in normalize change gypfile: true so it sets the correct install script

serverjs

npm 9 warns
npm 10 stops doing this altogether

scriptpath

  • npm 9 warns when doing this
  • npm pkg fix fixes this
  • npm 10 throws and refuses to accept bad script paths

authors

  • npm 9 will warn
  • npm 10 will stop doing this

readme

  • npm 9 will warn
  • npm 10 will stop doing this

binDir

stops normalizing in npm 10 and lets binRefs handle the rest

normalizeData

  • npm 9 will warn
  • npm pkg fix will fix
  • npm 10 will throw

binRefs

  • Warn in 9
  • npm pkg fix fixes
  • Throw in 10

NEW PREPARE STEP

entries in devDependencies and dependencies that match names

  • Warn in 9
  • npm pkg fix fixes
  • Throw in 10

@wraithgar
Copy link
Member Author

This will go out w/ the next npm release.

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

No branches or pull requests

1 participant