@ykdz/template 0.0.8 → 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.
- 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 +23 -4
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +6 -6
- package/node_modules/@ykdz/template-builtin-source/package.json +15 -2
- package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +14 -2
- 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-hono-app/web/env.d.ts +7 -0
- 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 +4 -4
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +29 -9
- 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 +22 -8
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +1 -0
- 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 +187 -120
- 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 +9 -10
- package/node_modules/@ykdz/template-core/package.json +9 -2
- 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
|
-
|
|
282
|
-
? toolchainReport(generationContext.toolchain)
|
|
283
|
-
:
|
|
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
|
|
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
|
-
|
|
478
|
-
? toolchainReport(generationContext.toolchain)
|
|
479
|
-
:
|
|
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
|
|
23
|
-
"code" in error &&
|
|
24
|
-
error.code === "EISDIR") {
|
|
22
|
+
if (errorCode(error) === "EISDIR") {
|
|
25
23
|
return true;
|
|
26
24
|
}
|
|
27
|
-
if (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 .
|
|
81
|
-
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix
|
|
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
|
-
|
|
137
|
-
|
|
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: "
|
|
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 .
|
|
86
|
-
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix
|
|
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
|
-
|
|
139
|
-
|
|
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: "
|
|
153
|
+
target: "es2023",
|
|
145
154
|
types: ["node"],
|
|
155
|
+
verbatimModuleSyntax: true,
|
|
146
156
|
},
|
|
147
157
|
include: ["src/**/*.ts"],
|
|
148
158
|
},
|
|
@@ -79,8 +79,8 @@ 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 .
|
|
83
|
-
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix
|
|
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
86
|
"test:e2e": "pnpm run build && playwright test",
|
|
@@ -178,6 +178,7 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
|
|
|
178
178
|
"@vue/tsconfig": "catalog:",
|
|
179
179
|
oxfmt: "catalog:",
|
|
180
180
|
oxlint: "catalog:",
|
|
181
|
+
"oxlint-tsgolint": "catalog:",
|
|
181
182
|
tailwindcss: "catalog:",
|
|
182
183
|
typescript: "catalog:",
|
|
183
184
|
vite: "catalog:",
|
|
@@ -208,14 +209,23 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
|
|
|
208
209
|
extends: "@vue/tsconfig/tsconfig.dom.json",
|
|
209
210
|
compilerOptions: {
|
|
210
211
|
composite: true,
|
|
212
|
+
erasableSyntaxOnly: true,
|
|
213
|
+
exactOptionalPropertyTypes: true,
|
|
214
|
+
forceConsistentCasingInFileNames: true,
|
|
215
|
+
isolatedModules: true,
|
|
211
216
|
module: "ESNext",
|
|
212
217
|
moduleResolution: "Bundler",
|
|
213
218
|
noEmitOnError: true,
|
|
219
|
+
noFallthroughCasesInSwitch: true,
|
|
220
|
+
noImplicitOverride: true,
|
|
221
|
+
noImplicitReturns: true,
|
|
222
|
+
noUncheckedIndexedAccess: true,
|
|
214
223
|
skipLibCheck: false,
|
|
215
224
|
strict: true,
|
|
216
|
-
target: "
|
|
225
|
+
target: "es2023",
|
|
217
226
|
tsBuildInfoFile: "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
218
227
|
types: ["web-bluetooth"],
|
|
228
|
+
verbatimModuleSyntax: true,
|
|
219
229
|
},
|
|
220
230
|
include: ["env.d.ts", "src/**/*.ts", "src/**/*.vue"],
|
|
221
231
|
},
|
|
@@ -239,15 +249,24 @@ function packageAdditionOperations(packagePath, packageNameValue, nodeVersion) {
|
|
|
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: "
|
|
266
|
+
target: "es2023",
|
|
249
267
|
tsBuildInfoFile: "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
250
268
|
types: ["node"],
|
|
269
|
+
verbatimModuleSyntax: true,
|
|
251
270
|
},
|
|
252
271
|
include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
|
|
253
272
|
},
|
package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js
CHANGED
|
@@ -145,8 +145,8 @@ export function projectVueHonoRootPackageScripts() {
|
|
|
145
145
|
fix: renderFixCommand(planVueHonoRootFixes()),
|
|
146
146
|
"format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
|
|
147
147
|
"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
|
|
149
|
-
"lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix
|
|
148
|
+
lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts",
|
|
149
|
+
"lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix",
|
|
150
150
|
typecheck: "tsc -p tsconfig.config.json --noEmit",
|
|
151
151
|
};
|
|
152
152
|
}
|
|
@@ -158,8 +158,8 @@ export function projectVueHonoApiPackageScripts() {
|
|
|
158
158
|
fix: renderFixCommand(planVueHonoPackageFixes(apiPackageBoundary)),
|
|
159
159
|
"format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
|
|
160
160
|
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
161
|
-
lint: "oxlint --config ../../oxlint.config.ts .
|
|
162
|
-
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix
|
|
161
|
+
lint: "oxlint --config ../../oxlint.config.ts .",
|
|
162
|
+
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
|
|
163
163
|
start: "node dist/server.js",
|
|
164
164
|
test: "vitest run",
|
|
165
165
|
typecheck: "tsc -p tsconfig.json --noEmit",
|
|
@@ -173,8 +173,8 @@ export function projectVueHonoWebPackageScripts() {
|
|
|
173
173
|
fix: renderFixCommand(planVueHonoPackageFixes(webPackageBoundary)),
|
|
174
174
|
"format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
|
|
175
175
|
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
176
|
-
lint: "oxlint --config ../../oxlint.config.ts .
|
|
177
|
-
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix
|
|
176
|
+
lint: "oxlint --config ../../oxlint.config.ts .",
|
|
177
|
+
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix",
|
|
178
178
|
preview: "vite preview",
|
|
179
179
|
test: "vitest run",
|
|
180
180
|
"test:e2e": "pnpm run build && playwright test",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ykdz/template-builtin-source",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
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
|
},
|
|
@@ -266,6 +274,7 @@
|
|
|
266
274
|
"@vueuse/core",
|
|
267
275
|
"oxfmt",
|
|
268
276
|
"oxlint",
|
|
277
|
+
"oxlint-tsgolint",
|
|
269
278
|
"pinia",
|
|
270
279
|
"tailwindcss",
|
|
271
280
|
"turbo",
|
|
@@ -320,6 +329,7 @@
|
|
|
320
329
|
"shared-devcontainer",
|
|
321
330
|
"shared-editor-customization",
|
|
322
331
|
"shared-oxc-format",
|
|
332
|
+
"shared-oxc-root-tsconfig",
|
|
323
333
|
"shared-oxc-vue"
|
|
324
334
|
]
|
|
325
335
|
}
|
|
@@ -354,6 +364,7 @@
|
|
|
354
364
|
"hono",
|
|
355
365
|
"oxfmt",
|
|
356
366
|
"oxlint",
|
|
367
|
+
"oxlint-tsgolint",
|
|
357
368
|
"pinia",
|
|
358
369
|
"tailwindcss",
|
|
359
370
|
"tsc-alias",
|
|
@@ -435,6 +446,7 @@
|
|
|
435
446
|
"shared-editor-customization",
|
|
436
447
|
"shared-oxc-node",
|
|
437
448
|
"shared-oxc-format",
|
|
449
|
+
"shared-oxc-root-tsconfig",
|
|
438
450
|
"shared-oxc-vue"
|
|
439
451
|
]
|
|
440
452
|
}
|
package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts
CHANGED
|
@@ -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: "
|
|
9
|
+
suspicious: "warn",
|
|
7
10
|
},
|
|
8
|
-
plugins: [
|
|
11
|
+
plugins: [
|
|
12
|
+
"eslint",
|
|
13
|
+
"typescript",
|
|
14
|
+
"unicorn",
|
|
15
|
+
"oxc",
|
|
16
|
+
"node",
|
|
17
|
+
"import",
|
|
18
|
+
"vitest",
|
|
19
|
+
"promise",
|
|
20
|
+
],
|
|
9
21
|
rules: {
|
|
10
|
-
"
|
|
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
|
+
}
|
package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts
CHANGED
|
@@ -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: "
|
|
9
|
+
suspicious: "warn",
|
|
7
10
|
},
|
|
8
|
-
plugins: [
|
|
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
|
-
"
|
|
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,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
|
}
|
|
@@ -206,12 +206,45 @@ export function validatePresetFile(input, options = {}) {
|
|
|
206
206
|
export function findPreset(presets, name) {
|
|
207
207
|
return presets.find((preset) => preset.name === name);
|
|
208
208
|
}
|
|
209
|
+
function normalizeProjectBlueprint(blueprint) {
|
|
210
|
+
return {
|
|
211
|
+
schemaVersion: blueprint.schemaVersion,
|
|
212
|
+
preset: blueprint.preset,
|
|
213
|
+
...(blueprint.packageManager === undefined
|
|
214
|
+
? {}
|
|
215
|
+
: { packageManager: blueprint.packageManager }),
|
|
216
|
+
projectKind: blueprint.projectKind,
|
|
217
|
+
features: [...blueprint.features],
|
|
218
|
+
...(blueprint.packages === undefined
|
|
219
|
+
? {}
|
|
220
|
+
: {
|
|
221
|
+
packages: blueprint.packages.map((projectPackage) => ({
|
|
222
|
+
name: projectPackage.name,
|
|
223
|
+
path: projectPackage.path,
|
|
224
|
+
...(projectPackage.role === undefined
|
|
225
|
+
? {}
|
|
226
|
+
: { role: projectPackage.role }),
|
|
227
|
+
...(projectPackage.sourcePreset === undefined
|
|
228
|
+
? {}
|
|
229
|
+
: { sourcePreset: projectPackage.sourcePreset }),
|
|
230
|
+
})),
|
|
231
|
+
}),
|
|
232
|
+
...(blueprint.packageLinkIntents === undefined
|
|
233
|
+
? {}
|
|
234
|
+
: {
|
|
235
|
+
packageLinkIntents: blueprint.packageLinkIntents.map((intent) => ({
|
|
236
|
+
consumerPackagePath: intent.consumerPackagePath,
|
|
237
|
+
providerPackagePath: intent.providerPackagePath,
|
|
238
|
+
})),
|
|
239
|
+
}),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
209
242
|
export function validateProjectBlueprint(input, options = {}) {
|
|
210
243
|
const result = v.safeParse(projectBlueprintSchema, input);
|
|
211
244
|
if (!result.success) {
|
|
212
245
|
return { ok: false, issues: shapeIssues(result.issues) };
|
|
213
246
|
}
|
|
214
|
-
const blueprint = result.output;
|
|
247
|
+
const blueprint = normalizeProjectBlueprint(result.output);
|
|
215
248
|
const preset = findPreset(options.presets ?? [], blueprint.preset);
|
|
216
249
|
const semanticIssues = [
|
|
217
250
|
...duplicateIssues(blueprint.features, "$.features"),
|
|
@@ -26,7 +26,12 @@ function parseTemplateDependencyCatalog(workspaceYaml) {
|
|
|
26
26
|
if (!match) {
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
const key = match[1] ?? match[2];
|
|
30
|
+
const version = match[3];
|
|
31
|
+
if (key === undefined || version === undefined) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
catalog[key] = version;
|
|
30
35
|
}
|
|
31
36
|
return catalog;
|
|
32
37
|
}
|
|
@@ -35,7 +40,7 @@ export function loadTemplateDependencyCatalog() {
|
|
|
35
40
|
}
|
|
36
41
|
export function selectTemplateDependencyCatalogEntries(dependencies, catalog = loadTemplateDependencyCatalog()) {
|
|
37
42
|
const selected = {};
|
|
38
|
-
for (const dependency of
|
|
43
|
+
for (const dependency of dependencies.toSorted()) {
|
|
39
44
|
const version = catalog[dependency];
|
|
40
45
|
if (version === undefined) {
|
|
41
46
|
throw new Error(`Template Dependency Catalog is missing dependency: ${dependency}`);
|
|
@@ -61,7 +66,7 @@ export function collectGeneratedManifestCatalogDependencies(manifests) {
|
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
|
-
return [...dependencies].
|
|
69
|
+
return [...dependencies].toSorted();
|
|
65
70
|
}
|
|
66
71
|
export function collectGeneratedManifestCatalogReferences(manifests) {
|
|
67
72
|
const dependencies = new Set();
|
|
@@ -79,7 +84,7 @@ export function collectGeneratedManifestCatalogReferences(manifests) {
|
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
}
|
|
82
|
-
return [...dependencies].
|
|
87
|
+
return [...dependencies].toSorted();
|
|
83
88
|
}
|
|
84
89
|
function renderCatalogKey(key) {
|
|
85
90
|
return key.startsWith("@") ? JSON.stringify(key) : key;
|
|
@@ -106,7 +111,7 @@ export function pnpmWorkspaceYamlWithCatalogDependencies(workspaceYaml, dependen
|
|
|
106
111
|
const catalogLines = [
|
|
107
112
|
"catalog:",
|
|
108
113
|
...Object.entries(nextCatalog)
|
|
109
|
-
.
|
|
114
|
+
.toSorted(([left], [right]) => left.localeCompare(right))
|
|
110
115
|
.map(([dependency, version]) => ` ${renderCatalogKey(dependency)}: ${version}`),
|
|
111
116
|
"",
|
|
112
117
|
];
|
|
@@ -126,7 +131,7 @@ export function renderGeneratedPnpmWorkspaceYaml(options) {
|
|
|
126
131
|
];
|
|
127
132
|
if (options.allowBuilds) {
|
|
128
133
|
lines.push("allowBuilds:", ...Object.entries(options.allowBuilds)
|
|
129
|
-
.
|
|
134
|
+
.toSorted(([left], [right]) => left.localeCompare(right))
|
|
130
135
|
.map(([dependency, allowed]) => ` ${dependency}: ${allowed}`), "");
|
|
131
136
|
}
|
|
132
137
|
lines.push("catalog:", ...Object.entries(catalog).map(([dependency, version]) => ` ${renderCatalogKey(dependency)}: ${version}`), "");
|
|
@@ -38,21 +38,21 @@ export declare function dockerfileFirstNodePnpmDevcontainer(options: {
|
|
|
38
38
|
readonly name: string;
|
|
39
39
|
readonly layer: DevelopmentContainerNodePnpmLayer;
|
|
40
40
|
readonly extensions: readonly string[];
|
|
41
|
-
readonly settings?: Record<string, unknown
|
|
41
|
+
readonly settings?: Record<string, unknown> | undefined;
|
|
42
42
|
}): DevelopmentContainerPlan;
|
|
43
43
|
export declare function checkedDockerfileFirstNodePnpmDevcontainer(options: {
|
|
44
44
|
readonly name: string;
|
|
45
45
|
readonly layer: DevelopmentContainerNodePnpmLayer;
|
|
46
|
-
readonly additionalLayers?: readonly DevelopmentContainerCapabilityLayer[];
|
|
46
|
+
readonly additionalLayers?: readonly DevelopmentContainerCapabilityLayer[] | undefined;
|
|
47
47
|
readonly extensions: readonly string[];
|
|
48
|
-
readonly settings?: Record<string, unknown
|
|
49
|
-
readonly mounts?: readonly string[];
|
|
48
|
+
readonly settings?: Record<string, unknown> | undefined;
|
|
49
|
+
readonly mounts?: readonly string[] | undefined;
|
|
50
50
|
}): DevelopmentContainerPlan;
|
|
51
51
|
export declare function dockerfileFirstRustPnpmDevcontainer(options: {
|
|
52
52
|
readonly name: string;
|
|
53
53
|
readonly nodeLayer: DevelopmentContainerNodePnpmLayer;
|
|
54
54
|
readonly rustLayer: DevelopmentContainerRustLayer;
|
|
55
55
|
readonly extensions: readonly string[];
|
|
56
|
-
readonly settings?: Record<string, unknown
|
|
56
|
+
readonly settings?: Record<string, unknown> | undefined;
|
|
57
57
|
}): DevelopmentContainerPlan;
|
|
58
58
|
export {};
|