Skip to content

Commit cac819c

Browse files
committed
Merge branch 'feat/atproto-blog-fe' of github.com:npmx-dev/npmx.dev into feat/blogs-og-image
2 parents 4018800 + 05b887f commit cac819c

229 files changed

Lines changed: 17516 additions & 3376 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/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,8 @@ jobs:
235235

236236
- name: 🌐 Check for missing or dynamic i18n keys
237237
run: pnpm i18n:report
238+
239+
- name: 🌐 Check i18n schema is up to date
240+
run: |
241+
pnpm i18n:schema
242+
git diff --exit-code i18n/schema.json
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: mirror
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
mirror:
15+
name: 🕸️ Mirror to Tangled
16+
runs-on: ubuntu-24.04-arm
17+
18+
steps:
19+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
with:
21+
fetch-depth: 0
22+
23+
- name: 🔑 Configure SSH
24+
env:
25+
TANGLED_SSH_KEY: ${{ secrets.TANGLED_SSH_KEY }}
26+
run: |
27+
mkdir -p ~/.ssh
28+
echo "$TANGLED_SSH_KEY" > ~/.ssh/id_ed25519
29+
chmod 600 ~/.ssh/id_ed25519
30+
ssh-keyscan -t ed25519 tangled.org >> ~/.ssh/known_hosts 2>/dev/null
31+
32+
- name: ⬆︎ Push to Tangled
33+
run: |
34+
git remote add tangled git@tangled.org:npmx.dev/npmx.dev
35+
git push tangled main --force
36+
git push tangled --tags --force

.lighthouserc.cjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@ module.exports = {
3535
chromePath: findChrome(),
3636
puppeteerScript: './lighthouse-setup.cjs',
3737
settings: {
38-
onlyCategories: ['accessibility'],
38+
onlyCategories: process.env.LH_PERF ? ['performance'] : ['accessibility'],
3939
skipAudits: ['valid-source-maps'],
4040
},
4141
},
4242
assert: {
43-
assertions: {
44-
'categories:accessibility': ['error', { minScore: 1 }],
45-
},
43+
assertions: process.env.LH_PERF
44+
? {
45+
'cumulative-layout-shift': ['error', { maxNumericValue: 0 }],
46+
}
47+
: {
48+
'categories:accessibility': ['error', { minScore: 1 }],
49+
},
4650
},
4751
upload: {
4852
target: 'temporary-public-storage',

CONTRIBUTING.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ This focus helps guide our project decisions as a community and what we choose t
5454
- [Unit tests](#unit-tests)
5555
- [Component accessibility tests](#component-accessibility-tests)
5656
- [Lighthouse accessibility tests](#lighthouse-accessibility-tests)
57+
- [Lighthouse performance tests](#lighthouse-performance-tests)
5758
- [End to end tests](#end-to-end-tests)
5859
- [Test fixtures (mocking external APIs)](#test-fixtures-mocking-external-apis)
5960
- [Submitting changes](#submitting-changes)
@@ -114,6 +115,7 @@ pnpm test:unit # Unit tests only
114115
pnpm test:nuxt # Nuxt component tests
115116
pnpm test:browser # Playwright E2E tests
116117
pnpm test:a11y # Lighthouse accessibility audits
118+
pnpm test:perf # Lighthouse performance audits (CLS)
117119
```
118120

119121
### Project structure
@@ -641,18 +643,38 @@ pnpm test:a11y:prebuilt
641643

642644
# Or run a single color mode manually
643645
pnpm build:test
644-
LIGHTHOUSE_COLOR_MODE=dark ./scripts/lighthouse-a11y.sh
646+
LIGHTHOUSE_COLOR_MODE=dark ./scripts/lighthouse.sh
645647
```
646648

647649
This requires Chrome or Chromium to be installed. The script will auto-detect common installation paths. Results are printed to the terminal and saved in `.lighthouseci/`.
648650

649651
#### Configuration
650652

651-
| File | Purpose |
652-
| ---------------------------- | --------------------------------------------------------- |
653-
| `.lighthouserc.cjs` | Lighthouse CI config (URLs, assertions, Chrome path) |
654-
| `lighthouse-setup.cjs` | Puppeteer script for color mode + client-side API mocking |
655-
| `scripts/lighthouse-a11y.sh` | Shell wrapper that runs the audit for a given color mode |
653+
| File | Purpose |
654+
| ----------------------- | --------------------------------------------------------- |
655+
| `.lighthouserc.cjs` | Lighthouse CI config (URLs, assertions, Chrome path) |
656+
| `lighthouse-setup.cjs` | Puppeteer script for color mode + client-side API mocking |
657+
| `scripts/lighthouse.sh` | Shell wrapper that runs the audit for a given color mode |
658+
659+
### Lighthouse performance tests
660+
661+
The project also runs Lighthouse performance audits to enforce zero Cumulative Layout Shift (CLS). These run separately from the accessibility audits and test the same set of URLs.
662+
663+
#### How it works
664+
665+
The same `.lighthouserc.cjs` config is shared between accessibility and performance audits. When the `LH_PERF` environment variable is set, the config switches from the `accessibility` category to the `performance` category and asserts that CLS is exactly 0.
666+
667+
#### Running locally
668+
669+
```bash
670+
# Build + run performance audit
671+
pnpm test:perf
672+
673+
# Or against an existing test build
674+
pnpm test:perf:prebuilt
675+
```
676+
677+
Unlike the accessibility audits, performance audits do not run in separate light/dark modes.
656678

657679
### End to end tests
658680

@@ -767,8 +789,10 @@ Format: `type(scope): description`
767789
- `fix(i18n): update French translations`
768790
- `chore(deps): update vite to v6`
769791

792+
Where front end changes are made, please include before and after screenshots in your pull request description.
793+
770794
> [!NOTE]
771-
> The subject must start with a lowercase letter. Individual commit messages within your PR don't need to follow this format since they'll be squashed.
795+
> Use lowercase letters in your pull request title. Individual commit messages within your PR don't need to follow this format since they'll be squashed.
772796
773797
### PR descriptions
774798

app/assets/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,11 @@ html:has(dialog:modal) {
339339
overflow: hidden;
340340
scrollbar-gutter: stable;
341341
}
342+
343+
/* Blog post Markdown wrapper styles */
344+
.blog-post img {
345+
display: block;
346+
max-width: 100%;
347+
height: auto;
348+
border-radius: 0.5rem; /* matches rounded-lg */
349+
}

app/components/AppFooter.vue

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const showModal = () => modalRef.value?.showModal?.()
1414
>
1515
<div>
1616
<p class="font-mono text-balance m-0 hidden sm:block">{{ $t('tagline') }}</p>
17-
<BuildEnvironment v-if="!isHome" footer />
1817
</div>
1918
<!-- Desktop: Show all links. Mobile: Links are in MobileMenu -->
2019
<div class="hidden sm:flex items-center gap-6 min-h-11 text-xs">
@@ -27,22 +26,9 @@ const showModal = () => modalRef.value?.showModal?.()
2726
<LinkBase :to="{ name: 'privacy' }">
2827
{{ $t('privacy_policy.title') }}
2928
</LinkBase>
30-
<LinkBase to="https://docs.npmx.dev">
31-
{{ $t('footer.docs') }}
32-
</LinkBase>
33-
<LinkBase to="https://repo.npmx.dev">
34-
{{ $t('footer.source') }}
35-
</LinkBase>
36-
<LinkBase to="https://social.npmx.dev">
37-
{{ $t('footer.social') }}
38-
</LinkBase>
39-
<LinkBase to="https://chat.npmx.dev">
40-
{{ $t('footer.chat') }}
41-
</LinkBase>
42-
4329
<button
4430
type="button"
45-
class="group inline-flex gap-x-1 items-center justify-center underline-offset-[0.2rem] underline decoration-1 decoration-fg/30 font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200"
31+
class="cursor-pointer group inline-flex gap-x-1 items-center justify-center underline-offset-[0.2rem] underline decoration-1 decoration-fg/30 font-mono text-fg hover:(decoration-accent text-accent) focus-visible:(decoration-accent text-accent) transition-colors duration-200"
4632
@click.prevent="showModal"
4733
aria-haspopup="dialog"
4834
>
@@ -106,8 +92,21 @@ const showModal = () => modalRef.value?.showModal?.()
10692
</li>
10793
</ul>
10894
</Modal>
95+
<LinkBase to="https://docs.npmx.dev">
96+
{{ $t('footer.docs') }}
97+
</LinkBase>
98+
<LinkBase to="https://repo.npmx.dev">
99+
{{ $t('footer.source') }}
100+
</LinkBase>
101+
<LinkBase to="https://social.npmx.dev">
102+
{{ $t('footer.social') }}
103+
</LinkBase>
104+
<LinkBase to="https://chat.npmx.dev">
105+
{{ $t('footer.chat') }}
106+
</LinkBase>
109107
</div>
110108
</div>
109+
<BuildEnvironment v-if="!isHome" footer />
111110
<p class="text-xs text-fg-muted text-center sm:text-start m-0">
112111
<span class="sm:hidden">{{ $t('non_affiliation_disclaimer') }}</span>
113112
<span class="hidden sm:inline">{{ $t('trademark_disclaimer') }}</span>

0 commit comments

Comments
 (0)