@ykdz/template 0.0.1 → 0.0.3

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 (101) hide show
  1. package/dist/src/cli.d.ts.map +1 -0
  2. package/dist/{cli.js → src/cli.js} +126 -128
  3. package/dist/{declarations.d.ts → src/declarations.d.ts} +1 -2
  4. package/dist/src/declarations.d.ts.map +1 -0
  5. package/dist/{declarations.js → src/declarations.js} +2 -109
  6. package/dist/src/dependency-catalog.d.ts +10 -0
  7. package/dist/src/dependency-catalog.d.ts.map +1 -0
  8. package/dist/src/dependency-catalog.js +63 -0
  9. package/dist/src/devcontainer.d.ts +18 -0
  10. package/dist/src/devcontainer.d.ts.map +1 -0
  11. package/dist/src/devcontainer.js +24 -0
  12. package/dist/src/editor-customization.d.ts +13 -0
  13. package/dist/src/editor-customization.d.ts.map +1 -0
  14. package/dist/src/editor-customization.js +101 -0
  15. package/dist/src/generation-context.d.ts +24 -0
  16. package/dist/src/generation-context.d.ts.map +1 -0
  17. package/dist/src/generation-context.js +12 -0
  18. package/dist/src/module-graph.d.ts +31 -0
  19. package/dist/src/module-graph.d.ts.map +1 -0
  20. package/dist/src/module-graph.js +48 -0
  21. package/dist/src/next-step-instructions.d.ts +21 -0
  22. package/dist/src/next-step-instructions.d.ts.map +1 -0
  23. package/dist/src/next-step-instructions.js +89 -0
  24. package/dist/src/package-addition.d.ts.map +1 -0
  25. package/dist/src/package-addition.js +188 -0
  26. package/dist/src/preset-projection.d.ts +66 -0
  27. package/dist/src/preset-projection.d.ts.map +1 -0
  28. package/dist/src/preset-projection.js +7 -0
  29. package/dist/src/project-github.d.ts +29 -0
  30. package/dist/src/project-github.d.ts.map +1 -0
  31. package/dist/src/project-github.js +63 -0
  32. package/dist/src/renderer.d.ts.map +1 -0
  33. package/dist/{renderer.js → src/renderer.js} +0 -3
  34. package/dist/src/runtime-paths.d.ts +2 -0
  35. package/dist/src/runtime-paths.d.ts.map +1 -0
  36. package/dist/src/runtime-paths.js +11 -0
  37. package/dist/src/toolchain-resolution.d.ts +35 -0
  38. package/dist/src/toolchain-resolution.d.ts.map +1 -0
  39. package/dist/src/toolchain-resolution.js +192 -0
  40. package/dist/templates/hono-api/projection.d.ts +7 -0
  41. package/dist/templates/hono-api/projection.d.ts.map +1 -0
  42. package/dist/templates/hono-api/projection.js +377 -0
  43. package/dist/templates/projection-plans.d.ts +8 -0
  44. package/dist/templates/projection-plans.d.ts.map +1 -0
  45. package/dist/templates/projection-plans.js +94 -0
  46. package/dist/templates/registry.d.ts +8 -0
  47. package/dist/templates/registry.d.ts.map +1 -0
  48. package/dist/templates/registry.js +42 -0
  49. package/dist/templates/rust-bin/projection.d.ts +10 -0
  50. package/dist/templates/rust-bin/projection.d.ts.map +1 -0
  51. package/dist/templates/rust-bin/projection.js +282 -0
  52. package/dist/templates/ts-lib/projection.d.ts +7 -0
  53. package/dist/templates/ts-lib/projection.d.ts.map +1 -0
  54. package/dist/templates/ts-lib/projection.js +372 -0
  55. package/dist/templates/vue-app/projection.d.ts +7 -0
  56. package/dist/templates/vue-app/projection.d.ts.map +1 -0
  57. package/dist/templates/vue-app/projection.js +594 -0
  58. package/dist/templates/vue-hono-app/projection.d.ts +9 -0
  59. package/dist/templates/vue-hono-app/projection.d.ts.map +1 -0
  60. package/dist/templates/vue-hono-app/projection.js +589 -0
  61. package/package.json +30 -24
  62. package/pnpm-workspace.yaml +34 -0
  63. package/templates/hono-api/projection.ts +453 -0
  64. package/templates/projection-plans.ts +135 -0
  65. package/templates/registry.ts +59 -0
  66. package/templates/rust-bin/.github/dependabot.yml +4 -0
  67. package/templates/rust-bin/.github/workflows/check.yml +6 -1
  68. package/templates/rust-bin/projection.ts +346 -0
  69. package/templates/ts-lib/projection.ts +454 -0
  70. package/templates/vue-app/projection.ts +687 -0
  71. package/templates/vue-app/test/e2e/app.spec.ts +4 -1
  72. package/templates/vue-hono-app/projection.ts +669 -0
  73. package/templates/vue-hono-app/web/test/e2e/app.spec.ts +4 -1
  74. package/dist/cli.d.ts.map +0 -1
  75. package/dist/declarations.d.ts.map +0 -1
  76. package/dist/hono-api.d.ts +0 -2
  77. package/dist/hono-api.d.ts.map +0 -1
  78. package/dist/hono-api.js +0 -208
  79. package/dist/package-addition.d.ts.map +0 -1
  80. package/dist/package-addition.js +0 -560
  81. package/dist/post-commands.d.ts +0 -40
  82. package/dist/post-commands.d.ts.map +0 -1
  83. package/dist/post-commands.js +0 -154
  84. package/dist/renderer.d.ts.map +0 -1
  85. package/dist/rust-bin.d.ts +0 -2
  86. package/dist/rust-bin.d.ts.map +0 -1
  87. package/dist/rust-bin.js +0 -174
  88. package/dist/ts-lib.d.ts +0 -2
  89. package/dist/ts-lib.d.ts.map +0 -1
  90. package/dist/ts-lib.js +0 -181
  91. package/dist/vue-app.d.ts +0 -2
  92. package/dist/vue-app.d.ts.map +0 -1
  93. package/dist/vue-app.js +0 -299
  94. package/dist/vue-hono-app.d.ts +0 -4
  95. package/dist/vue-hono-app.d.ts.map +0 -1
  96. package/dist/vue-hono-app.js +0 -436
  97. package/templates/shared/oxc/package.json +0 -18
  98. package/templates/shared/oxc/tsconfig.json +0 -11
  99. /package/dist/{cli.d.ts → src/cli.d.ts} +0 -0
  100. /package/dist/{package-addition.d.ts → src/package-addition.d.ts} +0 -0
  101. /package/dist/{renderer.d.ts → src/renderer.d.ts} +0 -0
@@ -1,436 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import { renderNewProject } from "./renderer.js";
4
- const features = [
5
- "pnpm-catalog",
6
- "oxc-format-lint",
7
- "strict-typescript",
8
- "root-check",
9
- "fix-command",
10
- "devcontainer",
11
- "github-actions",
12
- "dependabot"
13
- ];
14
- const generatedBy = {
15
- packageName: "@ykdz/template",
16
- version: "0.0.0",
17
- command: "template init --preset vue-hono-app"
18
- };
19
- function projectNameFromDir(targetDir) {
20
- return path.basename(path.resolve(targetDir));
21
- }
22
- function packageName(packageScope, leaf) {
23
- return `@${packageScope}/${leaf}`;
24
- }
25
- function workspacePackageFilter(packageScope, leaf) {
26
- return `--filter ${packageName(packageScope, leaf)}`;
27
- }
28
- function rootPackageJson(projectName) {
29
- return {
30
- name: projectName,
31
- version: "0.0.0",
32
- private: true,
33
- type: "module",
34
- scripts: {
35
- check: "turbo run check",
36
- dev: "turbo run dev --parallel",
37
- fix: "turbo run fix"
38
- },
39
- devDependencies: {
40
- turbo: "catalog:"
41
- },
42
- engines: {
43
- node: "22"
44
- },
45
- packageManager: "pnpm@10.0.0"
46
- };
47
- }
48
- function apiPackageJson(packageScope) {
49
- return {
50
- name: packageName(packageScope, "api"),
51
- version: "0.0.0",
52
- private: true,
53
- type: "module",
54
- types: "./dist/index.d.ts",
55
- 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"
70
- },
71
- dependencies: {
72
- "@hono/node-server": "catalog:",
73
- hono: "catalog:"
74
- },
75
- devDependencies: {
76
- "@types/node": "catalog:",
77
- oxfmt: "catalog:",
78
- oxlint: "catalog:",
79
- "tsc-alias": "catalog:",
80
- tsx: "catalog:",
81
- typescript: "catalog:",
82
- vitest: "catalog:"
83
- },
84
- engines: {
85
- node: "22"
86
- }
87
- };
88
- }
89
- function webPackageJson(packageScope) {
90
- return {
91
- name: packageName(packageScope, "web"),
92
- version: "0.0.0",
93
- private: true,
94
- 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
- },
109
- dependencies: {
110
- [packageName(packageScope, "api")]: "workspace:*",
111
- "@vueuse/core": "catalog:",
112
- hono: "catalog:",
113
- pinia: "catalog:",
114
- vue: "catalog:"
115
- },
116
- devDependencies: {
117
- "@playwright/test": "catalog:",
118
- "@tailwindcss/vite": "catalog:",
119
- "@types/node": "catalog:",
120
- "@types/web-bluetooth": "catalog:",
121
- "@vitejs/plugin-vue": "catalog:",
122
- "@vue/tsconfig": "catalog:",
123
- oxfmt: "catalog:",
124
- oxlint: "catalog:",
125
- tailwindcss: "catalog:",
126
- typescript: "catalog:",
127
- vite: "catalog:",
128
- vitest: "catalog:",
129
- "vue-tsc": "catalog:"
130
- },
131
- engines: {
132
- node: "22"
133
- }
134
- };
135
- }
136
- function operationsForVueHonoApp(projectName, packageScope) {
137
- const apiName = packageName(packageScope, "api");
138
- const webName = packageName(packageScope, "web");
139
- const webFilter = workspacePackageFilter(packageScope, "web");
140
- return [
141
- { kind: "writeJson", to: "package.json", value: rootPackageJson(projectName) },
142
- {
143
- kind: "writeText",
144
- to: "pnpm-workspace.yaml",
145
- text: [
146
- "packages:",
147
- " - apps/*",
148
- "",
149
- "allowBuilds:",
150
- " esbuild: true",
151
- "",
152
- "catalog:",
153
- ' "@hono/node-server": ^2.0.6',
154
- ' "@playwright/test": ^1.57.0',
155
- ' "@tailwindcss/vite": ^4.1.18',
156
- ' "@types/node": ^24.0.0',
157
- ' "@types/web-bluetooth": ^0.0.21',
158
- ' "@vitejs/plugin-vue": ^6.0.2',
159
- ' "@vue/tsconfig": ^0.8.1',
160
- ' "@vueuse/core": ^14.1.0',
161
- " hono: ^4.12.27",
162
- " oxfmt: ^0.56.0",
163
- " oxlint: ^1.71.0",
164
- " pinia: ^3.0.4",
165
- " tailwindcss: ^4.1.18",
166
- " tsc-alias: ^1.8.17",
167
- " tsx: ^4.20.0",
168
- " turbo: ^2.7.0",
169
- " typescript: ^5.8.0",
170
- " vite: ^7.3.0",
171
- " vitest: ^4.1.9",
172
- " vue: ^3.5.26",
173
- " vue-tsc: ^3.1.8",
174
- ""
175
- ].join("\n")
176
- },
177
- {
178
- kind: "writeJson",
179
- to: "turbo.json",
180
- value: {
181
- tasks: {
182
- build: {
183
- dependsOn: ["^build"],
184
- outputs: ["dist/**"]
185
- },
186
- check: {
187
- dependsOn: ["^build"]
188
- },
189
- dev: {
190
- cache: false,
191
- persistent: true
192
- },
193
- fix: {
194
- cache: false
195
- }
196
- }
197
- }
198
- },
199
- {
200
- kind: "writeJson",
201
- to: "tsconfig.json",
202
- value: {
203
- files: [],
204
- references: [
205
- { path: "./apps/api/tsconfig.json" },
206
- { path: "./apps/web/tsconfig.app.json" },
207
- { path: "./apps/web/tsconfig.test.json" },
208
- { path: "./apps/web/tsconfig.node.json" }
209
- ]
210
- }
211
- },
212
- {
213
- kind: "writeJson",
214
- to: ".project-kit/blueprint.json",
215
- value: {
216
- schemaVersion: 1,
217
- preset: "vue-hono-app",
218
- packageManager: "pnpm",
219
- projectKind: "multi-package",
220
- features,
221
- packages: [
222
- { name: webName, path: "apps/web" },
223
- { name: apiName, path: "apps/api" }
224
- ]
225
- }
226
- },
227
- {
228
- kind: "writeJson",
229
- to: ".project-kit/generated-by.json",
230
- value: generatedBy
231
- },
232
- {
233
- kind: "writeJson",
234
- to: ".devcontainer/devcontainer.json",
235
- value: {
236
- 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
- },
246
- {
247
- kind: "writeText",
248
- to: ".gitignore",
249
- text: ["node_modules", "dist", "playwright-report", "test-results", ".env", ""].join("\n")
250
- },
251
- {
252
- kind: "copyFile",
253
- from: ".github/workflows/check.yml",
254
- to: ".github/workflows/check.yml",
255
- },
256
- {
257
- kind: "copyFile",
258
- from: ".github/dependabot.yml",
259
- to: ".github/dependabot.yml",
260
- },
261
- { kind: "writeJson", to: "apps/api/package.json", value: apiPackageJson(packageScope) },
262
- {
263
- kind: "writeJson",
264
- to: "apps/api/tsconfig.json",
265
- value: {
266
- compilerOptions: {
267
- composite: true,
268
- declaration: true,
269
- declarationMap: true,
270
- module: "NodeNext",
271
- moduleResolution: "NodeNext",
272
- noEmitOnError: true,
273
- paths: {
274
- "@/*": ["./src/*"]
275
- },
276
- skipLibCheck: false,
277
- strict: true,
278
- target: "ES2022",
279
- types: ["node", "vitest/globals"]
280
- },
281
- include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"]
282
- }
283
- },
284
- {
285
- kind: "writeJson",
286
- to: "apps/api/tsconfig.build.json",
287
- value: {
288
- extends: "./tsconfig.json",
289
- compilerOptions: {
290
- outDir: "dist",
291
- rootDir: "src",
292
- types: ["node"]
293
- },
294
- include: ["src/**/*.ts"]
295
- }
296
- },
297
- {
298
- kind: "copyFile",
299
- sourceRoot: "sharedOxc",
300
- from: "node/oxlint.config.ts",
301
- to: "apps/api/oxlint.config.ts"
302
- },
303
- {
304
- kind: "copyFile",
305
- sourceRoot: "sharedOxc",
306
- from: "oxfmt.config.ts",
307
- to: "apps/api/oxfmt.config.ts"
308
- },
309
- { kind: "copyFile", from: "api/src/index.ts", to: "apps/api/src/index.ts" },
310
- { kind: "copyFile", from: "api/src/runtime.ts", to: "apps/api/src/runtime.ts" },
311
- { kind: "copyFile", from: "api/src/server.ts", to: "apps/api/src/server.ts" },
312
- { kind: "copyFile", from: "api/test/app.test.ts", to: "apps/api/test/app.test.ts" },
313
- { kind: "copyFile", from: "api/vitest.config.ts", to: "apps/api/vitest.config.ts" },
314
- { kind: "writeJson", to: "apps/web/package.json", value: webPackageJson(packageScope) },
315
- {
316
- kind: "writeJson",
317
- to: "apps/web/tsconfig.json",
318
- value: {
319
- files: [],
320
- references: [
321
- { path: "./tsconfig.app.json" },
322
- { path: "./tsconfig.test.json" },
323
- { path: "./tsconfig.node.json" }
324
- ]
325
- }
326
- },
327
- {
328
- kind: "writeJson",
329
- to: "apps/web/tsconfig.app.json",
330
- value: {
331
- extends: "@vue/tsconfig/tsconfig.dom.json",
332
- compilerOptions: {
333
- baseUrl: ".",
334
- composite: true,
335
- module: "ESNext",
336
- moduleResolution: "Bundler",
337
- noEmitOnError: true,
338
- paths: {
339
- "@/*": ["./src/*"],
340
- [apiName]: ["../api/src/index.ts"]
341
- },
342
- skipLibCheck: false,
343
- strict: true,
344
- target: "ES2022",
345
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
346
- types: ["web-bluetooth"]
347
- },
348
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
349
- references: [{ path: "../api/tsconfig.build.json" }]
350
- }
351
- },
352
- {
353
- kind: "writeJson",
354
- to: "apps/web/tsconfig.test.json",
355
- value: {
356
- extends: "./tsconfig.app.json",
357
- compilerOptions: {
358
- lib: ["ESNext", "DOM", "DOM.Iterable"],
359
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.test.tsbuildinfo",
360
- types: ["node", "vitest/globals", "web-bluetooth"]
361
- },
362
- include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue", "test/**/*.ts"],
363
- references: [{ path: "../api/tsconfig.build.json" }]
364
- }
365
- },
366
- {
367
- kind: "writeJson",
368
- to: "apps/web/tsconfig.node.json",
369
- value: {
370
- compilerOptions: {
371
- composite: true,
372
- module: "ESNext",
373
- moduleResolution: "Bundler",
374
- noEmitOnError: true,
375
- lib: ["ESNext", "DOM", "DOM.Iterable"],
376
- outDir: "./node_modules/.tmp/tsconfig.node",
377
- skipLibCheck: false,
378
- strict: true,
379
- target: "ES2022",
380
- tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
381
- types: ["node"]
382
- },
383
- include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"]
384
- }
385
- },
386
- {
387
- kind: "copyFile",
388
- sourceRoot: "sharedOxc",
389
- from: "vue/oxlint.config.ts",
390
- to: "apps/web/oxlint.config.ts"
391
- },
392
- {
393
- kind: "copyFile",
394
- sourceRoot: "sharedOxc",
395
- from: "oxfmt.config.ts",
396
- to: "apps/web/oxfmt.config.ts"
397
- },
398
- { kind: "copyFile", from: "web/env.d.ts", to: "apps/web/env.d.ts" },
399
- { kind: "copyFile", from: "web/index.html", to: "apps/web/index.html" },
400
- { kind: "copyFile", from: "web/playwright.config.ts", to: "apps/web/playwright.config.ts" },
401
- { kind: "copyFile", from: "web/vite.config.ts", to: "apps/web/vite.config.ts" },
402
- { kind: "copyFile", from: "web/vitest.config.ts", to: "apps/web/vitest.config.ts" },
403
- { kind: "copyFile", from: "web/src/api.ts", to: "apps/web/src/api.ts" },
404
- {
405
- kind: "replaceAnchors",
406
- path: "apps/web/src/api.ts",
407
- language: "typescript",
408
- replacements: {
409
- "api-type-import-start": `import type { AppType } from "${apiName}";\nimport { hc } from "hono/client";\n/*`,
410
- "api-type-import-end": "*/"
411
- }
412
- },
413
- { kind: "copyFile", from: "web/src/App.vue", to: "apps/web/src/App.vue" },
414
- { kind: "copyFile", from: "web/src/main.ts", to: "apps/web/src/main.ts" },
415
- { kind: "copyFile", from: "web/src/style.css", to: "apps/web/src/style.css" },
416
- { kind: "copyFile", from: "web/src/stores/counter.ts", to: "apps/web/src/stores/counter.ts" },
417
- { kind: "copyFile", from: "web/test/app.test.ts", to: "apps/web/test/app.test.ts" },
418
- { kind: "copyFile", from: "web/test/e2e/app.spec.ts", to: "apps/web/test/e2e/app.spec.ts" }
419
- ];
420
- }
421
- function templateSourceRoot() {
422
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "vue-hono-app");
423
- }
424
- function sharedOxcSourceRoot() {
425
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "templates", "shared", "oxc");
426
- }
427
- export async function initVueHonoAppProject(targetDir, options = {}) {
428
- const projectName = projectNameFromDir(targetDir);
429
- const packageScope = options.scope ?? projectName;
430
- await renderNewProject({
431
- sourceRoot: templateSourceRoot(),
432
- sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
433
- targetRoot: targetDir,
434
- operations: operationsForVueHonoApp(projectName, packageScope)
435
- });
436
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "@ykdz/template-shared-oxc",
3
- "private": true,
4
- "type": "module",
5
- "scripts": {
6
- "check": "pnpm run format:check && pnpm run lint && pnpm run typecheck",
7
- "format:check": "oxfmt --check .",
8
- "format:write": "oxfmt --write .",
9
- "lint": "oxlint . --deny-warnings",
10
- "lint:fix": "oxlint . --fix --deny-warnings",
11
- "typecheck": "tsc -p tsconfig.json --noEmit"
12
- },
13
- "devDependencies": {
14
- "oxfmt": "^0.56.0",
15
- "oxlint": "^1.71.0",
16
- "typescript": "^6.0.3"
17
- }
18
- }
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "NodeNext",
4
- "moduleResolution": "NodeNext",
5
- "noEmitOnError": true,
6
- "skipLibCheck": false,
7
- "strict": true,
8
- "target": "ES2022"
9
- },
10
- "include": ["**/*.ts"]
11
- }
File without changes
File without changes