@ykdz/template 0.0.35 → 0.0.36
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/application.d.ts +2 -1
- package/dist/application.js +64 -75
- package/dist/main.js +6 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +50 -36
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +968 -364
- package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.d.ts +24 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.js +154 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/index.d.ts +2 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/index.js +1 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.d.ts +31 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +29 -33
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.d.ts +4 -3
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.js +9 -5
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +1 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +0 -1
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.d.ts +31 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.js +79 -58
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.d.ts +31 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +31 -23
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.d.ts +22 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +53 -25
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.d.ts +26 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +19 -7
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.d.ts +22 -2
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +31 -20
- package/node_modules/@ykdz/template-builtin-presets/package.json +12 -11
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment-diagnostics.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.pnpmfile.mjs +19 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.packing-hook.json +8 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/CHANGELOG.md.template +17 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/RELEASING.md +17 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/artifact.ts +1271 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/changelog.ts +283 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-artifact.ts +99 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-readiness.ts +66 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/cli-command-identity.ts +4 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/handoff.ts +450 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/publish.ts +483 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/readiness.ts +1125 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.ts +819 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.yml +119 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/root-tsconfig.json +13 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/tsconfig.json +4 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/turbo.json +6 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/README.md +48 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/CHANGELOG.md.template +17 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/LICENSE-APACHE-2.0.txt +202 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/LICENSE-MIT.txt +21 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/README.md.template +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/bridge.ts +3336 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/setup.sh +221 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli-command-identity.ts +133 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli.ts +4 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/main.ts +5 -4
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/integration/command.test.ts +14 -13
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/unit/cli-command-identity.test.ts +76 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.build.json +2 -0
- package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +15 -53
- package/node_modules/@ykdz/template-core/dist/module-graph.js +134 -101
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +13 -1
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +92 -0
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +14 -10
- package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +71 -13
- package/node_modules/@ykdz/template-core/dist/preset-definition.js +16 -1
- package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +56 -0
- package/node_modules/@ykdz/template-core/dist/project-blueprint.js +271 -0
- package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +2 -2
- package/node_modules/@ykdz/template-core/dist/project-linking-v2.js +2 -2
- package/node_modules/@ykdz/template-core/dist/project-projection.d.ts +2 -1
- package/node_modules/@ykdz/template-core/dist/project-projection.js +107 -20
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +0 -2
- package/node_modules/@ykdz/template-core/dist/renderer.js +17 -38
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +2 -2
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +6 -0
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.d.ts +2 -0
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +9 -3
- package/package.json +5 -5
- package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.d.ts +0 -33
- package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.js +0 -182
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const tsLibDefinition:
|
|
1
|
+
import { type GenerationContext } from "#template-core/preset-definition";
|
|
2
|
+
export declare const tsLibDefinition: {
|
|
3
|
+
metadata: {
|
|
4
|
+
name: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
source: import("@ykdz/template-core/renderer").TemplateSourceHandle;
|
|
9
|
+
plannerSourceFile: string;
|
|
10
|
+
packageContributionReplayAdapters: import("@ykdz/template-core/preset-definition").PackageContributionReplayAdapter[];
|
|
11
|
+
initialPrimaryPackage: {
|
|
12
|
+
defaultLeafName: string;
|
|
13
|
+
role: "shared-library";
|
|
14
|
+
defaultPackagePath: ({ packageLeafName }: {
|
|
15
|
+
readonly packageLeafName: string;
|
|
16
|
+
}) => string;
|
|
17
|
+
planInitialContribution({ context, resolvedPackageIdentity }: {
|
|
18
|
+
readonly context: GenerationContext;
|
|
19
|
+
readonly resolvedPackageIdentity: import("@ykdz/template-core/preset-definition").ResolvedPrimaryPackageIdentity;
|
|
20
|
+
}): import("@ykdz/template-core/preset-definition").PlannedPackageContribution;
|
|
21
|
+
};
|
|
22
|
+
defaultPackagePath({ packageLeafName }: {
|
|
23
|
+
readonly context: GenerationContext;
|
|
24
|
+
readonly packageLeafName: string;
|
|
25
|
+
}): string;
|
|
26
|
+
planPackageAddition({ context, packageLeafName, packagePath }: {
|
|
27
|
+
readonly context: GenerationContext;
|
|
28
|
+
readonly packageLeafName: string;
|
|
29
|
+
readonly packagePath: string;
|
|
30
|
+
}): import("@ykdz/template-core/preset-definition").PlannedPackageContribution;
|
|
31
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { definePackageContributionReplayAdapter, } from "#template-core/preset-definition";
|
|
2
3
|
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
3
4
|
import { templateSources } from "../template-sources.js";
|
|
5
|
+
function packagePathForLeaf(packageLeafName) {
|
|
6
|
+
return `packages/${packageLeafName}`;
|
|
7
|
+
}
|
|
4
8
|
function packageScripts() {
|
|
5
9
|
return {
|
|
6
10
|
"format:check": "oxfmt --list-different --config ../../oxfmt.config.ts .",
|
|
@@ -12,8 +16,8 @@ function packageScripts() {
|
|
|
12
16
|
};
|
|
13
17
|
}
|
|
14
18
|
function libraryContribution(options) {
|
|
15
|
-
const definition = {
|
|
16
|
-
name: `@${options.context.
|
|
19
|
+
const definition = options.packageDefinition ?? {
|
|
20
|
+
name: `@${options.context.defaultPackageScope}/${options.packageLeafName}`,
|
|
17
21
|
path: options.packagePath,
|
|
18
22
|
role: "shared-library",
|
|
19
23
|
};
|
|
@@ -71,7 +75,6 @@ function libraryContribution(options) {
|
|
|
71
75
|
exposure,
|
|
72
76
|
manifest: {
|
|
73
77
|
name: definition.name,
|
|
74
|
-
version: "0.0.0",
|
|
75
78
|
private: true,
|
|
76
79
|
type: "module",
|
|
77
80
|
...exposure,
|
|
@@ -91,6 +94,7 @@ function libraryContribution(options) {
|
|
|
91
94
|
foundation: {
|
|
92
95
|
toolchains: {},
|
|
93
96
|
editorCapabilities: ["oxc-format-lint"],
|
|
97
|
+
typescriptConfigurationPackage: { dependency: "required" },
|
|
94
98
|
dependencyMaintenance: {
|
|
95
99
|
ecosystems: ["npm", "github-actions", "docker"],
|
|
96
100
|
interval: "weekly",
|
|
@@ -98,6 +102,15 @@ function libraryContribution(options) {
|
|
|
98
102
|
},
|
|
99
103
|
};
|
|
100
104
|
}
|
|
105
|
+
const libraryReplayAdapter = definePackageContributionReplayAdapter({
|
|
106
|
+
identity: "library",
|
|
107
|
+
replay: ({ context, packageDefinition, packageLeafName }) => libraryContribution({
|
|
108
|
+
context,
|
|
109
|
+
packageLeafName,
|
|
110
|
+
packagePath: packageDefinition.path,
|
|
111
|
+
packageDefinition,
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
101
114
|
export const tsLibDefinition = {
|
|
102
115
|
metadata: {
|
|
103
116
|
name: "ts-lib",
|
|
@@ -106,29 +119,24 @@ export const tsLibDefinition = {
|
|
|
106
119
|
},
|
|
107
120
|
source: templateSources.tsLib,
|
|
108
121
|
plannerSourceFile: fileURLToPath(import.meta.url),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return libraryContribution({
|
|
123
|
-
context,
|
|
124
|
-
packageLeafName: context.projectName,
|
|
125
|
-
packagePath: `packages/${context.projectName}`,
|
|
126
|
-
});
|
|
122
|
+
packageContributionReplayAdapters: [libraryReplayAdapter],
|
|
123
|
+
initialPrimaryPackage: {
|
|
124
|
+
defaultLeafName: "lib",
|
|
125
|
+
role: "shared-library",
|
|
126
|
+
defaultPackagePath: ({ packageLeafName }) => packagePathForLeaf(packageLeafName),
|
|
127
|
+
planInitialContribution({ context, resolvedPackageIdentity }) {
|
|
128
|
+
return libraryReplayAdapter.identify(libraryContribution({
|
|
129
|
+
context,
|
|
130
|
+
packageLeafName: resolvedPackageIdentity.leafName,
|
|
131
|
+
packagePath: resolvedPackageIdentity.definition.path,
|
|
132
|
+
packageDefinition: resolvedPackageIdentity.definition,
|
|
133
|
+
}));
|
|
134
|
+
},
|
|
127
135
|
},
|
|
128
136
|
defaultPackagePath({ packageLeafName }) {
|
|
129
|
-
return
|
|
137
|
+
return packagePathForLeaf(packageLeafName);
|
|
130
138
|
},
|
|
131
139
|
planPackageAddition({ context, packageLeafName, packagePath }) {
|
|
132
|
-
return libraryContribution({ context, packageLeafName, packagePath });
|
|
140
|
+
return libraryReplayAdapter.identify(libraryContribution({ context, packageLeafName, packagePath }));
|
|
133
141
|
},
|
|
134
142
|
};
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type GenerationContext } from "#template-core/preset-definition";
|
|
2
|
+
import type { PackageDefinition } from "#template-core/project-blueprint";
|
|
3
|
+
export declare const vikeAppDefinition: {
|
|
4
|
+
metadata: {
|
|
5
|
+
name: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
source: import("@ykdz/template-core/renderer").TemplateSourceHandle;
|
|
10
|
+
plannerSourceFile: string;
|
|
11
|
+
packageContributionReplayAdapters: import("@ykdz/template-core/preset-definition").PackageContributionReplayAdapter[];
|
|
12
|
+
blueprint(context: GenerationContext): {
|
|
13
|
+
schemaVersion: 3;
|
|
14
|
+
packages: PackageDefinition[];
|
|
15
|
+
packageLinkIntents: {
|
|
16
|
+
consumerPackagePath: string;
|
|
17
|
+
providerPackagePath: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
planInitialization(context: GenerationContext): import("@ykdz/template-core/preset-definition").PlannedPackageContribution;
|
|
21
|
+
planInitializationContributions(context: GenerationContext): import("@ykdz/template-core/preset-definition").PlannedPackageContribution[];
|
|
22
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { dockerEngineEnvironmentNeed, playwrightBrowserAssetsEnvironmentNeed, shellCheckEnvironmentNeed, } from "#template-core/module-graph";
|
|
3
|
+
import { definePackageContributionReplayAdapter, } from "#template-core/preset-definition";
|
|
3
4
|
import { browserTestDevelopmentContainerToolLayer } from "../shared/development-container.js";
|
|
4
5
|
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
5
6
|
import { vueTypecheckRunnerSourceOperation } from "../shared/vue.js";
|
|
@@ -7,33 +8,44 @@ import { templateSources } from "../template-sources.js";
|
|
|
7
8
|
function definitions(context) {
|
|
8
9
|
return {
|
|
9
10
|
web: {
|
|
10
|
-
name: `@${context.
|
|
11
|
+
name: `@${context.defaultPackageScope}/web`,
|
|
11
12
|
path: "apps/web",
|
|
12
13
|
role: "runtime-service",
|
|
13
14
|
},
|
|
14
15
|
db: {
|
|
15
|
-
name: `@${context.
|
|
16
|
+
name: `@${context.defaultPackageScope}/db`,
|
|
16
17
|
path: "packages/db",
|
|
17
18
|
role: "shared-library",
|
|
18
19
|
},
|
|
19
20
|
migrations: {
|
|
20
|
-
name: `@${context.
|
|
21
|
+
name: `@${context.defaultPackageScope}/db-migrations`,
|
|
21
22
|
path: "packages/db-migrations",
|
|
22
23
|
role: "shared-library",
|
|
23
24
|
},
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function replayDefinitions(initialPackages) {
|
|
28
|
+
return {
|
|
29
|
+
web: initialPackages.require("web"),
|
|
30
|
+
db: initialPackages.require("database"),
|
|
31
|
+
migrations: initialPackages.require("migrations"),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function foundation(packageDefinitions) {
|
|
35
|
+
const workspacePackageGlobs = [
|
|
36
|
+
...new Set(Object.values(packageDefinitions).map((definition) => `${definition.path.split("/")[0]}/*`)),
|
|
37
|
+
];
|
|
27
38
|
return {
|
|
28
39
|
toolchains: {},
|
|
29
40
|
editorCapabilities: ["oxc-format-lint", "vue", "tailwind", "vitest"],
|
|
41
|
+
typescriptConfigurationPackage: { dependency: "required" },
|
|
30
42
|
dependencyMaintenance: {
|
|
31
43
|
ecosystems: ["npm", "github-actions", "docker"],
|
|
32
44
|
directories: { npm: "/", docker: "/.devcontainer" },
|
|
33
|
-
extraDirectories: { docker: [
|
|
45
|
+
extraDirectories: { docker: [`/${packageDefinitions.web.path}`] },
|
|
34
46
|
interval: "weekly",
|
|
35
47
|
},
|
|
36
|
-
workspacePackageGlobs
|
|
48
|
+
workspacePackageGlobs,
|
|
37
49
|
};
|
|
38
50
|
}
|
|
39
51
|
function shellCheckDevelopmentContainerToolLayer() {
|
|
@@ -149,8 +161,8 @@ function copyOperations(context, packagePath, sourceFiles) {
|
|
|
149
161
|
};
|
|
150
162
|
});
|
|
151
163
|
}
|
|
152
|
-
function webContribution(context) {
|
|
153
|
-
const { web, db } =
|
|
164
|
+
function webContribution(context, packageDefinitions = definitions(context)) {
|
|
165
|
+
const { web, db, migrations } = packageDefinitions;
|
|
154
166
|
const sourceFiles = [
|
|
155
167
|
"web/+server.ts",
|
|
156
168
|
"web/.env.example",
|
|
@@ -194,8 +206,8 @@ function webContribution(context) {
|
|
|
194
206
|
replacements: {
|
|
195
207
|
NODE_VERSION: context.toolchain.nodeLtsMajor,
|
|
196
208
|
PACKAGE_MANAGER_PIN: context.toolchain.packageManagerPin,
|
|
197
|
-
DB_PACKAGE_NAME:
|
|
198
|
-
DB_MIGRATIONS_PACKAGE_NAME:
|
|
209
|
+
DB_PACKAGE_NAME: db.name,
|
|
210
|
+
DB_MIGRATIONS_PACKAGE_NAME: migrations.name,
|
|
199
211
|
WEB_PACKAGE_NAME: web.name,
|
|
200
212
|
},
|
|
201
213
|
},
|
|
@@ -265,7 +277,6 @@ function webContribution(context) {
|
|
|
265
277
|
},
|
|
266
278
|
manifest: {
|
|
267
279
|
name: web.name,
|
|
268
|
-
version: "0.0.0",
|
|
269
280
|
private: true,
|
|
270
281
|
type: "module",
|
|
271
282
|
files: ["dist"],
|
|
@@ -315,7 +326,7 @@ function webContribution(context) {
|
|
|
315
326
|
ciDiagnosticArtifacts: [{ kind: "playwright", owner }],
|
|
316
327
|
deploymentEnvironmentNeeds: [dockerEngineEnvironmentNeed()],
|
|
317
328
|
foundation: {
|
|
318
|
-
...foundation(),
|
|
329
|
+
...foundation(packageDefinitions),
|
|
319
330
|
developmentContainerToolLayers: [
|
|
320
331
|
browserTestDevelopmentContainerToolLayer(),
|
|
321
332
|
shellCheckDevelopmentContainerToolLayer(),
|
|
@@ -324,8 +335,8 @@ function webContribution(context) {
|
|
|
324
335
|
},
|
|
325
336
|
};
|
|
326
337
|
}
|
|
327
|
-
function databaseContribution(context) {
|
|
328
|
-
const { db } =
|
|
338
|
+
function databaseContribution(context, packageDefinitions = definitions(context)) {
|
|
339
|
+
const { db } = packageDefinitions;
|
|
329
340
|
const sourceFiles = [
|
|
330
341
|
"db/turbo.json",
|
|
331
342
|
"db/tsconfig.json",
|
|
@@ -363,7 +374,6 @@ function databaseContribution(context) {
|
|
|
363
374
|
exposure,
|
|
364
375
|
manifest: {
|
|
365
376
|
name: db.name,
|
|
366
|
-
version: "0.0.0",
|
|
367
377
|
private: true,
|
|
368
378
|
type: "module",
|
|
369
379
|
...exposure,
|
|
@@ -384,11 +394,11 @@ function databaseContribution(context) {
|
|
|
384
394
|
...copyOperations(context, db.path, sourceFiles),
|
|
385
395
|
],
|
|
386
396
|
environmentNeeds: [],
|
|
387
|
-
foundation: foundation(),
|
|
397
|
+
foundation: foundation(packageDefinitions),
|
|
388
398
|
};
|
|
389
399
|
}
|
|
390
|
-
function migrationsContribution(context) {
|
|
391
|
-
const { db, migrations } =
|
|
400
|
+
function migrationsContribution(context, packageDefinitions = definitions(context)) {
|
|
401
|
+
const { db, migrations } = packageDefinitions;
|
|
392
402
|
const sourceFiles = [
|
|
393
403
|
"db-migrations/drizzle.config.ts",
|
|
394
404
|
"db-migrations/tsconfig.json",
|
|
@@ -402,7 +412,6 @@ function migrationsContribution(context) {
|
|
|
402
412
|
exposure: { exports: {}, imports: {} },
|
|
403
413
|
manifest: {
|
|
404
414
|
name: migrations.name,
|
|
405
|
-
version: "0.0.0",
|
|
406
415
|
private: true,
|
|
407
416
|
type: "module",
|
|
408
417
|
files: ["drizzle.config.ts", "drizzle/migrations"],
|
|
@@ -427,9 +436,21 @@ function migrationsContribution(context) {
|
|
|
427
436
|
...copyOperations(context, migrations.path, sourceFiles),
|
|
428
437
|
],
|
|
429
438
|
environmentNeeds: [],
|
|
430
|
-
foundation: foundation(),
|
|
439
|
+
foundation: foundation(packageDefinitions),
|
|
431
440
|
};
|
|
432
441
|
}
|
|
442
|
+
const webReplayAdapter = definePackageContributionReplayAdapter({
|
|
443
|
+
identity: "web",
|
|
444
|
+
replay: ({ context, initialPackages }) => webContribution(context, replayDefinitions(initialPackages)),
|
|
445
|
+
});
|
|
446
|
+
const databaseReplayAdapter = definePackageContributionReplayAdapter({
|
|
447
|
+
identity: "database",
|
|
448
|
+
replay: ({ context, initialPackages }) => databaseContribution(context, replayDefinitions(initialPackages)),
|
|
449
|
+
});
|
|
450
|
+
const migrationsReplayAdapter = definePackageContributionReplayAdapter({
|
|
451
|
+
identity: "migrations",
|
|
452
|
+
replay: ({ context, initialPackages }) => migrationsContribution(context, replayDefinitions(initialPackages)),
|
|
453
|
+
});
|
|
433
454
|
export const vikeAppDefinition = {
|
|
434
455
|
metadata: {
|
|
435
456
|
name: "vike-app",
|
|
@@ -438,10 +459,15 @@ export const vikeAppDefinition = {
|
|
|
438
459
|
},
|
|
439
460
|
source: templateSources.vikeApp,
|
|
440
461
|
plannerSourceFile: fileURLToPath(import.meta.url),
|
|
462
|
+
packageContributionReplayAdapters: [
|
|
463
|
+
webReplayAdapter,
|
|
464
|
+
databaseReplayAdapter,
|
|
465
|
+
migrationsReplayAdapter,
|
|
466
|
+
],
|
|
441
467
|
blueprint(context) {
|
|
442
468
|
const { web, db, migrations } = definitions(context);
|
|
443
469
|
return {
|
|
444
|
-
schemaVersion:
|
|
470
|
+
schemaVersion: 3,
|
|
445
471
|
packages: [web, db, migrations],
|
|
446
472
|
packageLinkIntents: [
|
|
447
473
|
{ consumerPackagePath: web.path, providerPackagePath: db.path },
|
|
@@ -452,12 +478,14 @@ export const vikeAppDefinition = {
|
|
|
452
478
|
],
|
|
453
479
|
};
|
|
454
480
|
},
|
|
455
|
-
planInitialization
|
|
481
|
+
planInitialization(context) {
|
|
482
|
+
return webReplayAdapter.identify(webContribution(context));
|
|
483
|
+
},
|
|
456
484
|
planInitializationContributions(context) {
|
|
457
485
|
return [
|
|
458
|
-
webContribution(context),
|
|
459
|
-
databaseContribution(context),
|
|
460
|
-
migrationsContribution(context),
|
|
486
|
+
webReplayAdapter.identify(webContribution(context)),
|
|
487
|
+
databaseReplayAdapter.identify(databaseContribution(context)),
|
|
488
|
+
migrationsReplayAdapter.identify(migrationsContribution(context)),
|
|
461
489
|
];
|
|
462
490
|
},
|
|
463
491
|
};
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type GenerationContext } from "#template-core/preset-definition";
|
|
2
|
+
import type { PackageDefinition } from "#template-core/project-blueprint";
|
|
3
|
+
export declare const vueAppDefinition: {
|
|
4
|
+
metadata: {
|
|
5
|
+
name: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
source: import("@ykdz/template-core/renderer").TemplateSourceHandle;
|
|
10
|
+
plannerSourceFile: string;
|
|
11
|
+
packageContributionReplayAdapters: import("@ykdz/template-core/preset-definition").PackageContributionReplayAdapter[];
|
|
12
|
+
blueprint(context: GenerationContext): {
|
|
13
|
+
schemaVersion: 3;
|
|
14
|
+
packages: PackageDefinition[];
|
|
15
|
+
};
|
|
16
|
+
planInitialization(context: GenerationContext): import("@ykdz/template-core/preset-definition").PlannedPackageContribution;
|
|
17
|
+
defaultPackagePath({ packageLeafName }: {
|
|
18
|
+
readonly context: GenerationContext;
|
|
19
|
+
readonly packageLeafName: string;
|
|
20
|
+
}): string;
|
|
21
|
+
planPackageAddition({ context, packageLeafName, packagePath }: {
|
|
22
|
+
readonly context: GenerationContext;
|
|
23
|
+
readonly packageLeafName: string;
|
|
24
|
+
readonly packagePath: string;
|
|
25
|
+
}): import("@ykdz/template-core/preset-definition").PlannedPackageContribution;
|
|
26
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { definePackageContributionReplayAdapter, } from "#template-core/preset-definition";
|
|
1
2
|
import { sharedVueSourceOperations, vueApplicationDevelopmentContainerToolLayers, vueApplicationEnvironmentNeeds, vueApplicationExposure, vueApplicationManifest, vueApplicationScripts, } from "../shared/vue.js";
|
|
2
3
|
import { templateSources } from "../template-sources.js";
|
|
3
4
|
function packageScripts() {
|
|
@@ -7,8 +8,8 @@ function packageScripts() {
|
|
|
7
8
|
};
|
|
8
9
|
}
|
|
9
10
|
function appContribution(options) {
|
|
10
|
-
const definition = {
|
|
11
|
-
name: `@${options.context.
|
|
11
|
+
const definition = options.packageDefinition ?? {
|
|
12
|
+
name: `@${options.context.defaultPackageScope}/${options.packageLeafName}`,
|
|
12
13
|
path: options.packagePath,
|
|
13
14
|
role: "runtime-service",
|
|
14
15
|
};
|
|
@@ -52,15 +53,25 @@ function appContribution(options) {
|
|
|
52
53
|
foundation: {
|
|
53
54
|
toolchains: {},
|
|
54
55
|
editorCapabilities: ["oxc-format-lint", "vue", "tailwind", "vitest"],
|
|
56
|
+
typescriptConfigurationPackage: { dependency: "required" },
|
|
55
57
|
dependencyMaintenance: {
|
|
56
58
|
ecosystems: ["npm", "github-actions", "docker"],
|
|
57
59
|
interval: "weekly",
|
|
58
60
|
},
|
|
59
|
-
workspacePackageGlobs: [`${
|
|
61
|
+
workspacePackageGlobs: [`${definition.path.split("/")[0]}/*`],
|
|
60
62
|
developmentContainerToolLayers: vueApplicationDevelopmentContainerToolLayers(),
|
|
61
63
|
},
|
|
62
64
|
};
|
|
63
65
|
}
|
|
66
|
+
const appReplayAdapter = definePackageContributionReplayAdapter({
|
|
67
|
+
identity: "app",
|
|
68
|
+
replay: ({ context, packageDefinition, packageLeafName }) => appContribution({
|
|
69
|
+
context,
|
|
70
|
+
packageLeafName,
|
|
71
|
+
packagePath: packageDefinition.path,
|
|
72
|
+
packageDefinition,
|
|
73
|
+
}),
|
|
74
|
+
});
|
|
64
75
|
export const vueAppDefinition = {
|
|
65
76
|
metadata: {
|
|
66
77
|
name: "vue-app",
|
|
@@ -69,9 +80,10 @@ export const vueAppDefinition = {
|
|
|
69
80
|
},
|
|
70
81
|
source: templateSources.vueApp,
|
|
71
82
|
plannerSourceFile: fileURLToPath(import.meta.url),
|
|
83
|
+
packageContributionReplayAdapters: [appReplayAdapter],
|
|
72
84
|
blueprint(context) {
|
|
73
85
|
return {
|
|
74
|
-
schemaVersion:
|
|
86
|
+
schemaVersion: 3,
|
|
75
87
|
packages: [
|
|
76
88
|
appContribution({
|
|
77
89
|
context,
|
|
@@ -82,17 +94,17 @@ export const vueAppDefinition = {
|
|
|
82
94
|
};
|
|
83
95
|
},
|
|
84
96
|
planInitialization(context) {
|
|
85
|
-
return appContribution({
|
|
97
|
+
return appReplayAdapter.identify(appContribution({
|
|
86
98
|
context,
|
|
87
99
|
packageLeafName: "web",
|
|
88
100
|
packagePath: "apps/web",
|
|
89
|
-
});
|
|
101
|
+
}));
|
|
90
102
|
},
|
|
91
103
|
defaultPackagePath({ packageLeafName }) {
|
|
92
104
|
return `apps/${packageLeafName}`;
|
|
93
105
|
},
|
|
94
106
|
planPackageAddition({ context, packageLeafName, packagePath }) {
|
|
95
|
-
return appContribution({ context, packageLeafName, packagePath });
|
|
107
|
+
return appReplayAdapter.identify(appContribution({ context, packageLeafName, packagePath }));
|
|
96
108
|
},
|
|
97
109
|
};
|
|
98
110
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type GenerationContext } from "#template-core/preset-definition";
|
|
2
|
+
import type { PackageDefinition } from "#template-core/project-blueprint";
|
|
3
|
+
export declare const vueHonoAppDefinition: {
|
|
4
|
+
metadata: {
|
|
5
|
+
name: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
source: import("@ykdz/template-core/renderer").TemplateSourceHandle;
|
|
10
|
+
plannerSourceFile: string;
|
|
11
|
+
packageContributionReplayAdapters: import("@ykdz/template-core/preset-definition").PackageContributionReplayAdapter[];
|
|
12
|
+
blueprint(context: GenerationContext): {
|
|
13
|
+
schemaVersion: 3;
|
|
14
|
+
packages: PackageDefinition[];
|
|
15
|
+
packageLinkIntents: {
|
|
16
|
+
consumerPackagePath: string;
|
|
17
|
+
providerPackagePath: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
planInitialization(context: GenerationContext): import("@ykdz/template-core/preset-definition").PlannedPackageContribution;
|
|
21
|
+
planInitializationContributions(context: GenerationContext): import("@ykdz/template-core/preset-definition").PlannedPackageContribution[];
|
|
22
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { definePackageContributionReplayAdapter, } from "#template-core/preset-definition";
|
|
1
2
|
import { typescriptConfigSourceOperation } from "../shared/typescript.js";
|
|
2
3
|
import { sharedVueSourceOperations, vueApplicationDevelopmentContainerToolLayers, vueApplicationEnvironmentNeeds, vueApplicationExposure, vueApplicationManifest, vueApplicationScripts, } from "../shared/vue.js";
|
|
3
4
|
import { templateSources } from "../template-sources.js";
|
|
@@ -20,23 +21,23 @@ function webScripts() {
|
|
|
20
21
|
typecheck: "node --conditions=source scripts/run-vue-tsc.ts --build --noEmit --pretty false",
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
function packageFoundation() {
|
|
24
|
+
function packageFoundation(packagePath) {
|
|
24
25
|
return {
|
|
25
26
|
toolchains: {},
|
|
26
27
|
editorCapabilities: ["oxc-format-lint", "vue", "tailwind", "vitest"],
|
|
28
|
+
typescriptConfigurationPackage: { dependency: "required" },
|
|
27
29
|
dependencyMaintenance: {
|
|
28
30
|
ecosystems: ["npm", "github-actions", "docker"],
|
|
29
31
|
interval: "weekly",
|
|
30
32
|
},
|
|
31
|
-
workspacePackageGlobs: ["
|
|
33
|
+
workspacePackageGlobs: [`${packagePath.split("/")[0]}/*`],
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
|
-
function apiContribution(context
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
36
|
+
function apiContribution(context, definition = {
|
|
37
|
+
name: `@${context.defaultPackageScope}/api`,
|
|
38
|
+
path: "apps/api",
|
|
39
|
+
role: "runtime-service",
|
|
40
|
+
}) {
|
|
40
41
|
const exposure = {
|
|
41
42
|
exports: {
|
|
42
43
|
".": { default: "./dist/index.js", types: "./dist/index.d.ts" },
|
|
@@ -80,7 +81,6 @@ function apiContribution(context) {
|
|
|
80
81
|
exposure,
|
|
81
82
|
manifest: {
|
|
82
83
|
name: definition.name,
|
|
83
|
-
version: "0.0.0",
|
|
84
84
|
private: true,
|
|
85
85
|
type: "module",
|
|
86
86
|
...exposure,
|
|
@@ -98,15 +98,14 @@ function apiContribution(context) {
|
|
|
98
98
|
},
|
|
99
99
|
operations,
|
|
100
100
|
environmentNeeds: [],
|
|
101
|
-
foundation: packageFoundation(),
|
|
101
|
+
foundation: packageFoundation(definition.path),
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
function webContribution(context
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
104
|
+
function webContribution(context, definition = {
|
|
105
|
+
name: `@${context.defaultPackageScope}/web`,
|
|
106
|
+
path: "apps/web",
|
|
107
|
+
role: "runtime-service",
|
|
108
|
+
}) {
|
|
110
109
|
const exposure = vueApplicationExposure;
|
|
111
110
|
const localSourceFiles = [
|
|
112
111
|
"env.d.ts",
|
|
@@ -146,11 +145,19 @@ function webContribution(context) {
|
|
|
146
145
|
},
|
|
147
146
|
],
|
|
148
147
|
foundation: {
|
|
149
|
-
...packageFoundation(),
|
|
148
|
+
...packageFoundation(definition.path),
|
|
150
149
|
developmentContainerToolLayers: vueApplicationDevelopmentContainerToolLayers(),
|
|
151
150
|
},
|
|
152
151
|
};
|
|
153
152
|
}
|
|
153
|
+
const apiReplayAdapter = definePackageContributionReplayAdapter({
|
|
154
|
+
identity: "api",
|
|
155
|
+
replay: ({ context, packageDefinition }) => apiContribution(context, packageDefinition),
|
|
156
|
+
});
|
|
157
|
+
const webReplayAdapter = definePackageContributionReplayAdapter({
|
|
158
|
+
identity: "web",
|
|
159
|
+
replay: ({ context, packageDefinition }) => webContribution(context, packageDefinition),
|
|
160
|
+
});
|
|
154
161
|
export const vueHonoAppDefinition = {
|
|
155
162
|
metadata: {
|
|
156
163
|
name: "vue-hono-app",
|
|
@@ -159,11 +166,12 @@ export const vueHonoAppDefinition = {
|
|
|
159
166
|
},
|
|
160
167
|
source: templateSources.vueHonoApp,
|
|
161
168
|
plannerSourceFile: fileURLToPath(import.meta.url),
|
|
169
|
+
packageContributionReplayAdapters: [apiReplayAdapter, webReplayAdapter],
|
|
162
170
|
blueprint(context) {
|
|
163
171
|
const api = apiContribution(context);
|
|
164
172
|
const web = webContribution(context);
|
|
165
173
|
return {
|
|
166
|
-
schemaVersion:
|
|
174
|
+
schemaVersion: 3,
|
|
167
175
|
packages: [api.definition, web.definition],
|
|
168
176
|
packageLinkIntents: [
|
|
169
177
|
{
|
|
@@ -174,10 +182,13 @@ export const vueHonoAppDefinition = {
|
|
|
174
182
|
};
|
|
175
183
|
},
|
|
176
184
|
planInitialization(context) {
|
|
177
|
-
return apiContribution(context);
|
|
185
|
+
return apiReplayAdapter.identify(apiContribution(context));
|
|
178
186
|
},
|
|
179
187
|
planInitializationContributions(context) {
|
|
180
|
-
return [
|
|
188
|
+
return [
|
|
189
|
+
apiReplayAdapter.identify(apiContribution(context)),
|
|
190
|
+
webReplayAdapter.identify(webContribution(context)),
|
|
191
|
+
];
|
|
181
192
|
},
|
|
182
193
|
};
|
|
183
194
|
import { fileURLToPath } from "node:url";
|
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
-
"templates"
|
|
8
|
-
"!dist/src/check-*.js",
|
|
9
|
-
"!dist/src/check-*.d.ts",
|
|
10
|
-
"!dist/src/registry-checks.js",
|
|
11
|
-
"!dist/src/registry-checks.d.ts"
|
|
7
|
+
"templates"
|
|
12
8
|
],
|
|
13
9
|
"type": "module",
|
|
14
10
|
"imports": {
|
|
@@ -16,7 +12,8 @@
|
|
|
16
12
|
"source": "@ykdz/template-core-source/*",
|
|
17
13
|
"types": "@ykdz/template-core/*",
|
|
18
14
|
"default": "@ykdz/template-core/*"
|
|
19
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"#npm-publication/*": "./templates/ts-cli/publication/*.ts"
|
|
20
17
|
},
|
|
21
18
|
"exports": {
|
|
22
19
|
".": {
|
|
@@ -27,12 +24,10 @@
|
|
|
27
24
|
},
|
|
28
25
|
"scripts": {
|
|
29
26
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
30
|
-
"check:templates": "node --conditions=source src/check-template-source.ts && node --conditions=source src/check-registry-contract.ts && node --conditions=source src/check-publication-source.ts",
|
|
31
|
-
"check:templates:boundary": "node --conditions=source src/check-template-boundary.ts",
|
|
32
27
|
"format:check": "oxfmt --list-different --config ../../oxfmt.config.ts .",
|
|
33
28
|
"format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
|
|
34
|
-
"lint": "oxlint --quiet --format=unix --config ../../oxlint.config.ts --ignore-pattern dist --ignore-pattern templates .",
|
|
35
|
-
"lint:fix": "oxlint --format=unix --config ../../oxlint.config.ts --ignore-pattern dist --ignore-pattern templates . --fix",
|
|
29
|
+
"lint": "oxlint --quiet --format=unix --config ../../oxlint.config.ts --ignore-pattern dist --ignore-pattern templates . && oxlint --quiet --format=unix --config ../../oxlint.config.ts templates/ts-cli/publication-setup/bridge.ts",
|
|
30
|
+
"lint:fix": "oxlint --format=unix --config ../../oxlint.config.ts --ignore-pattern dist --ignore-pattern templates . --fix && oxlint --format=unix --config ../../oxlint.config.ts templates/ts-cli/publication-setup/bridge.ts --fix",
|
|
36
31
|
"test": "vitest run --config vitest.config.ts --reporter=agent --silent=passed-only --maxWorkers=1",
|
|
37
32
|
"typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
|
|
38
33
|
},
|
|
@@ -45,6 +40,8 @@
|
|
|
45
40
|
"@playwright/test": "catalog:",
|
|
46
41
|
"@tailwindcss/vite": "catalog:",
|
|
47
42
|
"@types/node": "catalog:",
|
|
43
|
+
"@types/semver": "catalog:",
|
|
44
|
+
"@types/spdx-expression-parse": "catalog:",
|
|
48
45
|
"@types/web-bluetooth": "catalog:",
|
|
49
46
|
"@vikejs/hono": "catalog:",
|
|
50
47
|
"@vitejs/plugin-vue": "catalog:",
|
|
@@ -60,7 +57,10 @@
|
|
|
60
57
|
"oxlint": "catalog:",
|
|
61
58
|
"oxlint-tsgolint": "catalog:",
|
|
62
59
|
"pinia": "catalog:",
|
|
60
|
+
"semver": "catalog:",
|
|
61
|
+
"spdx-expression-parse": "catalog:",
|
|
63
62
|
"tailwindcss": "catalog:",
|
|
63
|
+
"tar": "catalog:",
|
|
64
64
|
"telefunc": "catalog:",
|
|
65
65
|
"typescript": "catalog:",
|
|
66
66
|
"typescript-7": "catalog:",
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
"vite": "catalog:",
|
|
70
70
|
"vitest": "catalog:",
|
|
71
71
|
"vue": "catalog:",
|
|
72
|
-
"vue-tsc": "catalog:"
|
|
72
|
+
"vue-tsc": "catalog:",
|
|
73
|
+
"yaml": "catalog:"
|
|
73
74
|
},
|
|
74
75
|
"turbo": {
|
|
75
76
|
"tags": [
|