Skip to content

Commit 2535b75

Browse files
Merge branch 'main' into fix/header-nav-i18n-and-settings-icon
2 parents 0bbe754 + 5f30d25 commit 2535b75

File tree

92 files changed

+6453
-1134
lines changed

Some content is hidden

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

92 files changed

+6453
-1134
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#secure password, can use openssl rand -hex 32
22
NUXT_SESSION_PASSWORD=""
33

4-
#HMAC secret for image proxy URL signing, can use openssl rand -hex 32
4+
#HMAC secret for image-proxy and OG image URL signing, can use openssl rand -hex 32
55
NUXT_IMAGE_PROXY_SECRET=""

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: "\U0001F41E Bug report"
22
description: Create a report to help us improve npmx
3+
type: bug
4+
labels: ['pending triage']
35
body:
46
- type: markdown
57
attributes:

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: '🚀 Feature request'
22
description: Suggest a feature that will improve npmx
3+
type: feature
34
labels: ['pending triage']
45
body:
56
- type: markdown

.storybook/handlers.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,68 @@ export const pdsUsersHandler = http.get('/api/atproto/pds-users', () => {
9191
},
9292
])
9393
})
94+
95+
export const i18nStatusHandler = http.get('/lunaria/status.json', () => {
96+
return HttpResponse.json({
97+
generatedAt: '2026-01-22T10:07:07.000Z',
98+
sourceLocale: {
99+
lang: 'en',
100+
label: 'English',
101+
totalKeys: 500,
102+
},
103+
locales: [
104+
{
105+
lang: 'en-GB',
106+
label: 'English (UK)',
107+
dir: 'ltr',
108+
totalKeys: 500,
109+
completedKeys: 423,
110+
percentComplete: 84,
111+
missingKeys: [
112+
'settings.background_themes.label',
113+
'settings.enable_graph_pulse_loop',
114+
'settings.enable_graph_pulse_loop_description',
115+
'settings.data_source.algolia_description',
116+
'settings.data_source.npm_description',
117+
'i18n.contribute_hint',
118+
'i18n.copy_keys',
119+
],
120+
githubEditUrl: 'https://github.com/npmx-dev/npmx.dev/edit/main/i18n/locales/en-GB.json',
121+
githubHistoryUrl:
122+
'https://github.com/npmx-dev/npmx.dev/commits/main/i18n/locales/en-GB.json',
123+
},
124+
{
125+
lang: 'fr-FR',
126+
label: 'Français',
127+
dir: 'ltr',
128+
totalKeys: 500,
129+
completedKeys: 423,
130+
percentComplete: 84,
131+
missingKeys: [
132+
'settings.background_themes.label',
133+
'settings.enable_graph_pulse_loop',
134+
'settings.enable_graph_pulse_loop_description',
135+
'settings.data_source.algolia_description',
136+
'settings.data_source.npm_description',
137+
'i18n.contribute_hint',
138+
'i18n.copy_keys',
139+
],
140+
githubEditUrl: 'https://github.com/npmx-dev/npmx.dev/edit/main/i18n/locales/fr-FR.json',
141+
githubHistoryUrl:
142+
'https://github.com/npmx-dev/npmx.dev/commits/main/i18n/locales/fr-FR.json',
143+
},
144+
{
145+
lang: 'de-DE',
146+
label: 'Deutsch',
147+
dir: 'ltr',
148+
totalKeys: 500,
149+
completedKeys: 500,
150+
percentComplete: 100,
151+
missingKeys: [],
152+
githubEditUrl: 'https://github.com/npmx-dev/npmx.dev/edit/main/i18n/locales/de-DE.json',
153+
githubHistoryUrl:
154+
'https://github.com/npmx-dev/npmx.dev/commits/main/i18n/locales/de-DE.json',
155+
},
156+
],
157+
})
158+
})

.storybook/preview-head.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,19 @@
6161
background-color: var(--bg, oklch(0.171 0 0)) !important;
6262
}
6363
</style>
64+
<script>
65+
// related: https://github.com/npmx-dev/npmx.dev/blob/1431d24be555bca5e1ae6264434d49ca15173c43/test/nuxt/setup.ts#L12-L26
66+
// Stub Nuxt specific globals
67+
// @nuxtjs/color-mode's plugin.client.js reads window[globalName] at module
68+
// evaluation time — before any Storybook setup() callback runs — so the
69+
// global must exist in the HTML head, not in preview.ts.
70+
window.__NUXT_COLOR_MODE__ ??= {
71+
preference: 'system',
72+
value: 'dark',
73+
getColorScheme: function () {
74+
return 'dark'
75+
},
76+
addColorScheme: function () {},
77+
removeColorScheme: function () {},
78+
}
79+
</script>

.storybook/preview.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,8 @@ import npmxDark from './theme'
1010

1111
initialize()
1212

13-
// related: https://github.com/npmx-dev/npmx.dev/blob/1431d24be555bca5e1ae6264434d49ca15173c43/test/nuxt/setup.ts#L12-L26
14-
// Stub Nuxt specific globals
1513
// @ts-expect-error - dynamic global name
16-
globalThis['__NUXT_COLOR_MODE__'] ??= {
17-
preference: 'system',
18-
value: 'dark',
19-
getColorScheme: fn(() => 'dark'),
20-
addColorScheme: fn(),
21-
removeColorScheme: fn(),
22-
}
23-
// @ts-expect-error - dynamic global name
24-
globalThis.defineOgImageComponent = fn()
14+
globalThis.defineOgImage = fn()
2515

2616
// Subscribe to locale changes from storybook-i18n addon (once, outside decorator)
2717
let currentI18nInstance: any = null

app/app.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ if (import.meta.client) {
127127
useEventListener(document, 'click', handleModalLightDismiss)
128128
}
129129
}
130+
131+
// title and description will be inferred
132+
// this will be overridden by upstream pages that use different templates
133+
defineOgImage('Page.takumi', {}, { alt: 'npmx — a fast, modern browser for the npm registry' })
130134
</script>
131135

132136
<template>

app/components/AppFooter.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ const closeModal = () => modalRef.value?.close?.()
120120
<kbd class="kbd">f</kbd>
121121
<span>{{ $t('shortcuts.open_diff') }}</span>
122122
</li>
123+
<li class="flex gap-2 items-center">
124+
<kbd class="kbd">t</kbd>
125+
<span>{{ $t('shortcuts.open_timeline') }}</span>
126+
</li>
123127
<li class="flex gap-2 items-center">
124128
<kbd class="kbd">c</kbd>
125129
<span>{{ $t('shortcuts.compare_from_package') }}</span>

app/components/Chart/SplitSparkline.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const props = defineProps<{
3131
3232
const { locale } = useI18n()
3333
const colorMode = useColorMode()
34+
const numberFormatter = useNumberFormatter()
3435
const resolvedMode = shallowRef<'light' | 'dark'>('light')
3536
const rootEl = shallowRef<HTMLElement | null>(null)
3637
const palette = getPalette('')
@@ -153,6 +154,9 @@ const configs = computed(() => {
153154
fontSize: 24,
154155
bold: false,
155156
color: colors.value.fg,
157+
formatter: ({ value }) => {
158+
return numberFormatter.value.format(value)
159+
},
156160
datetimeFormatter: {
157161
enable: true,
158162
locale: locale.value,

app/components/OgBrand.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script setup lang="ts">
2+
const props = withDefaults(
3+
defineProps<{
4+
height?: number
5+
}>(),
6+
{
7+
height: 60,
8+
},
9+
)
10+
11+
const width = computed(() => Math.round(props.height * (602 / 170)))
12+
</script>
13+
14+
<template>
15+
<img
16+
src="/logo.svg"
17+
alt="npmx"
18+
:width="width"
19+
:height="height"
20+
:style="{ width: `${width}px`, height: `${height}px` }"
21+
/>
22+
</template>

0 commit comments

Comments
 (0)