Compare commits
2 Commits
84b001e651
...
af2c8b8f4e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af2c8b8f4e | ||
|
|
3d19a34dd5 |
|
|
@ -8,15 +8,16 @@ import { NOSE_DIR } from "@/config"
|
|||
import load from "./load"
|
||||
|
||||
export default function (project: string) {
|
||||
if (!project) throw "usage: new <project name>"
|
||||
if (!project) throw "usage: mkproject <project name>"
|
||||
|
||||
if (projects().includes(project)) throw `${project} already exists`
|
||||
|
||||
const dir = join(NOSE_DIR, project)
|
||||
mkdirSync(join(dir, "bin"), { recursive: true })
|
||||
|
||||
writeFileSync(join(dir, `index.tsx`), `export default (c: Context) =>\n "Hello from the ${project} project!"`)
|
||||
writeFileSync(join(dir, "index.tsx"), `export default (c: Context) =>\n "Hello from the ${project} project!"`)
|
||||
writeFileSync(join(dir, "bin", `${project}.ts`), `export default function() {\n return "The ${project} project lives!"\n}`)
|
||||
writeFileSync(join(dir, "tsconfig.json"), `{ "extends": "../tsconfig.json", "include": ["./**/*"] }`)
|
||||
|
||||
load(project)
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
export type { Context } from "hono"
|
||||
export type { FC as Component } from "hono/jsx"
|
||||
|
||||
export { routes, css, js } from "./helpers"
|
||||
Loading…
Reference in New Issue
Block a user