@caartzee/theme-sdk 1.0.0 → 1.2.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/README.md +208 -20
- package/dist/bin/caartzee-theme.js +1855 -81
- package/dist/lib/index.js +1857 -81
- package/dist/types/src/blocks/block-contract.d.ts +10 -10
- package/dist/types/src/cli/candy-mcp.d.ts +2 -0
- package/dist/types/src/cli/candy-tool-server.d.ts +39 -0
- package/dist/types/src/cli/mcp/component-tools.d.ts +2 -0
- package/dist/types/src/cli/mcp/docs-tools.d.ts +89 -0
- package/dist/types/src/cli/mcp/editor-tools.d.ts +22 -0
- package/dist/types/src/cli/mcp/resources-and-prompts.d.ts +2 -0
- package/dist/types/src/cli/mcp/testing-tools.d.ts +54 -0
- package/dist/types/src/contracts/manifest.d.ts +77 -77
- package/dist/types/src/dev-server/dev-server.d.ts +3 -0
- package/dist/types/src/dev-server/local-commerce-runtime.d.ts +76 -0
- package/dist/types/src/dev-server/local-editor-server.d.ts +22 -0
- package/dist/types/src/dev-server/theme-preview.d.ts +6 -2
- package/dist/types/src/sections/section-contract.d.ts +12 -12
- package/package.json +2 -1
- package/templates/theme-candy-boilerplate/.editorconfig +14 -0
- package/templates/theme-candy-boilerplate/.gitattributes +1 -0
- package/templates/theme-candy-boilerplate/.vscode/extensions.json +7 -0
- package/templates/theme-candy-boilerplate/.vscode/settings.json +17 -0
- package/templates/theme-candy-boilerplate/assets/theme.css +78 -0
- package/templates/theme-candy-boilerplate/assets/theme.js +7 -0
- package/templates/theme-candy-boilerplate/candy.config.json +40 -0
- package/templates/theme-candy-boilerplate/index.ts +39 -0
- package/templates/theme-candy-boilerplate/layout/theme.candy +25 -0
- package/templates/theme-candy-boilerplate/locales/en.default.json +37 -0
- package/templates/theme-candy-boilerplate/manifest.json +123 -0
- package/templates/theme-candy-boilerplate/package.json +16 -0
- package/templates/theme-candy-boilerplate/schemas/settings_schema.json +36 -0
- package/templates/theme-candy-boilerplate/sections/featured-products.candy +89 -0
- package/templates/theme-candy-boilerplate/sections/footer.candy +50 -0
- package/templates/theme-candy-boilerplate/sections/header.candy +116 -0
- package/templates/theme-candy-boilerplate/sections/hero-banner.candy +135 -0
- package/templates/theme-candy-boilerplate/sections/image-with-text.candy +85 -0
- package/templates/theme-candy-boilerplate/snippets/price.candy +19 -0
- package/templates/theme-candy-boilerplate/snippets/product-card.candy +43 -0
- package/templates/theme-candy-boilerplate/templates/404.candy +12 -0
- package/templates/theme-candy-boilerplate/templates/cart.candy +51 -0
- package/templates/theme-candy-boilerplate/templates/collection.candy +51 -0
- package/templates/theme-candy-boilerplate/templates/index.candy +7 -0
- package/templates/theme-candy-boilerplate/templates/page.candy +10 -0
- package/templates/theme-candy-boilerplate/templates/product.candy +59 -0
- package/templates/theme-candy-boilerplate/templates/search.candy +40 -0
- package/templates/vscode-candy/LICENSE +21 -0
- package/templates/vscode-candy/extension.js +689 -338
- package/templates/vscode-candy/icons/candy-logo.png +0 -0
- package/templates/vscode-candy/package.json +18 -3
- package/templates/vscode-candy/snippets/candy.code-snippets +91 -0
|
@@ -10,7 +10,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
10
10
|
allowedParentSections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
11
|
settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
12
|
id: z.ZodString;
|
|
13
|
-
type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
|
|
13
|
+
type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "image_picker", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
|
|
14
14
|
label: z.ZodString;
|
|
15
15
|
default: z.ZodOptional<z.ZodUnknown>;
|
|
16
16
|
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -30,7 +30,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
30
30
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
31
31
|
}, "strip", z.ZodTypeAny, {
|
|
32
32
|
id: string;
|
|
33
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
33
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
34
34
|
label: string;
|
|
35
35
|
options?: {
|
|
36
36
|
value: string | number | boolean;
|
|
@@ -44,7 +44,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
44
44
|
placeholder?: string | undefined;
|
|
45
45
|
}, {
|
|
46
46
|
id: string;
|
|
47
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
47
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
48
48
|
label: string;
|
|
49
49
|
options?: {
|
|
50
50
|
value: string | number | boolean;
|
|
@@ -59,7 +59,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
59
59
|
}>, "many">>;
|
|
60
60
|
settingsSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
61
|
id: z.ZodString;
|
|
62
|
-
type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
|
|
62
|
+
type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "image_picker", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
|
|
63
63
|
label: z.ZodString;
|
|
64
64
|
default: z.ZodOptional<z.ZodUnknown>;
|
|
65
65
|
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -79,7 +79,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
79
79
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
81
|
id: string;
|
|
82
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
82
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
83
83
|
label: string;
|
|
84
84
|
options?: {
|
|
85
85
|
value: string | number | boolean;
|
|
@@ -93,7 +93,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
93
93
|
placeholder?: string | undefined;
|
|
94
94
|
}, {
|
|
95
95
|
id: string;
|
|
96
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
96
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
97
97
|
label: string;
|
|
98
98
|
options?: {
|
|
99
99
|
value: string | number | boolean;
|
|
@@ -111,7 +111,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
111
111
|
type: string;
|
|
112
112
|
settings?: {
|
|
113
113
|
id: string;
|
|
114
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
114
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
115
115
|
label: string;
|
|
116
116
|
options?: {
|
|
117
117
|
value: string | number | boolean;
|
|
@@ -130,7 +130,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
130
130
|
description?: string | undefined;
|
|
131
131
|
settingsSchema?: {
|
|
132
132
|
id: string;
|
|
133
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
133
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
134
134
|
label: string;
|
|
135
135
|
options?: {
|
|
136
136
|
value: string | number | boolean;
|
|
@@ -150,7 +150,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
150
150
|
type: string;
|
|
151
151
|
settings?: {
|
|
152
152
|
id: string;
|
|
153
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
153
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
154
154
|
label: string;
|
|
155
155
|
options?: {
|
|
156
156
|
value: string | number | boolean;
|
|
@@ -169,7 +169,7 @@ export declare const BlockContractSchema: z.ZodObject<{
|
|
|
169
169
|
description?: string | undefined;
|
|
170
170
|
settingsSchema?: {
|
|
171
171
|
id: string;
|
|
172
|
-
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
172
|
+
type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
|
|
173
173
|
label: string;
|
|
174
174
|
options?: {
|
|
175
175
|
value: string | number | boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { type TestingOperations } from './mcp/testing-tools';
|
|
3
|
+
export type StoreRequest = {
|
|
4
|
+
store: string;
|
|
5
|
+
note?: string | undefined;
|
|
6
|
+
scopes?: string[] | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type CatalogRequest = {
|
|
9
|
+
store: string;
|
|
10
|
+
page?: number | undefined;
|
|
11
|
+
category?: string | undefined;
|
|
12
|
+
product?: string | undefined;
|
|
13
|
+
search?: string | undefined;
|
|
14
|
+
sort?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export interface CandyToolServerOperations extends TestingOperations {
|
|
17
|
+
request(args: StoreRequest): Promise<unknown>;
|
|
18
|
+
list(): Promise<unknown>;
|
|
19
|
+
catalog(args: CatalogRequest): Promise<unknown>;
|
|
20
|
+
storeAccessStatus?: (args: {
|
|
21
|
+
store: string;
|
|
22
|
+
}) => Promise<unknown>;
|
|
23
|
+
storePermissionScopes?: () => Promise<unknown>;
|
|
24
|
+
storeTestCapabilities?: (args: {
|
|
25
|
+
store: string;
|
|
26
|
+
}) => Promise<unknown>;
|
|
27
|
+
storeData?: (args: {
|
|
28
|
+
store: string;
|
|
29
|
+
resource: string;
|
|
30
|
+
page?: number;
|
|
31
|
+
category?: string;
|
|
32
|
+
product?: string;
|
|
33
|
+
search?: string;
|
|
34
|
+
sort?: string;
|
|
35
|
+
}) => Promise<unknown>;
|
|
36
|
+
workspace?: () => Promise<unknown>;
|
|
37
|
+
themeVersions?: () => Promise<unknown>;
|
|
38
|
+
}
|
|
39
|
+
export declare function candyToolServer(operations: CandyToolServerOperations): McpServer;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
export declare const PLUGIN_HOOK_CATALOG: {
|
|
3
|
+
name: string;
|
|
4
|
+
group: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const RUNTIME_HOOKS_REFERENCE: {
|
|
8
|
+
cartAndWishlist: ({
|
|
9
|
+
selector: string;
|
|
10
|
+
dataAttributes: string[];
|
|
11
|
+
endpoint: string;
|
|
12
|
+
notes: string;
|
|
13
|
+
} | {
|
|
14
|
+
selector: string;
|
|
15
|
+
notes: string;
|
|
16
|
+
dataAttributes?: never;
|
|
17
|
+
endpoint?: never;
|
|
18
|
+
} | {
|
|
19
|
+
selector: string;
|
|
20
|
+
dataAttributes: string[];
|
|
21
|
+
endpoint: string;
|
|
22
|
+
notes?: never;
|
|
23
|
+
} | {
|
|
24
|
+
selector: string;
|
|
25
|
+
endpoint: string;
|
|
26
|
+
dataAttributes?: never;
|
|
27
|
+
notes?: never;
|
|
28
|
+
})[];
|
|
29
|
+
authentication: ({
|
|
30
|
+
selector: string;
|
|
31
|
+
method: string;
|
|
32
|
+
fields: string[];
|
|
33
|
+
notes: string;
|
|
34
|
+
} | {
|
|
35
|
+
selector: string;
|
|
36
|
+
method: string;
|
|
37
|
+
fields: string[];
|
|
38
|
+
notes?: never;
|
|
39
|
+
})[];
|
|
40
|
+
themeEditorEvents: ({
|
|
41
|
+
attribute: string;
|
|
42
|
+
description: string;
|
|
43
|
+
pattern?: never;
|
|
44
|
+
} | {
|
|
45
|
+
pattern: string;
|
|
46
|
+
description: string;
|
|
47
|
+
attribute?: never;
|
|
48
|
+
})[];
|
|
49
|
+
};
|
|
50
|
+
export declare const STOREFRONT_ROUTES: {
|
|
51
|
+
route: string;
|
|
52
|
+
pageType: string;
|
|
53
|
+
template: string;
|
|
54
|
+
description: string;
|
|
55
|
+
}[];
|
|
56
|
+
export declare const STOREFRONT_VARIABLES: {
|
|
57
|
+
global: ({
|
|
58
|
+
name: string;
|
|
59
|
+
fields: string[];
|
|
60
|
+
description?: never;
|
|
61
|
+
} | {
|
|
62
|
+
name: string;
|
|
63
|
+
description: string;
|
|
64
|
+
fields?: never;
|
|
65
|
+
})[];
|
|
66
|
+
sectionContext: {
|
|
67
|
+
name: string;
|
|
68
|
+
fields: string[];
|
|
69
|
+
}[];
|
|
70
|
+
commerceObjects: ({
|
|
71
|
+
name: string;
|
|
72
|
+
fields: string[];
|
|
73
|
+
description?: never;
|
|
74
|
+
} | {
|
|
75
|
+
name: string;
|
|
76
|
+
description: string;
|
|
77
|
+
fields?: never;
|
|
78
|
+
})[];
|
|
79
|
+
};
|
|
80
|
+
export declare const COMMON_ERRORS_REFERENCE: {
|
|
81
|
+
code: string;
|
|
82
|
+
cause: string;
|
|
83
|
+
fix: string;
|
|
84
|
+
}[];
|
|
85
|
+
export declare const SDK_COMMANDS_REFERENCE: {
|
|
86
|
+
command: string;
|
|
87
|
+
description: string;
|
|
88
|
+
}[];
|
|
89
|
+
export declare function registerDocsTools(server: McpServer): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
export interface EditorCompatibilityCheck {
|
|
3
|
+
name: string;
|
|
4
|
+
status: 'passed' | 'failed' | 'warning';
|
|
5
|
+
message: string;
|
|
6
|
+
file?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function validateThemeEditorDirectory(themeDir: string): {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
themeDir: string;
|
|
11
|
+
slug?: string;
|
|
12
|
+
version?: string;
|
|
13
|
+
sectionCount?: number;
|
|
14
|
+
sections?: string[];
|
|
15
|
+
checks: EditorCompatibilityCheck[];
|
|
16
|
+
summary: {
|
|
17
|
+
passed: number;
|
|
18
|
+
failed: number;
|
|
19
|
+
warnings: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function registerEditorTools(server: McpServer): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
export interface StorefrontTestCheck {
|
|
3
|
+
id: string;
|
|
4
|
+
category: 'validation' | 'editor' | 'commerce' | 'responsive' | 'accessibility' | 'security' | 'plugins';
|
|
5
|
+
status: 'passed' | 'failed' | 'warning' | 'skipped' | 'blocked';
|
|
6
|
+
message: string;
|
|
7
|
+
file?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface ThemeReadinessReport {
|
|
10
|
+
generatedAt: string;
|
|
11
|
+
themeDir: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
version: string;
|
|
14
|
+
packageHash: string;
|
|
15
|
+
sdkVersion: string;
|
|
16
|
+
runtimeVersion: string;
|
|
17
|
+
status: 'passed' | 'failed' | 'partial';
|
|
18
|
+
summary: {
|
|
19
|
+
passed: number;
|
|
20
|
+
failed: number;
|
|
21
|
+
warnings: number;
|
|
22
|
+
skipped: number;
|
|
23
|
+
blocked: number;
|
|
24
|
+
};
|
|
25
|
+
checks: StorefrontTestCheck[];
|
|
26
|
+
}
|
|
27
|
+
export declare function runThemeReadinessAudit(themeDir: string): Promise<ThemeReadinessReport>;
|
|
28
|
+
export interface TestingOperations {
|
|
29
|
+
createTestSession?: (args: {
|
|
30
|
+
store: string;
|
|
31
|
+
themeVersion?: string | undefined;
|
|
32
|
+
ttlMinutes?: number | undefined;
|
|
33
|
+
}) => Promise<unknown>;
|
|
34
|
+
getTestSession?: (args: {
|
|
35
|
+
sessionId: string;
|
|
36
|
+
}) => Promise<unknown>;
|
|
37
|
+
getTestFixtures?: (args: {
|
|
38
|
+
sessionId: string;
|
|
39
|
+
}) => Promise<unknown>;
|
|
40
|
+
resetTestSession?: (args: {
|
|
41
|
+
sessionId: string;
|
|
42
|
+
}) => Promise<unknown>;
|
|
43
|
+
closeTestSession?: (args: {
|
|
44
|
+
sessionId: string;
|
|
45
|
+
}) => Promise<unknown>;
|
|
46
|
+
runTestAction?: (args: {
|
|
47
|
+
sessionId: string;
|
|
48
|
+
action: string;
|
|
49
|
+
payload?: Record<string, unknown> | undefined;
|
|
50
|
+
}) => Promise<unknown>;
|
|
51
|
+
saveTestReport?: (report: ThemeReadinessReport) => Promise<unknown>;
|
|
52
|
+
getLatestTestReport?: () => Promise<unknown>;
|
|
53
|
+
}
|
|
54
|
+
export declare function registerTestingTools(server: McpServer, ops: TestingOperations): void;
|