@spwig/theme-validator 1.0.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 +367 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/component_manifest_schema.json +221 -0
- package/dist/schemas/theme_manifest_schema.json +267 -0
- package/dist/types/manifest.d.ts +183 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/dist/types/manifest.js +5 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/validation-result.d.ts +48 -0
- package/dist/types/validation-result.d.ts.map +1 -0
- package/dist/types/validation-result.js +26 -0
- package/dist/types/validation-result.js.map +1 -0
- package/dist/validators/component-validator.d.ts +50 -0
- package/dist/validators/component-validator.d.ts.map +1 -0
- package/dist/validators/component-validator.js +235 -0
- package/dist/validators/component-validator.js.map +1 -0
- package/dist/validators/design-tokens-validator.d.ts +46 -0
- package/dist/validators/design-tokens-validator.d.ts.map +1 -0
- package/dist/validators/design-tokens-validator.js +202 -0
- package/dist/validators/design-tokens-validator.js.map +1 -0
- package/dist/validators/manifest-validator.d.ts +69 -0
- package/dist/validators/manifest-validator.d.ts.map +1 -0
- package/dist/validators/manifest-validator.js +206 -0
- package/dist/validators/manifest-validator.js.map +1 -0
- package/dist/validators/template-validator.d.ts +34 -0
- package/dist/validators/template-validator.d.ts.map +1 -0
- package/dist/validators/template-validator.js +170 -0
- package/dist/validators/template-validator.js.map +1 -0
- package/dist/validators/theme-validator.d.ts +44 -0
- package/dist/validators/theme-validator.d.ts.map +1 -0
- package/dist/validators/theme-validator.js +237 -0
- package/dist/validators/theme-validator.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Theme Package Manifest Schema",
|
|
4
|
+
"description": "Schema for Spwig theme package manifests with bundled components",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"name",
|
|
8
|
+
"version",
|
|
9
|
+
"display_name",
|
|
10
|
+
"description",
|
|
11
|
+
"author"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"name": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
17
|
+
"minLength": 2,
|
|
18
|
+
"maxLength": 50,
|
|
19
|
+
"description": "Theme identifier (lowercase, alphanumeric with hyphens)"
|
|
20
|
+
},
|
|
21
|
+
"version": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
|
|
24
|
+
"description": "Semantic version (e.g., 1.0.0)"
|
|
25
|
+
},
|
|
26
|
+
"display_name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1,
|
|
29
|
+
"maxLength": 100,
|
|
30
|
+
"description": "Human-readable theme name"
|
|
31
|
+
},
|
|
32
|
+
"description": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 10,
|
|
35
|
+
"maxLength": 1000,
|
|
36
|
+
"description": "Theme description for marketplace listing"
|
|
37
|
+
},
|
|
38
|
+
"author": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1,
|
|
41
|
+
"maxLength": 100,
|
|
42
|
+
"description": "Theme author/vendor name"
|
|
43
|
+
},
|
|
44
|
+
"license": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"enum": ["MIT", "Apache-2.0", "GPL-3.0", "Proprietary"],
|
|
47
|
+
"default": "Proprietary",
|
|
48
|
+
"description": "Theme license type"
|
|
49
|
+
},
|
|
50
|
+
"bundled_components": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["type", "name", "path"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"type": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": ["header", "footer", "section", "utility"],
|
|
59
|
+
"description": "Component type"
|
|
60
|
+
},
|
|
61
|
+
"name": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"pattern": "^[a-z][a-z0-9_-]*$",
|
|
64
|
+
"description": "Component name"
|
|
65
|
+
},
|
|
66
|
+
"path": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^components/",
|
|
69
|
+
"description": "Relative path to component directory"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"description": "List of components bundled with this theme"
|
|
74
|
+
},
|
|
75
|
+
"page_schemas": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"home": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "Path to home page schema"
|
|
81
|
+
},
|
|
82
|
+
"product": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "Path to product page schema"
|
|
85
|
+
},
|
|
86
|
+
"collection": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Path to collection page schema"
|
|
89
|
+
},
|
|
90
|
+
"cart": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Path to cart page schema"
|
|
93
|
+
},
|
|
94
|
+
"checkout": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Path to checkout page schema"
|
|
97
|
+
},
|
|
98
|
+
"landing": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Path to landing page schema"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"additionalProperties": {
|
|
104
|
+
"type": "string"
|
|
105
|
+
},
|
|
106
|
+
"description": "Page schema file paths"
|
|
107
|
+
},
|
|
108
|
+
"design_tokens": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"description": "Path to design tokens file (colors, fonts, spacing)"
|
|
111
|
+
},
|
|
112
|
+
"preview_image": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"pattern": "^.+\\.(png|jpg|jpeg|webp)$",
|
|
115
|
+
"description": "Theme preview image filename"
|
|
116
|
+
},
|
|
117
|
+
"screenshots": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"items": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"pattern": "^.+\\.(png|jpg|jpeg|webp)$"
|
|
122
|
+
},
|
|
123
|
+
"maxItems": 10,
|
|
124
|
+
"description": "Screenshot filenames for theme showcase"
|
|
125
|
+
},
|
|
126
|
+
"demo_url": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"format": "uri",
|
|
129
|
+
"description": "URL to live demo of theme"
|
|
130
|
+
},
|
|
131
|
+
"documentation_url": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"format": "uri",
|
|
134
|
+
"description": "URL to theme documentation"
|
|
135
|
+
},
|
|
136
|
+
"support_url": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"format": "uri",
|
|
139
|
+
"description": "URL for theme support"
|
|
140
|
+
},
|
|
141
|
+
"tags": {
|
|
142
|
+
"type": "array",
|
|
143
|
+
"maxItems": 10,
|
|
144
|
+
"items": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
147
|
+
"maxLength": 30
|
|
148
|
+
},
|
|
149
|
+
"description": "Searchable tags for theme marketplace"
|
|
150
|
+
},
|
|
151
|
+
"categories": {
|
|
152
|
+
"type": "array",
|
|
153
|
+
"items": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"enum": [
|
|
156
|
+
"fashion",
|
|
157
|
+
"electronics",
|
|
158
|
+
"home-garden",
|
|
159
|
+
"sports",
|
|
160
|
+
"beauty",
|
|
161
|
+
"food-beverage",
|
|
162
|
+
"books",
|
|
163
|
+
"toys",
|
|
164
|
+
"jewelry",
|
|
165
|
+
"automotive",
|
|
166
|
+
"general"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"description": "Theme categories for marketplace organization"
|
|
170
|
+
},
|
|
171
|
+
"color_schemes": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"items": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"required": ["name", "colors"],
|
|
176
|
+
"properties": {
|
|
177
|
+
"name": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"description": "Color scheme name (e.g., 'Light', 'Dark')"
|
|
180
|
+
},
|
|
181
|
+
"colors": {
|
|
182
|
+
"type": "object",
|
|
183
|
+
"properties": {
|
|
184
|
+
"primary": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
187
|
+
},
|
|
188
|
+
"secondary": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
191
|
+
},
|
|
192
|
+
"accent": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
195
|
+
},
|
|
196
|
+
"background": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
199
|
+
},
|
|
200
|
+
"text": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"pattern": "^#[0-9A-Fa-f]{6}$"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"description": "Pre-defined color schemes for theme"
|
|
209
|
+
},
|
|
210
|
+
"features": {
|
|
211
|
+
"type": "array",
|
|
212
|
+
"items": {
|
|
213
|
+
"type": "string"
|
|
214
|
+
},
|
|
215
|
+
"description": "List of theme features for marketing"
|
|
216
|
+
},
|
|
217
|
+
"min_platform_version": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
|
|
220
|
+
"description": "Minimum platform version required"
|
|
221
|
+
},
|
|
222
|
+
"max_platform_version": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
|
|
225
|
+
"description": "Maximum platform version supported"
|
|
226
|
+
},
|
|
227
|
+
"changelog": {
|
|
228
|
+
"type": "array",
|
|
229
|
+
"items": {
|
|
230
|
+
"type": "object",
|
|
231
|
+
"required": ["version", "date", "changes"],
|
|
232
|
+
"properties": {
|
|
233
|
+
"version": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
|
|
236
|
+
},
|
|
237
|
+
"date": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
|
|
240
|
+
},
|
|
241
|
+
"changes": {
|
|
242
|
+
"type": "array",
|
|
243
|
+
"minItems": 1,
|
|
244
|
+
"items": {
|
|
245
|
+
"type": "string"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"description": "Version history and changes"
|
|
251
|
+
},
|
|
252
|
+
"total_size_bytes": {
|
|
253
|
+
"type": "integer",
|
|
254
|
+
"description": "Total package size in bytes (added during packaging)"
|
|
255
|
+
},
|
|
256
|
+
"file_count": {
|
|
257
|
+
"type": "integer",
|
|
258
|
+
"description": "Total number of files (added during packaging)"
|
|
259
|
+
},
|
|
260
|
+
"checksum": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"pattern": "^sha256:[a-f0-9]{64}$",
|
|
263
|
+
"description": "SHA256 checksum of package contents (added during packaging)"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"additionalProperties": false
|
|
267
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for theme and component manifests
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Reference to a bundled component in theme manifest
|
|
6
|
+
*/
|
|
7
|
+
export interface BundledComponentRef {
|
|
8
|
+
/** Component type */
|
|
9
|
+
type: 'header' | 'footer' | 'section' | 'utility';
|
|
10
|
+
/** Component name */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Relative path to component directory */
|
|
13
|
+
path: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Changelog entry
|
|
17
|
+
*/
|
|
18
|
+
export interface ChangelogEntry {
|
|
19
|
+
/** Version number */
|
|
20
|
+
version: string;
|
|
21
|
+
/** Release date (YYYY-MM-DD) */
|
|
22
|
+
date: string;
|
|
23
|
+
/** List of changes */
|
|
24
|
+
changes: string[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Color scheme definition
|
|
28
|
+
*/
|
|
29
|
+
export interface ColorScheme {
|
|
30
|
+
/** Scheme name (e.g., "Light", "Dark") */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Color definitions */
|
|
33
|
+
colors: {
|
|
34
|
+
primary?: string;
|
|
35
|
+
secondary?: string;
|
|
36
|
+
accent?: string;
|
|
37
|
+
background?: string;
|
|
38
|
+
text?: string;
|
|
39
|
+
[key: string]: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Component dependency
|
|
44
|
+
*/
|
|
45
|
+
export interface ComponentDependency {
|
|
46
|
+
/** Component name */
|
|
47
|
+
name: string;
|
|
48
|
+
/** Minimum version (optional) */
|
|
49
|
+
min_version?: string;
|
|
50
|
+
/** Maximum version (optional) */
|
|
51
|
+
max_version?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Theme manifest structure
|
|
55
|
+
*/
|
|
56
|
+
export interface ThemeManifest {
|
|
57
|
+
/** Theme identifier (kebab-case) */
|
|
58
|
+
name: string;
|
|
59
|
+
/** Semantic version */
|
|
60
|
+
version: string;
|
|
61
|
+
/** Human-readable name */
|
|
62
|
+
display_name: string;
|
|
63
|
+
/** Theme description */
|
|
64
|
+
description: string;
|
|
65
|
+
/** Author/vendor name */
|
|
66
|
+
author: string;
|
|
67
|
+
/** License type */
|
|
68
|
+
license?: 'MIT' | 'Apache-2.0' | 'GPL-3.0' | 'Proprietary';
|
|
69
|
+
/** Bundled components */
|
|
70
|
+
bundled_components?: BundledComponentRef[];
|
|
71
|
+
/** Page schema paths */
|
|
72
|
+
page_schemas?: {
|
|
73
|
+
home?: string;
|
|
74
|
+
product?: string;
|
|
75
|
+
collection?: string;
|
|
76
|
+
cart?: string;
|
|
77
|
+
checkout?: string;
|
|
78
|
+
landing?: string;
|
|
79
|
+
[key: string]: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
/** Design tokens file path */
|
|
82
|
+
design_tokens?: string;
|
|
83
|
+
/** Preview image filename */
|
|
84
|
+
preview_image?: string;
|
|
85
|
+
/** Screenshot filenames */
|
|
86
|
+
screenshots?: string[];
|
|
87
|
+
/** Demo URL */
|
|
88
|
+
demo_url?: string;
|
|
89
|
+
/** Documentation URL */
|
|
90
|
+
documentation_url?: string;
|
|
91
|
+
/** Support URL */
|
|
92
|
+
support_url?: string;
|
|
93
|
+
/** Searchable tags */
|
|
94
|
+
tags?: string[];
|
|
95
|
+
/** Categories */
|
|
96
|
+
categories?: string[];
|
|
97
|
+
/** Color schemes */
|
|
98
|
+
color_schemes?: ColorScheme[];
|
|
99
|
+
/** Feature list */
|
|
100
|
+
features?: string[];
|
|
101
|
+
/** Minimum platform version */
|
|
102
|
+
min_platform_version?: string;
|
|
103
|
+
/** Maximum platform version */
|
|
104
|
+
max_platform_version?: string;
|
|
105
|
+
/** Changelog */
|
|
106
|
+
changelog?: ChangelogEntry[];
|
|
107
|
+
/** Total package size (added during packaging) */
|
|
108
|
+
total_size_bytes?: number;
|
|
109
|
+
/** File count (added during packaging) */
|
|
110
|
+
file_count?: number;
|
|
111
|
+
/** Package checksum (added during packaging) */
|
|
112
|
+
checksum?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Component manifest structure
|
|
116
|
+
*/
|
|
117
|
+
export interface ComponentManifest {
|
|
118
|
+
/** Component identifier */
|
|
119
|
+
name: string;
|
|
120
|
+
/** Semantic version */
|
|
121
|
+
version: string;
|
|
122
|
+
/** Human-readable name */
|
|
123
|
+
display_name: string;
|
|
124
|
+
/** Component description */
|
|
125
|
+
description: string;
|
|
126
|
+
/** Author name */
|
|
127
|
+
author: string;
|
|
128
|
+
/** Tier compatibility */
|
|
129
|
+
tier_compatibility: ('A' | 'B' | 'C')[];
|
|
130
|
+
/** Allowed regions */
|
|
131
|
+
regions: string[];
|
|
132
|
+
/** Component category */
|
|
133
|
+
category: string;
|
|
134
|
+
/** Searchable tags */
|
|
135
|
+
tags?: string[];
|
|
136
|
+
/** Asset declarations */
|
|
137
|
+
assets?: {
|
|
138
|
+
css?: string[];
|
|
139
|
+
js?: string[];
|
|
140
|
+
images?: string[];
|
|
141
|
+
};
|
|
142
|
+
/** Supported locales */
|
|
143
|
+
locales?: string[];
|
|
144
|
+
/** Preview image filename */
|
|
145
|
+
preview?: string;
|
|
146
|
+
/** Dependencies */
|
|
147
|
+
dependencies?: ComponentDependency[];
|
|
148
|
+
/** Props schema (optional, can be in separate file) */
|
|
149
|
+
props_schema?: Record<string, any>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Page schema structure (simplified - actual structure is flexible)
|
|
153
|
+
*/
|
|
154
|
+
export interface PageSchema {
|
|
155
|
+
/** Page type */
|
|
156
|
+
page_type: string;
|
|
157
|
+
/** Layout sections */
|
|
158
|
+
sections: any[];
|
|
159
|
+
/** Other page-specific config */
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Design tokens structure
|
|
164
|
+
*/
|
|
165
|
+
export interface DesignTokens {
|
|
166
|
+
/** Color palette */
|
|
167
|
+
colors?: Record<string, string>;
|
|
168
|
+
/** Typography scale */
|
|
169
|
+
typography?: Record<string, any>;
|
|
170
|
+
/** Spacing scale */
|
|
171
|
+
spacing?: Record<string, string>;
|
|
172
|
+
/** Breakpoints */
|
|
173
|
+
breakpoints?: Record<string, string>;
|
|
174
|
+
/** Shadows */
|
|
175
|
+
shadows?: Record<string, string>;
|
|
176
|
+
/** Border radius values */
|
|
177
|
+
borderRadius?: Record<string, string>;
|
|
178
|
+
/** Transitions */
|
|
179
|
+
transitions?: Record<string, string>;
|
|
180
|
+
/** Other design tokens */
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAClD,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,MAAM,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACnC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACl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
|
1
|
+
/**
|
|
2
|
+
* Validation result types
|
|
3
|
+
*/
|
|
4
|
+
export interface ValidationError {
|
|
5
|
+
/** Error type/category */
|
|
6
|
+
type: string;
|
|
7
|
+
/** Error message */
|
|
8
|
+
message: string;
|
|
9
|
+
/** File path where error occurred */
|
|
10
|
+
path?: string;
|
|
11
|
+
/** Line number (for template/JSON errors) */
|
|
12
|
+
line?: number;
|
|
13
|
+
/** Whether this error can be auto-fixed */
|
|
14
|
+
fixable: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ValidationWarning {
|
|
17
|
+
/** Warning type/category */
|
|
18
|
+
type: string;
|
|
19
|
+
/** Warning message */
|
|
20
|
+
message: string;
|
|
21
|
+
/** File path where warning occurred */
|
|
22
|
+
path?: string;
|
|
23
|
+
/** Suggestion for fixing */
|
|
24
|
+
suggestion?: string;
|
|
25
|
+
/** Whether this warning can be auto-fixed */
|
|
26
|
+
fixable: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ValidationResult {
|
|
29
|
+
/** Whether validation passed */
|
|
30
|
+
isValid: boolean;
|
|
31
|
+
/** List of validation errors */
|
|
32
|
+
errors: ValidationError[];
|
|
33
|
+
/** List of validation warnings */
|
|
34
|
+
warnings: ValidationWarning[];
|
|
35
|
+
/** Theme or component info (if valid) */
|
|
36
|
+
themeInfo?: any;
|
|
37
|
+
/** Component info (for component validation) */
|
|
38
|
+
componentInfo?: any;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Helper to create validation error
|
|
42
|
+
*/
|
|
43
|
+
export declare function createError(type: string, message: string, options?: Partial<Omit<ValidationError, 'type' | 'message'>>): ValidationError;
|
|
44
|
+
/**
|
|
45
|
+
* Helper to create validation warning
|
|
46
|
+
*/
|
|
47
|
+
export declare function createWarning(type: string, message: string, options?: Partial<Omit<ValidationWarning, 'type' | 'message'>>): ValidationWarning;
|
|
48
|
+
//# sourceMappingURL=validation-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-result.d.ts","sourceRoot":"","sources":["../../src/types/validation-result.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,kCAAkC;IAClC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,yCAAyC;IACzC,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,gDAAgD;IAChD,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,CAAM,GAC/D,eAAe,CAOjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC,CAAM,GACjE,iBAAiB,CAOnB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation result types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Helper to create validation error
|
|
6
|
+
*/
|
|
7
|
+
export function createError(type, message, options = {}) {
|
|
8
|
+
return {
|
|
9
|
+
type,
|
|
10
|
+
message,
|
|
11
|
+
fixable: false,
|
|
12
|
+
...options,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Helper to create validation warning
|
|
17
|
+
*/
|
|
18
|
+
export function createWarning(type, message, options = {}) {
|
|
19
|
+
return {
|
|
20
|
+
type,
|
|
21
|
+
message,
|
|
22
|
+
fixable: false,
|
|
23
|
+
...options,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=validation-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-result.js","sourceRoot":"","sources":["../../src/types/validation-result.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyCH;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,IAAY,EACZ,OAAe,EACf,UAA8D,EAAE;IAEhE,OAAO;QACL,IAAI;QACJ,OAAO;QACP,OAAO,EAAE,KAAK;QACd,GAAG,OAAO;KACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAY,EACZ,OAAe,EACf,UAAgE,EAAE;IAElE,OAAO;QACL,IAAI;QACJ,OAAO;QACP,OAAO,EAAE,KAAK;QACd,GAAG,OAAO;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Validator
|
|
3
|
+
* Validates component packages against manifest schema and file structure
|
|
4
|
+
*/
|
|
5
|
+
import { ManifestValidator } from './manifest-validator.js';
|
|
6
|
+
import { ValidationResult } from '../types/validation-result.js';
|
|
7
|
+
export declare class ComponentValidator extends ManifestValidator {
|
|
8
|
+
private componentDir;
|
|
9
|
+
private manifest;
|
|
10
|
+
private static readonly REQUIRED_FILES;
|
|
11
|
+
private static readonly OPTIONAL_FILES;
|
|
12
|
+
constructor(componentDir: string);
|
|
13
|
+
/**
|
|
14
|
+
* Validate complete component package
|
|
15
|
+
*/
|
|
16
|
+
validate(): Promise<ValidationResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Validate required files exist
|
|
19
|
+
*/
|
|
20
|
+
private validateRequiredFiles;
|
|
21
|
+
/**
|
|
22
|
+
* Validate template.html file
|
|
23
|
+
*/
|
|
24
|
+
private validateTemplate;
|
|
25
|
+
/**
|
|
26
|
+
* Validate props schema file
|
|
27
|
+
*/
|
|
28
|
+
private validatePropsSchema;
|
|
29
|
+
/**
|
|
30
|
+
* Validate declared asset files exist
|
|
31
|
+
*/
|
|
32
|
+
private validateAssets;
|
|
33
|
+
/**
|
|
34
|
+
* Validate locale files exist for declared locales
|
|
35
|
+
*/
|
|
36
|
+
private validateLocales;
|
|
37
|
+
/**
|
|
38
|
+
* Validate preview image file exists
|
|
39
|
+
*/
|
|
40
|
+
private validatePreview;
|
|
41
|
+
/**
|
|
42
|
+
* Validate dependency format
|
|
43
|
+
*/
|
|
44
|
+
private validateDependencies;
|
|
45
|
+
/**
|
|
46
|
+
* Build validation result
|
|
47
|
+
*/
|
|
48
|
+
private buildResult;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=component-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-validator.d.ts","sourceRoot":"","sources":["../../src/validators/component-validator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAGjB,MAAM,+BAA+B,CAAC;AAGvC,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAkC;IAElD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAIpC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAKpC;gBAEU,YAAY,EAAE,MAAM;IAKhC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IA6D3C;;OAEG;YACW,qBAAqB;IAcnC;;OAEG;YACW,gBAAgB;IAiB9B;;OAEG;YACW,mBAAmB;IA+CjC;;OAEG;YACW,cAAc;IAsB5B;;OAEG;YACW,eAAe;IA+B7B;;OAEG;YACW,eAAe;IA0B7B;;OAEG;YACW,oBAAoB;IAqBlC;;OAEG;IACH,OAAO,CAAC,WAAW;CAQpB"}
|