@vendure-platform/create 0.1.0 → 0.2.1-nightly.202605190703

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 (97) hide show
  1. package/README.md +37 -27
  2. package/dist/assets/storefront/.env.example +14 -14
  3. package/dist/assets/storefront/messages/de.json +2 -3
  4. package/dist/assets/storefront/messages/en.json +2 -3
  5. package/dist/assets/storefront/next.config.ts +22 -21
  6. package/dist/assets/storefront/package.json +75 -75
  7. package/dist/assets/storefront/public/scenarios/customer/logo.svg +4 -0
  8. package/dist/assets/storefront/src/app/[locale]/layout.tsx +0 -4
  9. package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +70 -102
  10. package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +2 -3
  11. package/dist/assets/storefront/src/config/scenario-meta.ts +3 -7
  12. package/dist/assets/storefront/src/config/scenario.ts +14 -30
  13. package/dist/assets/storefront/src/graphql-env.d.ts +456 -0
  14. package/dist/assets/storefront/src/scenarios/customer/branding.ts +142 -0
  15. package/dist/assets/storefront/src/scenarios/customer/hero.tsx +76 -0
  16. package/dist/assets/storefront/src/scenarios/{default → customer}/index.ts +3 -3
  17. package/dist/assets/storefront/src/scenarios/{default → customer}/meta.ts +1 -1
  18. package/dist/assets/storefront/src/schema.graphql +5852 -0
  19. package/dist/assets/storefront/tsconfig.json +17 -8
  20. package/dist/assets/templates/README.md.hbs +1 -1
  21. package/dist/assets/templates/docker-compose.yml.hbs +0 -4
  22. package/dist/assets/templates/env.hbs +13 -7
  23. package/dist/assets/templates/environment.d.ts.hbs +1 -5
  24. package/dist/assets/templates/npmrc.hbs +1 -1
  25. package/dist/assets/templates/populate.ts.hbs +17 -0
  26. package/dist/assets/templates/server-package.json.hbs +3 -2
  27. package/dist/bin/run.js +17 -3
  28. package/dist/bin/run.js.map +1 -1
  29. package/dist/cli.d.ts +6 -1
  30. package/dist/cli.js +147 -25
  31. package/dist/cli.js.map +1 -1
  32. package/dist/index.d.ts +5 -3
  33. package/dist/index.js +9 -3
  34. package/dist/index.js.map +1 -1
  35. package/dist/plugin-registry.d.ts +43 -6
  36. package/dist/plugin-registry.js +139 -421
  37. package/dist/plugin-registry.js.map +1 -1
  38. package/dist/registry.d.ts +18 -0
  39. package/dist/registry.js +29 -0
  40. package/dist/registry.js.map +1 -0
  41. package/dist/scaffold-shared.d.ts +19 -0
  42. package/dist/scaffold-shared.js +114 -0
  43. package/dist/scaffold-shared.js.map +1 -0
  44. package/dist/scaffold-storefront-only.d.ts +6 -0
  45. package/dist/scaffold-storefront-only.js +101 -0
  46. package/dist/scaffold-storefront-only.js.map +1 -0
  47. package/dist/scaffolder.js +22 -42
  48. package/dist/scaffolder.js.map +1 -1
  49. package/dist/storefront-copier.d.ts +26 -3
  50. package/dist/storefront-copier.js +63 -12
  51. package/dist/storefront-copier.js.map +1 -1
  52. package/dist/template-renderer.d.ts +24 -7
  53. package/dist/template-renderer.js +32 -64
  54. package/dist/template-renderer.js.map +1 -1
  55. package/dist/types.d.ts +46 -27
  56. package/package.json +3 -1
  57. package/dist/assets/storefront/.env.local +0 -1
  58. package/dist/assets/storefront/public/scenarios/b2b-wholesale/hero/hero-bg.webp +0 -0
  59. package/dist/assets/storefront/public/scenarios/b2b-wholesale/logo.svg +0 -4
  60. package/dist/assets/storefront/public/scenarios/default/logo.svg +0 -4
  61. package/dist/assets/storefront/public/scenarios/kaminpro/hero/hero-bg.webp +0 -0
  62. package/dist/assets/storefront/public/scenarios/kaminpro/logo.svg +0 -7
  63. package/dist/assets/storefront/src/components/shared/scenario-paused.tsx +0 -80
  64. package/dist/assets/storefront/src/scenarios/b2b-wholesale/branding.ts +0 -180
  65. package/dist/assets/storefront/src/scenarios/b2b-wholesale/hero.tsx +0 -122
  66. package/dist/assets/storefront/src/scenarios/b2b-wholesale/index.ts +0 -21
  67. package/dist/assets/storefront/src/scenarios/b2b-wholesale/meta.ts +0 -3
  68. package/dist/assets/storefront/src/scenarios/default/branding.ts +0 -148
  69. package/dist/assets/storefront/src/scenarios/default/hero.tsx +0 -107
  70. package/dist/assets/storefront/src/scenarios/kaminpro/auth-gate.tsx +0 -36
  71. package/dist/assets/storefront/src/scenarios/kaminpro/branding.ts +0 -238
  72. package/dist/assets/storefront/src/scenarios/kaminpro/cart-items.tsx +0 -359
  73. package/dist/assets/storefront/src/scenarios/kaminpro/hero.tsx +0 -123
  74. package/dist/assets/storefront/src/scenarios/kaminpro/index.ts +0 -50
  75. package/dist/assets/storefront/src/scenarios/kaminpro/meta.ts +0 -9
  76. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/banners.tsx +0 -21
  77. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/bom-basket.tsx +0 -221
  78. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/btn.tsx +0 -38
  79. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/chip.tsx +0 -35
  80. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/config-header.tsx +0 -72
  81. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/field-row.tsx +0 -126
  82. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/info-dot.tsx +0 -38
  83. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/login-notice.tsx +0 -81
  84. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/module-panel.tsx +0 -144
  85. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/quote-dialog.tsx +0 -110
  86. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/schematic.tsx +0 -674
  87. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/why-panel.tsx +0 -66
  88. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-pdp.tsx +0 -43
  89. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-shell.tsx +0 -320
  90. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/data.ts +0 -150
  91. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/types.ts +0 -30
  92. package/dist/assets/storefront/src/scenarios/kaminpro/pdp/styles.css +0 -104
  93. package/dist/assets/storefront/src/scenarios/kaminpro/shop-by-system.tsx +0 -97
  94. package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/decision-tree.ts +0 -261
  95. package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/page.tsx +0 -21
  96. package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/wizard.tsx +0 -600
  97. package/dist/assets/storefront/src/schema.graphql.placeholder +0 -5
@@ -1,7 +1,5 @@
1
1
  import type {Locale} from '@/i18n/locales';
2
- import {defaultMeta} from '@/scenarios/default/meta';
3
- import {bauDirektMeta} from '@/scenarios/b2b-wholesale/meta';
4
- import {kaminProMeta} from '@/scenarios/kaminpro/meta';
2
+ import {customerMeta} from '@/scenarios/customer/meta';
5
3
 
6
4
  /**
7
5
  * Client-safe scenario metadata.
@@ -28,9 +26,7 @@ export interface ScenarioMeta {
28
26
  }
29
27
 
30
28
  const META: Record<string, ScenarioMeta> = {
31
- default: defaultMeta,
32
- 'b2b-wholesale': bauDirektMeta,
33
- kaminpro: kaminProMeta,
29
+ customer: customerMeta,
34
30
  };
35
31
 
36
32
  /**
@@ -42,5 +38,5 @@ export function getScenarioMeta(): ScenarioMeta {
42
38
  if (scenario && scenario in META) {
43
39
  return META[scenario];
44
40
  }
45
- return META.default;
41
+ return META.customer;
46
42
  }
@@ -6,9 +6,7 @@ import type { ProductSidebarProps } from '@/components/commerce/product-sidebar'
6
6
  import type { ProductImageCarouselProps } from '@/components/commerce/product-image-carousel';
7
7
  import type { RelatedProductsProps } from '@/components/commerce/related-products';
8
8
  import type { ShopByCategoryProps } from '@/components/commerce/shop-by-category';
9
- import { defaultScenario } from '@/scenarios/default';
10
- import { bauDirektScenario } from '@/scenarios/b2b-wholesale';
11
- import { kaminProScenario } from '@/scenarios/kaminpro';
9
+ import { customerScenario } from '@/scenarios/customer';
12
10
 
13
11
  // =============================================================
14
12
  // Branding — pure serializable data (no React components)
@@ -32,23 +30,19 @@ export interface StorefrontBranding {
32
30
 
33
31
  /**
34
32
  * By default the Navbar appends an `Unternehmen` link for logged-in
35
- * company-bound users. Opt out to keep the scenario nav strip fixed —
36
- * useful for demos that want to keep the nav narrow regardless of
33
+ * company-bound users. Opt out to keep the nav strip fixed regardless of
37
34
  * who's signed in.
38
35
  */
39
36
  hideCompanyNavLink?: boolean;
40
37
 
41
38
  /**
42
39
  * Hide the globe / language-picker dropdown in the navbar. Useful for
43
- * single-locale scenarios where offering a locale switch suggests
40
+ * single-locale storefronts where offering a locale switch suggests
44
41
  * translations exist when they don't. The underlying routing still
45
42
  * carries the locale prefix; only the UI affordance is suppressed.
46
43
  */
47
44
  hideLanguagePicker?: boolean;
48
45
 
49
- /** Demo accounts shown on the sign-in page for quick login. */
50
- demoAccounts?: Array<{ email: string; label: string; description: string }>;
51
-
52
46
  footer: {
53
47
  copyright: string;
54
48
  poweredByLinks?: Array<{ label: string; href: string }>;
@@ -62,11 +56,11 @@ export interface StorefrontBranding {
62
56
  };
63
57
 
64
58
  /**
65
- * Optional typography opt-ins. Default scenarios get the standard Geist
66
- * stack; opting in swaps the whole site onto the scenario's preferred
67
- * typeface. Kept as a narrow flag set rather than a free-form font
68
- * descriptor so next/font imports can stay at module scope (required by
69
- * next/font — dynamic imports are not supported).
59
+ * Optional typography opt-ins. Defaults to the standard Geist stack;
60
+ * opting in swaps the whole site onto the chosen typeface. Kept as a
61
+ * narrow flag set rather than a free-form font descriptor so next/font
62
+ * imports can stay at module scope (required by next/font — dynamic
63
+ * imports are not supported).
70
64
  */
71
65
  fonts?: {
72
66
  /**
@@ -144,10 +138,6 @@ export interface CartSlotOverrides {
144
138
  * receives the same props as the built-in component and is responsible
145
139
  * for rendering the entire line-items column (not the order summary /
146
140
  * promotion-code sidebar).
147
- *
148
- * Typed as `ComponentType<any>` to avoid locking the storefront into the
149
- * built-in `ActiveOrder` shape — a scenario override can query its own
150
- * extra fields and declare a stricter type locally.
151
141
  */
152
142
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
153
143
  CartItems?: ServerComponent<any>;
@@ -226,13 +216,11 @@ export function isConditionalPdpOverride(
226
216
  }
227
217
 
228
218
  // =============================================================
229
- // Registry — add new scenarios here
219
+ // Registry
230
220
  // =============================================================
231
221
 
232
222
  const registry: Record<string, ScenarioConfig> = {
233
- default: defaultScenario,
234
- 'b2b-wholesale': bauDirektScenario,
235
- kaminpro: kaminProScenario,
223
+ customer: customerScenario,
236
224
  };
237
225
 
238
226
  // Safe to cache at module level: NEXT_PUBLIC_SCENARIO is baked at build time, so
@@ -241,14 +229,14 @@ let _cached: ScenarioConfig | undefined;
241
229
 
242
230
  export function getScenarioConfig(): ScenarioConfig {
243
231
  if (_cached) return _cached;
244
- const scenario = process.env.NEXT_PUBLIC_SCENARIO || 'default';
232
+ const scenario = process.env.NEXT_PUBLIC_SCENARIO || 'customer';
245
233
  if (!registry[scenario]) {
246
234
  console.warn(
247
- `[scenario] Unknown scenario "${scenario}" — falling back to "default". ` +
235
+ `[scenario] Unknown scenario "${scenario}" — falling back to "customer". ` +
248
236
  `Did you register it in scenario.ts?`,
249
237
  );
250
238
  }
251
- _cached = registry[scenario] ?? registry.default;
239
+ _cached = registry[scenario] ?? registry.customer;
252
240
  return _cached;
253
241
  }
254
242
 
@@ -271,9 +259,6 @@ const _brandingStyleTag = (() => {
271
259
 
272
260
  let base = `:root { ${darkVars} } .light { ${lightVars} }`;
273
261
 
274
- // Scenario-scoped typography overrides. The `.kp-app` class is only
275
- // added to <body> when `fonts.technical === true`, so these rules
276
- // are dormant for every other scenario.
277
262
  if (fonts?.technical) {
278
263
  base += `
279
264
  .kp-app {
@@ -292,8 +277,7 @@ const _brandingStyleTag = (() => {
292
277
  font-family: var(--font-jetbrains-mono), ui-monospace, monospace;
293
278
  }
294
279
  .kp-app :where(table, .tabular-nums) { font-variant-numeric: tabular-nums; }
295
- /* Slim scrollbars in scenario-scoped scroll containers (same rules as
296
- the configurator's scroll-slim utility, just widened in scope). */
280
+ /* Slim scrollbars in scenario-scoped scroll containers. */
297
281
  .kp-app *::-webkit-scrollbar { width: 8px; height: 8px; }
298
282
  .kp-app *::-webkit-scrollbar-track { background: transparent; }
299
283
  .kp-app *::-webkit-scrollbar-thumb {