fumadocs-openapi 9.2.0 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/generate-file.js
CHANGED
|
@@ -9,16 +9,17 @@ export async function generateFiles(options) {
|
|
|
9
9
|
let schemas = {};
|
|
10
10
|
if (Array.isArray(input)) {
|
|
11
11
|
const targets = [];
|
|
12
|
+
const patterns = [];
|
|
12
13
|
for (const item of input) {
|
|
13
|
-
if (isUrl(item))
|
|
14
|
+
if (isUrl(item))
|
|
14
15
|
targets.push(item);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
targets.push(...(await glob(item, { cwd, absolute: true })));
|
|
18
|
-
}
|
|
16
|
+
else
|
|
17
|
+
patterns.push(item);
|
|
19
18
|
}
|
|
19
|
+
if (patterns.length > 0)
|
|
20
|
+
targets.push(...(await glob(patterns, { cwd })));
|
|
20
21
|
await Promise.all(targets.map(async (item) => {
|
|
21
|
-
schemas[item] = await processDocument(item);
|
|
22
|
+
schemas[item] = await processDocument(path.join(cwd, item));
|
|
22
23
|
}));
|
|
23
24
|
}
|
|
24
25
|
else {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PageTree } from 'fumadocs-core/server';
|
|
2
|
-
import type { PageFile } from 'fumadocs-core/source';
|
|
2
|
+
import type { PageFile, PageTreeTransformer } from 'fumadocs-core/source';
|
|
3
3
|
/**
|
|
4
4
|
* Source API Integration
|
|
5
5
|
*
|
|
6
6
|
* Add this to page tree builder options
|
|
7
7
|
*/
|
|
8
8
|
export declare const attachFile: (node: PageTree.Item, file: PageFile | undefined) => PageTree.Item;
|
|
9
|
+
export declare function transformerOpenAPI(): PageTreeTransformer;
|
|
9
10
|
//# sourceMappingURL=source-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,QAAQ,CAAC,IAAI,EACnB,MAAM,QAAQ,GAAG,SAAS,KACzB,QAAQ,CAAC,IA4BX,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,mBAAmB,CASxD"}
|
|
@@ -22,3 +22,13 @@ export const attachFile = (node, file) => {
|
|
|
22
22
|
}
|
|
23
23
|
return node;
|
|
24
24
|
};
|
|
25
|
+
export function transformerOpenAPI() {
|
|
26
|
+
return {
|
|
27
|
+
file(node, file) {
|
|
28
|
+
if (!file)
|
|
29
|
+
return node;
|
|
30
|
+
const content = this.storage.read(file);
|
|
31
|
+
return attachFile(node, content?.format === 'page' ? content : undefined);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"react-hook-form": "^7.62.0",
|
|
62
62
|
"remark": "^15.0.1",
|
|
63
63
|
"remark-rehype": "^11.1.2",
|
|
64
|
-
"shiki": "^3.
|
|
64
|
+
"shiki": "^3.11.0",
|
|
65
65
|
"tinyglobby": "^0.2.14",
|
|
66
66
|
"xml-js": "^1.6.11",
|
|
67
|
-
"fumadocs-core": "15.
|
|
68
|
-
"fumadocs-ui": "15.
|
|
67
|
+
"fumadocs-core": "15.7.0",
|
|
68
|
+
"fumadocs-ui": "15.7.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@scalar/api-client-react": "^1.3.27",
|