@ykdz/template 0.0.31 → 0.0.33
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/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +10 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +320 -161
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +66 -9
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.js +35 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.d.ts +13 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.js +70 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +2 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +22 -7
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.js +4 -3
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +4 -3
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +82 -11
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +9 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +27 -10
- package/node_modules/@ykdz/template-builtin-presets/package.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment-diagnostics.yml +81 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment.yml +55 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-diagnostics.yml +64 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +24 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/devcontainer.json +3 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/typescript-config/base.json +15 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/typescript-config/turbo.json +4 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/rust.Dockerfile +3 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/browser-test.Dockerfile +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/tsconfig.config.json +2 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.app.json +6 -13
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.node.json +2 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.json +2 -6
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +3 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +2 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/tsconfig.json +2 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/devcontainer/docker-client.Dockerfile +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/playwright.config.ts +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/check-standalone-deployment.ts +67 -27
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.app.json +6 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.node.json +2 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +0 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/playwright.config.ts +2 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +2 -12
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/playwright.config.ts +2 -0
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.d.ts +19 -0
- package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.js +68 -0
- package/node_modules/@ykdz/template-core/dist/development-container-tool-layer.d.ts +56 -0
- package/node_modules/@ykdz/template-core/dist/development-container-tool-layer.js +361 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +15 -1
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +7 -0
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +1 -0
- package/node_modules/@ykdz/template-core/dist/project-github.d.ts +51 -15
- package/node_modules/@ykdz/template-core/dist/project-github.js +83 -96
- package/node_modules/@ykdz/template-core/dist/project-projection.d.ts +9 -0
- package/node_modules/@ykdz/template-core/dist/project-projection.js +84 -5
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +1 -0
- package/node_modules/@ykdz/template-core/dist/renderer.js +47 -7
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +15 -1
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +183 -1
- package/package.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-playwright.yml +0 -20
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-rust.yml +0 -23
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.dynamic.template +0 -19
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/extensions.json +0 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/settings.json +0 -5
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/devcontainer/devcontainer.json +0 -21
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/devcontainer/rust.Dockerfile +0 -18
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/rust-toolchain.toml +0 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/devcontainer.json +0 -21
- package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +0 -83
- package/node_modules/@ykdz/template-core/dist/devcontainer.js +0 -217
- /package/node_modules/@ykdz/template-builtin-presets/templates/{shared → vike-app}/devcontainer/shellcheck.Dockerfile +0 -0
|
@@ -18,11 +18,10 @@ function packageScripts() {
|
|
|
18
18
|
test: "cargo test --workspace",
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function rustContribution(
|
|
22
|
-
const cargoName = cargoPackageName(context.projectName);
|
|
21
|
+
function rustContribution(options) {
|
|
23
22
|
const definition = {
|
|
24
|
-
name: `@${context.scope}/${
|
|
25
|
-
path:
|
|
23
|
+
name: `@${options.context.scope}/${options.packageLeafName}`,
|
|
24
|
+
path: options.packagePath,
|
|
26
25
|
role: "native-package",
|
|
27
26
|
};
|
|
28
27
|
const operations = [
|
|
@@ -32,14 +31,14 @@ function rustContribution(context) {
|
|
|
32
31
|
source: templateSources.rustBin,
|
|
33
32
|
from: "Cargo.toml",
|
|
34
33
|
to: `${definition.path}/Cargo.toml`,
|
|
35
|
-
replacements: { CARGO_PACKAGE_NAME:
|
|
34
|
+
replacements: { CARGO_PACKAGE_NAME: options.packageLeafName },
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
37
|
kind: "writeTextTemplate",
|
|
39
38
|
source: templateSources.rustBin,
|
|
40
39
|
from: "Cargo.lock",
|
|
41
40
|
to: `${definition.path}/Cargo.lock`,
|
|
42
|
-
replacements: { CARGO_PACKAGE_NAME:
|
|
41
|
+
replacements: { CARGO_PACKAGE_NAME: options.packageLeafName },
|
|
43
42
|
},
|
|
44
43
|
{
|
|
45
44
|
kind: "copyFile",
|
|
@@ -68,7 +67,7 @@ function rustContribution(context) {
|
|
|
68
67
|
version: "0.0.0",
|
|
69
68
|
private: true,
|
|
70
69
|
scripts: packageScripts(),
|
|
71
|
-
engines: { node: context.toolchain.nodeLtsMajor },
|
|
70
|
+
engines: { node: options.context.toolchain.nodeLtsMajor },
|
|
72
71
|
},
|
|
73
72
|
operations,
|
|
74
73
|
environmentNeeds: [
|
|
@@ -93,6 +92,44 @@ function rustContribution(context) {
|
|
|
93
92
|
directories: { cargo: `/${definition.path}` },
|
|
94
93
|
interval: "weekly",
|
|
95
94
|
},
|
|
95
|
+
developmentContainerToolLayers: [
|
|
96
|
+
{
|
|
97
|
+
identity: "rust",
|
|
98
|
+
dockerfile: {
|
|
99
|
+
source: templateSources.rustBin,
|
|
100
|
+
from: "devcontainer/rust.Dockerfile",
|
|
101
|
+
},
|
|
102
|
+
requires: ["node-pnpm"],
|
|
103
|
+
buildArguments: [{ name: "RUST_TOOLCHAIN", value: "stable" }],
|
|
104
|
+
mounts: [
|
|
105
|
+
{
|
|
106
|
+
identity: "cargo-registry",
|
|
107
|
+
type: "volume",
|
|
108
|
+
source: "${devcontainerId}-cargo-registry",
|
|
109
|
+
target: "/usr/local/cargo/registry",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
identity: "cargo-git",
|
|
113
|
+
type: "volume",
|
|
114
|
+
source: "${devcontainerId}-cargo-git",
|
|
115
|
+
target: "/usr/local/cargo/git",
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
probes: [
|
|
119
|
+
{ identity: "cargo", command: "cargo", args: ["--version"] },
|
|
120
|
+
{ identity: "rustc", command: "rustc", args: ["--version"] },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
templateFiles: [
|
|
125
|
+
{
|
|
126
|
+
identity: "rust-toolchain",
|
|
127
|
+
source: templateSources.rustBin,
|
|
128
|
+
from: "rust-toolchain.toml",
|
|
129
|
+
to: "rust-toolchain.toml",
|
|
130
|
+
replacements: { RUST_TOOLCHAIN: "stable" },
|
|
131
|
+
},
|
|
132
|
+
],
|
|
96
133
|
},
|
|
97
134
|
};
|
|
98
135
|
}
|
|
@@ -105,10 +142,30 @@ export const rustBinDefinition = {
|
|
|
105
142
|
source: templateSources.rustBin,
|
|
106
143
|
plannerSourceFile: fileURLToPath(import.meta.url),
|
|
107
144
|
blueprint(context) {
|
|
145
|
+
const packageLeafName = cargoPackageName(context.projectName);
|
|
108
146
|
return {
|
|
109
147
|
schemaVersion: 2,
|
|
110
|
-
packages: [
|
|
148
|
+
packages: [
|
|
149
|
+
rustContribution({
|
|
150
|
+
context,
|
|
151
|
+
packageLeafName,
|
|
152
|
+
packagePath: `packages/${packageLeafName}`,
|
|
153
|
+
}).definition,
|
|
154
|
+
],
|
|
111
155
|
};
|
|
112
156
|
},
|
|
113
|
-
planInitialization
|
|
157
|
+
planInitialization(context) {
|
|
158
|
+
const packageLeafName = cargoPackageName(context.projectName);
|
|
159
|
+
return rustContribution({
|
|
160
|
+
context,
|
|
161
|
+
packageLeafName,
|
|
162
|
+
packagePath: `packages/${packageLeafName}`,
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
defaultPackagePath({ packageLeafName }) {
|
|
166
|
+
return `packages/${packageLeafName}`;
|
|
167
|
+
},
|
|
168
|
+
planPackageAddition({ context, packageLeafName, packagePath }) {
|
|
169
|
+
return rustContribution({ context, packageLeafName, packagePath });
|
|
170
|
+
},
|
|
114
171
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { loadTemplateDependencyCatalog } from "#template-core/dependency-catalog";
|
|
2
|
+
import { templateSources } from "../template-sources.js";
|
|
3
|
+
export function browserTestDevelopmentContainerToolLayer() {
|
|
4
|
+
const playwrightTestVersion = loadTemplateDependencyCatalog()["@playwright/test"];
|
|
5
|
+
if (playwrightTestVersion === undefined) {
|
|
6
|
+
throw new Error("Template Dependency Catalog is missing dependency: @playwright/test");
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
identity: "browser-test",
|
|
10
|
+
dockerfile: {
|
|
11
|
+
source: templateSources.sharedDevcontainer,
|
|
12
|
+
from: "browser-test.Dockerfile",
|
|
13
|
+
},
|
|
14
|
+
requires: ["node-pnpm"],
|
|
15
|
+
buildArguments: [
|
|
16
|
+
{
|
|
17
|
+
name: "PLAYWRIGHT_CLI_PACKAGE",
|
|
18
|
+
value: `@playwright/test@${playwrightTestVersion}`,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
probes: [
|
|
22
|
+
{
|
|
23
|
+
identity: "playwright",
|
|
24
|
+
command: "npx",
|
|
25
|
+
args: [
|
|
26
|
+
"--yes",
|
|
27
|
+
"--package",
|
|
28
|
+
`@playwright/test@${playwrightTestVersion}`,
|
|
29
|
+
"playwright",
|
|
30
|
+
"--version",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PackageContribution } from "#template-core/package-contribution";
|
|
2
|
+
import type { GenerationContext } from "#template-core/preset-definition";
|
|
3
|
+
import type { PackageDefinition } from "#template-core/project-blueprint-v2";
|
|
4
|
+
import type { RenderOperation, TemplateSourceHandle } from "#template-core/renderer";
|
|
5
|
+
export declare function typescriptConfigPackageName(context: GenerationContext): string;
|
|
6
|
+
export declare function typescriptConfigPackageDefinition(context: GenerationContext): PackageDefinition;
|
|
7
|
+
export declare function typescriptConfigSourceOperation(options: {
|
|
8
|
+
readonly context: GenerationContext;
|
|
9
|
+
readonly source: TemplateSourceHandle;
|
|
10
|
+
readonly from: string;
|
|
11
|
+
readonly to: string;
|
|
12
|
+
}): RenderOperation;
|
|
13
|
+
export declare function typescriptConfigContribution(context: GenerationContext): PackageContribution;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { templateSources } from "../template-sources.js";
|
|
2
|
+
export function typescriptConfigPackageName(context) {
|
|
3
|
+
return `@${context.scope}/typescript-config`;
|
|
4
|
+
}
|
|
5
|
+
export function typescriptConfigPackageDefinition(context) {
|
|
6
|
+
return {
|
|
7
|
+
name: typescriptConfigPackageName(context),
|
|
8
|
+
path: "packages/typescript-config",
|
|
9
|
+
role: "shared-library",
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function typescriptConfigSourceOperation(options) {
|
|
13
|
+
return {
|
|
14
|
+
kind: "writeTextTemplate",
|
|
15
|
+
source: options.source,
|
|
16
|
+
from: options.from,
|
|
17
|
+
to: options.to,
|
|
18
|
+
replacements: {
|
|
19
|
+
TYPESCRIPT_CONFIG_PACKAGE: typescriptConfigPackageName(options.context),
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function typescriptConfigContribution(context) {
|
|
24
|
+
const definition = typescriptConfigPackageDefinition(context);
|
|
25
|
+
return {
|
|
26
|
+
definition,
|
|
27
|
+
exposure: { exports: {}, imports: {} },
|
|
28
|
+
manifest: {
|
|
29
|
+
name: definition.name,
|
|
30
|
+
version: "0.0.0",
|
|
31
|
+
private: true,
|
|
32
|
+
files: ["base.json"],
|
|
33
|
+
scripts: {
|
|
34
|
+
"format:check": "oxfmt --list-different --config ../../oxfmt.config.ts .",
|
|
35
|
+
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
36
|
+
},
|
|
37
|
+
devDependencies: { oxfmt: "catalog:" },
|
|
38
|
+
engines: { node: context.toolchain.nodeLtsMajor },
|
|
39
|
+
},
|
|
40
|
+
operations: [
|
|
41
|
+
{
|
|
42
|
+
kind: "writeJson",
|
|
43
|
+
to: `${definition.path}/package.json`,
|
|
44
|
+
value: {},
|
|
45
|
+
multilineArrays: ["files"],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
kind: "copyFile",
|
|
49
|
+
source: templateSources.foundation,
|
|
50
|
+
from: "typescript-config/base.json",
|
|
51
|
+
to: `${definition.path}/base.json`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
kind: "copyFile",
|
|
55
|
+
source: templateSources.foundation,
|
|
56
|
+
from: "typescript-config/turbo.json",
|
|
57
|
+
to: `${definition.path}/turbo.json`,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
environmentNeeds: [],
|
|
61
|
+
foundation: {
|
|
62
|
+
toolchains: {},
|
|
63
|
+
editorCapabilities: ["oxc-format-lint"],
|
|
64
|
+
dependencyMaintenance: {
|
|
65
|
+
ecosystems: ["npm", "github-actions", "docker"],
|
|
66
|
+
interval: "weekly",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -22,10 +22,11 @@ export declare const vueApplicationExposure: {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export declare function vueApplicationScripts(): Record<string, string>;
|
|
25
|
-
export declare function sharedVueSourceOperations(packagePath: string): readonly RenderOperation[];
|
|
25
|
+
export declare function sharedVueSourceOperations(context: GenerationContext, packagePath: string): readonly RenderOperation[];
|
|
26
26
|
/** Vike shares Vue's compiler runner, but owns its distinct Vike source tree. */
|
|
27
27
|
export declare function vueTypecheckRunnerSourceOperation(packagePath: string): RenderOperation;
|
|
28
28
|
export declare function vueApplicationEnvironmentNeeds(packagePath: string): import("@ykdz/template-core/module-graph").PlaywrightBrowserAssetsEnvironmentNeed[];
|
|
29
|
+
export declare function vueApplicationDevelopmentContainerToolLayers(): import("@ykdz/template-core/development-container-tool-layer").DevelopmentContainerToolLayer[];
|
|
29
30
|
export declare function vueApplicationManifest(options: {
|
|
30
31
|
readonly context: GenerationContext;
|
|
31
32
|
readonly definition: PackageDefinition;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { playwrightBrowserAssetsEnvironmentNeed } from "#template-core/module-graph";
|
|
2
2
|
import { templateSources } from "../template-sources.js";
|
|
3
|
+
import { browserTestDevelopmentContainerToolLayer } from "./development-container.js";
|
|
4
|
+
import { typescriptConfigSourceOperation } from "./typescript.js";
|
|
3
5
|
/** Vue's tooling peers need these repository policy overrides, never Core defaults. */
|
|
4
6
|
export const vuePnpmDependencyOverrides = {
|
|
5
7
|
"pinia>typescript": "-",
|
|
@@ -33,13 +35,23 @@ export function vueApplicationScripts() {
|
|
|
33
35
|
"test:e2e": "node --conditions=source scripts/run-playwright.ts",
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
|
-
export function sharedVueSourceOperations(packagePath) {
|
|
37
|
-
return sharedVueSourceFiles.map((from) =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
export function sharedVueSourceOperations(context, packagePath) {
|
|
39
|
+
return sharedVueSourceFiles.map((from) => {
|
|
40
|
+
const to = `${packagePath}/${from.replace("typescript/", "scripts/")}`;
|
|
41
|
+
return from === "tsconfig.app.json" || from === "tsconfig.node.json"
|
|
42
|
+
? typescriptConfigSourceOperation({
|
|
43
|
+
context,
|
|
44
|
+
source: templateSources.vue,
|
|
45
|
+
from,
|
|
46
|
+
to,
|
|
47
|
+
})
|
|
48
|
+
: {
|
|
49
|
+
kind: "copyFile",
|
|
50
|
+
source: templateSources.vue,
|
|
51
|
+
from,
|
|
52
|
+
to,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
43
55
|
}
|
|
44
56
|
/** Vike shares Vue's compiler runner, but owns its distinct Vike source tree. */
|
|
45
57
|
export function vueTypecheckRunnerSourceOperation(packagePath) {
|
|
@@ -58,6 +70,9 @@ export function vueApplicationEnvironmentNeeds(packagePath) {
|
|
|
58
70
|
}),
|
|
59
71
|
];
|
|
60
72
|
}
|
|
73
|
+
export function vueApplicationDevelopmentContainerToolLayers() {
|
|
74
|
+
return [browserTestDevelopmentContainerToolLayer()];
|
|
75
|
+
}
|
|
61
76
|
export function vueApplicationManifest(options) {
|
|
62
77
|
return {
|
|
63
78
|
name: options.definition.name,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
2
3
|
import { templateSources } from "../template-sources.js";
|
|
3
4
|
function packageScripts() {
|
|
4
5
|
return {
|
|
@@ -43,12 +44,12 @@ function cliContribution(options) {
|
|
|
43
44
|
value: {},
|
|
44
45
|
multilineArrays: ["files"],
|
|
45
46
|
},
|
|
46
|
-
{
|
|
47
|
-
|
|
47
|
+
typescriptConfigSourceOperation({
|
|
48
|
+
context: options.context,
|
|
48
49
|
source: templateSources.tsCli,
|
|
49
50
|
from: "tsconfig.json",
|
|
50
51
|
to: `${definition.path}/tsconfig.json`,
|
|
51
|
-
},
|
|
52
|
+
}),
|
|
52
53
|
{
|
|
53
54
|
kind: "copyFile",
|
|
54
55
|
source: templateSources.tsCli,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
2
3
|
import { templateSources } from "../template-sources.js";
|
|
3
4
|
function packageScripts() {
|
|
4
5
|
return {
|
|
@@ -34,12 +35,12 @@ function libraryContribution(options) {
|
|
|
34
35
|
};
|
|
35
36
|
const operations = [
|
|
36
37
|
{ kind: "writeJson", to: `${definition.path}/package.json`, value: {} },
|
|
37
|
-
{
|
|
38
|
-
|
|
38
|
+
typescriptConfigSourceOperation({
|
|
39
|
+
context: options.context,
|
|
39
40
|
source: templateSources.tsLib,
|
|
40
41
|
from: "tsconfig.json",
|
|
41
42
|
to: `${definition.path}/tsconfig.json`,
|
|
42
|
-
},
|
|
43
|
+
}),
|
|
43
44
|
{
|
|
44
45
|
kind: "copyFile",
|
|
45
46
|
source: templateSources.tsLib,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { dockerEngineEnvironmentNeed, playwrightBrowserAssetsEnvironmentNeed, shellCheckEnvironmentNeed, } from "#template-core/module-graph";
|
|
3
|
+
import { browserTestDevelopmentContainerToolLayer } from "../shared/development-container.js";
|
|
4
|
+
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
3
5
|
import { vueTypecheckRunnerSourceOperation } from "../shared/vue.js";
|
|
4
6
|
import { templateSources } from "../template-sources.js";
|
|
5
7
|
function definitions(context) {
|
|
@@ -34,6 +36,51 @@ function foundation() {
|
|
|
34
36
|
workspacePackageGlobs: ["apps/*", "packages/*"],
|
|
35
37
|
};
|
|
36
38
|
}
|
|
39
|
+
function shellCheckDevelopmentContainerToolLayer() {
|
|
40
|
+
return {
|
|
41
|
+
identity: "shellcheck",
|
|
42
|
+
dockerfile: {
|
|
43
|
+
source: templateSources.vikeApp,
|
|
44
|
+
from: "devcontainer/shellcheck.Dockerfile",
|
|
45
|
+
},
|
|
46
|
+
requires: ["node-pnpm"],
|
|
47
|
+
probes: [
|
|
48
|
+
{ identity: "shellcheck", command: "shellcheck", args: ["--version"] },
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function dockerClientDevelopmentContainerToolLayer() {
|
|
53
|
+
return {
|
|
54
|
+
identity: "docker-client",
|
|
55
|
+
dockerfile: {
|
|
56
|
+
source: templateSources.vikeApp,
|
|
57
|
+
from: "devcontainer/docker-client.Dockerfile",
|
|
58
|
+
},
|
|
59
|
+
requires: ["node-pnpm"],
|
|
60
|
+
mounts: [
|
|
61
|
+
{
|
|
62
|
+
identity: "docker-socket",
|
|
63
|
+
type: "bind",
|
|
64
|
+
source: "/var/run/docker.sock",
|
|
65
|
+
target: "/var/run/docker.sock",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
probes: [
|
|
69
|
+
{
|
|
70
|
+
identity: "docker-cli",
|
|
71
|
+
command: "docker",
|
|
72
|
+
args: ["--version"],
|
|
73
|
+
failureMessage: "Docker CLI is unavailable; rebuild the Development Container to install the Docker Client Tool Layer.",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
identity: "docker-daemon",
|
|
77
|
+
command: "docker",
|
|
78
|
+
args: ["version"],
|
|
79
|
+
failureMessage: "Docker daemon is inaccessible through /var/run/docker.sock; verify the host daemon is running and the standard socket is accessible.",
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
37
84
|
function webScripts() {
|
|
38
85
|
const prepareDatabase = "DATABASE_FILE=../../apps/web/data/app.sqlite pnpm --dir ../../packages/db-migrations run db:prepare:dev";
|
|
39
86
|
return {
|
|
@@ -81,13 +128,29 @@ function migrationScripts(databasePackageName) {
|
|
|
81
128
|
typecheck: "tsc -p tsconfig.json --noEmit --pretty false",
|
|
82
129
|
};
|
|
83
130
|
}
|
|
84
|
-
function copyOperations(packagePath, sourceFiles) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
131
|
+
function copyOperations(context, packagePath, sourceFiles) {
|
|
132
|
+
const policyConfigs = new Set([
|
|
133
|
+
"web/tsconfig.app.json",
|
|
134
|
+
"web/tsconfig.node.json",
|
|
135
|
+
"db/tsconfig.json",
|
|
136
|
+
"db-migrations/tsconfig.json",
|
|
137
|
+
]);
|
|
138
|
+
return sourceFiles.map((from) => {
|
|
139
|
+
const to = `${packagePath}/${from.replace(/^(?:web|db|db-migrations)\//, "")}`;
|
|
140
|
+
return policyConfigs.has(from)
|
|
141
|
+
? typescriptConfigSourceOperation({
|
|
142
|
+
context,
|
|
143
|
+
source: templateSources.vikeApp,
|
|
144
|
+
from,
|
|
145
|
+
to,
|
|
146
|
+
})
|
|
147
|
+
: {
|
|
148
|
+
kind: "copyFile",
|
|
149
|
+
source: templateSources.vikeApp,
|
|
150
|
+
from,
|
|
151
|
+
to,
|
|
152
|
+
};
|
|
153
|
+
});
|
|
91
154
|
}
|
|
92
155
|
function webContribution(context) {
|
|
93
156
|
const { web, db } = definitions(context);
|
|
@@ -125,7 +188,7 @@ function webContribution(context) {
|
|
|
125
188
|
value: {},
|
|
126
189
|
multilineArrays: ["files"],
|
|
127
190
|
},
|
|
128
|
-
...copyOperations(web.path, sourceFiles),
|
|
191
|
+
...copyOperations(context, web.path, sourceFiles),
|
|
129
192
|
{
|
|
130
193
|
kind: "writeTextTemplate",
|
|
131
194
|
source: templateSources.vikeApp,
|
|
@@ -252,8 +315,16 @@ function webContribution(context) {
|
|
|
252
315
|
playwrightBrowserAssetsEnvironmentNeed({ browser: "chromium", owner }),
|
|
253
316
|
shellCheckEnvironmentNeed(owner),
|
|
254
317
|
],
|
|
318
|
+
ciDiagnosticArtifacts: [{ kind: "playwright", owner }],
|
|
255
319
|
deploymentEnvironmentNeeds: [dockerEngineEnvironmentNeed()],
|
|
256
|
-
foundation:
|
|
320
|
+
foundation: {
|
|
321
|
+
...foundation(),
|
|
322
|
+
developmentContainerToolLayers: [
|
|
323
|
+
browserTestDevelopmentContainerToolLayer(),
|
|
324
|
+
shellCheckDevelopmentContainerToolLayer(),
|
|
325
|
+
dockerClientDevelopmentContainerToolLayer(),
|
|
326
|
+
],
|
|
327
|
+
},
|
|
257
328
|
};
|
|
258
329
|
}
|
|
259
330
|
function databaseContribution(context) {
|
|
@@ -311,7 +382,7 @@ function databaseContribution(context) {
|
|
|
311
382
|
},
|
|
312
383
|
operations: [
|
|
313
384
|
{ kind: "writeJson", to: `${db.path}/package.json`, value: {} },
|
|
314
|
-
...copyOperations(db.path, sourceFiles),
|
|
385
|
+
...copyOperations(context, db.path, sourceFiles),
|
|
315
386
|
],
|
|
316
387
|
environmentNeeds: [],
|
|
317
388
|
foundation: foundation(),
|
|
@@ -355,7 +426,7 @@ function migrationsContribution(context) {
|
|
|
355
426
|
value: {},
|
|
356
427
|
multilineArrays: ["files"],
|
|
357
428
|
},
|
|
358
|
-
...copyOperations(migrations.path, sourceFiles),
|
|
429
|
+
...copyOperations(context, migrations.path, sourceFiles),
|
|
359
430
|
],
|
|
360
431
|
environmentNeeds: [],
|
|
361
432
|
foundation: foundation(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sharedVueSourceOperations, vueApplicationEnvironmentNeeds, vueApplicationExposure, vueApplicationManifest, vueApplicationScripts, } from "../shared/vue.js";
|
|
1
|
+
import { sharedVueSourceOperations, vueApplicationDevelopmentContainerToolLayers, vueApplicationEnvironmentNeeds, vueApplicationExposure, vueApplicationManifest, vueApplicationScripts, } from "../shared/vue.js";
|
|
2
2
|
import { templateSources } from "../template-sources.js";
|
|
3
3
|
function packageScripts() {
|
|
4
4
|
return {
|
|
@@ -32,7 +32,7 @@ function appContribution(options) {
|
|
|
32
32
|
from,
|
|
33
33
|
to: `${definition.path}/${from.replace("typescript/", "scripts/")}`,
|
|
34
34
|
})),
|
|
35
|
-
...sharedVueSourceOperations(definition.path),
|
|
35
|
+
...sharedVueSourceOperations(options.context, definition.path),
|
|
36
36
|
];
|
|
37
37
|
return {
|
|
38
38
|
definition,
|
|
@@ -44,6 +44,12 @@ function appContribution(options) {
|
|
|
44
44
|
}),
|
|
45
45
|
operations,
|
|
46
46
|
environmentNeeds: vueApplicationEnvironmentNeeds(definition.path),
|
|
47
|
+
ciDiagnosticArtifacts: [
|
|
48
|
+
{
|
|
49
|
+
kind: "playwright",
|
|
50
|
+
owner: { kind: "package-boundary", path: definition.path },
|
|
51
|
+
},
|
|
52
|
+
],
|
|
47
53
|
foundation: {
|
|
48
54
|
toolchains: {},
|
|
49
55
|
editorCapabilities: ["oxc-format-lint", "vue", "tailwind", "vitest"],
|
|
@@ -52,6 +58,7 @@ function appContribution(options) {
|
|
|
52
58
|
interval: "weekly",
|
|
53
59
|
},
|
|
54
60
|
workspacePackageGlobs: [`${options.packagePath.split("/")[0]}/*`],
|
|
61
|
+
developmentContainerToolLayers: vueApplicationDevelopmentContainerToolLayers(),
|
|
55
62
|
},
|
|
56
63
|
};
|
|
57
64
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
2
|
+
import { sharedVueSourceOperations, vueApplicationDevelopmentContainerToolLayers, vueApplicationEnvironmentNeeds, vueApplicationExposure, vueApplicationManifest, vueApplicationScripts, } from "../shared/vue.js";
|
|
2
3
|
import { templateSources } from "../template-sources.js";
|
|
3
4
|
function apiScripts() {
|
|
4
5
|
return {
|
|
@@ -16,7 +17,7 @@ function apiScripts() {
|
|
|
16
17
|
function webScripts() {
|
|
17
18
|
return {
|
|
18
19
|
...vueApplicationScripts(),
|
|
19
|
-
typecheck: "node --conditions=source scripts/run-vue-tsc.ts --build --pretty false",
|
|
20
|
+
typecheck: "node --conditions=source scripts/run-vue-tsc.ts --build --noEmit --pretty false",
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
function packageFoundation() {
|
|
@@ -60,12 +61,19 @@ function apiContribution(context) {
|
|
|
60
61
|
];
|
|
61
62
|
const operations = [
|
|
62
63
|
{ kind: "writeJson", to: `${definition.path}/package.json`, value: {} },
|
|
63
|
-
...sourceFiles.map((from) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
...sourceFiles.map((from) => from === "tsconfig.json"
|
|
65
|
+
? typescriptConfigSourceOperation({
|
|
66
|
+
context,
|
|
67
|
+
source: templateSources.vueHonoApp,
|
|
68
|
+
from: `api/${from}`,
|
|
69
|
+
to: `${definition.path}/${from}`,
|
|
70
|
+
})
|
|
71
|
+
: {
|
|
72
|
+
kind: "copyFile",
|
|
73
|
+
source: templateSources.vueHonoApp,
|
|
74
|
+
from: `api/${from}`,
|
|
75
|
+
to: `${definition.path}/${from}`,
|
|
76
|
+
}),
|
|
69
77
|
];
|
|
70
78
|
return {
|
|
71
79
|
definition,
|
|
@@ -120,7 +128,7 @@ function webContribution(context) {
|
|
|
120
128
|
from: `web/${from}`,
|
|
121
129
|
to: `${definition.path}/${from}`,
|
|
122
130
|
})),
|
|
123
|
-
...sharedVueSourceOperations(definition.path),
|
|
131
|
+
...sharedVueSourceOperations(context, definition.path),
|
|
124
132
|
];
|
|
125
133
|
return {
|
|
126
134
|
definition,
|
|
@@ -132,7 +140,16 @@ function webContribution(context) {
|
|
|
132
140
|
}),
|
|
133
141
|
operations,
|
|
134
142
|
environmentNeeds: vueApplicationEnvironmentNeeds(definition.path),
|
|
135
|
-
|
|
143
|
+
ciDiagnosticArtifacts: [
|
|
144
|
+
{
|
|
145
|
+
kind: "playwright",
|
|
146
|
+
owner: { kind: "package-boundary", path: definition.path },
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
foundation: {
|
|
150
|
+
...packageFoundation(),
|
|
151
|
+
developmentContainerToolLayers: vueApplicationDevelopmentContainerToolLayers(),
|
|
152
|
+
},
|
|
136
153
|
};
|
|
137
154
|
}
|
|
138
155
|
export const vueHonoAppDefinition = {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
34
34
|
"lint": "oxlint --quiet --format=unix --config ../../oxlint.config.ts --ignore-pattern dist --ignore-pattern templates .",
|
|
35
35
|
"lint:fix": "oxlint --format=unix --config ../../oxlint.config.ts --ignore-pattern dist --ignore-pattern templates . --fix",
|
|
36
|
-
"test": "vitest run --config vitest.config.ts --reporter=agent --silent=passed-only",
|
|
36
|
+
"test": "vitest run --config vitest.config.ts --reporter=agent --silent=passed-only --maxWorkers=1",
|
|
37
37
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|