Lines 1–10 at 318 (were 1–10 at 5)
11// Create the project from its first files. Writes go through InitHost; today 22// the host is Project. 4−import { type AttrSet, buildBase, canonicalText, type View } from "../../src/engine/index.ts";
4+import { type AttrSet, buildBase, canonicalText, type ReadView } from "../../src/engine/index.ts"; 55import { checkPath } from "./path-rules.ts"; 66import { ProjectError } from "./project-error.ts"; 7−import { configProblem } from "./project-helpers.ts";
7+import { configProblem, PROJECT_FILES, projectFileOf } from "./project-helpers.ts"; 88import type { Entry, Modes, ProjectOptions } from "./project-types.ts"; 99import { clashInPaths } from "./spelling.ts"; 1010import { checkModes } from "./view-changes.ts"; Lines 16–22 at 318 (were 16–22 at 5)
1717 files: Readonly<Record<string, string | null>>, 1818 blobs: Readonly<Record<string, string>>, 19− view: View | undefined,
19+ view: ReadView | undefined, 2121 ): { files: Record<string, string | null>; blobs: Record<string, string> }; 2222 checkBlobs(blobs: unknown, files: object): Record<string, string>; Lines 35–47 at 318 (were 35–45 at 5)
3535 if (typeof files !== "object" || files === null) throw new ProjectError("bad-request", "init needs {files}"); 3636 const clash = clashInPaths([...new Set([...Object.keys(files), ...Object.keys(blobs)])].toSorted()); 3737 if (clash) throw new ProjectError("bad-request", `init: ${clash} (#49)`); 38− const config = typeof files["avcs.json"] === "string" ? configProblem(files["avcs.json"]) : undefined;
39− if (config) throw new ProjectError("bad-request", `init: avcs.json ${config}`);
38+ for (const name of PROJECT_FILES) { 39+ const config = typeof files[name] === "string" ? configProblem(files[name]) : undefined; 40+ if (config) throw new ProjectError("bad-request", `init: ${name} ${config}`); 4143 // The project file being created says which paths are whole (#46). 42− const config = typeof files["avcs.json"] === "string" ? files["avcs.json"] : undefined;
44+ const config = projectFileOf(files)?.text; 4345 ({ files, blobs } = host.wholeOut(files, blobs, undefined, config) as { 4446 files: Record<string, string>; 4547 blobs: Record<string, string>;