Use default package in workspace templates

This commit is contained in:
sanjin 2026-05-22 13:19:00 +02:00
parent 0337974923
commit 60d1d0f8a3
8 changed files with 14 additions and 5 deletions

View File

@ -21,6 +21,8 @@ ABI promise.
- Diagnose duplicate workspace members after path normalization before package - Diagnose duplicate workspace members after path normalization before package
loading. loading.
- Add workspace package and dependency summaries to `glagol doc`. - Add workspace package and dependency summaries to `glagol doc`.
- Teach generated workspace templates and canonical workspace examples to
declare `default_package = "app"`.
- Keep dependency resolution local-path-only and deterministic. - Keep dependency resolution local-path-only and deterministic.
## Acceptance Gates ## Acceptance Gates
@ -28,6 +30,7 @@ ABI promise.
- `cargo test --test project_mode workspace_default_package` - `cargo test --test project_mode workspace_default_package`
- `cargo test --test project_mode workspace_package_boundaries` - `cargo test --test project_mode workspace_package_boundaries`
- `cargo test --test dx_v1_7 doc_generates_workspace_package_summary` - `cargo test --test dx_v1_7 doc_generates_workspace_package_summary`
- `cargo test --test dx_v1_7 new_workspace_template`
- `cargo fmt --check` - `cargo fmt --check`
- `git diff --check` - `git diff --check`

View File

@ -157,9 +157,9 @@ Local workspaces may declare `[workspace] default_package = "name"` to select
the build/run entry package when multiple packages have entry modules. the build/run entry package when multiple packages have entry modules.
Duplicate normalized workspace members and missing default-package references Duplicate normalized workspace members and missing default-package references
are now dedicated diagnostics. `glagol doc <workspace> -o <dir>` includes a are now dedicated diagnostics. `glagol doc <workspace> -o <dir>` includes a
workspace package/dependency summary. Remote registries, lockfiles, workspace package/dependency summary. New workspace templates declare
semantic-version solving, package publishing, and stable package ABI/layout `default_package = "app"`. Remote registries, lockfiles, semantic-version
remain deferred. solving, package publishing, and stable package ABI/layout remain deferred.
## Documentation ## Documentation

View File

@ -121,7 +121,7 @@ fn create_workspace_project(root: &Path, target: &str) -> Result<(), Diagnostic>
create_dir_all_checked(&lib_src, target)?; create_dir_all_checked(&lib_src, target)?;
write_checked( write_checked(
&root.join("slovo.toml"), &root.join("slovo.toml"),
"[workspace]\nmembers = [\"packages/app\", \"packages/libutil\"]\n", "[workspace]\nmembers = [\"packages/app\", \"packages/libutil\"]\ndefault_package = \"app\"\n",
target, target,
)?; )?;
write_checked( write_checked(

View File

@ -228,7 +228,7 @@ fn new_workspace_template_creates_local_package_workspace() {
assert_success("glagol new --template workspace", &output); assert_success("glagol new --template workspace", &output);
assert_eq!( assert_eq!(
fs::read_to_string(workspace.join("slovo.toml")).expect("read workspace manifest"), fs::read_to_string(workspace.join("slovo.toml")).expect("read workspace manifest"),
"[workspace]\nmembers = [\"packages/app\", \"packages/libutil\"]\n" "[workspace]\nmembers = [\"packages/app\", \"packages/libutil\"]\ndefault_package = \"app\"\n"
); );
assert!(workspace.join("packages/app/slovo.toml").is_file()); assert!(workspace.join("packages/app/slovo.toml").is_file());
assert!(workspace.join("packages/libutil/slovo.toml").is_file()); assert!(workspace.join("packages/libutil/slovo.toml").is_file());

View File

@ -20,6 +20,8 @@ integration/readiness release, not the first real beta.
that lacks its entry module with `WorkspaceDefaultPackageEntryMissing`. that lacks its entry module with `WorkspaceDefaultPackageEntryMissing`.
- `glagol doc <workspace> -o <dir>` now includes a deterministic workspace - `glagol doc <workspace> -o <dir>` now includes a deterministic workspace
summary with members, packages, and local package dependency edges. summary with members, packages, and local package dependency edges.
- `glagol new --template workspace` and the canonical local workspace examples
now declare `default_package = "app"`.
## 1.0.0-beta.4 ## 1.0.0-beta.4

View File

@ -28,6 +28,8 @@ diagnostics bundle.
`WorkspaceDefaultPackageEntryMissing` during build/run. `WorkspaceDefaultPackageEntryMissing` during build/run.
- Workspace documentation generated by `glagol doc` now includes a - Workspace documentation generated by `glagol doc` now includes a
deterministic summary of members, packages, and local dependency edges. deterministic summary of members, packages, and local dependency edges.
- Generated workspace templates and the canonical local workspace examples now
declare `default_package = "app"`.
## 1.0.0-beta.4 ## 1.0.0-beta.4

View File

@ -1,2 +1,3 @@
[workspace] [workspace]
members = ["packages/app", "packages/mathlib"] members = ["packages/app", "packages/mathlib"]
default_package = "app"

View File

@ -1,2 +1,3 @@
[workspace] [workspace]
members = ["packages/app", "packages/mathlib"] members = ["packages/app", "packages/mathlib"]
default_package = "app"