Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config = {
'storybook-i18n',
],
framework: '@storybook-vue/nuxt',
staticDirs: ['./.public'],
staticDirs: ['./.public', { from: '../public', to: '/' }],
features: {
backgrounds: false,
},
Expand Down
57 changes: 57 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
<style>
/* Load Geist fonts to match the production app (normally handled by @nuxt/fonts,
which is disabled in Storybook at this time) */
@font-face {
font-family: 'Geist';
font-weight: 400;
font-style: normal;
font-display: swap;
src: url('/fonts/Geist-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Geist';
font-weight: 500;
font-style: normal;
font-display: swap;
src: url('/fonts/Geist-Medium.ttf') format('truetype');
}
@font-face {
font-family: 'Geist';
font-weight: 600;
font-style: normal;
font-display: swap;
src: url('/fonts/Geist-SemiBold.ttf') format('truetype');
}
@font-face {
font-family: 'Geist';
font-weight: 700;
font-style: normal;
font-display: swap;
src: url('/fonts/Geist-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Geist Mono';
font-weight: 400;
font-style: normal;
font-display: swap;
src: url('/fonts/GeistMono-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Geist Mono';
font-weight: 500;
font-style: normal;
font-display: swap;
src: url('/fonts/GeistMono-Medium.ttf') format('truetype');
}
@font-face {
font-family: 'Geist Mono';
font-weight: 700;
font-style: normal;
font-display: swap;
src: url('/fonts/GeistMono-Bold.ttf') format('truetype');
}
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}

/* Override docs story canvas background to match npmx theme */
.docs-story {
background-color: var(--bg, oklch(0.171 0 0)) !important;
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ npmx.dev supports npm permalinks &ndash; just replace `npmjs.com` with `npmx.dev
| `npmjs.com/org/nuxt` | [`npmx.dev/org/nuxt`](https://npmx.dev/org/nuxt) |

> [!TIP]
> 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/).
> 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/).

#### Not yet supported

Expand Down Expand Up @@ -148,7 +148,7 @@ We welcome contributions &ndash; please do feel free to explore the project and

## Related projects

- [npmx-replace-extension](https://github.com/tylersayshi/npmx-replace-extension) &ndash; Browser extension to redirect npmjs.com to npmx.dev (Chrome only for now)
- [npmx-redirect](https://github.com/iaverages/npmx-redirect) &ndash; Browser extension that automatically redirects npmjs.com URLs to npmx.dev.
- [JSR](https://jsr.io/) &ndash; The open-source package registry for modern JavaScript and TypeScript
- [npm-userscript](https://github.com/bluwy/npm-userscript) &ndash; Browser userscript with various improvements and fixes for npmjs.com
- [npm-alt](https://npm.willow.sh/) &ndash; An alternative npm package browser
Expand All @@ -158,7 +158,6 @@ We welcome contributions &ndash; please do feel free to explore the project and
- [nxjt](https://nxjt.netlify.app) &ndash; npmx Jump To: Quickly navigate to npmx common webpages.
- [npmx-weekly](https://npmx-weekly.trueberryless.org/) &ndash; A weekly newsletter for the npmx ecosystem. Add your own content via suggestions in the weekly PR on [GitHub](https://github.com/trueberryless-org/npmx-weekly/pulls?q=is%3Aopen+is%3Apr+label%3A%22%F0%9F%95%94+weekly+post%22).
- [npmx-digest](https://npmx-digest.trueberryless.org/) &ndash; An automated news aggregation website that summarizes npmx activity from GitHub and Bluesky every 8 hours.
- [npmx-redirect](https://github.com/iaverages/npmx-redirect) &ndash; Browser extension that automatically redirects npmjs.com URLs to npmx.dev.
- [npmx-badge](https://npmx-badge.vercel.app/) &ndash; A playground to help you create custom badges quickly.

If you're building something cool, let us know! 🙏
Expand Down
12 changes: 6 additions & 6 deletions app/composables/useRepoMeta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ProviderId, RepoRef } from '#shared/utils/git-providers'
import { parseRepoUrl, GITLAB_HOSTS } from '#shared/utils/git-providers'
import { GIT_PROVIDER_API_ORIGINS, parseRepoUrl, GITLAB_HOSTS } from '#shared/utils/git-providers'

// TTL for git repo metadata (10 minutes - repo stats don't change frequently)
const REPO_META_TTL = 60 * 10
Expand Down Expand Up @@ -134,7 +134,7 @@ const githubAdapter: ProviderAdapter = {
let res: UnghRepoResponse | null = null
try {
const { data } = await cachedFetch<UnghRepoResponse>(
`https://ungh.cc/repos/${ref.owner}/${ref.repo}`,
`${GIT_PROVIDER_API_ORIGINS.github}/repos/${ref.owner}/${ref.repo}`,
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
UNGH_REPO_META_TTL,
)
Expand Down Expand Up @@ -256,7 +256,7 @@ const bitbucketAdapter: ProviderAdapter = {
let res: BitbucketRepoResponse | null = null
try {
const { data } = await cachedFetch<BitbucketRepoResponse>(
`https://api.bitbucket.org/2.0/repositories/${ref.owner}/${ref.repo}`,
`${GIT_PROVIDER_API_ORIGINS.bitbucket}/2.0/repositories/${ref.owner}/${ref.repo}`,
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
REPO_META_TTL,
)
Expand Down Expand Up @@ -314,7 +314,7 @@ const codebergAdapter: ProviderAdapter = {
let res: GiteaRepoResponse | null = null
try {
const { data } = await cachedFetch<GiteaRepoResponse>(
`https://codeberg.org/api/v1/repos/${ref.owner}/${ref.repo}`,
`${GIT_PROVIDER_API_ORIGINS.codeberg}/api/v1/repos/${ref.owner}/${ref.repo}`,
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
REPO_META_TTL,
)
Expand Down Expand Up @@ -372,7 +372,7 @@ const giteeAdapter: ProviderAdapter = {
let res: GiteeRepoResponse | null = null
try {
const { data } = await cachedFetch<GiteeRepoResponse>(
`https://gitee.com/api/v5/repos/${ref.owner}/${ref.repo}`,
`${GIT_PROVIDER_API_ORIGINS.gitee}/api/v5/repos/${ref.owner}/${ref.repo}`,
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
REPO_META_TTL,
)
Expand Down Expand Up @@ -625,7 +625,7 @@ const radicleAdapter: ProviderAdapter = {
let res: RadicleProjectResponse | null = null
try {
const { data } = await cachedFetch<RadicleProjectResponse>(
`https://seed.radicle.at/api/v1/projects/${ref.repo}`,
`${GIT_PROVIDER_API_ORIGINS.radicle}/api/v1/projects/${ref.repo}`,
{ headers: { 'User-Agent': 'npmx', ...options.headers }, ...options },
REPO_META_TTL,
)
Expand Down
30 changes: 30 additions & 0 deletions app/pages/accessibility.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Accessibility from './accessibility.vue'
import type { Meta, StoryObj } from '@storybook-vue/nuxt'
import AppHeader from '~/components/AppHeader.vue'
import AppFooter from '~/components/AppFooter.vue'

const meta = {
component: Accessibility,
parameters: {
layout: 'fullscreen',
},
decorators: [
() => ({
components: { AppHeader, AppFooter },
template: `
<div class="min-h-screen flex flex-col bg-bg text-fg">
<AppHeader :show-logo="true" />
<div id="main-content" class="flex-1 flex flex-col" tabindex="-1">
<story />
</div>
<AppFooter />
</div>
`,
}),
],
} satisfies Meta<typeof Accessibility>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {}
2 changes: 1 addition & 1 deletion docs/content/1.getting-started/2.quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ Replace `npmjs.com` with `npmx.dev` in any npm URL:
| `npmjs.com/~sindresorhus` | `npmx.dev/~sindresorhus` |

::tip
Install the [npmx-replace browser extension](https://github.com/tylersayshi/npmx-replace-extension) for automatic redirects from npmjs.com.
Install the [npmx-redirect extension](https://github.com/iaverages/npmx-redirect) for automatic redirects from npmjs.com.
::
2 changes: 1 addition & 1 deletion docs/content/2.guide/3.url-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Replace `npmjs.com` with `npmx.dev` (or `xnpmjs.com`) in any npm URL:
| `npmjs.com/org/nuxt` | [`npmx.dev/org/nuxt`](https://npmx.dev/org/nuxt) |

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

## Use simpler URLs
Expand Down
Loading
Loading