@shoppexio/builder-contracts 0.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/dist/builder-contracts.test.d.ts +2 -0
- package/dist/builder-contracts.test.d.ts.map +1 -0
- package/dist/builder-contracts.test.js +361 -0
- package/dist/builder-settings.d.ts +801 -0
- package/dist/builder-settings.d.ts.map +1 -0
- package/dist/builder-settings.js +65 -0
- package/dist/events.d.ts +512 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +104 -0
- package/dist/fields.d.ts +300 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +111 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/legacy-manifest.d.ts +172 -0
- package/dist/legacy-manifest.d.ts.map +1 -0
- package/dist/legacy-manifest.js +272 -0
- package/dist/migrations.d.ts +31 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +175 -0
- package/dist/preview-protocol.d.ts +687 -0
- package/dist/preview-protocol.d.ts.map +1 -0
- package/dist/preview-protocol.js +79 -0
- package/dist/style-slots.d.ts +209 -0
- package/dist/style-slots.d.ts.map +1 -0
- package/dist/style-slots.js +93 -0
- package/dist/theme-manifest.d.ts +845 -0
- package/dist/theme-manifest.d.ts.map +1 -0
- package/dist/theme-manifest.js +119 -0
- package/dist/validation.d.ts +16 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +131 -0
- package/package.json +95 -0
- package/src/builder-contracts.test.ts +405 -0
- package/src/builder-settings.ts +85 -0
- package/src/events.ts +121 -0
- package/src/fields.ts +134 -0
- package/src/index.ts +9 -0
- package/src/legacy-manifest.ts +321 -0
- package/src/migrations.ts +240 -0
- package/src/preview-protocol.ts +93 -0
- package/src/style-slots.ts +111 -0
- package/src/theme-manifest.ts +140 -0
- package/src/validation.ts +196 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-manifest.d.ts","sourceRoot":"","sources":["../src/theme-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,eAAO,MAAM,aAAa,aAAoD,CAAC;AAC/E,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,eAAO,MAAM,kBAAkB;;;;kBAMpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;kBAMpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;;;;;;kBAOpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAWrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+D5B,CAAC;AACL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAEhE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { BlockSettingsSchema } from "./fields.js";
|
|
3
|
+
import { StyleSlotDefaultsSchema, StyleSlotIdSchema } from "./style-slots.js";
|
|
4
|
+
export const ThemeIdSchema = z.string().min(1).regex(/^[a-z0-9][a-z0-9-_.]*$/);
|
|
5
|
+
export const BlockVariantSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
id: z.string().min(1),
|
|
8
|
+
label: z.string().min(1),
|
|
9
|
+
previewImage: z.string().url().optional(),
|
|
10
|
+
})
|
|
11
|
+
.strict();
|
|
12
|
+
export const DefaultBlockSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
type: z.string().min(1),
|
|
15
|
+
variant: z.string().min(1).optional(),
|
|
16
|
+
settings: z.record(z.string().min(1), z.unknown()).optional(),
|
|
17
|
+
})
|
|
18
|
+
.strict();
|
|
19
|
+
export const ManifestPageSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
label: z.string().min(1),
|
|
22
|
+
previewPath: z.string().min(1).optional(),
|
|
23
|
+
allowedBlocks: z.array(z.string().min(1)).default([]),
|
|
24
|
+
defaultBlocks: z.array(DefaultBlockSchema).default([]),
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
export const BlockPresetSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
id: z.string().min(1),
|
|
30
|
+
label: z.string().min(1),
|
|
31
|
+
variant: z.string().min(1).optional(),
|
|
32
|
+
settings: z.record(z.string().min(1), z.unknown()).default({}),
|
|
33
|
+
style_overrides: StyleSlotDefaultsSchema.optional(),
|
|
34
|
+
})
|
|
35
|
+
.strict();
|
|
36
|
+
export const ManifestBlockSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
label: z.string().min(1),
|
|
39
|
+
description: z.string().min(1).optional(),
|
|
40
|
+
category: z.string().min(1).optional(),
|
|
41
|
+
maxInstances: z.number().int().positive().optional(),
|
|
42
|
+
variants: z.array(BlockVariantSchema).default([]),
|
|
43
|
+
settings: BlockSettingsSchema.default({}),
|
|
44
|
+
exposedStyleSlots: z.array(StyleSlotIdSchema).default([]),
|
|
45
|
+
presets: z.array(BlockPresetSchema).default([]),
|
|
46
|
+
})
|
|
47
|
+
.strict();
|
|
48
|
+
export const ThemePresetSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
label: z.string().min(1),
|
|
51
|
+
description: z.string().min(1).optional(),
|
|
52
|
+
content: z.record(z.string().min(1), z.unknown()).default({}),
|
|
53
|
+
layout: z.record(z.string().min(1), z.unknown()).default({}),
|
|
54
|
+
style_slots: StyleSlotDefaultsSchema.default({}),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
export const ThemeManifestSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
id: ThemeIdSchema,
|
|
60
|
+
name: z.string().min(1),
|
|
61
|
+
version: z.string().min(1),
|
|
62
|
+
pages: z.record(z.string().min(1), ManifestPageSchema),
|
|
63
|
+
blocks: z.record(z.string().min(1), ManifestBlockSchema),
|
|
64
|
+
styleSlots: StyleSlotDefaultsSchema.default({}),
|
|
65
|
+
presets: z.record(z.string().min(1), ThemePresetSchema).default({}),
|
|
66
|
+
})
|
|
67
|
+
.strict()
|
|
68
|
+
.superRefine((manifest, ctx) => {
|
|
69
|
+
for (const [pageId, page] of Object.entries(manifest.pages)) {
|
|
70
|
+
for (const blockType of page.allowedBlocks) {
|
|
71
|
+
if (!manifest.blocks[blockType]) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
code: 'custom',
|
|
74
|
+
path: ['pages', pageId, 'allowedBlocks'],
|
|
75
|
+
message: `Page "${pageId}" allows unknown block "${blockType}"`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const [index, block] of page.defaultBlocks.entries()) {
|
|
80
|
+
if (!manifest.blocks[block.type]) {
|
|
81
|
+
ctx.addIssue({
|
|
82
|
+
code: 'custom',
|
|
83
|
+
path: ['pages', pageId, 'defaultBlocks', index, 'type'],
|
|
84
|
+
message: `Page "${pageId}" defaults unknown block "${block.type}"`,
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (!page.allowedBlocks.includes(block.type)) {
|
|
89
|
+
ctx.addIssue({
|
|
90
|
+
code: 'custom',
|
|
91
|
+
path: ['pages', pageId, 'defaultBlocks', index, 'type'],
|
|
92
|
+
message: `Page "${pageId}" defaults block "${block.type}" without allowing it`,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const blockDefinition = manifest.blocks[block.type];
|
|
96
|
+
if (block.variant && !blockDefinition.variants.some((variant) => variant.id === block.variant)) {
|
|
97
|
+
ctx.addIssue({
|
|
98
|
+
code: 'custom',
|
|
99
|
+
path: ['pages', pageId, 'defaultBlocks', index, 'variant'],
|
|
100
|
+
message: `Block "${block.type}" does not expose variant "${block.variant}"`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (const [blockType, block] of Object.entries(manifest.blocks)) {
|
|
106
|
+
for (const preset of block.presets) {
|
|
107
|
+
if (preset.variant && !block.variants.some((variant) => variant.id === preset.variant)) {
|
|
108
|
+
ctx.addIssue({
|
|
109
|
+
code: 'custom',
|
|
110
|
+
path: ['blocks', blockType, 'presets', preset.id, 'variant'],
|
|
111
|
+
message: `Block preset "${preset.id}" references unknown variant "${preset.variant}"`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
export function parseThemeManifest(input) {
|
|
118
|
+
return ThemeManifestSchema.parse(input);
|
|
119
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BuilderSettings } from './builder-settings.ts';
|
|
2
|
+
import type { ThemeManifest } from './theme-manifest.ts';
|
|
3
|
+
export type BuilderManifestValidationIssueCode = 'unknown_page' | 'duplicate_block_id' | 'unknown_block_type' | 'block_not_allowed' | 'too_many_block_instances' | 'unknown_block_variant' | 'unknown_block_setting' | 'unexposed_style_slot';
|
|
4
|
+
export type BuilderManifestValidationIssue = {
|
|
5
|
+
code: BuilderManifestValidationIssueCode;
|
|
6
|
+
path: string;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class BuilderManifestValidationError extends Error {
|
|
10
|
+
readonly issues: BuilderManifestValidationIssue[];
|
|
11
|
+
constructor(issues: BuilderManifestValidationIssue[]);
|
|
12
|
+
}
|
|
13
|
+
export declare function validateBuilderSettingsAgainstManifest(settings: BuilderSettings, manifest: ThemeManifest): BuilderManifestValidationIssue[];
|
|
14
|
+
export declare function assertBuilderSettingsMatchManifest(settings: BuilderSettings, manifest: ThemeManifest): void;
|
|
15
|
+
export declare function formatBuilderManifestValidationIssues(issues: BuilderManifestValidationIssue[]): string;
|
|
16
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,kCAAkC,GAC1C,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,mBAAmB,GACnB,0BAA0B,GAC1B,uBAAuB,GACvB,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,kCAAkC,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,QAAQ,CAAC,MAAM,EAAE,8BAA8B,EAAE,CAAC;gBAEtC,MAAM,EAAE,8BAA8B,EAAE;CAKrD;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,aAAa,GACtB,8BAA8B,EAAE,CAkElC;AAED,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAKN;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,8BAA8B,EAAE,GACvC,MAAM,CAQR"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export class BuilderManifestValidationError extends Error {
|
|
2
|
+
issues;
|
|
3
|
+
constructor(issues) {
|
|
4
|
+
super(formatBuilderManifestValidationIssues(issues));
|
|
5
|
+
this.name = 'BuilderManifestValidationError';
|
|
6
|
+
this.issues = issues;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export function validateBuilderSettingsAgainstManifest(settings, manifest) {
|
|
10
|
+
const issues = [];
|
|
11
|
+
for (const [pageId, layout] of Object.entries(settings.theme.layout)) {
|
|
12
|
+
const page = manifest.pages[pageId];
|
|
13
|
+
if (!page) {
|
|
14
|
+
issues.push({
|
|
15
|
+
code: 'unknown_page',
|
|
16
|
+
path: `theme.layout.${pageId}`,
|
|
17
|
+
message: `Unknown builder page "${pageId}"`,
|
|
18
|
+
});
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const blockIds = new Set();
|
|
22
|
+
const blockTypeCounts = new Map();
|
|
23
|
+
for (const [index, block] of layout.blocks.entries()) {
|
|
24
|
+
const blockPath = `theme.layout.${pageId}.blocks.${index}`;
|
|
25
|
+
if (blockIds.has(block.id)) {
|
|
26
|
+
issues.push({
|
|
27
|
+
code: 'duplicate_block_id',
|
|
28
|
+
path: `${blockPath}.id`,
|
|
29
|
+
message: `Duplicate block id "${block.id}" on page "${pageId}"`,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
blockIds.add(block.id);
|
|
33
|
+
const blockDefinition = manifest.blocks[block.type];
|
|
34
|
+
if (!blockDefinition) {
|
|
35
|
+
issues.push({
|
|
36
|
+
code: 'unknown_block_type',
|
|
37
|
+
path: `${blockPath}.type`,
|
|
38
|
+
message: `Unknown builder block type "${block.type}"`,
|
|
39
|
+
});
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (!page.allowedBlocks.includes(block.type)) {
|
|
43
|
+
issues.push({
|
|
44
|
+
code: 'block_not_allowed',
|
|
45
|
+
path: `${blockPath}.type`,
|
|
46
|
+
message: `Block "${block.type}" is not allowed on page "${pageId}"`,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
blockTypeCounts.set(block.type, (blockTypeCounts.get(block.type) ?? 0) + 1);
|
|
50
|
+
validateBlockVariant(block, blockDefinition.variants, blockPath, issues);
|
|
51
|
+
validateBlockSettings(block, Object.keys(blockDefinition.settings), blockPath, issues);
|
|
52
|
+
validateBlockStyleOverrides(block, blockDefinition.exposedStyleSlots, blockPath, issues);
|
|
53
|
+
}
|
|
54
|
+
for (const [blockType, count] of blockTypeCounts.entries()) {
|
|
55
|
+
const maxInstances = manifest.blocks[blockType]?.maxInstances;
|
|
56
|
+
if (maxInstances !== undefined && count > maxInstances) {
|
|
57
|
+
issues.push({
|
|
58
|
+
code: 'too_many_block_instances',
|
|
59
|
+
path: `theme.layout.${pageId}.blocks`,
|
|
60
|
+
message: `Page "${pageId}" has ${count} "${blockType}" blocks but the manifest allows ${maxInstances}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return issues;
|
|
66
|
+
}
|
|
67
|
+
export function assertBuilderSettingsMatchManifest(settings, manifest) {
|
|
68
|
+
const issues = validateBuilderSettingsAgainstManifest(settings, manifest);
|
|
69
|
+
if (issues.length > 0) {
|
|
70
|
+
throw new BuilderManifestValidationError(issues);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export function formatBuilderManifestValidationIssues(issues) {
|
|
74
|
+
if (issues.length === 0) {
|
|
75
|
+
return 'Builder settings match the theme manifest';
|
|
76
|
+
}
|
|
77
|
+
const [firstIssue] = issues;
|
|
78
|
+
const suffix = issues.length === 1 ? '' : ` (+${issues.length - 1} more)`;
|
|
79
|
+
return `${firstIssue.message}${suffix}`;
|
|
80
|
+
}
|
|
81
|
+
function validateBlockSettings(block, settingPaths, blockPath, issues) {
|
|
82
|
+
if (settingPaths.length === 0 && Object.keys(block.settings).length === 0) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const allowedSettings = new Set();
|
|
86
|
+
for (const path of settingPaths) {
|
|
87
|
+
allowedSettings.add(path);
|
|
88
|
+
allowedSettings.add(getShortSettingKey(path));
|
|
89
|
+
}
|
|
90
|
+
for (const key of Object.keys(block.settings)) {
|
|
91
|
+
if (allowedSettings.has(key)) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
issues.push({
|
|
95
|
+
code: 'unknown_block_setting',
|
|
96
|
+
path: `${blockPath}.settings.${key}`,
|
|
97
|
+
message: `Block "${block.id}" stores unknown setting "${key}"`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function validateBlockVariant(block, variants, blockPath, issues) {
|
|
102
|
+
if (!block.variant) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!variants.some((variant) => variant.id === block.variant)) {
|
|
106
|
+
issues.push({
|
|
107
|
+
code: 'unknown_block_variant',
|
|
108
|
+
path: `${blockPath}.variant`,
|
|
109
|
+
message: `Block "${block.id}" uses unknown variant "${block.variant}"`,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function getShortSettingKey(path) {
|
|
114
|
+
const parts = path.split('.').filter(Boolean);
|
|
115
|
+
return parts.at(-1) ?? path;
|
|
116
|
+
}
|
|
117
|
+
function validateBlockStyleOverrides(block, exposedStyleSlots, blockPath, issues) {
|
|
118
|
+
if (!block.style_overrides) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const exposed = new Set(exposedStyleSlots);
|
|
122
|
+
for (const slotId of Object.keys(block.style_overrides)) {
|
|
123
|
+
if (!exposed.has(slotId)) {
|
|
124
|
+
issues.push({
|
|
125
|
+
code: 'unexposed_style_slot',
|
|
126
|
+
path: `${blockPath}.style_overrides.${slotId}`,
|
|
127
|
+
message: `Block "${block.id}" cannot override unexposed style slot "${slotId}"`,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shoppexio/builder-contracts",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared Builder v2 contracts for Shoppex dashboard, backend, preview runtime, and themes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ShoppexIO/shoppex.git",
|
|
9
|
+
"directory": "packages/builder-contracts"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://docs.shoppex.io",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ShoppexIO/shoppex/issues"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"registry": "https://registry.npmjs.org",
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"bun": "./src/index.ts",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./builder-settings": {
|
|
29
|
+
"bun": "./src/builder-settings.ts",
|
|
30
|
+
"types": "./dist/builder-settings.d.ts",
|
|
31
|
+
"import": "./dist/builder-settings.js",
|
|
32
|
+
"default": "./dist/builder-settings.js"
|
|
33
|
+
},
|
|
34
|
+
"./events": {
|
|
35
|
+
"bun": "./src/events.ts",
|
|
36
|
+
"types": "./dist/events.d.ts",
|
|
37
|
+
"import": "./dist/events.js",
|
|
38
|
+
"default": "./dist/events.js"
|
|
39
|
+
},
|
|
40
|
+
"./fields": {
|
|
41
|
+
"bun": "./src/fields.ts",
|
|
42
|
+
"types": "./dist/fields.d.ts",
|
|
43
|
+
"import": "./dist/fields.js",
|
|
44
|
+
"default": "./dist/fields.js"
|
|
45
|
+
},
|
|
46
|
+
"./legacy-manifest": {
|
|
47
|
+
"bun": "./src/legacy-manifest.ts",
|
|
48
|
+
"types": "./dist/legacy-manifest.d.ts",
|
|
49
|
+
"import": "./dist/legacy-manifest.js",
|
|
50
|
+
"default": "./dist/legacy-manifest.js"
|
|
51
|
+
},
|
|
52
|
+
"./migrations": {
|
|
53
|
+
"bun": "./src/migrations.ts",
|
|
54
|
+
"types": "./dist/migrations.d.ts",
|
|
55
|
+
"import": "./dist/migrations.js",
|
|
56
|
+
"default": "./dist/migrations.js"
|
|
57
|
+
},
|
|
58
|
+
"./preview-protocol": {
|
|
59
|
+
"bun": "./src/preview-protocol.ts",
|
|
60
|
+
"types": "./dist/preview-protocol.d.ts",
|
|
61
|
+
"import": "./dist/preview-protocol.js",
|
|
62
|
+
"default": "./dist/preview-protocol.js"
|
|
63
|
+
},
|
|
64
|
+
"./style-slots": {
|
|
65
|
+
"bun": "./src/style-slots.ts",
|
|
66
|
+
"types": "./dist/style-slots.d.ts",
|
|
67
|
+
"import": "./dist/style-slots.js",
|
|
68
|
+
"default": "./dist/style-slots.js"
|
|
69
|
+
},
|
|
70
|
+
"./theme-manifest": {
|
|
71
|
+
"bun": "./src/theme-manifest.ts",
|
|
72
|
+
"types": "./dist/theme-manifest.d.ts",
|
|
73
|
+
"import": "./dist/theme-manifest.js",
|
|
74
|
+
"default": "./dist/theme-manifest.js"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"files": [
|
|
78
|
+
"dist",
|
|
79
|
+
"src"
|
|
80
|
+
],
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsc",
|
|
83
|
+
"typecheck": "tsc --noEmit",
|
|
84
|
+
"test": "bun test ./src",
|
|
85
|
+
"clean": "rm -rf dist"
|
|
86
|
+
},
|
|
87
|
+
"author": "Shoppex",
|
|
88
|
+
"license": "MIT",
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"zod": "^4.3.6"
|
|
91
|
+
},
|
|
92
|
+
"devDependencies": {
|
|
93
|
+
"typescript": "^5.8.3"
|
|
94
|
+
}
|
|
95
|
+
}
|