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

npm reports warnings in generated package.json file #1358

Open
printfn opened this issue Jan 7, 2024 · 0 comments
Open

npm reports warnings in generated package.json file #1358

printfn opened this issue Jan 7, 2024 · 0 comments

Comments

@printfn
Copy link
Contributor

printfn commented Jan 7, 2024

馃悰 Bug description

Running wasm-pack build in my project generates this package.json file:

{
  "name": "fend-wasm",
  "description": "Arbitrary-precision unit-aware calculator",
  "version": "1.4.1",
  "license": "GPL-3.0-or-later",
  "repository": {
    "type": "git",
    "url": "https://github.com/printfn/fend"
  },
  "files": [
    "fend_wasm_bg.wasm",
    "fend_wasm.js",
    "fend_wasm_bg.js",
    "fend_wasm.d.ts"
  ],
  "module": "fend_wasm.js",
  "homepage": "https://github.com/printfn/fend",
  "types": "fend_wasm.d.ts",
  "sideEffects": [
    "./fend_wasm.js",
    "./snippets/*"
  ],
  "keywords": [
    "calculator",
    "cli",
    "conversion",
    "math",
    "tool"
  ]
}

When I then run npm publish I get the following output:

npm WARN publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
npm WARN publish errors corrected:
npm WARN publish Removed invalid "scripts"
npm WARN publish "repository.url" was normalized to "git+https://github.com/printfn/fend.git"
npm notice
npm notice 馃摝  fend-wasm@1.4.1
npm notice === Tarball Contents ===
npm notice 86B     README.md
npm notice 13.9kB  fend_wasm_bg.js
npm notice 527.3kB fend_wasm_bg.wasm
npm notice 1.2kB   fend_wasm.d.ts
npm notice 154B    fend_wasm.js
npm notice 598B    package.json
npm notice === Tarball Details ===
npm notice name:          fend-wasm
npm notice version:       1.4.1
npm notice filename:      fend-wasm-1.4.1.tgz
npm notice package size:  198.8 kB
npm notice unpacked size: 543.3 kB
npm notice shasum:        0798ea9803152fff81c77b8d5c4fce3a676c6b94
npm notice integrity:     sha512-66XR8CorJhh47[...]Y8LGu2oRKNwsg==
npm notice total files:   6
npm notice
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
+ fend-wasm@1.4.1

It looks like npm expects an empty scripts section to be included, and the repository URL to be in a different format.

馃 Expected Behavior

I expected the package to get published without any warnings.

馃憻 Steps to reproduce

rm -rfv wasm/pkg
(cd wasm && wasm-pack build)
(cd wasm/pkg && npm publish)

馃實 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.12.1
rustc version: 1.75.0
node version: 21.5.0
npm version: 10.2.4

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

No branches or pull requests

1 participant