Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
add start and dev scripts, only install the main tscircuit package
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Mar 19, 2024
1 parent a3d8a90 commit 21f0034
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/cmd-fns/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,20 @@ 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
const packageJson = JSON.parse(readFileSync("package.json", "utf-8"))
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",
Expand Down

0 comments on commit 21f0034

Please sign in to comment.