From 9180a9b5591a6aa374ea752aa5f84001536fe154 Mon Sep 17 00:00:00 2001 From: Zach Fedor Date: Tue, 3 Nov 2026 12:27:23 -0500 Subject: [PATCH] fix: link workspace packages in generated pnpm-workspace.yml --- .../stellar-scaffold-cli/src/commands/init/instantiate.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/stellar-scaffold-cli/src/commands/init/instantiate.rs b/crates/stellar-scaffold-cli/src/commands/init/instantiate.rs index 0976e268..6a5e8f64 100644 --- a/crates/stellar-scaffold-cli/src/commands/init/instantiate.rs +++ b/crates/stellar-scaffold-cli/src/commands/init/instantiate.rs @@ -243,6 +243,10 @@ fn rewrite_root_workspaces(root: &Path) -> Result<(), Error> { /// pnpm-workspace.yaml contents mirroring the instantiated workspaces. pnpm /// reads workspace globs from this file rather than `package.json`. +/// +/// `linkWorkspacePackages` is required because templates depend on +/// `@stellar-scaffold/app-lib` via `"*"` (parsable by npm rather than pnpm's +/// preferred `"workspace:*"`). Newer versions of pnpm default to false. fn pnpm_workspace_yaml() -> String { let mut out = String::from("packages:\n"); for ws in INSTANTIATED_WORKSPACES { @@ -250,6 +254,7 @@ fn pnpm_workspace_yaml() -> String { out.push_str(ws); out.push_str("\"\n"); } + out.push_str("linkWorkspacePackages: true\n"); out } @@ -553,6 +558,8 @@ mod tests { assert!(yaml.contains("- \"app\"")); assert!(yaml.contains("- \"app-lib\"")); assert!(yaml.contains("- \"app-lib/clients/*\"")); + // the leading `\n` ensures this is a top-level key, not nested under packages + assert!(yaml.contains("\nlinkWorkspacePackages: true\n")); let config = fs::read_to_string(root.join("scaffold.yml")).unwrap(); assert!(config.contains(" contracts-dir: contracts\n package-manager: pnpm@1.2.3\n"));