diff --git a/src/cli.ts b/src/cli.ts index 23bbefc..2dd42f5 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -62,7 +62,7 @@ Usage: wspace validate Options: - --manifest Manifest path (default: wspace.json / workspace.json / repos.json) + --manifest Manifest path (default: workspace.json / wspace.json / repos.json) --json Machine-readable output --stale Filter worktrees fully merged into origin/ (or missing branch) --dry-run Preview environment sync operations without modifying files diff --git a/src/manifest.ts b/src/manifest.ts index ea4bcf0..5e0c411 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -4,8 +4,8 @@ import type { RepositoryEntry, WorkspaceManifest } from "./types.ts"; export const CURRENT_SCHEMA_VERSION = 1; export const DEFAULT_MANIFEST_FILENAMES = [ - "wspace.json", "workspace.json", + "wspace.json", "repos.json", ]; diff --git a/tests/manifest_test.ts b/tests/manifest_test.ts index d40de45..6516a0c 100644 --- a/tests/manifest_test.ts +++ b/tests/manifest_test.ts @@ -85,13 +85,13 @@ Deno.test("validateManifest rejects invalid repo names or traversal", () => { ); }); -Deno.test("findDefaultManifestPath respects fallback order wspace.json -> workspace.json -> repos.json", async () => { +Deno.test("findDefaultManifestPath respects fallback order workspace.json -> wspace.json -> repos.json", async () => { const tempDir = await Deno.makeTempDir(); try { - // When no manifest exists, defaults to wspace.json + // When no manifest exists, defaults to workspace.json assertEquals( await findDefaultManifestPath(tempDir), - join(tempDir, "wspace.json"), + join(tempDir, "workspace.json"), ); // If repos.json exists, resolves repos.json @@ -99,15 +99,15 @@ Deno.test("findDefaultManifestPath respects fallback order wspace.json -> worksp await Deno.writeTextFile(reposPath, "{}"); assertEquals(await findDefaultManifestPath(tempDir), reposPath); - // If workspace.json exists, takes priority over repos.json - const workspacePath = join(tempDir, "workspace.json"); - await Deno.writeTextFile(workspacePath, "{}"); - assertEquals(await findDefaultManifestPath(tempDir), workspacePath); - - // If wspace.json exists, takes top priority + // If wspace.json exists, takes priority over repos.json const wspacePath = join(tempDir, "wspace.json"); await Deno.writeTextFile(wspacePath, "{}"); assertEquals(await findDefaultManifestPath(tempDir), wspacePath); + + // If workspace.json exists, takes top priority + const workspacePath = join(tempDir, "workspace.json"); + await Deno.writeTextFile(workspacePath, "{}"); + assertEquals(await findDefaultManifestPath(tempDir), workspacePath); } finally { await Deno.remove(tempDir, { recursive: true }); }