@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.
- package/README.md +37 -27
- package/dist/assets/storefront/.env.example +14 -14
- package/dist/assets/storefront/messages/de.json +2 -3
- package/dist/assets/storefront/messages/en.json +2 -3
- package/dist/assets/storefront/next.config.ts +22 -21
- package/dist/assets/storefront/package.json +75 -75
- package/dist/assets/storefront/public/scenarios/customer/logo.svg +4 -0
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +0 -4
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +70 -102
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +2 -3
- package/dist/assets/storefront/src/config/scenario-meta.ts +3 -7
- package/dist/assets/storefront/src/config/scenario.ts +14 -30
- package/dist/assets/storefront/src/graphql-env.d.ts +456 -0
- package/dist/assets/storefront/src/scenarios/customer/branding.ts +142 -0
- package/dist/assets/storefront/src/scenarios/customer/hero.tsx +76 -0
- package/dist/assets/storefront/src/scenarios/{default → customer}/index.ts +3 -3
- package/dist/assets/storefront/src/scenarios/{default → customer}/meta.ts +1 -1
- package/dist/assets/storefront/src/schema.graphql +5852 -0
- package/dist/assets/storefront/tsconfig.json +17 -8
- package/dist/assets/templates/README.md.hbs +1 -1
- package/dist/assets/templates/docker-compose.yml.hbs +0 -4
- package/dist/assets/templates/env.hbs +13 -7
- package/dist/assets/templates/environment.d.ts.hbs +1 -5
- package/dist/assets/templates/npmrc.hbs +1 -1
- package/dist/assets/templates/populate.ts.hbs +17 -0
- package/dist/assets/templates/server-package.json.hbs +3 -2
- package/dist/bin/run.js +17 -3
- package/dist/bin/run.js.map +1 -1
- package/dist/cli.d.ts +6 -1
- package/dist/cli.js +147 -25
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/plugin-registry.d.ts +43 -6
- package/dist/plugin-registry.js +139 -421
- package/dist/plugin-registry.js.map +1 -1
- package/dist/registry.d.ts +18 -0
- package/dist/registry.js +29 -0
- package/dist/registry.js.map +1 -0
- package/dist/scaffold-shared.d.ts +19 -0
- package/dist/scaffold-shared.js +114 -0
- package/dist/scaffold-shared.js.map +1 -0
- package/dist/scaffold-storefront-only.d.ts +6 -0
- package/dist/scaffold-storefront-only.js +101 -0
- package/dist/scaffold-storefront-only.js.map +1 -0
- package/dist/scaffolder.js +22 -42
- package/dist/scaffolder.js.map +1 -1
- package/dist/storefront-copier.d.ts +26 -3
- package/dist/storefront-copier.js +63 -12
- package/dist/storefront-copier.js.map +1 -1
- package/dist/template-renderer.d.ts +24 -7
- package/dist/template-renderer.js +32 -64
- package/dist/template-renderer.js.map +1 -1
- package/dist/types.d.ts +46 -27
- package/package.json +3 -1
- package/dist/assets/storefront/.env.local +0 -1
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/logo.svg +0 -4
- package/dist/assets/storefront/public/scenarios/default/logo.svg +0 -4
- package/dist/assets/storefront/public/scenarios/kaminpro/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/kaminpro/logo.svg +0 -7
- package/dist/assets/storefront/src/components/shared/scenario-paused.tsx +0 -80
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/branding.ts +0 -180
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/hero.tsx +0 -122
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/index.ts +0 -21
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/meta.ts +0 -3
- package/dist/assets/storefront/src/scenarios/default/branding.ts +0 -148
- package/dist/assets/storefront/src/scenarios/default/hero.tsx +0 -107
- package/dist/assets/storefront/src/scenarios/kaminpro/auth-gate.tsx +0 -36
- package/dist/assets/storefront/src/scenarios/kaminpro/branding.ts +0 -238
- package/dist/assets/storefront/src/scenarios/kaminpro/cart-items.tsx +0 -359
- package/dist/assets/storefront/src/scenarios/kaminpro/hero.tsx +0 -123
- package/dist/assets/storefront/src/scenarios/kaminpro/index.ts +0 -50
- package/dist/assets/storefront/src/scenarios/kaminpro/meta.ts +0 -9
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/banners.tsx +0 -21
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/bom-basket.tsx +0 -221
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/btn.tsx +0 -38
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/chip.tsx +0 -35
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/config-header.tsx +0 -72
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/field-row.tsx +0 -126
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/info-dot.tsx +0 -38
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/login-notice.tsx +0 -81
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/module-panel.tsx +0 -144
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/quote-dialog.tsx +0 -110
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/schematic.tsx +0 -674
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/why-panel.tsx +0 -66
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-pdp.tsx +0 -43
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-shell.tsx +0 -320
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/data.ts +0 -150
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/types.ts +0 -30
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/styles.css +0 -104
- package/dist/assets/storefront/src/scenarios/kaminpro/shop-by-system.tsx +0 -97
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/decision-tree.ts +0 -261
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/page.tsx +0 -21
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/wizard.tsx +0 -600
- package/dist/assets/storefront/src/schema.graphql.placeholder +0 -5
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type {Locale} from '@/i18n/locales';
|
|
2
|
-
import {
|
|
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
|
-
|
|
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.
|
|
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 {
|
|
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
|
|
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
|
|
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.
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
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
|
|
219
|
+
// Registry
|
|
230
220
|
// =============================================================
|
|
231
221
|
|
|
232
222
|
const registry: Record<string, ScenarioConfig> = {
|
|
233
|
-
|
|
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 || '
|
|
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 "
|
|
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.
|
|
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
|
|
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 {
|