diff --git a/index.ts b/index.ts index f562a76..85c2fad 100644 --- a/index.ts +++ b/index.ts @@ -3,7 +3,7 @@ import * as p from "@clack/prompts"; import { initRenderer } from '@gregorlohaus/tdir' import { z } from 'zod' -import join from "node:path"; +import path from "node:path"; p.intro("create-glstack"); @@ -35,22 +35,22 @@ const project = await p.group( }, } ); -const createRenderer = initRenderer('./template') +const createRenderer = initRenderer(path.join(import.meta.dir, 'template')) const render = createRenderer(z.object({ project: z.object({ name: z.string(), goprefix: z.string() }) })) -const destDir = join.join("./",project.name); +const destDir = path.join("./",project.name); render(destDir,{project}) // TODO: template rendering — copy/generate files into destDir const s = p.spinner(); s.start("Installing dependencies"); -await Bun.$`bun install`.cwd(join.join(destDir)).quiet(); -await Bun.$`bun install`.cwd(join.join(destDir,'packages','rpc')).quiet(); -await Bun.$`bun install`.cwd(join.join(destDir,'apps','web')).quiet(); +await Bun.$`bun install`.cwd(path.join(destDir)).quiet(); +await Bun.$`bun install`.cwd(path.join(destDir,'packages','rpc')).quiet(); +await Bun.$`bun install`.cwd(path.join(destDir,'apps','web')).quiet(); s.stop("Dependencies installed."); p.outro("You're all set!"); diff --git a/package.json b/package.json index 11bcd00..86f9e00 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "template" ], "scripts": { - "build": "bun build ./index.ts --outdir ./dist --target node", + "build": "bun build ./index.ts --outdir ./dist --target bun", "prepublishOnly": "bun run build" }, "devDependencies": {