@ykdz/template 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cli.js +94 -44
  2. package/dist/declarations.js +1 -1
  3. package/dist/devcontainer.d.ts +17 -0
  4. package/dist/devcontainer.d.ts.map +1 -0
  5. package/dist/devcontainer.js +23 -0
  6. package/dist/generation-context.d.ts +24 -0
  7. package/dist/generation-context.d.ts.map +1 -0
  8. package/dist/generation-context.js +12 -0
  9. package/dist/hono-api.d.ts +1 -0
  10. package/dist/hono-api.d.ts.map +1 -1
  11. package/dist/hono-api.js +63 -100
  12. package/dist/module-graph.d.ts +45 -0
  13. package/dist/module-graph.d.ts.map +1 -0
  14. package/dist/module-graph.js +187 -0
  15. package/dist/next-step-instructions.d.ts +22 -0
  16. package/dist/next-step-instructions.d.ts.map +1 -0
  17. package/dist/next-step-instructions.js +99 -0
  18. package/dist/package-addition.d.ts.map +1 -1
  19. package/dist/package-addition.js +31 -51
  20. package/dist/project-github.d.ts +36 -0
  21. package/dist/project-github.d.ts.map +1 -0
  22. package/dist/project-github.js +96 -0
  23. package/dist/renderer.d.ts +2 -0
  24. package/dist/renderer.d.ts.map +1 -1
  25. package/dist/renderer.js +7 -4
  26. package/dist/rust-bin.d.ts +7 -1
  27. package/dist/rust-bin.d.ts.map +1 -1
  28. package/dist/rust-bin.js +68 -66
  29. package/dist/toolchain-resolution.d.ts +35 -0
  30. package/dist/toolchain-resolution.d.ts.map +1 -0
  31. package/dist/toolchain-resolution.js +192 -0
  32. package/dist/ts-lib.d.ts +7 -1
  33. package/dist/ts-lib.d.ts.map +1 -1
  34. package/dist/ts-lib.js +95 -101
  35. package/dist/vue-app.d.ts +1 -0
  36. package/dist/vue-app.d.ts.map +1 -1
  37. package/dist/vue-app.js +78 -116
  38. package/dist/vue-hono-app.d.ts +3 -0
  39. package/dist/vue-hono-app.d.ts.map +1 -1
  40. package/dist/vue-hono-app.js +126 -170
  41. package/package.json +24 -16
  42. package/templates/hono-api/.github/dependabot.yml +10 -0
  43. package/templates/hono-api/.github/workflows/check.yml +19 -0
  44. package/templates/hono-api/src/server.ts +3 -2
  45. package/templates/hono-api/vitest.config.ts +5 -4
  46. package/templates/rust-bin/.github/dependabot.yml +14 -0
  47. package/templates/rust-bin/.github/workflows/check.yml +23 -0
  48. package/templates/shared/oxc/node/oxlint.config.ts +9 -0
  49. package/templates/shared/oxc/oxfmt.config.ts +8 -0
  50. package/templates/shared/oxc/package.json +18 -0
  51. package/templates/shared/oxc/tsconfig.json +11 -0
  52. package/templates/shared/oxc/vue/oxlint.config.ts +9 -0
  53. package/templates/ts-lib/.github/dependabot.yml +10 -0
  54. package/templates/ts-lib/.github/workflows/check.yml +19 -0
  55. package/templates/vue-app/.github/dependabot.yml +10 -0
  56. package/templates/vue-app/.github/workflows/check.yml +20 -0
  57. package/templates/vue-app/playwright.config.ts +5 -5
  58. package/templates/vue-app/src/App.vue +15 -5
  59. package/templates/vue-app/src/main.ts +2 -0
  60. package/templates/vue-app/test/app.test.ts +1 -0
  61. package/templates/vue-app/test/e2e/app.spec.ts +3 -1
  62. package/templates/vue-app/vite.config.ts +6 -5
  63. package/templates/vue-app/vitest.config.ts +5 -4
  64. package/templates/vue-hono-app/.github/dependabot.yml +10 -0
  65. package/templates/vue-hono-app/.github/workflows/check.yml +20 -0
  66. package/templates/vue-hono-app/api/src/server.ts +3 -2
  67. package/templates/vue-hono-app/api/vitest.config.ts +2 -2
  68. package/templates/vue-hono-app/web/playwright.config.ts +9 -7
  69. package/templates/vue-hono-app/web/src/App.vue +12 -4
  70. package/templates/vue-hono-app/web/src/api.ts +1 -1
  71. package/templates/vue-hono-app/web/src/main.ts +2 -0
  72. package/templates/vue-hono-app/web/test/app.test.ts +1 -0
  73. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +3 -1
  74. package/templates/vue-hono-app/web/vite.config.ts +13 -10
  75. package/templates/vue-hono-app/web/vitest.config.ts +6 -5
package/dist/ts-lib.js CHANGED
@@ -1,17 +1,47 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
+ import { nodePnpmDevcontainer } from "./devcontainer.js";
4
+ import { assembleGenerationContext } from "./generation-context.js";
5
+ import { planTsLibChecks, planTsLibFixes, renderFixCommand, renderRootCheckCommand, } from "./module-graph.js";
6
+ import { projectPresetDependabotConfig, projectTsLibGithubCheckWorkflow } from "./project-github.js";
3
7
  import { renderNewProject } from "./renderer.js";
8
+ import { resolveToolchainVersions } from "./toolchain-resolution.js";
4
9
  const generatedBy = {
5
10
  packageName: "@ykdz/template",
6
11
  version: "0.0.0",
7
- command: "template init --preset ts-lib"
12
+ command: "template init --preset ts-lib",
8
13
  };
9
- function projectNameFromDir(targetDir) {
10
- return path.basename(path.resolve(targetDir));
14
+ const tsLibBlueprint = {
15
+ schemaVersion: 1,
16
+ preset: "ts-lib",
17
+ packageManager: "pnpm",
18
+ projectKind: "single-package",
19
+ features: [
20
+ "pnpm-catalog",
21
+ "oxc-format-lint",
22
+ "strict-typescript",
23
+ "root-check",
24
+ "fix-command",
25
+ "devcontainer",
26
+ "github-actions",
27
+ "dependabot",
28
+ ],
29
+ };
30
+ export function projectTsLibPackageScripts() {
31
+ return {
32
+ build: "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
33
+ check: renderRootCheckCommand(planTsLibChecks()),
34
+ fix: renderFixCommand(planTsLibFixes()),
35
+ "format:check": "oxfmt --check .",
36
+ "format:write": "oxfmt --write .",
37
+ lint: "oxlint . --deny-warnings",
38
+ "lint:fix": "oxlint . --fix --deny-warnings",
39
+ typecheck: "tsc -p tsconfig.json --noEmit",
40
+ };
11
41
  }
12
- function packageJson(projectName) {
42
+ function packageJson(context) {
13
43
  return {
14
- name: projectName,
44
+ name: context.projectName.value,
15
45
  version: "0.0.0",
16
46
  private: true,
17
47
  files: ["dist"],
@@ -19,39 +49,40 @@ function packageJson(projectName) {
19
49
  exports: {
20
50
  ".": {
21
51
  default: "./dist/index.js",
22
- types: "./dist/index.d.ts"
23
- }
24
- },
25
- scripts: {
26
- build: "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
27
- check: "pnpm run typecheck && pnpm run lint && pnpm run format:check",
28
- fix: "pnpm run format:write && pnpm run lint:fix",
29
- "format:check": "oxfmt --check .",
30
- "format:write": "oxfmt --write .",
31
- lint: "oxlint . --deny-warnings",
32
- "lint:fix": "oxlint . --fix --deny-warnings",
33
- typecheck: "tsc -p tsconfig.json --noEmit"
52
+ types: "./dist/index.d.ts",
53
+ },
34
54
  },
55
+ scripts: projectTsLibPackageScripts(),
35
56
  devDependencies: {
36
57
  "@types/node": "catalog:",
37
58
  oxfmt: "catalog:",
38
59
  oxlint: "catalog:",
39
60
  "tsc-alias": "catalog:",
40
- typescript: "catalog:"
61
+ typescript: "catalog:",
41
62
  },
42
63
  engines: {
43
- node: ">=22.0.0"
64
+ node: context.toolchain.nodeLtsMajor.value,
44
65
  },
45
- packageManager: "pnpm@10.0.0"
66
+ packageManager: context.toolchain.packageManagerPin.value,
46
67
  };
47
68
  }
48
- function operationsForTsLib(projectName) {
69
+ function generationRecord(context) {
70
+ return {
71
+ ...generatedBy,
72
+ toolchain: {
73
+ nodeLtsMajor: context.toolchain.nodeLtsMajor.value,
74
+ packageManagerPin: context.toolchain.packageManagerPin.value,
75
+ source: context.toolchain.source,
76
+ },
77
+ };
78
+ }
79
+ function operationsForTsLib(context) {
49
80
  return [
50
81
  {
51
82
  kind: "writeJson",
52
83
  to: "package.json",
53
- value: packageJson(projectName),
54
- multilineArrays: ["files"]
84
+ value: packageJson(context),
85
+ multilineArrays: ["files"],
55
86
  },
56
87
  {
57
88
  kind: "writeText",
@@ -66,8 +97,8 @@ function operationsForTsLib(projectName) {
66
97
  " oxlint: ^1.71.0",
67
98
  " tsc-alias: ^1.8.17",
68
99
  " typescript: ^5.8.0",
69
- ""
70
- ].join("\n")
100
+ "",
101
+ ].join("\n"),
71
102
  },
72
103
  {
73
104
  kind: "writeJson",
@@ -81,46 +112,38 @@ function operationsForTsLib(projectName) {
81
112
  noEmitOnError: true,
82
113
  outDir: "dist",
83
114
  paths: {
84
- "@/*": ["./src/*"]
115
+ "@/*": ["./src/*"],
85
116
  },
86
117
  rootDir: "src",
87
118
  skipLibCheck: false,
88
119
  strict: true,
89
120
  target: "ES2022",
90
- types: ["node"]
121
+ types: ["node"],
91
122
  },
92
- include: ["src/**/*.ts"]
93
- }
123
+ include: ["src/**/*.ts"],
124
+ },
94
125
  },
95
126
  {
96
- kind: "writeJson",
97
- to: ".oxlintrc.json",
98
- value: {
99
- categories: {
100
- correctness: "error",
101
- suspicious: "error"
102
- },
103
- plugins: ["typescript", "oxc"]
104
- }
127
+ kind: "copyFile",
128
+ sourceRoot: "sharedOxc",
129
+ from: "node/oxlint.config.ts",
130
+ to: "oxlint.config.ts",
105
131
  },
106
132
  {
107
- kind: "writeJson",
108
- to: ".oxfmtrc.json",
109
- value: {
110
- printWidth: 100,
111
- singleQuote: false,
112
- trailingComma: "none"
113
- }
133
+ kind: "copyFile",
134
+ sourceRoot: "sharedOxc",
135
+ from: "oxfmt.config.ts",
136
+ to: "oxfmt.config.ts",
114
137
  },
115
138
  {
116
139
  kind: "writeText",
117
140
  to: ".gitignore",
118
- text: ["node_modules", "dist", ".env", ""].join("\n")
141
+ text: ["node_modules", "dist", ".env", ""].join("\n"),
119
142
  },
120
143
  {
121
144
  kind: "copyFile",
122
145
  from: "src/index.ts",
123
- to: "src/index.ts"
146
+ to: "src/index.ts",
124
147
  },
125
148
  {
126
149
  kind: "writeJson",
@@ -138,83 +161,54 @@ function operationsForTsLib(projectName) {
138
161
  "fix-command",
139
162
  "devcontainer",
140
163
  "github-actions",
141
- "dependabot"
142
- ]
143
- }
164
+ "dependabot",
165
+ ],
166
+ },
144
167
  },
145
168
  {
146
169
  kind: "writeJson",
147
170
  to: ".project-kit/generated-by.json",
148
- value: generatedBy
171
+ value: generationRecord(context),
149
172
  },
150
173
  {
151
174
  kind: "writeJson",
152
175
  to: ".devcontainer/devcontainer.json",
153
- value: {
154
- name: `${projectName} development`,
155
- image: "mcr.microsoft.com/devcontainers/typescript-node:22",
156
- postCreateCommand: "corepack enable && pnpm install",
157
- customizations: {
158
- vscode: {
159
- extensions: ["oxc.oxc-vscode"]
160
- }
161
- }
162
- }
176
+ value: nodePnpmDevcontainer({
177
+ name: `${context.projectName.value} development`,
178
+ nodeVersion: context.toolchain.nodeLtsMajor.value,
179
+ packageManagerPin: context.toolchain.packageManagerPin.value,
180
+ extensions: ["oxc.oxc-vscode"],
181
+ }),
163
182
  },
164
183
  {
165
184
  kind: "writeText",
166
185
  to: ".github/workflows/check.yml",
167
- text: [
168
- "name: Check",
169
- "",
170
- "on:",
171
- " pull_request:",
172
- " push:",
173
- " branches:",
174
- " - main",
175
- "",
176
- "jobs:",
177
- " check:",
178
- " runs-on: ubuntu-latest",
179
- " steps:",
180
- " - uses: actions/checkout@v4",
181
- " - uses: pnpm/action-setup@v4",
182
- " with:",
183
- " version: 10.0.0",
184
- " - uses: actions/setup-node@v4",
185
- " with:",
186
- " node-version: 22",
187
- " - run: pnpm install",
188
- " - run: pnpm run check",
189
- ""
190
- ].join("\n")
186
+ text: projectTsLibGithubCheckWorkflow(),
191
187
  },
192
188
  {
193
189
  kind: "writeText",
194
190
  to: ".github/dependabot.yml",
195
- text: [
196
- "version: 2",
197
- "updates:",
198
- " - package-ecosystem: npm",
199
- " directory: /",
200
- " schedule:",
201
- " interval: weekly",
202
- " - package-ecosystem: github-actions",
203
- " directory: /",
204
- " schedule:",
205
- " interval: weekly",
206
- ""
207
- ].join("\n")
208
- }
191
+ text: projectPresetDependabotConfig("ts-lib"),
192
+ },
209
193
  ];
210
194
  }
211
195
  function templateSourceRoot() {
212
196
  return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "ts-lib");
213
197
  }
214
- export async function initTsLibProject(targetDir) {
198
+ function sharedOxcSourceRoot() {
199
+ return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
200
+ }
201
+ export async function initTsLibProject(targetDir, options) {
202
+ const generationContext = options?.generationContext ??
203
+ assembleGenerationContext({
204
+ targetDir,
205
+ blueprint: tsLibBlueprint,
206
+ toolchain: await resolveToolchainVersions(),
207
+ });
215
208
  await renderNewProject({
216
209
  sourceRoot: templateSourceRoot(),
210
+ sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
217
211
  targetRoot: targetDir,
218
- operations: operationsForTsLib(projectNameFromDir(targetDir))
212
+ operations: operationsForTsLib(generationContext),
219
213
  });
220
214
  }
package/dist/vue-app.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export declare function projectVueAppPackageScripts(): Record<string, string>;
1
2
  export declare function initVueAppProject(targetDir: string): Promise<void>;
2
3
  //# sourceMappingURL=vue-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vue-app.d.ts","sourceRoot":"","sources":["../src/vue-app.ts"],"names":[],"mappings":"AAoVA,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxE"}
1
+ {"version":3,"file":"vue-app.d.ts","sourceRoot":"","sources":["../src/vue-app.ts"],"names":[],"mappings":"AAiCA,wBAAgB,2BAA2B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAepE;AAyQD,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxE"}
package/dist/vue-app.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
+ import { nodePnpmDevcontainer } from "./devcontainer.js";
4
+ import { planNodeChecks, planNodeFixes, renderFixCommand, renderRootCheckCommand, } from "./module-graph.js";
5
+ import { projectPresetDependabotConfig, projectPresetGithubCheckWorkflow } from "./project-github.js";
3
6
  import { renderNewProject } from "./renderer.js";
4
7
  const features = [
5
8
  "pnpm-catalog",
@@ -9,40 +12,43 @@ const features = [
9
12
  "fix-command",
10
13
  "devcontainer",
11
14
  "github-actions",
12
- "dependabot"
15
+ "dependabot",
13
16
  ];
14
17
  const generatedBy = {
15
18
  packageName: "@ykdz/template",
16
19
  version: "0.0.0",
17
- command: "template init --preset vue-app"
20
+ command: "template init --preset vue-app",
18
21
  };
19
22
  function projectNameFromDir(targetDir) {
20
23
  return path.basename(path.resolve(targetDir));
21
24
  }
25
+ export function projectVueAppPackageScripts() {
26
+ return {
27
+ build: "vite build",
28
+ check: renderRootCheckCommand(planNodeChecks("vue-app")),
29
+ dev: "vite",
30
+ fix: renderFixCommand(planNodeFixes("vue-app")),
31
+ "format:check": "oxfmt --check .",
32
+ "format:write": "oxfmt --write .",
33
+ lint: "oxlint . --deny-warnings",
34
+ "lint:fix": "oxlint . --fix --deny-warnings",
35
+ preview: "vite preview",
36
+ test: "vitest run",
37
+ "test:e2e": "pnpm run build && playwright test",
38
+ typecheck: "vue-tsc --build --noEmit",
39
+ };
40
+ }
22
41
  function packageJson(projectName) {
23
42
  return {
24
43
  name: projectName,
25
44
  version: "0.0.0",
26
45
  private: true,
27
46
  type: "module",
28
- scripts: {
29
- build: "vite build",
30
- check: "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm run test && pnpm run test:e2e",
31
- dev: "vite",
32
- fix: "pnpm run format:write && pnpm run lint:fix",
33
- "format:check": "oxfmt --check .",
34
- "format:write": "oxfmt --write .",
35
- lint: "oxlint . --deny-warnings",
36
- "lint:fix": "oxlint . --fix --deny-warnings",
37
- preview: "vite preview",
38
- test: "vitest run",
39
- "test:e2e": "pnpm run build && playwright test",
40
- typecheck: "vue-tsc --build --noEmit"
41
- },
47
+ scripts: projectVueAppPackageScripts(),
42
48
  dependencies: {
43
49
  "@vueuse/core": "catalog:",
44
50
  pinia: "catalog:",
45
- vue: "catalog:"
51
+ vue: "catalog:",
46
52
  },
47
53
  devDependencies: {
48
54
  "@playwright/test": "catalog:",
@@ -57,12 +63,12 @@ function packageJson(projectName) {
57
63
  typescript: "catalog:",
58
64
  vite: "catalog:",
59
65
  vitest: "catalog:",
60
- "vue-tsc": "catalog:"
66
+ "vue-tsc": "catalog:",
61
67
  },
62
68
  engines: {
63
- node: ">=22.0.0"
69
+ node: "22",
64
70
  },
65
- packageManager: "pnpm@10.0.0"
71
+ packageManager: "pnpm@10.0.0",
66
72
  };
67
73
  }
68
74
  function operationsForVueApp(projectName) {
@@ -70,7 +76,7 @@ function operationsForVueApp(projectName) {
70
76
  {
71
77
  kind: "writeJson",
72
78
  to: "package.json",
73
- value: packageJson(projectName)
79
+ value: packageJson(projectName),
74
80
  },
75
81
  {
76
82
  kind: "writeText",
@@ -99,8 +105,8 @@ function operationsForVueApp(projectName) {
99
105
  " vitest: ^4.1.9",
100
106
  " vue: ^3.5.26",
101
107
  " vue-tsc: ^3.1.8",
102
- ""
103
- ].join("\n")
108
+ "",
109
+ ].join("\n"),
104
110
  },
105
111
  {
106
112
  kind: "writeJson",
@@ -110,9 +116,9 @@ function operationsForVueApp(projectName) {
110
116
  references: [
111
117
  { path: "./tsconfig.app.json" },
112
118
  { path: "./tsconfig.test.json" },
113
- { path: "./tsconfig.node.json" }
114
- ]
115
- }
119
+ { path: "./tsconfig.node.json" },
120
+ ],
121
+ },
116
122
  },
117
123
  {
118
124
  kind: "writeJson",
@@ -126,16 +132,16 @@ function operationsForVueApp(projectName) {
126
132
  moduleResolution: "Bundler",
127
133
  noEmitOnError: true,
128
134
  paths: {
129
- "@/*": ["./src/*"]
135
+ "@/*": ["./src/*"],
130
136
  },
131
137
  skipLibCheck: false,
132
138
  strict: true,
133
139
  target: "ES2022",
134
140
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
135
- types: ["web-bluetooth"]
141
+ types: ["web-bluetooth"],
136
142
  },
137
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"]
138
- }
143
+ include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
144
+ },
139
145
  },
140
146
  {
141
147
  kind: "writeJson",
@@ -145,10 +151,10 @@ function operationsForVueApp(projectName) {
145
151
  compilerOptions: {
146
152
  lib: ["ESNext", "DOM", "DOM.Iterable"],
147
153
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
148
- types: ["node", "vitest/globals", "web-bluetooth"]
154
+ types: ["node", "vitest/globals", "web-bluetooth"],
149
155
  },
150
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"]
151
- }
156
+ include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
157
+ },
152
158
  },
153
159
  {
154
160
  kind: "writeJson",
@@ -164,90 +170,82 @@ function operationsForVueApp(projectName) {
164
170
  strict: true,
165
171
  target: "ES2022",
166
172
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
167
- types: ["node"]
173
+ types: ["node"],
168
174
  },
169
- include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"]
170
- }
175
+ include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
176
+ },
171
177
  },
172
178
  {
173
- kind: "writeJson",
174
- to: ".oxlintrc.json",
175
- value: {
176
- categories: {
177
- correctness: "error",
178
- suspicious: "error"
179
- },
180
- plugins: ["typescript", "oxc", "vue"]
181
- }
179
+ kind: "copyFile",
180
+ sourceRoot: "sharedOxc",
181
+ from: "vue/oxlint.config.ts",
182
+ to: "oxlint.config.ts",
182
183
  },
183
184
  {
184
- kind: "writeJson",
185
- to: ".oxfmtrc.json",
186
- value: {
187
- printWidth: 100,
188
- singleQuote: false,
189
- trailingComma: "none"
190
- }
185
+ kind: "copyFile",
186
+ sourceRoot: "sharedOxc",
187
+ from: "oxfmt.config.ts",
188
+ to: "oxfmt.config.ts",
191
189
  },
192
190
  {
193
191
  kind: "writeText",
194
192
  to: ".gitignore",
195
- text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n")
193
+ text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n"),
196
194
  },
197
195
  {
198
196
  kind: "copyFile",
199
197
  from: "env.d.ts",
200
- to: "env.d.ts"
198
+ to: "env.d.ts",
201
199
  },
202
200
  {
203
201
  kind: "copyFile",
204
202
  from: "index.html",
205
- to: "index.html"
203
+ to: "index.html",
206
204
  },
207
205
  {
208
206
  kind: "copyFile",
209
207
  from: "playwright.config.ts",
210
- to: "playwright.config.ts"
208
+ to: "playwright.config.ts",
211
209
  },
212
210
  {
213
211
  kind: "copyFile",
214
212
  from: "vite.config.ts",
215
- to: "vite.config.ts"
213
+ to: "vite.config.ts",
216
214
  },
217
215
  {
218
216
  kind: "copyFile",
219
217
  from: "vitest.config.ts",
220
- to: "vitest.config.ts"
218
+ to: "vitest.config.ts",
221
219
  },
222
220
  {
223
221
  kind: "copyFile",
224
222
  from: "src/App.vue",
225
- to: "src/App.vue"
223
+ to: "src/App.vue",
226
224
  },
227
225
  {
228
226
  kind: "copyFile",
229
227
  from: "src/main.ts",
230
- to: "src/main.ts"
228
+ to: "src/main.ts",
231
229
  },
232
230
  {
233
231
  kind: "copyFile",
234
232
  from: "src/style.css",
235
- to: "src/style.css"
233
+ to: "src/style.css",
236
234
  },
237
235
  {
238
236
  kind: "copyFile",
239
237
  from: "src/stores/counter.ts",
240
- to: "src/stores/counter.ts"
238
+ to: "src/stores/counter.ts",
241
239
  },
242
240
  {
243
241
  kind: "copyFile",
244
242
  from: "test/app.test.ts",
245
- to: "test/app.test.ts"
243
+ to: "test/app.test.ts",
246
244
  },
247
245
  {
248
246
  kind: "copyFile",
249
247
  from: "test/e2e/app.spec.ts",
250
- to: "test/e2e/app.spec.ts"
248
+ to: "test/e2e/app.spec.ts",
251
249
  },
252
250
  {
253
251
  kind: "writeJson",
@@ -257,83 +255,47 @@ function operationsForVueApp(projectName) {
257
255
  preset: "vue-app",
258
256
  packageManager: "pnpm",
259
257
  projectKind: "single-package",
260
- features
261
- }
258
+ features,
259
+ },
262
260
  },
263
261
  {
264
262
  kind: "writeJson",
265
263
  to: ".project-kit/generated-by.json",
266
- value: generatedBy
264
+ value: generatedBy,
267
265
  },
268
266
  {
269
267
  kind: "writeJson",
270
268
  to: ".devcontainer/devcontainer.json",
271
- value: {
269
+ value: nodePnpmDevcontainer({
272
270
  name: `${projectName} Vue development`,
273
- image: "mcr.microsoft.com/devcontainers/typescript-node:22",
274
- postCreateCommand: "corepack enable && pnpm install && pnpm exec playwright install chromium",
275
- customizations: {
276
- vscode: {
277
- extensions: ["Vue.volar", "oxc.oxc-vscode"]
278
- }
279
- }
280
- }
271
+ nodeVersion: "22",
272
+ packageManagerPin: "pnpm@10.0.0",
273
+ extensions: ["Vue.volar", "oxc.oxc-vscode"],
274
+ }),
281
275
  },
282
276
  {
283
277
  kind: "writeText",
284
278
  to: ".github/workflows/check.yml",
285
- text: [
286
- "name: Check",
287
- "",
288
- "on:",
289
- " pull_request:",
290
- " push:",
291
- " branches:",
292
- " - main",
293
- "",
294
- "jobs:",
295
- " check:",
296
- " runs-on: ubuntu-latest",
297
- " steps:",
298
- " - uses: actions/checkout@v4",
299
- " - uses: pnpm/action-setup@v4",
300
- " with:",
301
- " version: 10.0.0",
302
- " - uses: actions/setup-node@v4",
303
- " with:",
304
- " node-version: 22",
305
- " - run: pnpm install",
306
- " - run: pnpm exec playwright install --with-deps chromium",
307
- " - run: pnpm run check",
308
- ""
309
- ].join("\n")
279
+ text: projectPresetGithubCheckWorkflow("vue-app"),
310
280
  },
311
281
  {
312
282
  kind: "writeText",
313
283
  to: ".github/dependabot.yml",
314
- text: [
315
- "version: 2",
316
- "updates:",
317
- " - package-ecosystem: npm",
318
- " directory: /",
319
- " schedule:",
320
- " interval: weekly",
321
- " - package-ecosystem: github-actions",
322
- " directory: /",
323
- " schedule:",
324
- " interval: weekly",
325
- ""
326
- ].join("\n")
327
- }
284
+ text: projectPresetDependabotConfig("vue-app"),
285
+ },
328
286
  ];
329
287
  }
330
288
  function templateSourceRoot() {
331
289
  return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "vue-app");
332
290
  }
291
+ function sharedOxcSourceRoot() {
292
+ return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
293
+ }
333
294
  export async function initVueAppProject(targetDir) {
334
295
  await renderNewProject({
335
296
  sourceRoot: templateSourceRoot(),
297
+ sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
336
298
  targetRoot: targetDir,
337
- operations: operationsForVueApp(projectNameFromDir(targetDir))
299
+ operations: operationsForVueApp(projectNameFromDir(targetDir)),
338
300
  });
339
301
  }
@@ -1,3 +1,6 @@
1
+ export declare function projectVueHonoRootPackageScripts(): Record<string, string>;
2
+ export declare function projectVueHonoApiPackageScripts(): Record<string, string>;
3
+ export declare function projectVueHonoWebPackageScripts(): Record<string, string>;
1
4
  export declare function initVueHonoAppProject(targetDir: string, options?: {
2
5
  scope?: string;
3
6
  }): Promise<void>;