change init

This commit is contained in:
nvms 2024-10-13 19:05:26 -04:00
parent 9ec632ec2d
commit 76d0188dc4

View File

@ -12,12 +12,12 @@ var indexHtml = `<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark">
<title>Application</title> <title>Application</title>
{{ css }} {{ css }}
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
{{ livereload }} {{ livereload }}
{{ js }} {{ js }}
</body> </body>
</html>` </html>`
@ -55,18 +55,18 @@ func CreateDefaultPackageJson() string {
} }
return `{ return `{
"name": "` + filepath.Base(cwd) + `", "name": "` + filepath.Base(cwd) + `",
"version": "0.0.1", "version": "0.0.1",
"scripts": { "scripts": {
"serve": "esr --serve src/index.ts", "serve": "esr --serve src/index.ts",
"build": "esr --build src/index.ts", "build": "esr --build src/index.ts",
"build:watch": "esr --build --watch src/index.ts", "build:watch": "esr --build --watch src/index.ts",
"run": "esr --run src/index.ts", "run": "esr --run src/index.ts",
"run:watch": "esr --run --watch src/index.ts" "run:watch": "esr --run --watch src/index.ts"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC" "license": "ISC"
}` }`
} }
@ -119,7 +119,9 @@ func InitProject() {
if err := os.WriteFile(tsconfigJsonPath, []byte(`{ if err := os.WriteFile(tsconfigJsonPath, []byte(`{
"compilerOptions": { "compilerOptions": {
"module": "ES2022", "module": "ES2022",
"target": "ESNext" "target": "ESNext",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
} }
}`), 0644); err != nil { }`), 0644); err != nil {
Die("failed to write tsconfig.json: %v", err) Die("failed to write tsconfig.json: %v", err)