diff --git a/.llm/BETA_5_PACKAGE_WORKSPACE_DISCIPLINE.md b/.llm/BETA_5_PACKAGE_WORKSPACE_DISCIPLINE.md index 04e3ffe..4b17f82 100644 --- a/.llm/BETA_5_PACKAGE_WORKSPACE_DISCIPLINE.md +++ b/.llm/BETA_5_PACKAGE_WORKSPACE_DISCIPLINE.md @@ -21,6 +21,8 @@ ABI promise. - Diagnose duplicate workspace members after path normalization before package loading. - 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. ## Acceptance Gates @@ -28,6 +30,7 @@ ABI promise. - `cargo test --test project_mode workspace_default_package` - `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 new_workspace_template` - `cargo fmt --check` - `git diff --check` diff --git a/README.md b/README.md index cbeed97..2282bc9 100644 --- a/README.md +++ b/README.md @@ -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. Duplicate normalized workspace members and missing default-package references are now dedicated diagnostics. `glagol doc -o ` includes a -workspace package/dependency summary. Remote registries, lockfiles, -semantic-version solving, package publishing, and stable package ABI/layout -remain deferred. +workspace package/dependency summary. New workspace templates declare +`default_package = "app"`. Remote registries, lockfiles, semantic-version +solving, package publishing, and stable package ABI/layout remain deferred. ## Documentation diff --git a/compiler/src/scaffold.rs b/compiler/src/scaffold.rs index 13bfc67..6cca46a 100644 --- a/compiler/src/scaffold.rs +++ b/compiler/src/scaffold.rs @@ -121,7 +121,7 @@ fn create_workspace_project(root: &Path, target: &str) -> Result<(), Diagnostic> create_dir_all_checked(&lib_src, target)?; write_checked( &root.join("slovo.toml"), - "[workspace]\nmembers = [\"packages/app\", \"packages/libutil\"]\n", + "[workspace]\nmembers = [\"packages/app\", \"packages/libutil\"]\ndefault_package = \"app\"\n", target, )?; write_checked( diff --git a/compiler/tests/dx_v1_7.rs b/compiler/tests/dx_v1_7.rs index 66f9f60..c5aede5 100644 --- a/compiler/tests/dx_v1_7.rs +++ b/compiler/tests/dx_v1_7.rs @@ -228,7 +228,7 @@ fn new_workspace_template_creates_local_package_workspace() { assert_success("glagol new --template workspace", &output); assert_eq!( 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/libutil/slovo.toml").is_file()); diff --git a/docs/compiler/RELEASE_NOTES.md b/docs/compiler/RELEASE_NOTES.md index a7f4100..69753f3 100644 --- a/docs/compiler/RELEASE_NOTES.md +++ b/docs/compiler/RELEASE_NOTES.md @@ -20,6 +20,8 @@ integration/readiness release, not the first real beta. that lacks its entry module with `WorkspaceDefaultPackageEntryMissing`. - `glagol doc -o ` now includes a deterministic workspace 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 diff --git a/docs/language/RELEASE_NOTES.md b/docs/language/RELEASE_NOTES.md index 0f34a77..7ea88ed 100644 --- a/docs/language/RELEASE_NOTES.md +++ b/docs/language/RELEASE_NOTES.md @@ -28,6 +28,8 @@ diagnostics bundle. `WorkspaceDefaultPackageEntryMissing` during build/run. - Workspace documentation generated by `glagol doc` now includes a 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 diff --git a/docs/language/examples/workspaces/exp-5-local/slovo.toml b/docs/language/examples/workspaces/exp-5-local/slovo.toml index 13f7ff8..8bbafd2 100644 --- a/docs/language/examples/workspaces/exp-5-local/slovo.toml +++ b/docs/language/examples/workspaces/exp-5-local/slovo.toml @@ -1,2 +1,3 @@ [workspace] members = ["packages/app", "packages/mathlib"] +default_package = "app" diff --git a/examples/workspaces/exp-5-local/slovo.toml b/examples/workspaces/exp-5-local/slovo.toml index 13f7ff8..8bbafd2 100644 --- a/examples/workspaces/exp-5-local/slovo.toml +++ b/examples/workspaces/exp-5-local/slovo.toml @@ -1,2 +1,3 @@ [workspace] members = ["packages/app", "packages/mathlib"] +default_package = "app"