climaybe 3.1.2 → 3.1.4

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
@@ -243,14 +243,14 @@ When enabled, builds are **resilient**:
243
243
  - If `_scripts/*.js` or `_styles/main.css` are missing, the build workflow **skips** those steps and continues.
244
244
  - `init` may offer to create entrypoints; **default answer is No**.
245
245
  - Script bundling preserves comments/spacing and emits bundles only for root entry files (files imported by other top-level `_scripts/*.js` are inlined, not emitted separately).
246
- - On `live-<alias>` branches only, script bundles are minified and overwrite `assets/*.js`; `main` and `staging-*` keep readable built JS.
246
+ - Script bundles are written to `assets/*.js` (readable by default; use `climaybe build-scripts --minify` if you want minified output).
247
247
  - Live minified `assets/*` changes are intentionally excluded from hotfix backports to `main` (no branch-specific `.gitignore` split required).
248
248
 
249
249
  Build workflows install deps with `npm ci` and run `npx --no-install climaybe build-scripts` plus `npx --no-install climaybe build`, so CI uses lockfile-pinned versions (no `@latest` drift).
250
250
 
251
251
  | Workflow | Trigger | What it does |
252
252
  |----------|---------|-------------|
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 |
253
+ | `build-pipeline.yml` | Push to any branch (ignores docs-only/tooling-only paths; see CI/CD reference) | Runs reusable build; skips entirely on **`live-*`** when the pusher is a GitHub **`[bot]`** user; Lighthouse only on branch **`staging`**, when a build ran, and secrets allow |
254
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
 
package/bin/version.txt CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.1.4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "climaybe",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
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": {
package/src/index.js CHANGED
@@ -77,7 +77,7 @@ function registerThemeCommands(cmd) {
77
77
  cmd.command('build').description('Build assets (Tailwind + scripts build)').action(() => buildAll());
78
78
  cmd
79
79
  .command('build-scripts')
80
- .description('Build _scripts → assets/*.js (+ *.min.js)')
80
+ .description('Build _scripts → assets/*.js')
81
81
  .option('--minify', 'Minify output bundles')
82
82
  .action(buildScriptsCommand);
83
83
  cmd
@@ -174,12 +174,6 @@ function outputNameForEntrypoint(entryFile) {
174
174
  return basename(entryFile);
175
175
  }
176
176
 
177
- function outputMinNameForEntrypoint(entryFile) {
178
- const name = outputNameForEntrypoint(entryFile);
179
- if (!name.endsWith('.js')) return `${name}.min.js`;
180
- return name.replace(/\.js$/, '.min.js');
181
- }
182
-
183
177
  function buildSingleEntrypoint({ cwd, entryFile, minify = false }) {
184
178
  const scriptsDir = join(cwd, '_scripts');
185
179
  const entryPath = join(scriptsDir, entryFile);
@@ -214,16 +208,11 @@ function buildSingleEntrypoint({ cwd, entryFile, minify = false }) {
214
208
  const outReadable = stripModuleSyntax(readableContent).trim() + '\n';
215
209
  const outMinified = minifyScriptContent(stripModuleSyntax(minifiedContent)).trim() + '\n';
216
210
 
217
- // Back-compat: when minify=true, the primary output file is minified.
211
+ // When minify=true, the primary output file is minified.
218
212
  writeFileSync(outputPath, (minify ? outMinified : outReadable), 'utf-8');
219
213
 
220
- // Always emit an explicit *.min.js asset so Shopify won't attempt CDN minification.
221
- const outMinFile = outputMinNameForEntrypoint(entryFile);
222
- const outputMinPath = join(assetsDir, outMinFile);
223
- writeFileSync(outputMinPath, outMinified, 'utf-8');
224
-
225
214
  const fileCount = Math.max(processedFilesReadable.size, processedFilesMinified.size);
226
- return { entryFile, fileCount, outputPath, outputMinPath };
215
+ return { entryFile, fileCount, outputPath };
227
216
  }
228
217
 
229
218
  export function buildScripts({ cwd = process.cwd(), entry = null, minify = false } = {}) {
@@ -95,7 +95,6 @@ node_modules/
95
95
  **/.DS_Store
96
96
  assets/style.css
97
97
  assets/index.js
98
- assets/index.min.js
99
98
  .shopify
100
99
  .vercel
101
100
  `;
@@ -22,11 +22,14 @@ jobs:
22
22
  # Skip pure store-sync + hotfix-backport commits; those are infrastructure-only
23
23
  # syncs from staging/live stores back to main and should not trigger heavy theme
24
24
  # review / build pipelines.
25
+ # On live-<alias>, skip when the pusher is a GitHub bot (actor name contains "[bot]")
26
+ # so automated commits do not run script/Tailwind compilation.
25
27
  if: >
26
28
  !contains(github.event.head_commit.message, '[hotfix-backport]')
27
29
  && !contains(github.event.head_commit.message, '[stores-to-root]')
28
30
  && !contains(github.event.head_commit.message, '[root-to-stores]')
29
31
  && !(github.actor == 'github-actions[bot]' && contains(github.event.head_commit.message, 'chore(assets): update compiled javascript and css'))
32
+ && !(startsWith(github.ref_name, 'live-') && contains(github.actor, '[bot]'))
30
33
  uses: ./.github/workflows/reusable-build.yml
31
34
 
32
35
  lighthouse-gate:
@@ -50,12 +50,6 @@ jobs:
50
50
  fi
51
51
  echo "has_scripts=$HAS_SCRIPTS" >> $GITHUB_OUTPUT
52
52
  echo "has_styles=$HAS_STYLES" >> $GITHUB_OUTPUT
53
- BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
54
- if [[ "$BRANCH_NAME" == live-* ]]; then
55
- echo "scripts_minify=true" >> $GITHUB_OUTPUT
56
- else
57
- echo "scripts_minify=false" >> $GITHUB_OUTPUT
58
- fi
59
53
 
60
54
  - name: Decide which build steps to run
61
55
  id: run
@@ -94,11 +88,7 @@ jobs:
94
88
  - name: Build scripts
95
89
  if: steps.run.outputs.build_ran == 'true' && steps.run.outputs.run_scripts == 'true'
96
90
  run: |
97
- if [ "${{ steps.detect.outputs.scripts_minify }}" = "true" ]; then
98
- npx --no-install climaybe build-scripts --minify
99
- else
100
- npx --no-install climaybe build-scripts
101
- fi
91
+ npx --no-install climaybe build-scripts
102
92
 
103
93
  - name: Run Tailwind build
104
94
  if: steps.run.outputs.build_ran == 'true' && steps.run.outputs.run_tailwind == 'true'