feat: custom registries for targets in cargo-component new #400
+328
−111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds support for using custom registries with targets when performing
cargo component new. Users can specify a registry URI likeoci://ghcr.ioalong with a registry namespace prefix likebytecodeallianceand get easy access to packages (e.g.docs:adder) that are provided therein.NOTE This PR relies on a related one in wasm-pkg-tools
Until that PR is merged, the Cargo.toml in use here can't be updated to remove the pointer to my fork.
An example invocation:
While this invocation seems long, it is much shorter than configuring other tooling, and serves as a decent option for quickstarts IMO.
The one thing left to solve in this issue is how to enable cargo component to pull from namespace registry overrides from via it's own config (or alternatively, create a
wkg.toml)