Make Camino examples and scaffolds complete Yarn and Nix packages
This commit is contained in:
@@ -28,7 +28,7 @@ type Change = { file: string; before: string | null; after: string; mode: number
|
||||
type Journal = { schemaVersion: 1; id: string; root: string; phase: "prepared" | "complete"; changes: Change[] };
|
||||
const safeFile = (file: string) => {
|
||||
if (
|
||||
!/^(?:[A-Za-z0-9_-][A-Za-z0-9_.-]*\/)*(?:\.gitignore|\.yarnrc.yml|[A-Za-z0-9_-][A-Za-z0-9_.-]*\.(?:qx|graphql|lock|ts|tsx|css|mjs|json|nix|txtpb|md))$/.test(
|
||||
!/^(?:[A-Za-z0-9_-][A-Za-z0-9_.-]*\/)*(?:\.gitignore|\.yarnrc\.yml|\.yarn\/plugins\/[A-Za-z0-9_-][A-Za-z0-9_.-]*\.cjs|[A-Za-z0-9_-][A-Za-z0-9_.-]*\.(?:qx|graphql|lock|ts|tsx|css|mjs|json|nix|txtpb|md))$/.test(
|
||||
file,
|
||||
) ||
|
||||
file.split("/").some((part) => [".git", ".jj", ".quixos", "node_modules"].includes(part))
|
||||
@@ -141,7 +141,7 @@ export const planStructure = async (rootPath: string, request: StructuralRequest
|
||||
for (const change of changes) {
|
||||
if (change.file.endsWith(".qx") && parseQx(change.after, change.file).diagnostics.length)
|
||||
throw new Error(`Invalid QX syntax in ${change.file}`);
|
||||
if (change.file.endsWith(".lock") && !parseQuixosLockDocument(change.after, change.file).ok)
|
||||
if (path.basename(change.file) === "quixos.lock" && !parseQuixosLockDocument(change.after, change.file).ok)
|
||||
throw new Error(`Invalid lock syntax in ${change.file}`);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user