@spwig/theme-cli 1.1.0 → 2.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 (71) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +0 -0
  3. package/dist/cli.d.ts +0 -0
  4. package/dist/cli.d.ts.map +0 -0
  5. package/dist/cli.js +4 -30
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/component.d.ts +0 -0
  8. package/dist/commands/component.d.ts.map +0 -0
  9. package/dist/commands/component.js +0 -0
  10. package/dist/commands/component.js.map +0 -0
  11. package/dist/commands/dev.d.ts +0 -0
  12. package/dist/commands/dev.d.ts.map +0 -0
  13. package/dist/commands/dev.js +2 -2
  14. package/dist/commands/dev.js.map +1 -1
  15. package/dist/commands/init.d.ts +5 -1
  16. package/dist/commands/init.d.ts.map +1 -1
  17. package/dist/commands/init.js +80 -115
  18. package/dist/commands/init.js.map +1 -1
  19. package/dist/commands/package.d.ts +0 -0
  20. package/dist/commands/package.d.ts.map +1 -1
  21. package/dist/commands/package.js +0 -2
  22. package/dist/commands/package.js.map +1 -1
  23. package/dist/commands/validate.d.ts +1 -2
  24. package/dist/commands/validate.d.ts.map +1 -1
  25. package/dist/commands/validate.js +10 -112
  26. package/dist/commands/validate.js.map +1 -1
  27. package/dist/index.d.ts +0 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +0 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/schemas/component_manifest_schema.json +0 -0
  32. package/dist/schemas/theme_manifest_schema.json +5 -63
  33. package/dist/templates/assets/logo.svg.template +6 -0
  34. package/dist/templates/assets/theme.js.template +150 -0
  35. package/dist/templates/components/blank.template.html.template +0 -0
  36. package/dist/templates/components/footer.manifest.json.template +0 -0
  37. package/dist/templates/components/footer.schema.json.template +22 -0
  38. package/dist/templates/components/footer.styles.css.template +80 -0
  39. package/dist/templates/components/footer.template.html.template +0 -0
  40. package/dist/templates/components/header.manifest.json.template +0 -0
  41. package/dist/templates/components/header.schema.json.template +0 -0
  42. package/dist/templates/components/header.styles.css.template +104 -0
  43. package/dist/templates/components/header.template.html.template +0 -0
  44. package/dist/templates/components/schema.json.template +0 -0
  45. package/dist/templates/components/section.manifest.json.template +2 -2
  46. package/dist/templates/components/section.schema.json.template +40 -0
  47. package/dist/templates/components/section.styles.css.template +60 -0
  48. package/dist/templates/components/section.template.html.template +0 -0
  49. package/dist/templates/components/utility.manifest.json.template +0 -0
  50. package/dist/templates/pages/cart.html.template +104 -0
  51. package/dist/templates/pages/collection.html.template +86 -0
  52. package/dist/templates/pages/home.html.template +51 -0
  53. package/dist/templates/pages/layout.html.template +48 -0
  54. package/dist/templates/pages/product.html.template +90 -0
  55. package/dist/templates/presets/footer.json.template +16 -0
  56. package/dist/templates/presets/header.json.template +16 -0
  57. package/dist/templates/theme/README.md.template +51 -21
  58. package/dist/templates/theme/design_tokens.json.template +0 -0
  59. package/dist/templates/theme/manifest.json.template +6 -28
  60. package/dist/templates/theme/tokens.json.template +1254 -0
  61. package/dist/utils/file-system.d.ts +0 -0
  62. package/dist/utils/file-system.d.ts.map +0 -0
  63. package/dist/utils/file-system.js +0 -0
  64. package/dist/utils/file-system.js.map +0 -0
  65. package/dist/utils/validation.d.ts +0 -0
  66. package/dist/utils/validation.d.ts.map +0 -0
  67. package/dist/utils/validation.js +0 -0
  68. package/dist/utils/validation.js.map +0 -0
  69. package/package.json +2 -2
  70. package/schemas/theme_manifest_schema.json +5 -63
  71. package/schemas/component_manifest_schema.json +0 -221
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spwig/theme-cli",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "Spwig Theme SDK CLI",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "author": "Spwig",
39
39
  "license": "Apache-2.0",
40
40
  "dependencies": {
41
- "@spwig/theme-validator": "^1.0.0",
41
+ "@spwig/theme-validator": "^2.0.0",
42
42
  "archiver": "^6.0.1",
43
43
  "chalk": "^5.3.0",
44
44
  "chokidar": "^3.5.3",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "Theme Package Manifest Schema",
4
- "description": "Schema for Spwig theme package manifests with bundled components",
4
+ "description": "Schema for Spwig v2.0 theme package manifests",
5
5
  "type": "object",
6
6
  "required": [
7
7
  "name",
@@ -41,74 +41,16 @@
41
41
  "maxLength": 100,
42
42
  "description": "Theme author/vendor name"
43
43
  },
44
+ "sdk_version": {
45
+ "type": "string",
46
+ "description": "SDK version used to create this theme (e.g., '2.0')"
47
+ },
44
48
  "license": {
45
49
  "type": "string",
46
50
  "enum": ["MIT", "Apache-2.0", "GPL-3.0", "Proprietary"],
47
51
  "default": "Proprietary",
48
52
  "description": "Theme license type"
49
53
  },
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
54
  "preview_image": {
113
55
  "type": "string",
114
56
  "pattern": "^.+\\.(png|jpg|jpeg|webp)$",
@@ -1,221 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Component Manifest Schema",
4
- "description": "Schema for Spwig component package manifests",
5
- "type": "object",
6
- "required": [
7
- "name",
8
- "version",
9
- "display_name",
10
- "description",
11
- "author",
12
- "tier_compatibility",
13
- "regions"
14
- ],
15
- "properties": {
16
- "name": {
17
- "type": "string",
18
- "pattern": "^[a-z][a-z0-9_]*$",
19
- "minLength": 2,
20
- "maxLength": 50,
21
- "description": "Component identifier (lowercase, alphanumeric with underscores)"
22
- },
23
- "version": {
24
- "type": "string",
25
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
26
- "description": "Semantic version (e.g., 1.0.0)"
27
- },
28
- "display_name": {
29
- "type": "string",
30
- "minLength": 1,
31
- "maxLength": 100,
32
- "description": "Human-readable component name"
33
- },
34
- "description": {
35
- "type": "string",
36
- "minLength": 10,
37
- "maxLength": 500,
38
- "description": "Component description for marketplace listing"
39
- },
40
- "author": {
41
- "type": "string",
42
- "minLength": 1,
43
- "maxLength": 100,
44
- "description": "Component author/vendor name"
45
- },
46
- "tier_compatibility": {
47
- "type": "array",
48
- "minItems": 1,
49
- "uniqueItems": true,
50
- "items": {
51
- "type": "string",
52
- "enum": ["A", "B", "C"]
53
- },
54
- "description": "Security tiers this component is compatible with"
55
- },
56
- "regions": {
57
- "type": "array",
58
- "minItems": 1,
59
- "uniqueItems": true,
60
- "items": {
61
- "type": "string",
62
- "pattern": "^[a-z][a-z0-9_]*$"
63
- },
64
- "description": "Page regions this component can be placed in"
65
- },
66
- "props_schema": {
67
- "type": "object",
68
- "description": "JSON Schema defining component properties",
69
- "required": ["type", "properties"],
70
- "properties": {
71
- "type": {
72
- "const": "object"
73
- },
74
- "properties": {
75
- "type": "object"
76
- },
77
- "required": {
78
- "type": "array",
79
- "items": {
80
- "type": "string"
81
- }
82
- }
83
- }
84
- },
85
- "assets": {
86
- "type": "object",
87
- "properties": {
88
- "css": {
89
- "type": "array",
90
- "items": {
91
- "type": "string",
92
- "pattern": "^assets/.*\\.css$"
93
- },
94
- "description": "CSS files relative to component root"
95
- },
96
- "js": {
97
- "type": "array",
98
- "items": {
99
- "type": "string",
100
- "pattern": "^assets/.*\\.js$"
101
- },
102
- "description": "JavaScript files relative to component root"
103
- },
104
- "images": {
105
- "type": "array",
106
- "items": {
107
- "type": "string",
108
- "pattern": "^assets/.*\\.(png|jpg|jpeg|svg|gif|webp)$"
109
- },
110
- "description": "Image files relative to component root"
111
- }
112
- },
113
- "additionalProperties": false
114
- },
115
- "dependencies": {
116
- "type": "array",
117
- "items": {
118
- "type": "object",
119
- "required": ["name", "min_version"],
120
- "properties": {
121
- "name": {
122
- "type": "string",
123
- "pattern": "^[a-z][a-z0-9_]*$"
124
- },
125
- "min_version": {
126
- "type": "string",
127
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
128
- },
129
- "max_version": {
130
- "type": "string",
131
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
132
- }
133
- }
134
- },
135
- "description": "Component dependencies on other components"
136
- },
137
- "locales": {
138
- "type": "array",
139
- "items": {
140
- "type": "string",
141
- "pattern": "^[a-z]{2}(_[A-Z]{2})?$"
142
- },
143
- "description": "Supported locale codes (e.g., en, es, fr, en_US)"
144
- },
145
- "preview": {
146
- "type": "string",
147
- "pattern": "^preview\\.(png|jpg|jpeg|webp)$",
148
- "description": "Preview image filename (recommended: 600x800px, max 5MB)"
149
- },
150
- "category": {
151
- "type": "string",
152
- "enum": [
153
- "hero",
154
- "header",
155
- "footer",
156
- "content",
157
- "product",
158
- "collection",
159
- "cart",
160
- "checkout",
161
- "marketing",
162
- "social",
163
- "navigation",
164
- "utility"
165
- ],
166
- "description": "Component category for marketplace organization"
167
- },
168
- "tags": {
169
- "type": "array",
170
- "maxItems": 10,
171
- "items": {
172
- "type": "string",
173
- "pattern": "^[a-z][a-z0-9-]*$",
174
- "maxLength": 30
175
- },
176
- "description": "Searchable tags for marketplace"
177
- },
178
- "license": {
179
- "type": "string",
180
- "enum": ["MIT", "Apache-2.0", "GPL-3.0", "Proprietary"],
181
- "default": "Proprietary",
182
- "description": "Component license type"
183
- },
184
- "changelog": {
185
- "type": "array",
186
- "items": {
187
- "type": "object",
188
- "required": ["version", "date", "changes"],
189
- "properties": {
190
- "version": {
191
- "type": "string",
192
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
193
- },
194
- "date": {
195
- "type": "string",
196
- "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
197
- },
198
- "changes": {
199
- "type": "array",
200
- "minItems": 1,
201
- "items": {
202
- "type": "string"
203
- }
204
- }
205
- }
206
- },
207
- "description": "Version history and changes"
208
- },
209
- "min_platform_version": {
210
- "type": "string",
211
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
212
- "description": "Minimum platform version required"
213
- },
214
- "max_platform_version": {
215
- "type": "string",
216
- "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
217
- "description": "Maximum platform version supported"
218
- }
219
- },
220
- "additionalProperties": false
221
- }