climaybe 1.8.0 → 1.8.2

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
@@ -225,6 +225,7 @@ Enabled via `climaybe init` prompt (`Enable build + Lighthouse workflows?`; defa
225
225
  - **Non-staging to main** (hotfix backports, direct commits): **Patch** bump only, via **nightly workflow** at 02:00 US Eastern (not at commit time).
226
226
  - **Version bump runs only on main** (post-merge-tag and nightly-hotfix). Main-to-staging-stores merges main into each `staging-<alias>` on every push (version bumps and hotfixes). When the push is a hotfix from one store (e.g. live-norway), that store’s staging branch is skipped; other stores’ staging branches still get the merge.
227
227
  - Version bumps update `config/settings_schema.json` and, when present, `package.json` `version`.
228
+ - **Safety**: The version-bump workflow fails if the new tag would not be **strictly higher** than the latest merged release tag (semver), so the release line cannot step backward.
228
229
 
229
230
  **Full specification:** For detailed versioning rules, local dev flow, hotfix behavior, and alignment with the external CI/CD doc, see **[CI/CD Reference](docs/CI_CD_REFERENCE.md)**.
230
231
 
package/bin/version.txt CHANGED
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.8.2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "climaybe",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "Shopify CI/CD CLI — scaffolds workflows, branch strategy, and store config for single-store and multi-store theme repos",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,7 @@ Use the same type labels and emoji for changelog sections so the output matches
18
18
 
19
19
  ## Workflow
20
20
 
21
- 1. **Determine range** — Since last tag (e.g. `git describe --tags --abbrev=0` then `git log TAG..HEAD`), or since a branch/commit the user specifies. If unclear, default to "since last tag".
21
+ 1. **Determine range** — Since last tag: use the **highest semver** among tags merged into `HEAD` (merged-into + `sort -V`), then `git log TAG..HEAD`. Do not rely on `git describe` alone after branch merges—it can return a **lower** version that is graph-closer on the merged branch. Or use a branch/commit the user specifies. If unclear, default to "since last tag".
22
22
  2. **Get commits** — Run `git log --oneline [range]` (or with `--pretty=format:...` for message + body). Parse commit messages.
23
23
  3. **Group by type** — Map each commit to a type from commit-rules.mdc (fix, feat, refactor, style, remove, wip, docs, ai, chore, upgrade). Ignore merge commits. Put "unknown" or "other" for non-matching messages.
24
24
  4. **Format** — Output markdown:
@@ -47,6 +47,6 @@ jobs:
47
47
  if git diff --staged --quiet; then
48
48
  echo "No changes to commit"
49
49
  else
50
- git commit -m "Update compiled assets (JavaScript and CSS)"
50
+ git commit -m "🔧 chore(assets): update compiled javascript and css"
51
51
  git push origin "$BRANCH_NAME"
52
52
  fi
@@ -61,9 +61,15 @@ jobs:
61
61
  fi
62
62
  NEW_VERSION="v${NEW_VERSION}"
63
63
  else
64
- # Get latest tag (or theme_version from settings_schema.json when no tags)
65
- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true)
64
+ # Highest semver among tags reachable from HEAD not `git describe`, which picks
65
+ # the graph-nearest tag and can choose an old tag on the merged branch after staging→main.
66
+ LATEST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
67
+ # Legacy tags without patch (v1.0) if no strict triple match
66
68
  if [ -z "$LATEST_TAG" ]; then
69
+ LATEST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+$' | sort -V | tail -1)
70
+ fi
71
+ if [ -z "$LATEST_TAG" ]; then
72
+ # No semver tags: theme_version from settings_schema.json, else v0.0.0
67
73
  SCHEMA="config/settings_schema.json"
68
74
  if [ -f "$SCHEMA" ]; then
69
75
  LATEST_TAG=$(node -e "
@@ -100,6 +106,26 @@ jobs:
100
106
  echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
101
107
  echo "New version: $NEW_VERSION"
102
108
 
109
+ - name: Refuse non-increasing version
110
+ env:
111
+ NEW_VERSION: ${{ steps.bump.outputs.new_version }}
112
+ run: |
113
+ git fetch --tags origin
114
+ MAX_EXISTING=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
115
+ if [ -z "$MAX_EXISTING" ]; then
116
+ MAX_EXISTING=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+$' | sort -V | tail -1)
117
+ fi
118
+ if [ -z "$MAX_EXISTING" ]; then
119
+ echo "No merged semver tags; skipping monotonic check."
120
+ exit 0
121
+ fi
122
+ HI=$(printf '%s\n' "$MAX_EXISTING" "$NEW_VERSION" | sort -V | tail -1)
123
+ if [ "$HI" != "$NEW_VERSION" ] || [ "$NEW_VERSION" = "$MAX_EXISTING" ]; then
124
+ echo "::error::Refusing to release ${NEW_VERSION}: latest merged tag is ${MAX_EXISTING}; new tag must be strictly higher (semver)."
125
+ exit 1
126
+ fi
127
+ echo "OK: ${NEW_VERSION} > ${MAX_EXISTING}"
128
+
103
129
  - name: Update settings_schema.json and package.json
104
130
  env:
105
131
  NEW_VERSION: ${{ steps.bump.outputs.new_version }}
@@ -42,7 +42,10 @@ jobs:
42
42
  env:
43
43
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44
44
  run: |
45
- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true)
45
+ LATEST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
46
+ if [ -z "$LATEST_TAG" ]; then
47
+ LATEST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+$' | sort -V | tail -1)
48
+ fi
46
49
  if [ -z "$LATEST_TAG" ]; then
47
50
  SCHEMA="config/settings_schema.json"
48
51
  if [ -f "$SCHEMA" ]; then
@@ -77,7 +77,10 @@ jobs:
77
77
  - name: Get latest tag (or create from settings_schema.json)
78
78
  id: tag
79
79
  run: |
80
- LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true)
80
+ LAST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
81
+ if [ -z "$LAST_TAG" ]; then
82
+ LAST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+$' | sort -V | tail -1)
83
+ fi
81
84
  if [ -z "$LAST_TAG" ]; then
82
85
  SCHEMA="config/settings_schema.json"
83
86
  if [ -f "$SCHEMA" ]; then
@@ -56,7 +56,10 @@ jobs:
56
56
  - name: Create pre-release patch tag
57
57
  id: tag
58
58
  run: |
59
- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true)
59
+ LATEST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)
60
+ if [ -z "$LATEST_TAG" ]; then
61
+ LATEST_TAG=$(git tag --merged HEAD | grep -E '^v[0-9]+\.[0-9]+$' | sort -V | tail -1)
62
+ fi
60
63
  if [ -z "$LATEST_TAG" ]; then
61
64
  # No tags: use theme_version from config/settings_schema.json and push as initial tag
62
65
  SCHEMA="config/settings_schema.json"