@ykdz/template 0.0.9 → 0.0.11

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 (51) hide show
  1. package/dist/cli.js +2 -2
  2. package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +4 -4
  3. package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +12 -5
  4. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.d.ts +1 -1
  5. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +1 -1
  6. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +9 -6
  7. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +1 -1
  8. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +1 -1
  9. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +1 -1
  10. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +1 -1
  11. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +1 -1
  12. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +9 -4
  13. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +1 -1
  14. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +7 -7
  15. package/node_modules/@ykdz/template-builtin-source/package.json +4 -3
  16. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +39 -11
  17. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/scripts/run-playwright.ts +25 -0
  18. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/src/App.vue +18 -4
  19. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/scripts/run-playwright.ts +25 -0
  20. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/App.vue +18 -4
  21. package/node_modules/@ykdz/template-core/dist/declarations.d.ts +2 -203
  22. package/node_modules/@ykdz/template-core/dist/declarations.js +1 -303
  23. package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +17 -0
  24. package/node_modules/@ykdz/template-core/dist/devcontainer.js +22 -21
  25. package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +10 -1
  26. package/node_modules/@ykdz/template-core/dist/editor-customization.js +36 -26
  27. package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +5 -0
  28. package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +42 -24
  29. package/node_modules/@ykdz/template-core/dist/generation-context.d.ts +1 -1
  30. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +19 -1
  31. package/node_modules/@ykdz/template-core/dist/module-graph.js +42 -3
  32. package/node_modules/@ykdz/template-core/dist/next-step-instructions.d.ts +2 -0
  33. package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +11 -22
  34. package/node_modules/@ykdz/template-core/dist/package-addition-support.d.ts +2 -1
  35. package/node_modules/@ykdz/template-core/dist/package-addition-support.js +2 -4
  36. package/node_modules/@ykdz/template-core/dist/package-addition.js +4 -3
  37. package/node_modules/@ykdz/template-core/dist/package-linking.d.ts +2 -6
  38. package/node_modules/@ykdz/template-core/dist/package-linking.js +1 -1
  39. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +3 -5
  40. package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +1 -2
  41. package/node_modules/@ykdz/template-core/dist/preset-source.d.ts +4 -418
  42. package/node_modules/@ykdz/template-core/dist/preset-source.js +81 -726
  43. package/node_modules/@ykdz/template-core/dist/project-github.js +2 -6
  44. package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +5 -53
  45. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +108 -507
  46. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +1 -1
  47. package/node_modules/@ykdz/template-core/package.json +4 -3
  48. package/node_modules/@ykdz/template-shared/dist/index.d.ts +794 -0
  49. package/node_modules/@ykdz/template-shared/dist/index.js +1637 -0
  50. package/node_modules/@ykdz/template-shared/package.json +32 -0
  51. package/package.json +9 -6
package/dist/cli.js CHANGED
@@ -3,14 +3,14 @@ import { readFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { createInterface } from "node:readline/promises";
5
5
  import { builtInPresetProjectionSourceRoots, builtInPresets, findBuiltInPresetSourceManifestPreset, loadBuiltInPresetSourceManifest, projectBuiltInPresetSourcePreset, } from "@ykdz/template-builtin-source";
6
- import { blueprintJsonSchema, presetFileJsonSchema, validatePresetFile, validateProjectBlueprint, } from "@ykdz/template-core/declarations";
7
6
  import { assembleGenerationContext, } from "@ykdz/template-core/generation-context";
8
7
  import { addPackage } from "@ykdz/template-core/package-addition";
9
8
  import { planNextStepInstructionsForProjection, } from "@ykdz/template-core/preset-projection";
10
- import { presetSourceManifestJsonSchema, validateBuiltInPresetSourceManifest, validatePresetSourceManifest, } from "@ykdz/template-core/preset-source";
9
+ import { validateBuiltInPresetSourceManifest, validatePresetSourceManifest, } from "@ykdz/template-core/preset-source";
11
10
  import { blueprintForPresetSourcePreset } from "@ykdz/template-core/projection-capabilities";
12
11
  import { renderNewProject } from "@ykdz/template-core/renderer";
13
12
  import { resolveToolchainVersions, } from "@ykdz/template-core/toolchain-resolution";
13
+ import { blueprintJsonSchema, presetSourceManifestJsonSchema, presetFileJsonSchema, validatePresetFile, validateProjectBlueprint, } from "@ykdz/template-shared";
14
14
  function usage() {
15
15
  return [
16
16
  "Project Kit template CLI",
@@ -1,9 +1,9 @@
1
- import type { BuiltInPreset } from "@ykdz/template-core/declarations";
2
1
  import type { GenerationContext } from "@ykdz/template-core/generation-context";
3
2
  import type { PresetPackageAdditionOptions } from "@ykdz/template-core/preset-projection";
4
- import { type PresetSourceManifest, type PresetSourceManifestPreset } from "@ykdz/template-core/preset-source";
5
- import { type PresetProjectionSourceRoots, type PresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
6
- export { findPresetSourceManifestPreset, loadPresetSourceManifestFile, manifestReferencedSourceFiles, presetSourceManifestJsonSchema, validateBuiltInPresetSourceManifest, validatePresetSourceManifest, type PresetSourceManifest, type PresetSourceManifestPreset, } from "@ykdz/template-core/preset-source";
3
+ import { type PresetProjectionSourceRoots } from "@ykdz/template-core/projection-capabilities";
4
+ import { type BuiltInPreset, type PresetProjectionDeclaration, type PresetSourceManifest, type PresetSourceManifestPreset } from "@ykdz/template-shared";
5
+ export { findPresetSourceManifestPreset, loadPresetSourceManifestFile, manifestReferencedSourceFiles, validateBuiltInPresetSourceManifest, validatePresetSourceManifest, } from "@ykdz/template-core/preset-source";
6
+ export { presetSourceManifestJsonSchema, type PresetSourceManifest, type PresetSourceManifestPreset, } from "@ykdz/template-shared";
7
7
  export declare function builtInPresetSourceRoot(...segments: string[]): string;
8
8
  export declare function builtInPresetProjectionSourceRoots(): PresetProjectionSourceRoots;
9
9
  export declare function loadBuiltInPresetSourceManifest(): PresetSourceManifest;
@@ -2,8 +2,10 @@ import { readFileSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { findPresetSourceManifestPreset, validateBuiltInPresetSourceManifest, } from "@ykdz/template-core/preset-source";
5
- import { defaultPackagePathForPresetSourcePackageAddition, planPresetSourcePackageAddition, projectPresetSourcePreset, validateProjectionCapabilities, } from "@ykdz/template-core/projection-capabilities";
6
- export { findPresetSourceManifestPreset, loadPresetSourceManifestFile, manifestReferencedSourceFiles, presetSourceManifestJsonSchema, validateBuiltInPresetSourceManifest, validatePresetSourceManifest, } from "@ykdz/template-core/preset-source";
5
+ import { defaultPackagePathForPresetSourcePackageAddition, planPresetSourcePackageAddition, projectPresetSourcePreset, } from "@ykdz/template-core/projection-capabilities";
6
+ import { validatePresetProjectionDeclaration, } from "@ykdz/template-shared";
7
+ export { findPresetSourceManifestPreset, loadPresetSourceManifestFile, manifestReferencedSourceFiles, validateBuiltInPresetSourceManifest, validatePresetSourceManifest, } from "@ykdz/template-core/preset-source";
8
+ export { presetSourceManifestJsonSchema, } from "@ykdz/template-shared";
7
9
  export function builtInPresetSourceRoot(...segments) {
8
10
  const moduleDir = path.dirname(fileURLToPath(import.meta.url));
9
11
  const candidates = [
@@ -37,6 +39,8 @@ function errorCode(error) {
37
39
  return undefined;
38
40
  }
39
41
  export function builtInPresetProjectionSourceRoots() {
42
+ const manifest = loadBuiltInPresetSourceManifest();
43
+ const sharedResources = new Map(manifest.sharedResources.map((resource) => [resource.id, resource.path]));
40
44
  return {
41
45
  preset(sourcePreset) {
42
46
  return builtInPresetSourceRoot(sourcePreset);
@@ -44,8 +48,11 @@ export function builtInPresetProjectionSourceRoots() {
44
48
  sharedOxc() {
45
49
  return builtInPresetSourceRoot("shared", "oxc");
46
50
  },
47
- sharedDevcontainer() {
48
- return builtInPresetSourceRoot("shared", "devcontainer");
51
+ sharedResource(resourceId) {
52
+ const resourcePath = sharedResources.get(resourceId);
53
+ return resourcePath === undefined
54
+ ? undefined
55
+ : builtInPresetSourceRoot(resourcePath);
49
56
  },
50
57
  };
51
58
  }
@@ -71,7 +78,7 @@ export function loadBuiltInPresetProjectionDeclaration(presetName) {
71
78
  if (!preset?.projection) {
72
79
  throw new Error(`Built-in Preset ${presetName} must declare a Projection Declaration`);
73
80
  }
74
- const result = validateProjectionCapabilities(preset.projection);
81
+ const result = validatePresetProjectionDeclaration(preset.projection);
75
82
  if (!result.ok) {
76
83
  throw new Error(`Built-in Preset ${presetName} Projection Declaration is invalid:\n${result.issues
77
84
  .map((issue) => ` - ${issue.path}: ${issue.message}`)
@@ -1,5 +1,5 @@
1
- import type { BuiltInPreset, ProjectBlueprint } from "@ykdz/template-core/declarations";
2
1
  import type { PresetBlueprintOptions, PresetProjection } from "@ykdz/template-core/preset-projection";
2
+ import { type BuiltInPreset, type ProjectBlueprint } from "@ykdz/template-shared";
3
3
  export declare const honoApiPresetMetadata: BuiltInPreset;
4
4
  export declare function honoApiBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
5
5
  export declare function projectHonoApiPackageScripts(): Record<string, string>;
@@ -3,10 +3,10 @@ import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
5
5
  import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
6
- import { PackageAdditionSupport } from "@ykdz/template-core/package-addition-support";
7
6
  import { packageManifestExposureFields, planPackageLinks, } from "@ykdz/template-core/package-linking";
8
7
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
9
8
  import { renderNewProject, } from "@ykdz/template-core/renderer";
9
+ import { PackageAdditionSupport, } from "@ykdz/template-shared";
10
10
  export const honoApiPresetMetadata = {
11
11
  name: "hono-api",
12
12
  title: "Hono API",
@@ -1,3 +1,4 @@
1
+ import { playwrightBrowserAssetsEnvironmentNeed } from "@ykdz/template-core/module-graph";
1
2
  const rootPackageBoundary = {
2
3
  kind: "package-boundary",
3
4
  path: ".",
@@ -65,20 +66,22 @@ export function selectNodeFixComponents(target) {
65
66
  function checkEnvironmentNeeds(target) {
66
67
  if (target === "vue-app") {
67
68
  return [
68
- {
69
- kind: "playwright-browser-assets",
69
+ playwrightBrowserAssetsEnvironmentNeed({
70
70
  browser: "chromium",
71
71
  owner: rootPackageBoundary,
72
- },
72
+ id: "install-playwright-browsers",
73
+ label: "Install Playwright browser assets",
74
+ }),
73
75
  ];
74
76
  }
75
77
  if (target === "vue-hono-root" || target === "vue-hono-web") {
76
78
  return [
77
- {
78
- kind: "playwright-browser-assets",
79
+ playwrightBrowserAssetsEnvironmentNeed({
79
80
  browser: "chromium",
80
81
  owner: webPackageBoundary,
81
- },
82
+ id: "install-web-playwright-browsers",
83
+ label: "Install Playwright browser assets for web workspace",
84
+ }),
82
85
  ];
83
86
  }
84
87
  return [];
@@ -1,6 +1,6 @@
1
- import type { BuiltInPreset, ProjectBlueprint } from "@ykdz/template-core/declarations";
2
1
  import { type CheckPlan, type FixPlan } from "@ykdz/template-core/module-graph";
3
2
  import type { PresetBlueprintOptions, PresetProjection } from "@ykdz/template-core/preset-projection";
3
+ import { type BuiltInPreset, type ProjectBlueprint } from "@ykdz/template-shared";
4
4
  export declare const rustBinPresetMetadata: BuiltInPreset;
5
5
  export declare function planRustBinChecks(): CheckPlan;
6
6
  export declare function planRustBinFixes(): FixPlan;
@@ -1,9 +1,9 @@
1
1
  import path from "node:path";
2
2
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
3
3
  import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
4
- import { PackageAdditionSupport } from "@ykdz/template-core/package-addition-support";
5
4
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
6
5
  import { renderNewProject } from "@ykdz/template-core/renderer";
6
+ import { PackageAdditionSupport, } from "@ykdz/template-shared";
7
7
  export const rustBinPresetMetadata = {
8
8
  name: "rust-bin",
9
9
  title: "Rust binary",
@@ -1,5 +1,5 @@
1
- import type { BuiltInPreset, ProjectBlueprint } from "@ykdz/template-core/declarations";
2
1
  import type { PresetBlueprintOptions, PresetProjection } from "@ykdz/template-core/preset-projection";
2
+ import { type BuiltInPreset, type ProjectBlueprint } from "@ykdz/template-shared";
3
3
  export declare const tsLibPresetMetadata: BuiltInPreset;
4
4
  export declare function tsLibBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
5
5
  export declare function projectTsLibPackageScripts(): Record<string, string>;
@@ -3,10 +3,10 @@ import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
5
5
  import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
6
- import { PackageAdditionSupport } from "@ykdz/template-core/package-addition-support";
7
6
  import { packageManifestExposureFields, planPackageLinks, } from "@ykdz/template-core/package-linking";
8
7
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
9
8
  import { renderNewProject, } from "@ykdz/template-core/renderer";
9
+ import { PackageAdditionSupport, } from "@ykdz/template-shared";
10
10
  export const tsLibPresetMetadata = {
11
11
  name: "ts-lib",
12
12
  title: "TypeScript library",
@@ -1,5 +1,5 @@
1
- import type { BuiltInPreset, ProjectBlueprint } from "@ykdz/template-core/declarations";
2
1
  import type { PresetBlueprintOptions, PresetProjection } from "@ykdz/template-core/preset-projection";
2
+ import { type BuiltInPreset, type ProjectBlueprint } from "@ykdz/template-shared";
3
3
  export declare const vueAppPresetMetadata: BuiltInPreset;
4
4
  export declare function vueAppBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
5
5
  export declare function projectVueAppPackageScripts(): Record<string, string>;
@@ -4,9 +4,9 @@ import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
6
6
  import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
7
- import { PackageAdditionSupport } from "@ykdz/template-core/package-addition-support";
8
7
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
9
8
  import { renderNewProject, } from "@ykdz/template-core/renderer";
9
+ import { PackageAdditionSupport, } from "@ykdz/template-shared";
10
10
  export const vueAppPresetMetadata = {
11
11
  name: "vue-app",
12
12
  title: "Vue app",
@@ -83,7 +83,7 @@ export function projectVueAppPackageScripts() {
83
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
  },
@@ -246,6 +245,7 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
246
245
  {
247
246
  kind: "writeJson",
248
247
  to: `${packagePath}/tsconfig.node.json`,
248
+ multilineArrays: ["include"],
249
249
  value: {
250
250
  compilerOptions: {
251
251
  composite: true,
@@ -268,7 +268,12 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
268
268
  types: ["node"],
269
269
  verbatimModuleSyntax: true,
270
270
  },
271
- 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
+ ],
272
277
  },
273
278
  },
274
279
  { kind: "copyFile", from: "env.d.ts", to: `${packagePath}/env.d.ts` },
@@ -1,5 +1,5 @@
1
- import type { BuiltInPreset, ProjectBlueprint } from "@ykdz/template-core/declarations";
2
1
  import type { PresetBlueprintOptions, PresetProjection } from "@ykdz/template-core/preset-projection";
2
+ import { type BuiltInPreset, type ProjectBlueprint } from "@ykdz/template-shared";
3
3
  export declare const vueHonoAppPresetMetadata: BuiltInPreset;
4
4
  export declare function vueHonoAppBlueprint(options: PresetBlueprintOptions): ProjectBlueprint;
5
5
  export declare function projectVueHonoRootPackageScripts(): Record<string, string>;
@@ -1,9 +1,9 @@
1
1
  import path from "node:path";
2
2
  import { builtInPresetProjectionSourceRoots, loadBuiltInPresetProjectionDeclaration, } from "@ykdz/template-builtin-source";
3
- import { renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
4
- import { PackageAdditionSupport } from "@ykdz/template-core/package-addition-support";
3
+ import { playwrightBrowserAssetsEnvironmentNeed, renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
5
4
  import { interpretPresetProjectionDeclaration } from "@ykdz/template-core/projection-capabilities";
6
5
  import { renderNewProject } from "@ykdz/template-core/renderer";
6
+ import { PackageAdditionSupport, } from "@ykdz/template-shared";
7
7
  export const vueHonoAppPresetMetadata = {
8
8
  name: "vue-hono-app",
9
9
  title: "Vue Hono app",
@@ -77,15 +77,15 @@ 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: [
84
- {
85
- kind: "playwright-browser-assets",
83
+ playwrightBrowserAssetsEnvironmentNeed({
86
84
  browser: "chromium",
87
85
  owner: webWorkspaceBoundary,
88
- },
86
+ id: "install-web-playwright-browsers",
87
+ label: "Install Playwright browser assets for web workspace",
88
+ }),
89
89
  ],
90
90
  };
91
91
  }
@@ -177,7 +177,7 @@ export function projectVueHonoWebPackageScripts() {
177
177
  "lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
178
178
  preview: "vite preview",
179
179
  test: "vitest run",
180
- "test:e2e": "pnpm run build && playwright test",
180
+ "test:e2e": "pnpm run build && node --experimental-strip-types scripts/run-playwright.ts",
181
181
  typecheck: "vue-tsc --build",
182
182
  };
183
183
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template-builtin-source",
3
- "version": "0.0.9",
3
+ "version": "0.0.0",
4
4
  "private": true,
5
5
  "files": [
6
6
  "dist",
@@ -39,14 +39,15 @@
39
39
  "check:templates:shared-oxc:lint": "oxlint --config templates/shared/oxc/node/oxlint.config.ts templates/shared/oxc",
40
40
  "check:templates:shared-oxc:typecheck": "tsc -p templates/shared/oxc/tsconfig.json --noEmit",
41
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 .",
42
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
43
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
44
44
  "lint": "oxlint --config ../../oxlint.config.ts src templates/projection-plans.ts templates/registry.ts templates/*/projection.ts",
45
45
  "lint:fix": "oxlint --config ../../oxlint.config.ts src templates/projection-plans.ts templates/registry.ts templates/*/projection.ts --fix",
46
46
  "typecheck": "tsc -p tsconfig.json --noEmit"
47
47
  },
48
48
  "dependencies": {
49
49
  "@ykdz/template-core": "workspace:*",
50
+ "@ykdz/template-shared": "workspace:*",
50
51
  "typescript": "catalog:",
51
52
  "valibot": "catalog:"
52
53
  },
@@ -164,8 +164,14 @@
164
164
  "sourceFiles": ["src/index.ts", "src/name-schema.ts"]
165
165
  },
166
166
  { "kind": "strict-typescript-root" },
167
- { "kind": "oxc-format-lint" },
168
- { "kind": "node-pnpm-devcontainer" },
167
+ {
168
+ "kind": "oxc-format-lint",
169
+ "editorCustomizationResourceId": "shared-editor-customization"
170
+ },
171
+ {
172
+ "kind": "node-pnpm-devcontainer",
173
+ "devcontainerResourceId": "shared-devcontainer"
174
+ },
169
175
  { "kind": "github-maintenance" }
170
176
  ]
171
177
  },
@@ -229,8 +235,14 @@
229
235
  ]
230
236
  },
231
237
  { "kind": "strict-typescript-root" },
232
- { "kind": "oxc-format-lint" },
233
- { "kind": "node-pnpm-devcontainer" },
238
+ {
239
+ "kind": "oxc-format-lint",
240
+ "editorCustomizationResourceId": "shared-editor-customization"
241
+ },
242
+ {
243
+ "kind": "node-pnpm-devcontainer",
244
+ "devcontainerResourceId": "shared-devcontainer"
245
+ },
234
246
  { "kind": "github-maintenance" }
235
247
  ]
236
248
  },
@@ -271,7 +283,6 @@
271
283
  "@types/web-bluetooth",
272
284
  "@vitejs/plugin-vue",
273
285
  "@vue/tsconfig",
274
- "@vueuse/core",
275
286
  "oxfmt",
276
287
  "oxlint",
277
288
  "oxlint-tsgolint",
@@ -297,6 +308,7 @@
297
308
  "env.d.ts",
298
309
  "index.html",
299
310
  "playwright.config.ts",
311
+ "scripts/run-playwright.ts",
300
312
  "vite.config.ts",
301
313
  "vitest.config.ts",
302
314
  "src/App.vue",
@@ -310,8 +322,14 @@
310
322
  ]
311
323
  },
312
324
  { "kind": "strict-typescript-root" },
313
- { "kind": "oxc-format-lint" },
314
- { "kind": "node-pnpm-devcontainer" },
325
+ {
326
+ "kind": "oxc-format-lint",
327
+ "editorCustomizationResourceId": "shared-editor-customization"
328
+ },
329
+ {
330
+ "kind": "node-pnpm-devcontainer",
331
+ "devcontainerResourceId": "shared-devcontainer"
332
+ },
315
333
  { "kind": "github-maintenance" }
316
334
  ]
317
335
  },
@@ -322,6 +340,7 @@
322
340
  "vue-app/index.html",
323
341
  "vue-app/playwright.package-addition.config.ts",
324
342
  "vue-app/playwright.config.ts",
343
+ "vue-app/scripts/run-playwright.ts",
325
344
  "vue-app/vite.config.ts",
326
345
  "vue-app/vitest.config.ts"
327
346
  ],
@@ -360,7 +379,6 @@
360
379
  "@types/web-bluetooth",
361
380
  "@vitejs/plugin-vue",
362
381
  "@vue/tsconfig",
363
- "@vueuse/core",
364
382
  "hono",
365
383
  "oxfmt",
366
384
  "oxlint",
@@ -389,6 +407,7 @@
389
407
  "web/env.d.ts",
390
408
  "web/index.html",
391
409
  "web/playwright.config.ts",
410
+ "web/scripts/run-playwright.ts",
392
411
  "web/vite.config.ts",
393
412
  "web/vitest.config.ts",
394
413
  "web/src/api.ts",
@@ -420,8 +439,14 @@
420
439
  ]
421
440
  },
422
441
  { "kind": "strict-typescript-root" },
423
- { "kind": "oxc-format-lint" },
424
- { "kind": "node-pnpm-devcontainer" },
442
+ {
443
+ "kind": "oxc-format-lint",
444
+ "editorCustomizationResourceId": "shared-editor-customization"
445
+ },
446
+ {
447
+ "kind": "node-pnpm-devcontainer",
448
+ "devcontainerResourceId": "shared-devcontainer"
449
+ },
425
450
  { "kind": "github-maintenance" }
426
451
  ]
427
452
  },
@@ -438,6 +463,7 @@
438
463
  "vue-hono-app/web/env.d.ts",
439
464
  "vue-hono-app/web/index.html",
440
465
  "vue-hono-app/web/playwright.config.ts",
466
+ "vue-hono-app/web/scripts/run-playwright.ts",
441
467
  "vue-hono-app/web/vite.config.ts",
442
468
  "vue-hono-app/web/vitest.config.ts"
443
469
  ],
@@ -474,7 +500,9 @@
474
500
  {
475
501
  "kind": "rust-binary-workspace",
476
502
  "workspacePackageGlob": "packages/*",
477
- "sourceFiles": ["src/main.rs"]
503
+ "sourceFiles": ["src/main.rs"],
504
+ "devcontainerResourceId": "shared-devcontainer",
505
+ "editorCustomizationResourceId": "shared-editor-customization"
478
506
  }
479
507
  ]
480
508
  },
@@ -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>
@@ -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,17 +1,31 @@
1
1
  <script setup lang="ts">
2
- import { usePreferredDark } from "@vueuse/core";
3
2
  import { storeToRefs } from "pinia";
4
- import { computed, onMounted, ref } from "vue";
3
+ import { onMounted, onUnmounted, ref } from "vue";
5
4
 
6
5
  import { api } from "#/api";
7
6
  import { useCounterStore } from "#/stores/counter";
8
7
 
9
8
  const counter = useCounterStore();
10
9
  const { count } = storeToRefs(counter);
11
- const prefersDark = usePreferredDark();
12
- const themeLabel = computed(() => (prefersDark.value ? "dark" : "light"));
10
+ const themeLabel = ref<"dark" | "light">("light");
13
11
  const apiStatus = ref("checking");
14
12
 
13
+ let preferredThemeQuery: MediaQueryList | undefined;
14
+
15
+ function updateThemeLabel(event: MediaQueryList | MediaQueryListEvent): void {
16
+ themeLabel.value = event.matches ? "dark" : "light";
17
+ }
18
+
19
+ onMounted(() => {
20
+ preferredThemeQuery = window.matchMedia("(prefers-color-scheme: dark)");
21
+ updateThemeLabel(preferredThemeQuery);
22
+ preferredThemeQuery.addEventListener("change", updateThemeLabel);
23
+ });
24
+
25
+ onUnmounted(() => {
26
+ preferredThemeQuery?.removeEventListener("change", updateThemeLabel);
27
+ });
28
+
15
29
  onMounted(async () => {
16
30
  const response = await api.api.health.$get();
17
31
  const body = await response.json();