Skip to content

Implement support for RFC 8, transitive NPM dependencies #606

Closed
@alexcrichton

Description

@alexcrichton

Specified upstream RFC 8 is a way for NPM dependencies to work transitively throughout the crate graph. The first phase of supporting this is now implemented in wasm-bindgen and the next phase is in wasm-pack itself. Thankfully it shouldn't be too hard!

Currently today wasm-pack will write out a package.json, but this will overwrite a package.json created by wasm-bindgen, if one exists. Instead what wasm-pack should do is:

  • When creating package.json, first check to see if one already exists at the target location
  • Deserialize the dependencies map, if it exists, otherwise start with an empty object
  • Add in all the current configuration (name, scope, urls, etc)
  • Write out the package.json again, overwriting what was previously there.

Basically the package.json that wasm-pack writes should just be merged with the package.json emitted by wasm-bindgen if it's already there.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions