Make Camino examples and scaffolds complete Yarn and Nix packages

This commit is contained in:
Timothy J. Aveni
2026-09-22 14:42:54 -07:00
parent 0da022e216
commit 785c54992f
8 changed files with 164 additions and 20 deletions
+6 -1
View File
@@ -23,7 +23,12 @@ const writable = async (directory) => {
}
};
await writable(work);
await fs.writeFile(path.join(work, "package.json"), JSON.stringify({ type: "module" }));
const packageFile = path.join(work, "package.json");
const metadata = await fs.readFile(packageFile, "utf8").then(JSON.parse, (error) => {
if (error.code === "ENOENT") return {};
throw error;
});
await fs.writeFile(packageFile, JSON.stringify({ ...metadata, type: "module" }));
if (config.dependencies) await fs.symlink(config.dependencies, path.join(work, "node_modules"));
const members = Object.create(null);
let index = 0;