docusaurus-plugin-openapi-docs 0.0.0-615 → 0.0.0-616
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/lib/index.js +11 -1
- package/package.json +2 -2
- package/src/index.ts +11 -1
package/lib/index.js
CHANGED
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getDocsPluginConfig = exports.isURL = void 0;
|
|
13
13
|
const fs_1 = __importDefault(require("fs"));
|
|
14
14
|
const path_1 = __importDefault(require("path"));
|
|
15
|
+
const zlib_1 = __importDefault(require("zlib"));
|
|
15
16
|
const utils_1 = require("@docusaurus/utils");
|
|
16
17
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
18
|
const mustache_1 = require("mustache");
|
|
@@ -210,7 +211,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
210
211
|
: tagPageGenerator(item);
|
|
211
212
|
item.markdown = markdown;
|
|
212
213
|
if (item.type === "api") {
|
|
213
|
-
|
|
214
|
+
// opportunity to compress JSON
|
|
215
|
+
// const serialize = (o: any) => {
|
|
216
|
+
// return zlib.deflateSync(JSON.stringify(o)).toString("base64");
|
|
217
|
+
// };
|
|
218
|
+
// const deserialize = (s: any) => {
|
|
219
|
+
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
220
|
+
// };
|
|
221
|
+
item.json = zlib_1.default
|
|
222
|
+
.deflateSync(JSON.stringify(item.api))
|
|
223
|
+
.toString("base64");
|
|
214
224
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
215
225
|
if (docRouteBasePath) {
|
|
216
226
|
infoBasePath = `${docRouteBasePath}/${outputDir
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-616",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "8ba8a83ca6b3bd116a0a2bab85594d719b76b749"
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import fs from "fs";
|
|
9
9
|
import path from "path";
|
|
10
|
+
import zlib from "zlib";
|
|
10
11
|
|
|
11
12
|
import type { LoadContext, Plugin } from "@docusaurus/types";
|
|
12
13
|
import { Globby, posixPath } from "@docusaurus/utils";
|
|
@@ -264,7 +265,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
264
265
|
: tagPageGenerator(item);
|
|
265
266
|
item.markdown = markdown;
|
|
266
267
|
if (item.type === "api") {
|
|
267
|
-
|
|
268
|
+
// opportunity to compress JSON
|
|
269
|
+
// const serialize = (o: any) => {
|
|
270
|
+
// return zlib.deflateSync(JSON.stringify(o)).toString("base64");
|
|
271
|
+
// };
|
|
272
|
+
// const deserialize = (s: any) => {
|
|
273
|
+
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
274
|
+
// };
|
|
275
|
+
item.json = zlib
|
|
276
|
+
.deflateSync(JSON.stringify(item.api))
|
|
277
|
+
.toString("base64");
|
|
268
278
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
269
279
|
if (docRouteBasePath) {
|
|
270
280
|
infoBasePath = `${docRouteBasePath}/${outputDir
|