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

Arbitrary fields for generated package.json #836

Open
majoyal opened this issue May 1, 2020 · 1 comment
Open

Arbitrary fields for generated package.json #836

majoyal opened this issue May 1, 2020 · 1 comment

Comments

@majoyal
Copy link

majoyal commented May 1, 2020

馃挕 Feature description

I think it would be useful to have a way to include additional arbitrary fields in the generated package.json. For example, in my use case, we use GitHub packages to serve our internal packages, so we need to set the publishConfig manually on the generated manifest to be able to publish to GitHub. I know we can also use an .npmrc file, but, to me, the issue is the same: the source of truth should be defined in the base code, juste like repository or author values.

Also, scope of the package could be defined in these fields, so it can be kept in source control rather than a flag passed on the command line (command line flag could still be available, but would overwrite value if present, for example).

I don't know if it makes sense to you, but we could add a new section in Cargo.toml (e.g. [package.wasm-pack.extra]) that the build step would use and then output in the package.json.
Maybe scope would be best located under [package] though, closer to the actual package name.

I'm still learning Rust, but if you guys are interested, I could make a PR to implement this feature.

Thanks!

@pevers
Copy link

pevers commented Mar 31, 2021

I would love to have this as well. At the moment I have a bash script that is doing this:

#!/bin/bash
wasm-pack build --release --target bundler
jq '. |= . + {"publishConfig": {"registry": "https://my-private-registry/"}}' pkg/package.json

But it would be nice to have it as a wasm-pack feature.

vectronic added a commit to flowscripter/.github that referenced this issue Mar 4, 2022
vectronic added a commit to flowscripter/.github that referenced this issue Mar 8, 2022
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

2 participants