@ykdz/template 0.0.12 → 0.0.14
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-source/dist/templates/hono-api/projection.js +7 -34
- package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +2 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +5 -3
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +5 -32
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.d.ts +5 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.js +57 -0
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +8 -36
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +27 -74
- package/node_modules/@ykdz/template-builtin-source/templates/hono-api/turbo.json +8 -0
- package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +192 -4
- package/node_modules/@ykdz/template-builtin-source/templates/rust-bin/turbo.json +3 -0
- package/node_modules/@ykdz/template-builtin-source/templates/ts-lib/turbo.json +3 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/+server.ts +12 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.env.example +1 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/dependabot.yml +23 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/workflows/check.yml +20 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/assets/logo.svg +1 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/components/CounterButton.vue +21 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/components/PageShell.vue +17 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/database/db.ts +14 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/database/queries/todos.ts +32 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/database/schema.ts +14 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/drizzle.config.ts +10 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/env.d.ts +6 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/global.d.ts +9 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/+Head.vue +8 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/+Layout.vue +9 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/+config.ts +10 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/index/+Page.telefunc.ts +13 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/index/+Page.vue +89 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/tailwind.css +7 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/playwright.config.ts +22 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/server/api.ts +5 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/server/app.ts +25 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/test/e2e/app.spec.ts +10 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/test/todos.test.ts +20 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/vite.config.ts +12 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/vitest.config.ts +8 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-app/turbo.json +11 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/api/turbo.json +8 -0
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/playwright.config.ts +1 -1
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/api.ts +1 -4
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/turbo.json +11 -0
- package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +4 -0
- package/node_modules/@ykdz/template-core/dist/module-graph.js +64 -4
- package/node_modules/@ykdz/template-core/dist/package-addition.js +23 -34
- package/node_modules/@ykdz/template-core/dist/package-linking.js +14 -8
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +6 -0
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +1 -1
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +355 -104
- package/node_modules/@ykdz/template-shared/dist/index.d.ts +9 -9
- package/node_modules/@ykdz/template-shared/dist/index.js +29 -11
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ export declare const PackageAdditionSupport: {
|
|
|
6
6
|
export type PackageAdditionSupport = (typeof PackageAdditionSupport)[keyof typeof PackageAdditionSupport];
|
|
7
7
|
export declare const packageAdditionSupportValues: readonly ["supported", "unsupported"];
|
|
8
8
|
export type PackageRole = "runtime-service" | "shared-library";
|
|
9
|
-
export type PackageSourcePreset = "hono-api" | "ts-lib" | "vue-app";
|
|
9
|
+
export type PackageSourcePreset = "hono-api" | "ts-lib" | "vike-app" | "vue-app";
|
|
10
10
|
export type PackageLinkIntent = {
|
|
11
11
|
readonly consumerPackagePath: string;
|
|
12
12
|
readonly providerPackagePath: string;
|
|
@@ -77,8 +77,8 @@ export type WorkspaceLibraryPackageCapabilityDeclaration = {
|
|
|
77
77
|
readonly packageSourcePreset: "ts-lib";
|
|
78
78
|
readonly sourceFiles: readonly string[];
|
|
79
79
|
};
|
|
80
|
-
export type WorkspaceNodePackageKind = "hono-api" | "vue-app";
|
|
81
|
-
export type WorkspaceNodePackagePath = "apps/api" | "apps/web";
|
|
80
|
+
export type WorkspaceNodePackageKind = "hono-api" | "vike-app" | "vue-app";
|
|
81
|
+
export type WorkspaceNodePackagePath = "." | "apps/api" | "apps/web";
|
|
82
82
|
export type WorkspaceNodePackageDeclaration = {
|
|
83
83
|
readonly kind: WorkspaceNodePackageKind;
|
|
84
84
|
readonly path: WorkspaceNodePackagePath;
|
|
@@ -86,7 +86,7 @@ export type WorkspaceNodePackageDeclaration = {
|
|
|
86
86
|
};
|
|
87
87
|
export type WorkspaceNodePackagesCapabilityDeclaration = {
|
|
88
88
|
readonly kind: "workspace-node-packages";
|
|
89
|
-
readonly workspacePackageGlob: "apps/*";
|
|
89
|
+
readonly workspacePackageGlob: "." | "apps/*";
|
|
90
90
|
readonly packages: readonly WorkspaceNodePackageDeclaration[];
|
|
91
91
|
readonly packageLinks?: readonly {
|
|
92
92
|
readonly consumerPackagePath: "apps/web";
|
|
@@ -404,7 +404,7 @@ export declare const presetSourceManifestJsonSchema: {
|
|
|
404
404
|
readonly const: "workspace-node-packages";
|
|
405
405
|
};
|
|
406
406
|
readonly workspacePackageGlob: {
|
|
407
|
-
readonly
|
|
407
|
+
readonly enum: readonly [".", "apps/*"];
|
|
408
408
|
};
|
|
409
409
|
readonly packages: {
|
|
410
410
|
readonly type: "array";
|
|
@@ -415,10 +415,10 @@ export declare const presetSourceManifestJsonSchema: {
|
|
|
415
415
|
readonly required: readonly ["kind", "path", "sourceFiles"];
|
|
416
416
|
readonly properties: {
|
|
417
417
|
readonly kind: {
|
|
418
|
-
readonly enum: readonly ["hono-api", "vue-app"];
|
|
418
|
+
readonly enum: readonly ["hono-api", "vike-app", "vue-app"];
|
|
419
419
|
};
|
|
420
420
|
readonly path: {
|
|
421
|
-
readonly enum: readonly ["apps/api", "apps/web"];
|
|
421
|
+
readonly enum: readonly [".", "apps/api", "apps/web"];
|
|
422
422
|
};
|
|
423
423
|
readonly sourceFiles: {
|
|
424
424
|
readonly type: "array";
|
|
@@ -732,7 +732,7 @@ export declare const blueprintJsonSchema: {
|
|
|
732
732
|
readonly enum: readonly ["runtime-service", "shared-library"];
|
|
733
733
|
};
|
|
734
734
|
readonly sourcePreset: {
|
|
735
|
-
readonly enum: readonly ["hono-api", "ts-lib", "vue-app"];
|
|
735
|
+
readonly enum: readonly ["hono-api", "ts-lib", "vike-app", "vue-app"];
|
|
736
736
|
};
|
|
737
737
|
};
|
|
738
738
|
};
|
|
@@ -776,7 +776,7 @@ export declare const projectBlueprintSchema: v.StrictObjectSchema<{
|
|
|
776
776
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
777
777
|
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
778
778
|
readonly role: v.OptionalSchema<v.PicklistSchema<["runtime-service", "shared-library"], undefined>, undefined>;
|
|
779
|
-
readonly sourcePreset: v.OptionalSchema<v.PicklistSchema<["hono-api", "ts-lib", "vue-app"], undefined>, undefined>;
|
|
779
|
+
readonly sourcePreset: v.OptionalSchema<v.PicklistSchema<["hono-api", "ts-lib", "vike-app", "vue-app"], undefined>, undefined>;
|
|
780
780
|
}, undefined>, undefined>, undefined>;
|
|
781
781
|
readonly packageLinkIntents: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
|
|
782
782
|
readonly consumerPackagePath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -235,7 +235,7 @@ export const presetSourceManifestJsonSchema = {
|
|
|
235
235
|
required: ["kind", "workspacePackageGlob", "packages"],
|
|
236
236
|
properties: {
|
|
237
237
|
kind: { const: "workspace-node-packages" },
|
|
238
|
-
workspacePackageGlob: {
|
|
238
|
+
workspacePackageGlob: { enum: [".", "apps/*"] },
|
|
239
239
|
packages: {
|
|
240
240
|
type: "array",
|
|
241
241
|
minItems: 1,
|
|
@@ -244,8 +244,10 @@ export const presetSourceManifestJsonSchema = {
|
|
|
244
244
|
additionalProperties: false,
|
|
245
245
|
required: ["kind", "path", "sourceFiles"],
|
|
246
246
|
properties: {
|
|
247
|
-
kind: {
|
|
248
|
-
|
|
247
|
+
kind: {
|
|
248
|
+
enum: ["hono-api", "vike-app", "vue-app"],
|
|
249
|
+
},
|
|
250
|
+
path: { enum: [".", "apps/api", "apps/web"] },
|
|
249
251
|
sourceFiles: {
|
|
250
252
|
type: "array",
|
|
251
253
|
minItems: 1,
|
|
@@ -375,6 +377,7 @@ const packageRoleSchema = v.picklist([
|
|
|
375
377
|
const packageSourcePresetSchema = v.picklist([
|
|
376
378
|
"hono-api",
|
|
377
379
|
"ts-lib",
|
|
380
|
+
"vike-app",
|
|
378
381
|
"vue-app",
|
|
379
382
|
]);
|
|
380
383
|
const presetSourceManifestPresetSourceSchema = v.strictObject({
|
|
@@ -499,7 +502,7 @@ export const blueprintJsonSchema = {
|
|
|
499
502
|
name: { type: "string", minLength: 1 },
|
|
500
503
|
path: { type: "string", minLength: 1 },
|
|
501
504
|
role: { enum: ["runtime-service", "shared-library"] },
|
|
502
|
-
sourcePreset: { enum: ["hono-api", "ts-lib", "vue-app"] },
|
|
505
|
+
sourcePreset: { enum: ["hono-api", "ts-lib", "vike-app", "vue-app"] },
|
|
503
506
|
},
|
|
504
507
|
},
|
|
505
508
|
},
|
|
@@ -841,8 +844,16 @@ function nonEmptyStringArray(value) {
|
|
|
841
844
|
return strings.length === 0 ? undefined : strings;
|
|
842
845
|
}
|
|
843
846
|
const projectionCapabilityKindSet = new Set(projectionCapabilityKinds);
|
|
844
|
-
const workspaceNodePackageKindSet = new Set([
|
|
845
|
-
|
|
847
|
+
const workspaceNodePackageKindSet = new Set([
|
|
848
|
+
"hono-api",
|
|
849
|
+
"vike-app",
|
|
850
|
+
"vue-app",
|
|
851
|
+
]);
|
|
852
|
+
const workspaceNodePackagePathSet = new Set([
|
|
853
|
+
".",
|
|
854
|
+
"apps/api",
|
|
855
|
+
"apps/web",
|
|
856
|
+
]);
|
|
846
857
|
function isProjectionCapabilityKind(value) {
|
|
847
858
|
return projectionCapabilityKindSet.has(value);
|
|
848
859
|
}
|
|
@@ -962,13 +973,13 @@ function parseWorkspaceNodePackage(value, pathPrefix) {
|
|
|
962
973
|
if (kind === undefined) {
|
|
963
974
|
issues.push({
|
|
964
975
|
path: `${pathPrefix}.kind`,
|
|
965
|
-
message: "workspace-node-packages package kind must be hono-api or vue-app",
|
|
976
|
+
message: "workspace-node-packages package kind must be hono-api, vike-app, or vue-app",
|
|
966
977
|
});
|
|
967
978
|
}
|
|
968
979
|
if (packagePath === undefined) {
|
|
969
980
|
issues.push({
|
|
970
981
|
path: `${pathPrefix}.path`,
|
|
971
|
-
message: "workspace-node-packages package path must be apps/api or apps/web",
|
|
982
|
+
message: "workspace-node-packages package path must be ., apps/api, or apps/web",
|
|
972
983
|
});
|
|
973
984
|
}
|
|
974
985
|
if (!Array.isArray(value.sourceFiles)) {
|
|
@@ -1072,10 +1083,14 @@ function parseWorkspaceNodePackageLinks(value, pathPrefix, declaredPackagePaths,
|
|
|
1072
1083
|
}
|
|
1073
1084
|
function parseWorkspaceNodePackagesCapability(capability, pathPrefix) {
|
|
1074
1085
|
const issues = [];
|
|
1075
|
-
|
|
1086
|
+
const workspacePackageGlob = capability.workspacePackageGlob === "." ||
|
|
1087
|
+
capability.workspacePackageGlob === "apps/*"
|
|
1088
|
+
? capability.workspacePackageGlob
|
|
1089
|
+
: undefined;
|
|
1090
|
+
if (workspacePackageGlob === undefined) {
|
|
1076
1091
|
issues.push({
|
|
1077
1092
|
path: `${pathPrefix}.workspacePackageGlob`,
|
|
1078
|
-
message: "workspace-node-packages currently supports workspacePackageGlob: apps/*",
|
|
1093
|
+
message: "workspace-node-packages currently supports workspacePackageGlob: . or apps/*",
|
|
1079
1094
|
});
|
|
1080
1095
|
}
|
|
1081
1096
|
if (!Array.isArray(capability.packages) || capability.packages.length === 0) {
|
|
@@ -1101,9 +1116,12 @@ function parseWorkspaceNodePackagesCapability(capability, pathPrefix) {
|
|
|
1101
1116
|
if (issues.length > 0) {
|
|
1102
1117
|
return issues;
|
|
1103
1118
|
}
|
|
1119
|
+
if (workspacePackageGlob === undefined) {
|
|
1120
|
+
throw new Error(`workspace-node-packages validation failed without workspacePackageGlob diagnostic at ${pathPrefix}`);
|
|
1121
|
+
}
|
|
1104
1122
|
return {
|
|
1105
1123
|
kind: "workspace-node-packages",
|
|
1106
|
-
workspacePackageGlob
|
|
1124
|
+
workspacePackageGlob,
|
|
1107
1125
|
packages,
|
|
1108
1126
|
...(packageLinks === undefined ? {} : { packageLinks }),
|
|
1109
1127
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ykdz/template",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Project template generator for YKDZ starter projects.",
|
|
6
6
|
"keywords": [
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"typescript": "^6.0.3",
|
|
36
36
|
"valibot": "^1.4.2",
|
|
37
|
-
"@ykdz/template-
|
|
37
|
+
"@ykdz/template-core": "0.0.0",
|
|
38
38
|
"@ykdz/template-shared": "0.0.0",
|
|
39
|
-
"@ykdz/template-
|
|
39
|
+
"@ykdz/template-builtin-source": "0.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "^24.0.0",
|