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

Support custom section in Cargo.toml, ex. [wasm] #707

Closed
barabadzhi opened this issue Aug 22, 2019 · 2 comments · Fixed by #838
Closed

Support custom section in Cargo.toml, ex. [wasm] #707

barabadzhi opened this issue Aug 22, 2019 · 2 comments · Fixed by #838

Comments

@barabadzhi
Copy link

💡 Feature description

Prequel: The original issue I had faced was wasm-pack not pulling keywords from Cargo.toml into generated package.json. This affects the visibility of the package in the registry. The solution so far is manual editing of package.json which is not ideal, imho.

Idea evolution: Why not to add support for a custom [wasm] (or [package.wasm]) section to Cargo.toml? This can be a set of key/value pairs to put into generated package.json. It can even help overriding same-name field from [package] specifically for wasm target.

💻 Basic example

[package]
name = "my-lib" # this name will be used on crates.io
                # package may be used as a native lib without possible confusion
[package.wasm]
name = "my-lib-wasm" # override, this name will be used on npm
keywords = ["one", "two", "three"] # original to generated package.json

What do you think?

PS: Would be happy to pick this one up 🤓

@barabadzhi barabadzhi changed the title Support custom section in Cargo.toml, ex. [wasm] [feature] Support custom section in Cargo.toml, ex. [wasm] Aug 22, 2019
@barabadzhi barabadzhi changed the title [feature] Support custom section in Cargo.toml, ex. [wasm] Support custom section in Cargo.toml, ex. [wasm] Aug 30, 2019
@suyoshi
Copy link

suyoshi commented Sep 1, 2019

Yeah, that's a great idea. 👍

@lucashorward lucashorward mentioned this issue May 3, 2020
3 tasks
@Pauan Pauan closed this as completed in #838 May 4, 2020
Pauan added a commit that referenced this issue May 4, 2020
@ijc
Copy link

ijc commented Jul 7, 2021

[package.wasm]
name = "my-lib-wasm" # override, this name will be used on npm

This bit wasn't done in #838, the keywords were just added to the [package] section. Should this issue be reopened?

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

Successfully merging a pull request may close this issue.

4 participants