@ykdz/template 0.0.3 → 0.0.4
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 +14 -2
- package/dist/src/declarations.d.ts +2 -3
- package/dist/src/declarations.js +46 -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 +10 -0
- package/dist/src/next-step-instructions.d.ts +0 -1
- package/dist/src/next-step-instructions.js +35 -0
- package/dist/src/package-addition.d.ts +1 -1
- package/dist/src/package-addition.js +170 -15
- package/dist/src/preset-projection.d.ts +1 -1
- 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 +95 -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 +230 -69
- package/dist/templates/projection-plans.d.ts +0 -1
- package/dist/templates/registry.d.ts +0 -1
- package/dist/templates/registry.js +2 -2
- package/dist/templates/rust-bin/projection.d.ts +2 -3
- package/dist/templates/rust-bin/projection.js +161 -53
- package/dist/templates/ts-lib/projection.d.ts +2 -3
- package/dist/templates/ts-lib/projection.js +215 -64
- package/dist/templates/vue-app/projection.d.ts +2 -3
- package/dist/templates/vue-app/projection.js +246 -83
- package/dist/templates/vue-hono-app/projection.d.ts +0 -1
- package/dist/templates/vue-hono-app/projection.js +191 -87
- package/package.json +10 -5
- package/pnpm-workspace.yaml +1 -0
- package/templates/hono-api/.github/dependabot.yml +13 -0
- 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/vue-app/.github/dependabot.yml +13 -0
- package/templates/vue-app/.github/workflows/check.yml +1 -1
- package/templates/vue-hono-app/.github/dependabot.yml +13 -0
- 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,11 @@ 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 { projectCheckWorkflow, projectDependabotConfig, } from "../../src/project-github.js";
|
|
10
9
|
import { renderNewProject } from "../../src/renderer.js";
|
|
11
|
-
import { planNodeChecks, planNodeFixes } from "../projection-plans.js";
|
|
12
10
|
const generatedBy = {
|
|
13
11
|
packageName: "@ykdz/template",
|
|
14
12
|
version: "0.0.0",
|
|
@@ -17,10 +15,10 @@ const generatedBy = {
|
|
|
17
15
|
export const vueAppPresetMetadata = {
|
|
18
16
|
name: "vue-app",
|
|
19
17
|
title: "Vue app",
|
|
20
|
-
description: "
|
|
18
|
+
description: "Vue app workspace with Vite, Tailwind, Pinia, and test tooling.",
|
|
21
19
|
generation: "supported",
|
|
22
20
|
supportedPackageManagers: ["pnpm"],
|
|
23
|
-
supportedProjectKinds: ["
|
|
21
|
+
supportedProjectKinds: ["multi-package"],
|
|
24
22
|
features: [
|
|
25
23
|
"pnpm-catalog",
|
|
26
24
|
"oxc-format-lint",
|
|
@@ -33,41 +31,149 @@ export const vueAppPresetMetadata = {
|
|
|
33
31
|
],
|
|
34
32
|
};
|
|
35
33
|
const dependencyMaintenancePolicy = {
|
|
36
|
-
ecosystems: ["npm", "github-actions"],
|
|
34
|
+
ecosystems: ["npm", "github-actions", "docker"],
|
|
37
35
|
interval: "weekly",
|
|
38
36
|
};
|
|
39
|
-
|
|
37
|
+
const webPackageBoundary = {
|
|
38
|
+
kind: "package-boundary",
|
|
39
|
+
path: ".",
|
|
40
|
+
};
|
|
41
|
+
const rootBoundary = {
|
|
42
|
+
kind: "workspace-orchestration",
|
|
43
|
+
path: ".",
|
|
44
|
+
};
|
|
45
|
+
const workspacePackageBoundary = {
|
|
46
|
+
kind: "package-boundary",
|
|
47
|
+
path: "apps/*",
|
|
48
|
+
};
|
|
49
|
+
const webWorkspaceBoundary = {
|
|
50
|
+
kind: "package-boundary",
|
|
51
|
+
path: "apps/web",
|
|
52
|
+
};
|
|
53
|
+
function planVueAppPackageChecks() {
|
|
54
|
+
return {
|
|
55
|
+
components: [
|
|
56
|
+
{ kind: "oxc-format-check", owner: webPackageBoundary },
|
|
57
|
+
{ kind: "oxc-lint", owner: webPackageBoundary },
|
|
58
|
+
{ kind: "typescript-typecheck", owner: webPackageBoundary },
|
|
59
|
+
{ kind: "build", owner: webPackageBoundary },
|
|
60
|
+
{ kind: "unit-test", owner: webPackageBoundary },
|
|
61
|
+
{ kind: "e2e-test", owner: webPackageBoundary },
|
|
62
|
+
],
|
|
63
|
+
environmentNeeds: [],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function planVueAppRootChecks() {
|
|
67
|
+
return {
|
|
68
|
+
components: [
|
|
69
|
+
{ kind: "oxc-format-check", owner: rootBoundary },
|
|
70
|
+
{ kind: "oxc-lint", owner: rootBoundary },
|
|
71
|
+
{ kind: "typescript-typecheck", owner: rootBoundary },
|
|
72
|
+
{ kind: "turbo-package-check", owner: workspacePackageBoundary },
|
|
73
|
+
],
|
|
74
|
+
environmentNeeds: [
|
|
75
|
+
{
|
|
76
|
+
kind: "playwright-browser-assets",
|
|
77
|
+
browser: "chromium",
|
|
78
|
+
owner: webWorkspaceBoundary,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function planVueAppPackageFixes() {
|
|
84
|
+
return {
|
|
85
|
+
components: [
|
|
86
|
+
{ kind: "oxc-format-write", owner: webPackageBoundary },
|
|
87
|
+
{ kind: "oxc-lint-fix", owner: webPackageBoundary },
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function planVueAppRootFixes() {
|
|
92
|
+
return {
|
|
93
|
+
components: [
|
|
94
|
+
{ kind: "oxc-format-write", owner: rootBoundary },
|
|
95
|
+
{ kind: "oxc-lint-fix", owner: rootBoundary },
|
|
96
|
+
{ kind: "turbo-package-fix", owner: workspacePackageBoundary },
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function projectNameFromDir(targetDir) {
|
|
101
|
+
return path.basename(path.resolve(targetDir));
|
|
102
|
+
}
|
|
103
|
+
function packageScopeFromOptions(options) {
|
|
104
|
+
return options.scope ?? projectNameFromDir(options.targetDir);
|
|
105
|
+
}
|
|
106
|
+
function packageName(packageScope) {
|
|
107
|
+
return `@${packageScope}/web`;
|
|
108
|
+
}
|
|
109
|
+
export function vueAppBlueprint(options = { targetDir: process.cwd() }) {
|
|
110
|
+
const packageScope = packageScopeFromOptions(options);
|
|
40
111
|
return {
|
|
41
112
|
schemaVersion: 1,
|
|
42
113
|
preset: "vue-app",
|
|
43
114
|
packageManager: "pnpm",
|
|
44
|
-
projectKind: "
|
|
115
|
+
projectKind: "multi-package",
|
|
45
116
|
features: [...vueAppPresetMetadata.features],
|
|
117
|
+
packages: [{ name: packageName(packageScope), path: "apps/web" }],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function projectVueAppRootPackageScripts() {
|
|
121
|
+
return {
|
|
122
|
+
check: renderRootCheckCommand(planVueAppRootChecks()),
|
|
123
|
+
fix: renderFixCommand(planVueAppRootFixes()),
|
|
124
|
+
"format:check": "oxfmt --check --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
|
|
125
|
+
"format:write": "oxfmt --write --config oxfmt.config.ts oxlint.config.ts oxfmt.config.ts",
|
|
126
|
+
lint: "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --deny-warnings",
|
|
127
|
+
"lint:fix": "oxlint --config oxlint.config.ts oxlint.config.ts oxfmt.config.ts --fix --deny-warnings",
|
|
128
|
+
typecheck: "tsc -p tsconfig.config.json --noEmit",
|
|
46
129
|
};
|
|
47
130
|
}
|
|
48
131
|
export function projectVueAppPackageScripts() {
|
|
49
132
|
return {
|
|
50
133
|
build: "vite build",
|
|
51
|
-
check: renderRootCheckCommand(
|
|
134
|
+
check: renderRootCheckCommand(planVueAppPackageChecks()),
|
|
52
135
|
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",
|
|
136
|
+
fix: renderFixCommand(planVueAppPackageFixes()),
|
|
137
|
+
"format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
|
|
138
|
+
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
139
|
+
lint: "oxlint --config ../../oxlint.config.ts . --deny-warnings",
|
|
140
|
+
"lint:fix": "oxlint --config ../../oxlint.config.ts . --fix --deny-warnings",
|
|
58
141
|
preview: "vite preview",
|
|
59
142
|
test: "vitest run",
|
|
60
143
|
"test:e2e": "pnpm run build && playwright test",
|
|
61
144
|
typecheck: "vue-tsc --build --noEmit",
|
|
62
145
|
};
|
|
63
146
|
}
|
|
64
|
-
function
|
|
147
|
+
function rootPackageJson(context, packageScripts) {
|
|
65
148
|
return {
|
|
66
149
|
name: context.projectName.value,
|
|
67
150
|
version: "0.0.0",
|
|
68
151
|
private: true,
|
|
69
152
|
type: "module",
|
|
70
153
|
scripts: packageScripts,
|
|
154
|
+
devDependencies: {
|
|
155
|
+
oxfmt: "catalog:",
|
|
156
|
+
oxlint: "catalog:",
|
|
157
|
+
turbo: "catalog:",
|
|
158
|
+
typescript: "catalog:",
|
|
159
|
+
},
|
|
160
|
+
engines: {
|
|
161
|
+
node: context.toolchain.nodeLtsMajor.value,
|
|
162
|
+
},
|
|
163
|
+
packageManager: context.toolchain.packageManagerPin.value,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function webPackageName(context) {
|
|
167
|
+
const webPackage = context.blueprint.packages?.find((pkg) => pkg.path === "apps/web");
|
|
168
|
+
return webPackage?.name ?? packageName(context.projectName.value);
|
|
169
|
+
}
|
|
170
|
+
function webPackageJson(context) {
|
|
171
|
+
return {
|
|
172
|
+
name: webPackageName(context),
|
|
173
|
+
version: "0.0.0",
|
|
174
|
+
private: true,
|
|
175
|
+
type: "module",
|
|
176
|
+
scripts: projectVueAppPackageScripts(),
|
|
71
177
|
dependencies: {
|
|
72
178
|
"@vueuse/core": "catalog:",
|
|
73
179
|
pinia: "catalog:",
|
|
@@ -91,7 +197,6 @@ function packageJson(context, packageScripts) {
|
|
|
91
197
|
engines: {
|
|
92
198
|
node: context.toolchain.nodeLtsMajor.value,
|
|
93
199
|
},
|
|
94
|
-
packageManager: context.toolchain.packageManagerPin.value,
|
|
95
200
|
};
|
|
96
201
|
}
|
|
97
202
|
function generationRecord(context) {
|
|
@@ -111,42 +216,95 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
111
216
|
"tailwind",
|
|
112
217
|
"vitest",
|
|
113
218
|
]);
|
|
219
|
+
const developmentContainer = checkedDockerfileFirstNodePnpmDevcontainer({
|
|
220
|
+
name: context.projectName.value,
|
|
221
|
+
layer: nodePnpmToolLayer({
|
|
222
|
+
nodeVersion: context.toolchain.nodeLtsMajor.value,
|
|
223
|
+
packageManagerPin: context.toolchain.packageManagerPin.value,
|
|
224
|
+
}),
|
|
225
|
+
additionalLayers: [browserTestToolLayer()],
|
|
226
|
+
extensions: editorCustomization.extensions,
|
|
227
|
+
settings: editorCustomization.settings,
|
|
228
|
+
});
|
|
229
|
+
const rootManifest = rootPackageJson(context, packageScripts);
|
|
230
|
+
const webManifest = webPackageJson(context);
|
|
114
231
|
return [
|
|
115
232
|
{
|
|
116
233
|
kind: "writeJson",
|
|
117
234
|
to: "package.json",
|
|
118
|
-
value:
|
|
235
|
+
value: rootManifest,
|
|
119
236
|
},
|
|
120
237
|
{
|
|
121
238
|
kind: "writeText",
|
|
122
239
|
to: "pnpm-workspace.yaml",
|
|
123
240
|
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
|
-
],
|
|
241
|
+
packages: ["apps/*"],
|
|
242
|
+
dependencies: collectGeneratedManifestCatalogDependencies([
|
|
243
|
+
rootManifest,
|
|
244
|
+
webManifest,
|
|
245
|
+
]),
|
|
142
246
|
allowBuilds: {
|
|
143
247
|
esbuild: true,
|
|
144
248
|
},
|
|
145
249
|
}),
|
|
146
250
|
},
|
|
251
|
+
{
|
|
252
|
+
kind: "writeJson",
|
|
253
|
+
to: "turbo.json",
|
|
254
|
+
value: {
|
|
255
|
+
tasks: {
|
|
256
|
+
build: {
|
|
257
|
+
dependsOn: ["^build"],
|
|
258
|
+
outputs: ["dist/**"],
|
|
259
|
+
},
|
|
260
|
+
check: {
|
|
261
|
+
dependsOn: ["^build"],
|
|
262
|
+
},
|
|
263
|
+
dev: {
|
|
264
|
+
cache: false,
|
|
265
|
+
persistent: true,
|
|
266
|
+
},
|
|
267
|
+
fix: {
|
|
268
|
+
cache: false,
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
},
|
|
147
273
|
{
|
|
148
274
|
kind: "writeJson",
|
|
149
275
|
to: "tsconfig.json",
|
|
276
|
+
value: {
|
|
277
|
+
files: [],
|
|
278
|
+
references: [
|
|
279
|
+
{ path: "./apps/web/tsconfig.app.json" },
|
|
280
|
+
{ path: "./apps/web/tsconfig.test.json" },
|
|
281
|
+
{ path: "./apps/web/tsconfig.node.json" },
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
kind: "writeJson",
|
|
287
|
+
to: "tsconfig.config.json",
|
|
288
|
+
value: {
|
|
289
|
+
compilerOptions: {
|
|
290
|
+
module: "NodeNext",
|
|
291
|
+
moduleResolution: "NodeNext",
|
|
292
|
+
noEmitOnError: true,
|
|
293
|
+
skipLibCheck: false,
|
|
294
|
+
strict: true,
|
|
295
|
+
target: "ES2022",
|
|
296
|
+
},
|
|
297
|
+
include: ["oxlint.config.ts", "oxfmt.config.ts"],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
kind: "writeJson",
|
|
302
|
+
to: "apps/web/package.json",
|
|
303
|
+
value: webManifest,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
kind: "writeJson",
|
|
307
|
+
to: "apps/web/tsconfig.json",
|
|
150
308
|
value: {
|
|
151
309
|
files: [],
|
|
152
310
|
references: [
|
|
@@ -158,7 +316,7 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
158
316
|
},
|
|
159
317
|
{
|
|
160
318
|
kind: "writeJson",
|
|
161
|
-
to: "tsconfig.app.json",
|
|
319
|
+
to: "apps/web/tsconfig.app.json",
|
|
162
320
|
value: {
|
|
163
321
|
extends: "@vue/tsconfig/tsconfig.dom.json",
|
|
164
322
|
compilerOptions: {
|
|
@@ -180,7 +338,7 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
180
338
|
},
|
|
181
339
|
{
|
|
182
340
|
kind: "writeJson",
|
|
183
|
-
to: "tsconfig.test.json",
|
|
341
|
+
to: "apps/web/tsconfig.test.json",
|
|
184
342
|
value: {
|
|
185
343
|
extends: "./tsconfig.app.json",
|
|
186
344
|
compilerOptions: {
|
|
@@ -193,7 +351,7 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
193
351
|
},
|
|
194
352
|
{
|
|
195
353
|
kind: "writeJson",
|
|
196
|
-
to: "tsconfig.node.json",
|
|
354
|
+
to: "apps/web/tsconfig.node.json",
|
|
197
355
|
value: {
|
|
198
356
|
compilerOptions: {
|
|
199
357
|
composite: true,
|
|
@@ -231,52 +389,59 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
231
389
|
"playwright-report",
|
|
232
390
|
"test-results",
|
|
233
391
|
".env",
|
|
392
|
+
".template/",
|
|
393
|
+
".pnpm-store/",
|
|
234
394
|
"",
|
|
235
395
|
].join("\n"),
|
|
236
396
|
},
|
|
237
|
-
{ kind: "copyFile", from: "env.d.ts", to: "env.d.ts" },
|
|
238
|
-
{ kind: "copyFile", from: "index.html", to: "index.html" },
|
|
397
|
+
{ kind: "copyFile", from: "env.d.ts", to: "apps/web/env.d.ts" },
|
|
398
|
+
{ kind: "copyFile", from: "index.html", to: "apps/web/index.html" },
|
|
239
399
|
{
|
|
240
400
|
kind: "copyFile",
|
|
241
401
|
from: "playwright.config.ts",
|
|
242
|
-
to: "playwright.config.ts",
|
|
402
|
+
to: "apps/web/playwright.config.ts",
|
|
243
403
|
},
|
|
244
|
-
{ kind: "copyFile", from: "vite.config.ts", to: "vite.config.ts" },
|
|
245
|
-
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
404
|
+
{ kind: "copyFile", from: "vite.config.ts", to: "apps/web/vite.config.ts" },
|
|
405
|
+
{
|
|
406
|
+
kind: "copyFile",
|
|
407
|
+
from: "vitest.config.ts",
|
|
408
|
+
to: "apps/web/vitest.config.ts",
|
|
409
|
+
},
|
|
410
|
+
{ kind: "copyFile", from: "src/App.vue", to: "apps/web/src/App.vue" },
|
|
411
|
+
{ kind: "copyFile", from: "src/main.ts", to: "apps/web/src/main.ts" },
|
|
412
|
+
{ kind: "copyFile", from: "src/style.css", to: "apps/web/src/style.css" },
|
|
249
413
|
{
|
|
250
414
|
kind: "copyFile",
|
|
251
415
|
from: "src/stores/counter.ts",
|
|
252
|
-
to: "src/stores/counter.ts",
|
|
416
|
+
to: "apps/web/src/stores/counter.ts",
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
kind: "copyFile",
|
|
420
|
+
from: "test/app.test.ts",
|
|
421
|
+
to: "apps/web/test/app.test.ts",
|
|
253
422
|
},
|
|
254
|
-
{ kind: "copyFile", from: "test/app.test.ts", to: "test/app.test.ts" },
|
|
255
423
|
{
|
|
256
424
|
kind: "copyFile",
|
|
257
425
|
from: "test/e2e/app.spec.ts",
|
|
258
|
-
to: "test/e2e/app.spec.ts",
|
|
426
|
+
to: "apps/web/test/e2e/app.spec.ts",
|
|
259
427
|
},
|
|
260
428
|
{
|
|
261
429
|
kind: "writeJson",
|
|
262
|
-
to: ".
|
|
263
|
-
value:
|
|
430
|
+
to: ".template/blueprint.json",
|
|
431
|
+
value: context.blueprint,
|
|
264
432
|
},
|
|
265
433
|
{
|
|
266
434
|
kind: "writeJson",
|
|
267
|
-
to: ".
|
|
435
|
+
to: ".template/generated-by.json",
|
|
268
436
|
value: generationRecord(context),
|
|
269
437
|
},
|
|
270
438
|
{
|
|
271
439
|
kind: "writeJson",
|
|
272
440
|
to: ".devcontainer/devcontainer.json",
|
|
273
|
-
value:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
extensions: editorCustomization.extensions,
|
|
278
|
-
settings: editorCustomization.settings,
|
|
279
|
-
}),
|
|
441
|
+
value: developmentContainer.devcontainer,
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
...developmentContainer.dockerfileOperation,
|
|
280
445
|
},
|
|
281
446
|
{
|
|
282
447
|
kind: "writeJson",
|
|
@@ -292,14 +457,14 @@ function operationsForVueApp(context, packageScripts, checkPlan) {
|
|
|
292
457
|
value: editorCustomization.settings,
|
|
293
458
|
},
|
|
294
459
|
{
|
|
295
|
-
kind: "
|
|
460
|
+
kind: "copyFile",
|
|
461
|
+
from: ".github/workflows/check.yml",
|
|
296
462
|
to: ".github/workflows/check.yml",
|
|
297
|
-
text: projectCheckWorkflow({ checkPlan }),
|
|
298
463
|
},
|
|
299
464
|
{
|
|
300
|
-
kind: "
|
|
465
|
+
kind: "copyFile",
|
|
466
|
+
from: ".github/dependabot.yml",
|
|
301
467
|
to: ".github/dependabot.yml",
|
|
302
|
-
text: projectDependabotConfig(dependencyMaintenancePolicy),
|
|
303
468
|
},
|
|
304
469
|
];
|
|
305
470
|
}
|
|
@@ -465,18 +630,6 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
|
|
|
465
630
|
include: ["playwright.config.ts", "vite.config.ts", "vitest.config.ts"],
|
|
466
631
|
},
|
|
467
632
|
},
|
|
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
633
|
{ kind: "copyFile", from: "env.d.ts", to: `${packagePath}/env.d.ts` },
|
|
481
634
|
{ kind: "copyFile", from: "index.html", to: `${packagePath}/index.html` },
|
|
482
635
|
{
|
|
@@ -518,12 +671,12 @@ function packageAdditionOperations(packagePath, packageName, nodeVersion) {
|
|
|
518
671
|
},
|
|
519
672
|
];
|
|
520
673
|
}
|
|
521
|
-
async function packageAdditionPlan({ root, blueprint,
|
|
522
|
-
const
|
|
674
|
+
async function packageAdditionPlan({ root, blueprint, packageName, packagePath, nodeVersion, }) {
|
|
675
|
+
const [workspaceCollection] = packagePath.split("/");
|
|
523
676
|
const previewPort = await nextVuePreviewPort(root, blueprint);
|
|
524
677
|
return {
|
|
525
678
|
packagePath,
|
|
526
|
-
workspacePackageGlob:
|
|
679
|
+
workspacePackageGlob: `${workspaceCollection}/*`,
|
|
527
680
|
rootTsconfigReferences: [
|
|
528
681
|
`./${packagePath}/tsconfig.app.json`,
|
|
529
682
|
`./${packagePath}/tsconfig.test.json`,
|
|
@@ -554,6 +707,13 @@ function sharedOxcSourceRoot() {
|
|
|
554
707
|
? publishedSharedRoot
|
|
555
708
|
: path.join(projectionDir, "..", "shared", "oxc");
|
|
556
709
|
}
|
|
710
|
+
function sharedDevcontainerSourceRoot() {
|
|
711
|
+
const projectionDir = path.dirname(fileURLToPath(import.meta.url));
|
|
712
|
+
const publishedSharedRoot = path.join(projectionDir, "..", "..", "..", "templates", "shared", "devcontainer");
|
|
713
|
+
return existsSync(path.join(publishedSharedRoot, "node-pnpm.Dockerfile"))
|
|
714
|
+
? publishedSharedRoot
|
|
715
|
+
: path.join(projectionDir, "..", "shared", "devcontainer");
|
|
716
|
+
}
|
|
557
717
|
export const vueAppPresetProjection = {
|
|
558
718
|
metadata: vueAppPresetMetadata,
|
|
559
719
|
capabilities: {
|
|
@@ -563,12 +723,15 @@ export const vueAppPresetProjection = {
|
|
|
563
723
|
},
|
|
564
724
|
blueprint: vueAppBlueprint,
|
|
565
725
|
project(context) {
|
|
566
|
-
const checkPlan =
|
|
567
|
-
const fixPlan =
|
|
568
|
-
const packageScripts =
|
|
726
|
+
const checkPlan = planVueAppRootChecks();
|
|
727
|
+
const fixPlan = planVueAppRootFixes();
|
|
728
|
+
const packageScripts = projectVueAppRootPackageScripts();
|
|
569
729
|
return {
|
|
570
730
|
sourceRoot: templateSourceRoot(),
|
|
571
|
-
sourceRoots: {
|
|
731
|
+
sourceRoots: {
|
|
732
|
+
sharedDevcontainer: sharedDevcontainerSourceRoot(),
|
|
733
|
+
sharedOxc: sharedOxcSourceRoot(),
|
|
734
|
+
},
|
|
572
735
|
operations: operationsForVueApp(context, packageScripts, checkPlan),
|
|
573
736
|
checkPlan,
|
|
574
737
|
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
|