@ykdz/template 0.0.17 → 0.0.19

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 (80) hide show
  1. package/dist/cli.js +61 -24
  2. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +0 -2
  3. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +4 -4
  4. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.js +13 -2
  5. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +6 -74
  6. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +23 -22
  7. package/node_modules/@ykdz/template-builtin-source/package.json +41 -8
  8. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +69 -282
  9. package/node_modules/@ykdz/template-builtin-source/templates/rust-bin/src/main.rs +5 -2
  10. package/node_modules/@ykdz/template-builtin-source/templates/rust-bin/turbo.json +2 -1
  11. package/node_modules/@ykdz/template-builtin-source/templates/ts-lib/turbo.json +2 -1
  12. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{drizzle.config.ts → db/drizzle.config.ts} +2 -2
  13. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{database → db/src}/db.ts +1 -1
  14. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/db/src/index.ts +1 -0
  15. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{database → db/src}/queries/todos.ts +4 -8
  16. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{test → db/test}/todos.test.ts +2 -2
  17. package/node_modules/@ykdz/template-builtin-source/templates/{hono-api → vike-app/db}/turbo.json +2 -1
  18. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{pages → web/pages}/index/+Page.telefunc.ts +3 -1
  19. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{pages → web/pages}/index/+Page.vue +1 -2
  20. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/playwright.config.ts +43 -0
  21. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/run-playwright.ts +62 -0
  22. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{server → web/server}/app.ts +1 -1
  23. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{test → web/test}/e2e/app.spec.ts +1 -1
  24. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/turbo.json +12 -0
  25. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{types → web/types}/global.d.ts +1 -1
  26. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{vite.config.ts → web/vite.config.ts} +1 -0
  27. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/playwright.config.ts +16 -3
  28. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/scripts/run-playwright.ts +38 -1
  29. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/turbo.json +1 -0
  30. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/api/turbo.json +1 -0
  31. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/playwright.config.ts +7 -9
  32. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/scripts/run-playwright.ts +79 -1
  33. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/App.vue +4 -5
  34. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/api.ts +9 -3
  35. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/test/e2e/app.spec.ts +1 -1
  36. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/turbo.json +1 -0
  37. package/node_modules/@ykdz/template-core/dist/Cargo.lock +16 -0
  38. package/node_modules/@ykdz/template-core/dist/Cargo.toml +12 -0
  39. package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +8 -0
  40. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +63 -2
  41. package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +1 -1
  42. package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +104 -26
  43. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +1 -0
  44. package/node_modules/@ykdz/template-core/dist/module-graph.js +19 -12
  45. package/node_modules/@ykdz/template-core/dist/next-step-instructions.d.ts +8 -0
  46. package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +65 -0
  47. package/node_modules/@ykdz/template-core/dist/package-addition.js +6 -12
  48. package/node_modules/@ykdz/template-core/dist/package-linking.d.ts +24 -0
  49. package/node_modules/@ykdz/template-core/dist/package-linking.js +35 -0
  50. package/node_modules/@ykdz/template-core/dist/preset-source.d.ts +2 -2
  51. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +240 -153
  52. package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +46 -10
  53. package/node_modules/@ykdz/template-core/package.json +9 -5
  54. package/node_modules/@ykdz/template-shared/dist/index.d.ts +3 -152
  55. package/node_modules/@ykdz/template-shared/dist/index.js +49 -305
  56. package/node_modules/@ykdz/template-shared/package.json +8 -4
  57. package/package.json +5 -5
  58. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.d.ts +0 -6
  59. package/node_modules/@ykdz/template-builtin-source/dist/templates/hono-api/projection.js +0 -213
  60. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/.github/dependabot.yml +0 -23
  61. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/.github/workflows/check.yml +0 -19
  62. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/src/app.ts +0 -5
  63. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/src/server.ts +0 -15
  64. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/test/app.test.ts +0 -10
  65. package/node_modules/@ykdz/template-builtin-source/templates/hono-api/vitest.config.ts +0 -15
  66. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/playwright.config.ts +0 -23
  67. package/node_modules/@ykdz/template-builtin-source/templates/vue-app/playwright.package-addition.config.ts +0 -22
  68. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{database → db/src}/schema.ts +0 -0
  69. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{+server.ts → web/+server.ts} +0 -0
  70. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{.env.example → web/.env.example} +0 -0
  71. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{assets → web/assets}/logo.svg +0 -0
  72. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{components → web/components}/CounterButton.vue +0 -0
  73. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{components → web/components}/PageShell.vue +0 -0
  74. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{pages → web/pages}/+Head.vue +0 -0
  75. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{pages → web/pages}/+Layout.vue +0 -0
  76. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{pages → web/pages}/+config.ts +0 -0
  77. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{pages → web/pages}/tailwind.css +0 -0
  78. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{server → web/server}/api.ts +0 -0
  79. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{types → web/types}/env.d.ts +0 -0
  80. /package/node_modules/@ykdz/template-builtin-source/templates/vike-app/{vitest.config.ts → web/vitest.config.ts} +0 -0
@@ -47,14 +47,6 @@ export const projectionCapabilityKinds = [
47
47
  "github-maintenance",
48
48
  ];
49
49
  export const packageLeafNamePattern = "^[a-z0-9][a-z0-9-]*$";
50
- const packageLeafNameRegExp = new RegExp(packageLeafNamePattern);
51
- export const requiredFixtureMatrixCheckRequirements = [
52
- "machine-verifiable-next-steps",
53
- "root-check-ci",
54
- ];
55
- export const requiredFixtureMatrixEnvironmentPreparation = [
56
- "playwright-browser-assets",
57
- ];
58
50
  export const presetSourceManifestJsonSchema = {
59
51
  $schema: "https://json-schema.org/draft/2020-12/schema",
60
52
  $id: "https://ykdz.dev/schemas/template/preset-source-manifest.schema.json",
@@ -77,84 +69,6 @@ export const presetSourceManifestJsonSchema = {
77
69
  },
78
70
  },
79
71
  },
80
- fixtureMatrix: {
81
- type: "object",
82
- additionalProperties: false,
83
- required: [
84
- "initSupport",
85
- "packageAdditionSupport",
86
- "supportedCombinations",
87
- "semanticSkips",
88
- "checkRequirements",
89
- "environmentPreparation",
90
- ],
91
- properties: {
92
- initSupport: {
93
- type: "array",
94
- items: {
95
- type: "object",
96
- additionalProperties: false,
97
- required: ["preset"],
98
- properties: { preset: { type: "string", minLength: 1 } },
99
- },
100
- },
101
- packageAdditionSupport: {
102
- type: "array",
103
- items: {
104
- type: "object",
105
- additionalProperties: false,
106
- required: ["preset", "packageLeafName"],
107
- properties: {
108
- preset: { type: "string", minLength: 1 },
109
- packageLeafName: {
110
- type: "string",
111
- minLength: 1,
112
- pattern: packageLeafNamePattern,
113
- },
114
- },
115
- },
116
- },
117
- supportedCombinations: {
118
- type: "array",
119
- items: {
120
- type: "object",
121
- additionalProperties: false,
122
- required: ["basePreset", "addedPreset"],
123
- properties: {
124
- basePreset: { type: "string", minLength: 1 },
125
- addedPreset: { type: "string", minLength: 1 },
126
- linkFrom: {
127
- type: "array",
128
- items: { type: "string", minLength: 1 },
129
- },
130
- },
131
- },
132
- },
133
- semanticSkips: {
134
- type: "array",
135
- items: {
136
- type: "object",
137
- additionalProperties: false,
138
- required: ["basePreset", "addedPreset", "reason"],
139
- properties: {
140
- basePreset: { type: "string", minLength: 1 },
141
- addedPreset: { type: "string", minLength: 1 },
142
- reason: { type: "string", minLength: 1 },
143
- },
144
- },
145
- },
146
- checkRequirements: {
147
- type: "array",
148
- items: { enum: [...requiredFixtureMatrixCheckRequirements] },
149
- uniqueItems: true,
150
- },
151
- environmentPreparation: {
152
- type: "array",
153
- items: { enum: [...requiredFixtureMatrixEnvironmentPreparation] },
154
- uniqueItems: true,
155
- },
156
- },
157
- },
158
72
  presets: {
159
73
  type: "array",
160
74
  minItems: 1,
@@ -267,7 +181,9 @@ export const presetSourceManifestJsonSchema = {
267
181
  ],
268
182
  properties: {
269
183
  consumerPackagePath: { const: "apps/web" },
270
- providerPackagePath: { const: "apps/api" },
184
+ providerPackagePath: {
185
+ enum: ["apps/api", "packages/db"],
186
+ },
271
187
  },
272
188
  },
273
189
  },
@@ -385,31 +301,6 @@ const presetSourceManifestPresetSourceSchema = v.strictObject({
385
301
  files: v.optional(v.array(nonEmptyString), []),
386
302
  sharedResources: v.optional(v.array(nonEmptyString), []),
387
303
  });
388
- const fixtureMatrixPresetSupportSchema = v.strictObject({
389
- preset: nonEmptyString,
390
- });
391
- const fixtureMatrixPackageAdditionSupportSchema = v.strictObject({
392
- preset: nonEmptyString,
393
- packageLeafName: v.pipe(v.string(), v.regex(packageLeafNameRegExp, "Fixture Matrix Package Addition packageLeafName must be a lowercase package leaf name using letters, numbers, and hyphens")),
394
- });
395
- const fixtureMatrixCombinationSchema = v.strictObject({
396
- basePreset: nonEmptyString,
397
- addedPreset: nonEmptyString,
398
- linkFrom: v.optional(v.array(nonEmptyString), []),
399
- });
400
- const fixtureMatrixSemanticSkipSchema = v.strictObject({
401
- basePreset: nonEmptyString,
402
- addedPreset: nonEmptyString,
403
- reason: nonEmptyString,
404
- });
405
- const fixtureMatrixContractSchema = v.strictObject({
406
- initSupport: v.array(fixtureMatrixPresetSupportSchema),
407
- packageAdditionSupport: v.array(fixtureMatrixPackageAdditionSupportSchema),
408
- supportedCombinations: v.array(fixtureMatrixCombinationSchema),
409
- semanticSkips: v.array(fixtureMatrixSemanticSkipSchema),
410
- checkRequirements: v.array(v.picklist(requiredFixtureMatrixCheckRequirements)),
411
- environmentPreparation: v.array(v.picklist(requiredFixtureMatrixEnvironmentPreparation)),
412
- });
413
304
  export const presetProjectionDeclarationSchema = v.strictObject({
414
305
  capabilities: v.array(v.looseObject({
415
306
  kind: v.string(),
@@ -422,7 +313,6 @@ export const presetSourceManifestSchema = v.strictObject({
422
313
  id: nonEmptyString,
423
314
  path: nonEmptyString,
424
315
  })), []),
425
- fixtureMatrix: v.optional(fixtureMatrixContractSchema),
426
316
  presets: v.pipe(v.array(v.strictObject({
427
317
  name: nonEmptyString,
428
318
  title: nonEmptyString,
@@ -608,6 +498,13 @@ function presetSourceShapeIssues(issues) {
608
498
  message: `Preset metadata is missing required field: ${missingPresetMetadata[1]}`,
609
499
  };
610
500
  }
501
+ if (issue.message.startsWith("Invalid key:") &&
502
+ validationPath === "$.fixtureMatrix") {
503
+ return {
504
+ path: validationPath,
505
+ message: "Preset Source Manifests must contain production facts only; remove fixtureMatrix",
506
+ };
507
+ }
611
508
  if (issue.message.startsWith("Invalid key:") &&
612
509
  /\.(body|content|text)$/.test(validationPath)) {
613
510
  const key = validationPath.split(".").at(-1);
@@ -660,166 +557,6 @@ function duplicatePresetMetadataArrayIssues(presets) {
660
557
  ...duplicateValueIssues(preset.dependencyCatalog ?? [], `$.presets[${index}].dependencyCatalog`),
661
558
  ]);
662
559
  }
663
- function fixtureCombinationKey(combination) {
664
- return [
665
- combination.basePreset,
666
- combination.addedPreset,
667
- ...(combination.linkFrom ?? []),
668
- ].join("\0");
669
- }
670
- function fixtureCombinationPairKey(combination) {
671
- return [combination.basePreset, combination.addedPreset].join("\0");
672
- }
673
- function fixtureMatrixContractIssues(manifest) {
674
- if (!manifest.fixtureMatrix) {
675
- return [];
676
- }
677
- const issues = [];
678
- const presetsByName = new Map(manifest.presets.map((preset) => [preset.name, preset]));
679
- const initPresets = new Set(manifest.fixtureMatrix.initSupport.map((support) => support.preset));
680
- const addablePresets = new Set(manifest.fixtureMatrix.packageAdditionSupport.map((support) => support.preset));
681
- const validInitPresets = new Set();
682
- const validAddablePresets = new Set();
683
- const supportedCombinationKeys = new Set();
684
- const supportedCombinationPairKeys = new Set();
685
- const semanticSkipKeys = new Set();
686
- const semanticSkipPairKeys = new Set();
687
- manifest.fixtureMatrix.initSupport.forEach((support, index) => {
688
- const preset = presetsByName.get(support.preset);
689
- if (!preset) {
690
- issues.push({
691
- path: `$.fixtureMatrix.initSupport[${index}].preset`,
692
- message: `Fixture Matrix init support references unknown Preset: ${support.preset}`,
693
- });
694
- return;
695
- }
696
- if (preset.generation !== "supported") {
697
- issues.push({
698
- path: `$.fixtureMatrix.initSupport[${index}].preset`,
699
- message: `Fixture Matrix init support must reference supported Presets: ${support.preset}`,
700
- });
701
- return;
702
- }
703
- validInitPresets.add(support.preset);
704
- });
705
- manifest.presets.forEach((preset, index) => {
706
- if (preset.generation === "supported" &&
707
- preset.packageAdditionSupport === PackageAdditionSupport.Supported &&
708
- !addablePresets.has(preset.name)) {
709
- issues.push({
710
- path: `$.presets[${index}].packageAdditionSupport`,
711
- message: `Fixture Matrix Package Addition support must declare supported Preset: ${preset.name}`,
712
- });
713
- }
714
- });
715
- manifest.fixtureMatrix.packageAdditionSupport.forEach((support, index) => {
716
- const preset = presetsByName.get(support.preset);
717
- if (!preset) {
718
- issues.push({
719
- path: `$.fixtureMatrix.packageAdditionSupport[${index}].preset`,
720
- message: `Fixture Matrix Package Addition support references unknown Preset: ${support.preset}`,
721
- });
722
- return;
723
- }
724
- if (preset.packageAdditionSupport !== PackageAdditionSupport.Supported) {
725
- issues.push({
726
- path: `$.fixtureMatrix.packageAdditionSupport[${index}].preset`,
727
- message: `Fixture Matrix Package Addition support must match Preset metadata: ${support.preset} is ${preset.packageAdditionSupport}`,
728
- });
729
- return;
730
- }
731
- validAddablePresets.add(support.preset);
732
- });
733
- manifest.fixtureMatrix.supportedCombinations.forEach((combination, index) => {
734
- const key = fixtureCombinationKey(combination);
735
- supportedCombinationPairKeys.add(fixtureCombinationPairKey(combination));
736
- if (supportedCombinationKeys.has(key)) {
737
- issues.push({
738
- path: `$.fixtureMatrix.supportedCombinations[${index}]`,
739
- message: `Duplicate Fixture Matrix supported combination: ${combination.basePreset} + ${combination.addedPreset}`,
740
- });
741
- }
742
- supportedCombinationKeys.add(key);
743
- if (!initPresets.has(combination.basePreset)) {
744
- issues.push({
745
- path: `$.fixtureMatrix.supportedCombinations[${index}].basePreset`,
746
- message: `Fixture Matrix supported combination base Preset is not init-supported: ${combination.basePreset}`,
747
- });
748
- }
749
- if (!addablePresets.has(combination.addedPreset)) {
750
- issues.push({
751
- path: `$.fixtureMatrix.supportedCombinations[${index}].addedPreset`,
752
- message: `Fixture Matrix supported combination added Preset is not Package Addition-supported: ${combination.addedPreset}`,
753
- });
754
- }
755
- });
756
- manifest.fixtureMatrix.semanticSkips.forEach((skip, index) => {
757
- const key = fixtureCombinationKey(skip);
758
- semanticSkipPairKeys.add(fixtureCombinationPairKey(skip));
759
- if (semanticSkipKeys.has(key)) {
760
- issues.push({
761
- path: `$.fixtureMatrix.semanticSkips[${index}]`,
762
- message: `Duplicate Fixture Matrix semantic skip: ${skip.basePreset} + ${skip.addedPreset}`,
763
- });
764
- }
765
- semanticSkipKeys.add(key);
766
- if (!initPresets.has(skip.basePreset)) {
767
- issues.push({
768
- path: `$.fixtureMatrix.semanticSkips[${index}].basePreset`,
769
- message: `Fixture Matrix semantic skip base Preset is not init-supported: ${skip.basePreset}`,
770
- });
771
- }
772
- if (!presetsByName.has(skip.addedPreset)) {
773
- issues.push({
774
- path: `$.fixtureMatrix.semanticSkips[${index}].addedPreset`,
775
- message: `Fixture Matrix semantic skip references unknown added Preset: ${skip.addedPreset}`,
776
- });
777
- }
778
- });
779
- for (const basePreset of validInitPresets) {
780
- for (const addedPreset of validAddablePresets) {
781
- const key = fixtureCombinationPairKey({ basePreset, addedPreset });
782
- if (!supportedCombinationPairKeys.has(key) &&
783
- !semanticSkipPairKeys.has(key)) {
784
- issues.push({
785
- path: "$.fixtureMatrix.supportedCombinations",
786
- message: `Fixture Matrix must explicitly cover supported combination or semantic skip: ${basePreset} + ${addedPreset}`,
787
- });
788
- }
789
- }
790
- }
791
- for (const checkRequirement of requiredFixtureMatrixCheckRequirements) {
792
- if (!manifest.fixtureMatrix.checkRequirements.includes(checkRequirement)) {
793
- issues.push({
794
- path: "$.fixtureMatrix.checkRequirements",
795
- message: `Fixture Matrix check requirements must include ${checkRequirement}`,
796
- });
797
- }
798
- }
799
- for (const environmentPreparation of requiredFixtureMatrixEnvironmentPreparation) {
800
- if (!manifest.fixtureMatrix.environmentPreparation.includes(environmentPreparation)) {
801
- issues.push({
802
- path: "$.fixtureMatrix.environmentPreparation",
803
- message: `Fixture Matrix environment preparation must include ${environmentPreparation}`,
804
- });
805
- }
806
- }
807
- for (const key of semanticSkipPairKeys) {
808
- if (supportedCombinationPairKeys.has(key)) {
809
- issues.push({
810
- path: "$.fixtureMatrix.semanticSkips",
811
- message: "Fixture Matrix semantic skips must not duplicate supported combinations",
812
- });
813
- }
814
- }
815
- return [
816
- ...duplicateValueIssues(manifest.fixtureMatrix.initSupport.map((support) => support.preset), "$.fixtureMatrix.initSupport.preset"),
817
- ...duplicateValueIssues(manifest.fixtureMatrix.packageAdditionSupport.map((support) => support.preset), "$.fixtureMatrix.packageAdditionSupport.preset"),
818
- ...duplicateValueIssues(manifest.fixtureMatrix.checkRequirements, "$.fixtureMatrix.checkRequirements"),
819
- ...duplicateValueIssues(manifest.fixtureMatrix.environmentPreparation, "$.fixtureMatrix.environmentPreparation"),
820
- ...issues,
821
- ];
822
- }
823
560
  function unsupportedProjectShapeIssues(presets) {
824
561
  return presets.flatMap((preset, index) => preset.supportedProjectKinds.includes("single-package")
825
562
  ? [
@@ -877,6 +614,7 @@ const exactCapabilityKeys = {
877
614
  "kind",
878
615
  "workspacePackageGlob",
879
616
  "sourceFiles",
617
+ "cargoDependencies",
880
618
  "devcontainerResourceId",
881
619
  "editorCustomizationResourceId",
882
620
  ],
@@ -1044,24 +782,33 @@ function parseWorkspaceNodePackageLinks(value, pathPrefix, declaredPackagePaths,
1044
782
  });
1045
783
  }
1046
784
  }
1047
- if (link.consumerPackagePath !== "apps/web" ||
1048
- link.providerPackagePath !== "apps/api") {
785
+ const consumerPackagePath = typeof link.consumerPackagePath === "string"
786
+ ? link.consumerPackagePath
787
+ : undefined;
788
+ const providerPackagePath = typeof link.providerPackagePath === "string"
789
+ ? link.providerPackagePath
790
+ : undefined;
791
+ const isSupportedLink = consumerPackagePath === "apps/web" &&
792
+ (providerPackagePath === "apps/api" ||
793
+ providerPackagePath === "packages/db");
794
+ if (!isSupportedLink) {
1049
795
  linkIssues.push({
1050
796
  path: linkPath,
1051
- message: "workspace-node-packages currently supports links from apps/web to apps/api",
797
+ message: "workspace-node-packages currently supports links from apps/web to apps/api or packages/db",
1052
798
  });
1053
799
  }
1054
800
  else {
1055
- if (!declaredPackagePaths.has(link.consumerPackagePath)) {
801
+ if (!declaredPackagePaths.has(consumerPackagePath)) {
1056
802
  linkIssues.push({
1057
803
  path: `${linkPath}.consumerPackagePath`,
1058
804
  message: "workspace-node-packages packageLink consumerPackagePath must reference a package declared in the same packages array: apps/web",
1059
805
  });
1060
806
  }
1061
- if (!declaredPackagePaths.has(link.providerPackagePath)) {
807
+ if (providerPackagePath !== "packages/db" &&
808
+ !declaredPackagePaths.has(providerPackagePath)) {
1062
809
  linkIssues.push({
1063
810
  path: `${linkPath}.providerPackagePath`,
1064
- message: "workspace-node-packages packageLink providerPackagePath must reference a package declared in the same packages array: apps/api",
811
+ message: "workspace-node-packages packageLink providerPackagePath must reference a package declared in the same packages array or the vike db package: apps/api, packages/db",
1065
812
  });
1066
813
  }
1067
814
  }
@@ -1072,7 +819,7 @@ function parseWorkspaceNodePackageLinks(value, pathPrefix, declaredPackagePaths,
1072
819
  return [
1073
820
  {
1074
821
  consumerPackagePath: "apps/web",
1075
- providerPackagePath: "apps/api",
822
+ providerPackagePath: providerPackagePath,
1076
823
  },
1077
824
  ];
1078
825
  });
@@ -1124,6 +871,7 @@ function parseWorkspaceNodePackagesCapability(capability, pathPrefix) {
1124
871
  function parseRustBinaryWorkspaceCapability(capability, pathPrefix) {
1125
872
  const issues = [];
1126
873
  let sourceFiles = [];
874
+ let cargoDependencies = [];
1127
875
  let devcontainerResourceId = "";
1128
876
  let editorCustomizationResourceId = "";
1129
877
  if (capability.workspacePackageGlob !== "packages/*") {
@@ -1150,6 +898,26 @@ function parseRustBinaryWorkspaceCapability(capability, pathPrefix) {
1150
898
  sourceFiles = parsedSourceFiles;
1151
899
  }
1152
900
  }
901
+ if (capability.cargoDependencies !== undefined) {
902
+ if (!Array.isArray(capability.cargoDependencies)) {
903
+ issues.push({
904
+ path: `${pathPrefix}.cargoDependencies`,
905
+ message: "rust-binary-workspace cargoDependencies must be an array",
906
+ });
907
+ }
908
+ else {
909
+ const parsedCargoDependencies = nonEmptyStringArray(capability.cargoDependencies);
910
+ if (parsedCargoDependencies === undefined) {
911
+ issues.push({
912
+ path: `${pathPrefix}.cargoDependencies`,
913
+ message: "rust-binary-workspace cargoDependencies must be an array of dependency names",
914
+ });
915
+ }
916
+ else {
917
+ cargoDependencies = parsedCargoDependencies;
918
+ }
919
+ }
920
+ }
1153
921
  if (typeof capability.devcontainerResourceId !== "string" ||
1154
922
  capability.devcontainerResourceId.length === 0) {
1155
923
  issues.push({
@@ -1177,6 +945,7 @@ function parseRustBinaryWorkspaceCapability(capability, pathPrefix) {
1177
945
  kind: "rust-binary-workspace",
1178
946
  workspacePackageGlob: "packages/*",
1179
947
  sourceFiles,
948
+ ...(cargoDependencies.length === 0 ? {} : { cargoDependencies }),
1180
949
  devcontainerResourceId,
1181
950
  editorCustomizationResourceId,
1182
951
  };
@@ -1451,30 +1220,6 @@ function normalizePresetSourceManifestOutput(manifest) {
1451
1220
  sharedResources: manifest.sharedResources.map((resource) => ({
1452
1221
  ...resource,
1453
1222
  })),
1454
- ...(manifest.fixtureMatrix
1455
- ? {
1456
- fixtureMatrix: {
1457
- initSupport: manifest.fixtureMatrix.initSupport.map((support) => ({
1458
- ...support,
1459
- })),
1460
- packageAdditionSupport: manifest.fixtureMatrix.packageAdditionSupport.map((support) => ({
1461
- ...support,
1462
- })),
1463
- supportedCombinations: manifest.fixtureMatrix.supportedCombinations.map((combination) => ({
1464
- basePreset: combination.basePreset,
1465
- addedPreset: combination.addedPreset,
1466
- linkFrom: [...combination.linkFrom],
1467
- })),
1468
- semanticSkips: manifest.fixtureMatrix.semanticSkips.map((skip) => ({
1469
- ...skip,
1470
- })),
1471
- checkRequirements: [...manifest.fixtureMatrix.checkRequirements],
1472
- environmentPreparation: [
1473
- ...manifest.fixtureMatrix.environmentPreparation,
1474
- ],
1475
- },
1476
- }
1477
- : {}),
1478
1223
  presets: manifest.presets.map((preset) => ({
1479
1224
  name: preset.name,
1480
1225
  title: preset.title,
@@ -1513,7 +1258,6 @@ export function validatePresetSourceManifestDeclaration(input) {
1513
1258
  ...duplicatePresetNameIssues(parsedManifest.presets),
1514
1259
  ...duplicatePresetMetadataArrayIssues(parsedManifest.presets),
1515
1260
  ...unsupportedProjectShapeIssues(parsedManifest.presets),
1516
- ...fixtureMatrixContractIssues(parsedManifest),
1517
1261
  ...projectionCapabilityIssues(parsedManifest.presets),
1518
1262
  ...projectionCapabilitySharedResourceIssues(parsedManifest),
1519
1263
  ];
@@ -8,17 +8,21 @@
8
8
  "type": "module",
9
9
  "exports": {
10
10
  ".": {
11
+ "source": {
12
+ "types": "./src/index.ts",
13
+ "default": "./src/index.ts"
14
+ },
11
15
  "types": "./dist/index.d.ts",
12
16
  "default": "./dist/index.js"
13
17
  }
14
18
  },
15
19
  "scripts": {
16
20
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
17
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
21
+ "format:check": "oxfmt --list-different --config ../../oxfmt.config.ts .",
18
22
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
19
- "lint": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist .",
20
- "lint:fix": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist . --fix",
21
- "typecheck": "tsc -p tsconfig.json --noEmit"
23
+ "lint": "oxlint --quiet --format=unix --config ../../oxlint.config.ts --ignore-pattern dist .",
24
+ "lint:fix": "oxlint --format=unix --config ../../oxlint.config.ts --ignore-pattern dist . --fix",
25
+ "typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
22
26
  },
23
27
  "dependencies": {
24
28
  "valibot": "catalog:"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "scripts": {
56
56
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
57
- "format:check": "oxfmt --check --config ../../oxfmt.config.ts .",
57
+ "format:check": "oxfmt --list-different --config ../../oxfmt.config.ts .",
58
58
  "format:write": "oxfmt --write --config ../../oxfmt.config.ts .",
59
- "lint": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist .",
60
- "lint:fix": "oxlint --config ../../oxlint.config.ts --ignore-pattern dist . --fix",
61
- "typecheck": "tsc -p tsconfig.json --noEmit"
59
+ "lint": "oxlint --quiet --format=unix --config ../../oxlint.config.ts --ignore-pattern dist .",
60
+ "lint:fix": "oxlint --format=unix --config ../../oxlint.config.ts --ignore-pattern dist . --fix",
61
+ "typecheck": "tsc -p tsconfig.json --noEmit --pretty false"
62
62
  }
63
63
  }
@@ -1,6 +0,0 @@
1
- import type { PresetBlueprintOptions, PresetProjection } from "@ykdz/template-core/preset-projection";
2
- import { type BuiltInPreset, type ProjectBlueprint } from "@ykdz/template-shared";
3
- export declare const honoApiPresetMetadata: BuiltInPreset;
4
- export declare function honoApiBlueprint(options?: PresetBlueprintOptions): ProjectBlueprint;
5
- export declare function projectHonoApiPackageScripts(): Record<string, string>;
6
- export declare const honoApiPresetProjection: PresetProjection;