File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { MaybeRefOrGetter } from 'vue'
22import { toValue } from 'vue'
3+ import { fetchNpmDownloadsRange } from '~/utils/npm/api'
34
45export type PackumentLikeForTime = {
56 time ?: Record < string , string >
@@ -45,12 +46,6 @@ export type PackageDownloadEvolutionOptions =
4546
4647type DailyDownloadsResponse = { downloads : Array < { day : string ; downloads : number } > }
4748
48- declare function fetchNpmDownloadsRange (
49- packageName : string ,
50- startIso : string ,
51- endIso : string ,
52- ) : Promise < DailyDownloadsResponse >
53-
5449function toIsoDateString ( date : Date ) : string {
5550 return date . toISOString ( ) . slice ( 0 , 10 )
5651}
Original file line number Diff line number Diff line change 66 * - /package/docs/* → /package-docs/*
77 * - /docs/* → /package-docs/*
88 * - /org/* → /@*
9- * - /* → /package/* (Unless its an existing page)
9+ * - /* → /package/* (Unless it's an existing page)
1010 */
1111export default defineNuxtRouteMiddleware ( to => {
1212 // Only redirect on client-side to avoid breaking crawlers mid-transition
@@ -38,7 +38,7 @@ export default defineNuxtRouteMiddleware(to => {
3838 }
3939
4040 // Keep this one last as it will catch everything
41- // /* → /package/* (Unless its an existing page)
41+ // /* → /package/* (Unless it's an existing page)
4242 if ( path . startsWith ( '/' ) && ! path . startsWith ( '/package/' ) ) {
4343 const router = useRouter ( )
4444 const resolved = router . resolve ( path )
Original file line number Diff line number Diff line change @@ -445,7 +445,7 @@ defineOgImageComponent('Package', {
445445 <button
446446 type =" button"
447447 @click =" copyPkgName()"
448- class =" copy-button absolute z-20 left-0 top-full inline-flex items-center gap-1 px-2 py-1 rounded border text-xs font-mono whitespace-nowrap text-fg-muted bg-bg border-border opacity-0 -translate-y-1 pointer-events-none transition-all duration-150 group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto focus-visible:opacity-100 focus-visible:translate-y-0 focus-visible:pointer-events-auto hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/40"
448+ class =" copy-button absolute z-20 left-0 top-full inline-flex items-center gap-1 px-2 py-1 rounded border text-xs font-mono whitespace-nowrap text-fg-muted bg-bg border-border opacity-0 -translate-y-1 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto focus-visible:opacity-100 focus-visible:translate-y-0 focus-visible:pointer-events-auto hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/40"
449449 :aria-label =" $t('package.copy_name')"
450450 >
451451 <span class =" i-carbon:copy w-3.5 h-3.5" aria-hidden =" true" />
@@ -1191,6 +1191,33 @@ defineOgImageComponent('Package', {
11911191 min-width : 0 ;
11921192}
11931193
1194+ .copy-button {
1195+ clip : rect (0 0 0 0 );
1196+ clip-path : inset (50% );
1197+ height : 1px ;
1198+ overflow : hidden ;
1199+ width : 1px ;
1200+ transition :
1201+ opacity 0.25s 0.1s ,
1202+ translate 0.15s 0.1s ,
1203+ clip 0.01s 0.34s allow-discrete,
1204+ clip-path 0.01s 0.34s allow-discrete,
1205+ height 0.01s 0.34s allow-discrete,
1206+ width 0.01s 0.34s allow-discrete;
1207+ }
1208+
1209+ .group :hover .copy-button ,
1210+ .copy-button :focus-visible {
1211+ clip : auto ;
1212+ clip-path : none ;
1213+ height : auto ;
1214+ overflow : visible ;
1215+ width : auto ;
1216+ transition :
1217+ opacity 0.15s ,
1218+ translate 0.15s ;
1219+ }
1220+
11941221@media (hover : none) {
11951222 .copy-button {
11961223 display : none ;
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ export default defineNuxtModule({
1111
1212 if ( isCI && provider !== 'github_actions' ) {
1313 nuxt . options . debug = defu ( nuxt . options . debug , { hydration : true } )
14+ nuxt . options . sourcemap = {
15+ server : true ,
16+ client : true ,
17+ }
1418 }
1519 } ,
1620} )
Original file line number Diff line number Diff line change @@ -126,9 +126,6 @@ export default defineNuxtConfig({
126126 compatibilityDate : '2026-01-31' ,
127127
128128 nitro : {
129- experimental : {
130- wasm : true ,
131- } ,
132129 externals : {
133130 inline : [
134131 'shiki' ,
You can’t perform that action at this time.
0 commit comments