@ykdz/template 0.0.7 → 0.0.9

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 (123) hide show
  1. package/dist/{src/cli.js → cli.js} +33 -21
  2. package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +22 -0
  3. package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +96 -0
  4. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.d.ts +6 -0
  5. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +240 -0
  6. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.d.ts +7 -0
  7. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +94 -0
  8. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.d.ts +2 -0
  9. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +15 -0
  10. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +9 -0
  11. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +103 -0
  12. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +6 -0
  13. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +224 -0
  14. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +6 -0
  15. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +372 -0
  16. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +8 -0
  17. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +203 -0
  18. package/node_modules/@ykdz/template-builtin-source/package.json +59 -0
  19. package/{templates → node_modules/@ykdz/template-builtin-source/templates}/preset-source.json +14 -2
  20. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts +34 -0
  21. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/tsconfig.config.json +20 -0
  22. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts +36 -0
  23. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/env.d.ts +8 -0
  24. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/env.d.ts +16 -0
  25. package/{dist/src → node_modules/@ykdz/template-core/dist}/declarations.d.ts +7 -4
  26. package/{dist/src → node_modules/@ykdz/template-core/dist}/declarations.js +45 -14
  27. package/{dist/src → node_modules/@ykdz/template-core/dist}/dependency-catalog.js +13 -6
  28. package/{dist/src → node_modules/@ykdz/template-core/dist}/devcontainer.d.ts +5 -5
  29. package/{dist/src → node_modules/@ykdz/template-core/dist}/editor-customization.js +23 -30
  30. package/{dist/src → node_modules/@ykdz/template-core/dist}/generated-scenarios.d.ts +6 -4
  31. package/{dist/src → node_modules/@ykdz/template-core/dist}/generated-scenarios.js +45 -14
  32. package/{dist/src → node_modules/@ykdz/template-core/dist}/generation-context.js +8 -3
  33. package/{dist/src → node_modules/@ykdz/template-core/dist}/next-step-instructions.js +3 -0
  34. package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +12 -0
  35. package/{dist/src → node_modules/@ykdz/template-core/dist}/package-addition.js +33 -18
  36. package/{pnpm-workspace.yaml → node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml} +4 -1
  37. package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-projection.d.ts +3 -3
  38. package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-projection.js +1 -0
  39. package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-source.d.ts +1 -3
  40. package/{dist/src → node_modules/@ykdz/template-core/dist}/preset-source.js +73 -74
  41. package/{dist/src → node_modules/@ykdz/template-core/dist}/project-github.d.ts +3 -3
  42. package/{dist/src → node_modules/@ykdz/template-core/dist}/project-github.js +1 -0
  43. package/{dist/src → node_modules/@ykdz/template-core/dist}/projection-capabilities.d.ts +17 -5
  44. package/{dist/src → node_modules/@ykdz/template-core/dist}/projection-capabilities.js +209 -169
  45. package/{dist/src → node_modules/@ykdz/template-core/dist}/renderer.d.ts +2 -2
  46. package/{dist/src → node_modules/@ykdz/template-core/dist}/renderer.js +14 -6
  47. package/{dist/src → node_modules/@ykdz/template-core/dist}/runtime-paths.js +2 -0
  48. package/{dist/src → node_modules/@ykdz/template-core/dist}/template-boundary-check.d.ts +1 -1
  49. package/{dist/src → node_modules/@ykdz/template-core/dist}/template-boundary-check.js +8 -10
  50. package/{dist/src → node_modules/@ykdz/template-core/dist}/toolchain-resolution.d.ts +5 -5
  51. package/{dist/src → node_modules/@ykdz/template-core/dist}/toolchain-resolution.js +10 -11
  52. package/node_modules/@ykdz/template-core/package.json +34 -0
  53. package/package.json +18 -31
  54. package/README.md +0 -35
  55. package/dist/src/package-addition.d.ts +0 -8
  56. package/templates/shared/oxc/node/oxlint.config.ts +0 -9
  57. package/templates/shared/oxc/vue/oxlint.config.ts +0 -9
  58. package/templates/vue-app/env.d.ts +0 -1
  59. package/templates/vue-hono-app/web/env.d.ts +0 -9
  60. /package/dist/{src/cli.d.ts → cli.d.ts} +0 -0
  61. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/.github/dependabot.yml +0 -0
  62. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/.github/workflows/check.yml +0 -0
  63. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/src/app.ts +0 -0
  64. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/src/server.ts +0 -0
  65. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/test/app.test.ts +0 -0
  66. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/hono-api/vitest.config.ts +0 -0
  67. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/.github/dependabot.yml +0 -0
  68. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/.github/workflows/check.yml +0 -0
  69. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/rust-toolchain.toml +0 -0
  70. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/rustfmt.toml +0 -0
  71. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/rust-bin/src/main.rs +0 -0
  72. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/devcontainer/browser-test.Dockerfile +0 -0
  73. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/devcontainer/node-pnpm.Dockerfile +0 -0
  74. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/devcontainer/rust.Dockerfile +0 -0
  75. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/editor-customization/capabilities.json +0 -0
  76. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/shared/oxc/oxfmt.config.ts +0 -0
  77. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/.github/dependabot.yml +0 -0
  78. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/.github/workflows/check.yml +0 -0
  79. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/src/index.ts +0 -0
  80. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/ts-lib/src/name-schema.ts +0 -0
  81. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/.github/dependabot.yml +0 -0
  82. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/.github/workflows/check.yml +0 -0
  83. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/index.html +0 -0
  84. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/playwright.config.ts +0 -0
  85. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/playwright.package-addition.config.ts +0 -0
  86. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/App.vue +0 -0
  87. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/main.ts +0 -0
  88. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/stores/counter.ts +0 -0
  89. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/src/style.css +0 -0
  90. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/test/app.test.ts +0 -0
  91. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/test/e2e/app.spec.ts +0 -0
  92. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/vite.config.ts +0 -0
  93. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-app/vitest.config.ts +0 -0
  94. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/.github/dependabot.yml +0 -0
  95. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/.github/workflows/check.yml +0 -0
  96. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/src/index.ts +0 -0
  97. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/src/runtime.ts +0 -0
  98. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/src/server.ts +0 -0
  99. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/test/app.test.ts +0 -0
  100. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/api/vitest.config.ts +0 -0
  101. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/index.html +0 -0
  102. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/playwright.config.ts +0 -0
  103. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/App.vue +0 -0
  104. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/api.ts +0 -0
  105. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/main.ts +0 -0
  106. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/stores/counter.ts +0 -0
  107. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/src/style.css +0 -0
  108. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/test/app.test.ts +0 -0
  109. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/test/e2e/app.spec.ts +0 -0
  110. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/vite.config.ts +0 -0
  111. /package/{templates → node_modules/@ykdz/template-builtin-source/templates}/vue-hono-app/web/vitest.config.ts +0 -0
  112. /package/{dist/src → node_modules/@ykdz/template-core/dist}/dependency-catalog.d.ts +0 -0
  113. /package/{dist/src → node_modules/@ykdz/template-core/dist}/devcontainer.js +0 -0
  114. /package/{dist/src → node_modules/@ykdz/template-core/dist}/editor-customization.d.ts +0 -0
  115. /package/{dist/src → node_modules/@ykdz/template-core/dist}/generation-context.d.ts +0 -0
  116. /package/{dist/src → node_modules/@ykdz/template-core/dist}/module-graph.d.ts +0 -0
  117. /package/{dist/src → node_modules/@ykdz/template-core/dist}/module-graph.js +0 -0
  118. /package/{dist/src → node_modules/@ykdz/template-core/dist}/next-step-instructions.d.ts +0 -0
  119. /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-addition-support.d.ts +0 -0
  120. /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-addition-support.js +0 -0
  121. /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-linking.d.ts +0 -0
  122. /package/{dist/src → node_modules/@ykdz/template-core/dist}/package-linking.js +0 -0
  123. /package/{dist/src → node_modules/@ykdz/template-core/dist}/runtime-paths.d.ts +0 -0
@@ -50,9 +50,9 @@ export type ReplaceAnchorsOperation = {
50
50
  export type RenderOperation = CopyFileOperation | WriteJsonOperation | MergeJsonOperation | WriteTextOperation | WriteTextFromFragmentsOperation | WriteTextTemplateOperation | SetExecutableOperation | ReplaceAnchorsOperation;
51
51
  export type RenderProjectOptions = {
52
52
  sourceRoot: string;
53
- sourceRoots?: Record<string, string>;
53
+ sourceRoots?: Record<string, string> | undefined;
54
54
  targetRoot: string;
55
- variables?: RenderVariables;
55
+ variables?: RenderVariables | undefined;
56
56
  operations: RenderOperation[];
57
57
  };
58
58
  export declare function renderProject(options: RenderProjectOptions): Promise<void>;
@@ -65,7 +65,7 @@ function serializeJsonValue(value, indentation, pathSegments, multilineArrays, r
65
65
  if (!isRecord(value)) {
66
66
  return JSON.stringify(value);
67
67
  }
68
- const entries = Object.entries(value).sort(([left], [right]) => compareJsonKeys(left, right, pathSegments, rootKeyOrder));
68
+ const entries = Object.entries(value).toSorted(([left], [right]) => compareJsonKeys(left, right, pathSegments, rootKeyOrder));
69
69
  if (entries.length === 0) {
70
70
  return "{}";
71
71
  }
@@ -325,7 +325,7 @@ async function findTypeScriptAnchorRanges(sourceText) {
325
325
  }
326
326
  function replaceRanges(sourceText, ranges, replacements) {
327
327
  let nextText = sourceText;
328
- for (const range of [...ranges].sort((a, b) => b.start - a.start)) {
328
+ for (const range of ranges.toSorted((a, b) => b.start - a.start)) {
329
329
  const replacement = replacements[range.name];
330
330
  if (replacement === undefined) {
331
331
  continue;
@@ -380,7 +380,9 @@ async function copyGeneratedFile(from, to) {
380
380
  }
381
381
  catch (error) {
382
382
  if (isNodeError(error) && error.code === "EEXIST") {
383
- throw new Error(`Refusing to overwrite existing file: ${to}`);
383
+ throw new Error(`Refusing to overwrite existing file: ${to}`, {
384
+ cause: error,
385
+ });
384
386
  }
385
387
  throw error;
386
388
  }
@@ -394,7 +396,9 @@ async function writeGeneratedFile(to, text, overwrite = false) {
394
396
  }
395
397
  catch (error) {
396
398
  if (isNodeError(error) && error.code === "EEXIST") {
397
- throw new Error(`Refusing to overwrite existing file: ${to}`);
399
+ throw new Error(`Refusing to overwrite existing file: ${to}`, {
400
+ cause: error,
401
+ });
398
402
  }
399
403
  throw error;
400
404
  }
@@ -447,7 +451,9 @@ async function commitStagedProject(stagingRoot, targetRoot) {
447
451
  // The target disappeared between the emptiness check and commit.
448
452
  }
449
453
  else if (isNodeError(error) && error.code === "ENOTEMPTY") {
450
- throw new Error(`Target directory is not empty: ${targetRoot}`);
454
+ throw new Error(`Target directory is not empty: ${targetRoot}`, {
455
+ cause: error,
456
+ });
451
457
  }
452
458
  else {
453
459
  throw error;
@@ -460,7 +466,9 @@ async function commitStagedProject(stagingRoot, targetRoot) {
460
466
  catch (error) {
461
467
  if (isNodeError(error) &&
462
468
  ["EEXIST", "ENOTEMPTY", "ENOTDIR", "EISDIR"].includes(error.code ?? "")) {
463
- throw new Error(`Refusing to overwrite existing target: ${targetRoot}`);
469
+ throw new Error(`Refusing to overwrite existing target: ${targetRoot}`, {
470
+ cause: error,
471
+ });
464
472
  }
465
473
  throw error;
466
474
  }
@@ -2,6 +2,8 @@ import { existsSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  export function packageTemplateRoot(moduleDir, ...segments) {
4
4
  const candidates = [
5
+ path.join(moduleDir, "..", "..", "builtin-source", "templates", ...segments),
6
+ path.join(moduleDir, "..", "..", "template-builtin-source", "templates", ...segments),
5
7
  path.join(moduleDir, "..", "..", "templates", ...segments),
6
8
  path.join(moduleDir, "..", "templates", ...segments),
7
9
  path.join(moduleDir, "..", "..", "..", "templates", ...segments),
@@ -18,7 +18,7 @@ export type TemplateBoundaryCheckProjection = {
18
18
  readonly sourceFilePath: string;
19
19
  readonly plan: {
20
20
  readonly sourceRoot: string;
21
- readonly sourceRoots?: Record<string, string>;
21
+ readonly sourceRoots?: Record<string, string> | undefined;
22
22
  readonly operations: readonly RenderOperation[];
23
23
  };
24
24
  };
@@ -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;
@@ -53,7 +53,7 @@ async function contractPhase(phase, operation) {
53
53
  }
54
54
  catch (error) {
55
55
  const message = error instanceof Error ? error.message : String(error);
56
- throw new Error(`Online toolchain resolution contract failed during ${phase}: ${message}`, error instanceof Error ? { cause: error } : undefined);
56
+ throw new Error(`Online toolchain resolution contract failed during ${phase}: ${message}`, { cause: error });
57
57
  }
58
58
  }
59
59
  function fallbackResult(diagnostics) {
@@ -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}`);
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@ykdz/template-core",
3
+ "version": "0.0.9",
4
+ "private": true,
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ "./*": {
11
+ "types": "./dist/*.d.ts",
12
+ "default": "./dist/*.js"
13
+ }
14
+ },
15
+ "scripts": {
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",
21
+ "typecheck": "tsc -p tsconfig.json --noEmit"
22
+ },
23
+ "dependencies": {
24
+ "typescript": "catalog:",
25
+ "valibot": "catalog:"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "catalog:",
29
+ "execa": "catalog:",
30
+ "oxfmt": "catalog:",
31
+ "oxlint": "catalog:",
32
+ "oxlint-tsgolint": "catalog:"
33
+ }
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -18,17 +18,13 @@
18
18
  "url": "git+https://github.com/YKDZ/template.git"
19
19
  },
20
20
  "bin": {
21
- "template": "dist/src/cli.js"
21
+ "template": "dist/cli.js"
22
22
  },
23
23
  "files": [
24
24
  "dist",
25
- "pnpm-workspace.yaml",
26
- "templates",
27
- "!templates/registry.ts",
28
- "!templates/projection-plans.ts",
29
- "!templates/*/projection.ts",
30
- "!templates/shared/oxc/tsconfig.json",
31
- "!templates/**/node_modules"
25
+ "node_modules/@ykdz/template-core",
26
+ "node_modules/@ykdz/template-builtin-source",
27
+ "!**/node_modules/**/node_modules"
32
28
  ],
33
29
  "type": "module",
34
30
  "publishConfig": {
@@ -36,38 +32,29 @@
36
32
  },
37
33
  "dependencies": {
38
34
  "typescript": "^6.0.3",
39
- "valibot": "^1.4.2"
35
+ "valibot": "^1.4.2",
36
+ "@ykdz/template-builtin-source": "0.0.9",
37
+ "@ykdz/template-core": "0.0.9"
40
38
  },
41
39
  "devDependencies": {
42
40
  "@types/node": "^24.0.0",
43
- "execa": "^9.6.1",
44
41
  "oxfmt": "^0.57.0",
45
42
  "oxlint": "^1.72.0",
46
- "oxlint-tsgolint": "^0.24.0",
47
- "tsx": "^4.22.4",
48
- "vitest": "^4.1.9",
49
- "yaml": "^2.9.0"
43
+ "oxlint-tsgolint": "^0.24.0"
50
44
  },
45
+ "bundleDependencies": [
46
+ "@ykdz/template-builtin-source",
47
+ "@ykdz/template-core"
48
+ ],
51
49
  "engines": {
52
50
  "node": ">=24.0.0"
53
51
  },
54
52
  "scripts": {
55
53
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
56
- "check": "pnpm run check:format && pnpm run typecheck && pnpm run test && pnpm run check:generated && pnpm run check:templates",
57
- "check:format": "oxfmt --check --config templates/shared/oxc/oxfmt.config.ts --ignore-path .oxfmtignore .",
58
- "check:fixtures": "tsx scripts/check-fixtures.ts",
59
- "check:generated": "tsx scripts/check-generated.ts",
60
- "check:templates": "pnpm run check:templates:shared-oxc && pnpm run check:templates:github-yaml && pnpm run check:templates:boundary && pnpm run check:templates:static-source",
61
- "check:toolchain:online": "tsx scripts/check-online-toolchain-resolution-contract.ts",
62
- "check:templates:boundary": "tsx scripts/check-template-boundary.ts",
63
- "check:templates:github-yaml": "tsx scripts/check-template-github-yaml.ts",
64
- "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",
65
- "check:templates:shared-oxc:format": "oxfmt --check templates/shared/oxc",
66
- "check:templates:shared-oxc:lint": "oxlint templates/shared/oxc --deny-warnings",
67
- "check:templates:shared-oxc:typecheck": "tsc -p templates/shared/oxc/tsconfig.json --noEmit",
68
- "check:templates:static-source": "rustfmt --check templates/rust-bin/src/main.rs",
69
- "fix": "pnpm run build",
70
- "typecheck": "tsc -p tsconfig.json --noEmit",
71
- "test": "vitest run"
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",
58
+ "typecheck": "tsc -p tsconfig.json --noEmit"
72
59
  }
73
60
  }
package/README.md DELETED
@@ -1,35 +0,0 @@
1
- # @ykdz/template
2
-
3
- Project template generator for YKDZ starter projects.
4
-
5
- ## Usage
6
-
7
- ```sh
8
- pnpm dlx @ykdz/template init my-project --preset ts-lib --yes
9
- ```
10
-
11
- Available commands:
12
-
13
- ```sh
14
- template init <dir> --preset <name> --yes
15
- template add package --preset <name> --name <name> [--path <package-path>]
16
- template presets
17
- template schema preset
18
- template schema blueprint
19
- template preset validate <path>
20
- template blueprint validate <path>
21
- ```
22
-
23
- Supported presets are `ts-lib`, `hono-api`, `vue-app`, `vue-hono-app`, and
24
- `rust-bin`.
25
-
26
- ## Publishing
27
-
28
- This package is intended to publish through npm Trusted Publishing from the
29
- GitHub Actions release workflow. Maintainers should complete
30
- [the Trusted Publishing checklist](docs/npm-trusted-publishing.md) before the
31
- first public release.
32
-
33
- ## License
34
-
35
- MIT
@@ -1,8 +0,0 @@
1
- export type AddPackageOptions = {
2
- cwd: string;
3
- preset: string;
4
- name: string;
5
- path?: string;
6
- linkFrom?: readonly string[];
7
- };
8
- export declare function addPackage(options: AddPackageOptions): Promise<void>;
@@ -1,9 +0,0 @@
1
- import { defineConfig } from "oxlint";
2
-
3
- export default defineConfig({
4
- categories: {
5
- correctness: "error",
6
- suspicious: "error",
7
- },
8
- plugins: ["typescript", "oxc"],
9
- });
@@ -1,9 +0,0 @@
1
- import { defineConfig } from "oxlint";
2
-
3
- export default defineConfig({
4
- categories: {
5
- correctness: "error",
6
- suspicious: "error",
7
- },
8
- plugins: ["typescript", "oxc", "vue"],
9
- });
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,9 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_API_BASE_URL?: string;
5
- }
6
-
7
- interface ImportMeta {
8
- readonly env: ImportMetaEnv;
9
- }
File without changes