climaybe 3.0.9 → 3.1.1

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 CHANGED
@@ -227,7 +227,7 @@ Enabled via `climaybe init` prompt (`Enable preview + cleanup workflows?`; defau
227
227
 
228
228
  | Workflow | Trigger | What it does |
229
229
  |----------|---------|-------------|
230
- | `pr-update.yml` | PR opened/synchronize/reopened (base: main, staging, develop, staging-*, live-*) | Shares draft theme, renames with `-PR<number>`, comments preview + customize URLs; uses default store for main/staging/develop, or the store for staging-&lt;alias&gt;/live-&lt;alias&gt; |
230
+ | `pr-update.yml` | PR opened/synchronize/reopened (base: main, staging, develop, staging-*, live-*) | Shares draft theme, renames with `-PR<number>`, comments preview + customize URLs; uses default store for main/staging/develop, or the store for staging-&lt;alias&gt;/live-&lt;alias&gt;. **Path filter:** runs only when the PR changes theme paths (`assets/`, `blocks/`, `config/`, `layout/`, `locales/`, `sections/`, `snippets/`, `templates/`, `_scripts/`, `_styles/`, `shopify.theme.toml`, `stores/**`); docs-only or tooling-only PRs skip preview work. |
231
231
  | `pr-close.yml` | PR closed (same branch set) | Deletes matching preview themes and comments deleted count + names |
232
232
  | `reusable-share-theme.yml` | workflow_call | Shares Shopify draft theme and returns `theme_id` |
233
233
  | `reusable-rename-theme.yml` | workflow_call | Renames shared theme to include `PR<number>` (fails job on rename failure) |
@@ -250,8 +250,8 @@ Build workflows install deps with `npm ci` and run `npx --no-install climaybe bu
250
250
 
251
251
  | Workflow | Trigger | What it does |
252
252
  |----------|---------|-------------|
253
- | `build-pipeline.yml` | Push to any branch | Runs reusable build and Lighthouse checks (when required secrets exist) |
254
- | `reusable-build.yml` | workflow_call | Runs Node build + Tailwind compile, then commits compiled assets when changed |
253
+ | `build-pipeline.yml` | Push to any branch (ignores docs-only/tooling-only paths; see CI/CD reference) | Runs reusable build; Lighthouse only on branch **`staging`**, when a build ran, and secrets allow |
254
+ | `reusable-build.yml` | workflow_call | Path-filtered `build-scripts` / Tailwind (`climaybe build`), then commits compiled assets when changed |
255
255
  | `create-release.yml` | Push tag `v*`, or **workflow_run** after Post-Merge Tag / Nightly Hotfix Tag succeed on `main` | Builds release archive and creates GitHub Release notes from commits since the previous tag. It filters repetitive automation subjects (main→staging syncs, store/root sync chores, bot merge noise) before generating notes. If remaining subjects are low-signal and `GEMINI_API_KEY` exists, it uses Gemini to generate cleaner merchant-facing notes. Also covers tags created by workflows with `GITHUB_TOKEN`, which may not trigger tag-push workflows. |
256
256
 
257
257
  ### Optional theme dev kit package
@@ -270,6 +270,59 @@ You can create optional build entrypoints later with:
270
270
 
271
271
  If these files already exist, `init` warns that they will be replaced.
272
272
 
273
+ ### Section schema builder
274
+
275
+ Build Shopify section schemas dynamically from JavaScript or JSON files using `climaybe build-schemas`. Works directly in `sections/` — no separate source folder, no sync issues with the theme editor.
276
+
277
+ **How it works:** Add an inline-comment marker at the end of any `sections/*.liquid` or `blocks/*.liquid` file. Shopify treats `{% # ... %}` as a comment and ignores it. The builder finds the marker, resolves the schema from `_schemas/`, and writes the generated `{% schema %}...{% endschema %}` block below it. The marker is never removed, so rebuilds always work — even after Shopify theme editor edits.
278
+
279
+ ```liquid
280
+ <section class="hero">{{ section.settings.title }}</section>
281
+
282
+ {% # schema 'hero-banner' %}
283
+ {% schema %}
284
+ {
285
+ "name": "Hero Banner",
286
+ "settings": [...]
287
+ }
288
+ {% endschema %}
289
+ ```
290
+
291
+ On rebuild, only the generated `{% schema %}` block is replaced. Everything above the marker (including theme editor changes) is preserved.
292
+
293
+ **Supported patterns:**
294
+
295
+ - **Shared schemas** — one schema file reused across multiple sections
296
+ - **Partials** — `require()` shared settings arrays into multiple schemas
297
+ - **Common fieldsets** — spread partial arrays into settings (`...linkSettings`)
298
+ - **Looping fieldsets** — factory functions that generate repeated field groups
299
+ - **Section-specific overrides** — export a function receiving `(filename, inlineContent)` to customise per section
300
+ - **Inline JSON overrides** — add `{% # { "name": "Custom" } %}` below the marker
301
+
302
+ ```bash
303
+ npx climaybe build-schemas # generate schemas in sections/
304
+ npx climaybe build-schemas --dry-run # preview without writing files
305
+ npx climaybe build-schemas --list # list schema files and markers
306
+ ```
307
+
308
+ Schemas also rebuild automatically during `climaybe serve` and `climaybe serve:assets` — the watcher monitors `_schemas/` for changes and rebuilds on save, tagged `[schema]` in green. `climaybe build` includes schemas alongside scripts and Tailwind.
309
+
310
+ Example `_schemas/hero-banner.js`:
311
+
312
+ ```js
313
+ const createLinks = require('./partials/create-links');
314
+
315
+ module.exports = {
316
+ name: 'Hero Banner',
317
+ settings: [
318
+ { label: 'Title', id: 'title', type: 'text' },
319
+ ...createLinks(2)
320
+ ]
321
+ };
322
+ ```
323
+
324
+ **Full examples:** See **[Schema Builder Examples](docs/SCHEMA_BUILDER_EXAMPLES.md)** for working code covering every pattern.
325
+
273
326
  You can install/update this later with:
274
327
 
275
328
  `climaybe add-dev-kit` (or `climaybe theme add-dev-kit`)
@@ -342,6 +395,10 @@ Add the following secrets to your GitHub repository (or use **GitLab CI/CD varia
342
395
  │ ├── config/settings_data.json
343
396
  │ ├── templates/*.json
344
397
  │ └── sections/*.json
398
+ ├── _schemas/ (optional: JS/JSON schema definitions for build-schemas)
399
+ │ ├── hero-banner.js
400
+ │ └── partials/
401
+ │ └── link.js
345
402
  ├── package.json
346
403
  └── .github/workflows/
347
404
  ```
package/bin/version.txt CHANGED
@@ -1 +1 @@
1
- 3.0.9
1
+ 3.1.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "climaybe",
3
- "version": "3.0.9",
3
+ "version": "3.1.1",
4
4
  "description": "Shopify CLI by Electric Maybe for theme CI/CD workflows, branch orchestration, app setup, and dev tooling",
5
5
  "type": "module",
6
6
  "bin": {
@@ -82,7 +82,7 @@
82
82
  "@tailwindcss/cli": "^4.1.17",
83
83
  "@tailwindcss/typography": "^0.5.16",
84
84
  "commander": "^14.0.3",
85
- "eslint": "^9.11.0",
85
+ "eslint": "^10.1.0",
86
86
  "picocolors": "^1.1.1",
87
87
  "prettier": "^3.4.2",
88
88
  "prompts": "^2.4.2",
@@ -0,0 +1,74 @@
1
+ import pc from 'picocolors';
2
+ import { requireThemeProject } from '../lib/theme-guard.js';
3
+ import { buildSchemas, listSchemaFiles, listSectionsWithSchemaRefs } from '../lib/schema-builder.js';
4
+
5
+ export async function buildSchemasCommand(opts = {}) {
6
+ console.log(pc.bold('\n climaybe — Build schemas\n'));
7
+ if (!requireThemeProject()) return;
8
+
9
+ try {
10
+ const dryRun = opts.dryRun === true;
11
+ const list = opts.list === true;
12
+
13
+ if (list) {
14
+ const schemas = listSchemaFiles(process.cwd());
15
+ const refs = listSectionsWithSchemaRefs(process.cwd());
16
+
17
+ if (schemas.length === 0 && refs.length === 0) {
18
+ console.log(pc.yellow(' No _schemas/ files or schema markers found.'));
19
+ return;
20
+ }
21
+
22
+ if (schemas.length > 0) {
23
+ console.log(pc.cyan(' Schema source files (_schemas/):'));
24
+ for (const s of schemas) {
25
+ console.log(pc.dim(` - ${s}`));
26
+ }
27
+ }
28
+
29
+ if (refs.length > 0) {
30
+ console.log(pc.cyan('\n Files with schema markers:'));
31
+ for (const { section, schemas: names } of refs) {
32
+ console.log(` ${pc.white(section)} → ${names.map((r) => pc.green(r)).join(', ')}`);
33
+ }
34
+ }
35
+ return;
36
+ }
37
+
38
+ if (dryRun) {
39
+ console.log(pc.dim(' Dry run — no files will be written.\n'));
40
+ }
41
+
42
+ const { processed, skipped, errors } = buildSchemas({ cwd: process.cwd(), dryRun });
43
+
44
+ if (processed.length === 0 && errors.length === 0 && skipped.length === 0) {
45
+ console.log(pc.yellow(' No sections/ or blocks/ directory found. Nothing to build.'));
46
+ return;
47
+ }
48
+
49
+ if (processed.length === 0 && errors.length === 0) {
50
+ console.log(pc.yellow(' No schema markers found in sections/ or blocks/.'));
51
+ console.log(pc.dim(" Add a marker to a liquid file: {% # schema 'name' %}"));
52
+ return;
53
+ }
54
+
55
+ if (processed.length > 0) {
56
+ const verb = dryRun ? 'Would generate' : 'Generated';
57
+ console.log(pc.green(` ${verb} schemas for ${processed.length} file(s):`));
58
+ for (const { section, schemaName } of processed) {
59
+ console.log(pc.dim(` - ${section} ← _schemas/${schemaName}`));
60
+ }
61
+ }
62
+
63
+ if (errors.length > 0) {
64
+ console.log(pc.red(`\n ${errors.length} error(s):`));
65
+ for (const { section, schema, error } of errors) {
66
+ console.log(pc.red(` ${section} (schema: ${schema}): ${error}`));
67
+ }
68
+ process.exitCode = 1;
69
+ }
70
+ } catch (err) {
71
+ console.log(pc.red(` Build error: ${err.message}`));
72
+ process.exitCode = 1;
73
+ }
74
+ }
@@ -15,7 +15,7 @@ When you perform any of the following, **read and apply** the corresponding rule
15
15
  - **Liquid syntax and usage** → `liquid.mdc`
16
16
  - **Section files (sections/*.liquid)** → `sections.mdc`
17
17
  - **Snippets (snippets/*.liquid)** → `snippets.mdc`
18
- - **Schema definitions (section/layout schemas)** → `schemas.mdc`
18
+ - **Schema definitions (section/layout schemas), _schemas/ builder** → `schemas.mdc`
19
19
  - **Liquid documentation comments** → `liquid-doc-rules.mdc`
20
20
  - **JS refactor tasks / current refactoring work** → `js-refactor-tasks.mdc`
21
21
  - **Adding or editing Cursor rules** → `cursor-rule-template.mdc`
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Git commit conventions for Shopify theme projects (emoji + type + description)
2
+ description: Git commit conventions for Shopify theme projects (type + description)
3
3
  globs:
4
4
  - "**/*"
5
5
  alwaysApply: false
@@ -8,75 +8,75 @@ alwaysApply: false
8
8
 
9
9
  ## Commit Convention
10
10
 
11
- Follow conventional commit format with emoji prefixes for all commits:
11
+ Follow conventional commit format for all commits:
12
12
 
13
13
  ```
14
- <emoji> <type>: <description>
14
+ <type>: <description>
15
15
  ```
16
16
 
17
17
  ## Commit Types
18
18
 
19
- ### 🔨 `fix:` - Bug Fixes
19
+ ### `fix:` - Bug Fixes
20
20
  - Fixes for broken functionality
21
21
  - Bug patches and error corrections
22
22
  - Performance fixes
23
23
 
24
24
  **Examples:**
25
25
  ```
26
- 🔨 fix: modal close button not working
27
- 🔨 fix: cart total calculation error
28
- 🔨 fix: mobile navigation menu overlap
26
+ fix: modal close button not working
27
+ fix: cart total calculation error
28
+ fix: mobile navigation menu overlap
29
29
  ```
30
30
 
31
- ### 🚀 `feat:` - New Features
31
+ ### `feat:` - New Features
32
32
  - New functionality additions
33
33
  - Feature implementations
34
34
  - New components or sections
35
35
 
36
36
  **Examples:**
37
37
  ```
38
- 🚀 feat: add product quick view functionality
39
- 🚀 feat: implement infinite scroll for collections
40
- 🚀 feat: add newsletter signup modal
38
+ feat: add product quick view functionality
39
+ feat: implement infinite scroll for collections
40
+ feat: add newsletter signup modal
41
41
  ```
42
42
 
43
- ### ♻️ `refactor:` - Code Refactoring
43
+ ### `refactor:` - Code Refactoring
44
44
  - Code restructuring without changing functionality
45
45
  - Performance improvements
46
46
  - Code cleanup and optimization
47
47
 
48
48
  **Examples:**
49
49
  ```
50
- ♻️ refactor: optimize product card rendering
51
- ♻️ refactor: restructure JavaScript build system
52
- ♻️ refactor: improve web component lifecycle management
50
+ refactor: optimize product card rendering
51
+ refactor: restructure JavaScript build system
52
+ refactor: improve web component lifecycle management
53
53
  ```
54
54
 
55
- ### 🎨 `style:` - UI/Styling Changes
55
+ ### `style:` - UI/Styling Changes
56
56
  - Visual design updates
57
57
  - CSS/styling modifications
58
58
  - Layout adjustments
59
59
 
60
60
  **Examples:**
61
61
  ```
62
- 🎨 style: update button hover states
63
- 🎨 style: improve mobile responsive design
64
- 🎨 style: adjust typography spacing
62
+ style: update button hover states
63
+ style: improve mobile responsive design
64
+ style: adjust typography spacing
65
65
  ```
66
66
 
67
- ### 🗑️ `remove:` - Code Removal
67
+ ### `remove:` - Code Removal
68
68
  - Removing unused code
69
69
  - Deleting deprecated features
70
70
  - Cleaning up legacy code
71
71
 
72
72
  **Examples:**
73
73
  ```
74
- 🗑️ remove: unused JavaScript functions
75
- 🗑️ remove: deprecated Liquid snippets
76
- 🗑️ remove: old CSS classes
74
+ remove: unused JavaScript functions
75
+ remove: deprecated Liquid snippets
76
+ remove: old CSS classes
77
77
  ```
78
78
 
79
- ### 🚧 `wip:` - Work in Progress
79
+ ### `wip:` - Work in Progress
80
80
  - Incomplete features
81
81
  - Experimental code
82
82
  - Development in progress
@@ -84,12 +84,12 @@ Follow conventional commit format with emoji prefixes for all commits:
84
84
 
85
85
  **Examples:**
86
86
  ```
87
- 🚧 wip: product quick view modal (incomplete)
88
- 🚧 wip: experimental infinite scroll implementation
89
- 🚧 wip: temporary mobile navigation solution
87
+ wip: product quick view modal (incomplete)
88
+ wip: experimental infinite scroll implementation
89
+ wip: temporary mobile navigation solution
90
90
  ```
91
91
 
92
- ### 📝 `docs:` - Documentation
92
+ ### `docs:` - Documentation
93
93
  - README updates
94
94
  - Code documentation
95
95
  - Comment additions
@@ -97,12 +97,12 @@ Follow conventional commit format with emoji prefixes for all commits:
97
97
 
98
98
  **Examples:**
99
99
  ```
100
- 📝 docs: update installation instructions
101
- 📝 docs: add component usage examples
102
- 📝 docs: improve code comments
100
+ docs: update installation instructions
101
+ docs: add component usage examples
102
+ docs: improve code comments
103
103
  ```
104
104
 
105
- ### `ai:` - AI Rules & Automation
105
+ ### `ai:` - AI Rules & Automation
106
106
  - AI-generated code improvements
107
107
  - Automated refactoring
108
108
  - Code optimization rules
@@ -110,12 +110,12 @@ Follow conventional commit format with emoji prefixes for all commits:
110
110
 
111
111
  **Examples:**
112
112
  ```
113
- ai: implement automated code formatting rules
114
- ai: optimize web component performance with AI suggestions
115
- ai: add intelligent error handling patterns
113
+ ai: implement automated code formatting rules
114
+ ai: optimize web component performance with AI suggestions
115
+ ai: add intelligent error handling patterns
116
116
  ```
117
117
 
118
- ### 🔧 `chore:` - Maintenance Tasks
118
+ ### `chore:` - Maintenance Tasks
119
119
  - Build system updates
120
120
  - Configuration changes
121
121
  - Dependency management
@@ -123,21 +123,21 @@ Follow conventional commit format with emoji prefixes for all commits:
123
123
 
124
124
  **Examples:**
125
125
  ```
126
- 🔧 chore: update Tailwind CSS to v4
127
- 🔧 chore: add new npm scripts
128
- 🔧 chore: update Shopify CLI version
126
+ chore: update Tailwind CSS to v4
127
+ chore: add new npm scripts
128
+ chore: update Shopify CLI version
129
129
  ```
130
130
 
131
- ### ⬆️ `upgrade:` - Dependencies
131
+ ### `upgrade:` - Dependencies
132
132
  - Package updates
133
133
  - Version upgrades
134
134
  - Security patches
135
135
 
136
136
  **Examples:**
137
137
  ```
138
- ⬆️ upgrade: update Shopify CLI to latest version
139
- ⬆️ upgrade: bump Tailwind CSS dependencies
140
- ⬆️ upgrade: security patch for npm packages
138
+ upgrade: update Shopify CLI to latest version
139
+ upgrade: bump Tailwind CSS dependencies
140
+ upgrade: security patch for npm packages
141
141
  ```
142
142
 
143
143
  ## Commit Message Guidelines
@@ -150,18 +150,18 @@ Follow conventional commit format with emoji prefixes for all commits:
150
150
 
151
151
  ### Good Examples
152
152
  ```
153
- 🔨 fix: resolve cart total calculation error
154
- 🚀 feat: implement product quick view modal
155
- ♻️ refactor: optimize web component performance
156
- 🎨 style: improve mobile navigation layout
153
+ fix: resolve cart total calculation error
154
+ feat: implement product quick view modal
155
+ refactor: optimize web component performance
156
+ style: improve mobile navigation layout
157
157
  ```
158
158
 
159
159
  ### Bad Examples
160
160
  ```
161
- 🔨 fix: fixed the bug
162
- 🚀 feat: Added new feature
163
- ♻️ refactor: Refactored code for better performance.
164
- 🎨 style: Updated styling
161
+ fix: fixed the bug
162
+ feat: Added new feature
163
+ refactor: Refactored code for better performance.
164
+ style: Updated styling
165
165
  ```
166
166
 
167
167
  ## Multi-line Commit Messages
@@ -169,7 +169,7 @@ Follow conventional commit format with emoji prefixes for all commits:
169
169
  For complex changes, use multi-line format:
170
170
 
171
171
  ```
172
- 🔨 fix: resolve cart total calculation error
172
+ fix: resolve cart total calculation error
173
173
 
174
174
  - Fix floating point precision issues
175
175
  - Add proper error handling for invalid prices
@@ -183,7 +183,7 @@ Closes #123
183
183
  For breaking changes, use `!` after the type and include migration notes:
184
184
 
185
185
  ```
186
- ♻️ refactor!: restructure web component API
186
+ refactor!: restructure web component API
187
187
 
188
188
  BREAKING CHANGE: Component initialization now requires config object
189
189
  Migration: Update component calls to use new API format
@@ -197,9 +197,9 @@ Migration: Update component calls to use new API format
197
197
  You can add scope to specify the area of change:
198
198
 
199
199
  ```
200
- 🔨 fix(web-components): resolve event listener memory leak
201
- 🚀 feat(sections): add new product grid layout
202
- 🎨 style(header): improve mobile navigation
200
+ fix(web-components): resolve event listener memory leak
201
+ feat(sections): add new product grid layout
202
+ style(header): improve mobile navigation
203
203
  ```
204
204
 
205
205
  ## File-specific Commits
@@ -207,9 +207,9 @@ You can add scope to specify the area of change:
207
207
  When committing changes to specific file types, include context:
208
208
 
209
209
  ```
210
- 🔨 fix(liquid): resolve template rendering error in product page
211
- 🚀 feat(js): add new utility functions for DOM manipulation
212
- 🎨 style(css): update button component styling
210
+ fix(liquid): resolve template rendering error in product page
211
+ feat(js): add new utility functions for DOM manipulation
212
+ style(css): update button component styling
213
213
  ```
214
214
 
215
215
  ## Commit Frequency
@@ -250,37 +250,37 @@ When creating pull requests:
250
250
 
251
251
  ### Web Components
252
252
  ```
253
- 🔨 fix: resolve web component memory leak in disconnectedCallback
254
- 🚀 feat: add new electric-slider component with touch support
255
- ♻️ refactor: optimize web component event handling
253
+ fix: resolve web component memory leak in disconnectedCallback
254
+ feat: add new electric-slider component with touch support
255
+ refactor: optimize web component event handling
256
256
  ```
257
257
 
258
258
  ### Shopify Sections
259
259
  ```
260
- 🔨 fix: resolve section rendering error in collection page
261
- 🚀 feat: add new product recommendations section
262
- 🎨 style: improve section spacing and layout
260
+ fix: resolve section rendering error in collection page
261
+ feat: add new product recommendations section
262
+ style: improve section spacing and layout
263
263
  ```
264
264
 
265
265
  ### JavaScript
266
266
  ```
267
- 🔨 fix: resolve async/await error in cart API
268
- 🚀 feat: add utility functions for DOM manipulation
269
- ♻️ refactor: optimize JavaScript build system
267
+ fix: resolve async/await error in cart API
268
+ feat: add utility functions for DOM manipulation
269
+ refactor: optimize JavaScript build system
270
270
  ```
271
271
 
272
272
  ### CSS/Styling
273
273
  ```
274
- 🎨 style: update button component design system
275
- 🎨 style: improve mobile responsive breakpoints
276
- 🎨 style: add new color palette variables
274
+ style: update button component design system
275
+ style: improve mobile responsive breakpoints
276
+ style: add new color palette variables
277
277
  ```
278
278
 
279
279
  ### Liquid Templates
280
280
  ```
281
- 🔨 fix: resolve Liquid syntax error in product template
282
- 🚀 feat: add new product variant selector
283
- ♻️ refactor: optimize Liquid template performance
281
+ fix: resolve Liquid syntax error in product template
282
+ feat: add new product variant selector
283
+ refactor: optimize Liquid template performance
284
284
  ```
285
285
 
286
286
  This commit convention ensures clear, consistent, and informative commit messages that help track project progress and facilitate collaboration.