create-next-hydra 0.1.0 → 0.2.0

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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +91 -0
  3. package/dist/cli.js +0 -0
  4. package/dist/composition/add.d.ts +14 -0
  5. package/dist/composition/add.d.ts.map +1 -0
  6. package/dist/composition/add.js +453 -0
  7. package/dist/composition/catalog.d.ts +23 -0
  8. package/dist/composition/catalog.d.ts.map +1 -0
  9. package/dist/composition/catalog.js +301 -0
  10. package/dist/composition/errors.d.ts +5 -0
  11. package/dist/composition/errors.d.ts.map +1 -0
  12. package/dist/composition/errors.js +8 -0
  13. package/dist/composition/format.d.ts +6 -0
  14. package/dist/composition/format.d.ts.map +1 -0
  15. package/dist/composition/format.js +63 -0
  16. package/dist/composition/install.d.ts +16 -0
  17. package/dist/composition/install.d.ts.map +1 -0
  18. package/dist/composition/install.js +175 -0
  19. package/dist/composition/packages.d.ts +6 -0
  20. package/dist/composition/packages.d.ts.map +1 -0
  21. package/dist/composition/packages.js +54 -0
  22. package/dist/composition/paths.d.ts +4 -0
  23. package/dist/composition/paths.d.ts.map +1 -0
  24. package/dist/composition/paths.js +47 -0
  25. package/dist/composition/planner.d.ts +4 -0
  26. package/dist/composition/planner.d.ts.map +1 -0
  27. package/dist/composition/planner.js +320 -0
  28. package/dist/composition/schema.d.ts +235 -0
  29. package/dist/composition/schema.d.ts.map +1 -0
  30. package/dist/composition/schema.js +115 -0
  31. package/dist/composition/types.d.ts +87 -0
  32. package/dist/composition/types.d.ts.map +1 -0
  33. package/dist/composition/types.js +6 -0
  34. package/dist/composition/use.d.ts +23 -0
  35. package/dist/composition/use.d.ts.map +1 -0
  36. package/dist/composition/use.js +182 -0
  37. package/dist/composition/workspace.d.ts +10 -0
  38. package/dist/composition/workspace.d.ts.map +1 -0
  39. package/dist/composition/workspace.js +208 -0
  40. package/dist/constants.d.ts +4 -1
  41. package/dist/constants.d.ts.map +1 -1
  42. package/dist/constants.js +26 -1
  43. package/dist/fs-utils.js +3 -3
  44. package/dist/git.d.ts.map +1 -1
  45. package/dist/git.js +12 -12
  46. package/dist/index.d.ts +5 -1
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +55 -6
  49. package/dist/instruction-renderer.d.ts +17 -0
  50. package/dist/instruction-renderer.d.ts.map +1 -0
  51. package/dist/instruction-renderer.js +132 -0
  52. package/dist/logger.d.ts +2 -1
  53. package/dist/logger.d.ts.map +1 -1
  54. package/dist/logger.js +7 -3
  55. package/dist/prompts.d.ts +2 -0
  56. package/dist/prompts.d.ts.map +1 -1
  57. package/dist/prompts.js +25 -2
  58. package/dist/sanitize.d.ts +2 -1
  59. package/dist/sanitize.d.ts.map +1 -1
  60. package/dist/sanitize.js +13 -4
  61. package/dist/scaffold.d.ts +5 -1
  62. package/dist/scaffold.d.ts.map +1 -1
  63. package/dist/scaffold.js +247 -71
  64. package/dist/types.d.ts +5 -0
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/version.d.ts +2 -0
  67. package/dist/version.d.ts.map +1 -0
  68. package/dist/version.js +2 -0
  69. package/package.json +35 -23
  70. package/schema/selection-definition.json +237 -0
  71. package/schema/source-registry.json +37 -0
@@ -0,0 +1,47 @@
1
+ import path from "node:path";
2
+ import { CompositionValidationError } from "./errors.js";
3
+ const LEADING_CURRENT_DIRECTORY = /^\.\//;
4
+ const REGISTRY_SOURCE_DIRECTORY = "registry";
5
+ function normalizeRelativePath(value, label) {
6
+ if (value.includes("\\")) {
7
+ throw new CompositionValidationError("Unsafe composition path.", [
8
+ `${label} must use forward slashes: ${value}`,
9
+ ]);
10
+ }
11
+ const normalized = path.posix.normalize(value);
12
+ if (normalized === "." ||
13
+ normalized === ".." ||
14
+ normalized.startsWith("../") ||
15
+ path.posix.isAbsolute(normalized)) {
16
+ throw new CompositionValidationError("Unsafe composition path.", [
17
+ `${label} escapes or names the workspace root: ${value}`,
18
+ ]);
19
+ }
20
+ return normalized.replace(LEADING_CURRENT_DIRECTORY, "");
21
+ }
22
+ export function resolveRegistryTarget(target) {
23
+ if (!target.startsWith("~/")) {
24
+ throw new CompositionValidationError("Registry files require workspace-root targets.", [`files[].target must start with ~/: ${target}`]);
25
+ }
26
+ const relativeTarget = target.startsWith("~/") ? target.slice(2) : target;
27
+ return normalizeRelativePath(relativeTarget, "registry target");
28
+ }
29
+ export function resolveWorkspacePath(value, label) {
30
+ return normalizeRelativePath(value, label);
31
+ }
32
+ export function isManagedApplicationSource(sourcePath, target) {
33
+ if (!target?.startsWith("~/")) {
34
+ return false;
35
+ }
36
+ const normalized = path.posix
37
+ .normalize(sourcePath)
38
+ .replace(LEADING_CURRENT_DIRECTORY, "");
39
+ const marker = `/${REGISTRY_SOURCE_DIRECTORY}/`;
40
+ const sourceWithLeadingSlash = `/${normalized}`;
41
+ const markerIndex = sourceWithLeadingSlash.lastIndexOf(marker);
42
+ if (markerIndex === -1) {
43
+ return false;
44
+ }
45
+ return (sourceWithLeadingSlash.slice(markerIndex + marker.length) ===
46
+ target.slice(2));
47
+ }
@@ -0,0 +1,4 @@
1
+ import type { CompositionPlan, SourceRegistryCatalog, WorkspaceSelection } from "./types.js";
2
+ export declare function planComposition(catalog: SourceRegistryCatalog, selection: WorkspaceSelection): CompositionPlan;
3
+ export declare function selectionFromPreset(catalog: SourceRegistryCatalog, reference: string): WorkspaceSelection;
4
+ //# sourceMappingURL=planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/composition/planner.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,eAAe,EAIf,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAiWpB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,kBAAkB,GAC5B,eAAe,CAoGjB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,MAAM,GAChB,kBAAkB,CAuBpB"}
@@ -0,0 +1,320 @@
1
+ import { resolveCatalogSelection, resolveRegistryItemGraph, } from "./catalog.js";
2
+ import { CompositionValidationError } from "./errors.js";
3
+ import { mergePackageRequirements } from "./packages.js";
4
+ import { isManagedApplicationSource, resolveRegistryTarget, resolveWorkspacePath, } from "./paths.js";
5
+ import { PROVIDER_ALIASES, PROVIDER_SLOTS } from "./types.js";
6
+ function uniqueSorted(values) {
7
+ // eslint-disable-next-line unicorn/no-array-sort -- The newly-created array is safe to sort in place.
8
+ return [...new Set(values)].sort((left, right) => left.localeCompare(right));
9
+ }
10
+ function itemTargets(catalog, itemName) {
11
+ const item = catalog.items.get(itemName);
12
+ if (!item) {
13
+ throw new CompositionValidationError("Missing registry item.", [
14
+ `${itemName} is not in the source registry`,
15
+ ]);
16
+ }
17
+ return uniqueSorted((item.files ?? []).map((file) => {
18
+ if (!file.target) {
19
+ throw new CompositionValidationError("Registry items require explicit targets.", [`${itemName}:${file.path} does not declare files[].target`]);
20
+ }
21
+ return resolveRegistryTarget(file.target);
22
+ }));
23
+ }
24
+ function itemManagedTargets(catalog, itemName) {
25
+ const item = catalog.items.get(itemName);
26
+ if (!item) {
27
+ throw new CompositionValidationError("Missing registry item.", [
28
+ `${itemName} is not in the source registry`,
29
+ ]);
30
+ }
31
+ return uniqueSorted((item.files ?? [])
32
+ .filter((file) => isManagedApplicationSource(file.path, file.target))
33
+ .map((file) => {
34
+ if (!file.target) {
35
+ throw new CompositionValidationError("Managed application files require explicit targets.", [`${itemName}:${file.path} does not declare files[].target`]);
36
+ }
37
+ return resolveRegistryTarget(file.target);
38
+ }));
39
+ }
40
+ function resolveProviders(catalog, selection) {
41
+ const providers = new Map();
42
+ const issues = [];
43
+ for (const slot of PROVIDER_SLOTS) {
44
+ const candidate = resolveCatalogSelection(catalog, selection.providers[slot]);
45
+ if (candidate.kind !== "provider" || candidate.slot !== slot) {
46
+ issues.push(`${selection.providers[slot]} is ${candidate.kind}${candidate.slot ? ` for ${candidate.slot}` : ""}, not a ${slot} provider`);
47
+ continue;
48
+ }
49
+ providers.set(slot, candidate);
50
+ }
51
+ if (issues.length > 0) {
52
+ throw new CompositionValidationError("Provider Slot cardinality is invalid.", issues);
53
+ }
54
+ return providers;
55
+ }
56
+ function resolveAddOns(catalog, references, providers) {
57
+ const selected = new Map();
58
+ const queue = references.map((reference) => resolveCatalogSelection(catalog, reference));
59
+ const selectedProviderIds = new Set(providers.map((provider) => provider.id));
60
+ const enqueueRequiredAddOns = (selection) => {
61
+ for (const requiredId of selection.compatibility.requires) {
62
+ if (selectedProviderIds.has(requiredId) || selected.has(requiredId)) {
63
+ continue;
64
+ }
65
+ const required = catalog.byId.get(requiredId);
66
+ if (required?.kind === "add-on") {
67
+ queue.push(required);
68
+ }
69
+ }
70
+ };
71
+ for (const provider of providers) {
72
+ enqueueRequiredAddOns(provider);
73
+ }
74
+ while (queue.length > 0) {
75
+ const candidate = queue.shift();
76
+ if (!candidate) {
77
+ continue;
78
+ }
79
+ if (candidate.kind !== "add-on") {
80
+ throw new CompositionValidationError("Invalid Add-on selection.", [
81
+ `${candidate.id} is ${candidate.kind}, not an add-on`,
82
+ ]);
83
+ }
84
+ if (selected.has(candidate.id)) {
85
+ continue;
86
+ }
87
+ selected.set(candidate.id, candidate);
88
+ enqueueRequiredAddOns(candidate);
89
+ }
90
+ // eslint-disable-next-line unicorn/no-array-sort -- The newly-created array is safe to sort in place.
91
+ return [...selected.values()].sort((left, right) => left.id.localeCompare(right.id));
92
+ }
93
+ function validateCompatibility(selections) {
94
+ const selectedIds = new Set(selections.map((selection) => selection.id));
95
+ const issues = [];
96
+ for (const selection of selections) {
97
+ for (const requiredId of selection.compatibility.requires) {
98
+ if (!selectedIds.has(requiredId)) {
99
+ issues.push(`${selection.id} requires ${requiredId}`);
100
+ }
101
+ }
102
+ for (const conflictingId of selection.compatibility.conflicts) {
103
+ if (selectedIds.has(conflictingId)) {
104
+ issues.push(`${selection.id} conflicts with ${conflictingId}`);
105
+ }
106
+ }
107
+ }
108
+ if (issues.length > 0) {
109
+ throw new CompositionValidationError("The requested selections are incompatible.", uniqueSorted(issues));
110
+ }
111
+ }
112
+ function validateProviderAliasRequirements(providers) {
113
+ const requiredLocations = {
114
+ auth: [
115
+ { cwd: "apps/api", section: "dependencies" },
116
+ { cwd: "apps/web", section: "dependencies" },
117
+ { cwd: "packages/feature-flags", section: "dependencies" },
118
+ ],
119
+ cms: [
120
+ { cwd: "apps/cli", section: "dependencies" },
121
+ { cwd: "apps/web", section: "dependencies" },
122
+ ],
123
+ commerce: [
124
+ { cwd: "apps/api", section: "dependencies" },
125
+ { cwd: "apps/cli", section: "dependencies" },
126
+ { cwd: "apps/web", section: "dependencies" },
127
+ ],
128
+ };
129
+ const issues = [];
130
+ for (const provider of providers) {
131
+ if (!provider.slot) {
132
+ continue;
133
+ }
134
+ const alias = PROVIDER_ALIASES[provider.slot];
135
+ const requiredClaims = new Set(requiredLocations[provider.slot].map((requirement) => `${requirement.cwd}\0${requirement.section}\0${alias}`));
136
+ const actualClaims = new Set(provider.packages.map((requirement) => `${requirement.cwd}\0${requirement.section}\0${requirement.name}`));
137
+ for (const claim of requiredClaims) {
138
+ if (!actualClaims.has(claim)) {
139
+ const [cwd, section, name] = claim.split("\0");
140
+ issues.push(`${provider.id} must declare ${cwd}/${section}.${name} for the ${provider.slot} Provider Slot`);
141
+ }
142
+ }
143
+ }
144
+ if (issues.length > 0) {
145
+ throw new CompositionValidationError("Providers do not supply all stable Provider aliases required by the Baseline.", uniqueSorted(issues));
146
+ }
147
+ }
148
+ function catalogPackageRequirements(catalog) {
149
+ const requirements = new Map();
150
+ for (const selection of catalog.selections) {
151
+ for (const requirement of selection.packages) {
152
+ const key = `${requirement.cwd}\0${requirement.section}\0${requirement.name}`;
153
+ if (!requirements.has(key)) {
154
+ requirements.set(key, requirement);
155
+ }
156
+ }
157
+ }
158
+ // eslint-disable-next-line unicorn/no-array-sort -- The newly-created array is safe to sort in place.
159
+ return [...requirements.values()].sort((left, right) => `${left.cwd}/${left.section}/${left.name}`.localeCompare(`${right.cwd}/${right.section}/${right.name}`));
160
+ }
161
+ function resolvePnpmPatches(selections) {
162
+ const patches = new Map();
163
+ const issues = [];
164
+ for (const selection of selections) {
165
+ for (const patch of selection.pnpmPatches) {
166
+ const normalized = {
167
+ ...patch,
168
+ path: resolveWorkspacePath(patch.path, `${selection.id} pnpm patch path`),
169
+ };
170
+ const existing = patches.get(normalized.dependency);
171
+ if (existing && existing.path !== normalized.path) {
172
+ issues.push(`${normalized.dependency} is patched by both ${existing.path} and ${normalized.path}`);
173
+ }
174
+ else {
175
+ patches.set(normalized.dependency, normalized);
176
+ }
177
+ }
178
+ }
179
+ if (issues.length > 0) {
180
+ throw new CompositionValidationError("pnpm patches conflict.", issues);
181
+ }
182
+ // eslint-disable-next-line unicorn/no-array-sort -- The newly-created array is safe to sort in place.
183
+ return [...patches.values()].sort((left, right) => left.dependency.localeCompare(right.dependency));
184
+ }
185
+ function catalogPnpmPatches(catalog) {
186
+ const patches = new Map();
187
+ for (const selection of catalog.selections) {
188
+ for (const patch of selection.pnpmPatches) {
189
+ const normalized = {
190
+ ...patch,
191
+ path: resolveWorkspacePath(patch.path, `${selection.id} pnpm patch path`),
192
+ };
193
+ if (!patches.has(normalized.dependency)) {
194
+ patches.set(normalized.dependency, normalized);
195
+ }
196
+ }
197
+ }
198
+ // eslint-disable-next-line unicorn/no-array-sort -- The newly-created array is safe to sort in place.
199
+ return [...patches.values()].sort((left, right) => left.dependency.localeCompare(right.dependency));
200
+ }
201
+ function catalogVariableTargets(catalog) {
202
+ return uniqueSorted([...catalog.items.values()].flatMap((item) => item.files?.map((file) => {
203
+ if (!file.target) {
204
+ throw new CompositionValidationError("Registry items require explicit targets.", [`${item.name}:${file.path} does not declare files[].target`]);
205
+ }
206
+ return resolveRegistryTarget(file.target);
207
+ }) ?? []));
208
+ }
209
+ function validateMaterializationTargets(options) {
210
+ const claims = new Map();
211
+ const issues = [];
212
+ const claim = (target, owner) => {
213
+ const existing = claims.get(target);
214
+ if (existing && existing !== owner) {
215
+ issues.push(`${target} is claimed by both ${existing} and ${owner}`);
216
+ return;
217
+ }
218
+ claims.set(target, owner);
219
+ };
220
+ for (const item of options.registryItems) {
221
+ for (const target of itemTargets(options.catalog, item)) {
222
+ claim(target, `registry item ${item}`);
223
+ }
224
+ }
225
+ for (const asset of options.assets) {
226
+ claim(asset.target, `asset ${asset.source}`);
227
+ }
228
+ if (issues.length > 0) {
229
+ throw new CompositionValidationError("Materialization targets conflict.", uniqueSorted(issues));
230
+ }
231
+ }
232
+ export function planComposition(catalog, selection) {
233
+ const providers = resolveProviders(catalog, selection);
234
+ const providerSelections = PROVIDER_SLOTS.map((slot) => {
235
+ const provider = providers.get(slot);
236
+ if (!provider) {
237
+ throw new CompositionValidationError("Provider Slot cardinality is invalid.", [`${slot} requires exactly one provider`]);
238
+ }
239
+ return provider;
240
+ });
241
+ const addOns = resolveAddOns(catalog, selection.addOns, providerSelections);
242
+ const selections = [...providerSelections, ...addOns];
243
+ validateProviderAliasRequirements(providerSelections);
244
+ validateCompatibility(selections);
245
+ const entryItems = uniqueSorted(selections.map((selected) => selected.itemName));
246
+ const registryItems = resolveRegistryItemGraph(catalog, entryItems);
247
+ const assets = selections
248
+ .flatMap((selected) => selected.assets.map((asset) => ({
249
+ source: resolveWorkspacePath(asset.source, `${selected.id} asset source`),
250
+ target: resolveWorkspacePath(asset.target, `${selected.id} asset target`),
251
+ })))
252
+ // eslint-disable-next-line unicorn/no-array-sort -- flatMap creates a fresh array.
253
+ .sort((left, right) => left.target.localeCompare(right.target));
254
+ const pnpmPatches = resolvePnpmPatches(selections);
255
+ const assetTargets = new Set(assets.map((asset) => asset.target));
256
+ const missingPatchAssets = pnpmPatches
257
+ .filter((patch) => !assetTargets.has(patch.path))
258
+ .map((patch) => `${patch.dependency} references ${patch.path}, which is not a selected asset target`);
259
+ if (missingPatchAssets.length > 0) {
260
+ throw new CompositionValidationError("pnpm patch files are missing.", missingPatchAssets);
261
+ }
262
+ validateMaterializationTargets({
263
+ assets,
264
+ catalog,
265
+ registryItems,
266
+ });
267
+ const managedTargets = uniqueSorted(registryItems.flatMap((item) => itemManagedTargets(catalog, item)));
268
+ const directlySelectedAddOnIds = new Set(selection.addOns.map((reference) => resolveCatalogSelection(catalog, reference).id));
269
+ const requiredAddOnIds = addOns
270
+ .filter((addOn) => !directlySelectedAddOnIds.has(addOn.id))
271
+ .map((addOn) => addOn.id);
272
+ return {
273
+ assets,
274
+ catalogManagedTargets: catalog.managedTargets,
275
+ catalogPackageRequirements: catalogPackageRequirements(catalog),
276
+ catalogPnpmPatches: catalogPnpmPatches(catalog),
277
+ entryItems,
278
+ instructions: [
279
+ ...new Set(selections
280
+ .map((selected) => catalog.items.get(selected.itemName)?.docs)
281
+ .filter((value) => Boolean(value))),
282
+ ],
283
+ managedTargets,
284
+ packageRequirements: mergePackageRequirements(selections),
285
+ pnpmPatches,
286
+ registryItems,
287
+ selection: {
288
+ ...selection,
289
+ addOns: uniqueSorted([...selection.addOns, ...requiredAddOnIds]),
290
+ providers: { ...selection.providers },
291
+ },
292
+ selections,
293
+ variableTargets: uniqueSorted([
294
+ ...catalogVariableTargets(catalog),
295
+ ...catalog.selections.flatMap((selected) => selected.assets.map((asset) => resolveWorkspacePath(asset.target, `${selected.id} asset target`))),
296
+ ]),
297
+ };
298
+ }
299
+ export function selectionFromPreset(catalog, reference) {
300
+ const preset = resolveCatalogSelection(catalog, reference);
301
+ if (preset.kind !== "preset" || !preset.selections?.providers) {
302
+ throw new CompositionValidationError("Invalid Preset selection.", [
303
+ `${reference} is not a complete Next Hydra preset`,
304
+ ]);
305
+ }
306
+ const { addOns, providers } = preset.selections;
307
+ if (!(providers.auth && providers.cms && providers.commerce)) {
308
+ throw new CompositionValidationError("Preset is incomplete.", [
309
+ `${preset.id} must select auth, cms, and commerce providers`,
310
+ ]);
311
+ }
312
+ return {
313
+ addOns,
314
+ providers: {
315
+ auth: providers.auth,
316
+ cms: providers.cms,
317
+ commerce: providers.commerce,
318
+ },
319
+ };
320
+ }
@@ -0,0 +1,235 @@
1
+ import { z } from "zod";
2
+ export declare const NEXT_HYDRA_SELECTION_SCHEMA_URL = "https://raw.githubusercontent.com/jakala-na/next-hydra/main/packages/create-next-hydra/schema/selection-definition.json";
3
+ export declare const selectionDefinitionSchema: z.ZodEffects<z.ZodObject<{
4
+ assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
5
+ source: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
6
+ target: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ source: string;
9
+ target: string;
10
+ }, {
11
+ source: string;
12
+ target: string;
13
+ }>, "many">>;
14
+ compatibility: z.ZodDefault<z.ZodObject<{
15
+ conflicts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
16
+ requires: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
17
+ }, "strict", z.ZodTypeAny, {
18
+ conflicts: string[];
19
+ requires: string[];
20
+ }, {
21
+ conflicts?: string[] | undefined;
22
+ requires?: string[] | undefined;
23
+ }>>;
24
+ id: z.ZodString;
25
+ kind: z.ZodEnum<["provider", "add-on", "preset"]>;
26
+ packages: z.ZodDefault<z.ZodArray<z.ZodObject<{
27
+ cwd: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
28
+ name: z.ZodString;
29
+ section: z.ZodEnum<["dependencies", "devDependencies", "optionalDependencies"]>;
30
+ specifier: z.ZodString;
31
+ }, "strict", z.ZodTypeAny, {
32
+ cwd: string;
33
+ name: string;
34
+ section: "dependencies" | "devDependencies" | "optionalDependencies";
35
+ specifier: string;
36
+ }, {
37
+ cwd: string;
38
+ name: string;
39
+ section: "dependencies" | "devDependencies" | "optionalDependencies";
40
+ specifier: string;
41
+ }>, "many">>;
42
+ pnpmPatches: z.ZodDefault<z.ZodArray<z.ZodObject<{
43
+ dependency: z.ZodString;
44
+ path: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
45
+ }, "strict", z.ZodTypeAny, {
46
+ dependency: string;
47
+ path: string;
48
+ }, {
49
+ dependency: string;
50
+ path: string;
51
+ }>, "many">>;
52
+ selections: z.ZodOptional<z.ZodObject<{
53
+ addOns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
54
+ providers: z.ZodOptional<z.ZodObject<{
55
+ auth: z.ZodOptional<z.ZodString>;
56
+ cms: z.ZodOptional<z.ZodString>;
57
+ commerce: z.ZodOptional<z.ZodString>;
58
+ }, "strict", z.ZodTypeAny, {
59
+ auth?: string | undefined;
60
+ cms?: string | undefined;
61
+ commerce?: string | undefined;
62
+ }, {
63
+ auth?: string | undefined;
64
+ cms?: string | undefined;
65
+ commerce?: string | undefined;
66
+ }>>;
67
+ }, "strict", z.ZodTypeAny, {
68
+ addOns: string[];
69
+ providers?: {
70
+ auth?: string | undefined;
71
+ cms?: string | undefined;
72
+ commerce?: string | undefined;
73
+ } | undefined;
74
+ }, {
75
+ addOns?: string[] | undefined;
76
+ providers?: {
77
+ auth?: string | undefined;
78
+ cms?: string | undefined;
79
+ commerce?: string | undefined;
80
+ } | undefined;
81
+ }>>;
82
+ slot: z.ZodOptional<z.ZodEnum<["auth", "cms", "commerce"]>>;
83
+ }, "strict", z.ZodTypeAny, {
84
+ assets: {
85
+ source: string;
86
+ target: string;
87
+ }[];
88
+ compatibility: {
89
+ conflicts: string[];
90
+ requires: string[];
91
+ };
92
+ id: string;
93
+ kind: "add-on" | "preset" | "provider";
94
+ packages: {
95
+ cwd: string;
96
+ name: string;
97
+ section: "dependencies" | "devDependencies" | "optionalDependencies";
98
+ specifier: string;
99
+ }[];
100
+ pnpmPatches: {
101
+ dependency: string;
102
+ path: string;
103
+ }[];
104
+ selections?: {
105
+ addOns: string[];
106
+ providers?: {
107
+ auth?: string | undefined;
108
+ cms?: string | undefined;
109
+ commerce?: string | undefined;
110
+ } | undefined;
111
+ } | undefined;
112
+ slot?: "auth" | "cms" | "commerce" | undefined;
113
+ }, {
114
+ assets?: {
115
+ source: string;
116
+ target: string;
117
+ }[] | undefined;
118
+ compatibility?: {
119
+ conflicts?: string[] | undefined;
120
+ requires?: string[] | undefined;
121
+ } | undefined;
122
+ id: string;
123
+ kind: "add-on" | "preset" | "provider";
124
+ packages?: {
125
+ cwd: string;
126
+ name: string;
127
+ section: "dependencies" | "devDependencies" | "optionalDependencies";
128
+ specifier: string;
129
+ }[] | undefined;
130
+ pnpmPatches?: {
131
+ dependency: string;
132
+ path: string;
133
+ }[] | undefined;
134
+ selections?: {
135
+ addOns?: string[] | undefined;
136
+ providers?: {
137
+ auth?: string | undefined;
138
+ cms?: string | undefined;
139
+ commerce?: string | undefined;
140
+ } | undefined;
141
+ } | undefined;
142
+ slot?: "auth" | "cms" | "commerce" | undefined;
143
+ }>, {
144
+ assets: {
145
+ source: string;
146
+ target: string;
147
+ }[];
148
+ compatibility: {
149
+ conflicts: string[];
150
+ requires: string[];
151
+ };
152
+ id: string;
153
+ kind: "add-on" | "preset" | "provider";
154
+ packages: {
155
+ cwd: string;
156
+ name: string;
157
+ section: "dependencies" | "devDependencies" | "optionalDependencies";
158
+ specifier: string;
159
+ }[];
160
+ pnpmPatches: {
161
+ dependency: string;
162
+ path: string;
163
+ }[];
164
+ selections?: {
165
+ addOns: string[];
166
+ providers?: {
167
+ auth?: string | undefined;
168
+ cms?: string | undefined;
169
+ commerce?: string | undefined;
170
+ } | undefined;
171
+ } | undefined;
172
+ slot?: "auth" | "cms" | "commerce" | undefined;
173
+ }, {
174
+ assets?: {
175
+ source: string;
176
+ target: string;
177
+ }[] | undefined;
178
+ compatibility?: {
179
+ conflicts?: string[] | undefined;
180
+ requires?: string[] | undefined;
181
+ } | undefined;
182
+ id: string;
183
+ kind: "add-on" | "preset" | "provider";
184
+ packages?: {
185
+ cwd: string;
186
+ name: string;
187
+ section: "dependencies" | "devDependencies" | "optionalDependencies";
188
+ specifier: string;
189
+ }[] | undefined;
190
+ pnpmPatches?: {
191
+ dependency: string;
192
+ path: string;
193
+ }[] | undefined;
194
+ selections?: {
195
+ addOns?: string[] | undefined;
196
+ providers?: {
197
+ auth?: string | undefined;
198
+ cms?: string | undefined;
199
+ commerce?: string | undefined;
200
+ } | undefined;
201
+ } | undefined;
202
+ slot?: "auth" | "cms" | "commerce" | undefined;
203
+ }>;
204
+ export declare const workspaceSelectionSchema: z.ZodObject<{
205
+ addOns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
206
+ providers: z.ZodObject<{
207
+ auth: z.ZodString;
208
+ cms: z.ZodString;
209
+ commerce: z.ZodString;
210
+ }, "strict", z.ZodTypeAny, {
211
+ auth: string;
212
+ cms: string;
213
+ commerce: string;
214
+ }, {
215
+ auth: string;
216
+ cms: string;
217
+ commerce: string;
218
+ }>;
219
+ }, "strict", z.ZodTypeAny, {
220
+ addOns: string[];
221
+ providers: {
222
+ auth: string;
223
+ cms: string;
224
+ commerce: string;
225
+ };
226
+ }, {
227
+ addOns?: string[] | undefined;
228
+ providers: {
229
+ auth: string;
230
+ cms: string;
231
+ commerce: string;
232
+ };
233
+ }>;
234
+ export declare function formatZodError(error: z.ZodError): string[];
235
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/composition/schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,+BAA+B,4HAC+E,CAAC;AAoD5H,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DlC,CAAC;AAEL,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1B,CAAC;AAEZ,wBAAgB,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,GAAG,MAAM,EAAE,CAK1D"}