Skip to content

Commit ef51c3d

Browse files
authored
Merge branch 'main' into feat/changelog-1
2 parents 22901bc + bfc0917 commit ef51c3d

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ We welcome contributions – please do feel free to explore the project and
148148

149149
## Related projects
150150

151-
- [npmx-replace-extension](https://github.com/tylersayshi/npmx-replace-extension) – Browser extension to redirect npmjs.com to npmx.dev (Chrome only for now)
151+
- [npmx-redirect](https://github.com/iaverages/npmx-redirect) – Browser extension that automatically redirects npmjs.com URLs to npmx.dev.
152152
- [JSR](https://jsr.io/) – The open-source package registry for modern JavaScript and TypeScript
153153
- [npm-userscript](https://github.com/bluwy/npm-userscript) – Browser userscript with various improvements and fixes for npmjs.com
154154
- [npm-alt](https://npm.willow.sh/) – An alternative npm package browser
@@ -158,7 +158,6 @@ We welcome contributions – please do feel free to explore the project and
158158
- [nxjt](https://nxjt.netlify.app) – npmx Jump To: Quickly navigate to npmx common webpages.
159159
- [npmx-weekly](https://npmx-weekly.trueberryless.org/) – 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).
160160
- [npmx-digest](https://npmx-digest.trueberryless.org/) – An automated news aggregation website that summarizes npmx activity from GitHub and Bluesky every 8 hours.
161-
- [npmx-redirect](https://github.com/iaverages/npmx-redirect) – Browser extension that automatically redirects npmjs.com URLs to npmx.dev.
162161
- [npmx-badge](https://npmx-badge.vercel.app/) – A playground to help you create custom badges quickly.
163162

164163
If you're building something cool, let us know! 🙏

nuxt.config.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default defineNuxtConfig({
9999

100100
routeRules: {
101101
// API routes
102-
'/api/**': { isr: 60 },
102+
'/api/**': { isr: 300 },
103103
'/api/registry/badge/**': {
104104
isr: {
105105
expiration: 60 * 60 /* one hour */,
@@ -128,7 +128,7 @@ export default defineNuxtConfig({
128128
'/api/registry/package-meta/**': { isr: 300 },
129129
'/:pkg/.well-known/skills/**': { isr: 3600 },
130130
'/:scope/:pkg/.well-known/skills/**': { isr: 3600 },
131-
'/__og-image__/**': getISRConfig(60),
131+
'/__og-image__/**': getISRConfig(3600),
132132
'/_avatar/**': { isr: 3600, proxy: 'https://www.gravatar.com/avatar/**' },
133133
'/opensearch.xml': { isr: true },
134134
'/oauth-client-metadata.json': { prerender: true },
@@ -161,14 +161,18 @@ export default defineNuxtConfig({
161161
},
162162
},
163163
// pages
164-
'/package/**': getISRConfig(60, { fallback: 'html' }),
165-
'/package/:name/_payload.json': getISRConfig(60, { fallback: 'json' }),
166-
'/package/:name/v/:version/_payload.json': getISRConfig(60, { fallback: 'json' }),
167-
'/package/:org/:name/_payload.json': getISRConfig(60, { fallback: 'json' }),
168-
'/package/:org/:name/v/:version/_payload.json': getISRConfig(60, { fallback: 'json' }),
164+
'/package/**': getISRConfig(300, { fallback: 'html' }),
165+
'/package/:name/_payload.json': getISRConfig(300, { fallback: 'json' }),
166+
'/package/:name/v/:version/_payload.json': getISRConfig(300, { fallback: 'json' }),
167+
'/package/:org/:name/_payload.json': getISRConfig(300, { fallback: 'json' }),
168+
'/package/:org/:name/v/:version/_payload.json': getISRConfig(300, { fallback: 'json' }),
169169
// infinite cache (versioned - doesn't change)
170-
'/package-code/**': { isr: true, cache: { maxAge: 365 * 24 * 60 * 60 } },
171-
'/package-docs/**': { isr: true, cache: { maxAge: 365 * 24 * 60 * 60 } },
170+
'/package-code/**': {
171+
headers: { 'Cache-Control': 'public, s-maxage=31536000, stale-while-revalidate=31536000' },
172+
},
173+
'/package-docs/**': {
174+
headers: { 'Cache-Control': 'public, s-maxage=31536000, stale-while-revalidate=31536000' },
175+
},
172176
// static pages
173177
'/': { prerender: true },
174178
'/200.html': { prerender: true },

vercel.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@
9191
}
9292
],
9393
"destination": "https://github.com/npmx-dev/npmx.dev/blob/main/LICENSE"
94+
},
95+
{
96+
"source": "/(.*)",
97+
"has": [
98+
{
99+
"type": "host",
100+
"value": "i18n.npmx.dev"
101+
}
102+
],
103+
"destination": "https://main.npmx.dev/translation-status"
94104
}
95105
]
96106
}

0 commit comments

Comments
 (0)