@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.
- package/dist/cli.js +7 -7
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +10 -6
- package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +15 -5
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +15 -5
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +31 -7
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +7 -8
- package/node_modules/@ykdz/template-builtin-source/package.json +15 -2
- package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +18 -4
- package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts +25 -3
- package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/tsconfig.config.json +20 -0
- package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts +27 -3
- package/node_modules/@ykdz/template-builtin-source/templates/vue-app/env.d.ts +7 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-app/scripts/run-playwright.ts +25 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-app/src/App.vue +18 -4
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/env.d.ts +7 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/scripts/run-playwright.ts +25 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/App.vue +18 -4
- package/node_modules/@ykdz/template-core/dist/declarations.js +34 -1
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +11 -6
- package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +5 -5
- package/node_modules/@ykdz/template-core/dist/editor-customization.js +20 -29
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +5 -4
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +38 -10
- package/node_modules/@ykdz/template-core/dist/generation-context.js +8 -3
- package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +3 -0
- package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +2 -2
- package/node_modules/@ykdz/template-core/dist/package-addition.js +24 -9
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +4 -5
- package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +3 -3
- package/node_modules/@ykdz/template-core/dist/preset-projection.js +1 -0
- package/node_modules/@ykdz/template-core/dist/preset-source.js +60 -45
- package/node_modules/@ykdz/template-core/dist/project-github.d.ts +3 -3
- package/node_modules/@ykdz/template-core/dist/project-github.js +1 -0
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +7 -3
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +196 -130
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +2 -2
- package/node_modules/@ykdz/template-core/dist/renderer.js +2 -2
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +1 -1
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +8 -10
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.d.ts +5 -5
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +10 -11
- package/node_modules/@ykdz/template-core/package.json +9 -2
- 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
|
|
237
|
-
const
|
|
238
|
-
return (leftEntries.length ===
|
|
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
|
-
|
|
241
|
-
|
|
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: "
|
|
387
|
-
moduleResolution: "
|
|
384
|
+
module: "nodenext",
|
|
385
|
+
moduleResolution: "nodenext",
|
|
388
386
|
noEmitOnError: true,
|
|
389
387
|
skipLibCheck: false,
|
|
390
388
|
strict: true,
|
|
391
|
-
target: "
|
|
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.
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
.
|
|
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.
|
|
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.
|
|
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-
|
|
37
|
-
"@ykdz/template-
|
|
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
|
-
"
|
|
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
|
}
|