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

Add config file option to set default scope flag #1412

Open
mattrunyon opened this issue Jul 13, 2024 · 0 comments
Open

Add config file option to set default scope flag #1412

mattrunyon opened this issue Jul 13, 2024 · 0 comments

Comments

@mattrunyon
Copy link

💡 Feature description

From what I can find in the docs, the only way to set the package scope when building is via the CLI flag. This could be error prone in a repo as any script that calls build for different reasons needs to specify the scope and not mess it up.

This is contrasted by the package name being read from Cargo.toml. Scope is effectively part of the package name in npm. I don't think I've ever seen publishing the same package under multiple scopes unless the organization changed their name/scope and the old one is marked as deprecated. To me, it doesn't make sense that scope would not be part of Cargo.toml just like name is.

💻 Basic example

Something like this should produce a package.json with @my-scope/my-package as the package name when running wasm-pack build without the --scope flag. I have little experience in Rust config, so no idea if package is the right section here

[package]
name = "my-package"
scope = "my-scope"
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