Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Usage:
wspace validate

Options:
--manifest <path> Manifest path (default: wspace.json / workspace.json / repos.json)
--manifest <path> Manifest path (default: workspace.json / wspace.json / repos.json)
--json Machine-readable output
--stale Filter worktrees fully merged into origin/<default> (or missing branch)
--dry-run Preview environment sync operations without modifying files
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
];

Expand Down
18 changes: 9 additions & 9 deletions tests/manifest_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,29 @@ 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
const reposPath = join(tempDir, "repos.json");
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 });
}
Expand Down
Loading