@spwig/theme-cli 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.
Files changed (51) hide show
  1. package/README.md +278 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +99 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/component.d.ts +13 -0
  7. package/dist/commands/component.d.ts.map +1 -0
  8. package/dist/commands/component.js +229 -0
  9. package/dist/commands/component.js.map +1 -0
  10. package/dist/commands/init.d.ts +13 -0
  11. package/dist/commands/init.d.ts.map +1 -0
  12. package/dist/commands/init.js +249 -0
  13. package/dist/commands/init.js.map +1 -0
  14. package/dist/commands/package.d.ts +12 -0
  15. package/dist/commands/package.d.ts.map +1 -0
  16. package/dist/commands/package.js +320 -0
  17. package/dist/commands/package.js.map +1 -0
  18. package/dist/commands/validate.d.ts +10 -0
  19. package/dist/commands/validate.d.ts.map +1 -0
  20. package/dist/commands/validate.js +204 -0
  21. package/dist/commands/validate.js.map +1 -0
  22. package/dist/index.d.ts +13 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +9 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/schemas/component_manifest_schema.json +221 -0
  27. package/dist/schemas/theme_manifest_schema.json +267 -0
  28. package/dist/templates/components/blank.template.html.template +4 -0
  29. package/dist/templates/components/footer.manifest.json.template +11 -0
  30. package/dist/templates/components/footer.template.html.template +36 -0
  31. package/dist/templates/components/header.manifest.json.template +11 -0
  32. package/dist/templates/components/header.schema.json.template +23 -0
  33. package/dist/templates/components/header.template.html.template +39 -0
  34. package/dist/templates/components/schema.json.template +15 -0
  35. package/dist/templates/components/section.manifest.json.template +11 -0
  36. package/dist/templates/components/section.template.html.template +13 -0
  37. package/dist/templates/components/utility.manifest.json.template +11 -0
  38. package/dist/templates/theme/README.md.template +64 -0
  39. package/dist/templates/theme/design_tokens.json.template +66 -0
  40. package/dist/templates/theme/manifest.json.template +40 -0
  41. package/dist/utils/file-system.d.ts +49 -0
  42. package/dist/utils/file-system.d.ts.map +1 -0
  43. package/dist/utils/file-system.js +115 -0
  44. package/dist/utils/file-system.js.map +1 -0
  45. package/dist/utils/validation.d.ts +40 -0
  46. package/dist/utils/validation.d.ts.map +1 -0
  47. package/dist/utils/validation.js +98 -0
  48. package/dist/utils/validation.js.map +1 -0
  49. package/package.json +62 -0
  50. package/schemas/component_manifest_schema.json +221 -0
  51. package/schemas/theme_manifest_schema.json +267 -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 (recommended: 600x800px, max 5MB)"
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 (recommended: 1200x800px, max 5MB each)"
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
+ }