Skip to content

Commit ef4a6d6

Browse files
committed
Merge branch 'main' into click-relative
2 parents f9f1e10 + 3cf7fef commit ef4a6d6

325 files changed

Lines changed: 58202 additions & 3156 deletions

File tree

Some content is hidden

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

.github/workflows/autofix.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ permissions:
1414

1515
jobs:
1616
code:
17-
runs-on: ubuntu-latest
17+
name: 🤖 Autofix code
18+
runs-on: ubuntu-24.04-arm
1819

1920
steps:
2021
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -23,14 +24,17 @@ jobs:
2324
with:
2425
node-version: lts/*
2526

26-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
27-
name: Install pnpm
27+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
28+
name: 🟧 Install pnpm
2829
with:
2930
cache: true
3031

3132
- name: 📦 Install dependencies
3233
run: pnpm install
3334

35+
- name: 🎨 Check for non-RTL CSS classes
36+
run: pnpm rtl:check
37+
3438
- name: 🌐 Compare translations
3539
run: pnpm i18n:check
3640

@@ -40,4 +44,4 @@ jobs:
4044
- name: 🔠 Fix lint errors
4145
run: pnpm lint:fix
4246

43-
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
47+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # 635ffb0c9798bd160680f18fd73371e355b85f27

.github/workflows/ci.yml

Lines changed: 116 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ permissions:
2121

2222
jobs:
2323
lint:
24-
runs-on: ubuntu-latest
24+
name: 🔠 Lint project
25+
runs-on: ubuntu-24.04-arm
2526

2627
steps:
2728
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -30,15 +31,70 @@ jobs:
3031
with:
3132
node-version: lts/*
3233

33-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
34-
name: Install pnpm
35-
# pnpm cache skipped deliberately as the project is not actually installed here
34+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
35+
name: 🟧 Install pnpm
36+
with:
37+
cache: true
38+
39+
- name: 📦 Install dependencies (root only, no scripts)
40+
run: pnpm install --filter . --ignore-scripts
3641

3742
- name: 🔠 Lint project
38-
run: node scripts/lint.ts
43+
run: pnpm lint
44+
45+
types:
46+
name: 💪 Type check
47+
runs-on: ubuntu-24.04-arm
48+
49+
steps:
50+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
51+
52+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
53+
with:
54+
node-version: lts/*
55+
56+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
57+
name: 🟧 Install pnpm
58+
with:
59+
cache: true
60+
61+
- name: 📦 Install dependencies
62+
run: pnpm install
63+
64+
- name: 💪 Type check
65+
run: pnpm test:types
66+
67+
unit:
68+
name: 🧪 Unit tests
69+
runs-on: ubuntu-24.04-arm
70+
71+
steps:
72+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
73+
74+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
75+
with:
76+
node-version: lts/*
77+
78+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
79+
name: 🟧 Install pnpm
80+
with:
81+
cache: true
82+
83+
- name: 📦 Install dependencies
84+
run: pnpm install
85+
86+
- name: 🧪 Unit tests
87+
run: pnpm test:unit run --coverage --reporter=junit --outputFile=test-report.junit.xml
88+
89+
- name: ⬆︎ Upload test results to Codecov
90+
if: ${{ !cancelled() }}
91+
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
92+
with:
93+
token: ${{ secrets.CODECOV_TOKEN }}
3994

4095
test:
41-
runs-on: ubuntu-latest
96+
name: 🧪 Component tests
97+
runs-on: ubuntu-24.04-arm
4298

4399
steps:
44100
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -47,8 +103,8 @@ jobs:
47103
with:
48104
node-version: lts/*
49105

50-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
51-
name: Install pnpm
106+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
107+
name: 🟧 Install pnpm
52108
with:
53109
cache: true
54110

@@ -58,17 +114,23 @@ jobs:
58114
- name: 🌐 Install browser
59115
run: pnpm playwright install chromium-headless-shell
60116

61-
- name: 💪 Type check
62-
run: pnpm test:types
117+
- name: 🧪 Component tests
118+
run: pnpm test:nuxt run --coverage --reporter=junit --outputFile=test-report.junit.xml
63119

64-
- name: 🧪 Unit and component tests
65-
run: pnpm vite test run --coverage
120+
- name: ⬆︎ Upload test results to Codecov
121+
if: ${{ !cancelled() }}
122+
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
123+
with:
124+
token: ${{ secrets.CODECOV_TOKEN }}
66125

67-
- name: Upload coverage reports to Codecov
126+
- name: ⬆︎ Upload coverage reports to Codecov
68127
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
128+
env:
129+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
69130

70131
browser:
71-
runs-on: ubuntu-latest
132+
name: 🖥️ Browser tests
133+
runs-on: ubuntu-24.04-arm
72134
container:
73135
image: mcr.microsoft.com/playwright:v1.58.0-noble
74136

@@ -79,22 +141,25 @@ jobs:
79141
with:
80142
node-version: lts/*
81143

82-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
83-
name: Install pnpm
144+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
145+
name: 🟧 Install pnpm
84146
with:
85147
cache: true
86148

87149
- name: 📦 Install dependencies
88150
run: pnpm install
89151

90152
- name: 🏗️ Build project
91-
run: pnpm build:playwright
153+
run: pnpm build:test
154+
env:
155+
VALIDATE_HTML: true
92156

93157
- name: 🖥️ Test project (browser)
94158
run: pnpm test:browser:prebuilt
95159

96160
a11y:
97-
runs-on: ubuntu-latest
161+
name: ♿ Accessibility audit
162+
runs-on: ubuntu-latest # See https://github.com/GoogleChrome/lighthouse/discussions/16834
98163
strategy:
99164
matrix:
100165
mode: [dark, light]
@@ -106,16 +171,16 @@ jobs:
106171
with:
107172
node-version: lts/*
108173

109-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
110-
name: Install pnpm
174+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
175+
name: 🟧 Install pnpm
111176
with:
112177
cache: true
113178

114179
- name: 📦 Install dependencies
115180
run: pnpm install
116181

117182
- name: 🏗️ Build project
118-
run: pnpm build
183+
run: pnpm build:test
119184

120185
- name: ♿ Accessibility audit (Lighthouse - ${{ matrix.mode }} mode)
121186
run: ./scripts/lighthouse-a11y.sh
@@ -124,7 +189,8 @@ jobs:
124189
LIGHTHOUSE_COLOR_MODE: ${{ matrix.mode }}
125190

126191
knip:
127-
runs-on: ubuntu-latest
192+
name: 🧹 Unused code check
193+
runs-on: ubuntu-24.04-arm
128194

129195
steps:
130196
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -133,13 +199,38 @@ jobs:
133199
with:
134200
node-version: lts/*
135201

136-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
137-
name: Install pnpm
202+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
203+
name: 🟧 Install pnpm
138204
with:
139205
cache: true
140206

141207
- name: 📦 Install dependencies
142208
run: pnpm install
143209

144-
- name: 🔍 Check for unused code
210+
- name: 🧹 Check for unused code
145211
run: pnpm knip
212+
213+
- name: 🧹 Check for unused production code
214+
run: pnpm knip --production
215+
216+
i18n:
217+
name: 🌐 i18n validation
218+
runs-on: ubuntu-24.04-arm
219+
220+
steps:
221+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
222+
223+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
224+
with:
225+
node-version: lts/*
226+
227+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
228+
name: 🟧 Install pnpm
229+
with:
230+
cache: true
231+
232+
- name: 📦 Install dependencies (root only, no scripts)
233+
run: pnpm install --filter . --ignore-scripts
234+
235+
- name: 🌐 Check for missing or dynamic i18n keys
236+
run: pnpm i18n:report

.github/workflows/lunaria.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ permissions:
1717

1818
jobs:
1919
lunaria-overview:
20-
name: Generate Lunaria Overview
21-
runs-on: ubuntu-latest
20+
name: 🌝 Generate Lunaria Overview
21+
runs-on: ubuntu-24.04-arm
2222

2323
steps:
2424
- name: Checkout
@@ -32,13 +32,13 @@ jobs:
3232
with:
3333
node-version: lts/*
3434

35-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
36-
name: Install pnpm
35+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
36+
name: 🟧 Install pnpm
3737
with:
3838
cache: true
3939

4040
- name: 📦 Install dependencies
4141
run: pnpm install
4242

4343
- name: Generate Lunaria Overview
44-
uses: lunariajs/action@v1-prerelease
44+
uses: lunariajs/action@4911ad0736d1e3b20af4cb70f5079aea2327ed8e # v1-prerelease

.github/workflows/provenance.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ permissions:
2020

2121
jobs:
2222
check-provenance:
23+
name: 🔒 Check provenance downgrades
2324
runs-on: ubuntu-slim
2425
steps:
2526
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

.github/workflows/semantic-pull-requests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
1818
if: github.repository == 'npmx-dev/npmx.dev'
1919
runs-on: ubuntu-slim
20-
name: semantic-pr
20+
name: 🏷️ Validate PR title
2121
steps:
2222
- name: Validate PR title
2323
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
@@ -26,6 +26,7 @@ jobs:
2626
a11y
2727
deps
2828
docs
29+
cli
2930
i18n
3031
ui
3132
subjectPattern: ^(?![A-Z]).+$

.github/workflows/welcome.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: welcome
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
8+
permissions: {}
9+
10+
jobs:
11+
welcome:
12+
permissions:
13+
pull-requests: write # to comment on PRs
14+
if: github.repository == 'npmx-dev/npmx.dev' && github.event.pull_request.merged == true
15+
runs-on: ubuntu-slim
16+
name: 🎉 Welcome new contributor
17+
steps:
18+
- name: 🎉 Welcome new contributor
19+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
20+
with:
21+
script: |
22+
const pr = context.payload.pull_request;
23+
const author = pr.user.login;
24+
25+
// Check if this is the author's first merged PR
26+
const { data: prs } = await github.rest.search.issuesAndPullRequests({
27+
q: `repo:${context.repo.owner}/${context.repo.repo} type:pr is:merged author:${author}`,
28+
});
29+
30+
// If the only merged PR is this one, it's their first contribution
31+
if (prs.total_count !== 1) {
32+
console.log(`@${author} already has ${prs.total_count} merged PRs — skipping welcome comment.`);
33+
return;
34+
}
35+
36+
const emojis = ['🎉', '🥳', '🎊', '🚀', '⭐', '💫', '✨', '💪', '👏', '🙌', '🤩', '💥'];
37+
const emoji = emojis[Math.floor(Math.random() * emojis.length)];
38+
39+
const body = [
40+
`Thanks for your first contribution, @${author}! ${emoji}`,
41+
'',
42+
`We'd love to welcome you to the npmx community. Come and say hi on [Discord](https://chat.npmx.dev)! And once you've joined, visit [npmx.wamellow.com](https://npmx.wamellow.com/) to claim the **contributor** role.`,
43+
].join('\n');
44+
45+
await github.rest.issues.createComment({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
issue_number: pr.number,
49+
body,
50+
});
51+
52+
console.log(`Welcomed new contributor @${author} on PR #${pr.number}`);

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ test-results/
3939

4040
# generated files
4141
shared/types/lexicons
42+
43+
# output
44+
.vercel

0 commit comments

Comments
 (0)