@ykdz/template 0.0.12 → 0.0.13

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.
Files changed (38) hide show
  1. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +2 -0
  2. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.d.ts +5 -0
  3. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.js +57 -0
  4. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +176 -0
  5. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/+server.ts +12 -0
  6. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.env.example +1 -0
  7. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/dependabot.yml +23 -0
  8. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/workflows/check.yml +20 -0
  9. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/assets/logo.svg +1 -0
  10. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/components/CounterButton.vue +21 -0
  11. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/components/PageShell.vue +17 -0
  12. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/database/db.ts +14 -0
  13. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/database/queries/todos.ts +32 -0
  14. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/database/schema.ts +14 -0
  15. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/drizzle.config.ts +10 -0
  16. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/env.d.ts +6 -0
  17. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/global.d.ts +9 -0
  18. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/+Head.vue +8 -0
  19. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/+Layout.vue +9 -0
  20. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/+config.ts +10 -0
  21. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/index/+Page.telefunc.ts +13 -0
  22. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/index/+Page.vue +89 -0
  23. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/pages/tailwind.css +7 -0
  24. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/playwright.config.ts +22 -0
  25. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/server/api.ts +5 -0
  26. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/server/app.ts +25 -0
  27. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/test/e2e/app.spec.ts +10 -0
  28. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/test/todos.test.ts +20 -0
  29. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/vite.config.ts +12 -0
  30. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/vitest.config.ts +8 -0
  31. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/api.ts +1 -4
  32. package/node_modules/@ykdz/template-core/dist/package-addition.js +2 -1
  33. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +6 -0
  34. package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +1 -1
  35. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +227 -22
  36. package/node_modules/@ykdz/template-shared/dist/index.d.ts +9 -9
  37. package/node_modules/@ykdz/template-shared/dist/index.js +29 -11
  38. package/package.json +3 -3
@@ -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: { const: "apps/*" },
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: { enum: ["hono-api", "vue-app"] },
248
- path: { enum: ["apps/api", "apps/web"] },
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(["hono-api", "vue-app"]);
845
- const workspaceNodePackagePathSet = new Set(["apps/api", "apps/web"]);
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
- if (capability.workspacePackageGlob !== "apps/*") {
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: "apps/*",
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.12",
3
+ "version": "0.0.13",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -35,8 +35,8 @@
35
35
  "typescript": "^6.0.3",
36
36
  "valibot": "^1.4.2",
37
37
  "@ykdz/template-builtin-source": "0.0.0",
38
- "@ykdz/template-shared": "0.0.0",
39
- "@ykdz/template-core": "0.0.0"
38
+ "@ykdz/template-core": "0.0.0",
39
+ "@ykdz/template-shared": "0.0.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^24.0.0",