@vitrine-kit/contracts 1.1.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.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/index.d.ts +711 -0
- package/dist/index.js +321 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vitrine Kit (Max Davydov)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @vitrine-kit/contracts
|
|
2
|
+
|
|
3
|
+
Пять стабильных контрактов Vitrine, от которых зависит каждая фича реестра: **Tokens · Data · Slots · Config · Blueprint**.
|
|
4
|
+
|
|
5
|
+
Это API под semver. Сломанный контракт ломает `add` у всех клиентов → расширяем **только аддитивно** (§5, §13 спеки).
|
|
6
|
+
|
|
7
|
+
Скелет (M0). Содержимое контрактов наполняется в M1; предложение по именам слотов/токенов — [docs/contracts-v1-proposal.md](../../docs/contracts-v1-proposal.md).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const TIERS: readonly ["catalog", "simple-store", "full-store"];
|
|
4
|
+
type Tier = (typeof TIERS)[number];
|
|
5
|
+
declare const tierSchema: z.ZodEnum<["catalog", "simple-store", "full-store"]>;
|
|
6
|
+
declare const BACKENDS: readonly ["payload", "vendure"];
|
|
7
|
+
type Backend = (typeof BACKENDS)[number];
|
|
8
|
+
declare const backendSchema: z.ZodEnum<["payload", "vendure"]>;
|
|
9
|
+
|
|
10
|
+
declare const COLOR_TOKENS: readonly ["bg", "fg", "muted", "muted-fg", "surface", "surface-fg", "border", "input", "ring", "primary", "primary-fg", "secondary", "secondary-fg", "accent", "accent-fg", "success", "warning", "danger", "danger-fg", "price", "sale"];
|
|
11
|
+
type ColorToken = (typeof COLOR_TOKENS)[number];
|
|
12
|
+
declare const FONT_TOKENS: readonly ["sans", "heading", "mono"];
|
|
13
|
+
type FontToken = (typeof FONT_TOKENS)[number];
|
|
14
|
+
declare const FONT_WEIGHT_TOKENS: readonly ["normal", "medium", "bold", "heading"];
|
|
15
|
+
type FontWeightToken = (typeof FONT_WEIGHT_TOKENS)[number];
|
|
16
|
+
declare const LEADING_TOKENS: readonly ["tight", "normal", "relaxed"];
|
|
17
|
+
type LeadingToken = (typeof LEADING_TOKENS)[number];
|
|
18
|
+
declare const TRACKING_TOKENS: readonly ["tight", "normal", "wide"];
|
|
19
|
+
type TrackingToken = (typeof TRACKING_TOKENS)[number];
|
|
20
|
+
declare const RADIUS_TOKENS: readonly ["base", "sm", "md", "lg", "full"];
|
|
21
|
+
type RadiusToken = (typeof RADIUS_TOKENS)[number];
|
|
22
|
+
declare const SHADOW_TOKENS: readonly ["sm", "md", "lg", "color"];
|
|
23
|
+
type ShadowToken = (typeof SHADOW_TOKENS)[number];
|
|
24
|
+
declare const SPACE_TOKENS: readonly ["unit", "container-max", "container-padding", "section-gap"];
|
|
25
|
+
type SpaceToken = (typeof SPACE_TOKENS)[number];
|
|
26
|
+
declare const MOTION_TOKENS: readonly ["duration-fast", "duration-normal", "ease-default"];
|
|
27
|
+
type MotionToken = (typeof MOTION_TOKENS)[number];
|
|
28
|
+
/** Одиночные «ручки» без группы. */
|
|
29
|
+
declare const SINGLETON_TOKENS: readonly ["density", "border-width"];
|
|
30
|
+
type SingletonToken = (typeof SINGLETON_TOKENS)[number];
|
|
31
|
+
/** Имя CSS-переменной для токена: cssVar('color','primary') → '--vt-color-primary'. */
|
|
32
|
+
declare function cssVar(group: string, name?: string): `--vt-${string}`;
|
|
33
|
+
/** Полный перечень имён CSS-переменных контракта — для скаффолда theme и доков. */
|
|
34
|
+
declare const TOKEN_CSS_VARS: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Tailwind-preset Vitrine: маппит ключи Tailwind на CSS-переменные контракта.
|
|
37
|
+
* Используется в клиентском tailwind.config: `presets: [vitrinePreset]`.
|
|
38
|
+
* Типизирован свободно, чтобы не тащить зависимость на tailwindcss в контракты.
|
|
39
|
+
*/
|
|
40
|
+
declare const vitrinePreset: {
|
|
41
|
+
theme: {
|
|
42
|
+
extend: Record<string, unknown>;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Деньги — целое в минимальных единицах валюты (копейки/центы).
|
|
48
|
+
* 199000 = 1990.00. Решение зафиксировано (см. демо-сид §18.2 спеки).
|
|
49
|
+
*/
|
|
50
|
+
type Money = number;
|
|
51
|
+
/** ISO 4217, напр. 'RUB', 'USD', 'EUR'. */
|
|
52
|
+
type CurrencyCode = string;
|
|
53
|
+
interface Category {
|
|
54
|
+
id: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
title: string;
|
|
57
|
+
parentId?: string | null;
|
|
58
|
+
description?: string;
|
|
59
|
+
}
|
|
60
|
+
interface ProductImage {
|
|
61
|
+
url: string;
|
|
62
|
+
alt?: string;
|
|
63
|
+
width?: number;
|
|
64
|
+
height?: number;
|
|
65
|
+
}
|
|
66
|
+
interface Variant {
|
|
67
|
+
id: string;
|
|
68
|
+
sku: string;
|
|
69
|
+
title?: string;
|
|
70
|
+
price: Money;
|
|
71
|
+
currency: CurrencyCode;
|
|
72
|
+
/** null/undefined = склад не отслеживается. */
|
|
73
|
+
stock?: number | null;
|
|
74
|
+
/** Опции варианта, напр. { size: 'M', color: 'red' }. */
|
|
75
|
+
options?: Record<string, string>;
|
|
76
|
+
}
|
|
77
|
+
interface Seo {
|
|
78
|
+
title?: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
image?: string;
|
|
81
|
+
}
|
|
82
|
+
interface Product {
|
|
83
|
+
id: string;
|
|
84
|
+
slug: string;
|
|
85
|
+
title: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
categoryIds: string[];
|
|
88
|
+
images: ProductImage[];
|
|
89
|
+
variants: Variant[];
|
|
90
|
+
priceRange?: {
|
|
91
|
+
min: Money;
|
|
92
|
+
max: Money;
|
|
93
|
+
currency: CurrencyCode;
|
|
94
|
+
};
|
|
95
|
+
seo?: Seo;
|
|
96
|
+
/**
|
|
97
|
+
* Поля, добавленные фичами через blueprint extend() (контракт 5),
|
|
98
|
+
* сюда мапит адаптер. Контракт остаётся стабильным — фичи читают свои ключи.
|
|
99
|
+
*/
|
|
100
|
+
extensions?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
type ProductSort = 'newest' | 'price-asc' | 'price-desc' | 'relevance';
|
|
103
|
+
interface ProductQuery {
|
|
104
|
+
/** slug категории. */
|
|
105
|
+
category?: string;
|
|
106
|
+
search?: string;
|
|
107
|
+
sort?: ProductSort;
|
|
108
|
+
page?: number;
|
|
109
|
+
perPage?: number;
|
|
110
|
+
/** Фасеты фильтров: { color: ['red','blue'], size: ['M'] }. */
|
|
111
|
+
filters?: Record<string, string[]>;
|
|
112
|
+
}
|
|
113
|
+
interface CartLine {
|
|
114
|
+
id: string;
|
|
115
|
+
variantId: string;
|
|
116
|
+
productId: string;
|
|
117
|
+
title: string;
|
|
118
|
+
quantity: number;
|
|
119
|
+
unitPrice: Money;
|
|
120
|
+
lineTotal: Money;
|
|
121
|
+
image?: string;
|
|
122
|
+
}
|
|
123
|
+
interface Cart {
|
|
124
|
+
id: string;
|
|
125
|
+
lines: CartLine[];
|
|
126
|
+
currency: CurrencyCode;
|
|
127
|
+
subtotal: Money;
|
|
128
|
+
discountTotal?: Money;
|
|
129
|
+
total: Money;
|
|
130
|
+
}
|
|
131
|
+
type OrderStatus = 'pending' | 'paid' | 'fulfilled' | 'cancelled' | 'refunded';
|
|
132
|
+
interface OrderLine {
|
|
133
|
+
variantId: string;
|
|
134
|
+
productId: string;
|
|
135
|
+
title: string;
|
|
136
|
+
quantity: number;
|
|
137
|
+
unitPrice: Money;
|
|
138
|
+
lineTotal: Money;
|
|
139
|
+
}
|
|
140
|
+
interface Order {
|
|
141
|
+
id: string;
|
|
142
|
+
number?: string;
|
|
143
|
+
status: OrderStatus;
|
|
144
|
+
lines: OrderLine[];
|
|
145
|
+
currency: CurrencyCode;
|
|
146
|
+
subtotal: Money;
|
|
147
|
+
discountTotal?: Money;
|
|
148
|
+
total: Money;
|
|
149
|
+
email?: string;
|
|
150
|
+
/** ISO-8601. */
|
|
151
|
+
createdAt: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Источник каталога. Реализуется адаптерами PayloadCatalog* / VendureCatalog*.
|
|
155
|
+
* Нужен на всех уровнях (каталог и выше).
|
|
156
|
+
*/
|
|
157
|
+
interface CatalogSource {
|
|
158
|
+
listProducts(query: ProductQuery): Promise<Product[]>;
|
|
159
|
+
getProduct(slug: string): Promise<Product | null>;
|
|
160
|
+
listCategories(): Promise<Category[]>;
|
|
161
|
+
search(term: string): Promise<Product[]>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Коммерческий бэкенд. Только simple-store / full-store.
|
|
165
|
+
* Реализуется PayloadCommerce* / VendureCommerce*.
|
|
166
|
+
* Полная поверхность корзины зафиксирована в v1 (добавлять методы в интерфейс
|
|
167
|
+
* позже = ломающее изменение для реализаций).
|
|
168
|
+
*/
|
|
169
|
+
interface CommerceBackend {
|
|
170
|
+
createCart(): Promise<Cart>;
|
|
171
|
+
getCart(cartId: string): Promise<Cart | null>;
|
|
172
|
+
addItem(cartId: string, variantId: string, qty: number): Promise<Cart>;
|
|
173
|
+
updateItem(cartId: string, lineId: string, qty: number): Promise<Cart>;
|
|
174
|
+
removeItem(cartId: string, lineId: string): Promise<Cart>;
|
|
175
|
+
/** Hosted checkout активного платёжного провайдера → redirectUrl. */
|
|
176
|
+
startCheckout(cartId: string): Promise<{
|
|
177
|
+
redirectUrl: string;
|
|
178
|
+
}>;
|
|
179
|
+
getOrder(id: string): Promise<Order | null>;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** 32 слота v1. Порядок и группировка — как в утверждённом предложении. */
|
|
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
|
+
type SlotId = (typeof SLOT_IDS)[number];
|
|
185
|
+
/** Zod-перечисление слотов (для валидации feature.json / site.config). */
|
|
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
|
+
/**
|
|
188
|
+
* Декларативная регистрация слота в манифесте фичи (feature.json, §8 спеки):
|
|
189
|
+
* component — ИМЯ компонента, резолвится в репозитории клиента.
|
|
190
|
+
*/
|
|
191
|
+
declare const slotRegistrationSchema: z.ZodObject<{
|
|
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"]>;
|
|
193
|
+
component: z.ZodString;
|
|
194
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
}, "strip", z.ZodTypeAny, {
|
|
196
|
+
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";
|
|
197
|
+
component: string;
|
|
198
|
+
order?: number | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
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";
|
|
201
|
+
component: string;
|
|
202
|
+
order?: number | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
type SlotRegistration = z.infer<typeof slotRegistrationSchema>;
|
|
205
|
+
/**
|
|
206
|
+
* Рантайм-привязка имени к фактическому компоненту (используется @vitrine-kit/core
|
|
207
|
+
* в lib/slots.ts клиента). Дженерик по типу компонента, чтобы контракт не
|
|
208
|
+
* зависел от React.
|
|
209
|
+
*/
|
|
210
|
+
interface SlotMount<TComponent = unknown> {
|
|
211
|
+
slot: SlotId;
|
|
212
|
+
component: TComponent;
|
|
213
|
+
order?: number;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Переопределение/порядок секции страницы (композиция поверх wireframe). */
|
|
217
|
+
declare const layoutSectionSchema: z.ZodObject<{
|
|
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
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
220
|
+
/** Путь к override-компоненту в репо клиента (уникальное — как override, §13). */
|
|
221
|
+
override: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
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";
|
|
224
|
+
enabled: boolean;
|
|
225
|
+
override?: string | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
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";
|
|
228
|
+
enabled?: boolean | undefined;
|
|
229
|
+
override?: string | undefined;
|
|
230
|
+
}>;
|
|
231
|
+
type LayoutSection = z.infer<typeof layoutSectionSchema>;
|
|
232
|
+
declare const integrationsSchema: z.ZodDefault<z.ZodObject<{
|
|
233
|
+
payments: z.ZodOptional<z.ZodEnum<["stripe", "paddle", "yookassa"]>>;
|
|
234
|
+
email: z.ZodOptional<z.ZodString>;
|
|
235
|
+
analytics: z.ZodOptional<z.ZodString>;
|
|
236
|
+
media: z.ZodOptional<z.ZodString>;
|
|
237
|
+
shipping: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
payments?: "stripe" | "paddle" | "yookassa" | undefined;
|
|
240
|
+
email?: string | undefined;
|
|
241
|
+
analytics?: string | undefined;
|
|
242
|
+
media?: string | undefined;
|
|
243
|
+
shipping?: string | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
payments?: "stripe" | "paddle" | "yookassa" | undefined;
|
|
246
|
+
email?: string | undefined;
|
|
247
|
+
analytics?: string | undefined;
|
|
248
|
+
media?: string | undefined;
|
|
249
|
+
shipping?: string | undefined;
|
|
250
|
+
}>>;
|
|
251
|
+
declare const i18nSchema: z.ZodDefault<z.ZodObject<{
|
|
252
|
+
defaultLocale: z.ZodDefault<z.ZodString>;
|
|
253
|
+
locales: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
254
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
255
|
+
priceFormat: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
defaultLocale: string;
|
|
258
|
+
locales: string[];
|
|
259
|
+
currency: string;
|
|
260
|
+
priceFormat?: string | undefined;
|
|
261
|
+
}, {
|
|
262
|
+
defaultLocale?: string | undefined;
|
|
263
|
+
locales?: string[] | undefined;
|
|
264
|
+
currency?: string | undefined;
|
|
265
|
+
priceFormat?: string | undefined;
|
|
266
|
+
}>>;
|
|
267
|
+
declare const themeSchema: z.ZodDefault<z.ZodObject<{
|
|
268
|
+
name: z.ZodDefault<z.ZodString>;
|
|
269
|
+
/** Файл со значениями токенов (заполняет дизайн-шаг). */
|
|
270
|
+
cssFile: z.ZodDefault<z.ZodString>;
|
|
271
|
+
}, "strip", z.ZodTypeAny, {
|
|
272
|
+
name: string;
|
|
273
|
+
cssFile: string;
|
|
274
|
+
}, {
|
|
275
|
+
name?: string | undefined;
|
|
276
|
+
cssFile?: string | undefined;
|
|
277
|
+
}>>;
|
|
278
|
+
declare const siteConfigSchema: z.ZodObject<{
|
|
279
|
+
backend: z.ZodEnum<["payload", "vendure"]>;
|
|
280
|
+
tier: z.ZodEnum<["catalog", "simple-store", "full-store"]>;
|
|
281
|
+
/** Флаги фич: { 'reviews': true }. Поднимаются примитивом установки. */
|
|
282
|
+
features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
283
|
+
layout: z.ZodDefault<z.ZodObject<{
|
|
284
|
+
sections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
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
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
287
|
+
/** Путь к override-компоненту в репо клиента (уникальное — как override, §13). */
|
|
288
|
+
override: z.ZodOptional<z.ZodString>;
|
|
289
|
+
}, "strip", z.ZodTypeAny, {
|
|
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";
|
|
291
|
+
enabled: boolean;
|
|
292
|
+
override?: string | undefined;
|
|
293
|
+
}, {
|
|
294
|
+
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";
|
|
295
|
+
enabled?: boolean | undefined;
|
|
296
|
+
override?: string | undefined;
|
|
297
|
+
}>, "many">>;
|
|
298
|
+
}, "strip", z.ZodTypeAny, {
|
|
299
|
+
sections: {
|
|
300
|
+
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";
|
|
301
|
+
enabled: boolean;
|
|
302
|
+
override?: string | undefined;
|
|
303
|
+
}[];
|
|
304
|
+
}, {
|
|
305
|
+
sections?: {
|
|
306
|
+
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";
|
|
307
|
+
enabled?: boolean | undefined;
|
|
308
|
+
override?: string | undefined;
|
|
309
|
+
}[] | undefined;
|
|
310
|
+
}>>;
|
|
311
|
+
theme: z.ZodDefault<z.ZodObject<{
|
|
312
|
+
name: z.ZodDefault<z.ZodString>;
|
|
313
|
+
/** Файл со значениями токенов (заполняет дизайн-шаг). */
|
|
314
|
+
cssFile: z.ZodDefault<z.ZodString>;
|
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
name: string;
|
|
317
|
+
cssFile: string;
|
|
318
|
+
}, {
|
|
319
|
+
name?: string | undefined;
|
|
320
|
+
cssFile?: string | undefined;
|
|
321
|
+
}>>;
|
|
322
|
+
integrations: z.ZodDefault<z.ZodObject<{
|
|
323
|
+
payments: z.ZodOptional<z.ZodEnum<["stripe", "paddle", "yookassa"]>>;
|
|
324
|
+
email: z.ZodOptional<z.ZodString>;
|
|
325
|
+
analytics: z.ZodOptional<z.ZodString>;
|
|
326
|
+
media: z.ZodOptional<z.ZodString>;
|
|
327
|
+
shipping: z.ZodOptional<z.ZodString>;
|
|
328
|
+
}, "strip", z.ZodTypeAny, {
|
|
329
|
+
payments?: "stripe" | "paddle" | "yookassa" | undefined;
|
|
330
|
+
email?: string | undefined;
|
|
331
|
+
analytics?: string | undefined;
|
|
332
|
+
media?: string | undefined;
|
|
333
|
+
shipping?: string | undefined;
|
|
334
|
+
}, {
|
|
335
|
+
payments?: "stripe" | "paddle" | "yookassa" | undefined;
|
|
336
|
+
email?: string | undefined;
|
|
337
|
+
analytics?: string | undefined;
|
|
338
|
+
media?: string | undefined;
|
|
339
|
+
shipping?: string | undefined;
|
|
340
|
+
}>>;
|
|
341
|
+
i18n: z.ZodDefault<z.ZodObject<{
|
|
342
|
+
defaultLocale: z.ZodDefault<z.ZodString>;
|
|
343
|
+
locales: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
344
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
345
|
+
priceFormat: z.ZodOptional<z.ZodString>;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
defaultLocale: string;
|
|
348
|
+
locales: string[];
|
|
349
|
+
currency: string;
|
|
350
|
+
priceFormat?: string | undefined;
|
|
351
|
+
}, {
|
|
352
|
+
defaultLocale?: string | undefined;
|
|
353
|
+
locales?: string[] | undefined;
|
|
354
|
+
currency?: string | undefined;
|
|
355
|
+
priceFormat?: string | undefined;
|
|
356
|
+
}>>;
|
|
357
|
+
}, "strip", z.ZodTypeAny, {
|
|
358
|
+
backend: "payload" | "vendure";
|
|
359
|
+
tier: "catalog" | "simple-store" | "full-store";
|
|
360
|
+
features: Record<string, boolean>;
|
|
361
|
+
layout: {
|
|
362
|
+
sections: {
|
|
363
|
+
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";
|
|
364
|
+
enabled: boolean;
|
|
365
|
+
override?: string | undefined;
|
|
366
|
+
}[];
|
|
367
|
+
};
|
|
368
|
+
theme: {
|
|
369
|
+
name: string;
|
|
370
|
+
cssFile: string;
|
|
371
|
+
};
|
|
372
|
+
integrations: {
|
|
373
|
+
payments?: "stripe" | "paddle" | "yookassa" | undefined;
|
|
374
|
+
email?: string | undefined;
|
|
375
|
+
analytics?: string | undefined;
|
|
376
|
+
media?: string | undefined;
|
|
377
|
+
shipping?: string | undefined;
|
|
378
|
+
};
|
|
379
|
+
i18n: {
|
|
380
|
+
defaultLocale: string;
|
|
381
|
+
locales: string[];
|
|
382
|
+
currency: string;
|
|
383
|
+
priceFormat?: string | undefined;
|
|
384
|
+
};
|
|
385
|
+
}, {
|
|
386
|
+
backend: "payload" | "vendure";
|
|
387
|
+
tier: "catalog" | "simple-store" | "full-store";
|
|
388
|
+
features?: Record<string, boolean> | undefined;
|
|
389
|
+
layout?: {
|
|
390
|
+
sections?: {
|
|
391
|
+
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";
|
|
392
|
+
enabled?: boolean | undefined;
|
|
393
|
+
override?: string | undefined;
|
|
394
|
+
}[] | undefined;
|
|
395
|
+
} | undefined;
|
|
396
|
+
theme?: {
|
|
397
|
+
name?: string | undefined;
|
|
398
|
+
cssFile?: string | undefined;
|
|
399
|
+
} | undefined;
|
|
400
|
+
integrations?: {
|
|
401
|
+
payments?: "stripe" | "paddle" | "yookassa" | undefined;
|
|
402
|
+
email?: string | undefined;
|
|
403
|
+
analytics?: string | undefined;
|
|
404
|
+
media?: string | undefined;
|
|
405
|
+
shipping?: string | undefined;
|
|
406
|
+
} | undefined;
|
|
407
|
+
i18n?: {
|
|
408
|
+
defaultLocale?: string | undefined;
|
|
409
|
+
locales?: string[] | undefined;
|
|
410
|
+
currency?: string | undefined;
|
|
411
|
+
priceFormat?: string | undefined;
|
|
412
|
+
} | undefined;
|
|
413
|
+
}>;
|
|
414
|
+
type SiteConfig = z.infer<typeof siteConfigSchema>;
|
|
415
|
+
|
|
416
|
+
/** Базовые коллекции blueprint, которые фича может расширять. */
|
|
417
|
+
declare const BLUEPRINT_COLLECTIONS: readonly ["product", "variant", "category", "media", "order", "user"];
|
|
418
|
+
type BlueprintCollection = (typeof BLUEPRINT_COLLECTIONS)[number];
|
|
419
|
+
declare const blueprintCollectionSchema: z.ZodEnum<["product", "variant", "category", "media", "order", "user"]>;
|
|
420
|
+
/** Поддерживаемые типы добавляемых полей (минимальный набор v1). */
|
|
421
|
+
declare const BLUEPRINT_FIELD_TYPES: readonly ["text", "textarea", "richText", "number", "checkbox", "select", "relationship", "date", "json", "array", "group"];
|
|
422
|
+
type BlueprintFieldType = (typeof BLUEPRINT_FIELD_TYPES)[number];
|
|
423
|
+
/**
|
|
424
|
+
* Определение добавляемого поля (рантайм-форма для @vitrine-kit/payload-blueprint).
|
|
425
|
+
* Допускает доп. ключи Payload-поля (options, relationTo, …) через passthrough.
|
|
426
|
+
*/
|
|
427
|
+
declare const blueprintFieldDefSchema: z.ZodObject<{
|
|
428
|
+
name: z.ZodString;
|
|
429
|
+
type: z.ZodEnum<["text", "textarea", "richText", "number", "checkbox", "select", "relationship", "date", "json", "array", "group"]>;
|
|
430
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
431
|
+
label: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
433
|
+
name: z.ZodString;
|
|
434
|
+
type: z.ZodEnum<["text", "textarea", "richText", "number", "checkbox", "select", "relationship", "date", "json", "array", "group"]>;
|
|
435
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
436
|
+
label: z.ZodOptional<z.ZodString>;
|
|
437
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
438
|
+
name: z.ZodString;
|
|
439
|
+
type: z.ZodEnum<["text", "textarea", "richText", "number", "checkbox", "select", "relationship", "date", "json", "array", "group"]>;
|
|
440
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
441
|
+
label: z.ZodOptional<z.ZodString>;
|
|
442
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
443
|
+
type BlueprintFieldDef = z.infer<typeof blueprintFieldDefSchema>;
|
|
444
|
+
/** Рантайм-расширение, применяемое extend(). */
|
|
445
|
+
interface BlueprintExtension {
|
|
446
|
+
extend: BlueprintCollection;
|
|
447
|
+
addFields: BlueprintFieldDef[];
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Сигнатура extend(), реализуемая в @vitrine-kit/payload-blueprint.
|
|
451
|
+
* Аддитивна по контракту: добавляет поля в коллекцию.
|
|
452
|
+
*/
|
|
453
|
+
type Extend = (collection: BlueprintCollection, patch: {
|
|
454
|
+
addFields: BlueprintFieldDef[];
|
|
455
|
+
}) => void;
|
|
456
|
+
/**
|
|
457
|
+
* Форма blueprint в манифесте фичи (feature.json, §8): addFields — ИМЕНА полей
|
|
458
|
+
* (строки); фактические определения живут в коде фичи / payload-blueprint.
|
|
459
|
+
*/
|
|
460
|
+
declare const blueprintManifestSchema: z.ZodObject<{
|
|
461
|
+
extend: z.ZodEnum<["product", "variant", "category", "media", "order", "user"]>;
|
|
462
|
+
addFields: z.ZodArray<z.ZodString, "many">;
|
|
463
|
+
}, "strip", z.ZodTypeAny, {
|
|
464
|
+
extend: "order" | "media" | "product" | "variant" | "category" | "user";
|
|
465
|
+
addFields: string[];
|
|
466
|
+
}, {
|
|
467
|
+
extend: "order" | "media" | "product" | "variant" | "category" | "user";
|
|
468
|
+
addFields: string[];
|
|
469
|
+
}>;
|
|
470
|
+
type BlueprintManifest = z.infer<typeof blueprintManifestSchema>;
|
|
471
|
+
|
|
472
|
+
declare const featureFileMapSchema: z.ZodObject<{
|
|
473
|
+
from: z.ZodString;
|
|
474
|
+
to: z.ZodString;
|
|
475
|
+
}, "strip", z.ZodTypeAny, {
|
|
476
|
+
from: string;
|
|
477
|
+
to: string;
|
|
478
|
+
}, {
|
|
479
|
+
from: string;
|
|
480
|
+
to: string;
|
|
481
|
+
}>;
|
|
482
|
+
declare const featureEnvSchema: z.ZodObject<{
|
|
483
|
+
key: z.ZodString;
|
|
484
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
485
|
+
}, "strip", z.ZodTypeAny, {
|
|
486
|
+
required: boolean;
|
|
487
|
+
key: string;
|
|
488
|
+
}, {
|
|
489
|
+
key: string;
|
|
490
|
+
required?: boolean | undefined;
|
|
491
|
+
}>;
|
|
492
|
+
/** registry/<feature>/feature.json — декларативный манифест фичи (§8). */
|
|
493
|
+
declare const featureManifestSchema: z.ZodObject<{
|
|
494
|
+
name: z.ZodString;
|
|
495
|
+
title: z.ZodString;
|
|
496
|
+
kitVersion: z.ZodString;
|
|
497
|
+
/** semver-диапазон требуемых контрактов, напр. ">=1.0.0 <2.0.0". */
|
|
498
|
+
requiresContracts: z.ZodString;
|
|
499
|
+
tier: z.ZodArray<z.ZodEnum<["catalog", "simple-store", "full-store"]>, "atleastone">;
|
|
500
|
+
registryDependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
501
|
+
/** Версионируемые пакеты: { "@vitrine-kit/core": ">=1.0.0" }. */
|
|
502
|
+
corePackages: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
503
|
+
npm: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
504
|
+
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
505
|
+
from: z.ZodString;
|
|
506
|
+
to: z.ZodString;
|
|
507
|
+
}, "strip", z.ZodTypeAny, {
|
|
508
|
+
from: string;
|
|
509
|
+
to: string;
|
|
510
|
+
}, {
|
|
511
|
+
from: string;
|
|
512
|
+
to: string;
|
|
513
|
+
}>, "many">>;
|
|
514
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
515
|
+
set: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
516
|
+
}, "strip", z.ZodTypeAny, {
|
|
517
|
+
set: Record<string, boolean>;
|
|
518
|
+
}, {
|
|
519
|
+
set: Record<string, boolean>;
|
|
520
|
+
}>>;
|
|
521
|
+
/**
|
|
522
|
+
* Платёжный провайдер фичи checkout-<provider>. CLI по нему: (1) генерирует
|
|
523
|
+
* регистрацию провайдера в lib/payments.ts, (2) проставляет integrations.payments
|
|
524
|
+
* в site.config. register<Pascal>Provider() экспортируется из lib/<name>/register.ts.
|
|
525
|
+
*/
|
|
526
|
+
payment: z.ZodOptional<z.ZodObject<{
|
|
527
|
+
provider: z.ZodEnum<["stripe", "paddle", "yookassa"]>;
|
|
528
|
+
}, "strip", z.ZodTypeAny, {
|
|
529
|
+
provider: "stripe" | "paddle" | "yookassa";
|
|
530
|
+
}, {
|
|
531
|
+
provider: "stripe" | "paddle" | "yookassa";
|
|
532
|
+
}>>;
|
|
533
|
+
slots: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
534
|
+
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"]>;
|
|
535
|
+
component: z.ZodString;
|
|
536
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
537
|
+
}, "strip", z.ZodTypeAny, {
|
|
538
|
+
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";
|
|
539
|
+
component: string;
|
|
540
|
+
order?: number | undefined;
|
|
541
|
+
}, {
|
|
542
|
+
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";
|
|
543
|
+
component: string;
|
|
544
|
+
order?: number | undefined;
|
|
545
|
+
}>, "many">>;
|
|
546
|
+
blueprint: z.ZodOptional<z.ZodObject<{
|
|
547
|
+
extend: z.ZodEnum<["product", "variant", "category", "media", "order", "user"]>;
|
|
548
|
+
addFields: z.ZodArray<z.ZodString, "many">;
|
|
549
|
+
}, "strip", z.ZodTypeAny, {
|
|
550
|
+
extend: "order" | "media" | "product" | "variant" | "category" | "user";
|
|
551
|
+
addFields: string[];
|
|
552
|
+
}, {
|
|
553
|
+
extend: "order" | "media" | "product" | "variant" | "category" | "user";
|
|
554
|
+
addFields: string[];
|
|
555
|
+
}>>;
|
|
556
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
557
|
+
key: z.ZodString;
|
|
558
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
559
|
+
}, "strip", z.ZodTypeAny, {
|
|
560
|
+
required: boolean;
|
|
561
|
+
key: string;
|
|
562
|
+
}, {
|
|
563
|
+
key: string;
|
|
564
|
+
required?: boolean | undefined;
|
|
565
|
+
}>, "many">>;
|
|
566
|
+
/** Док, дописываемый в CLAUDE.md клиента. */
|
|
567
|
+
claudeDoc: z.ZodOptional<z.ZodString>;
|
|
568
|
+
conflicts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
569
|
+
removable: z.ZodDefault<z.ZodBoolean>;
|
|
570
|
+
}, "strip", z.ZodTypeAny, {
|
|
571
|
+
name: string;
|
|
572
|
+
tier: ["catalog" | "simple-store" | "full-store", ...("catalog" | "simple-store" | "full-store")[]];
|
|
573
|
+
title: string;
|
|
574
|
+
kitVersion: string;
|
|
575
|
+
requiresContracts: string;
|
|
576
|
+
registryDependencies: string[];
|
|
577
|
+
corePackages: Record<string, string>;
|
|
578
|
+
npm: string[];
|
|
579
|
+
files: {
|
|
580
|
+
from: string;
|
|
581
|
+
to: string;
|
|
582
|
+
}[];
|
|
583
|
+
slots: {
|
|
584
|
+
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";
|
|
585
|
+
component: string;
|
|
586
|
+
order?: number | undefined;
|
|
587
|
+
}[];
|
|
588
|
+
env: {
|
|
589
|
+
required: boolean;
|
|
590
|
+
key: string;
|
|
591
|
+
}[];
|
|
592
|
+
conflicts: string[];
|
|
593
|
+
removable: boolean;
|
|
594
|
+
config?: {
|
|
595
|
+
set: Record<string, boolean>;
|
|
596
|
+
} | undefined;
|
|
597
|
+
payment?: {
|
|
598
|
+
provider: "stripe" | "paddle" | "yookassa";
|
|
599
|
+
} | undefined;
|
|
600
|
+
blueprint?: {
|
|
601
|
+
extend: "order" | "media" | "product" | "variant" | "category" | "user";
|
|
602
|
+
addFields: string[];
|
|
603
|
+
} | undefined;
|
|
604
|
+
claudeDoc?: string | undefined;
|
|
605
|
+
}, {
|
|
606
|
+
name: string;
|
|
607
|
+
tier: ["catalog" | "simple-store" | "full-store", ...("catalog" | "simple-store" | "full-store")[]];
|
|
608
|
+
title: string;
|
|
609
|
+
kitVersion: string;
|
|
610
|
+
requiresContracts: string;
|
|
611
|
+
registryDependencies?: string[] | undefined;
|
|
612
|
+
corePackages?: Record<string, string> | undefined;
|
|
613
|
+
npm?: string[] | undefined;
|
|
614
|
+
files?: {
|
|
615
|
+
from: string;
|
|
616
|
+
to: string;
|
|
617
|
+
}[] | undefined;
|
|
618
|
+
config?: {
|
|
619
|
+
set: Record<string, boolean>;
|
|
620
|
+
} | undefined;
|
|
621
|
+
payment?: {
|
|
622
|
+
provider: "stripe" | "paddle" | "yookassa";
|
|
623
|
+
} | undefined;
|
|
624
|
+
slots?: {
|
|
625
|
+
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";
|
|
626
|
+
component: string;
|
|
627
|
+
order?: number | undefined;
|
|
628
|
+
}[] | undefined;
|
|
629
|
+
blueprint?: {
|
|
630
|
+
extend: "order" | "media" | "product" | "variant" | "category" | "user";
|
|
631
|
+
addFields: string[];
|
|
632
|
+
} | undefined;
|
|
633
|
+
env?: {
|
|
634
|
+
key: string;
|
|
635
|
+
required?: boolean | undefined;
|
|
636
|
+
}[] | undefined;
|
|
637
|
+
claudeDoc?: string | undefined;
|
|
638
|
+
conflicts?: string[] | undefined;
|
|
639
|
+
removable?: boolean | undefined;
|
|
640
|
+
}>;
|
|
641
|
+
type FeatureManifest = z.infer<typeof featureManifestSchema>;
|
|
642
|
+
/** vitrine.json — лок-файл клиентского репо (§6). */
|
|
643
|
+
declare const vitrineLockSchema: z.ZodObject<{
|
|
644
|
+
kitVersion: z.ZodString;
|
|
645
|
+
contracts: z.ZodString;
|
|
646
|
+
backend: z.ZodEnum<["payload", "vendure"]>;
|
|
647
|
+
tier: z.ZodEnum<["catalog", "simple-store", "full-store"]>;
|
|
648
|
+
features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
649
|
+
version: z.ZodString;
|
|
650
|
+
}, "strip", z.ZodTypeAny, {
|
|
651
|
+
version: string;
|
|
652
|
+
}, {
|
|
653
|
+
version: string;
|
|
654
|
+
}>>>;
|
|
655
|
+
}, "strip", z.ZodTypeAny, {
|
|
656
|
+
backend: "payload" | "vendure";
|
|
657
|
+
tier: "catalog" | "simple-store" | "full-store";
|
|
658
|
+
features: Record<string, {
|
|
659
|
+
version: string;
|
|
660
|
+
}>;
|
|
661
|
+
kitVersion: string;
|
|
662
|
+
contracts: string;
|
|
663
|
+
}, {
|
|
664
|
+
backend: "payload" | "vendure";
|
|
665
|
+
tier: "catalog" | "simple-store" | "full-store";
|
|
666
|
+
kitVersion: string;
|
|
667
|
+
contracts: string;
|
|
668
|
+
features?: Record<string, {
|
|
669
|
+
version: string;
|
|
670
|
+
}> | undefined;
|
|
671
|
+
}>;
|
|
672
|
+
type VitrineLock = z.infer<typeof vitrineLockSchema>;
|
|
673
|
+
/** registry/_index.json — манифест реестра: все фичи + версия kit. */
|
|
674
|
+
declare const registryIndexSchema: z.ZodObject<{
|
|
675
|
+
kitVersion: z.ZodString;
|
|
676
|
+
contracts: z.ZodString;
|
|
677
|
+
features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
678
|
+
title: z.ZodString;
|
|
679
|
+
kitVersion: z.ZodString;
|
|
680
|
+
tier: z.ZodArray<z.ZodEnum<["catalog", "simple-store", "full-store"]>, "many">;
|
|
681
|
+
}, "strip", z.ZodTypeAny, {
|
|
682
|
+
tier: ("catalog" | "simple-store" | "full-store")[];
|
|
683
|
+
title: string;
|
|
684
|
+
kitVersion: string;
|
|
685
|
+
}, {
|
|
686
|
+
tier: ("catalog" | "simple-store" | "full-store")[];
|
|
687
|
+
title: string;
|
|
688
|
+
kitVersion: string;
|
|
689
|
+
}>>>;
|
|
690
|
+
}, "strip", z.ZodTypeAny, {
|
|
691
|
+
features: Record<string, {
|
|
692
|
+
tier: ("catalog" | "simple-store" | "full-store")[];
|
|
693
|
+
title: string;
|
|
694
|
+
kitVersion: string;
|
|
695
|
+
}>;
|
|
696
|
+
kitVersion: string;
|
|
697
|
+
contracts: string;
|
|
698
|
+
}, {
|
|
699
|
+
kitVersion: string;
|
|
700
|
+
contracts: string;
|
|
701
|
+
features?: Record<string, {
|
|
702
|
+
tier: ("catalog" | "simple-store" | "full-store")[];
|
|
703
|
+
title: string;
|
|
704
|
+
kitVersion: string;
|
|
705
|
+
}> | undefined;
|
|
706
|
+
}>;
|
|
707
|
+
type RegistryIndex = z.infer<typeof registryIndexSchema>;
|
|
708
|
+
|
|
709
|
+
declare const CONTRACTS_VERSION: "1.0.0";
|
|
710
|
+
|
|
711
|
+
export { BACKENDS, BLUEPRINT_COLLECTIONS, BLUEPRINT_FIELD_TYPES, type Backend, type BlueprintCollection, type BlueprintExtension, type BlueprintFieldDef, type BlueprintFieldType, type BlueprintManifest, COLOR_TOKENS, CONTRACTS_VERSION, type Cart, type CartLine, type CatalogSource, type Category, type ColorToken, type CommerceBackend, type CurrencyCode, type Extend, FONT_TOKENS, FONT_WEIGHT_TOKENS, type FeatureManifest, type FontToken, type FontWeightToken, LEADING_TOKENS, type LayoutSection, type LeadingToken, MOTION_TOKENS, type Money, type MotionToken, type Order, type OrderLine, type OrderStatus, type Product, type ProductImage, type ProductQuery, type ProductSort, RADIUS_TOKENS, type RadiusToken, type RegistryIndex, SHADOW_TOKENS, SINGLETON_TOKENS, SLOT_IDS, SPACE_TOKENS, type Seo, type ShadowToken, type SingletonToken, type SiteConfig, type SlotId, type SlotMount, type SlotRegistration, type SpaceToken, TIERS, TOKEN_CSS_VARS, TRACKING_TOKENS, type Tier, type TrackingToken, type Variant, type VitrineLock, backendSchema, blueprintCollectionSchema, blueprintFieldDefSchema, blueprintManifestSchema, cssVar, featureEnvSchema, featureFileMapSchema, featureManifestSchema, i18nSchema, integrationsSchema, layoutSectionSchema, registryIndexSchema, siteConfigSchema, slotIdSchema, slotRegistrationSchema, themeSchema, tierSchema, vitrineLockSchema, vitrinePreset };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
// src/common.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var TIERS = ["catalog", "simple-store", "full-store"];
|
|
4
|
+
var tierSchema = z.enum(TIERS);
|
|
5
|
+
var BACKENDS = ["payload", "vendure"];
|
|
6
|
+
var backendSchema = z.enum(BACKENDS);
|
|
7
|
+
|
|
8
|
+
// src/tokens.ts
|
|
9
|
+
var COLOR_TOKENS = [
|
|
10
|
+
"bg",
|
|
11
|
+
"fg",
|
|
12
|
+
"muted",
|
|
13
|
+
"muted-fg",
|
|
14
|
+
"surface",
|
|
15
|
+
"surface-fg",
|
|
16
|
+
"border",
|
|
17
|
+
"input",
|
|
18
|
+
"ring",
|
|
19
|
+
"primary",
|
|
20
|
+
"primary-fg",
|
|
21
|
+
"secondary",
|
|
22
|
+
"secondary-fg",
|
|
23
|
+
"accent",
|
|
24
|
+
"accent-fg",
|
|
25
|
+
"success",
|
|
26
|
+
"warning",
|
|
27
|
+
"danger",
|
|
28
|
+
"danger-fg",
|
|
29
|
+
"price",
|
|
30
|
+
"sale"
|
|
31
|
+
];
|
|
32
|
+
var FONT_TOKENS = ["sans", "heading", "mono"];
|
|
33
|
+
var FONT_WEIGHT_TOKENS = ["normal", "medium", "bold", "heading"];
|
|
34
|
+
var LEADING_TOKENS = ["tight", "normal", "relaxed"];
|
|
35
|
+
var TRACKING_TOKENS = ["tight", "normal", "wide"];
|
|
36
|
+
var RADIUS_TOKENS = ["base", "sm", "md", "lg", "full"];
|
|
37
|
+
var SHADOW_TOKENS = ["sm", "md", "lg", "color"];
|
|
38
|
+
var SPACE_TOKENS = ["unit", "container-max", "container-padding", "section-gap"];
|
|
39
|
+
var MOTION_TOKENS = ["duration-fast", "duration-normal", "ease-default"];
|
|
40
|
+
var SINGLETON_TOKENS = ["density", "border-width"];
|
|
41
|
+
function cssVar(group, name) {
|
|
42
|
+
return name ? `--vt-${group}-${name}` : `--vt-${group}`;
|
|
43
|
+
}
|
|
44
|
+
var TOKEN_CSS_VARS = [
|
|
45
|
+
...COLOR_TOKENS.map((t) => cssVar("color", t)),
|
|
46
|
+
...FONT_TOKENS.map((t) => cssVar("font", t)),
|
|
47
|
+
...FONT_WEIGHT_TOKENS.map((t) => cssVar("weight", t)),
|
|
48
|
+
...LEADING_TOKENS.map((t) => cssVar("leading", t)),
|
|
49
|
+
...TRACKING_TOKENS.map((t) => cssVar("tracking", t)),
|
|
50
|
+
...RADIUS_TOKENS.map((t) => cssVar("radius", t)),
|
|
51
|
+
...SHADOW_TOKENS.map((t) => cssVar("shadow", t)),
|
|
52
|
+
...SPACE_TOKENS.map((t) => cssVar("space", t)),
|
|
53
|
+
...MOTION_TOKENS.map((t) => cssVar("motion", t)),
|
|
54
|
+
...SINGLETON_TOKENS.map((t) => cssVar(t))
|
|
55
|
+
];
|
|
56
|
+
var ref = (group, name) => `var(${cssVar(group, name)})`;
|
|
57
|
+
var vitrinePreset = {
|
|
58
|
+
theme: {
|
|
59
|
+
extend: {
|
|
60
|
+
colors: Object.fromEntries(
|
|
61
|
+
COLOR_TOKENS.map((t) => [t, ref("color", t)])
|
|
62
|
+
),
|
|
63
|
+
fontFamily: {
|
|
64
|
+
sans: ref("font", "sans"),
|
|
65
|
+
heading: ref("font", "heading"),
|
|
66
|
+
mono: ref("font", "mono")
|
|
67
|
+
},
|
|
68
|
+
fontWeight: Object.fromEntries(
|
|
69
|
+
FONT_WEIGHT_TOKENS.map((t) => [t, ref("weight", t)])
|
|
70
|
+
),
|
|
71
|
+
lineHeight: Object.fromEntries(
|
|
72
|
+
LEADING_TOKENS.map((t) => [t, ref("leading", t)])
|
|
73
|
+
),
|
|
74
|
+
letterSpacing: Object.fromEntries(
|
|
75
|
+
TRACKING_TOKENS.map((t) => [t, ref("tracking", t)])
|
|
76
|
+
),
|
|
77
|
+
borderRadius: Object.fromEntries(
|
|
78
|
+
RADIUS_TOKENS.map((t) => [t, ref("radius", t)])
|
|
79
|
+
),
|
|
80
|
+
boxShadow: {
|
|
81
|
+
sm: ref("shadow", "sm"),
|
|
82
|
+
md: ref("shadow", "md"),
|
|
83
|
+
lg: ref("shadow", "lg")
|
|
84
|
+
},
|
|
85
|
+
borderWidth: { DEFAULT: ref("border-width") },
|
|
86
|
+
maxWidth: { container: ref("space", "container-max") },
|
|
87
|
+
spacing: {
|
|
88
|
+
unit: ref("space", "unit"),
|
|
89
|
+
gutter: ref("space", "container-padding"),
|
|
90
|
+
section: ref("space", "section-gap")
|
|
91
|
+
},
|
|
92
|
+
transitionDuration: {
|
|
93
|
+
fast: ref("motion", "duration-fast"),
|
|
94
|
+
normal: ref("motion", "duration-normal")
|
|
95
|
+
},
|
|
96
|
+
transitionTimingFunction: { DEFAULT: ref("motion", "ease-default") }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// src/slots.ts
|
|
102
|
+
import { z as z2 } from "zod";
|
|
103
|
+
var SLOT_IDS = [
|
|
104
|
+
// global — на всех страницах
|
|
105
|
+
"global.banner-top",
|
|
106
|
+
"global.header-start",
|
|
107
|
+
"global.header-nav",
|
|
108
|
+
"global.header-actions",
|
|
109
|
+
"global.footer",
|
|
110
|
+
"global.body-end",
|
|
111
|
+
// home
|
|
112
|
+
"home.hero",
|
|
113
|
+
"home.below-hero",
|
|
114
|
+
"home.sections",
|
|
115
|
+
"home.bottom",
|
|
116
|
+
// catalog — листинг/грид
|
|
117
|
+
"catalog.toolbar",
|
|
118
|
+
"catalog.sidebar",
|
|
119
|
+
"catalog.grid-top",
|
|
120
|
+
"catalog.grid-bottom",
|
|
121
|
+
// category
|
|
122
|
+
"category.header",
|
|
123
|
+
"category.below-products",
|
|
124
|
+
// product
|
|
125
|
+
"product.gallery",
|
|
126
|
+
"product.below-title",
|
|
127
|
+
"product.below-price",
|
|
128
|
+
"product.purchase",
|
|
129
|
+
"product.below-description",
|
|
130
|
+
"product.tabs",
|
|
131
|
+
"product.related",
|
|
132
|
+
// cart
|
|
133
|
+
"cart.items-bottom",
|
|
134
|
+
"cart.summary",
|
|
135
|
+
"cart.below",
|
|
136
|
+
// checkout
|
|
137
|
+
"checkout.top",
|
|
138
|
+
"checkout.below",
|
|
139
|
+
// order
|
|
140
|
+
"order.top",
|
|
141
|
+
"order.below",
|
|
142
|
+
// search
|
|
143
|
+
"search.results-top",
|
|
144
|
+
"search.empty"
|
|
145
|
+
];
|
|
146
|
+
var slotIdSchema = z2.enum(SLOT_IDS);
|
|
147
|
+
var slotRegistrationSchema = z2.object({
|
|
148
|
+
slot: slotIdSchema,
|
|
149
|
+
component: z2.string().min(1),
|
|
150
|
+
order: z2.number().int().optional()
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// src/config.ts
|
|
154
|
+
import { z as z3 } from "zod";
|
|
155
|
+
var layoutSectionSchema = z3.object({
|
|
156
|
+
slot: slotIdSchema,
|
|
157
|
+
enabled: z3.boolean().default(true),
|
|
158
|
+
/** Путь к override-компоненту в репо клиента (уникальное — как override, §13). */
|
|
159
|
+
override: z3.string().optional()
|
|
160
|
+
});
|
|
161
|
+
var integrationsSchema = z3.object({
|
|
162
|
+
payments: z3.enum(["stripe", "paddle", "yookassa"]).optional(),
|
|
163
|
+
email: z3.string().optional(),
|
|
164
|
+
analytics: z3.string().optional(),
|
|
165
|
+
media: z3.string().optional(),
|
|
166
|
+
shipping: z3.string().optional()
|
|
167
|
+
}).default({});
|
|
168
|
+
var i18nSchema = z3.object({
|
|
169
|
+
defaultLocale: z3.string().default("ru"),
|
|
170
|
+
locales: z3.array(z3.string()).default(["ru"]),
|
|
171
|
+
currency: z3.string().default("RUB"),
|
|
172
|
+
priceFormat: z3.string().optional()
|
|
173
|
+
}).default({ defaultLocale: "ru", locales: ["ru"], currency: "RUB" });
|
|
174
|
+
var themeSchema = z3.object({
|
|
175
|
+
name: z3.string().default("default"),
|
|
176
|
+
/** Файл со значениями токенов (заполняет дизайн-шаг). */
|
|
177
|
+
cssFile: z3.string().default("theme/client.css")
|
|
178
|
+
}).default({ name: "default", cssFile: "theme/client.css" });
|
|
179
|
+
var siteConfigSchema = z3.object({
|
|
180
|
+
backend: backendSchema,
|
|
181
|
+
tier: tierSchema,
|
|
182
|
+
/** Флаги фич: { 'reviews': true }. Поднимаются примитивом установки. */
|
|
183
|
+
features: z3.record(z3.string(), z3.boolean()).default({}),
|
|
184
|
+
layout: z3.object({ sections: z3.array(layoutSectionSchema).default([]) }).default({ sections: [] }),
|
|
185
|
+
theme: themeSchema,
|
|
186
|
+
integrations: integrationsSchema,
|
|
187
|
+
i18n: i18nSchema
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// src/blueprint.ts
|
|
191
|
+
import { z as z4 } from "zod";
|
|
192
|
+
var BLUEPRINT_COLLECTIONS = [
|
|
193
|
+
"product",
|
|
194
|
+
"variant",
|
|
195
|
+
"category",
|
|
196
|
+
"media",
|
|
197
|
+
"order",
|
|
198
|
+
"user"
|
|
199
|
+
];
|
|
200
|
+
var blueprintCollectionSchema = z4.enum(BLUEPRINT_COLLECTIONS);
|
|
201
|
+
var BLUEPRINT_FIELD_TYPES = [
|
|
202
|
+
"text",
|
|
203
|
+
"textarea",
|
|
204
|
+
"richText",
|
|
205
|
+
"number",
|
|
206
|
+
"checkbox",
|
|
207
|
+
"select",
|
|
208
|
+
"relationship",
|
|
209
|
+
"date",
|
|
210
|
+
"json",
|
|
211
|
+
"array",
|
|
212
|
+
"group"
|
|
213
|
+
];
|
|
214
|
+
var blueprintFieldDefSchema = z4.object({
|
|
215
|
+
name: z4.string().min(1),
|
|
216
|
+
type: z4.enum(BLUEPRINT_FIELD_TYPES),
|
|
217
|
+
required: z4.boolean().optional(),
|
|
218
|
+
label: z4.string().optional()
|
|
219
|
+
}).passthrough();
|
|
220
|
+
var blueprintManifestSchema = z4.object({
|
|
221
|
+
extend: blueprintCollectionSchema,
|
|
222
|
+
addFields: z4.array(z4.string().min(1))
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// src/manifest.ts
|
|
226
|
+
import { z as z5 } from "zod";
|
|
227
|
+
var featureFileMapSchema = z5.object({
|
|
228
|
+
from: z5.string().min(1),
|
|
229
|
+
to: z5.string().min(1)
|
|
230
|
+
});
|
|
231
|
+
var featureEnvSchema = z5.object({
|
|
232
|
+
key: z5.string().min(1),
|
|
233
|
+
required: z5.boolean().default(false)
|
|
234
|
+
});
|
|
235
|
+
var featureManifestSchema = z5.object({
|
|
236
|
+
name: z5.string().min(1),
|
|
237
|
+
title: z5.string().min(1),
|
|
238
|
+
kitVersion: z5.string().min(1),
|
|
239
|
+
/** semver-диапазон требуемых контрактов, напр. ">=1.0.0 <2.0.0". */
|
|
240
|
+
requiresContracts: z5.string().min(1),
|
|
241
|
+
tier: z5.array(tierSchema).nonempty(),
|
|
242
|
+
registryDependencies: z5.array(z5.string()).default([]),
|
|
243
|
+
/** Версионируемые пакеты: { "@vitrine-kit/core": ">=1.0.0" }. */
|
|
244
|
+
corePackages: z5.record(z5.string(), z5.string()).default({}),
|
|
245
|
+
npm: z5.array(z5.string()).default([]),
|
|
246
|
+
files: z5.array(featureFileMapSchema).default([]),
|
|
247
|
+
config: z5.object({ set: z5.record(z5.string(), z5.boolean()) }).optional(),
|
|
248
|
+
/**
|
|
249
|
+
* Платёжный провайдер фичи checkout-<provider>. CLI по нему: (1) генерирует
|
|
250
|
+
* регистрацию провайдера в lib/payments.ts, (2) проставляет integrations.payments
|
|
251
|
+
* в site.config. register<Pascal>Provider() экспортируется из lib/<name>/register.ts.
|
|
252
|
+
*/
|
|
253
|
+
payment: z5.object({ provider: z5.enum(["stripe", "paddle", "yookassa"]) }).optional(),
|
|
254
|
+
slots: z5.array(slotRegistrationSchema).default([]),
|
|
255
|
+
blueprint: blueprintManifestSchema.optional(),
|
|
256
|
+
env: z5.array(featureEnvSchema).default([]),
|
|
257
|
+
/** Док, дописываемый в CLAUDE.md клиента. */
|
|
258
|
+
claudeDoc: z5.string().optional(),
|
|
259
|
+
conflicts: z5.array(z5.string()).default([]),
|
|
260
|
+
removable: z5.boolean().default(true)
|
|
261
|
+
});
|
|
262
|
+
var vitrineLockSchema = z5.object({
|
|
263
|
+
kitVersion: z5.string().min(1),
|
|
264
|
+
contracts: z5.string().min(1),
|
|
265
|
+
backend: backendSchema,
|
|
266
|
+
tier: tierSchema,
|
|
267
|
+
features: z5.record(z5.string(), z5.object({ version: z5.string().min(1) })).default({})
|
|
268
|
+
});
|
|
269
|
+
var registryIndexSchema = z5.object({
|
|
270
|
+
kitVersion: z5.string().min(1),
|
|
271
|
+
contracts: z5.string().min(1),
|
|
272
|
+
features: z5.record(
|
|
273
|
+
z5.string(),
|
|
274
|
+
z5.object({
|
|
275
|
+
title: z5.string(),
|
|
276
|
+
kitVersion: z5.string(),
|
|
277
|
+
tier: z5.array(tierSchema)
|
|
278
|
+
})
|
|
279
|
+
).default({})
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// src/index.ts
|
|
283
|
+
var CONTRACTS_VERSION = "1.0.0";
|
|
284
|
+
export {
|
|
285
|
+
BACKENDS,
|
|
286
|
+
BLUEPRINT_COLLECTIONS,
|
|
287
|
+
BLUEPRINT_FIELD_TYPES,
|
|
288
|
+
COLOR_TOKENS,
|
|
289
|
+
CONTRACTS_VERSION,
|
|
290
|
+
FONT_TOKENS,
|
|
291
|
+
FONT_WEIGHT_TOKENS,
|
|
292
|
+
LEADING_TOKENS,
|
|
293
|
+
MOTION_TOKENS,
|
|
294
|
+
RADIUS_TOKENS,
|
|
295
|
+
SHADOW_TOKENS,
|
|
296
|
+
SINGLETON_TOKENS,
|
|
297
|
+
SLOT_IDS,
|
|
298
|
+
SPACE_TOKENS,
|
|
299
|
+
TIERS,
|
|
300
|
+
TOKEN_CSS_VARS,
|
|
301
|
+
TRACKING_TOKENS,
|
|
302
|
+
backendSchema,
|
|
303
|
+
blueprintCollectionSchema,
|
|
304
|
+
blueprintFieldDefSchema,
|
|
305
|
+
blueprintManifestSchema,
|
|
306
|
+
cssVar,
|
|
307
|
+
featureEnvSchema,
|
|
308
|
+
featureFileMapSchema,
|
|
309
|
+
featureManifestSchema,
|
|
310
|
+
i18nSchema,
|
|
311
|
+
integrationsSchema,
|
|
312
|
+
layoutSectionSchema,
|
|
313
|
+
registryIndexSchema,
|
|
314
|
+
siteConfigSchema,
|
|
315
|
+
slotIdSchema,
|
|
316
|
+
slotRegistrationSchema,
|
|
317
|
+
themeSchema,
|
|
318
|
+
tierSchema,
|
|
319
|
+
vitrineLockSchema,
|
|
320
|
+
vitrinePreset
|
|
321
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vitrine-kit/contracts",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Vitrine — пять стабильных контрактов: Tokens, Data, Slots, Config, Blueprint.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/vitrine-kit/vitrine.git",
|
|
25
|
+
"directory": "packages/contracts"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"zod": "^3.23.8"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"tsx": "^4.19.2",
|
|
32
|
+
"zod-to-json-schema": "^3.24.1"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"test": "vitest run --passWithNoTests",
|
|
38
|
+
"schemas": "tsx scripts/generate-schemas.ts"
|
|
39
|
+
}
|
|
40
|
+
}
|