From 76d0188dc4ed9d5661afa985d59d714452645b8d Mon Sep 17 00:00:00 2001 From: nvms Date: Sun, 13 Oct 2024 19:05:26 -0400 Subject: [PATCH] change init --- internal/esr/init.go | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/internal/esr/init.go b/internal/esr/init.go index 834e043..0fee375 100644 --- a/internal/esr/init.go +++ b/internal/esr/init.go @@ -12,12 +12,12 @@ var indexHtml = ` Application - {{ css }} + {{ css }} -
+
{{ livereload }} - {{ js }} + {{ js }} ` @@ -55,18 +55,18 @@ func CreateDefaultPackageJson() string { } return `{ - "name": "` + filepath.Base(cwd) + `", - "version": "0.0.1", - "scripts": { - "serve": "esr --serve src/index.ts", - "build": "esr --build src/index.ts", - "build:watch": "esr --build --watch src/index.ts", - "run": "esr --run src/index.ts", - "run:watch": "esr --run --watch src/index.ts" - }, - "keywords": [], - "author": "", - "license": "ISC" + "name": "` + filepath.Base(cwd) + `", + "version": "0.0.1", + "scripts": { + "serve": "esr --serve src/index.ts", + "build": "esr --build src/index.ts", + "build:watch": "esr --build --watch src/index.ts", + "run": "esr --run src/index.ts", + "run:watch": "esr --run --watch src/index.ts" + }, + "keywords": [], + "author": "", + "license": "ISC" }` } @@ -119,7 +119,9 @@ func InitProject() { if err := os.WriteFile(tsconfigJsonPath, []byte(`{ "compilerOptions": { "module": "ES2022", - "target": "ESNext" + "target": "ESNext", + "experimentalDecorators": true, + "emitDecoratorMetadata": true } }`), 0644); err != nil { Die("failed to write tsconfig.json: %v", err)