@velastack/patterns 0.4.2 → 0.5.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 (130) hide show
  1. package/README.md +22 -2
  2. package/dist/chunks/{_page-e_I-fdSR.js → _page-DoPdZgZv.js} +2 -2
  3. package/dist/chunks/_page-DoPdZgZv.js.map +1 -0
  4. package/dist/chunks/collections-Cpjo2OiQ.js +203 -0
  5. package/dist/chunks/collections-Cpjo2OiQ.js.map +1 -0
  6. package/dist/chunks/dispatch-BIvOwbKN.js +6 -0
  7. package/dist/chunks/dispatch-BIvOwbKN.js.map +1 -0
  8. package/dist/chunks/{env-vars-CcE6ODqC.js → env-vars-Bj41Nccm.js} +32 -20
  9. package/dist/chunks/env-vars-Bj41Nccm.js.map +1 -0
  10. package/dist/chunks/generate-BClgUH4J.js +137 -0
  11. package/dist/chunks/generate-BClgUH4J.js.map +1 -0
  12. package/dist/chunks/{generate-CZGHByV3.js → generate-DjBMRzsB.js} +6 -6
  13. package/dist/chunks/{generate-CZGHByV3.js.map → generate-DjBMRzsB.js.map} +1 -1
  14. package/dist/chunks/{generate-DetW_gbr.js → generate-DyV5R8NP.js} +7 -7
  15. package/dist/chunks/{generate-DetW_gbr.js.map → generate-DyV5R8NP.js.map} +1 -1
  16. package/dist/chunks/generate-ZIOVLH6Q.js +72 -0
  17. package/dist/chunks/generate-ZIOVLH6Q.js.map +1 -0
  18. package/dist/chunks/{generate-Bg0E3eWm.js → generate-dNlBII84.js} +4 -4
  19. package/dist/chunks/{generate-Bg0E3eWm.js.map → generate-dNlBII84.js.map} +1 -1
  20. package/dist/chunks/{generate-CFqpRi9D.js → generate-yi8AP3xH.js} +4 -4
  21. package/dist/chunks/{generate-CFqpRi9D.js.map → generate-yi8AP3xH.js.map} +1 -1
  22. package/dist/chunks/{generate.runtime-CpMKXBkn.js → generate.runtime-B4QoBn5v.js} +6 -6
  23. package/dist/chunks/{generate.runtime-CpMKXBkn.js.map → generate.runtime-B4QoBn5v.js.map} +1 -1
  24. package/dist/chunks/{generate.runtime-aQnBmH8D.js → generate.runtime-BKINIJ2c.js} +3 -3
  25. package/dist/chunks/{generate.runtime-aQnBmH8D.js.map → generate.runtime-BKINIJ2c.js.map} +1 -1
  26. package/dist/chunks/{generate.runtime-Dl6OQ7pe.js → generate.runtime-BKTkVCEm.js} +4 -4
  27. package/dist/chunks/{generate.runtime-Dl6OQ7pe.js.map → generate.runtime-BKTkVCEm.js.map} +1 -1
  28. package/dist/chunks/{generate.runtime-CAn1qIQ_.js → generate.runtime-BXZDKLbA.js} +3 -3
  29. package/dist/chunks/{generate.runtime-CAn1qIQ_.js.map → generate.runtime-BXZDKLbA.js.map} +1 -1
  30. package/dist/chunks/{generate.runtime-hTKzxH2M.js → generate.runtime-BYfyZHhs.js} +7 -7
  31. package/dist/chunks/{generate.runtime-hTKzxH2M.js.map → generate.runtime-BYfyZHhs.js.map} +1 -1
  32. package/dist/chunks/{generate.runtime-DoZJHtZh.js → generate.runtime-BavEh01F.js} +6 -6
  33. package/dist/chunks/{generate.runtime-DoZJHtZh.js.map → generate.runtime-BavEh01F.js.map} +1 -1
  34. package/dist/chunks/{generate.runtime-DJ9MVVPC.js → generate.runtime-BcgjZJug.js} +123 -110
  35. package/dist/chunks/generate.runtime-BcgjZJug.js.map +1 -0
  36. package/dist/chunks/generate.runtime-BdHv7Jp1.js +82 -0
  37. package/dist/chunks/generate.runtime-BdHv7Jp1.js.map +1 -0
  38. package/dist/chunks/{generate.runtime-CqncBFNg.js → generate.runtime-BdmoAVJK.js} +4 -4
  39. package/dist/chunks/{generate.runtime-CqncBFNg.js.map → generate.runtime-BdmoAVJK.js.map} +1 -1
  40. package/dist/chunks/{generate.runtime-BpMN5Uq-.js → generate.runtime-Bdpu4rX0.js} +3 -3
  41. package/dist/chunks/{generate.runtime-BpMN5Uq-.js.map → generate.runtime-Bdpu4rX0.js.map} +1 -1
  42. package/dist/chunks/{generate.runtime-uLUiPgqx.js → generate.runtime-C7s1Mx5L.js} +6 -6
  43. package/dist/chunks/{generate.runtime-uLUiPgqx.js.map → generate.runtime-C7s1Mx5L.js.map} +1 -1
  44. package/dist/chunks/{generate.runtime-CEqLgLT9.js → generate.runtime-CCV4O6_I.js} +3 -3
  45. package/dist/chunks/{generate.runtime-CEqLgLT9.js.map → generate.runtime-CCV4O6_I.js.map} +1 -1
  46. package/dist/chunks/{generate.runtime-CK10Mum5.js → generate.runtime-CSUnP0l-.js} +10 -10
  47. package/dist/chunks/{generate.runtime-CK10Mum5.js.map → generate.runtime-CSUnP0l-.js.map} +1 -1
  48. package/dist/chunks/{generate.runtime-koQxLywh.js → generate.runtime-CV4soy2n.js} +6 -6
  49. package/dist/chunks/{generate.runtime-koQxLywh.js.map → generate.runtime-CV4soy2n.js.map} +1 -1
  50. package/dist/chunks/{generate.runtime-Db0HZyj3.js → generate.runtime-CWgZhxQt.js} +2 -2
  51. package/dist/chunks/{generate.runtime-Db0HZyj3.js.map → generate.runtime-CWgZhxQt.js.map} +1 -1
  52. package/dist/chunks/{generate.runtime-IWEhGhWY.js → generate.runtime-CcPCAEV0.js} +6 -6
  53. package/dist/chunks/{generate.runtime-IWEhGhWY.js.map → generate.runtime-CcPCAEV0.js.map} +1 -1
  54. package/dist/chunks/{generate.runtime-DG2z6kqH.js → generate.runtime-D-qtaVdq.js} +3 -3
  55. package/dist/chunks/{generate.runtime-DG2z6kqH.js.map → generate.runtime-D-qtaVdq.js.map} +1 -1
  56. package/dist/chunks/{generate.runtime-E-zoeSKW.js → generate.runtime-DBBtYTAa.js} +7 -7
  57. package/dist/chunks/{generate.runtime-E-zoeSKW.js.map → generate.runtime-DBBtYTAa.js.map} +1 -1
  58. package/dist/chunks/{generate.runtime-5rIc-RNL.js → generate.runtime-DRRyPa-e.js} +6 -6
  59. package/dist/chunks/{generate.runtime-5rIc-RNL.js.map → generate.runtime-DRRyPa-e.js.map} +1 -1
  60. package/dist/chunks/{generate.runtime-BK3mR0Rj.js → generate.runtime-DaRVyiSg.js} +148 -127
  61. package/dist/chunks/generate.runtime-DaRVyiSg.js.map +1 -0
  62. package/dist/chunks/{generate.runtime-DVB7uuht.js → generate.runtime-DetYynf4.js} +3 -3
  63. package/dist/chunks/{generate.runtime-DVB7uuht.js.map → generate.runtime-DetYynf4.js.map} +1 -1
  64. package/dist/chunks/{generate.runtime-a3R4hqFy.js → generate.runtime-DjCzW3zU.js} +12 -12
  65. package/dist/chunks/{generate.runtime-a3R4hqFy.js.map → generate.runtime-DjCzW3zU.js.map} +1 -1
  66. package/dist/chunks/{generate.runtime-Djas9UNy.js → generate.runtime-DlbG-8Xm.js} +4 -4
  67. package/dist/chunks/{generate.runtime-Djas9UNy.js.map → generate.runtime-DlbG-8Xm.js.map} +1 -1
  68. package/dist/chunks/{generate.runtime-CbE9RHcf.js → generate.runtime-DmsOEsJV.js} +5 -5
  69. package/dist/chunks/generate.runtime-DmsOEsJV.js.map +1 -0
  70. package/dist/chunks/{generate.runtime-axm9wcQv.js → generate.runtime-MjWwR2Bd.js} +3 -3
  71. package/dist/chunks/{generate.runtime-axm9wcQv.js.map → generate.runtime-MjWwR2Bd.js.map} +1 -1
  72. package/dist/chunks/generate.runtime-NaSIZlP5.js +48 -0
  73. package/dist/chunks/generate.runtime-NaSIZlP5.js.map +1 -0
  74. package/dist/chunks/{generate.runtime-CZ46nkSL.js → generate.runtime-OEgsdWRP.js} +2 -2
  75. package/dist/chunks/{generate.runtime-CZ46nkSL.js.map → generate.runtime-OEgsdWRP.js.map} +1 -1
  76. package/dist/chunks/{generate.runtime-rs1ZOIET.js → generate.runtime-QbmCPT42.js} +3 -3
  77. package/dist/chunks/{generate.runtime-rs1ZOIET.js.map → generate.runtime-QbmCPT42.js.map} +1 -1
  78. package/dist/chunks/generate.runtime-azOvp6tl.js +106 -0
  79. package/dist/chunks/generate.runtime-azOvp6tl.js.map +1 -0
  80. package/dist/chunks/{generate.runtime-kciwaXxh.js → generate.runtime-b2RtuPy4.js} +4 -4
  81. package/dist/chunks/{generate.runtime-kciwaXxh.js.map → generate.runtime-b2RtuPy4.js.map} +1 -1
  82. package/dist/chunks/{generate.runtime-Dp7SsCQG.js → generate.runtime-pMpn0Pbf.js} +3 -3
  83. package/dist/chunks/{generate.runtime-Dp7SsCQG.js.map → generate.runtime-pMpn0Pbf.js.map} +1 -1
  84. package/dist/chunks/{generate.runtime-DHHlYfTD.js → generate.runtime-utFLS6Jz.js} +3 -3
  85. package/dist/chunks/{generate.runtime-DHHlYfTD.js.map → generate.runtime-utFLS6Jz.js.map} +1 -1
  86. package/dist/chunks/modify-file-Bbhyfiy_.js +53 -0
  87. package/dist/chunks/modify-file-Bbhyfiy_.js.map +1 -0
  88. package/dist/chunks/{modify-nav-user-BLyrW2sK.js → modify-nav-user-B8h8WTrM.js} +2 -2
  89. package/dist/chunks/{modify-nav-user-BLyrW2sK.js.map → modify-nav-user-B8h8WTrM.js.map} +1 -1
  90. package/dist/chunks/providers-CL9kQ4hp.js +98 -0
  91. package/dist/chunks/providers-CL9kQ4hp.js.map +1 -0
  92. package/dist/chunks/providers-DwbwccSW.js +38 -0
  93. package/dist/chunks/providers-DwbwccSW.js.map +1 -0
  94. package/dist/chunks/{shared-Cc_ns5-y.js → shared-D5GOS97l.js} +2 -2
  95. package/dist/chunks/{shared-Cc_ns5-y.js.map → shared-D5GOS97l.js.map} +1 -1
  96. package/dist/chunks/shopify-page-D-VFwGxI.js +11 -0
  97. package/dist/chunks/shopify-page-D-VFwGxI.js.map +1 -0
  98. package/dist/chunks/stripe-customer-B3tP8gtD.js +6 -0
  99. package/dist/chunks/stripe-customer-B3tP8gtD.js.map +1 -0
  100. package/dist/chunks/{svelte-file-B3RfgVdt.js → svelte-file-Dv5-bl79.js} +37 -2
  101. package/dist/chunks/svelte-file-Dv5-bl79.js.map +1 -0
  102. package/dist/chunks/{test-setup-B9fQ5L_-.js → test-setup-DZoyF8Ak.js} +2 -2
  103. package/dist/chunks/{test-setup-B9fQ5L_-.js.map → test-setup-DZoyF8Ak.js.map} +1 -1
  104. package/dist/chunks/{ui-CuCsupFq.js → ui-BuocThuh.js} +2 -2
  105. package/dist/chunks/{ui-CuCsupFq.js.map → ui-BuocThuh.js.map} +1 -1
  106. package/dist/chunks/{write-result-DiZsCS_y.js → write-result-Cq-9A7Zy.js} +2 -2
  107. package/dist/chunks/write-result-Cq-9A7Zy.js.map +1 -0
  108. package/dist/index.d.ts +284 -22
  109. package/dist/index.js +2199 -2035
  110. package/dist/index.js.map +1 -1
  111. package/package.json +1 -1
  112. package/dist/chunks/_page-e_I-fdSR.js.map +0 -1
  113. package/dist/chunks/collections-zzZ_HQxB.js +0 -192
  114. package/dist/chunks/collections-zzZ_HQxB.js.map +0 -1
  115. package/dist/chunks/dispatch-D4TN9pdW.js +0 -6
  116. package/dist/chunks/dispatch-D4TN9pdW.js.map +0 -1
  117. package/dist/chunks/env-vars-CcE6ODqC.js.map +0 -1
  118. package/dist/chunks/env-vars-De0Xs0L2.js +0 -20
  119. package/dist/chunks/env-vars-De0Xs0L2.js.map +0 -1
  120. package/dist/chunks/generate.runtime-BK3mR0Rj.js.map +0 -1
  121. package/dist/chunks/generate.runtime-CbE9RHcf.js.map +0 -1
  122. package/dist/chunks/generate.runtime-DJ9MVVPC.js.map +0 -1
  123. package/dist/chunks/generate.runtime-EQnytCFL.js +0 -122
  124. package/dist/chunks/generate.runtime-EQnytCFL.js.map +0 -1
  125. package/dist/chunks/modify-file-DK-tCH9k.js +0 -46
  126. package/dist/chunks/modify-file-DK-tCH9k.js.map +0 -1
  127. package/dist/chunks/providers-BHR6-XZ7.js +0 -76
  128. package/dist/chunks/providers-BHR6-XZ7.js.map +0 -1
  129. package/dist/chunks/svelte-file-B3RfgVdt.js.map +0 -1
  130. package/dist/chunks/write-result-DiZsCS_y.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare interface ApplyThemeOptions {
31
31
  theme: string;
32
32
  }
33
33
 
34
- export declare const byCategory: Record<"auth" | "content" | "generators" | "ai" | "analytics" | "api" | "backend" | "i18n" | "payments", ({
34
+ export declare const byCategory: Record<"auth" | "content" | "api" | "backend" | "i18n" | "payments" | "generators" | "ai" | "analytics", ({
35
35
  version: string;
36
36
  slug: "generate-form";
37
37
  source: string;
@@ -481,7 +481,7 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
481
481
  summary: string;
482
482
  requires: {
483
483
  auth: true;
484
- api: true;
484
+ api: false;
485
485
  apiKeys: false;
486
486
  backend: true;
487
487
  i18n: false;
@@ -706,14 +706,49 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
706
706
  auth: false;
707
707
  api: false;
708
708
  apiKeys: false;
709
- backend: true;
709
+ backend: false;
710
710
  i18n: false;
711
711
  teams: false;
712
712
  payments: false;
713
713
  blog: false;
714
714
  contentNegotiation: false;
715
715
  cms: false;
716
- workflows: true;
716
+ ui: "shadcn";
717
+ };
718
+ category: "payments";
719
+ tags: string[];
720
+ command: {
721
+ raw: string;
722
+ base: string;
723
+ argv: never[];
724
+ };
725
+ examples: {
726
+ command: string;
727
+ description: string;
728
+ }[];
729
+ tests: number;
730
+ baseline: "velastack";
731
+ providers: Provider[];
732
+ generate: typeof generate;
733
+ } | {
734
+ version: string;
735
+ slug: "enable-ecommerce";
736
+ source: string;
737
+ docs: string;
738
+ plan: "pro";
739
+ title: string;
740
+ summary: string;
741
+ requires: {
742
+ auth: false;
743
+ api: false;
744
+ apiKeys: false;
745
+ backend: false;
746
+ i18n: false;
747
+ teams: false;
748
+ payments: true;
749
+ blog: false;
750
+ contentNegotiation: false;
751
+ cms: false;
717
752
  ui: "shadcn";
718
753
  };
719
754
  category: "payments";
@@ -726,6 +761,8 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
726
761
  examples: never[];
727
762
  tests: number;
728
763
  baseline: "velastack";
764
+ providers: Provider[];
765
+ inheritsProvider: string;
729
766
  generate: typeof generate;
730
767
  } | {
731
768
  version: string;
@@ -748,6 +785,9 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
748
785
  cms: false;
749
786
  workflows: true;
750
787
  ui: "shadcn";
788
+ providers: {
789
+ payments: string[];
790
+ };
751
791
  };
752
792
  category: "payments";
753
793
  tags: string[];
@@ -1093,8 +1133,8 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1093
1133
  title: string;
1094
1134
  summary: string;
1095
1135
  requires: {
1096
- auth: true;
1097
- api: true;
1136
+ auth: false;
1137
+ api: false;
1098
1138
  apiKeys: true;
1099
1139
  backend: true;
1100
1140
  i18n: false;
@@ -1248,7 +1288,7 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1248
1288
  title: string;
1249
1289
  summary: string;
1250
1290
  requires: {
1251
- auth: true;
1291
+ auth: false;
1252
1292
  api: false;
1253
1293
  apiKeys: false;
1254
1294
  backend: true;
@@ -1279,7 +1319,7 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1279
1319
  title: string;
1280
1320
  summary: string;
1281
1321
  requires: {
1282
- auth: true;
1322
+ auth: false;
1283
1323
  api: false;
1284
1324
  apiKeys: false;
1285
1325
  backend: true;
@@ -1313,7 +1353,7 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1313
1353
  auth: false;
1314
1354
  api: false;
1315
1355
  apiKeys: false;
1316
- backend: true;
1356
+ backend: false;
1317
1357
  i18n: false;
1318
1358
  teams: false;
1319
1359
  payments: true;
@@ -1332,6 +1372,37 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1332
1372
  tests: number;
1333
1373
  baseline: "velastack";
1334
1374
  generate: typeof generate;
1375
+ } | {
1376
+ version: string;
1377
+ slug: "disable-ecommerce";
1378
+ source: string;
1379
+ docs: string;
1380
+ plan: "pro";
1381
+ title: string;
1382
+ summary: string;
1383
+ requires: {
1384
+ auth: false;
1385
+ api: false;
1386
+ apiKeys: false;
1387
+ backend: false;
1388
+ i18n: false;
1389
+ teams: false;
1390
+ payments: false;
1391
+ blog: false;
1392
+ contentNegotiation: false;
1393
+ cms: false;
1394
+ };
1395
+ category: "payments";
1396
+ tags: string[];
1397
+ command: {
1398
+ raw: string;
1399
+ base: string;
1400
+ argv: never[];
1401
+ };
1402
+ examples: never[];
1403
+ tests: number;
1404
+ baseline: "velastack";
1405
+ generate: typeof generate;
1335
1406
  } | {
1336
1407
  version: string;
1337
1408
  slug: "disable-subscriptions";
@@ -1341,7 +1412,7 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1341
1412
  title: string;
1342
1413
  summary: string;
1343
1414
  requires: {
1344
- auth: true;
1415
+ auth: false;
1345
1416
  api: false;
1346
1417
  apiKeys: false;
1347
1418
  backend: true;
@@ -1351,6 +1422,9 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1351
1422
  blog: false;
1352
1423
  contentNegotiation: false;
1353
1424
  cms: false;
1425
+ providers: {
1426
+ payments: string[];
1427
+ };
1354
1428
  };
1355
1429
  category: "payments";
1356
1430
  tags: string[];
@@ -1398,6 +1472,9 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "ai"
1398
1472
 
1399
1473
  export declare const bySlug: Record<Slug, PatternEntry>;
1400
1474
 
1475
+ /** `analytics` for `enable-analytics`: how the capability is named to users. */
1476
+ export declare function capabilityName(slug: string): string;
1477
+
1401
1478
  export declare type Category = PatternEntry["category"];
1402
1479
 
1403
1480
  declare interface Collection {
@@ -1462,6 +1539,24 @@ declare interface CollectionSpec {
1462
1539
 
1463
1540
  export declare type Component = string;
1464
1541
 
1542
+ /** The providers `detectProviders` found in a project, by capability. */
1543
+ export declare interface DetectedProviders {
1544
+ /** `{ payments: "stripe", analytics: "plausible" }` */
1545
+ providers: Record<string, string>;
1546
+ /** Capabilities where more than one provider's markers are present. */
1547
+ ambiguous: {
1548
+ capability: string;
1549
+ ids: string[];
1550
+ }[];
1551
+ }
1552
+
1553
+ /**
1554
+ * The provider in use for each capability (`{ payments: "stripe" }`), read
1555
+ * from what each registered provider leaves in the project. Node-only, loaded
1556
+ * on first call like `installComponents`.
1557
+ */
1558
+ export declare function detectProviders(root: string): Promise<DetectedProviders>;
1559
+
1465
1560
  /** Add missing package.json `imports` entries; never overwrites a different value. */
1466
1561
  export declare function ensurePackageImports(root: string, entries: Record<string, string>): Promise<PackageJsonEditResult>;
1467
1562
 
@@ -1793,6 +1888,12 @@ export declare interface Options {
1793
1888
  * the chosen provider's `env` keys, written to `.env` by the pattern.
1794
1889
  */
1795
1890
  input: Record<string, any>;
1891
+ /**
1892
+ * The provider in use per capability (`{ payments: "stripe" }`), as
1893
+ * `detectProviders` reads it from the project. Detected by the caller;
1894
+ * absent in preview and in callers that predate it.
1895
+ */
1896
+ providers?: Partial<Record<string, string>>;
1796
1897
  logger?: Logger;
1797
1898
  }
1798
1899
 
@@ -1828,9 +1929,10 @@ export declare interface Pattern {
1828
1929
  source: string;
1829
1930
  plan: "open" | "pro" | "agency";
1830
1931
  title: string;
1932
+ /** The pattern's docs page as a path under velastack.dev/docs, e.g. `/enable/auth`. */
1831
1933
  docs: string;
1832
1934
  summary: string;
1833
- requires: Features;
1935
+ requires: Requires;
1834
1936
  category: string;
1835
1937
  tags: string[];
1836
1938
  command: {
@@ -1843,6 +1945,7 @@ export declare interface Pattern {
1843
1945
  baseline: "sv" | "velastack" | "velastack-auth";
1844
1946
  variants?: string[];
1845
1947
  providers?: Provider[];
1948
+ inheritsProvider?: string;
1846
1949
  generate: (options: Options) => Promise<Result>;
1847
1950
  }
1848
1951
 
@@ -2298,7 +2401,7 @@ export declare const patterns: ({
2298
2401
  summary: string;
2299
2402
  requires: {
2300
2403
  auth: true;
2301
- api: true;
2404
+ api: false;
2302
2405
  apiKeys: false;
2303
2406
  backend: true;
2304
2407
  i18n: false;
@@ -2523,14 +2626,49 @@ export declare const patterns: ({
2523
2626
  auth: false;
2524
2627
  api: false;
2525
2628
  apiKeys: false;
2526
- backend: true;
2629
+ backend: false;
2527
2630
  i18n: false;
2528
2631
  teams: false;
2529
2632
  payments: false;
2530
2633
  blog: false;
2531
2634
  contentNegotiation: false;
2532
2635
  cms: false;
2533
- workflows: true;
2636
+ ui: "shadcn";
2637
+ };
2638
+ category: "payments";
2639
+ tags: string[];
2640
+ command: {
2641
+ raw: string;
2642
+ base: string;
2643
+ argv: never[];
2644
+ };
2645
+ examples: {
2646
+ command: string;
2647
+ description: string;
2648
+ }[];
2649
+ tests: number;
2650
+ baseline: "velastack";
2651
+ providers: Provider[];
2652
+ generate: typeof generate;
2653
+ } | {
2654
+ version: string;
2655
+ slug: "enable-ecommerce";
2656
+ source: string;
2657
+ docs: string;
2658
+ plan: "pro";
2659
+ title: string;
2660
+ summary: string;
2661
+ requires: {
2662
+ auth: false;
2663
+ api: false;
2664
+ apiKeys: false;
2665
+ backend: false;
2666
+ i18n: false;
2667
+ teams: false;
2668
+ payments: true;
2669
+ blog: false;
2670
+ contentNegotiation: false;
2671
+ cms: false;
2534
2672
  ui: "shadcn";
2535
2673
  };
2536
2674
  category: "payments";
@@ -2543,6 +2681,8 @@ export declare const patterns: ({
2543
2681
  examples: never[];
2544
2682
  tests: number;
2545
2683
  baseline: "velastack";
2684
+ providers: Provider[];
2685
+ inheritsProvider: string;
2546
2686
  generate: typeof generate;
2547
2687
  } | {
2548
2688
  version: string;
@@ -2565,6 +2705,9 @@ export declare const patterns: ({
2565
2705
  cms: false;
2566
2706
  workflows: true;
2567
2707
  ui: "shadcn";
2708
+ providers: {
2709
+ payments: string[];
2710
+ };
2568
2711
  };
2569
2712
  category: "payments";
2570
2713
  tags: string[];
@@ -2910,8 +3053,8 @@ export declare const patterns: ({
2910
3053
  title: string;
2911
3054
  summary: string;
2912
3055
  requires: {
2913
- auth: true;
2914
- api: true;
3056
+ auth: false;
3057
+ api: false;
2915
3058
  apiKeys: true;
2916
3059
  backend: true;
2917
3060
  i18n: false;
@@ -3065,7 +3208,7 @@ export declare const patterns: ({
3065
3208
  title: string;
3066
3209
  summary: string;
3067
3210
  requires: {
3068
- auth: true;
3211
+ auth: false;
3069
3212
  api: false;
3070
3213
  apiKeys: false;
3071
3214
  backend: true;
@@ -3096,7 +3239,7 @@ export declare const patterns: ({
3096
3239
  title: string;
3097
3240
  summary: string;
3098
3241
  requires: {
3099
- auth: true;
3242
+ auth: false;
3100
3243
  api: false;
3101
3244
  apiKeys: false;
3102
3245
  backend: true;
@@ -3130,7 +3273,7 @@ export declare const patterns: ({
3130
3273
  auth: false;
3131
3274
  api: false;
3132
3275
  apiKeys: false;
3133
- backend: true;
3276
+ backend: false;
3134
3277
  i18n: false;
3135
3278
  teams: false;
3136
3279
  payments: true;
@@ -3149,6 +3292,37 @@ export declare const patterns: ({
3149
3292
  tests: number;
3150
3293
  baseline: "velastack";
3151
3294
  generate: typeof generate;
3295
+ } | {
3296
+ version: string;
3297
+ slug: "disable-ecommerce";
3298
+ source: string;
3299
+ docs: string;
3300
+ plan: "pro";
3301
+ title: string;
3302
+ summary: string;
3303
+ requires: {
3304
+ auth: false;
3305
+ api: false;
3306
+ apiKeys: false;
3307
+ backend: false;
3308
+ i18n: false;
3309
+ teams: false;
3310
+ payments: false;
3311
+ blog: false;
3312
+ contentNegotiation: false;
3313
+ cms: false;
3314
+ };
3315
+ category: "payments";
3316
+ tags: string[];
3317
+ command: {
3318
+ raw: string;
3319
+ base: string;
3320
+ argv: never[];
3321
+ };
3322
+ examples: never[];
3323
+ tests: number;
3324
+ baseline: "velastack";
3325
+ generate: typeof generate;
3152
3326
  } | {
3153
3327
  version: string;
3154
3328
  slug: "disable-subscriptions";
@@ -3158,7 +3332,7 @@ export declare const patterns: ({
3158
3332
  title: string;
3159
3333
  summary: string;
3160
3334
  requires: {
3161
- auth: true;
3335
+ auth: false;
3162
3336
  api: false;
3163
3337
  apiKeys: false;
3164
3338
  backend: true;
@@ -3168,6 +3342,9 @@ export declare const patterns: ({
3168
3342
  blog: false;
3169
3343
  contentNegotiation: false;
3170
3344
  cms: false;
3345
+ providers: {
3346
+ payments: string[];
3347
+ };
3171
3348
  };
3172
3349
  category: "payments";
3173
3350
  tags: string[];
@@ -3222,6 +3399,13 @@ export declare interface Provider {
3222
3399
  id: string;
3223
3400
  label: string;
3224
3401
  env?: ProviderEnvVar[];
3402
+ /**
3403
+ * Any one present means this provider is in use. Defaults to the first
3404
+ * `env` key's declaration in `src/env.ts`.
3405
+ */
3406
+ markers?: ProviderMarker[];
3407
+ /** Prerequisites when this provider is chosen, on top of the pattern's own. */
3408
+ requires?: Partial<Requires>;
3225
3409
  }
3226
3410
 
3227
3411
  /** One `.env` key a provider needs; the CLI prompts for it and the pattern writes it. */
@@ -3230,6 +3414,8 @@ export declare interface ProviderEnvVar {
3230
3414
  key: string;
3231
3415
  /** Prompt label shown by the CLI. */
3232
3416
  label: string;
3417
+ /** What `src/env.ts` says the variable is for; the label when absent. */
3418
+ description?: string;
3233
3419
  /** Prompt hint only; never written to `.env`. */
3234
3420
  placeholder?: string;
3235
3421
  /** Written to `.env` when the user supplies nothing. */
@@ -3245,6 +3431,11 @@ export declare interface ProviderEnvVar {
3245
3431
  * not by a `PUBLIC_` prefix.
3246
3432
  */
3247
3433
  public?: boolean;
3434
+ /**
3435
+ * The CLI refuses a blank value for it. The pattern still writes whatever
3436
+ * it is handed.
3437
+ */
3438
+ required?: boolean;
3248
3439
  }
3249
3440
 
3250
3441
  /**
@@ -3256,7 +3447,27 @@ export declare function providerEnvVars(provider: Provider): EnvVarSpec[];
3256
3447
  /** `--provider <id>` or `--provider=<id>`, for callers that hand flags through in argv. */
3257
3448
  export declare function providerFromArgv(argv: string[]): string | undefined;
3258
3449
 
3259
- declare type ProviderPattern = Pick<Pattern, "slug" | "providers">;
3450
+ /**
3451
+ * Something only one provider leaves in a project, so the provider in use can
3452
+ * be read back from disk instead of being recorded anywhere: a name declared
3453
+ * in `src/env.ts`, an app-relative path, or a `package.json` dependency.
3454
+ */
3455
+ export declare type ProviderMarker = {
3456
+ env: string;
3457
+ } | {
3458
+ path: string;
3459
+ } | {
3460
+ dependency: string;
3461
+ };
3462
+
3463
+ /**
3464
+ * What `detectProviders` looks for: the declared markers, else the first env
3465
+ * key's declaration in `src/env.ts`. Empty for a provider with neither, which
3466
+ * can't be detected.
3467
+ */
3468
+ export declare function providerMarkers(provider: Provider): ProviderMarker[];
3469
+
3470
+ declare type ProviderPattern = Pick<Pattern, "slug" | "providers" | "inheritsProvider">;
3260
3471
 
3261
3472
  /** One entry of a style's registry index (`/registry/styles/<style>/index.json`). */
3262
3473
  export declare interface RegistryItem {
@@ -3282,6 +3493,24 @@ export declare class RegistryUnavailableError extends Error {
3282
3493
  */
3283
3494
  export declare function removePackageImports(root: string, keys: string[], expected?: Record<string, string>): Promise<PackageJsonEditResult>;
3284
3495
 
3496
+ export declare interface RequirementsContext {
3497
+ features: Features;
3498
+ detected: DetectedProviders;
3499
+ /** The provider chosen for this run, when the caller already knows it. */
3500
+ provider?: string;
3501
+ }
3502
+
3503
+ /**
3504
+ * What a pattern needs before it can run. A `true` feature is required;
3505
+ * `false` only means "not required". `providers` narrows a capability to the
3506
+ * providers the pattern supports: `{ payments: ["stripe"] }`.
3507
+ */
3508
+ export declare interface Requires extends Features {
3509
+ providers?: Partial<Record<string, string[]>>;
3510
+ }
3511
+
3512
+ declare type RequiresPattern = Pick<Pattern, "requires" | "providers" | "inheritsProvider">;
3513
+
3285
3514
  /**
3286
3515
  * The provider a generate call should produce, from `input.provider` or
3287
3516
  * `--provider` in argv.
@@ -3290,8 +3519,11 @@ export declare function removePackageImports(root: string, keys: string[], expec
3290
3519
  * all, a runtime call is rejected too: the CLI always supplies one, so this
3291
3520
  * is a caller bug. A preview call falls back to the first declared provider,
3292
3521
  * because the website loads patterns with argv only.
3522
+ *
3523
+ * A pattern with `inheritsProvider` takes the provider detected for that
3524
+ * capability instead; see `resolveInheritedProvider`.
3293
3525
  */
3294
- export declare function resolveProvider(pattern: ProviderPattern, options: Pick<Options, "input" | "argv" | "env">): Provider;
3526
+ export declare function resolveProvider(pattern: ProviderPattern, options: Pick<Options, "input" | "argv" | "env" | "providers">): Provider;
3295
3527
 
3296
3528
  declare interface Result {
3297
3529
  creates: File_2[];
@@ -3373,6 +3605,36 @@ export declare interface SwitchStyleResult {
3373
3605
 
3374
3606
  export declare function unknownProviderMessage(name: string, raw: string, providers: Provider[]): string;
3375
3607
 
3608
+ /** One prerequisite a project is missing for a pattern. */
3609
+ export declare type Unmet = {
3610
+ kind: "feature";
3611
+ feature: keyof Features;
3612
+ } | {
3613
+ kind: "provider";
3614
+ capability: string;
3615
+ /** Provider ids that would satisfy the pattern. */
3616
+ want: string[];
3617
+ /** What the project has, `null` for none. */
3618
+ have: string | null;
3619
+ } | {
3620
+ kind: "ambiguous";
3621
+ capability: string;
3622
+ ids: string[];
3623
+ };
3624
+
3625
+ /**
3626
+ * What `pattern` needs that the project doesn't have, in a stable order:
3627
+ * missing features, then providers, then ambiguous detections. Empty means
3628
+ * the pattern can run.
3629
+ *
3630
+ * Only `true` flags are requirements. `false` means "not required", never
3631
+ * "must be absent", and `ui` is left to its own check, since it is a value
3632
+ * rather than a flag. The chosen provider's own `requires` is added to the
3633
+ * pattern's; for a pattern with `inheritsProvider`, the chosen provider is the
3634
+ * detected one.
3635
+ */
3636
+ export declare function unmetRequirements(pattern: RequiresPattern, context: RequirementsContext): Unmet[];
3637
+
3376
3638
  /**
3377
3639
  * Remove the declarations of `names` from `src/env.ts`. `deleted` means only
3378
3640
  * the import and an empty `variables` are left (the emptied file is saved;