@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
@@ -233,14 +233,12 @@ function jsonValuesEqual(left, right) {
233
233
  return false;
234
234
  }
235
235
  const leftEntries = Object.entries(left);
236
- const rightRecord = right;
237
- const rightKeys = new Set(Object.keys(rightRecord));
238
- return (leftEntries.length === rightKeys.size &&
236
+ const rightEntries = Object.entries(right);
237
+ const rightValues = new Map(rightEntries);
238
+ return (leftEntries.length === rightEntries.length &&
239
239
  leftEntries.every(([key, value]) => {
240
- rightKeys.delete(key);
241
- return jsonValuesEqual(value, rightRecord[key]);
242
- }) &&
243
- rightKeys.size === 0);
240
+ return (rightValues.has(key) && jsonValuesEqual(value, rightValues.get(key)));
241
+ }));
244
242
  }
245
243
  function expressionMatchesJsonValue(expression, expectedValue) {
246
244
  const literalValue = expressionLiteralJsonValue(expression);
@@ -383,12 +381,12 @@ function isStructuralTurboValue(value) {
383
381
  });
384
382
  }
385
383
  const rootTsconfigConfigCompilerOptions = {
386
- module: "NodeNext",
387
- moduleResolution: "NodeNext",
384
+ module: "nodenext",
385
+ moduleResolution: "nodenext",
388
386
  noEmitOnError: true,
389
387
  skipLibCheck: false,
390
388
  strict: true,
391
- target: "ES2022",
389
+ target: "es2023",
392
390
  };
393
391
  const rootTsconfigConfigIncludes = new Set([
394
392
  "oxlint.config.ts",
@@ -14,15 +14,15 @@ export type ResolvedToolchainVersions = {
14
14
  readonly diagnostics: string[];
15
15
  };
16
16
  export type ResolveToolchainVersionsOptions = {
17
- readonly source?: ToolchainResolutionSource | "auto";
18
- readonly fetchJson?: (url: string) => Promise<unknown>;
19
- readonly nodeReleaseIndexUrl?: string;
20
- readonly pnpmRegistryUrl?: string;
17
+ readonly source?: ToolchainResolutionSource | "auto" | undefined;
18
+ readonly fetchJson?: ((url: string) => Promise<unknown>) | undefined;
19
+ readonly nodeReleaseIndexUrl?: string | undefined;
20
+ readonly pnpmRegistryUrl?: string | undefined;
21
21
  };
22
22
  export declare const nodeReleaseIndexUrl = "https://nodejs.org/dist/index.json";
23
23
  export declare const pnpmRegistryUrl = "https://registry.npmjs.org/pnpm";
24
24
  type OnlineToolchainResolutionContractOptions = {
25
- readonly fetchJson?: (url: string) => Promise<unknown>;
25
+ readonly fetchJson?: ((url: string) => Promise<unknown>) | undefined;
26
26
  };
27
27
  export type OnlineToolchainResolutionContractResult = {
28
28
  readonly nodeLtsMajor: NodeLtsMajor;
@@ -2,7 +2,7 @@ export const nodeReleaseIndexUrl = "https://nodejs.org/dist/index.json";
2
2
  export const pnpmRegistryUrl = "https://registry.npmjs.org/pnpm";
3
3
  const bundledFallbackToolchain = {
4
4
  nodeLtsMajor: nodeLtsMajor("24"),
5
- packageManagerPin: packageManagerPin("10.0.0"),
5
+ packageManagerPin: packageManagerPin("10.34.4"),
6
6
  };
7
7
  export async function resolveToolchainVersions(options = {}) {
8
8
  const source = options.source ?? "online";
@@ -122,15 +122,14 @@ function parsePnpmRegistryMetadata(value) {
122
122
  if (!isRecord(metadata)) {
123
123
  continue;
124
124
  }
125
- versions[version] = {
126
- engines: isRecord(metadata.engines)
127
- ? {
128
- node: typeof metadata.engines.node === "string"
129
- ? metadata.engines.node
130
- : undefined,
131
- }
132
- : undefined,
133
- };
125
+ const nodeRange = isRecord(metadata.engines)
126
+ ? metadata.engines.node
127
+ : undefined;
128
+ versions[version] = isRecord(metadata.engines)
129
+ ? {
130
+ engines: typeof nodeRange === "string" ? { node: nodeRange } : {},
131
+ }
132
+ : {};
134
133
  }
135
134
  return { versions };
136
135
  }
@@ -139,7 +138,7 @@ function latestCompatiblePnpmVersion(metadata, nodeMajor) {
139
138
  .filter(([version]) => /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(version))
140
139
  .filter(([, packageMetadata]) => nodeSatisfiesRange(nodeMajor, packageMetadata.engines?.node))
141
140
  .map(([version]) => version)
142
- .sort(compareSemver);
141
+ .toSorted(compareSemver);
143
142
  const latest = candidates.at(-1);
144
143
  if (!latest) {
145
144
  throw new Error(`pnpm registry metadata did not contain a release compatible with Node ${nodeMajor}`);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template-core",
3
- "version": "0.0.8",
3
+ "version": "0.0.0",
4
4
  "private": true,
5
5
  "files": [
6
6
  "dist"
@@ -14,6 +14,10 @@
14
14
  },
15
15
  "scripts": {
16
16
  "build": "rm -rf dist && tsc -p tsconfig.build.json && cp ../../pnpm-workspace.yaml dist/pnpm-workspace.yaml",
17
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts --ignore-path ../../.oxfmtignore .",
18
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts --ignore-path ../../.oxfmtignore .",
19
+ "lint": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist .",
20
+ "lint:fix": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist . --fix",
17
21
  "typecheck": "tsc -p tsconfig.json --noEmit"
18
22
  },
19
23
  "dependencies": {
@@ -22,6 +26,9 @@
22
26
  },
23
27
  "devDependencies": {
24
28
  "@types/node": "catalog:",
25
- "execa": "catalog:"
29
+ "execa": "catalog:",
30
+ "oxfmt": "catalog:",
31
+ "oxlint": "catalog:",
32
+ "oxlint-tsgolint": "catalog:"
26
33
  }
27
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -33,13 +33,16 @@
33
33
  "dependencies": {
34
34
  "typescript": "^6.0.3",
35
35
  "valibot": "^1.4.2",
36
- "@ykdz/template-builtin-source": "0.0.8",
37
- "@ykdz/template-core": "0.0.8"
36
+ "@ykdz/template-core": "0.0.0",
37
+ "@ykdz/template-builtin-source": "0.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@types/node": "^24.0.0"
40
+ "@types/node": "^24.0.0",
41
+ "oxfmt": "^0.57.0",
42
+ "oxlint": "^1.72.0",
43
+ "oxlint-tsgolint": "^0.24.0"
41
44
  },
42
- "bundledDependencies": [
45
+ "bundleDependencies": [
43
46
  "@ykdz/template-builtin-source",
44
47
  "@ykdz/template-core"
45
48
  ],
@@ -48,6 +51,10 @@
48
51
  },
49
52
  "scripts": {
50
53
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
54
+ "format:check": "oxfmt --check --config ../../oxfmt.config.ts --ignore-path ../../.oxfmtignore .",
55
+ "format:write": "oxfmt --write --config ../../oxfmt.config.ts --ignore-path ../../.oxfmtignore .",
56
+ "lint": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist .",
57
+ "lint:fix": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist . --fix",
51
58
  "typecheck": "tsc -p tsconfig.json --noEmit"
52
59
  }
53
60
  }