Skip to content

Commit f10f375

Browse files
committed
Merge remote-tracking branch 'origin/main' into serhalp/cmdk-palette
2 parents 19f242f + e2a7b59 commit f10f375

File tree

22 files changed

+1160
-50
lines changed

22 files changed

+1160
-50
lines changed

.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config = {
99
'storybook-i18n',
1010
],
1111
framework: '@storybook-vue/nuxt',
12-
staticDirs: ['./.public'],
12+
staticDirs: ['./.public', { from: '../public', to: '/' }],
1313
features: {
1414
backgrounds: false,
1515
},

.storybook/preview-head.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,61 @@
11
<style>
2+
/* Load Geist fonts to match the production app (normally handled by @nuxt/fonts,
3+
which is disabled in Storybook at this time) */
4+
@font-face {
5+
font-family: 'Geist';
6+
font-weight: 400;
7+
font-style: normal;
8+
font-display: swap;
9+
src: url('/fonts/Geist-Regular.ttf') format('truetype');
10+
}
11+
@font-face {
12+
font-family: 'Geist';
13+
font-weight: 500;
14+
font-style: normal;
15+
font-display: swap;
16+
src: url('/fonts/Geist-Medium.ttf') format('truetype');
17+
}
18+
@font-face {
19+
font-family: 'Geist';
20+
font-weight: 600;
21+
font-style: normal;
22+
font-display: swap;
23+
src: url('/fonts/Geist-SemiBold.ttf') format('truetype');
24+
}
25+
@font-face {
26+
font-family: 'Geist';
27+
font-weight: 700;
28+
font-style: normal;
29+
font-display: swap;
30+
src: url('/fonts/Geist-Bold.ttf') format('truetype');
31+
}
32+
@font-face {
33+
font-family: 'Geist Mono';
34+
font-weight: 400;
35+
font-style: normal;
36+
font-display: swap;
37+
src: url('/fonts/GeistMono-Regular.ttf') format('truetype');
38+
}
39+
@font-face {
40+
font-family: 'Geist Mono';
41+
font-weight: 500;
42+
font-style: normal;
43+
font-display: swap;
44+
src: url('/fonts/GeistMono-Medium.ttf') format('truetype');
45+
}
46+
@font-face {
47+
font-family: 'Geist Mono';
48+
font-weight: 700;
49+
font-style: normal;
50+
font-display: swap;
51+
src: url('/fonts/GeistMono-Bold.ttf') format('truetype');
52+
}
53+
html {
54+
-webkit-font-smoothing: antialiased;
55+
-moz-osx-font-smoothing: grayscale;
56+
text-rendering: optimizeLegibility;
57+
}
58+
259
/* Override docs story canvas background to match npmx theme */
360
.docs-story {
461
background-color: var(--bg, oklch(0.171 0 0)) !important;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ npmx.dev supports npm permalinks &ndash; just replace `npmjs.com` with `npmx.dev
114114
| `npmjs.com/org/nuxt` | [`npmx.dev/org/nuxt`](https://npmx.dev/org/nuxt) |
115115

116116
> [!TIP]
117-
> Want automatic redirects? Try the [npmx-replace browser extension](https://github.com/tylersayshi/npmx-replace-extension) (Chrome only for now) or the separate [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for [Chrome](https://chromewebstore.google.com/detail/lbhjgfgpnlihfmobnohoipeljollhlnb) / [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/npmx-redirect/).
117+
> Want automatic redirects? Try the [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for [Chrome](https://chromewebstore.google.com/detail/lbhjgfgpnlihfmobnohoipeljollhlnb) / [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/npmx-redirect/).
118118
119119
#### Not yet supported
120120

app/composables/useRepoMeta.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ProviderId, RepoRef } from '#shared/utils/git-providers'
2-
import { parseRepoUrl, GITLAB_HOSTS } from '#shared/utils/git-providers'
2+
import { GIT_PROVIDER_API_ORIGINS, parseRepoUrl, GITLAB_HOSTS } from '#shared/utils/git-providers'
33

44
// TTL for git repo metadata (10 minutes - repo stats don't change frequently)
55
const REPO_META_TTL = 60 * 10
@@ -134,7 +134,7 @@ const githubAdapter: ProviderAdapter = {
134134
let res: UnghRepoResponse | null = null
135135
try {
136136
const { data } = await cachedFetch<UnghRepoResponse>(
137-
`https://ungh.cc/repos/${ref.owner}/${ref.repo}`,
137+
`${GIT_PROVIDER_API_ORIGINS.github}/repos/${ref.owner}/${ref.repo}`,
138138
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
139139
UNGH_REPO_META_TTL,
140140
)
@@ -256,7 +256,7 @@ const bitbucketAdapter: ProviderAdapter = {
256256
let res: BitbucketRepoResponse | null = null
257257
try {
258258
const { data } = await cachedFetch<BitbucketRepoResponse>(
259-
`https://api.bitbucket.org/2.0/repositories/${ref.owner}/${ref.repo}`,
259+
`${GIT_PROVIDER_API_ORIGINS.bitbucket}/2.0/repositories/${ref.owner}/${ref.repo}`,
260260
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
261261
REPO_META_TTL,
262262
)
@@ -314,7 +314,7 @@ const codebergAdapter: ProviderAdapter = {
314314
let res: GiteaRepoResponse | null = null
315315
try {
316316
const { data } = await cachedFetch<GiteaRepoResponse>(
317-
`https://codeberg.org/api/v1/repos/${ref.owner}/${ref.repo}`,
317+
`${GIT_PROVIDER_API_ORIGINS.codeberg}/api/v1/repos/${ref.owner}/${ref.repo}`,
318318
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
319319
REPO_META_TTL,
320320
)
@@ -372,7 +372,7 @@ const giteeAdapter: ProviderAdapter = {
372372
let res: GiteeRepoResponse | null = null
373373
try {
374374
const { data } = await cachedFetch<GiteeRepoResponse>(
375-
`https://gitee.com/api/v5/repos/${ref.owner}/${ref.repo}`,
375+
`${GIT_PROVIDER_API_ORIGINS.gitee}/api/v5/repos/${ref.owner}/${ref.repo}`,
376376
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
377377
REPO_META_TTL,
378378
)
@@ -625,7 +625,7 @@ const radicleAdapter: ProviderAdapter = {
625625
let res: RadicleProjectResponse | null = null
626626
try {
627627
const { data } = await cachedFetch<RadicleProjectResponse>(
628-
`https://seed.radicle.at/api/v1/projects/${ref.repo}`,
628+
`${GIT_PROVIDER_API_ORIGINS.radicle}/api/v1/projects/${ref.repo}`,
629629
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
630630
REPO_META_TTL,
631631
)

app/pages/accessibility.stories.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import Accessibility from './accessibility.vue'
2+
import type { Meta, StoryObj } from '@storybook-vue/nuxt'
3+
import AppHeader from '~/components/AppHeader.vue'
4+
import AppFooter from '~/components/AppFooter.vue'
5+
6+
const meta = {
7+
component: Accessibility,
8+
parameters: {
9+
layout: 'fullscreen',
10+
},
11+
decorators: [
12+
() => ({
13+
components: { AppHeader, AppFooter },
14+
template: `
15+
<div class="min-h-screen flex flex-col bg-bg text-fg">
16+
<AppHeader :show-logo="true" />
17+
<div id="main-content" class="flex-1 flex flex-col" tabindex="-1">
18+
<story />
19+
</div>
20+
<AppFooter />
21+
</div>
22+
`,
23+
}),
24+
],
25+
} satisfies Meta<typeof Accessibility>
26+
27+
export default meta
28+
type Story = StoryObj<typeof meta>
29+
30+
export const Default: Story = {}

docs/content/1.getting-started/2.quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ Replace `npmjs.com` with `npmx.dev` in any npm URL:
4444
| `npmjs.com/~sindresorhus` | `npmx.dev/~sindresorhus` |
4545

4646
::tip
47-
Install the [npmx-replace browser extension](https://github.com/tylersayshi/npmx-replace-extension) for automatic redirects from npmjs.com.
47+
Install the [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for automatic redirects from npmjs.com.
4848
::

docs/content/2.guide/3.url-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Replace `npmjs.com` with `npmx.dev` (or `xnpmjs.com`) in any npm URL:
2121
| `npmjs.com/org/nuxt` | [`npmx.dev/org/nuxt`](https://npmx.dev/org/nuxt) |
2222

2323
::tip
24-
Install the [npmx-replace browser extension](https://github.com/tylersayshi/npmx-replace-extension) for automatic redirects.
24+
Install the [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for automatic redirects from npmjs.com.
2525
::
2626

2727
## Use simpler URLs

0 commit comments

Comments
 (0)