@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
@@ -6,54 +6,84 @@
6
6
 
7
7
  - **Author**: {{author}}
8
8
  - **Version**: 1.0.0
9
+ - **SDK Version**: 2.0
9
10
  - **License**: {{license}}
11
+ - **Min Platform Version**: 2.0.0
10
12
 
11
13
  ## Features
12
14
 
13
15
  - Responsive design optimized for all devices
14
- - Modern and clean aesthetics
15
- - Customizable color schemes via design tokens
16
- - Performance optimized
16
+ - Mobile-first approach
17
+ - Fully customizable via design tokens
18
+ - Header and footer presets included
17
19
  - Accessible and SEO-friendly
18
20
 
21
+ ## Theme Structure
22
+
23
+ ```
24
+ {{themeName}}/
25
+ ├── manifest.json # Theme metadata and configuration
26
+ ├── tokens.json # Design tokens (colors, typography, spacing, etc.)
27
+ ├── presets/
28
+ │ ├── header.json # Default header layout preset
29
+ │ └── footer.json # Default footer layout preset
30
+ ├── css/
31
+ │ └── theme.css # Custom CSS overrides (optional)
32
+ ├── preview.png # Theme preview image
33
+ └── README.md
34
+ ```
35
+
19
36
  ## Development
20
37
 
21
38
  ```bash
22
- # Start development server
39
+ # Start development server with live preview
23
40
  spwig dev
24
41
 
25
- # Validate theme
42
+ # Validate theme structure and tokens
26
43
  spwig validate
27
44
 
28
45
  # Package for distribution
29
46
  spwig package
30
47
  ```
31
48
 
32
- ## Bundled Components
49
+ ## Customization
33
50
 
34
- This theme includes the following components:
51
+ ### Design Tokens
35
52
 
36
- - **Default Header** - Site header with navigation
37
- - **Default Footer** - Site footer with links
38
- - **Hero Section** - Eye-catching hero banner
53
+ The `tokens.json` file is the primary deliverable of your theme. It controls every visual aspect of the storefront:
39
54
 
40
- ## Customization
55
+ - **Colors** - Primary, secondary, accent, text, backgrounds, borders, status colors
56
+ - **Typography** - Font families, sizes, weights, line heights, letter spacing
57
+ - **Spacing** - Consistent spacing scale used throughout the layout
58
+ - **Borders** - Border widths and radius values
59
+ - **Shadows** - Elevation levels from subtle to prominent
60
+ - **Transitions** - Animation durations and easing functions
61
+ - **Breakpoints** - Responsive design breakpoints
62
+ - **Z-Index** - Layering system for overlapping elements
63
+ - **Container** - Max width and padding for page content
64
+ - **Menu** - Navigation styling and behavior
65
+ - **Header** - Header zones, backgrounds, text colors, and per-layout-type overrides
66
+ - **Footer** - Footer zones, backgrounds, text colors
67
+ - **Search** - Search input, button, and dropdown styling
68
+ - **Buttons** - Primary, secondary, neutral, and danger button variants (solid, outline, ghost)
69
+ - **Cards** - Default, elevated, bordered, and minimal card variants
70
+ - **Elements** - Hero, heading, body text, form, product card, gallery, modal, and more
71
+ - **Widgets** - Account, cart, logo, language, currency, announcement, newsletter, social, links, text, payment, trust badges, contact
41
72
 
42
- ### Design Tokens
73
+ Edit `tokens.json` to customize any of these values. The platform converts tokens into CSS custom properties automatically.
74
+
75
+ ### Header & Footer Presets
43
76
 
44
- Edit `design_tokens.json` to customize colors, typography, spacing, and more.
77
+ The `presets/` directory contains default header and footer configurations:
45
78
 
46
- ### Components
79
+ - **header.json** - Defines the header layout type, sticky behavior, zone layout, and widget placements
80
+ - **footer.json** - Defines the footer layout type, zone layout, and widget placements
47
81
 
48
- Components are located in the `components/` directory. Each component has:
49
- - `manifest.json` - Component configuration
50
- - `template.html` - Component template
51
- - `schema.json` - Component settings schema
52
- - `styles.css` - Component styles (optional)
82
+ These presets are applied when a merchant activates your theme, giving them a ready-to-use layout that matches your design vision.
53
83
 
54
- ### Pages
84
+ ### Custom CSS (Optional)
55
85
 
56
- Page schemas are in the `pages/` directory. Configure which components appear on each page type.
86
+ For advanced customization beyond tokens, add a `css/theme.css` file. This CSS is loaded after the token-generated styles and can override specific rules.
57
87
 
58
88
  ## Support
59
89
 
File without changes
@@ -1,40 +1,18 @@
1
1
  {
2
2
  "name": "{{themeName}}",
3
3
  "version": "1.0.0",
4
+ "sdk_version": "2.0",
4
5
  "display_name": "{{displayName}}",
5
6
  "description": "{{description}}",
6
7
  "author": "{{author}}",
7
8
  "license": "{{license}}",
8
- "bundled_components": [
9
- {
10
- "type": "header",
11
- "name": "default_header",
12
- "path": "components/headers/default_header"
13
- },
14
- {
15
- "type": "footer",
16
- "name": "default_footer",
17
- "path": "components/footers/default_footer"
18
- },
19
- {
20
- "type": "section",
21
- "name": "hero_section",
22
- "path": "components/sections/hero_section"
23
- }
24
- ],
25
- "page_schemas": {
26
- "home": "pages/home.json",
27
- "product": "pages/product.json",
28
- "collection": "pages/collection.json",
29
- "cart": "pages/cart.json"
30
- },
31
- "design_tokens": "design_tokens.json",
9
+ "min_platform_version": "2.0.0",
32
10
  "tags": ["ecommerce", "modern"],
33
11
  "categories": ["general"],
34
12
  "features": [
35
13
  "Responsive design",
36
- "Modern aesthetics",
37
- "Customizable color schemes",
38
- "Performance optimized"
39
- ]
14
+ "Mobile-first",
15
+ "Customizable via design tokens"
16
+ ],
17
+ "preview_image": "preview.png"
40
18
  }