@ykdz/template 0.0.8 → 0.0.10

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 (43) hide show
  1. package/dist/cli.js +7 -7
  2. package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +10 -6
  3. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +15 -5
  4. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +15 -5
  5. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +31 -7
  6. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +7 -8
  7. package/node_modules/@ykdz/template-builtin-source/package.json +15 -2
  8. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +18 -4
  9. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts +25 -3
  10. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/tsconfig.config.json +20 -0
  11. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts +27 -3
  12. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/env.d.ts +7 -0
  13. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/scripts/run-playwright.ts +25 -0
  14. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/src/App.vue +18 -4
  15. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/env.d.ts +7 -0
  16. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/scripts/run-playwright.ts +25 -0
  17. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/App.vue +18 -4
  18. package/node_modules/@ykdz/template-core/dist/declarations.js +34 -1
  19. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +11 -6
  20. package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +5 -5
  21. package/node_modules/@ykdz/template-core/dist/editor-customization.js +20 -29
  22. package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +5 -4
  23. package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +38 -10
  24. package/node_modules/@ykdz/template-core/dist/generation-context.js +8 -3
  25. package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +3 -0
  26. package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +2 -2
  27. package/node_modules/@ykdz/template-core/dist/package-addition.js +24 -9
  28. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +4 -5
  29. package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +3 -3
  30. package/node_modules/@ykdz/template-core/dist/preset-projection.js +1 -0
  31. package/node_modules/@ykdz/template-core/dist/preset-source.js +60 -45
  32. package/node_modules/@ykdz/template-core/dist/project-github.d.ts +3 -3
  33. package/node_modules/@ykdz/template-core/dist/project-github.js +1 -0
  34. package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +7 -3
  35. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +196 -130
  36. package/node_modules/@ykdz/template-core/dist/renderer.d.ts +2 -2
  37. package/node_modules/@ykdz/template-core/dist/renderer.js +2 -2
  38. package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +1 -1
  39. package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +8 -10
  40. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.d.ts +5 -5
  41. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +10 -11
  42. package/node_modules/@ykdz/template-core/package.json +9 -2
  43. package/package.json +12 -5
package/dist/cli.js CHANGED
@@ -278,9 +278,9 @@ function printInitComplete(options, blueprint, generationContext) {
278
278
  dryRun: false,
279
279
  targetDir: options.dir,
280
280
  blueprint,
281
- toolchain: generationContext
282
- ? toolchainReport(generationContext.toolchain)
283
- : undefined,
281
+ ...(generationContext
282
+ ? { toolchain: toolchainReport(generationContext.toolchain) }
283
+ : {}),
284
284
  nextSteps,
285
285
  });
286
286
  return;
@@ -301,7 +301,7 @@ function printInitComplete(options, blueprint, generationContext) {
301
301
  console.log(formatProjectionNextSteps(options.dir, projectionPlan));
302
302
  }
303
303
  function isInteractiveTerminal() {
304
- return Boolean(process.stdin.isTTY && process.stdout.isTTY);
304
+ return process.stdin.isTTY && process.stdout.isTTY;
305
305
  }
306
306
  async function confirmInit(targetDir, blueprint) {
307
307
  console.log(formatBlueprintSummary(targetDir, blueprint));
@@ -474,9 +474,9 @@ async function main(args) {
474
474
  dryRun: true,
475
475
  targetDir: options.dir,
476
476
  blueprint,
477
- toolchain: generationContext
478
- ? toolchainReport(generationContext.toolchain)
479
- : undefined,
477
+ ...(generationContext
478
+ ? { toolchain: toolchainReport(generationContext.toolchain) }
479
+ : {}),
480
480
  nextSteps,
481
481
  });
482
482
  return;
@@ -19,19 +19,23 @@ function readPathExists(filePath) {
19
19
  return true;
20
20
  }
21
21
  catch (error) {
22
- if (error instanceof Error &&
23
- "code" in error &&
24
- error.code === "EISDIR") {
22
+ if (errorCode(error) === "EISDIR") {
25
23
  return true;
26
24
  }
27
- if (error instanceof Error &&
28
- "code" in error &&
29
- error.code === "ENOENT") {
25
+ if (errorCode(error) === "ENOENT") {
30
26
  return false;
31
27
  }
32
28
  return false;
33
29
  }
34
30
  }
31
+ function errorCode(error) {
32
+ if (error instanceof Error &&
33
+ "code" in error &&
34
+ typeof error.code === "string") {
35
+ return error.code;
36
+ }
37
+ return undefined;
38
+ }
35
39
  export function builtInPresetProjectionSourceRoots() {
36
40
  return {
37
41
  preset(sourcePreset) {
@@ -77,8 +77,8 @@ export function projectHonoApiPackageScripts() {
77
77
  fix: renderFixCommand(planHonoApiPackageFixes()),
78
78
  "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
79
79
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
80
- lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
81
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
80
+ lint: "oxlint --config ../../oxlint.config.ts .",
81
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
82
82
  start: "node dist/server.js",
83
83
  test: "vitest run",
84
84
  typecheck: "tsc -p tsconfig.json --noEmit",
@@ -118,6 +118,7 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
118
118
  "@types/node": "catalog:",
119
119
  oxfmt: "catalog:",
120
120
  oxlint: "catalog:",
121
+ "oxlint-tsgolint": "catalog:",
121
122
  "tsc-alias": "catalog:",
122
123
  typescript: "catalog:",
123
124
  vitest: "catalog:",
@@ -133,13 +134,22 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
133
134
  value: {
134
135
  compilerOptions: {
135
136
  composite: true,
136
- module: "NodeNext",
137
- moduleResolution: "NodeNext",
137
+ erasableSyntaxOnly: true,
138
+ exactOptionalPropertyTypes: true,
139
+ forceConsistentCasingInFileNames: true,
140
+ isolatedModules: true,
141
+ module: "nodenext",
142
+ moduleResolution: "nodenext",
138
143
  noEmitOnError: true,
144
+ noFallthroughCasesInSwitch: true,
145
+ noImplicitOverride: true,
146
+ noImplicitReturns: true,
147
+ noUncheckedIndexedAccess: true,
139
148
  skipLibCheck: false,
140
149
  strict: true,
141
- target: "ES2022",
150
+ target: "es2023",
142
151
  types: ["node", "vitest/globals"],
152
+ verbatimModuleSyntax: true,
143
153
  },
144
154
  include: ["src/**/*.ts", "test/**/*.ts", "vitest.config.ts"],
145
155
  },
@@ -82,8 +82,8 @@ export function projectTsLibPackageScripts() {
82
82
  fix: renderFixCommand(fixPlan),
83
83
  "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
84
84
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
85
- lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
86
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
85
+ lint: "oxlint --config ../../oxlint.config.ts .",
86
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
87
87
  typecheck: "tsc -p tsconfig.json --noEmit",
88
88
  };
89
89
  }
@@ -119,6 +119,7 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
119
119
  "@types/node": "catalog:",
120
120
  oxfmt: "catalog:",
121
121
  oxlint: "catalog:",
122
+ "oxlint-tsgolint": "catalog:",
122
123
  typescript: "catalog:",
123
124
  },
124
125
  engines: {
@@ -135,14 +136,23 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
135
136
  composite: true,
136
137
  declaration: true,
137
138
  declarationMap: true,
138
- module: "NodeNext",
139
- moduleResolution: "NodeNext",
139
+ erasableSyntaxOnly: true,
140
+ exactOptionalPropertyTypes: true,
141
+ forceConsistentCasingInFileNames: true,
142
+ isolatedModules: true,
143
+ module: "nodenext",
144
+ moduleResolution: "nodenext",
140
145
  noEmitOnError: true,
146
+ noFallthroughCasesInSwitch: true,
147
+ noImplicitOverride: true,
148
+ noImplicitReturns: true,
149
+ noUncheckedIndexedAccess: true,
141
150
  rootDir: "src",
142
151
  skipLibCheck: false,
143
152
  strict: true,
144
- target: "ES2022",
153
+ target: "es2023",
145
154
  types: ["node"],
155
+ verbatimModuleSyntax: true,
146
156
  },
147
157
  include: ["src/**/*.ts"],
148
158
  },
@@ -79,11 +79,11 @@ export function projectVueAppPackageScripts() {
79
79
  fix: renderFixCommand(planVueAppPackageFixes()),
80
80
  "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
81
81
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
82
- lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
83
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
82
+ lint: "oxlint --config ../../oxlint.config.ts .",
83
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
84
84
  preview: "vite preview",
85
85
  test: "vitest run",
86
- "test:e2e": "pnpm run build && playwright test",
86
+ "test:e2e": "pnpm run build && node --experimental-strip-types scripts/run-playwright.ts",
87
87
  typecheck: "vue-tsc --build --noEmit",
88
88
  };
89
89
  }
@@ -165,7 +165,6 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
165
165
  },
166
166
  scripts: projectVueAppPackageScripts(),
167
167
  dependencies: {
168
- "@vueuse/core": "catalog:",
169
168
  pinia: "catalog:",
170
169
  vue: "catalog:",
171
170
  },
@@ -178,6 +177,7 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
178
177
  "@vue/tsconfig": "catalog:",
179
178
  oxfmt: "catalog:",
180
179
  oxlint: "catalog:",
180
+ "oxlint-tsgolint": "catalog:",
181
181
  tailwindcss: "catalog:",
182
182
  typescript: "catalog:",
183
183
  vite: "catalog:",
@@ -208,14 +208,23 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
208
208
  extends: "@vue/tsconfig/tsconfig.dom.json",
209
209
  compilerOptions: {
210
210
  composite: true,
211
+ erasableSyntaxOnly: true,
212
+ exactOptionalPropertyTypes: true,
213
+ forceConsistentCasingInFileNames: true,
214
+ isolatedModules: true,
211
215
  module: "ESNext",
212
216
  moduleResolution: "Bundler",
213
217
  noEmitOnError: true,
218
+ noFallthroughCasesInSwitch: true,
219
+ noImplicitOverride: true,
220
+ noImplicitReturns: true,
221
+ noUncheckedIndexedAccess: true,
214
222
  skipLibCheck: false,
215
223
  strict: true,
216
- target: "ES2022",
224
+ target: "es2023",
217
225
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
218
226
  types: ["web-bluetooth"],
227
+ verbatimModuleSyntax: true,
219
228
  },
220
229
  include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
221
230
  },
@@ -236,20 +245,35 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
236
245
  {
237
246
  kind: "writeJson",
238
247
  to: `${packagePath}/tsconfig.node.json`,
248
+ multilineArrays: ["include"],
239
249
  value: {
240
250
  compilerOptions: {
241
251
  composite: true,
252
+ erasableSyntaxOnly: true,
253
+ exactOptionalPropertyTypes: true,
254
+ forceConsistentCasingInFileNames: true,
255
+ isolatedModules: true,
242
256
  module: "ESNext",
243
257
  moduleResolution: "Bundler",
244
258
  noEmitOnError: true,
245
259
  lib: ["ESNext", "DOM", "DOM.Iterable"],
260
+ noFallthroughCasesInSwitch: true,
261
+ noImplicitOverride: true,
262
+ noImplicitReturns: true,
263
+ noUncheckedIndexedAccess: true,
246
264
  skipLibCheck: false,
247
265
  strict: true,
248
- target: "ES2022",
266
+ target: "es2023",
249
267
  tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
250
268
  types: ["node"],
269
+ verbatimModuleSyntax: true,
251
270
  },
252
- include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
271
+ include: [
272
+ "playwright.config.ts",
273
+ "scripts/**/*.ts",
274
+ "vite.config.ts",
275
+ "vitest.config.ts",
276
+ ],
253
277
  },
254
278
  },
255
279
  { kind: "copyFile", from: "env.d.ts", to: `${packagePath}/env.d.ts` },
@@ -77,7 +77,6 @@ function planVueHonoRootChecks() {
77
77
  { kind: "turbo-package-typecheck", owner: workspacePackageBoundary },
78
78
  { kind: "turbo-package-build", owner: workspacePackageBoundary },
79
79
  { kind: "turbo-package-test", owner: workspacePackageBoundary },
80
- { kind: "turbo-package-e2e-test", owner: workspacePackageBoundary },
81
80
  { kind: "turbo-package-check", owner: workspacePackageBoundary },
82
81
  ],
83
82
  environmentNeeds: [
@@ -145,8 +144,8 @@ export function projectVueHonoRootPackageScripts() {
145
144
  fix: renderFixCommand(planVueHonoRootFixes()),
146
145
  "format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
147
146
  "format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
148
- lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --deny-warnings",
149
- "lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix --deny-warnings",
147
+ lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts",
148
+ "lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix",
150
149
  typecheck: "tsc -p tsconfig.config.json --noEmit",
151
150
  };
152
151
  }
@@ -158,8 +157,8 @@ export function projectVueHonoApiPackageScripts() {
158
157
  fix: renderFixCommand(planVueHonoPackageFixes(apiPackageBoundary)),
159
158
  "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
160
159
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
161
- lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
162
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
160
+ lint: "oxlint --config ../../oxlint.config.ts .",
161
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
163
162
  start: "node dist/server.js",
164
163
  test: "vitest run",
165
164
  typecheck: "tsc -p tsconfig.json --noEmit",
@@ -173,11 +172,11 @@ export function projectVueHonoWebPackageScripts() {
173
172
  fix: renderFixCommand(planVueHonoPackageFixes(webPackageBoundary)),
174
173
  "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
175
174
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
176
- lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
177
- "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
175
+ lint: "oxlint --config ../../oxlint.config.ts .",
176
+ "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
178
177
  preview: "vite preview",
179
178
  test: "vitest run",
180
- "test:e2e": "pnpm run build && playwright test",
179
+ "test:e2e": "pnpm run build && node --experimental-strip-types scripts/run-playwright.ts",
181
180
  typecheck: "vue-tsc --build",
182
181
  };
183
182
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template-builtin-source",
3
- "version": "0.0.8",
3
+ "version": "0.0.0",
4
4
  "private": true,
5
5
  "files": [
6
6
  "dist",
@@ -33,6 +33,16 @@
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
36
+ "check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:static-source",
37
+ "check:templates:shared-oxc": "pnpm run check:templates:shared-oxc:format && pnpm run check:templates:shared-oxc:lint && pnpm run check:templates:shared-oxc:typecheck",
38
+ "check:templates:shared-oxc:format": "oxfmt --check templates/shared/oxc",
39
+ "check:templates:shared-oxc:lint": "oxlint --config templates/shared/oxc/node/oxlint.config.ts templates/shared/oxc",
40
+ "check:templates:shared-oxc:typecheck": "tsc -p templates/shared/oxc/tsconfig.json --noEmit",
41
+ "check:templates:static-source": "rustup run stable rustfmt --check templates/rust-bin/src/main.rs",
42
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts --ignore-path ../../.oxfmtignore .",
43
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts --ignore-path ../../.oxfmtignore .",
44
+ "lint": "oxlint --config ../../oxlint.config.ts src templates/projection-plans.ts templates/registry.ts templates/*/projection.ts",
45
+ "lint:fix": "oxlint --config ../../oxlint.config.ts src templates/projection-plans.ts templates/registry.ts templates/*/projection.ts --fix",
36
46
  "typecheck": "tsc -p tsconfig.json --noEmit"
37
47
  },
38
48
  "dependencies": {
@@ -41,6 +51,9 @@
41
51
  "valibot": "catalog:"
42
52
  },
43
53
  "devDependencies": {
44
- "@types/node": "catalog:"
54
+ "@types/node": "catalog:",
55
+ "oxfmt": "catalog:",
56
+ "oxlint": "catalog:",
57
+ "oxlint-tsgolint": "catalog:"
45
58
  }
46
59
  }
@@ -18,6 +18,10 @@
18
18
  "id": "shared-oxc-format",
19
19
  "path": "shared/oxc/oxfmt.config.ts"
20
20
  },
21
+ {
22
+ "id": "shared-oxc-root-tsconfig",
23
+ "path": "shared/oxc/tsconfig.config.json"
24
+ },
21
25
  {
22
26
  "id": "shared-oxc-vue",
23
27
  "path": "shared/oxc/vue"
@@ -145,6 +149,7 @@
145
149
  "@types/node",
146
150
  "oxfmt",
147
151
  "oxlint",
152
+ "oxlint-tsgolint",
148
153
  "turbo",
149
154
  "typescript",
150
155
  "valibot"
@@ -170,7 +175,8 @@
170
175
  "shared-devcontainer",
171
176
  "shared-editor-customization",
172
177
  "shared-oxc-node",
173
- "shared-oxc-format"
178
+ "shared-oxc-format",
179
+ "shared-oxc-root-tsconfig"
174
180
  ]
175
181
  }
176
182
  },
@@ -198,6 +204,7 @@
198
204
  "hono",
199
205
  "oxfmt",
200
206
  "oxlint",
207
+ "oxlint-tsgolint",
201
208
  "tsc-alias",
202
209
  "turbo",
203
210
  "typescript",
@@ -234,7 +241,8 @@
234
241
  "shared-devcontainer",
235
242
  "shared-editor-customization",
236
243
  "shared-oxc-node",
237
- "shared-oxc-format"
244
+ "shared-oxc-format",
245
+ "shared-oxc-root-tsconfig"
238
246
  ]
239
247
  }
240
248
  },
@@ -263,9 +271,9 @@
263
271
  "@types/web-bluetooth",
264
272
  "@vitejs/plugin-vue",
265
273
  "@vue/tsconfig",
266
- "@vueuse/core",
267
274
  "oxfmt",
268
275
  "oxlint",
276
+ "oxlint-tsgolint",
269
277
  "pinia",
270
278
  "tailwindcss",
271
279
  "turbo",
@@ -288,6 +296,7 @@
288
296
  "env.d.ts",
289
297
  "index.html",
290
298
  "playwright.config.ts",
299
+ "scripts/run-playwright.ts",
291
300
  "vite.config.ts",
292
301
  "vitest.config.ts",
293
302
  "src/App.vue",
@@ -313,6 +322,7 @@
313
322
  "vue-app/index.html",
314
323
  "vue-app/playwright.package-addition.config.ts",
315
324
  "vue-app/playwright.config.ts",
325
+ "vue-app/scripts/run-playwright.ts",
316
326
  "vue-app/vite.config.ts",
317
327
  "vue-app/vitest.config.ts"
318
328
  ],
@@ -320,6 +330,7 @@
320
330
  "shared-devcontainer",
321
331
  "shared-editor-customization",
322
332
  "shared-oxc-format",
333
+ "shared-oxc-root-tsconfig",
323
334
  "shared-oxc-vue"
324
335
  ]
325
336
  }
@@ -350,10 +361,10 @@
350
361
  "@types/web-bluetooth",
351
362
  "@vitejs/plugin-vue",
352
363
  "@vue/tsconfig",
353
- "@vueuse/core",
354
364
  "hono",
355
365
  "oxfmt",
356
366
  "oxlint",
367
+ "oxlint-tsgolint",
357
368
  "pinia",
358
369
  "tailwindcss",
359
370
  "tsc-alias",
@@ -378,6 +389,7 @@
378
389
  "web/env.d.ts",
379
390
  "web/index.html",
380
391
  "web/playwright.config.ts",
392
+ "web/scripts/run-playwright.ts",
381
393
  "web/vite.config.ts",
382
394
  "web/vitest.config.ts",
383
395
  "web/src/api.ts",
@@ -427,6 +439,7 @@
427
439
  "vue-hono-app/web/env.d.ts",
428
440
  "vue-hono-app/web/index.html",
429
441
  "vue-hono-app/web/playwright.config.ts",
442
+ "vue-hono-app/web/scripts/run-playwright.ts",
430
443
  "vue-hono-app/web/vite.config.ts",
431
444
  "vue-hono-app/web/vitest.config.ts"
432
445
  ],
@@ -435,6 +448,7 @@
435
448
  "shared-editor-customization",
436
449
  "shared-oxc-node",
437
450
  "shared-oxc-format",
451
+ "shared-oxc-root-tsconfig",
438
452
  "shared-oxc-vue"
439
453
  ]
440
454
  }
@@ -1,12 +1,34 @@
1
1
  import { defineConfig } from "oxlint";
2
2
 
3
3
  export default defineConfig({
4
+ options: {
5
+ typeAware: true,
6
+ },
4
7
  categories: {
5
8
  correctness: "error",
6
- suspicious: "error",
9
+ suspicious: "warn",
7
10
  },
8
- plugins: ["typescript", "oxc"],
11
+ plugins: [
12
+ "eslint",
13
+ "typescript",
14
+ "unicorn",
15
+ "oxc",
16
+ "node",
17
+ "import",
18
+ "vitest",
19
+ "promise",
20
+ ],
9
21
  rules: {
10
- "no-unused-vars": "error",
22
+ "typescript/consistent-return": "off",
23
+ "typescript/no-misused-promises": "error",
24
+ "typescript/no-unsafe-argument": "warn",
25
+ "typescript/no-unsafe-assignment": "warn",
26
+ "typescript/no-unsafe-call": "warn",
27
+ "typescript/no-unsafe-member-access": "warn",
28
+ "typescript/no-unsafe-return": "warn",
29
+ "typescript/switch-exhaustiveness-check": "error",
30
+ "vitest/expect-expect": "off",
31
+ "vitest/no-conditional-expect": "off",
32
+ "vitest/require-to-throw-message": "off",
11
33
  },
12
34
  });
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "erasableSyntaxOnly": true,
4
+ "exactOptionalPropertyTypes": true,
5
+ "forceConsistentCasingInFileNames": true,
6
+ "isolatedModules": true,
7
+ "module": "nodenext",
8
+ "moduleResolution": "nodenext",
9
+ "noEmitOnError": true,
10
+ "noFallthroughCasesInSwitch": true,
11
+ "noImplicitOverride": true,
12
+ "noImplicitReturns": true,
13
+ "noUncheckedIndexedAccess": true,
14
+ "skipLibCheck": false,
15
+ "strict": true,
16
+ "target": "es2023",
17
+ "verbatimModuleSyntax": true
18
+ },
19
+ "include": ["oxlint.config.ts", "oxfmt.config.ts"]
20
+ }
@@ -1,12 +1,36 @@
1
1
  import { defineConfig } from "oxlint";
2
2
 
3
3
  export default defineConfig({
4
+ options: {
5
+ typeAware: true,
6
+ },
4
7
  categories: {
5
8
  correctness: "error",
6
- suspicious: "error",
9
+ suspicious: "warn",
7
10
  },
8
- plugins: ["typescript", "oxc", "vue"],
11
+ plugins: [
12
+ "eslint",
13
+ "typescript",
14
+ "unicorn",
15
+ "oxc",
16
+ "node",
17
+ "import",
18
+ "vitest",
19
+ "promise",
20
+ "vue",
21
+ ],
9
22
  rules: {
10
- "no-unused-vars": "error",
23
+ "typescript/consistent-return": "off",
24
+ "import/no-unassigned-import": ["warn", { allow: ["**/*.css"] }],
25
+ "typescript/no-misused-promises": "error",
26
+ "typescript/no-unsafe-argument": "warn",
27
+ "typescript/no-unsafe-assignment": "warn",
28
+ "typescript/no-unsafe-call": "warn",
29
+ "typescript/no-unsafe-member-access": "warn",
30
+ "typescript/no-unsafe-return": "warn",
31
+ "typescript/switch-exhaustiveness-check": "error",
32
+ "vitest/expect-expect": "off",
33
+ "vitest/no-conditional-expect": "off",
34
+ "vitest/require-to-throw-message": "off",
11
35
  },
12
36
  });
@@ -1 +1,8 @@
1
1
  /// <reference types="vite/client" />
2
+
3
+ declare module "*.vue" {
4
+ import type { DefineComponent } from "vue";
5
+
6
+ const component: DefineComponent<object, object, unknown>;
7
+ export default component;
8
+ }
@@ -0,0 +1,25 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ const env: NodeJS.ProcessEnv = { ...process.env };
4
+ delete env.NO_COLOR;
5
+
6
+ const command = process.platform === "win32" ? "playwright.cmd" : "playwright";
7
+ const child = spawn(command, ["test", ...process.argv.slice(2)], {
8
+ env,
9
+ stdio: "inherit",
10
+ });
11
+
12
+ child.once("error", (error: Error) => {
13
+ console.error(error);
14
+ process.exitCode = 1;
15
+ });
16
+
17
+ child.once("exit", (code: number | null, signal: NodeJS.Signals | null) => {
18
+ if (signal) {
19
+ console.error(`Playwright exited with signal ${signal}`);
20
+ process.exitCode = 1;
21
+ return;
22
+ }
23
+
24
+ process.exitCode = code ?? 1;
25
+ });
@@ -1,14 +1,28 @@
1
1
  <script setup lang="ts">
2
- import { usePreferredDark } from "@vueuse/core";
3
2
  import { storeToRefs } from "pinia";
4
- import { computed } from "vue";
3
+ import { onMounted, onUnmounted, ref } from "vue";
5
4
 
6
5
  import { useCounterStore } from "#/stores/counter";
7
6
 
8
7
  const counter = useCounterStore();
9
8
  const { count } = storeToRefs(counter);
10
- const prefersDark = usePreferredDark();
11
- const themeLabel = computed(() => (prefersDark.value ? "dark" : "light"));
9
+ const themeLabel = ref<"dark" | "light">("light");
10
+
11
+ let preferredThemeQuery: MediaQueryList | undefined;
12
+
13
+ function updateThemeLabel(event: MediaQueryList | MediaQueryListEvent): void {
14
+ themeLabel.value = event.matches ? "dark" : "light";
15
+ }
16
+
17
+ onMounted(() => {
18
+ preferredThemeQuery = window.matchMedia("(prefers-color-scheme: dark)");
19
+ updateThemeLabel(preferredThemeQuery);
20
+ preferredThemeQuery.addEventListener("change", updateThemeLabel);
21
+ });
22
+
23
+ onUnmounted(() => {
24
+ preferredThemeQuery?.removeEventListener("change", updateThemeLabel);
25
+ });
12
26
  </script>
13
27
 
14
28
  <template>
@@ -1,5 +1,12 @@
1
1
  /// <reference types="vite/client" />
2
2
 
3
+ declare module "*.vue" {
4
+ import type { DefineComponent } from "vue";
5
+
6
+ const component: DefineComponent<object, object, unknown>;
7
+ export default component;
8
+ }
9
+
3
10
  interface ImportMetaEnv {
4
11
  readonly VITE_API_BASE_URL?: string;
5
12
  }
@@ -0,0 +1,25 @@
1
+ import { spawn } from "node:child_process";
2
+
3
+ const env: NodeJS.ProcessEnv = { ...process.env };
4
+ delete env.NO_COLOR;
5
+
6
+ const command = process.platform === "win32" ? "playwright.cmd" : "playwright";
7
+ const child = spawn(command, ["test", ...process.argv.slice(2)], {
8
+ env,
9
+ stdio: "inherit",
10
+ });
11
+
12
+ child.once("error", (error: Error) => {
13
+ console.error(error);
14
+ process.exitCode = 1;
15
+ });
16
+
17
+ child.once("exit", (code: number | null, signal: NodeJS.Signals | null) => {
18
+ if (signal) {
19
+ console.error(`Playwright exited with signal ${signal}`);
20
+ process.exitCode = 1;
21
+ return;
22
+ }
23
+
24
+ process.exitCode = code ?? 1;
25
+ });