From 21f0034fc6bc4462e249584e9b9483c105821995 Mon Sep 17 00:00:00 2001 From: seveibar Date: Tue, 19 Mar 2024 09:08:49 -0700 Subject: [PATCH] add start and dev scripts, only install the main tscircuit package --- lib/cmd-fns/init/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/cmd-fns/init/index.ts b/lib/cmd-fns/init/index.ts index e6254f79..ec4bb44b 100644 --- a/lib/cmd-fns/init/index.ts +++ b/lib/cmd-fns/init/index.ts @@ -75,7 +75,7 @@ export const initCmd = async (ctx: AppContext, args: any) => { } // TODO just allow adding "tscircuit" in the future - await $`${pkm} add -D @tscircuit/react-fiber @tscircuit/builder` + await $`${pkm} add -D tscircuit` console.log("Changing package name...") // Change package.json "name" to params.name @@ -83,6 +83,12 @@ export const initCmd = async (ctx: AppContext, args: any) => { packageJson.name = params.name writeFileSync("package.json", JSON.stringify(packageJson, null, 2)) + console.log('Changing adding "start" and "dev" scripts...') + packageJson.scripts ??= {} + packageJson.scripts.start = "npm run dev" + packageJson.scripts.dev = "tsci dev" + writeFileSync("package.json", JSON.stringify(packageJson, null, 2)) + console.log(`Adding ".tscircuit" to .gitignore`) appendFileSync(".gitignore", "\n.tscircuit\n*.__tmp_entrypoint.tsx\ndist", { encoding: "utf-8",