@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
@@ -1 +1 @@
1
- {"version":3,"file":"vue-hono-app.d.ts","sourceRoot":"","sources":["../src/vue-hono-app.ts"],"names":[],"mappings":"AA8eA,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,IAAI,CAAC,CAQf"}
1
+ {"version":3,"file":"vue-hono-app.d.ts","sourceRoot":"","sources":["../src/vue-hono-app.ts"],"names":[],"mappings":"AAqCA,wBAAgB,gCAAgC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMzE;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcxE;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexE;AA4XD,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,IAAI,CAAC,CASf"}
@@ -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,12 +12,12 @@ 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-hono-app"
20
+ command: "template init --preset vue-hono-app",
18
21
  };
19
22
  function projectNameFromDir(targetDir) {
20
23
  return path.basename(path.resolve(targetDir));
@@ -22,8 +25,43 @@ function projectNameFromDir(targetDir) {
22
25
  function packageName(packageScope, leaf) {
23
26
  return `@${packageScope}/${leaf}`;
24
27
  }
25
- function workspacePackageFilter(packageScope, leaf) {
26
- return `--filter ${packageName(packageScope, leaf)}`;
28
+ export function projectVueHonoRootPackageScripts() {
29
+ return {
30
+ check: renderRootCheckCommand(planNodeChecks("vue-hono-root")),
31
+ dev: "turbo run dev --parallel",
32
+ fix: renderFixCommand(planNodeFixes("vue-hono-root")),
33
+ };
34
+ }
35
+ export function projectVueHonoApiPackageScripts() {
36
+ return {
37
+ build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
38
+ check: renderRootCheckCommand(planNodeChecks("vue-hono-api")),
39
+ dev: "tsx watch src/server.ts",
40
+ fix: renderFixCommand(planNodeFixes("vue-hono-api")),
41
+ "format:check": "oxfmt --check .",
42
+ "format:write": "oxfmt --write .",
43
+ lint: "oxlint . --deny-warnings",
44
+ "lint:fix": "oxlint . --fix --deny-warnings",
45
+ start: "node dist/server.js",
46
+ test: "vitest run",
47
+ typecheck: "tsc -p tsconfig.json --noEmit",
48
+ };
49
+ }
50
+ export function projectVueHonoWebPackageScripts() {
51
+ return {
52
+ build: "vite build",
53
+ check: renderRootCheckCommand(planNodeChecks("vue-hono-web")),
54
+ dev: "vite",
55
+ fix: renderFixCommand(planNodeFixes("vue-hono-web")),
56
+ "format:check": "oxfmt --check .",
57
+ "format:write": "oxfmt --write .",
58
+ lint: "oxlint . --deny-warnings",
59
+ "lint:fix": "oxlint . --fix --deny-warnings",
60
+ preview: "vite preview",
61
+ test: "vitest run",
62
+ "test:e2e": "pnpm run build && playwright test",
63
+ typecheck: "vue-tsc --build",
64
+ };
27
65
  }
28
66
  function rootPackageJson(projectName) {
29
67
  return {
@@ -31,18 +69,14 @@ function rootPackageJson(projectName) {
31
69
  version: "0.0.0",
32
70
  private: true,
33
71
  type: "module",
34
- scripts: {
35
- check: "turbo run check",
36
- dev: "turbo run dev --parallel",
37
- fix: "turbo run fix"
38
- },
72
+ scripts: projectVueHonoRootPackageScripts(),
39
73
  devDependencies: {
40
- turbo: "catalog:"
74
+ turbo: "catalog:",
41
75
  },
42
76
  engines: {
43
- node: ">=22.0.0"
77
+ node: "22",
44
78
  },
45
- packageManager: "pnpm@10.0.0"
79
+ packageManager: "pnpm@10.0.0",
46
80
  };
47
81
  }
48
82
  function apiPackageJson(packageScope) {
@@ -53,24 +87,12 @@ function apiPackageJson(packageScope) {
53
87
  type: "module",
54
88
  types: "./dist/index.d.ts",
55
89
  exports: {
56
- ".": "./dist/index.js"
57
- },
58
- scripts: {
59
- build: "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
60
- check: "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm run test",
61
- dev: "tsx watch src/server.ts",
62
- fix: "pnpm run format:write && pnpm run lint:fix",
63
- "format:check": "oxfmt --check .",
64
- "format:write": "oxfmt --write .",
65
- lint: "oxlint . --deny-warnings",
66
- "lint:fix": "oxlint . --fix --deny-warnings",
67
- start: "node dist/server.js",
68
- test: "vitest run",
69
- typecheck: "tsc -p tsconfig.json --noEmit"
90
+ ".": "./dist/index.js",
70
91
  },
92
+ scripts: projectVueHonoApiPackageScripts(),
71
93
  dependencies: {
72
94
  "@hono/node-server": "catalog:",
73
- hono: "catalog:"
95
+ hono: "catalog:",
74
96
  },
75
97
  devDependencies: {
76
98
  "@types/node": "catalog:",
@@ -79,11 +101,11 @@ function apiPackageJson(packageScope) {
79
101
  "tsc-alias": "catalog:",
80
102
  tsx: "catalog:",
81
103
  typescript: "catalog:",
82
- vitest: "catalog:"
104
+ vitest: "catalog:",
83
105
  },
84
106
  engines: {
85
- node: ">=22.0.0"
86
- }
107
+ node: "22",
108
+ },
87
109
  };
88
110
  }
89
111
  function webPackageJson(packageScope) {
@@ -92,26 +114,13 @@ function webPackageJson(packageScope) {
92
114
  version: "0.0.0",
93
115
  private: true,
94
116
  type: "module",
95
- scripts: {
96
- build: "vite build",
97
- check: "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm run test && pnpm run test:e2e",
98
- dev: "vite",
99
- fix: "pnpm run format:write && pnpm run lint:fix",
100
- "format:check": "oxfmt --check .",
101
- "format:write": "oxfmt --write .",
102
- lint: "oxlint . --deny-warnings",
103
- "lint:fix": "oxlint . --fix --deny-warnings",
104
- preview: "vite preview",
105
- test: "vitest run",
106
- "test:e2e": "pnpm run build && playwright test",
107
- typecheck: "vue-tsc --build"
108
- },
117
+ scripts: projectVueHonoWebPackageScripts(),
109
118
  dependencies: {
110
119
  [packageName(packageScope, "api")]: "workspace:*",
111
120
  "@vueuse/core": "catalog:",
112
121
  hono: "catalog:",
113
122
  pinia: "catalog:",
114
- vue: "catalog:"
123
+ vue: "catalog:",
115
124
  },
116
125
  devDependencies: {
117
126
  "@playwright/test": "catalog:",
@@ -126,17 +135,16 @@ function webPackageJson(packageScope) {
126
135
  typescript: "catalog:",
127
136
  vite: "catalog:",
128
137
  vitest: "catalog:",
129
- "vue-tsc": "catalog:"
138
+ "vue-tsc": "catalog:",
130
139
  },
131
140
  engines: {
132
- node: ">=22.0.0"
133
- }
141
+ node: "22",
142
+ },
134
143
  };
135
144
  }
136
145
  function operationsForVueHonoApp(projectName, packageScope) {
137
146
  const apiName = packageName(packageScope, "api");
138
147
  const webName = packageName(packageScope, "web");
139
- const webFilter = workspacePackageFilter(packageScope, "web");
140
148
  return [
141
149
  { kind: "writeJson", to: "package.json", value: rootPackageJson(projectName) },
142
150
  {
@@ -171,8 +179,8 @@ function operationsForVueHonoApp(projectName, packageScope) {
171
179
  " vitest: ^4.1.9",
172
180
  " vue: ^3.5.26",
173
181
  " vue-tsc: ^3.1.8",
174
- ""
175
- ].join("\n")
182
+ "",
183
+ ].join("\n"),
176
184
  },
177
185
  {
178
186
  kind: "writeJson",
@@ -181,20 +189,20 @@ function operationsForVueHonoApp(projectName, packageScope) {
181
189
  tasks: {
182
190
  build: {
183
191
  dependsOn: ["^build"],
184
- outputs: ["dist/**"]
192
+ outputs: ["dist/**"],
185
193
  },
186
194
  check: {
187
- dependsOn: ["^build"]
195
+ dependsOn: ["^build"],
188
196
  },
189
197
  dev: {
190
198
  cache: false,
191
- persistent: true
199
+ persistent: true,
192
200
  },
193
201
  fix: {
194
- cache: false
195
- }
196
- }
197
- }
202
+ cache: false,
203
+ },
204
+ },
205
+ },
198
206
  },
199
207
  {
200
208
  kind: "writeJson",
@@ -205,9 +213,9 @@ function operationsForVueHonoApp(projectName, packageScope) {
205
213
  { path: "./apps/api/tsconfig.json" },
206
214
  { path: "./apps/web/tsconfig.app.json" },
207
215
  { path: "./apps/web/tsconfig.test.json" },
208
- { path: "./apps/web/tsconfig.node.json" }
209
- ]
210
- }
216
+ { path: "./apps/web/tsconfig.node.json" },
217
+ ],
218
+ },
211
219
  },
212
220
  {
213
221
  kind: "writeJson",
@@ -220,79 +228,39 @@ function operationsForVueHonoApp(projectName, packageScope) {
220
228
  features,
221
229
  packages: [
222
230
  { name: webName, path: "apps/web" },
223
- { name: apiName, path: "apps/api" }
224
- ]
225
- }
231
+ { name: apiName, path: "apps/api" },
232
+ ],
233
+ },
226
234
  },
227
235
  {
228
236
  kind: "writeJson",
229
237
  to: ".project-kit/generated-by.json",
230
- value: generatedBy
238
+ value: generatedBy,
231
239
  },
232
240
  {
233
241
  kind: "writeJson",
234
242
  to: ".devcontainer/devcontainer.json",
235
- value: {
243
+ value: nodePnpmDevcontainer({
236
244
  name: `${projectName} full-stack development`,
237
- image: "mcr.microsoft.com/devcontainers/typescript-node:22",
238
- postCreateCommand: `corepack enable && pnpm install && pnpm ${webFilter} exec playwright install chromium`,
239
- customizations: {
240
- vscode: {
241
- extensions: ["Vue.volar", "oxc.oxc-vscode"]
242
- }
243
- }
244
- }
245
+ nodeVersion: "22",
246
+ packageManagerPin: "pnpm@10.0.0",
247
+ extensions: ["Vue.volar", "oxc.oxc-vscode"],
248
+ }),
245
249
  },
246
250
  {
247
251
  kind: "writeText",
248
252
  to: ".gitignore",
249
- text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n")
253
+ text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n"),
250
254
  },
251
255
  {
252
256
  kind: "writeText",
253
257
  to: ".github/workflows/check.yml",
254
- text: [
255
- "name: Check",
256
- "",
257
- "on:",
258
- " pull_request:",
259
- " push:",
260
- " branches:",
261
- " - main",
262
- "",
263
- "jobs:",
264
- " check:",
265
- " runs-on: ubuntu-latest",
266
- " steps:",
267
- " - uses: actions/checkout@v4",
268
- " - uses: pnpm/action-setup@v4",
269
- " with:",
270
- " version: 10.0.0",
271
- " - uses: actions/setup-node@v4",
272
- " with:",
273
- " node-version: 22",
274
- " - run: pnpm install",
275
- ` - run: pnpm ${webFilter} exec playwright install --with-deps chromium`,
276
- " - run: pnpm run check",
277
- ""
278
- ].join("\n")
258
+ text: projectPresetGithubCheckWorkflow("vue-hono-app"),
279
259
  },
280
260
  {
281
261
  kind: "writeText",
282
262
  to: ".github/dependabot.yml",
283
- text: [
284
- "version: 2",
285
- "updates:",
286
- " - package-ecosystem: npm",
287
- " directory: /",
288
- " schedule:",
289
- " interval: weekly",
290
- " - package-ecosystem: github-actions",
291
- " directory: /",
292
- " schedule:",
293
- " interval: weekly",
294
- ""
295
- ].join("\n")
263
+ text: projectPresetDependabotConfig("vue-hono-app"),
296
264
  },
297
265
  { kind: "writeJson", to: "apps/api/package.json", value: apiPackageJson(packageScope) },
298
266
  {
@@ -307,15 +275,15 @@ function operationsForVueHonoApp(projectName, packageScope) {
307
275
  moduleResolution: "NodeNext",
308
276
  noEmitOnError: true,
309
277
  paths: {
310
- "@/*": ["./src/*"]
278
+ "@/*": ["./src/*"],
311
279
  },
312
280
  skipLibCheck: false,
313
281
  strict: true,
314
282
  target: "ES2022",
315
- types: ["node", "vitest/globals"]
283
+ types: ["node", "vitest/globals"],
316
284
  },
317
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"]
318
- }
285
+ include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
286
+ },
319
287
  },
320
288
  {
321
289
  kind: "writeJson",
@@ -325,30 +293,22 @@ function operationsForVueHonoApp(projectName, packageScope) {
325
293
  compilerOptions: {
326
294
  outDir: "dist",
327
295
  rootDir: "src",
328
- types: ["node"]
296
+ types: ["node"],
329
297
  },
330
- include: ["src/**/*.ts"]
331
- }
298
+ include: ["src/**/*.ts"],
299
+ },
332
300
  },
333
301
  {
334
- kind: "writeJson",
335
- to: "apps/api/.oxlintrc.json",
336
- value: {
337
- categories: {
338
- correctness: "error",
339
- suspicious: "error"
340
- },
341
- plugins: ["typescript", "oxc"]
342
- }
302
+ kind: "copyFile",
303
+ sourceRoot: "sharedOxc",
304
+ from: "node/oxlint.config.ts",
305
+ to: "apps/api/oxlint.config.ts",
343
306
  },
344
307
  {
345
- kind: "writeJson",
346
- to: "apps/api/.oxfmtrc.json",
347
- value: {
348
- printWidth: 100,
349
- singleQuote: false,
350
- trailingComma: "none"
351
- }
308
+ kind: "copyFile",
309
+ sourceRoot: "sharedOxc",
310
+ from: "oxfmt.config.ts",
311
+ to: "apps/api/oxfmt.config.ts",
352
312
  },
353
313
  { kind: "copyFile", from: "api/src/index.ts", to: "apps/api/src/index.ts" },
354
314
  { kind: "copyFile", from: "api/src/runtime.ts", to: "apps/api/src/runtime.ts" },
@@ -364,9 +324,9 @@ function operationsForVueHonoApp(projectName, packageScope) {
364
324
  references: [
365
325
  { path: "./tsconfig.app.json" },
366
326
  { path: "./tsconfig.test.json" },
367
- { path: "./tsconfig.node.json" }
368
- ]
369
- }
327
+ { path: "./tsconfig.node.json" },
328
+ ],
329
+ },
370
330
  },
371
331
  {
372
332
  kind: "writeJson",
@@ -381,17 +341,17 @@ function operationsForVueHonoApp(projectName, packageScope) {
381
341
  noEmitOnError: true,
382
342
  paths: {
383
343
  "@/*": ["./src/*"],
384
- [apiName]: ["../api/src/index.ts"]
344
+ [apiName]: ["../api/src/index.ts"],
385
345
  },
386
346
  skipLibCheck: false,
387
347
  strict: true,
388
348
  target: "ES2022",
389
349
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
390
- types: ["web-bluetooth"]
350
+ types: ["web-bluetooth"],
391
351
  },
392
352
  include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
393
- references: [{ path: "../api/tsconfig.build.json" }]
394
- }
353
+ references: [{ path: "../api/tsconfig.build.json" }],
354
+ },
395
355
  },
396
356
  {
397
357
  kind: "writeJson",
@@ -401,11 +361,11 @@ function operationsForVueHonoApp(projectName, packageScope) {
401
361
  compilerOptions: {
402
362
  lib: ["ESNext", "DOM", "DOM.Iterable"],
403
363
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
404
- types: ["node", "vitest/globals", "web-bluetooth"]
364
+ types: ["node", "vitest/globals", "web-bluetooth"],
405
365
  },
406
366
  include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
407
- references: [{ path: "../api/tsconfig.build.json" }]
408
- }
367
+ references: [{ path: "../api/tsconfig.build.json" }],
368
+ },
409
369
  },
410
370
  {
411
371
  kind: "writeJson",
@@ -422,30 +382,22 @@ function operationsForVueHonoApp(projectName, packageScope) {
422
382
  strict: true,
423
383
  target: "ES2022",
424
384
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
425
- types: ["node"]
385
+ types: ["node"],
426
386
  },
427
- include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"]
428
- }
387
+ include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
388
+ },
429
389
  },
430
390
  {
431
- kind: "writeJson",
432
- to: "apps/web/.oxlintrc.json",
433
- value: {
434
- categories: {
435
- correctness: "error",
436
- suspicious: "error"
437
- },
438
- plugins: ["typescript", "oxc", "vue"]
439
- }
391
+ kind: "copyFile",
392
+ sourceRoot: "sharedOxc",
393
+ from: "vue/oxlint.config.ts",
394
+ to: "apps/web/oxlint.config.ts",
440
395
  },
441
396
  {
442
- kind: "writeJson",
443
- to: "apps/web/.oxfmtrc.json",
444
- value: {
445
- printWidth: 100,
446
- singleQuote: false,
447
- trailingComma: "none"
448
- }
397
+ kind: "copyFile",
398
+ sourceRoot: "sharedOxc",
399
+ from: "oxfmt.config.ts",
400
+ to: "apps/web/oxfmt.config.ts",
449
401
  },
450
402
  { kind: "copyFile", from: "web/env.d.ts", to: "apps/web/env.d.ts" },
451
403
  { kind: "copyFile", from: "web/index.html", to: "apps/web/index.html" },
@@ -458,27 +410,31 @@ function operationsForVueHonoApp(projectName, packageScope) {
458
410
  path: "apps/web/src/api.ts",
459
411
  language: "typescript",
460
412
  replacements: {
461
- "api-type-import-start": `import type { AppType } from "${apiName}";\n/*`,
462
- "api-type-import-end": "*/"
463
- }
413
+ "api-type-import-start": `import type { AppType } from "${apiName}";\nimport { hc } from "hono/client";\n/*`,
414
+ "api-type-import-end": "*/",
415
+ },
464
416
  },
465
417
  { kind: "copyFile", from: "web/src/App.vue", to: "apps/web/src/App.vue" },
466
418
  { kind: "copyFile", from: "web/src/main.ts", to: "apps/web/src/main.ts" },
467
419
  { kind: "copyFile", from: "web/src/style.css", to: "apps/web/src/style.css" },
468
420
  { kind: "copyFile", from: "web/src/stores/counter.ts", to: "apps/web/src/stores/counter.ts" },
469
421
  { kind: "copyFile", from: "web/test/app.test.ts", to: "apps/web/test/app.test.ts" },
470
- { kind: "copyFile", from: "web/test/e2e/app.spec.ts", to: "apps/web/test/e2e/app.spec.ts" }
422
+ { kind: "copyFile", from: "web/test/e2e/app.spec.ts", to: "apps/web/test/e2e/app.spec.ts" },
471
423
  ];
472
424
  }
473
425
  function templateSourceRoot() {
474
426
  return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "vue-hono-app");
475
427
  }
428
+ function sharedOxcSourceRoot() {
429
+ return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
430
+ }
476
431
  export async function initVueHonoAppProject(targetDir, options = {}) {
477
432
  const projectName = projectNameFromDir(targetDir);
478
433
  const packageScope = options.scope ?? projectName;
479
434
  await renderNewProject({
480
435
  sourceRoot: templateSourceRoot(),
436
+ sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
481
437
  targetRoot: targetDir,
482
- operations: operationsForVueHonoApp(projectName, packageScope)
438
+ operations: operationsForVueHonoApp(projectName, packageScope),
483
439
  });
484
440
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "description": "Project template generator for YKDZ starter projects.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -26,29 +26,37 @@
26
26
  ],
27
27
  "files": [
28
28
  "dist",
29
- "templates"
29
+ "templates",
30
+ "!templates/**/node_modules"
30
31
  ],
31
- "scripts": {
32
- "build": "tsc -p tsconfig.build.json",
33
- "prepack": "pnpm run build",
34
- "check": "pnpm run typecheck && pnpm run test && pnpm run check:fixtures",
35
- "check:fixtures": "tsx scripts/check-fixtures.ts",
36
- "fix": "pnpm run build",
37
- "typecheck": "tsc -p tsconfig.json --noEmit",
38
- "test": "vitest run"
32
+ "dependencies": {
33
+ "typescript": "^6.0.3",
34
+ "valibot": "^1.4.2"
39
35
  },
40
36
  "devDependencies": {
41
37
  "@types/node": "^24.0.0",
42
38
  "execa": "^9.6.0",
39
+ "oxfmt": "^0.56.0",
40
+ "oxlint": "^1.71.0",
41
+ "oxlint-tsgolint": "^0.23.0",
43
42
  "tsx": "^4.20.0",
44
- "vitest": "^3.2.0"
43
+ "vitest": "^4.1.9",
44
+ "yaml": "^2.9.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=22.0.0"
48
48
  },
49
- "packageManager": "pnpm@11.8.0",
50
- "dependencies": {
51
- "typescript": "^5.8.0",
52
- "valibot": "^1.4.2"
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.build.json",
51
+ "check": "pnpm run typecheck && pnpm run test && pnpm run check:templates && pnpm run check:fixtures",
52
+ "check:fixtures": "tsx scripts/check-fixtures.ts",
53
+ "check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:github-yaml && pnpm run check:templates:static-source",
54
+ "check:toolchain:online": "tsx scripts/check-online-toolchain-resolution-contract.ts",
55
+ "check:templates:github-yaml": "tsx scripts/check-template-github-yaml.ts",
56
+ "check:templates:shared-oxc": "pnpm --dir templates/shared/oxc run check",
57
+ "check:templates:static-source": "oxfmt --check --config templates/shared/oxc/oxfmt.config.ts templates && rustfmt --check templates/rust-bin/src/main.rs",
58
+ "fix": "pnpm run build",
59
+ "typecheck": "tsc -p tsconfig.json --noEmit",
60
+ "test": "vitest run"
53
61
  }
54
- }
62
+ }
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,19 @@
1
+ name: Check
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ check:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: actions/setup-node@v6
15
+ with:
16
+ node-version-file: package.json
17
+ - run: corepack enable
18
+ - run: pnpm install
19
+ - run: pnpm run check
@@ -1,4 +1,5 @@
1
1
  import { serve } from "@hono/node-server";
2
+
2
3
  import { app } from "@/app.js";
3
4
 
4
5
  const port = Number.parseInt(process.env.PORT ?? "3000", 10);
@@ -6,9 +7,9 @@ const port = Number.parseInt(process.env.PORT ?? "3000", 10);
6
7
  serve(
7
8
  {
8
9
  fetch: app.fetch,
9
- port
10
+ port,
10
11
  },
11
12
  (info) => {
12
13
  console.log(`Hono API listening on http://localhost:${info.port}`);
13
- }
14
+ },
14
15
  );
@@ -1,13 +1,14 @@
1
1
  import { fileURLToPath, URL } from "node:url";
2
+
2
3
  import { defineConfig } from "vitest/config";
3
4
 
4
5
  export default defineConfig({
5
6
  resolve: {
6
7
  alias: {
7
- "@": fileURLToPath(new URL("./src", import.meta.url))
8
- }
8
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
9
+ },
9
10
  },
10
11
  test: {
11
- globals: true
12
- }
12
+ globals: true,
13
+ },
13
14
  });
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: cargo
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
11
+ - package-ecosystem: github-actions
12
+ directory: /
13
+ schedule:
14
+ interval: weekly