@vitrine-kit/contracts 1.1.0 → 1.2.1
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 +3 -3
- package/dist/index.d.ts +53 -53
- package/dist/index.js +15 -15
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @vitrine-kit/contracts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The five stable Vitrine contracts that every registry feature depends on: **Tokens · Data · Slots · Config · Blueprint**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This is a semver-governed API. A broken contract breaks `add` for every client → we extend it **additively only** (spec §5, §13).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Source of truth is **zod**; the JSON Schemas in `schemas/` are generated from it. The v1 slot/token naming proposal lives in [docs/contracts-v1-proposal.md](../../docs/contracts-v1-proposal.md).
|
package/dist/index.d.ts
CHANGED
|
@@ -25,17 +25,17 @@ declare const SPACE_TOKENS: readonly ["unit", "container-max", "container-paddin
|
|
|
25
25
|
type SpaceToken = (typeof SPACE_TOKENS)[number];
|
|
26
26
|
declare const MOTION_TOKENS: readonly ["duration-fast", "duration-normal", "ease-default"];
|
|
27
27
|
type MotionToken = (typeof MOTION_TOKENS)[number];
|
|
28
|
-
/**
|
|
28
|
+
/** Single "knobs" without a group. */
|
|
29
29
|
declare const SINGLETON_TOKENS: readonly ["density", "border-width"];
|
|
30
30
|
type SingletonToken = (typeof SINGLETON_TOKENS)[number];
|
|
31
|
-
/**
|
|
31
|
+
/** CSS variable name for a token: cssVar('color','primary') → '--vt-color-primary'. */
|
|
32
32
|
declare function cssVar(group: string, name?: string): `--vt-${string}`;
|
|
33
|
-
/**
|
|
33
|
+
/** Full list of the contract's CSS variable names — for theme scaffolding and docs. */
|
|
34
34
|
declare const TOKEN_CSS_VARS: string[];
|
|
35
35
|
/**
|
|
36
|
-
* Tailwind
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* The Vitrine Tailwind preset: maps Tailwind keys to the contract's CSS variables.
|
|
37
|
+
* Used in the client's tailwind.config: `presets: [vitrinePreset]`.
|
|
38
|
+
* Loosely typed so contracts don't take a dependency on tailwindcss.
|
|
39
39
|
*/
|
|
40
40
|
declare const vitrinePreset: {
|
|
41
41
|
theme: {
|
|
@@ -44,11 +44,11 @@ declare const vitrinePreset: {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
* 199000 = 1990.00.
|
|
47
|
+
* Money — an integer in the currency's minor units (cents).
|
|
48
|
+
* 199000 = 1990.00. Decision is fixed (see the demo seed, spec §18.2).
|
|
49
49
|
*/
|
|
50
50
|
type Money = number;
|
|
51
|
-
/** ISO 4217,
|
|
51
|
+
/** ISO 4217, e.g. 'USD', 'EUR', 'GBP'. */
|
|
52
52
|
type CurrencyCode = string;
|
|
53
53
|
interface Category {
|
|
54
54
|
id: string;
|
|
@@ -69,9 +69,9 @@ interface Variant {
|
|
|
69
69
|
title?: string;
|
|
70
70
|
price: Money;
|
|
71
71
|
currency: CurrencyCode;
|
|
72
|
-
/** null/undefined =
|
|
72
|
+
/** null/undefined = stock not tracked. */
|
|
73
73
|
stock?: number | null;
|
|
74
|
-
/**
|
|
74
|
+
/** Variant options, e.g. { size: 'M', color: 'red' }. */
|
|
75
75
|
options?: Record<string, string>;
|
|
76
76
|
}
|
|
77
77
|
interface Seo {
|
|
@@ -94,20 +94,20 @@ interface Product {
|
|
|
94
94
|
};
|
|
95
95
|
seo?: Seo;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
97
|
+
* Fields added by features via blueprint extend() (contract 5),
|
|
98
|
+
* mapped here by the adapter. The contract stays stable — features read their own keys.
|
|
99
99
|
*/
|
|
100
100
|
extensions?: Record<string, unknown>;
|
|
101
101
|
}
|
|
102
102
|
type ProductSort = 'newest' | 'price-asc' | 'price-desc' | 'relevance';
|
|
103
103
|
interface ProductQuery {
|
|
104
|
-
/** slug
|
|
104
|
+
/** Category slug. */
|
|
105
105
|
category?: string;
|
|
106
106
|
search?: string;
|
|
107
107
|
sort?: ProductSort;
|
|
108
108
|
page?: number;
|
|
109
109
|
perPage?: number;
|
|
110
|
-
/**
|
|
110
|
+
/** Filter facets: { color: ['red','blue'], size: ['M'] }. */
|
|
111
111
|
filters?: Record<string, string[]>;
|
|
112
112
|
}
|
|
113
113
|
interface CartLine {
|
|
@@ -151,8 +151,8 @@ interface Order {
|
|
|
151
151
|
createdAt: string;
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
154
|
+
* Catalog source. Implemented by the PayloadCatalog* / VendureCatalog* adapters.
|
|
155
|
+
* Needed at every tier (catalog and above).
|
|
156
156
|
*/
|
|
157
157
|
interface CatalogSource {
|
|
158
158
|
listProducts(query: ProductQuery): Promise<Product[]>;
|
|
@@ -161,10 +161,10 @@ interface CatalogSource {
|
|
|
161
161
|
search(term: string): Promise<Product[]>;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
164
|
+
* Commerce backend. Only simple-store / full-store.
|
|
165
|
+
* Implemented by PayloadCommerce* / VendureCommerce*.
|
|
166
|
+
* The full cart surface is fixed in v1 (adding methods to the interface
|
|
167
|
+
* later = a breaking change for implementations).
|
|
168
168
|
*/
|
|
169
169
|
interface CommerceBackend {
|
|
170
170
|
createCart(): Promise<Cart>;
|
|
@@ -172,21 +172,21 @@ interface CommerceBackend {
|
|
|
172
172
|
addItem(cartId: string, variantId: string, qty: number): Promise<Cart>;
|
|
173
173
|
updateItem(cartId: string, lineId: string, qty: number): Promise<Cart>;
|
|
174
174
|
removeItem(cartId: string, lineId: string): Promise<Cart>;
|
|
175
|
-
/** Hosted checkout
|
|
175
|
+
/** Hosted checkout of the active payment provider → redirectUrl. */
|
|
176
176
|
startCheckout(cartId: string): Promise<{
|
|
177
177
|
redirectUrl: string;
|
|
178
178
|
}>;
|
|
179
179
|
getOrder(id: string): Promise<Order | null>;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
/** 32
|
|
182
|
+
/** 32 v1 slots. Order and grouping match the approved proposal. */
|
|
183
183
|
declare const SLOT_IDS: readonly ["global.banner-top", "global.header-start", "global.header-nav", "global.header-actions", "global.footer", "global.body-end", "home.hero", "home.below-hero", "home.sections", "home.bottom", "catalog.toolbar", "catalog.sidebar", "catalog.grid-top", "catalog.grid-bottom", "category.header", "category.below-products", "product.gallery", "product.below-title", "product.below-price", "product.purchase", "product.below-description", "product.tabs", "product.related", "cart.items-bottom", "cart.summary", "cart.below", "checkout.top", "checkout.below", "order.top", "order.below", "search.results-top", "search.empty"];
|
|
184
184
|
type SlotId = (typeof SLOT_IDS)[number];
|
|
185
|
-
/** Zod
|
|
185
|
+
/** Zod enum of slots (for validating feature.json / site.config). */
|
|
186
186
|
declare const slotIdSchema: z.ZodEnum<["global.banner-top", "global.header-start", "global.header-nav", "global.header-actions", "global.footer", "global.body-end", "home.hero", "home.below-hero", "home.sections", "home.bottom", "catalog.toolbar", "catalog.sidebar", "catalog.grid-top", "catalog.grid-bottom", "category.header", "category.below-products", "product.gallery", "product.below-title", "product.below-price", "product.purchase", "product.below-description", "product.tabs", "product.related", "cart.items-bottom", "cart.summary", "cart.below", "checkout.top", "checkout.below", "order.top", "order.below", "search.results-top", "search.empty"]>;
|
|
187
187
|
/**
|
|
188
|
-
*
|
|
189
|
-
* component
|
|
188
|
+
* Declarative slot registration in the feature manifest (feature.json, spec §8):
|
|
189
|
+
* component is the component NAME, resolved in the client repository.
|
|
190
190
|
*/
|
|
191
191
|
declare const slotRegistrationSchema: z.ZodObject<{
|
|
192
192
|
slot: z.ZodEnum<["global.banner-top", "global.header-start", "global.header-nav", "global.header-actions", "global.footer", "global.body-end", "home.hero", "home.below-hero", "home.sections", "home.bottom", "catalog.toolbar", "catalog.sidebar", "catalog.grid-top", "catalog.grid-bottom", "category.header", "category.below-products", "product.gallery", "product.below-title", "product.below-price", "product.purchase", "product.below-description", "product.tabs", "product.related", "cart.items-bottom", "cart.summary", "cart.below", "checkout.top", "checkout.below", "order.top", "order.below", "search.results-top", "search.empty"]>;
|
|
@@ -203,9 +203,9 @@ declare const slotRegistrationSchema: z.ZodObject<{
|
|
|
203
203
|
}>;
|
|
204
204
|
type SlotRegistration = z.infer<typeof slotRegistrationSchema>;
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
206
|
+
* Runtime binding of a name to an actual component (used by @vitrine-kit/core
|
|
207
|
+
* in the client's lib/slots.ts). Generic over the component type so the contract
|
|
208
|
+
* doesn't depend on React.
|
|
209
209
|
*/
|
|
210
210
|
interface SlotMount<TComponent = unknown> {
|
|
211
211
|
slot: SlotId;
|
|
@@ -213,11 +213,11 @@ interface SlotMount<TComponent = unknown> {
|
|
|
213
213
|
order?: number;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
/**
|
|
216
|
+
/** Override/ordering of a page section (composition over the wireframe). */
|
|
217
217
|
declare const layoutSectionSchema: z.ZodObject<{
|
|
218
218
|
slot: z.ZodEnum<["global.banner-top", "global.header-start", "global.header-nav", "global.header-actions", "global.footer", "global.body-end", "home.hero", "home.below-hero", "home.sections", "home.bottom", "catalog.toolbar", "catalog.sidebar", "catalog.grid-top", "catalog.grid-bottom", "category.header", "category.below-products", "product.gallery", "product.below-title", "product.below-price", "product.purchase", "product.below-description", "product.tabs", "product.related", "cart.items-bottom", "cart.summary", "cart.below", "checkout.top", "checkout.below", "order.top", "order.below", "search.results-top", "search.empty"]>;
|
|
219
219
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
220
|
-
/**
|
|
220
|
+
/** Path to the override component in the client repo (unique — as an override, §13). */
|
|
221
221
|
override: z.ZodOptional<z.ZodString>;
|
|
222
222
|
}, "strip", z.ZodTypeAny, {
|
|
223
223
|
slot: "global.banner-top" | "global.header-start" | "global.header-nav" | "global.header-actions" | "global.footer" | "global.body-end" | "home.hero" | "home.below-hero" | "home.sections" | "home.bottom" | "catalog.toolbar" | "catalog.sidebar" | "catalog.grid-top" | "catalog.grid-bottom" | "category.header" | "category.below-products" | "product.gallery" | "product.below-title" | "product.below-price" | "product.purchase" | "product.below-description" | "product.tabs" | "product.related" | "cart.items-bottom" | "cart.summary" | "cart.below" | "checkout.top" | "checkout.below" | "order.top" | "order.below" | "search.results-top" | "search.empty";
|
|
@@ -266,7 +266,7 @@ declare const i18nSchema: z.ZodDefault<z.ZodObject<{
|
|
|
266
266
|
}>>;
|
|
267
267
|
declare const themeSchema: z.ZodDefault<z.ZodObject<{
|
|
268
268
|
name: z.ZodDefault<z.ZodString>;
|
|
269
|
-
/**
|
|
269
|
+
/** File with token values (filled by the design step). */
|
|
270
270
|
cssFile: z.ZodDefault<z.ZodString>;
|
|
271
271
|
}, "strip", z.ZodTypeAny, {
|
|
272
272
|
name: string;
|
|
@@ -278,13 +278,13 @@ declare const themeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
278
278
|
declare const siteConfigSchema: z.ZodObject<{
|
|
279
279
|
backend: z.ZodEnum<["payload", "vendure"]>;
|
|
280
280
|
tier: z.ZodEnum<["catalog", "simple-store", "full-store"]>;
|
|
281
|
-
/**
|
|
281
|
+
/** Feature flags: { 'reviews': true }. Set by the install primitive. */
|
|
282
282
|
features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
283
283
|
layout: z.ZodDefault<z.ZodObject<{
|
|
284
284
|
sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
285
285
|
slot: z.ZodEnum<["global.banner-top", "global.header-start", "global.header-nav", "global.header-actions", "global.footer", "global.body-end", "home.hero", "home.below-hero", "home.sections", "home.bottom", "catalog.toolbar", "catalog.sidebar", "catalog.grid-top", "catalog.grid-bottom", "category.header", "category.below-products", "product.gallery", "product.below-title", "product.below-price", "product.purchase", "product.below-description", "product.tabs", "product.related", "cart.items-bottom", "cart.summary", "cart.below", "checkout.top", "checkout.below", "order.top", "order.below", "search.results-top", "search.empty"]>;
|
|
286
286
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
287
|
-
/**
|
|
287
|
+
/** Path to the override component in the client repo (unique — as an override, §13). */
|
|
288
288
|
override: z.ZodOptional<z.ZodString>;
|
|
289
289
|
}, "strip", z.ZodTypeAny, {
|
|
290
290
|
slot: "global.banner-top" | "global.header-start" | "global.header-nav" | "global.header-actions" | "global.footer" | "global.body-end" | "home.hero" | "home.below-hero" | "home.sections" | "home.bottom" | "catalog.toolbar" | "catalog.sidebar" | "catalog.grid-top" | "catalog.grid-bottom" | "category.header" | "category.below-products" | "product.gallery" | "product.below-title" | "product.below-price" | "product.purchase" | "product.below-description" | "product.tabs" | "product.related" | "cart.items-bottom" | "cart.summary" | "cart.below" | "checkout.top" | "checkout.below" | "order.top" | "order.below" | "search.results-top" | "search.empty";
|
|
@@ -310,7 +310,7 @@ declare const siteConfigSchema: z.ZodObject<{
|
|
|
310
310
|
}>>;
|
|
311
311
|
theme: z.ZodDefault<z.ZodObject<{
|
|
312
312
|
name: z.ZodDefault<z.ZodString>;
|
|
313
|
-
/**
|
|
313
|
+
/** File with token values (filled by the design step). */
|
|
314
314
|
cssFile: z.ZodDefault<z.ZodString>;
|
|
315
315
|
}, "strip", z.ZodTypeAny, {
|
|
316
316
|
name: string;
|
|
@@ -413,16 +413,16 @@ declare const siteConfigSchema: z.ZodObject<{
|
|
|
413
413
|
}>;
|
|
414
414
|
type SiteConfig = z.infer<typeof siteConfigSchema>;
|
|
415
415
|
|
|
416
|
-
/**
|
|
416
|
+
/** Base blueprint collections a feature can extend. */
|
|
417
417
|
declare const BLUEPRINT_COLLECTIONS: readonly ["product", "variant", "category", "media", "order", "user"];
|
|
418
418
|
type BlueprintCollection = (typeof BLUEPRINT_COLLECTIONS)[number];
|
|
419
419
|
declare const blueprintCollectionSchema: z.ZodEnum<["product", "variant", "category", "media", "order", "user"]>;
|
|
420
|
-
/**
|
|
420
|
+
/** Supported types for added fields (minimal v1 set). */
|
|
421
421
|
declare const BLUEPRINT_FIELD_TYPES: readonly ["text", "textarea", "richText", "number", "checkbox", "select", "relationship", "date", "json", "array", "group"];
|
|
422
422
|
type BlueprintFieldType = (typeof BLUEPRINT_FIELD_TYPES)[number];
|
|
423
423
|
/**
|
|
424
|
-
*
|
|
425
|
-
*
|
|
424
|
+
* Definition of an added field (runtime form for @vitrine-kit/payload-blueprint).
|
|
425
|
+
* Allows extra Payload field keys (options, relationTo, …) via passthrough.
|
|
426
426
|
*/
|
|
427
427
|
declare const blueprintFieldDefSchema: z.ZodObject<{
|
|
428
428
|
name: z.ZodString;
|
|
@@ -441,21 +441,21 @@ declare const blueprintFieldDefSchema: z.ZodObject<{
|
|
|
441
441
|
label: z.ZodOptional<z.ZodString>;
|
|
442
442
|
}, z.ZodTypeAny, "passthrough">>;
|
|
443
443
|
type BlueprintFieldDef = z.infer<typeof blueprintFieldDefSchema>;
|
|
444
|
-
/**
|
|
444
|
+
/** Runtime extension applied by extend(). */
|
|
445
445
|
interface BlueprintExtension {
|
|
446
446
|
extend: BlueprintCollection;
|
|
447
447
|
addFields: BlueprintFieldDef[];
|
|
448
448
|
}
|
|
449
449
|
/**
|
|
450
|
-
*
|
|
451
|
-
*
|
|
450
|
+
* The extend() signature, implemented in @vitrine-kit/payload-blueprint.
|
|
451
|
+
* Additive by contract: it adds fields to a collection.
|
|
452
452
|
*/
|
|
453
453
|
type Extend = (collection: BlueprintCollection, patch: {
|
|
454
454
|
addFields: BlueprintFieldDef[];
|
|
455
455
|
}) => void;
|
|
456
456
|
/**
|
|
457
|
-
*
|
|
458
|
-
* (
|
|
457
|
+
* The blueprint shape in the feature manifest (feature.json, §8): addFields are field NAMES
|
|
458
|
+
* (strings); the actual definitions live in the feature code / payload-blueprint.
|
|
459
459
|
*/
|
|
460
460
|
declare const blueprintManifestSchema: z.ZodObject<{
|
|
461
461
|
extend: z.ZodEnum<["product", "variant", "category", "media", "order", "user"]>;
|
|
@@ -489,16 +489,16 @@ declare const featureEnvSchema: z.ZodObject<{
|
|
|
489
489
|
key: string;
|
|
490
490
|
required?: boolean | undefined;
|
|
491
491
|
}>;
|
|
492
|
-
/** registry/<feature>/feature.json —
|
|
492
|
+
/** registry/<feature>/feature.json — the declarative feature manifest (§8). */
|
|
493
493
|
declare const featureManifestSchema: z.ZodObject<{
|
|
494
494
|
name: z.ZodString;
|
|
495
495
|
title: z.ZodString;
|
|
496
496
|
kitVersion: z.ZodString;
|
|
497
|
-
/** semver
|
|
497
|
+
/** semver range of required contracts, e.g. ">=1.0.0 <2.0.0". */
|
|
498
498
|
requiresContracts: z.ZodString;
|
|
499
499
|
tier: z.ZodArray<z.ZodEnum<["catalog", "simple-store", "full-store"]>, "atleastone">;
|
|
500
500
|
registryDependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
501
|
-
/**
|
|
501
|
+
/** Versioned packages: { "@vitrine-kit/core": ">=1.0.0" }. */
|
|
502
502
|
corePackages: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
503
503
|
npm: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
504
504
|
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -519,9 +519,9 @@ declare const featureManifestSchema: z.ZodObject<{
|
|
|
519
519
|
set: Record<string, boolean>;
|
|
520
520
|
}>>;
|
|
521
521
|
/**
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
522
|
+
* The payment provider of a checkout-<provider> feature. From it the CLI: (1) generates
|
|
523
|
+
* the provider registration in lib/payments.ts, (2) sets integrations.payments
|
|
524
|
+
* in site.config. register<Pascal>Provider() is exported from lib/<name>/register.ts.
|
|
525
525
|
*/
|
|
526
526
|
payment: z.ZodOptional<z.ZodObject<{
|
|
527
527
|
provider: z.ZodEnum<["stripe", "paddle", "yookassa"]>;
|
|
@@ -563,7 +563,7 @@ declare const featureManifestSchema: z.ZodObject<{
|
|
|
563
563
|
key: string;
|
|
564
564
|
required?: boolean | undefined;
|
|
565
565
|
}>, "many">>;
|
|
566
|
-
/**
|
|
566
|
+
/** Doc appended to the client's CLAUDE.md. */
|
|
567
567
|
claudeDoc: z.ZodOptional<z.ZodString>;
|
|
568
568
|
conflicts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
569
569
|
removable: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -639,7 +639,7 @@ declare const featureManifestSchema: z.ZodObject<{
|
|
|
639
639
|
removable?: boolean | undefined;
|
|
640
640
|
}>;
|
|
641
641
|
type FeatureManifest = z.infer<typeof featureManifestSchema>;
|
|
642
|
-
/** vitrine.json —
|
|
642
|
+
/** vitrine.json — the client repo's lock file (§6). */
|
|
643
643
|
declare const vitrineLockSchema: z.ZodObject<{
|
|
644
644
|
kitVersion: z.ZodString;
|
|
645
645
|
contracts: z.ZodString;
|
|
@@ -670,7 +670,7 @@ declare const vitrineLockSchema: z.ZodObject<{
|
|
|
670
670
|
}> | undefined;
|
|
671
671
|
}>;
|
|
672
672
|
type VitrineLock = z.infer<typeof vitrineLockSchema>;
|
|
673
|
-
/** registry/_index.json —
|
|
673
|
+
/** registry/_index.json — the registry manifest: all features + the kit version. */
|
|
674
674
|
declare const registryIndexSchema: z.ZodObject<{
|
|
675
675
|
kitVersion: z.ZodString;
|
|
676
676
|
contracts: z.ZodString;
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ var vitrinePreset = {
|
|
|
101
101
|
// src/slots.ts
|
|
102
102
|
import { z as z2 } from "zod";
|
|
103
103
|
var SLOT_IDS = [
|
|
104
|
-
// global —
|
|
104
|
+
// global — on every page
|
|
105
105
|
"global.banner-top",
|
|
106
106
|
"global.header-start",
|
|
107
107
|
"global.header-nav",
|
|
@@ -113,7 +113,7 @@ var SLOT_IDS = [
|
|
|
113
113
|
"home.below-hero",
|
|
114
114
|
"home.sections",
|
|
115
115
|
"home.bottom",
|
|
116
|
-
// catalog —
|
|
116
|
+
// catalog — listing/grid
|
|
117
117
|
"catalog.toolbar",
|
|
118
118
|
"catalog.sidebar",
|
|
119
119
|
"catalog.grid-top",
|
|
@@ -155,7 +155,7 @@ import { z as z3 } from "zod";
|
|
|
155
155
|
var layoutSectionSchema = z3.object({
|
|
156
156
|
slot: slotIdSchema,
|
|
157
157
|
enabled: z3.boolean().default(true),
|
|
158
|
-
/**
|
|
158
|
+
/** Path to the override component in the client repo (unique — as an override, §13). */
|
|
159
159
|
override: z3.string().optional()
|
|
160
160
|
});
|
|
161
161
|
var integrationsSchema = z3.object({
|
|
@@ -166,20 +166,20 @@ var integrationsSchema = z3.object({
|
|
|
166
166
|
shipping: z3.string().optional()
|
|
167
167
|
}).default({});
|
|
168
168
|
var i18nSchema = z3.object({
|
|
169
|
-
defaultLocale: z3.string().default("
|
|
170
|
-
locales: z3.array(z3.string()).default(["
|
|
171
|
-
currency: z3.string().default("
|
|
169
|
+
defaultLocale: z3.string().default("en"),
|
|
170
|
+
locales: z3.array(z3.string()).default(["en"]),
|
|
171
|
+
currency: z3.string().default("USD"),
|
|
172
172
|
priceFormat: z3.string().optional()
|
|
173
|
-
}).default({ defaultLocale: "
|
|
173
|
+
}).default({ defaultLocale: "en", locales: ["en"], currency: "USD" });
|
|
174
174
|
var themeSchema = z3.object({
|
|
175
175
|
name: z3.string().default("default"),
|
|
176
|
-
/**
|
|
176
|
+
/** File with token values (filled by the design step). */
|
|
177
177
|
cssFile: z3.string().default("theme/client.css")
|
|
178
178
|
}).default({ name: "default", cssFile: "theme/client.css" });
|
|
179
179
|
var siteConfigSchema = z3.object({
|
|
180
180
|
backend: backendSchema,
|
|
181
181
|
tier: tierSchema,
|
|
182
|
-
/**
|
|
182
|
+
/** Feature flags: { 'reviews': true }. Set by the install primitive. */
|
|
183
183
|
features: z3.record(z3.string(), z3.boolean()).default({}),
|
|
184
184
|
layout: z3.object({ sections: z3.array(layoutSectionSchema).default([]) }).default({ sections: [] }),
|
|
185
185
|
theme: themeSchema,
|
|
@@ -236,25 +236,25 @@ var featureManifestSchema = z5.object({
|
|
|
236
236
|
name: z5.string().min(1),
|
|
237
237
|
title: z5.string().min(1),
|
|
238
238
|
kitVersion: z5.string().min(1),
|
|
239
|
-
/** semver
|
|
239
|
+
/** semver range of required contracts, e.g. ">=1.0.0 <2.0.0". */
|
|
240
240
|
requiresContracts: z5.string().min(1),
|
|
241
241
|
tier: z5.array(tierSchema).nonempty(),
|
|
242
242
|
registryDependencies: z5.array(z5.string()).default([]),
|
|
243
|
-
/**
|
|
243
|
+
/** Versioned packages: { "@vitrine-kit/core": ">=1.0.0" }. */
|
|
244
244
|
corePackages: z5.record(z5.string(), z5.string()).default({}),
|
|
245
245
|
npm: z5.array(z5.string()).default([]),
|
|
246
246
|
files: z5.array(featureFileMapSchema).default([]),
|
|
247
247
|
config: z5.object({ set: z5.record(z5.string(), z5.boolean()) }).optional(),
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
249
|
+
* The payment provider of a checkout-<provider> feature. From it the CLI: (1) generates
|
|
250
|
+
* the provider registration in lib/payments.ts, (2) sets integrations.payments
|
|
251
|
+
* in site.config. register<Pascal>Provider() is exported from lib/<name>/register.ts.
|
|
252
252
|
*/
|
|
253
253
|
payment: z5.object({ provider: z5.enum(["stripe", "paddle", "yookassa"]) }).optional(),
|
|
254
254
|
slots: z5.array(slotRegistrationSchema).default([]),
|
|
255
255
|
blueprint: blueprintManifestSchema.optional(),
|
|
256
256
|
env: z5.array(featureEnvSchema).default([]),
|
|
257
|
-
/**
|
|
257
|
+
/** Doc appended to the client's CLAUDE.md. */
|
|
258
258
|
claudeDoc: z5.string().optional(),
|
|
259
259
|
conflicts: z5.array(z5.string()).default([]),
|
|
260
260
|
removable: z5.boolean().default(true)
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitrine-kit/contracts",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "Vitrine —
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Vitrine — the five stable contracts: Tokens, Data, Slots, Config, Blueprint.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
7
11
|
"types": "./dist/index.d.ts",
|
|
8
12
|
"main": "./dist/index.js",
|
|
9
13
|
"module": "./dist/index.js",
|