@ykdz/template 0.0.3 → 0.0.5
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/README.md +1 -1
- package/dist/src/cli.d.ts +0 -1
- package/dist/src/cli.js +26 -2
- package/dist/src/declarations.d.ts +38 -3
- package/dist/src/declarations.js +75 -36
- package/dist/src/dependency-catalog.d.ts +9 -1
- package/dist/src/dependency-catalog.js +69 -0
- package/dist/src/devcontainer.d.ts +49 -9
- package/dist/src/devcontainer.js +192 -14
- package/dist/src/editor-customization.d.ts +0 -1
- package/dist/src/editor-customization.js +54 -47
- package/dist/src/generation-context.d.ts +0 -1
- package/dist/src/generation-context.js +4 -1
- package/dist/src/module-graph.d.ts +8 -5
- package/dist/src/module-graph.js +20 -2
- package/dist/src/next-step-instructions.d.ts +0 -1
- package/dist/src/next-step-instructions.js +35 -0
- package/dist/src/package-addition-support.d.ts +5 -0
- package/dist/src/package-addition-support.js +4 -0
- package/dist/src/package-addition.d.ts +2 -1
- package/dist/src/package-addition.js +557 -55
- package/dist/src/package-linking.d.ts +55 -0
- package/dist/src/package-linking.js +116 -0
- package/dist/src/preset-projection.d.ts +4 -2
- package/dist/src/project-github.d.ts +3 -2
- package/dist/src/project-github.js +24 -6
- package/dist/src/renderer.d.ts +16 -2
- package/dist/src/renderer.js +96 -12
- package/dist/src/runtime-paths.d.ts +0 -1
- package/dist/src/template-boundary-check.d.ts +34 -0
- package/dist/src/template-boundary-check.js +448 -0
- package/dist/src/toolchain-resolution.d.ts +0 -1
- package/dist/templates/hono-api/projection.d.ts +2 -3
- package/dist/templates/hono-api/projection.js +258 -76
- package/dist/templates/projection-plans.d.ts +0 -1
- package/dist/templates/registry.d.ts +0 -1
- package/dist/templates/registry.js +5 -2
- package/dist/templates/rust-bin/projection.d.ts +2 -3
- package/dist/templates/rust-bin/projection.js +171 -53
- package/dist/templates/ts-lib/projection.d.ts +2 -3
- package/dist/templates/ts-lib/projection.js +251 -87
- package/dist/templates/vue-app/projection.d.ts +2 -3
- package/dist/templates/vue-app/projection.js +266 -94
- package/dist/templates/vue-hono-app/projection.d.ts +0 -1
- package/dist/templates/vue-hono-app/projection.js +232 -108
- package/package.json +10 -5
- package/pnpm-workspace.yaml +1 -0
- package/templates/hono-api/.github/dependabot.yml +13 -0
- package/templates/hono-api/src/server.ts +1 -1
- package/templates/hono-api/test/app.test.ts +1 -1
- package/templates/rust-bin/.github/dependabot.yml +18 -1
- package/templates/rust-bin/rust-toolchain.toml +3 -0
- package/templates/rust-bin/rustfmt.toml +2 -0
- package/templates/shared/devcontainer/browser-test.Dockerfile +2 -0
- package/templates/shared/devcontainer/node-pnpm.Dockerfile +6 -0
- package/templates/shared/devcontainer/rust.Dockerfile +16 -0
- package/templates/shared/editor-customization/capabilities.json +56 -0
- package/templates/ts-lib/.github/dependabot.yml +13 -0
- package/templates/ts-lib/src/index.ts +5 -1
- package/templates/ts-lib/src/name-schema.ts +3 -0
- package/templates/vue-app/.github/dependabot.yml +13 -0
- package/templates/vue-app/.github/workflows/check.yml +1 -1
- package/templates/vue-app/src/App.vue +1 -1
- package/templates/vue-app/test/app.test.ts +1 -1
- package/templates/vue-hono-app/.github/dependabot.yml +13 -0
- package/templates/vue-hono-app/web/src/App.vue +2 -2
- package/templates/vue-hono-app/web/test/app.test.ts +1 -1
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/declarations.d.ts.map +0 -1
- package/dist/src/dependency-catalog.d.ts.map +0 -1
- package/dist/src/devcontainer.d.ts.map +0 -1
- package/dist/src/editor-customization.d.ts.map +0 -1
- package/dist/src/generation-context.d.ts.map +0 -1
- package/dist/src/module-graph.d.ts.map +0 -1
- package/dist/src/next-step-instructions.d.ts.map +0 -1
- package/dist/src/package-addition.d.ts.map +0 -1
- package/dist/src/preset-projection.d.ts.map +0 -1
- package/dist/src/project-github.d.ts.map +0 -1
- package/dist/src/renderer.d.ts.map +0 -1
- package/dist/src/runtime-paths.d.ts.map +0 -1
- package/dist/src/toolchain-resolution.d.ts.map +0 -1
- package/dist/templates/hono-api/projection.d.ts.map +0 -1
- package/dist/templates/projection-plans.d.ts.map +0 -1
- package/dist/templates/registry.d.ts.map +0 -1
- package/dist/templates/rust-bin/projection.d.ts.map +0 -1
- package/dist/templates/ts-lib/projection.d.ts.map +0 -1
- package/dist/templates/vue-app/projection.d.ts.map +0 -1
- package/dist/templates/vue-hono-app/projection.d.ts.map +0 -1
- package/templates/hono-api/projection.ts +0 -453
- package/templates/projection-plans.ts +0 -135
- package/templates/registry.ts +0 -59
- package/templates/rust-bin/projection.ts +0 -346
- package/templates/ts-lib/projection.ts +0 -454
- package/templates/vue-app/projection.ts +0 -687
- package/templates/vue-hono-app/projection.ts +0 -669
|
@@ -2,13 +2,13 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { renderGeneratedPnpmWorkspaceYaml } from "../../src/dependency-catalog.js";
|
|
6
|
-
import {
|
|
5
|
+
import { collectGeneratedManifestCatalogDependencies, renderGeneratedPnpmWorkspaceYaml, } from "../../src/dependency-catalog.js";
|
|
6
|
+
import { browserTestToolLayer, checkedDockerfileFirstNodePnpmDevcontainer, nodePnpmToolLayer, } from "../../src/devcontainer.js";
|
|
7
7
|
import { editorCustomizationForCapabilities } from "../../src/editor-customization.js";
|
|
8
8
|
import { renderFixCommand, renderRootCheckCommand, } from "../../src/module-graph.js";
|
|
9
|
-
import {
|
|
9
|
+
import { PackageAdditionSupport } from "../../src/package-addition-support.js";
|
|
10
|
+
import { packageTurboTasks } from "../../src/package-linking.js";
|
|
10
11
|
import { renderNewProject } from "../../src/renderer.js";
|
|
11
|
-
import { planNodeChecks, planNodeFixes } from "../projection-plans.js";
|
|
12
12
|
const generatedBy = {
|
|
13
13
|
packageName: "@ykdz/template",
|
|
14
14
|
version: "0.0.0",
|
|
@@ -17,10 +17,11 @@ const generatedBy = {
|
|
|
17
17
|
export const vueAppPresetMetadata = {
|
|
18
18
|
name: "vue-app",
|
|
19
19
|
title: "Vue app",
|
|
20
|
-
description: "
|
|
20
|
+
description: "Vue app workspace with Vite, Tailwind, Pinia, and test tooling.",
|
|
21
21
|
generation: "supported",
|
|
22
22
|
supportedPackageManagers: ["pnpm"],
|
|
23
|
-
supportedProjectKinds: ["
|
|
23
|
+
supportedProjectKinds: ["multi-package"],
|
|
24
|
+
packageAdditionSupport: PackageAdditionSupport.Supported,
|
|
24
25
|
features: [
|
|
25
26
|
"pnpm-catalog",
|
|
26
27
|
"oxc-format-lint",
|
|
@@ -33,41 +34,159 @@ export const vueAppPresetMetadata = {
|
|
|
33
34
|
],
|
|
34
35
|
};
|
|
35
36
|
const dependencyMaintenancePolicy = {
|
|
36
|
-
ecosystems: ["npm", "github-actions"],
|
|
37
|
+
ecosystems: ["npm", "github-actions", "docker"],
|
|
37
38
|
interval: "weekly",
|
|
38
39
|
};
|
|
39
|
-
|
|
40
|
+
const webPackageBoundary = {
|
|
41
|
+
kind: "package-boundary",
|
|
42
|
+
path: ".",
|
|
43
|
+
};
|
|
44
|
+
const rootBoundary = {
|
|
45
|
+
kind: "workspace-orchestration",
|
|
46
|
+
path: ".",
|
|
47
|
+
};
|
|
48
|
+
const workspacePackageBoundary = {
|
|
49
|
+
kind: "package-boundary",
|
|
50
|
+
path: "apps/*",
|
|
51
|
+
};
|
|
52
|
+
const webWorkspaceBoundary = {
|
|
53
|
+
kind: "package-boundary",
|
|
54
|
+
path: "apps/web",
|
|
55
|
+
};
|
|
56
|
+
function planVueAppPackageChecks() {
|
|
57
|
+
return {
|
|
58
|
+
components: [
|
|
59
|
+
{ kind: "oxc-format-check", owner: webPackageBoundary },
|
|
60
|
+
{ kind: "oxc-lint", owner: webPackageBoundary },
|
|
61
|
+
{ kind: "typescript-typecheck", owner: webPackageBoundary },
|
|
62
|
+
{ kind: "build", owner: webPackageBoundary },
|
|
63
|
+
{ kind: "unit-test", owner: webPackageBoundary },
|
|
64
|
+
{ kind: "e2e-test", owner: webPackageBoundary },
|
|
65
|
+
],
|
|
66
|
+
environmentNeeds: [],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function planVueAppRootChecks() {
|
|
70
|
+
return {
|
|
71
|
+
components: [
|
|
72
|
+
{ kind: "oxc-format-check", owner: rootBoundary },
|
|
73
|
+
{ kind: "oxc-lint", owner: rootBoundary },
|
|
74
|
+
{ kind: "typescript-typecheck", owner: rootBoundary },
|
|
75
|
+
{ kind: "turbo-package-typecheck", owner: workspacePackageBoundary },
|
|
76
|
+
{ kind: "turbo-package-build", owner: workspacePackageBoundary },
|
|
77
|
+
{ kind: "turbo-package-test", owner: workspacePackageBoundary },
|
|
78
|
+
{ kind: "turbo-package-e2e-test", owner: workspacePackageBoundary },
|
|
79
|
+
{ kind: "turbo-package-check", owner: workspacePackageBoundary },
|
|
80
|
+
],
|
|
81
|
+
environmentNeeds: [
|
|
82
|
+
{
|
|
83
|
+
kind: "playwright-browser-assets",
|
|
84
|
+
browser: "chromium",
|
|
85
|
+
owner: webWorkspaceBoundary,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function planVueAppPackageFixes() {
|
|
91
|
+
return {
|
|
92
|
+
components: [
|
|
93
|
+
{ kind: "oxc-format-write", owner: webPackageBoundary },
|
|
94
|
+
{ kind: "oxc-lint-fix", owner: webPackageBoundary },
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function planVueAppRootFixes() {
|
|
99
|
+
return {
|
|
100
|
+
components: [
|
|
101
|
+
{ kind: "oxc-format-write", owner: rootBoundary },
|
|
102
|
+
{ kind: "oxc-lint-fix", owner: rootBoundary },
|
|
103
|
+
{ kind: "turbo-package-fix", owner: workspacePackageBoundary },
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function projectNameFromDir(targetDir) {
|
|
108
|
+
return path.basename(path.resolve(targetDir));
|
|
109
|
+
}
|
|
110
|
+
function packageScopeFromOptions(options) {
|
|
111
|
+
return options.scope ?? projectNameFromDir(options.targetDir);
|
|
112
|
+
}
|
|
113
|
+
function packageName(packageScope) {
|
|
114
|
+
return `@${packageScope}/web`;
|
|
115
|
+
}
|
|
116
|
+
export function vueAppBlueprint(options = { targetDir: process.cwd() }) {
|
|
117
|
+
const packageScope = packageScopeFromOptions(options);
|
|
40
118
|
return {
|
|
41
119
|
schemaVersion: 1,
|
|
42
120
|
preset: "vue-app",
|
|
43
121
|
packageManager: "pnpm",
|
|
44
|
-
projectKind: "
|
|
122
|
+
projectKind: "multi-package",
|
|
45
123
|
features: [...vueAppPresetMetadata.features],
|
|
124
|
+
packages: [{ name: packageName(packageScope), path: "apps/web" }],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function projectVueAppRootPackageScripts() {
|
|
128
|
+
return {
|
|
129
|
+
check: renderRootCheckCommand(planVueAppRootChecks()),
|
|
130
|
+
fix: renderFixCommand(planVueAppRootFixes()),
|
|
131
|
+
"format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
|
|
132
|
+
"format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
|
|
133
|
+
lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --deny-warnings",
|
|
134
|
+
"lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix --deny-warnings",
|
|
135
|
+
typecheck: "tsc -p tsconfig.config.json --noEmit",
|
|
46
136
|
};
|
|
47
137
|
}
|
|
48
138
|
export function projectVueAppPackageScripts() {
|
|
49
139
|
return {
|
|
50
140
|
build: "vite build",
|
|
51
|
-
check: renderRootCheckCommand(
|
|
141
|
+
check: renderRootCheckCommand(planVueAppPackageChecks()),
|
|
52
142
|
dev: "vite",
|
|
53
|
-
fix: renderFixCommand(
|
|
54
|
-
"format:check": "oxfmt --check .",
|
|
55
|
-
"format:write": "oxfmt --write .",
|
|
56
|
-
lint: "oxlint . --deny-warnings",
|
|
57
|
-
"lint:fix": "oxlint . --fix --deny-warnings",
|
|
143
|
+
fix: renderFixCommand(planVueAppPackageFixes()),
|
|
144
|
+
"format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
|
|
145
|
+
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
146
|
+
lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
|
|
147
|
+
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
|
|
58
148
|
preview: "vite preview",
|
|
59
149
|
test: "vitest run",
|
|
60
150
|
"test:e2e": "pnpm run build && playwright test",
|
|
61
151
|
typecheck: "vue-tsc --build --noEmit",
|
|
62
152
|
};
|
|
63
153
|
}
|
|
64
|
-
function
|
|
154
|
+
function rootPackageJson(context, packageScripts) {
|
|
65
155
|
return {
|
|
66
156
|
name: context.projectName.value,
|
|
67
157
|
version: "0.0.0",
|
|
68
158
|
private: true,
|
|
69
159
|
type: "module",
|
|
70
160
|
scripts: packageScripts,
|
|
161
|
+
devDependencies: {
|
|
162
|
+
oxfmt: "catalog:",
|
|
163
|
+
oxlint: "catalog:",
|
|
164
|
+
turbo: "catalog:",
|
|
165
|
+
typescript: "catalog:",
|
|
166
|
+
},
|
|
167
|
+
engines: {
|
|
168
|
+
node: context.toolchain.nodeLtsMajor.value,
|
|
169
|
+
},
|
|
170
|
+
packageManager: context.toolchain.packageManagerPin.value,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function webPackageName(context) {
|
|
174
|
+
const webPackage = context.blueprint.packages?.find((pkg) => pkg.path === "apps/web");
|
|
175
|
+
return webPackage?.name ?? packageName(context.projectName.value);
|
|
176
|
+
}
|
|
177
|
+
function webPackageJson(context) {
|
|
178
|
+
return {
|
|
179
|
+
name: webPackageName(context),
|
|
180
|
+
version: "0.0.0",
|
|
181
|
+
private: true,
|
|
182
|
+
type: "module",
|
|
183
|
+
imports: {
|
|
184
|
+
"#/*": {
|
|
185
|
+
default: "./src/*.ts",
|
|
186
|
+
types: "./src/*.ts",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
scripts: projectVueAppPackageScripts(),
|
|
71
190
|
dependencies: {
|
|
72
191
|
"@vueuse/core": "catalog:",
|
|
73
192
|
pinia: "catalog:",
|
|
@@ -91,7 +210,6 @@ function packageJson(context, packageScripts) {
|
|
|
91
210
|
engines: {
|
|
92
211
|
node: context.toolchain.nodeLtsMajor.value,
|
|
93
212
|
},
|
|
94
|
-
packageManager: context.toolchain.packageManagerPin.value,
|
|
95
213
|
};
|
|
96
214
|
}
|
|
97
215
|
function generationRecord(context) {
|
|
@@ -111,42 +229,94 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
111
229
|
"tailwind",
|
|
112
230
|
"vitest",
|
|
113
231
|
]);
|
|
232
|
+
const developmentContainer = checkedDockerfileFirstNodePnpmDevcontainer({
|
|
233
|
+
name: context.projectName.value,
|
|
234
|
+
layer: nodePnpmToolLayer({
|
|
235
|
+
nodeVersion: context.toolchain.nodeLtsMajor.value,
|
|
236
|
+
packageManagerPin: context.toolchain.packageManagerPin.value,
|
|
237
|
+
}),
|
|
238
|
+
additionalLayers: [browserTestToolLayer()],
|
|
239
|
+
extensions: editorCustomization.extensions,
|
|
240
|
+
settings: editorCustomization.settings,
|
|
241
|
+
});
|
|
242
|
+
const rootManifest = rootPackageJson(context, packageScripts);
|
|
243
|
+
const webManifest = webPackageJson(context);
|
|
244
|
+
const turboTasks = packageTurboTasks({ dependencyBuildsRequired: false });
|
|
114
245
|
return [
|
|
115
246
|
{
|
|
116
247
|
kind: "writeJson",
|
|
117
248
|
to: "package.json",
|
|
118
|
-
value:
|
|
249
|
+
value: rootManifest,
|
|
119
250
|
},
|
|
120
251
|
{
|
|
121
252
|
kind: "writeText",
|
|
122
253
|
to: "pnpm-workspace.yaml",
|
|
123
254
|
text: renderGeneratedPnpmWorkspaceYaml({
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"@vitejs/plugin-vue",
|
|
130
|
-
"@vue/tsconfig",
|
|
131
|
-
"@vueuse/core",
|
|
132
|
-
"oxfmt",
|
|
133
|
-
"oxlint",
|
|
134
|
-
"pinia",
|
|
135
|
-
"tailwindcss",
|
|
136
|
-
"typescript",
|
|
137
|
-
"vite",
|
|
138
|
-
"vitest",
|
|
139
|
-
"vue",
|
|
140
|
-
"vue-tsc",
|
|
141
|
-
],
|
|
255
|
+
packages: ["apps/*"],
|
|
256
|
+
dependencies: collectGeneratedManifestCatalogDependencies([
|
|
257
|
+
rootManifest,
|
|
258
|
+
webManifest,
|
|
259
|
+
]),
|
|
142
260
|
allowBuilds: {
|
|
143
261
|
esbuild: true,
|
|
144
262
|
},
|
|
145
263
|
}),
|
|
146
264
|
},
|
|
265
|
+
{
|
|
266
|
+
kind: "writeJson",
|
|
267
|
+
to: "turbo.json",
|
|
268
|
+
value: {
|
|
269
|
+
tasks: {
|
|
270
|
+
build: turboTasks.build,
|
|
271
|
+
check: turboTasks.check,
|
|
272
|
+
typecheck: turboTasks.typecheck,
|
|
273
|
+
test: turboTasks.test,
|
|
274
|
+
"test:e2e": turboTasks["test:e2e"],
|
|
275
|
+
dev: {
|
|
276
|
+
cache: false,
|
|
277
|
+
persistent: true,
|
|
278
|
+
},
|
|
279
|
+
fix: {
|
|
280
|
+
cache: false,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
147
285
|
{
|
|
148
286
|
kind: "writeJson",
|
|
149
287
|
to: "tsconfig.json",
|
|
288
|
+
value: {
|
|
289
|
+
files: [],
|
|
290
|
+
references: [
|
|
291
|
+
{ path: "./apps/web/tsconfig.app.json" },
|
|
292
|
+
{ path: "./apps/web/tsconfig.test.json" },
|
|
293
|
+
{ path: "./apps/web/tsconfig.node.json" },
|
|
294
|
+
],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
kind: "writeJson",
|
|
299
|
+
to: "tsconfig.config.json",
|
|
300
|
+
value: {
|
|
301
|
+
compilerOptions: {
|
|
302
|
+
module: "NodeNext",
|
|
303
|
+
moduleResolution: "NodeNext",
|
|
304
|
+
noEmitOnError: true,
|
|
305
|
+
skipLibCheck: false,
|
|
306
|
+
strict: true,
|
|
307
|
+
target: "ES2022",
|
|
308
|
+
},
|
|
309
|
+
include: ["oxlint.config.ts", "oxfmt.config.ts"],
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
kind: "writeJson",
|
|
314
|
+
to: "apps/web/package.json",
|
|
315
|
+
value: webManifest,
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
kind: "writeJson",
|
|
319
|
+
to: "apps/web/tsconfig.json",
|
|
150
320
|
value: {
|
|
151
321
|
files: [],
|
|
152
322
|
references: [
|
|
@@ -158,7 +328,7 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
158
328
|
},
|
|
159
329
|
{
|
|
160
330
|
kind: "writeJson",
|
|
161
|
-
to: "tsconfig.app.json",
|
|
331
|
+
to: "apps/web/tsconfig.app.json",
|
|
162
332
|
value: {
|
|
163
333
|
extends: "@vue/tsconfig/tsconfig.dom.json",
|
|
164
334
|
compilerOptions: {
|
|
@@ -166,9 +336,6 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
166
336
|
module: "ESNext",
|
|
167
337
|
moduleResolution: "Bundler",
|
|
168
338
|
noEmitOnError: true,
|
|
169
|
-
paths: {
|
|
170
|
-
"@/*": ["./src/*"],
|
|
171
|
-
},
|
|
172
339
|
skipLibCheck: false,
|
|
173
340
|
strict: true,
|
|
174
341
|
target: "ES2022",
|
|
@@ -180,7 +347,7 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
180
347
|
},
|
|
181
348
|
{
|
|
182
349
|
kind: "writeJson",
|
|
183
|
-
to: "tsconfig.test.json",
|
|
350
|
+
to: "apps/web/tsconfig.test.json",
|
|
184
351
|
value: {
|
|
185
352
|
extends: "./tsconfig.app.json",
|
|
186
353
|
compilerOptions: {
|
|
@@ -193,7 +360,7 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
193
360
|
},
|
|
194
361
|
{
|
|
195
362
|
kind: "writeJson",
|
|
196
|
-
to: "tsconfig.node.json",
|
|
363
|
+
to: "apps/web/tsconfig.node.json",
|
|
197
364
|
value: {
|
|
198
365
|
compilerOptions: {
|
|
199
366
|
composite: true,
|
|
@@ -231,52 +398,59 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
231
398
|
"playwright-report",
|
|
232
399
|
"test-results",
|
|
233
400
|
".env",
|
|
401
|
+
".template/",
|
|
402
|
+
".pnpm-store/",
|
|
234
403
|
"",
|
|
235
404
|
].join("\n"),
|
|
236
405
|
},
|
|
237
|
-
{ kind: "copyFile", from: "env.d.ts", to: "env.d.ts" },
|
|
238
|
-
{ kind: "copyFile", from: "index.html", to: "index.html" },
|
|
406
|
+
{ kind: "copyFile", from: "env.d.ts", to: "apps/web/env.d.ts" },
|
|
407
|
+
{ kind: "copyFile", from: "index.html", to: "apps/web/index.html" },
|
|
239
408
|
{
|
|
240
409
|
kind: "copyFile",
|
|
241
410
|
from: "playwright.config.ts",
|
|
242
|
-
to: "playwright.config.ts",
|
|
411
|
+
to: "apps/web/playwright.config.ts",
|
|
243
412
|
},
|
|
244
|
-
{ kind: "copyFile", from: "vite.config.ts", to: "vite.config.ts" },
|
|
245
|
-
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
413
|
+
{ kind: "copyFile", from: "vite.config.ts", to: "apps/web/vite.config.ts" },
|
|
414
|
+
{
|
|
415
|
+
kind: "copyFile",
|
|
416
|
+
from: "vitest.config.ts",
|
|
417
|
+
to: "apps/web/vitest.config.ts",
|
|
418
|
+
},
|
|
419
|
+
{ kind: "copyFile", from: "src/App.vue", to: "apps/web/src/App.vue" },
|
|
420
|
+
{ kind: "copyFile", from: "src/main.ts", to: "apps/web/src/main.ts" },
|
|
421
|
+
{ kind: "copyFile", from: "src/style.css", to: "apps/web/src/style.css" },
|
|
249
422
|
{
|
|
250
423
|
kind: "copyFile",
|
|
251
424
|
from: "src/stores/counter.ts",
|
|
252
|
-
to: "src/stores/counter.ts",
|
|
425
|
+
to: "apps/web/src/stores/counter.ts",
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
kind: "copyFile",
|
|
429
|
+
from: "test/app.test.ts",
|
|
430
|
+
to: "apps/web/test/app.test.ts",
|
|
253
431
|
},
|
|
254
|
-
{ kind: "copyFile", from: "test/app.test.ts", to: "test/app.test.ts" },
|
|
255
432
|
{
|
|
256
433
|
kind: "copyFile",
|
|
257
434
|
from: "test/e2e/app.spec.ts",
|
|
258
|
-
to: "test/e2e/app.spec.ts",
|
|
435
|
+
to: "apps/web/test/e2e/app.spec.ts",
|
|
259
436
|
},
|
|
260
437
|
{
|
|
261
438
|
kind: "writeJson",
|
|
262
|
-
to: ".
|
|
263
|
-
value:
|
|
439
|
+
to: ".template/blueprint.json",
|
|
440
|
+
value: context.blueprint,
|
|
264
441
|
},
|
|
265
442
|
{
|
|
266
443
|
kind: "writeJson",
|
|
267
|
-
to: ".
|
|
444
|
+
to: ".template/generated-by.json",
|
|
268
445
|
value: generationRecord(context),
|
|
269
446
|
},
|
|
270
447
|
{
|
|
271
448
|
kind: "writeJson",
|
|
272
449
|
to: ".devcontainer/devcontainer.json",
|
|
273
|
-
value:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
extensions: editorCustomization.extensions,
|
|
278
|
-
settings: editorCustomization.settings,
|
|
279
|
-
}),
|
|
450
|
+
value: developmentContainer.devcontainer,
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
...developmentContainer.dockerfileOperation,
|
|
280
454
|
},
|
|
281
455
|
{
|
|
282
456
|
kind: "writeJson",
|
|
@@ -292,14 +466,14 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
292
466
|
value: editorCustomization.settings,
|
|
293
467
|
},
|
|
294
468
|
{
|
|
295
|
-
kind: "
|
|
469
|
+
kind: "copyFile",
|
|
470
|
+
from: ".github/workflows/check.yml",
|
|
296
471
|
to: ".github/workflows/check.yml",
|
|
297
|
-
text: projectCheckWorkflow({ checkPlan }),
|
|
298
472
|
},
|
|
299
473
|
{
|
|
300
|
-
kind: "
|
|
474
|
+
kind: "copyFile",
|
|
475
|
+
from: ".github/dependabot.yml",
|
|
301
476
|
to: ".github/dependabot.yml",
|
|
302
|
-
text: projectDependabotConfig(dependencyMaintenancePolicy),
|
|
303
477
|
},
|
|
304
478
|
];
|
|
305
479
|
}
|
|
@@ -373,6 +547,12 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
|
|
|
373
547
|
version: "0.0.0",
|
|
374
548
|
private: true,
|
|
375
549
|
type: "module",
|
|
550
|
+
imports: {
|
|
551
|
+
"#/*": {
|
|
552
|
+
default: "./src/*.ts",
|
|
553
|
+
types: "./src/*.ts",
|
|
554
|
+
},
|
|
555
|
+
},
|
|
376
556
|
scripts: projectVueAppPackageScripts(),
|
|
377
557
|
dependencies: {
|
|
378
558
|
"@vueuse/core": "catalog:",
|
|
@@ -421,9 +601,6 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
|
|
|
421
601
|
module: "ESNext",
|
|
422
602
|
moduleResolution: "Bundler",
|
|
423
603
|
noEmitOnError: true,
|
|
424
|
-
paths: {
|
|
425
|
-
"@/*": ["./src/*"],
|
|
426
|
-
},
|
|
427
604
|
skipLibCheck: false,
|
|
428
605
|
strict: true,
|
|
429
606
|
target: "ES2022",
|
|
@@ -465,18 +642,6 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
|
|
|
465
642
|
include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
|
|
466
643
|
},
|
|
467
644
|
},
|
|
468
|
-
{
|
|
469
|
-
kind: "copyFile",
|
|
470
|
-
sourceRoot: "sharedOxc",
|
|
471
|
-
from: "vue/oxlint.config.ts",
|
|
472
|
-
to: `${packagePath}/oxlint.config.ts`,
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
kind: "copyFile",
|
|
476
|
-
sourceRoot: "sharedOxc",
|
|
477
|
-
from: "oxfmt.config.ts",
|
|
478
|
-
to: `${packagePath}/oxfmt.config.ts`,
|
|
479
|
-
},
|
|
480
645
|
{ kind: "copyFile", from: "env.d.ts", to: `${packagePath}/env.d.ts` },
|
|
481
646
|
{ kind: "copyFile", from: "index.html", to: `${packagePath}/index.html` },
|
|
482
647
|
{
|
|
@@ -518,17 +683,14 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
|
|
|
518
683
|
},
|
|
519
684
|
];
|
|
520
685
|
}
|
|
521
|
-
async function packageAdditionPlan({ root, blueprint,
|
|
522
|
-
const
|
|
686
|
+
async function packageAdditionPlan({ root, blueprint, packageName, packagePath, nodeVersion, }) {
|
|
687
|
+
const [workspaceCollection] = packagePath.split("/");
|
|
523
688
|
const previewPort = await nextVuePreviewPort(root, blueprint);
|
|
524
689
|
return {
|
|
525
690
|
packagePath,
|
|
526
|
-
workspacePackageGlob:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
`./${packagePath}/tsconfig.test.json`,
|
|
530
|
-
`./${packagePath}/tsconfig.node.json`,
|
|
531
|
-
],
|
|
691
|
+
workspacePackageGlob: `${workspaceCollection}/*`,
|
|
692
|
+
packageRole: "runtime-service",
|
|
693
|
+
packageSourcePreset: "vue-app",
|
|
532
694
|
sourceRoot: templateSourceRoot(),
|
|
533
695
|
sourceRoots: { sharedOxc: sharedOxcSourceRoot() },
|
|
534
696
|
operations: packageAdditionOperations(packagePath, packageName, nodeVersion),
|
|
@@ -554,6 +716,13 @@ function sharedOxcSourceRoot() {
|
|
|
554
716
|
? publishedSharedRoot
|
|
555
717
|
: path.join(projectionDir, "..", "shared", "oxc");
|
|
556
718
|
}
|
|
719
|
+
function sharedDevcontainerSourceRoot() {
|
|
720
|
+
const projectionDir = path.dirname(fileURLToPath(import.meta.url));
|
|
721
|
+
const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "devcontainer");
|
|
722
|
+
return existsSync(path.join(publishedSharedRoot, "node-pnpm.Dockerfile"))
|
|
723
|
+
? publishedSharedRoot
|
|
724
|
+
: path.join(projectionDir, "..", "shared", "devcontainer");
|
|
725
|
+
}
|
|
557
726
|
export const vueAppPresetProjection = {
|
|
558
727
|
metadata: vueAppPresetMetadata,
|
|
559
728
|
capabilities: {
|
|
@@ -563,12 +732,15 @@ export const vueAppPresetProjection = {
|
|
|
563
732
|
},
|
|
564
733
|
blueprint: vueAppBlueprint,
|
|
565
734
|
project(context) {
|
|
566
|
-
const checkPlan =
|
|
567
|
-
const fixPlan =
|
|
568
|
-
const packageScripts =
|
|
735
|
+
const checkPlan = planVueAppRootChecks();
|
|
736
|
+
const fixPlan = planVueAppRootFixes();
|
|
737
|
+
const packageScripts = projectVueAppRootPackageScripts();
|
|
569
738
|
return {
|
|
570
739
|
sourceRoot: templateSourceRoot(),
|
|
571
|
-
sourceRoots: {
|
|
740
|
+
sourceRoots: {
|
|
741
|
+
sharedDevcontainer: sharedDevcontainerSourceRoot(),
|
|
742
|
+
sharedOxc: sharedOxcSourceRoot(),
|
|
743
|
+
},
|
|
572
744
|
operations: operationsForVueApp(context, packageScripts, checkPlan),
|
|
573
745
|
checkPlan,
|
|
574
746
|
fixPlan,
|
|
@@ -6,4 +6,3 @@ export declare function projectVueHonoRootPackageScripts(): Record<string, strin
|
|
|
6
6
|
export declare function projectVueHonoApiPackageScripts(): Record<string, string>;
|
|
7
7
|
export declare function projectVueHonoWebPackageScripts(): Record<string, string>;
|
|
8
8
|
export declare const vueHonoAppPresetProjection: PresetProjection;
|
|
9
|
-
//# sourceMappingURL=projection.d.ts.map
|