Skip to content

feat(wkg,core,client): intial wkg workspace approach#231

Open
mkatychev wants to merge 12 commits into
mainfrom
mkatychev/feat/wkg-workspaces
Open

feat(wkg,core,client): intial wkg workspace approach#231
mkatychev wants to merge 12 commits into
mainfrom
mkatychev/feat/wkg-workspaces

Conversation

@mkatychev

@mkatychev mkatychev commented Jul 10, 2026

Copy link
Copy Markdown
Member

PR adds initial workspace support for wkg fetch and wkg publish

Introduced WorkspaceConfig to manage workspace configurations in manifests:

pub enum WorkspaceConfig {
// `[workspace]`
Root(WorkspaceRootConfig),
// - `workspace = "path/to/workspace/root"`
// - TODO(mkatychev): implement workspace package level field
// - https://doc.rust-lang.org/cargo/reference/manifest.html#the-workspace-field
// Member {
// root: Option<String>,
// },
}

WorkspaceRootConfig added as a virtual-manifest stand-in:

pub struct WorkspaceRootConfig {
#[serde(default, skip)]
pub(super) root_dir: PathBuf,
pub members: Vec<PathBuf>,
pub metadata: Option<Metadata>,
}

@mkatychev mkatychev force-pushed the mkatychev/feat/wkg-workspaces branch from 780ef2a to 16c8e3a Compare July 10, 2026 19:28
mkatychev added a commit that referenced this pull request Jul 11, 2026
Split changes from
#231 in
preparation for `WorkspaceConfig`/`WorkspaceRootConfig` additions.

* added `PackageRef` to `Error::VersionAlreadyExists`:

https://github.com/bytecodealliance/wasm-pkg-tools/blob/068a2b321d5680db9829323eac1741839b90c39a/crates/wasm-pkg-common/src/lib.rs#L58-L59
* introduce `pub const WIT_DEPS_DIR`:

https://github.com/bytecodealliance/wasm-pkg-tools/blob/068a2b321d5680db9829323eac1741839b90c39a/crates/wasm-pkg-core/src/wit.rs#L31-L32
* add `PublishVerifier` to reuse logic between current multi package
publishing eventual workspace fetching found in
#231:

https://github.com/bytecodealliance/wasm-pkg-tools/blob/790b44cbea5cd24a57f448ca86a624dcc52eb426/crates/wkg/src/overlay.rs#L21-L31
/// A `false` return does NOT mean the package is definitely not a member -
/// it could still be a member via path dependencies. Callers should fallback
/// to full workspace loading when this returns `false`.
// FIXME: implement cargo WorkspaceRootConfig::{member_paths, expand_member_path}

@mkatychev mkatychev Jul 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current workspace members are eagerly evaluated to this functions more like is_member for the moment, I can implement the member_paths and expand_member_path functionality here or in a follow-up. The distinction should not matter until WorkspaceConfig::Member is implemented.

@mkatychev mkatychev force-pushed the mkatychev/feat/wkg-workspaces branch from 94bfd28 to 1367cc3 Compare July 11, 2026 14:01
@mkatychev mkatychev force-pushed the mkatychev/feat/wkg-workspaces branch from cf99224 to b562b52 Compare July 11, 2026 14:13
@mkatychev mkatychev force-pushed the mkatychev/feat/wkg-workspaces branch from 8f168c9 to 574197c Compare July 11, 2026 15:01
@mkatychev mkatychev marked this pull request as ready for review July 11, 2026 15:13
@mkatychev mkatychev requested a review from vados-cosmonic July 11, 2026 15:15
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

Successfully merging this pull request may close these issues.

1 participant