Skip to content

Commit c1a896e

Browse files
authored
Merge branch 'npmx-dev:main' into main
2 parents 2a06e5a + 9e276c3 commit c1a896e

File tree

411 files changed

+73770
-8164
lines changed

Some content is hidden

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

411 files changed

+73770
-8164
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#secure password, can use openssl rand -hex 32
2+
NUXT_SESSION_PASSWORD=""

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/autofix.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
pull_request:
66
branches:
77
- main
8+
merge_group:
9+
branches:
10+
- main
811

912
permissions:
1013
contents: read
@@ -14,19 +17,29 @@ jobs:
1417
runs-on: ubuntu-latest
1518

1619
steps:
17-
- uses: actions/checkout@v6
18-
- run: corepack enable
19-
- uses: actions/setup-node@v6
20+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
21+
22+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2023
with:
2124
node-version: lts/*
22-
cache: 'pnpm'
25+
26+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
27+
name: Install pnpm
28+
with:
29+
cache: true
2330

2431
- name: 📦 Install dependencies
2532
run: pnpm install
2633

2734
- name: 📦 Install browsers
2835
run: pnpm playwright install
2936

37+
- name: 🌐 Compare translations
38+
run: pnpm i18n:check
39+
40+
- name: 🌍 Update lunaria data
41+
run: pnpm build:lunaria
42+
3043
- name: 🔠 Fix lint errors
3144
run: pnpm lint:fix
3245

@@ -36,7 +49,8 @@ jobs:
3649
- name: 🏃 Update component test snapshots
3750
run: pnpm test:nuxt -u
3851

39-
- name: 🖥️ Update browser test snapshots
40-
run: pnpm test:browser --update-snapshots
52+
# TODO: re-enable when we have snapshots in browser tests
53+
# - name: 🖥️ Update browser test snapshots
54+
# run: pnpm test:browser --update-snapshots
4155

4256
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

.github/workflows/ci.yml

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
push:
88
branches:
99
- main
10+
merge_group:
11+
branches:
12+
- main
13+
14+
# cancel in-progress runs on new commits to same PR (gitub.event.number)
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
17+
cancel-in-progress: true
1018

1119
permissions:
1220
contents: read
@@ -16,12 +24,16 @@ jobs:
1624
runs-on: ubuntu-latest
1725

1826
steps:
19-
- uses: actions/checkout@v6
20-
- run: corepack enable
21-
- uses: actions/setup-node@v6
27+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
29+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2230
with:
2331
node-version: lts/*
24-
cache: pnpm
32+
33+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
34+
name: Install pnpm
35+
with:
36+
cache: true
2537

2638
- name: 📦 Install dependencies
2739
run: pnpm install
@@ -33,12 +45,16 @@ jobs:
3345
runs-on: ubuntu-latest
3446

3547
steps:
36-
- uses: actions/checkout@v6
37-
- run: corepack enable
38-
- uses: actions/setup-node@v6
48+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
49+
50+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
3951
with:
4052
node-version: lts/*
41-
cache: pnpm
53+
54+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
55+
name: Install pnpm
56+
with:
57+
cache: true
4258

4359
- name: 📦 Install dependencies
4460
run: pnpm install
@@ -58,15 +74,19 @@ jobs:
5874
browser:
5975
runs-on: ubuntu-latest
6076
container:
61-
image: mcr.microsoft.com/playwright:v1.57.0-noble
77+
image: mcr.microsoft.com/playwright:v1.58.0-noble
6278

6379
steps:
64-
- uses: actions/checkout@v6
65-
- run: corepack enable
66-
- uses: actions/setup-node@v6
80+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
81+
82+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
6783
with:
6884
node-version: lts/*
69-
cache: pnpm
85+
86+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
87+
name: Install pnpm
88+
with:
89+
cache: true
7090

7191
- name: 📦 Install dependencies
7292
run: pnpm install
@@ -78,20 +98,45 @@ jobs:
7898
runs-on: ubuntu-latest
7999

80100
steps:
81-
- uses: actions/checkout@v6
82-
- run: corepack enable
83-
- uses: actions/setup-node@v6
101+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
102+
103+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
84104
with:
85105
node-version: lts/*
86-
cache: pnpm
106+
107+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
108+
name: Install pnpm
109+
with:
110+
cache: true
87111

88112
- name: 📦 Install dependencies
89113
run: pnpm install
90114

91115
- name: 🏗️ Build project
92116
run: pnpm build
93117

94-
- name: ♿ Accessibility audit (Lighthouse)
95-
run: pnpx @lhci/cli autorun
118+
- name: ♿ Accessibility audit (Lighthouse - dark & light mode)
119+
run: ./scripts/lighthouse-a11y.sh
96120
env:
97121
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
122+
123+
knip:
124+
runs-on: ubuntu-latest
125+
126+
steps:
127+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
128+
129+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
130+
with:
131+
node-version: lts/*
132+
133+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
134+
name: Install pnpm
135+
with:
136+
cache: true
137+
138+
- name: 📦 Install dependencies
139+
run: pnpm install
140+
141+
- name: 🔍 Check for unused code
142+
run: pnpm knip

.github/workflows/lunaria.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: lunaria
2+
3+
on:
4+
# Trigger the workflow every time a pull request is opened or synchronized at the target `main` branch
5+
pull_request_target:
6+
types: [opened, synchronize]
7+
8+
# Automatically cancel in-progress actions on the same branch
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
11+
cancel-in-progress: true
12+
13+
# Allow this job to clone the repository and comment on the pull request
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
18+
jobs:
19+
lunaria-overview:
20+
name: Generate Lunaria Overview
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
26+
with:
27+
# Necessary for Lunaria to work properly
28+
# Makes the action clone the entire git history
29+
fetch-depth: 0
30+
31+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
32+
with:
33+
node-version: lts/*
34+
35+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
36+
name: Install pnpm
37+
with:
38+
cache: true
39+
40+
- name: 📦 Install dependencies
41+
run: pnpm install
42+
43+
- name: Generate Lunaria Overview
44+
uses: lunariajs/action@v1-prerelease

.github/workflows/provenance.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: provenance
22

33
on:
44
push:
@@ -7,13 +7,16 @@ on:
77
pull_request:
88
branches:
99
- main
10+
merge_group:
11+
branches:
12+
- main
1013
permissions:
1114
contents: read
1215
jobs:
1316
check-provenance:
1417
runs-on: ubuntu-latest
1518
steps:
16-
- uses: actions/checkout@v6
19+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1720
with:
1821
fetch-depth: 0
1922
- name: Check provenance downgrades
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: chore
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions: {}
11+
12+
jobs:
13+
semantic-pr:
14+
permissions:
15+
contents: read
16+
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
17+
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
18+
if: github.repository == 'npmx-dev/npmx.dev'
19+
runs-on: ubuntu-latest
20+
name: semantic-pr
21+
steps:
22+
- name: Validate PR title
23+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
24+
with:
25+
scopes: |
26+
a11y
27+
deps
28+
docs
29+
i18n
30+
ui
31+
subjectPattern: ^(?![A-Z]).+$
32+
subjectPatternError: |
33+
The subject "{subject}" found in the pull request title "{title}"
34+
didn't match the configured pattern. Please ensure that the subject
35+
doesn't start with an uppercase character.
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

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

3737
# Lighthouse
3838
.lighthouseci
39+
40+
# generated files
41+
shared/types/lexicons

.lighthouserc.cjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const fs = require('fs')
2+
3+
// Auto-detect Chrome executable path
4+
function findChrome() {
5+
const paths = [
6+
// Linux
7+
'/usr/bin/google-chrome-stable',
8+
'/usr/bin/google-chrome',
9+
'/usr/bin/chromium-browser',
10+
// macOS
11+
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
12+
// Windows
13+
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
14+
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
15+
]
16+
17+
for (const p of paths) {
18+
if (fs.existsSync(p)) return p
19+
}
20+
21+
return undefined
22+
}
23+
24+
module.exports = {
25+
ci: {
26+
collect: {
27+
startServerCommand: 'pnpm preview',
28+
startServerReadyPattern: 'Listening',
29+
url: [
30+
'http://localhost:3000/',
31+
'http://localhost:3000/search?q=nuxt',
32+
'http://localhost:3000/package/nuxt',
33+
],
34+
numberOfRuns: 1,
35+
chromePath: findChrome(),
36+
puppeteerScript: './lighthouse-setup.cjs',
37+
settings: {
38+
onlyCategories: ['accessibility'],
39+
skipAudits: ['valid-source-maps'],
40+
},
41+
},
42+
assert: {
43+
assertions: {
44+
'categories:accessibility': ['error', { minScore: 1 }],
45+
},
46+
},
47+
upload: {
48+
target: 'temporary-public-storage',
49+
},
50+
},
51+
}

.lighthouserc.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)