From ba3bf17c4234b596c24cfa75579e19f74ef931be Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Tue, 29 Oct 2024 01:08:01 +0900 Subject: [PATCH] Fix editor page download bug --- website/build/editor.js | 5 +++-- website/package.json | 4 ++-- website/pages/docs/editor.mdx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/website/build/editor.js b/website/build/editor.js index 46672b8b5..49463c104 100644 --- a/website/build/editor.js +++ b/website/build/editor.js @@ -6,7 +6,7 @@ const PACKAGE = `${__dirname}/../../packages/editor`; const ASSETS = `${PACKAGE}/dist/assets`; const main = async () => { - cp.execSync("npm install && npm run build:static", { + cp.execSync("npm i && npm run build:static", { stdio: "ignore", cwd: PACKAGE, }); @@ -19,8 +19,9 @@ const main = async () => { zip.file(`assets/${file}`, await fs.promises.readFile(`${ASSETS}/${file}`)); const buffer = await zip.generateAsync({ type: "uint8array", + compression: "DEFLATE", compressionOptions: { - level: 0, + level: 9, }, }); try { diff --git a/website/package.json b/website/package.json index 540abd81b..31ef7b0d1 100644 --- a/website/package.json +++ b/website/package.json @@ -4,7 +4,7 @@ "description": "Nestia Guide Documents", "private": true, "scripts": { - "build": "rimraf .next && rimraf .out && node build/typedoc && next build && node build/sitemap", + "build": "rimraf .next && rimraf .out && node build/editor && node build/typedoc && next build && node build/sitemap", "deploy": "node build/deploy", "dev": "next dev" }, @@ -23,7 +23,7 @@ "@mui/icons-material": "5.15.6", "@mui/material": "5.15.6", "@mui/system": "5.15.6", - "@nestia/editor": "0.3.0", + "@nestia/editor": "0.3.1", "jszip": "^3.10.1", "next": "14.2.13", "nextra": "^2.13.4", diff --git a/website/pages/docs/editor.mdx b/website/pages/docs/editor.mdx index 9cfac24a8..27f97ef80 100644 --- a/website/pages/docs/editor.mdx +++ b/website/pages/docs/editor.mdx @@ -69,7 +69,7 @@ Install `@nestia/editor` and import one of below components. > [💾 https://nestia.io/downloads/editor.zip](/downloads/editor.zip) -Just unzip the above [`editor.zip`]((/downloads/editor.zip)) file, and place your `swagger.json` file into the extracted directory. +Just unzip the above [`editor.zip`](/downloads/editor.zip) file, and place your `swagger.json` file into the extracted directory. If you open the extracted `index.html` in your browser, you can see the `@nestia/editor` is serving the "TypeScript Swagger Editor" application with your `swagger.json` file.