Skip to content

Commit c05ed90

Browse files
committed
🏗️ [doc] update jh-api to fix doc build error
1 parent 02d2c9d commit c05ed90

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

cli/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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
}

doc/dependence/markdownLib/api.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

doc/janghood.config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ import { defineJhConfig } from '@janghood/config';
1313

1414
export 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
},

doc/nuxt.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
export 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+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
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",

0 commit comments

Comments
 (0)