Skip to content

Commit 4ed2818

Browse files
authored
Merge branch 'main' into fix/docs-page-improvements
2 parents b821969 + 2af4011 commit 4ed2818

File tree

13 files changed

+599
-90
lines changed

13 files changed

+599
-90
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ jobs:
111111
run: pnpm vp test --project nuxt --coverage --reporter=default --reporter=junit --outputFile=test-report.junit.xml
112112

113113
- name: ⬆︎ Upload coverage reports to Codecov
114-
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5
114+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
115115
with:
116116
report_type: test_results
117117
env:
118118
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
119119

120120
- name: ⬆︎ Upload coverage reports to Codecov
121-
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5
121+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
122122
env:
123123
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
124124

CONTRIBUTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pnpm npmx-connector # Start the real connector (requires npm login)
119119
pnpm mock-connector # Start the mock connector (no npm login needed)
120120

121121
# Code Quality
122-
pnpm lint # Run linter (oxlint + oxfmt)
122+
pnpm vp run lint # Run linter (oxlint + oxfmt)
123123
pnpm lint:fix # Auto-fix lint issues
124124
pnpm test:types # TypeScript type checking
125125

@@ -460,13 +460,13 @@ npmx.dev uses [@nuxtjs/i18n](https://i18n.nuxtjs.org/) for internationalization.
460460

461461
The following scripts help manage translation files. `en.json` is the reference locale.
462462

463-
| Command | Description |
464-
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
465-
| `pnpm i18n:check [locale]` | Compares `en.json` with other locale files. Shows missing and extra keys. Optionally filter output by locale (e.g. `pnpm i18n:check ja-JP`). |
466-
| `pnpm i18n:check:fix [locale]` | Same as check, but adds missing keys to other locales with English placeholders. |
467-
| `pnpm i18n:report` | Audits translation keys against code usage in `.vue` and `.ts` files. Reports missing keys (used in code but not in locale), unused keys (in locale but not in code), and dynamic keys. |
468-
| `pnpm i18n:report:fix` | Removes unused keys from `en.json` and all other locale files. |
469-
| `pnpm i18n:schema` | Generates a JSON Schema from `en.json` at `i18n/schema.json`. Locale files reference this schema for IDE validation and autocompletion. |
463+
| Command | Description |
464+
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
465+
| `pnpm i18n:check:fix [locale]` | Compares `en.json` with other locale files and adds missing keys with English placeholders. Optionally filter output by locale (e.g. `pnpm i18n:check:fix ja-JP`). |
466+
| `pnpm i18n:report:fix` | Removes unused keys from `en.json` and all other locale files. |
467+
| `pnpm vp run i18n:check [locale]` | Same as check:fix, but only show missing and extra keys. |
468+
| `pnpm vp run i18n:report` | Audits translation keys against code usage in `.vue` and `.ts` files. Reports missing keys (used in code but not in locale), unused keys (in locale but not in code), and dynamic keys. |
469+
| `pnpm vp run i18n:schema` | Generates a JSON Schema from `en.json` at `i18n/schema.json`. Locale files reference this schema for IDE validation and autocompletion. |
470470

471471
### Adding a new locale
472472

@@ -502,7 +502,7 @@ Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essential
502502
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/
503503
If you see any outdated translations in your language, feel free to update the keys to match the English version.
504504

505-
Use `pnpm i18n:check` and `pnpm i18n:check:fix` to verify and fix your locale (see [i18n commands](#i18n-commands) above for details).
505+
Use `pnpm i18n:check:fix` to fix your locale (see [i18n commands](#i18n-commands) above for details).
506506

507507
#### Country variants (advanced)
508508

@@ -590,7 +590,7 @@ See how `es`, `es-ES`, and `es-419` are configured in [config/i18n.ts](./config/
590590
- Use `common.*` for shared strings (loading, retry, close, etc.)
591591
- Use component-specific prefixes: `package.card.*`, `settings.*`, `nav.*`
592592
- Do not use dashes (`-`) in translation keys; always use underscore (`_`): e.g., `privacy_policy` instead of `privacy-policy`
593-
- **Always use static string literals as translation keys.** Our i18n scripts (`pnpm i18n:report`) rely on static analysis to detect unused and missing keys. Dynamic keys cannot be analyzed and will be flagged as errors.
593+
- **Always use static string literals as translation keys.** Our i18n scripts (`pnpm i18n:report:fix`) rely on static analysis to detect unused and missing keys. Dynamic keys cannot be analyzed and will be flagged as errors.
594594

595595
**Bad:**
596596

app/components/LandingLogo.vue

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
class?: string
4+
}>()
5+
6+
const { env } = useAppConfig().buildInfo
7+
8+
onPrehydrate(el => {
9+
const isKawaii = new URLSearchParams(window.location.search).has('kawaii')
10+
const date = new Intl.DateTimeFormat('en-US', {
11+
timeZone: 'America/Los_Angeles',
12+
month: '2-digit',
13+
day: '2-digit',
14+
}).format(new Date())
15+
const isTKawaii = date === '03/31'
16+
17+
if (!isKawaii && !isTKawaii) return
18+
19+
const normalLogo = el.querySelector<HTMLElement>('#npmx-index-h1-logo-normal')
20+
const kawaiiLogo = el.querySelector<HTMLElement>('#npmx-index-h1-logo-kawaii')
21+
const tkawaiiLogo = el.querySelector<HTMLElement>('#npmx-index-h1-logo-tkawaii')
22+
const logoEnv = el.querySelector<HTMLElement>('#npmx-index-h1-logo-env')
23+
const logoTagline = el.querySelector<HTMLElement>('#npmx-index-tagline')
24+
25+
if (!normalLogo || !kawaiiLogo || !tkawaiiLogo || !logoEnv || !logoTagline) return
26+
27+
if (isTKawaii) {
28+
tkawaiiLogo.style.display = 'block'
29+
} else {
30+
kawaiiLogo.style.display = 'block'
31+
}
32+
normalLogo.style.display = 'none'
33+
logoEnv.style.display = 'none'
34+
logoTagline.style.display = 'none'
35+
})
36+
</script>
37+
38+
<template>
39+
<div class="flex flex-col items-center justify-center">
40+
<h1
41+
dir="ltr"
42+
class="relative flex items-center justify-center gap-2 header-logo font-mono text-5xl sm:text-7xl md:text-8xl font-medium tracking-tight mb-6 motion-safe:animate-fade-in motion-safe:animate-fill-both"
43+
>
44+
<img
45+
id="npmx-index-h1-logo-kawaii"
46+
width="400"
47+
class="hidden mb-8 motion-safe:animate-fade-in motion-safe:animate-scale-in motion-safe:hover:scale-105 motion-safe:transition w-80 sm:w-100"
48+
src="/extra/npmx-cute.svg"
49+
:alt="$t('alt_logo_kawaii')"
50+
:class="class"
51+
/>
52+
<img
53+
id="npmx-index-h1-logo-tkawaii"
54+
width="400"
55+
class="hidden mb-8 motion-safe:animate-fade-in motion-safe:animate-scale-in motion-safe:hover:scale-105 motion-safe:transition w-80 sm:w-100"
56+
src="/extra/npmx-cute-transgender.svg"
57+
:alt="$t('alt_logo_kawaii')"
58+
:class="class"
59+
/>
60+
<AppLogo id="npmx-index-h1-logo-normal" :class="class" />
61+
<span
62+
id="npmx-index-h1-logo-env"
63+
aria-hidden="true"
64+
class="text-sm sm:text-base md:text-lg transform-origin-br font-mono tracking-widest text-accent absolute -bottom-4 -inset-ie-1.5"
65+
>
66+
{{ env === 'release' ? 'alpha' : env }}
67+
</span>
68+
</h1>
69+
<p
70+
id="npmx-index-tagline"
71+
class="text-fg-muted text-lg sm:text-xl max-w-xl mb-12 lg:mb-14 motion-safe:animate-slide-up motion-safe:animate-fill-both delay-100"
72+
>
73+
{{ $t('tagline') }}
74+
</p>
75+
</div>
76+
</template>

app/pages/index.vue

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ async function search() {
88
startSearch()
99
}
1010
11-
const { env } = useAppConfig().buildInfo
12-
1311
useSeoMeta({
1412
title: () => $t('seo.home.title'),
1513
ogTitle: () => $t('seo.home.title'),
@@ -32,25 +30,7 @@ defineOgImageComponent('Default', {
3230
<header
3331
class="flex-1 flex flex-col items-center justify-center text-center pt-20 pb-4 md:pb-8 lg:pb-20"
3432
>
35-
<h1
36-
dir="ltr"
37-
class="relative flex items-center justify-center gap-2 header-logo font-mono text-5xl sm:text-7xl md:text-8xl font-medium tracking-tight mb-6 motion-safe:animate-fade-in motion-safe:animate-fill-both"
38-
>
39-
<AppLogo class="w-42 h-auto sm:w-58 md:w-70" />
40-
<span
41-
aria-hidden="true"
42-
class="text-sm sm:text-base md:text-lg transform-origin-br font-mono tracking-widest text-accent absolute -bottom-4 -inset-ie-1.5"
43-
>
44-
{{ env === 'release' ? 'alpha' : env }}
45-
</span>
46-
</h1>
47-
48-
<p
49-
class="text-fg-muted text-lg sm:text-xl max-w-xl mb-12 lg:mb-14 motion-safe:animate-slide-up motion-safe:animate-fill-both"
50-
style="animation-delay: 0.1s"
51-
>
52-
{{ $t('tagline') }}
53-
</p>
33+
<LandingLogo class="w-42 h-auto sm:w-58 md:w-70" />
5434
<search
5535
class="w-full max-w-2xl motion-safe:animate-slide-up motion-safe:animate-fill-both"
5636
style="animation-delay: 0.2s"

i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,5 +1523,6 @@
15231523
"message": "Accessibility matters to us, and we would love you to follow us in this vision. When using mentioned media, ensure there is enough contrast against the background, and don't go smaller than 24px. If you need any other resources or additional information about the project, feel free to reach us at {link}.",
15241524
"discord_link_text": "chat.npmx.dev"
15251525
}
1526-
}
1526+
},
1527+
"alt_logo_kawaii": "A cute, rounded, and colorful version of the npmx logo."
15271528
}

0 commit comments

Comments
 (0)