File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ defineProps<{
2929 </div >
3030 </a >
3131
32- <a target =" _blank" :href =" `https://www.npmjs.com /package/${name}`" >
32+ <a target =" _blank" :href =" `https://npmx.dev /package/${name}`" >
3333 <div class =" flex text-gray-400" hover =" text-#cc3534" >
3434 <i class =" i-ri:npmjs-fill" />
3535 </div >
Original file line number Diff line number Diff line change 1+ import type { Repository } from './data/repository.data'
2+ import { createRequire } from 'node:module'
13import path from 'node:path'
24import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
35import MarkdownItGitHubAlerts from 'markdown-it-github-alerts'
46import { defineConfig } from 'vitepress'
57import { groupIconMdPlugin } from 'vitepress-plugin-group-icons'
68import { description , ogImage , title } from './constant'
7- import { repositoryMeta } from './data/meta'
9+
10+ const require = createRequire ( import . meta. url )
11+ const repos : Repository [ ] = [ ]
12+
13+ try {
14+ const meta = require ( './data/repository.json' )
15+ repos . push ( ...meta )
16+ }
17+ catch {
18+ }
819
920// https://vitepress.dev/reference/site-config
1021export default defineConfig ( {
@@ -43,7 +54,7 @@ export default defineConfig({
4354 text : 'Overview' ,
4455 link : '/showcase/' ,
4556 } ,
46- ...repositoryMeta . map ( repo => (
57+ ...repos . map ( repo => (
4758 {
4859 text : repo . name ,
4960 link : `/showcase/${ repo . name } ` ,
@@ -80,6 +91,7 @@ export default defineConfig({
8091 md . use ( groupIconMdPlugin )
8192 } ,
8293 codeTransformers : [
94+ // @ts -expect-error - version mismatch
8395 transformerTwoslash ( {
8496 twoslashOptions : {
8597 compilerOptions : {
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ for (const [key, repo] of Object.entries(data)) {
3939
4040writeFileSync (
4141 path . resolve ( import . meta. dirname , 'repository.json' ) ,
42- JSON . stringify ( Object . values ( data ) , null , 2 ) ,
42+ JSON . stringify ( Object . values ( data ) . sort (
43+ ( a , b ) => b . stargazers . totalCount - a . stargazers . totalCount ,
44+ ) , null , 2 ) ,
4345)
4446
4547consola . success ( 'All files generate done!' )
You can’t perform that action at this time.
0 commit comments