climaybe 2.2.4 → 2.2.5
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
|
@@ -209,7 +209,7 @@ Direct pushes to `staging-<store>` or `live-<store>` are automatically synced ba
|
|
|
209
209
|
|
|
210
210
|
| Workflow | Trigger | What it does |
|
|
211
211
|
|----------|---------|-------------|
|
|
212
|
-
| `main-to-staging-stores.yml` (main-to-staging-<store>) | Push to `main` | Merges main into each `staging-<alias>`; root JSONs ignored. For hotfix-backport
|
|
212
|
+
| `main-to-staging-stores.yml` (main-to-staging-<store>) | Push to `main` | Merges main into each `staging-<alias>`; root JSONs ignored. For hotfix-backport: if source is `staging-<alias>`, that same staging branch is skipped; if source is `live-<alias>`, `staging-<alias>` is also synced. Skips only on pure store-sync. |
|
|
213
213
|
| `stores-to-root.yml` | Push to `staging-*` | From main merge: stores→root. From elsewhere (e.g. Shopify): root→stores |
|
|
214
214
|
| `pr-to-live.yml` | After stores-to-root | Opens PR from `staging-<alias>` to `live-<alias>` |
|
|
215
215
|
| `root-to-stores.yml` | Push to `live-*` | From main merge: stores→root. From elsewhere: root→stores (same as stores-to-root on staging-*) |
|
|
@@ -268,7 +268,7 @@ You can install/update this later with:
|
|
|
268
268
|
- **No tags yet?** The system uses `theme_version` from `config/settings_schema.json` (`theme_info`), creates that tag on main (e.g. `v1.0.0`), and continues from there.
|
|
269
269
|
- **Staging → main**: On PR, a pre-release patch tag (e.g. v3.1.13) locks the current minor line; on merge, **minor** bump (e.g. v3.1.13 → v3.2.0).
|
|
270
270
|
- **Non-staging to main** (hotfix backports, direct commits): **Patch** bump only, via **nightly workflow** at 02:00 US Eastern (not at commit time).
|
|
271
|
-
- **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).
|
|
271
|
+
- **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). For hotfix-backport, only a `staging-<alias> -> main` source skips syncing back to the same staging branch; a `live-<alias> -> main` source still syncs into `staging-<alias>`.
|
|
272
272
|
- Version bumps update `config/settings_schema.json` and, when present, `package.json` `version`.
|
|
273
273
|
- **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.
|
|
274
274
|
|
package/bin/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.2.
|
|
1
|
+
2.2.5
|
package/package.json
CHANGED
|
@@ -3,12 +3,16 @@ const path = require('path');
|
|
|
3
3
|
const ROOT_DIR = process.cwd();
|
|
4
4
|
|
|
5
5
|
function extractImports(content) {
|
|
6
|
-
const importRegex = /^\s*import\s+(?:[^'"\n;]+?\s+from\s+)?['"]([^'"]+)['"]\s*;?\s*$/gm;
|
|
7
6
|
const imports = [];
|
|
7
|
+
const fromImportRegex = /(^|\n)\s*import\s+[\s\S]*?\s+from\s+['"]([^'"]+)['"]\s*;?/g;
|
|
8
|
+
const sideEffectImportRegex = /(^|\n)\s*import\s+['"]([^'"]+)['"]\s*;?/g;
|
|
8
9
|
let match;
|
|
9
10
|
|
|
10
|
-
while ((match =
|
|
11
|
-
imports.push(match[
|
|
11
|
+
while ((match = fromImportRegex.exec(content)) !== null) {
|
|
12
|
+
imports.push(match[2]);
|
|
13
|
+
}
|
|
14
|
+
while ((match = sideEffectImportRegex.exec(content)) !== null) {
|
|
15
|
+
imports.push(match[2]);
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
return imports;
|
|
@@ -36,7 +40,12 @@ function processScriptFile(filePath, processedFiles = new Set()) {
|
|
|
36
40
|
importedContent += processScriptFile(importPath, processedFiles);
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
// Remove import statements (including multiline "import { ... } from '...'" forms).
|
|
44
|
+
content = content.replace(/(^|\n)\s*import\s+[\s\S]*?\s+from\s+['"][^'"]+['"]\s*;?/g, '$1');
|
|
45
|
+
content = content.replace(/(^|\n)\s*import\s+['"][^'"]+['"]\s*;?/g, '$1');
|
|
46
|
+
content = content.replace(/^\s*export\s+default\s+/gm, '');
|
|
47
|
+
content = content.replace(/^\s*export\s+\{[^}]*\}\s*;?\s*$/gm, '');
|
|
48
|
+
content = content.replace(/^\s*export\s+(?=(const|let|var|function|class)\b)/gm, '');
|
|
40
49
|
|
|
41
50
|
if (process.env.NODE_ENV === 'production') {
|
|
42
51
|
content = content.replace(/\/\*\*[\s\S]*?\*\//g, '');
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
# merge brings main in but we immediately restore root from stores/<alias>/ so store-specific data is kept.
|
|
5
5
|
# Runs on every push to main except pure store-sync commits ([stores-to-root], [root-to-stores]), so that:
|
|
6
6
|
# - Version-bump commits: staging-<alias> get the new version.
|
|
7
|
-
# - Hotfix backports
|
|
7
|
+
# - Hotfix backports:
|
|
8
|
+
# - staging-<alias> → main: skip syncing back into the same staging-<alias> (already has the change).
|
|
9
|
+
# - live-<alias> → main: sync into staging-<alias> too (so staging gets the live hotfix).
|
|
8
10
|
#
|
|
9
11
|
# Also runs when Post-Merge Tag or Nightly Hotfix Tag complete: version-bump pushes with GITHUB_TOKEN,
|
|
10
12
|
# which does not trigger push-based workflows, so we explicitly run sync after those workflows finish.
|
|
@@ -25,7 +27,7 @@ concurrency:
|
|
|
25
27
|
cancel-in-progress: false
|
|
26
28
|
|
|
27
29
|
jobs:
|
|
28
|
-
# Gate: skip only pure store-sync commits.
|
|
30
|
+
# Gate: skip only pure store-sync commits. For hotfix-backport, skip syncing back only when source was staging-<alias>.
|
|
29
31
|
# When triggered by workflow_run (version-bump finished), run sync if the workflow succeeded.
|
|
30
32
|
gate:
|
|
31
33
|
runs-on: ubuntu-latest
|
|
@@ -33,7 +35,7 @@ jobs:
|
|
|
33
35
|
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
|
|
34
36
|
outputs:
|
|
35
37
|
should_run: ${{ steps.check.outputs.should_run }}
|
|
36
|
-
|
|
38
|
+
hotfix_skip_alias: ${{ steps.check.outputs.hotfix_skip_alias }}
|
|
37
39
|
steps:
|
|
38
40
|
- name: Check commit message and hotfix source
|
|
39
41
|
id: check
|
|
@@ -41,7 +43,7 @@ jobs:
|
|
|
41
43
|
if [ "${{ github.event_name }}" = "workflow_run" ]; then
|
|
42
44
|
echo "Triggered by workflow_run (version-bump finished); syncing main to staging."
|
|
43
45
|
echo "should_run=true" >> $GITHUB_OUTPUT
|
|
44
|
-
echo "
|
|
46
|
+
echo "hotfix_skip_alias=" >> $GITHUB_OUTPUT
|
|
45
47
|
exit 0
|
|
46
48
|
fi
|
|
47
49
|
|
|
@@ -50,22 +52,21 @@ jobs:
|
|
|
50
52
|
if echo "$COMMIT_MSG" | grep -qE "\[skip-store-sync\]|\[stores-to-root\]|\[root-to-stores\]"; then
|
|
51
53
|
echo "Skipping — store sync commit (avoid loop)"
|
|
52
54
|
echo "should_run=false" >> $GITHUB_OUTPUT
|
|
53
|
-
echo "
|
|
55
|
+
echo "hotfix_skip_alias=" >> $GITHUB_OUTPUT
|
|
54
56
|
exit 0
|
|
55
57
|
fi
|
|
56
58
|
|
|
57
59
|
echo "should_run=true" >> $GITHUB_OUTPUT
|
|
58
60
|
|
|
59
|
-
# If hotfix-backport
|
|
60
|
-
|
|
61
|
+
# If hotfix-backport came from staging-<alias>, skip syncing back to that same staging branch.
|
|
62
|
+
HOTFIX_SKIP_ALIAS=""
|
|
61
63
|
if echo "$COMMIT_MSG" | grep -q "\[hotfix-backport\]"; then
|
|
62
64
|
SOURCE_BRANCH=$(echo "$COMMIT_MSG" | sed -n 's/.*Merge \([^ ]*\) into main.*/\1/p' | head -1)
|
|
63
|
-
if [ -n "$SOURCE_BRANCH" ]; then
|
|
64
|
-
|
|
65
|
-
HOTFIX_SOURCE_ALIAS="${HOTFIX_SOURCE_ALIAS#live-}"
|
|
65
|
+
if [[ -n "$SOURCE_BRANCH" && "$SOURCE_BRANCH" == staging-* ]]; then
|
|
66
|
+
HOTFIX_SKIP_ALIAS="${SOURCE_BRANCH#staging-}"
|
|
66
67
|
fi
|
|
67
68
|
fi
|
|
68
|
-
echo "
|
|
69
|
+
echo "hotfix_skip_alias=$HOTFIX_SKIP_ALIAS" >> $GITHUB_OUTPUT
|
|
69
70
|
|
|
70
71
|
# Read store list from package.json
|
|
71
72
|
config:
|
|
@@ -88,7 +89,8 @@ jobs:
|
|
|
88
89
|
echo "stores=$STORES" >> $GITHUB_OUTPUT
|
|
89
90
|
echo "Store aliases: $STORES"
|
|
90
91
|
|
|
91
|
-
# Merge main into each staging-<alias>; root JSONs ignored (restored from stores/<alias>/).
|
|
92
|
+
# Merge main into each staging-<alias>; root JSONs ignored (restored from stores/<alias>/).
|
|
93
|
+
# Skip only staging-origin hotfix source branch (no need to merge back to same staging branch).
|
|
92
94
|
sync:
|
|
93
95
|
needs: [gate, config]
|
|
94
96
|
if: needs.gate.outputs.should_run == 'true'
|
|
@@ -103,7 +105,7 @@ jobs:
|
|
|
103
105
|
actions: write
|
|
104
106
|
env:
|
|
105
107
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
106
|
-
|
|
108
|
+
HOTFIX_SKIP_ALIAS: ${{ needs.gate.outputs.hotfix_skip_alias }}
|
|
107
109
|
steps:
|
|
108
110
|
- uses: actions/checkout@v4
|
|
109
111
|
with:
|
|
@@ -116,8 +118,8 @@ jobs:
|
|
|
116
118
|
ALIAS="${{ matrix.store }}"
|
|
117
119
|
STORE_DIR="stores/${ALIAS}"
|
|
118
120
|
|
|
119
|
-
if [ -n "$
|
|
120
|
-
echo "Hotfix came from staging-$ALIAS
|
|
121
|
+
if [ -n "$HOTFIX_SKIP_ALIAS" ] && [ "$HOTFIX_SKIP_ALIAS" = "$ALIAS" ]; then
|
|
122
|
+
echo "Hotfix came from staging-$ALIAS, skipping (no need to merge back to same staging branch)."
|
|
121
123
|
exit 0
|
|
122
124
|
fi
|
|
123
125
|
|