Add `Package::from_wit` convenience
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by comparing the existing wac_cli handling of wit_parser files and directories with the wac_types::Package::from_bytes path shown in the issue. Add a convenience entry point that covers both input forms and produces the equivalent package; verify that the resulting package matches the current manual sequence.
Written by the indexing model from the issue text.
Description
It would be nice to have some sort of convenience for declaring a wac_types::Package from wit files.
Essentially replacing this code:
let mut resolve = wit_parser::Resolve::new();
let pkg = if path.is_dir()
let (pkg, _) = resolve.push_dir(path)?;
pkg
} else {
let unresolved = wit_parser::UnresolvedPackage::parse_file(&path)?;
resolve.push(unresolved)?
};
let bytes = wit_component::encode(Some(true), &resolve, pkg)?;
wac_graph::types::Package::from_bytes(
name,
None,
bytes.to_owned(),
types,
)
Of course, this ties wac_types to the convention from wit_parser, but the wac_cli already does this, so I don't see why it would be inappropriate in wac_types.
- Dominant language
- Rust
- Stars
- 207
- Forks
- 41
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytecodealliance/wac
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
bytecodealliance/wac#181 · 7 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
bytecodealliance/wac#170 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
bytecodealliance/wac#169 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
bytecodealliance/wac#166 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
bytecodealliance/wac#165 ·
All issues in bytecodealliance/wac
Similar issues
-
contribution
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tree-sitter/tree-sitter#6005 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
maplibre/maplibre-tile-spec#1844 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-windowing/winit#4731 ·
Maintainers usually reply within 2 days