Skip to content

Commit 7b2c069

Browse files
committed
Merge branch 'main' into userquin/feat-add-contributors-popup-card
# Conflicts: # lunaria/files/ar-EG.json # lunaria/files/az-AZ.json # lunaria/files/bg-BG.json # lunaria/files/bn-IN.json # lunaria/files/cs-CZ.json # lunaria/files/de-DE.json # lunaria/files/en-GB.json # lunaria/files/en-US.json # lunaria/files/es-419.json # lunaria/files/es-ES.json # lunaria/files/fr-FR.json # lunaria/files/hi-IN.json # lunaria/files/hu-HU.json # lunaria/files/id-ID.json # lunaria/files/it-IT.json # lunaria/files/ja-JP.json # lunaria/files/kn-IN.json # lunaria/files/nb-NO.json # lunaria/files/ne-NP.json # lunaria/files/pl-PL.json # lunaria/files/pt-BR.json # lunaria/files/ru-RU.json # lunaria/files/ta-IN.json # lunaria/files/te-IN.json # lunaria/files/uk-UA.json # lunaria/files/zh-CN.json # lunaria/files/zh-TW.json
2 parents 3fc6dc1 + 58da597 commit 7b2c069

File tree

294 files changed

+11286
-36168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+11286
-36168
lines changed

.github/workflows/autofix.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626

2727
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
2828
name: 🟧 Install pnpm
29-
with:
30-
cache: true
3129

3230
- name: 📦 Install dependencies
3331
run: pnpm install

.github/workflows/chromatic.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: ☑️ Checkout
23-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2424
with:
2525
fetch-depth: 0
2626
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
@@ -30,16 +30,14 @@ jobs:
3030
with:
3131
node-version: lts/*
3232

33-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
33+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3434
name: 🟧 Install pnpm
35-
with:
36-
cache: true
3735

3836
- name: 📦 Install dependencies
3937
run: pnpm install
4038

4139
- name: 🧪 Run Chromatic Visual and Accessibility Tests
42-
uses: chromaui/action@a8ce9c58f59be5cc7090cadfc8f130fb08fcf0c3 # v15.1.0
40+
uses: chromaui/action@5ec258af08deb3e8c36653bd618cb7fe52090031 # v15.2.0
4341
env:
4442
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
4543
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

.github/workflows/ci.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches:
66
- main
7+
- release
78
push:
89
branches:
910
- main
@@ -33,8 +34,6 @@ jobs:
3334

3435
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3536
name: 🟧 Install pnpm
36-
with:
37-
cache: true
3837

3938
- name: 📦 Install dependencies (root only, no scripts)
4039
run: pnpm install --filter . --ignore-scripts
@@ -55,8 +54,6 @@ jobs:
5554

5655
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
5756
name: 🟧 Install pnpm
58-
with:
59-
cache: true
6057

6158
- name: 📦 Install dependencies
6259
run: pnpm install
@@ -77,8 +74,6 @@ jobs:
7774

7875
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
7976
name: 🟧 Install pnpm
80-
with:
81-
cache: true
8277

8378
- name: 📦 Install dependencies
8479
run: pnpm install
@@ -105,8 +100,6 @@ jobs:
105100

106101
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
107102
name: 🟧 Install pnpm
108-
with:
109-
cache: true
110103

111104
- name: 📦 Install dependencies
112105
run: pnpm install
@@ -144,8 +137,6 @@ jobs:
144137

145138
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
146139
name: 🟧 Install pnpm
147-
with:
148-
cache: true
149140

150141
- name: 📦 Install dependencies
151142
run: pnpm install
@@ -154,7 +145,6 @@ jobs:
154145
run: pnpm build:test
155146
env:
156147
VALIDATE_HTML: true
157-
NODE_OPTIONS: --max-old-space-size=6144
158148

159149
- name: 🖥️ Test project (browser)
160150
run: pnpm test:browser:prebuilt
@@ -175,16 +165,12 @@ jobs:
175165

176166
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
177167
name: 🟧 Install pnpm
178-
with:
179-
cache: true
180168

181169
- name: 📦 Install dependencies
182170
run: pnpm install
183171

184172
- name: 🏗️ Build project
185173
run: pnpm build:test
186-
env:
187-
NODE_OPTIONS: --max-old-space-size=6144
188174

189175
- name: ♿ Accessibility audit (Lighthouse - ${{ matrix.mode }} mode)
190176
run: pnpm test:a11y:prebuilt
@@ -205,8 +191,6 @@ jobs:
205191

206192
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
207193
name: 🟧 Install pnpm
208-
with:
209-
cache: true
210194

211195
- name: 📦 Install dependencies
212196
run: pnpm install
@@ -230,8 +214,6 @@ jobs:
230214

231215
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
232216
name: 🟧 Install pnpm
233-
with:
234-
cache: true
235217

236218
- name: 📦 Install dependencies (root only, no scripts)
237219
run: pnpm install --filter . --ignore-scripts

.github/workflows/lunaria.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ jobs:
3434

3535
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # 4e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3636
name: 🟧 Install pnpm
37-
with:
38-
cache: true
3937

4038
- name: 📦 Install dependencies
4139
run: pnpm install

.github/workflows/release-pr.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: release-pr
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
release-pr:
14+
name: 🚀 Create or update release PR
15+
runs-on: ubuntu-slim
16+
if: github.repository == 'npmx-dev/npmx.dev'
17+
18+
steps:
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
24+
with:
25+
node-version: lts/*
26+
27+
- name: 🔍 Check for unreleased commits
28+
id: check
29+
run: |
30+
git fetch origin release
31+
COMMITS=$(git log origin/release..origin/main --oneline)
32+
if [ -z "$COMMITS" ]; then
33+
echo "skip=true" >> "$GITHUB_OUTPUT"
34+
echo "No new commits to release"
35+
else
36+
echo "skip=false" >> "$GITHUB_OUTPUT"
37+
echo "Found unreleased commits:"
38+
echo "$COMMITS"
39+
fi
40+
41+
- name: 🔢 Determine next version
42+
if: steps.check.outputs.skip == 'false'
43+
id: version
44+
run: |
45+
VERSION_JSON=$(node scripts/next-version.ts)
46+
CURRENT_VERSION=$(echo "$VERSION_JSON" | jq -r .current)
47+
NEXT_VERSION=$(echo "$VERSION_JSON" | jq -r .next)
48+
FROM_REF=$(echo "$VERSION_JSON" | jq -r .from)
49+
echo "current=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
50+
echo "next=v${NEXT_VERSION}" >> "$GITHUB_OUTPUT"
51+
echo "from=$FROM_REF" >> "$GITHUB_OUTPUT"
52+
53+
- name: 📝 Generate changelog body
54+
if: steps.check.outputs.skip == 'false'
55+
id: changelog
56+
env:
57+
CURRENT_VERSION: ${{ steps.version.outputs.current }}
58+
NEXT_VERSION: ${{ steps.version.outputs.next }}
59+
FROM_REF: ${{ steps.version.outputs.from }}
60+
run: |
61+
# Categorize commits
62+
FEATURES=""
63+
FIXES=""
64+
CHORES=""
65+
OTHER=""
66+
67+
while IFS= read -r line; do
68+
[ -z "$line" ] && continue
69+
SHA=$(echo "$line" | cut -d' ' -f1)
70+
MSG=$(echo "$line" | cut -d' ' -f2-)
71+
ENTRY="- $MSG (\`$SHA\`)"
72+
73+
if echo "$MSG" | grep -qE '^feat(\(|:)'; then
74+
FEATURES="${FEATURES}${ENTRY}\n"
75+
elif echo "$MSG" | grep -qE '^fix(\(|:)'; then
76+
FIXES="${FIXES}${ENTRY}\n"
77+
elif echo "$MSG" | grep -qE '^(chore|ci|build|perf|refactor|style|test|docs)(\(|:)'; then
78+
CHORES="${CHORES}${ENTRY}\n"
79+
else
80+
OTHER="${OTHER}${ENTRY}\n"
81+
fi
82+
done <<< "$(git log "$FROM_REF"..origin/main --oneline --no-merges)"
83+
84+
# Strip the leading 'v' for display
85+
DISPLAY_NEXT="${NEXT_VERSION#v}"
86+
87+
# Build the PR body
88+
BODY="This PR will deploy the following changes to production (\`npmx.dev\`).\n\n"
89+
BODY="${BODY}**Next version: \`${NEXT_VERSION}\`** (current: \`v${CURRENT_VERSION}\`)\n\n"
90+
91+
if [ -n "$FEATURES" ]; then
92+
BODY="${BODY}### Features\n\n${FEATURES}\n"
93+
fi
94+
if [ -n "$FIXES" ]; then
95+
BODY="${BODY}### Fixes\n\n${FIXES}\n"
96+
fi
97+
if [ -n "$CHORES" ]; then
98+
BODY="${BODY}### Other Changes\n\n${CHORES}\n"
99+
fi
100+
if [ -n "$OTHER" ]; then
101+
BODY="${BODY}### Uncategorized\n\n${OTHER}\n"
102+
fi
103+
104+
BODY="${BODY}---\n\n"
105+
BODY="${BODY}> Merging this PR will:\n"
106+
BODY="${BODY}> - Deploy to \`npmx.dev\` via Vercel\n"
107+
BODY="${BODY}> - Create a \`${NEXT_VERSION}\` tag and GitHub Release\n"
108+
BODY="${BODY}> - Publish \`npmx-connector@${DISPLAY_NEXT}\` to npm"
109+
110+
# Write body to file, truncating if needed (GitHub limits PR body to 65536 chars)
111+
echo -e "$BODY" > /tmp/pr-body.md
112+
if [ "$(wc -c < /tmp/pr-body.md)" -gt 60000 ]; then
113+
COMMIT_COUNT=$(git log "$FROM_REF"..origin/main --oneline --no-merges | wc -l)
114+
COMPARE_URL="https://github.com/npmx-dev/npmx.dev/compare/${FROM_REF}...main"
115+
TRUNCATED="This PR will deploy the following changes to production (\`npmx.dev\`).\n\n"
116+
TRUNCATED="${TRUNCATED}**Next version: \`${NEXT_VERSION}\`** (current: \`v${CURRENT_VERSION}\`)\n\n"
117+
TRUNCATED="${TRUNCATED}> **${COMMIT_COUNT} commits** are included in this release. The full changelog is too large to display here.\n>\n"
118+
TRUNCATED="${TRUNCATED}> [View full diff on GitHub](${COMPARE_URL})\n\n"
119+
TRUNCATED="${TRUNCATED}---\n\n"
120+
TRUNCATED="${TRUNCATED}> Merging this PR will:\n"
121+
TRUNCATED="${TRUNCATED}> - Deploy to \`npmx.dev\` via Vercel\n"
122+
TRUNCATED="${TRUNCATED}> - Create a \`${NEXT_VERSION}\` tag and GitHub Release\n"
123+
TRUNCATED="${TRUNCATED}> - Publish \`npmx-connector@${DISPLAY_NEXT}\` to npm"
124+
echo -e "$TRUNCATED" > /tmp/pr-body.md
125+
fi
126+
127+
- name: 🚀 Create or update release PR
128+
if: steps.check.outputs.skip == 'false'
129+
env:
130+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
NEXT_VERSION: ${{ steps.version.outputs.next }}
132+
run: |
133+
EXISTING_PR=$(gh pr list --base release --head main --state open --json number --jq '.[0].number')
134+
135+
if [ -n "$EXISTING_PR" ]; then
136+
gh pr edit "$EXISTING_PR" \
137+
--title "chore: release ${NEXT_VERSION}" \
138+
--body-file /tmp/pr-body.md
139+
echo "Updated existing PR #${EXISTING_PR}"
140+
else
141+
gh pr create \
142+
--base release \
143+
--head main \
144+
--title "chore: release ${NEXT_VERSION}" \
145+
--body-file /tmp/pr-body.md \
146+
--label "release"
147+
echo "Created new release PR"
148+
fi

0 commit comments

Comments
 (0)