I guess put tsconfig EVERYWHERE
This commit is contained in:
parent
3d19a34dd5
commit
af2c8b8f4e
|
|
@ -8,15 +8,16 @@ import { NOSE_DIR } from "@/config"
|
||||||
import load from "./load"
|
import load from "./load"
|
||||||
|
|
||||||
export default function (project: string) {
|
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`
|
if (projects().includes(project)) throw `${project} already exists`
|
||||||
|
|
||||||
const dir = join(NOSE_DIR, project)
|
const dir = join(NOSE_DIR, project)
|
||||||
mkdirSync(join(dir, "bin"), { recursive: true })
|
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, "bin", `${project}.ts`), `export default function() {\n return "The ${project} project lives!"\n}`)
|
||||||
|
writeFileSync(join(dir, "tsconfig.json"), `{ "extends": "../tsconfig.json", "include": ["./**/*"] }`)
|
||||||
|
|
||||||
load(project)
|
load(project)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user