File tree Expand file tree Collapse file tree 5 files changed +25
-7
lines changed
Expand file tree Collapse file tree 5 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 1111 "vue-tsc" : " ^1.8.27"
1212 },
1313 "dependencies" : {
14- "@janghood/api-extractor" : " 0.0.1-alpha.15 " ,
14+ "@janghood/api-extractor" : " 0.0.1-alpha.16 " ,
1515 "rimraf" : " ^5.0.5"
1616 }
1717}
Original file line number Diff line number Diff line change @@ -18,7 +18,14 @@ export default function api() {
1818 searchValue ,
1919 ( apiStr : string , relativeApiPath : string ) => {
2020 const path = relativeApiPath . endsWith ( '.md' ) ? relativeApiPath : `${ relativeApiPath } /index.md` ;
21- const fileInfo = fs . readFileSync ( `${ __dirname } /../../apis/${ path } ` , 'utf-8' ) ;
21+
22+ // todo 后面上面那个全部换成props,现在是个中间处理方案
23+ let filePath = `${ __dirname } /../../apis/${ path } ` ;
24+ if ( ! fs . existsSync ( filePath ) ) {
25+ filePath = `${ __dirname } /../../apis/${ relativeApiPath . endsWith ( '.md' ) ? relativeApiPath : `${ relativeApiPath } /props.md` } `
26+ }
27+
28+ const fileInfo = fs . readFileSync ( filePath , 'utf-8' ) ;
2229 return fileInfo || '' ;
2330 } ) ;
2431 }
Original file line number Diff line number Diff line change @@ -13,12 +13,17 @@ import { defineJhConfig } from '@janghood/config';
1313
1414export default defineJhConfig ( {
1515 apiExtractor : {
16- include : [ '../lib/components/**/**/*.d.ts' ] ,
17- exclude : [ '../lib/components/types/*.d.ts' ] ,
16+ include : [ '../lib/components/**/**/*.d.ts' , '../core/components/**/**/*.d.ts' ] ,
17+ exclude : [ '../lib/components/types/*.d.ts' , '../core/components/types/*.d.ts' ] ,
1818 document : {
1919 markdown : {
2020 output : 'apis' ,
21- replace : '../lib/components' ,
21+ replace : dict => {
22+ if ( dict . startsWith ( '../core' ) ) {
23+ return dict . replace ( '../core/components' , '' ) ;
24+ }
25+ return dict . replace ( '../lib/components' , '' ) ;
26+ } ,
2227 active : true ,
2328 } ,
2429 } ,
Original file line number Diff line number Diff line change 11export default defineNuxtConfig ( {
22 devtools : { enabled : true } ,
33 extensions : [ '.md' ] ,
4+
45 modules : [
56 './modules/markdown' ,
67 './modules/fontmin' ,
78 '@shuimo-design/shuimo-ui-nuxt' ,
89 '@nuxtjs/i18n' ,
910 'nuxt-gtag' ,
1011 ] ,
12+
1113 css : [ './assets/style/index.css' ] ,
14+
1215 i18n : {
1316 strategy : 'prefix_except_default' ,
1417 defaultLocale : 'zh' ,
@@ -27,7 +30,10 @@ export default defineNuxtConfig({
2730 } ,
2831 vueI18n : './i18n/i18n.config.ts' ,
2932 } ,
33+
3034 gtag : {
3135 id : 'G-W1HW9D136H' ,
3236 } ,
33- } ) ;
37+
38+ compatibilityDate : '2025-01-13' ,
39+ } ) ;
Original file line number Diff line number Diff line change 3131 "attributes" : " attributes.json"
3232 },
3333 "devDependencies" : {
34- "@janghood/config" : " 0.0.1-5 " ,
34+ "@janghood/config" : " 0.0.1-6 " ,
3535 "@janghood/lint" : " 0.0.5" ,
3636 "@nuxt/devtools" : " latest" ,
3737 "@types/node" : " ^20.12.2" ,
You can’t perform that action at this time.
0 commit comments