diff --git a/packages/editor/index.html b/packages/editor/index.html index a71dbc8b3..7ecc1d64e 100644 --- a/packages/editor/index.html +++ b/packages/editor/index.html @@ -9,6 +9,11 @@
+ diff --git a/packages/editor/package.json b/packages/editor/package.json index acbb5c21b..7ce93fd3f 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/editor", - "version": "0.5.1", + "version": "0.6.2", "typings": "lib/index.d.ts", "main": "lib/index.js", "module": "lib/index.mjs", @@ -33,7 +33,7 @@ "homepage": "https://nestia.io", "dependencies": { "@mui/material": "^5.15.6", - "@nestia/migrate": "^0.18.2", + "@nestia/migrate": "^0.19.0", "@stackblitz/sdk": "^1.11.0", "js-yaml": "^4.1.0", "prettier": "^3.3.3", diff --git a/packages/editor/src/NestiaEditorApplication.tsx b/packages/editor/src/NestiaEditorApplication.tsx index 012cdf6cd..c59a5177d 100644 --- a/packages/editor/src/NestiaEditorApplication.tsx +++ b/packages/editor/src/NestiaEditorApplication.tsx @@ -23,8 +23,10 @@ export function NestiaEditorApplication() { return asset !== null ? ( ) : (
{ (await findSwagger("./swagger.yaml")); if (url === null) return null; - const simulate: string | null = query.get("simulate"); - const e2e: string | null = query.get("e2e"); const mode: string | null = query.get("mode"); + const packageName: string | null = + query.get("package") ?? (window as any).package; + const simulate: boolean | string | null = + query.get("simulate") ?? (window as any).simulate; + const e2e: boolean | string | null = query.get("e2e") ?? (window as any).e2e; return { + mode: mode === "nest" ? "nest" : "sdk", + package: packageName ?? "@ORGANIZATION/PROJECT", url, simulate: - simulate !== null ? simulate === "true" || simulate === "1" : false, - e2e: e2e !== null ? e2e === "true" || e2e === "1" : false, - mode: mode === "nest" ? "nest" : "sdk", + simulate !== null + ? simulate === true || simulate === "true" || simulate === "1" + : false, + e2e: e2e !== null ? e2e === true || e2e === "true" || e2e === "1" : false, }; } @@ -69,8 +77,9 @@ async function findSwagger(file: string): Promise { } interface IAsset { + mode: "nest" | "sdk"; + package: string; url: string; simulate: boolean; e2e: boolean; - mode: "nest" | "sdk"; } diff --git a/packages/editor/src/NestiaEditorIframe.tsx b/packages/editor/src/NestiaEditorIframe.tsx index 328f60e41..fdbc0e7d4 100644 --- a/packages/editor/src/NestiaEditorIframe.tsx +++ b/packages/editor/src/NestiaEditorIframe.tsx @@ -53,6 +53,7 @@ export function NestiaEditorIframe(props: NestiaEditorIframe.IProps) { document, simulate: props.simulate ?? true, e2e: props.e2e ?? true, + package: props.package ?? "@ORGANIZATION/PROJECT", }); } catch (exp) { return { @@ -189,6 +190,7 @@ export namespace NestiaEditorIframe { | SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument; + package?: string; simulate?: boolean; e2e?: boolean; diff --git a/packages/editor/src/NestiaEditorUploader.tsx b/packages/editor/src/NestiaEditorUploader.tsx index 1c40aa822..e0a70e704 100644 --- a/packages/editor/src/NestiaEditorUploader.tsx +++ b/packages/editor/src/NestiaEditorUploader.tsx @@ -6,6 +6,7 @@ import { Radio, RadioGroup, Switch, + TextField, } from "@mui/material"; import { OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi"; import StackBlitzSDK from "@stackblitz/sdk"; @@ -19,6 +20,7 @@ export function NestiaEditorUploader(props: NestiaEditorUploader.IProps) { const [mode, setMode] = React.useState<"nest" | "sdk">("sdk"); const [simulate, setSimulate] = React.useState(true); const [e2e, setE2e] = React.useState(true); + const [name, setName] = React.useState("@ORGINIZATION/PROJECT"); // RESULT const [document, setDocument] = React.useState< @@ -51,6 +53,7 @@ export function NestiaEditorUploader(props: NestiaEditorUploader.IProps) { document, e2e, simulate, + package: name, }); if (result.success === true) { StackBlitzSDK.openProject( @@ -79,7 +82,13 @@ export function NestiaEditorUploader(props: NestiaEditorUploader.IProps) {
- Mode + setName(e.target.value)} + defaultValue={name} + label="Package Name" + variant="outlined" + /> + Mode setMode(value as "nest" | "sdk")} diff --git a/packages/editor/src/internal/NestiaEditorComposer.ts b/packages/editor/src/internal/NestiaEditorComposer.ts index efc50a152..1571aa72e 100644 --- a/packages/editor/src/internal/NestiaEditorComposer.ts +++ b/packages/editor/src/internal/NestiaEditorComposer.ts @@ -10,6 +10,7 @@ export namespace NestiaEditorComposer { document: SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument; e2e: boolean; simulate: boolean; + package?: string; /** * @internal */ diff --git a/packages/editor/tsconfig.app.tsbuildinfo b/packages/editor/tsconfig.app.tsbuildinfo index ae1e0c308..06b0e2197 100644 --- a/packages/editor/tsconfig.app.tsbuildinfo +++ b/packages/editor/tsconfig.app.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/nestiaeditorapplication.tsx","./src/nestiaeditoriframe.tsx","./src/nestiaeditoruploader.tsx","./src/index.ts","./src/main.tsx","./src/vite-env.d.ts","./src/internal/nestiaeditorcomposer.ts","./src/internal/nestiaeditorfileuploader.tsx"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/nestiaeditorapplication.tsx","./src/nestiaeditoriframe.tsx","./src/nestiaeditoruploader.tsx","./src/index.ts","./src/main.tsx","./src/vite-env.d.ts","./src/internal/nestiaeditorcomposer.ts","./src/internal/nestiaeditorfileuploader.tsx"],"errors":true,"version":"5.6.3"} \ No newline at end of file diff --git a/packages/migrate/package-lock.json b/packages/migrate/package-lock.json index b1b018ab3..7c45fa12b 100644 --- a/packages/migrate/package-lock.json +++ b/packages/migrate/package-lock.json @@ -1,34 +1,36 @@ { "name": "@nestia/migrate", - "version": "0.18.2", + "version": "0.19.0-dev.20241101", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@nestia/migrate", - "version": "0.18.2", + "version": "0.19.0-dev.20241101", "license": "MIT", "dependencies": { - "@samchon/openapi": "^1.0.2", + "@samchon/openapi": "^1.1.2", "commander": "10.0.0", "inquirer": "8.2.5", "prettier": "^3.2.5", "tstl": "^3.0.0", "typescript": "^5.5.4", - "typia": "^6.10.0" + "typia": "^6.11.3" }, "bin": { "migrate": "lib/executable/migrate.js" }, "devDependencies": { "@nestia/benchmark": "^0.2.3", - "@nestia/core": "^3.14.0", + "@nestia/core": "^3.18.0", "@nestia/e2e": "^0.7.0", - "@nestia/fetcher": "^3.14.0", + "@nestia/fetcher": "^3.18.0", "@nestjs/common": "^10.3.8", "@nestjs/core": "^10.3.8", "@nestjs/platform-express": "^10.3.8", "@nestjs/platform-fastify": "^10.3.8", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.1", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/cli-progress": "^3.11.5", "@types/express": "^4.17.21", @@ -41,6 +43,7 @@ "dotenv-expand": "^10.0.0", "express": "^4.19.2", "rimraf": "^5.0.1", + "rollup": "^4.24.3", "serialize-error": "^4.1.0", "source-map-support": "^0.5.21", "swagger-ui-express": "^5.0.0", @@ -630,6 +633,26 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/source-map/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", @@ -667,15 +690,15 @@ } }, "node_modules/@nestia/core": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/@nestia/core/-/core-3.14.0.tgz", - "integrity": "sha512-nBe3q0Nazjcu4XSbFXGJVwUEIr9Ns4OEV7c4lnlsrUC8r72fo4D7bzvVdjge9u3P6JXrjX1VMGLgM5sVvgWeLA==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/@nestia/core/-/core-3.18.0.tgz", + "integrity": "sha512-zyj4CAHuvaq7igv+zwBPeGlFGufAFM7VqNEaxxQB98mrFBCo7QskGxX8oM7WsdjDFnmhvJTr6mot8EVnw+qMCQ==", "dev": true, "dependencies": { - "@nestia/fetcher": "^3.14.0", + "@nestia/fetcher": "^3.18.0", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", - "@samchon/openapi": "^1.0.2", + "@samchon/openapi": "^1.1.0", "detect-ts-node": "^1.0.5", "get-function-location": "^2.0.0", "glob": "^7.2.0", @@ -685,16 +708,16 @@ "reflect-metadata": ">=0.1.12", "rxjs": ">=6.0.3", "tgrid": "^1.0.0", - "typia": "^6.10.0", + "typia": "^6.11.0", "ws": "^7.5.3" }, "peerDependencies": { - "@nestia/fetcher": ">=3.14.0", + "@nestia/fetcher": ">=3.18.0", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", "rxjs": ">=6.0.3", - "typia": ">=6.10.0 <7.0.0" + "typia": ">=6.11.0 <7.0.0" } }, "node_modules/@nestia/e2e": { @@ -704,12 +727,12 @@ "dev": true }, "node_modules/@nestia/fetcher": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/@nestia/fetcher/-/fetcher-3.14.0.tgz", - "integrity": "sha512-12qMUI/N+vthrHKA0CKQHv31fr7L/8JMhcG/RvfkxOUkPtU+PzLPmUKnJqCryiEwV7RJB+UkEwCabgvu3L5p7w==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/@nestia/fetcher/-/fetcher-3.18.0.tgz", + "integrity": "sha512-KlYvPpzuRhdR3NTk4Wr7TqVlLsBWYCvPlAz2TJNWoPN7ErgjOj3AneVMofi7nDm0+e6qLoai9Zmqg7evuD5zaQ==", "dev": true, "dependencies": { - "@samchon/openapi": "^1.0.2" + "@samchon/openapi": "^1.1.0" }, "peerDependencies": { "typescript": ">= 4.8.0" @@ -996,10 +1019,314 @@ "node": ">=14" } }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.1.tgz", + "integrity": "sha512-t7O653DpfB5MbFrqPe/VcKFFkvRuFNp9qId3xq4Eth5xlyymzxNpye2z8Hrl0RIMuXTSr5GGcFpkdlMeacUiFQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", + "integrity": "sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.3.tgz", + "integrity": "sha512-ufb2CH2KfBWPJok95frEZZ82LtDl0A6QKTa8MoM+cWwDZvVGl5/jNb79pIhRvAalUu+7LD91VYR0nwRD799HkQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.3.tgz", + "integrity": "sha512-iAHpft/eQk9vkWIV5t22V77d90CRofgR2006UiCjHcHJFVI1E0oBkQIAbz+pLtthFw3hWEmVB4ilxGyBf48i2Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.3.tgz", + "integrity": "sha512-QPW2YmkWLlvqmOa2OwrfqLJqkHm7kJCIMq9kOz40Zo9Ipi40kf9ONG5Sz76zszrmIZZ4hgRIkez69YnTHgEz1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.3.tgz", + "integrity": "sha512-KO0pN5x3+uZm1ZXeIfDqwcvnQ9UEGN8JX5ufhmgH5Lz4ujjZMAnxQygZAVGemFWn+ZZC0FQopruV4lqmGMshow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.3.tgz", + "integrity": "sha512-CsC+ZdIiZCZbBI+aRlWpYJMSWvVssPuWqrDy/zi9YfnatKKSLFCe6fjna1grHuo/nVaHG+kiglpRhyBQYRTK4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.3.tgz", + "integrity": "sha512-F0nqiLThcfKvRQhZEzMIXOQG4EeX61im61VYL1jo4eBxv4aZRmpin6crnBJQ/nWnCsjH5F6J3W6Stdm0mBNqBg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.3.tgz", + "integrity": "sha512-KRSFHyE/RdxQ1CSeOIBVIAxStFC/hnBgVcaiCkQaVC+EYDtTe4X7z5tBkFyRoBgUGtB6Xg6t9t2kulnX6wJc6A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.3.tgz", + "integrity": "sha512-h6Q8MT+e05zP5BxEKz0vi0DhthLdrNEnspdLzkoFqGwnmOzakEHSlXfVyA4HJ322QtFy7biUAVFPvIDEDQa6rw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.3.tgz", + "integrity": "sha512-fKElSyXhXIJ9pqiYRqisfirIo2Z5pTTve5K438URf08fsypXrEkVmShkSfM8GJ1aUyvjakT+fn2W7Czlpd/0FQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.3.tgz", + "integrity": "sha512-YlddZSUk8G0px9/+V9PVilVDC6ydMz7WquxozToozSnfFK6wa6ne1ATUjUvjin09jp34p84milxlY5ikueoenw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.3.tgz", + "integrity": "sha512-yNaWw+GAO8JjVx3s3cMeG5Esz1cKVzz8PkTJSfYzE5u7A+NvGmbVFEHP+BikTIyYWuz0+DX9kaA3pH9Sqxp69g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.3.tgz", + "integrity": "sha512-lWKNQfsbpv14ZCtM/HkjCTm4oWTKTfxPmr7iPfp3AHSqyoTz5AgLemYkWLwOBWc+XxBbrU9SCokZP0WlBZM9lA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.3.tgz", + "integrity": "sha512-HoojGXTC2CgCcq0Woc/dn12wQUlkNyfH0I1ABK4Ni9YXyFQa86Fkt2Q0nqgLfbhkyfQ6003i3qQk9pLh/SpAYw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.3.tgz", + "integrity": "sha512-mnEOh4iE4USSccBOtcrjF5nj+5/zm6NcNhbSEfR3Ot0pxBwvEn5QVUXcuOwwPkapDtGZ6pT02xLoPaNv06w7KQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.3.tgz", + "integrity": "sha512-rMTzawBPimBQkG9NKpNHvquIUTQPzrnPxPbCY1Xt+mFkW7pshvyIS5kYgcf74goxXOQk0CP3EoOC1zcEezKXhw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.3.tgz", + "integrity": "sha512-2lg1CE305xNvnH3SyiKwPVsTVLCg4TmNCF1z7PSHX2uZY2VbUpdkgAllVoISD7JO7zu+YynpWNSKAtOrX3AiuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.3.tgz", + "integrity": "sha512-9SjYp1sPyxJsPWuhOCX6F4jUMXGbVVd5obVpoVEi8ClZqo52ViZewA6eFz85y8ezuOA+uJMP5A5zo6Oz4S5rVQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.3.tgz", + "integrity": "sha512-HGZgRFFYrMrP3TJlq58nR1xy8zHKId25vhmm5S9jETEfDf6xybPxsavFTJaufe2zgOGYJBskGlj49CwtEuFhWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@samchon/openapi": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@samchon/openapi/-/openapi-1.0.2.tgz", - "integrity": "sha512-+PFmOo3fZ0RejmhMnX+yKZCC2CCSxO6NhdQLnNStcX0JFdyNZk9Z5rrcOu+SDfWOlaMdRqfYzbmfUjpknJCMfA==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@samchon/openapi/-/openapi-1.1.2.tgz", + "integrity": "sha512-qg6cs2mEcY4ULUL19i0SN2hsWoQF9hntRYIVuuvZcjry85LkRgSMBM4PA1s1Yaf9b/abZnCU97L45tiz69G+9Q==" }, "node_modules/@trivago/prettier-plugin-sort-imports": { "version": "4.3.0", @@ -1076,6 +1403,12 @@ "@types/node": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, "node_modules/@types/express": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", @@ -1945,6 +2278,12 @@ "node": ">=4" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -2338,6 +2677,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -3069,9 +3422,9 @@ "dev": true }, "node_modules/package-manager-detector": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.0.tgz", - "integrity": "sha512-E385OSk9qDcXhcM9LNSe4sdhx8a9mAPrZ4sMLW+tmxl5ZuGtPUcdFu+MPP2jbgiWAZ6Pfe5soGFMd+0Db5Vrog==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.2.tgz", + "integrity": "sha512-VgXbyrSNsml4eHWIvxxG/nTL4wgybMTXCV2Un/+yEc3aDKKU6nQBZjbeP3Pl3qm9Qg92X/1ng4ffvCeD/zwHgg==" }, "node_modules/parseurl": { "version": "1.3.3", @@ -3150,6 +3503,18 @@ "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, + "node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/pino": { "version": "9.3.2", "resolved": "https://registry.npmjs.org/pino/-/pino-9.3.2.tgz", @@ -3332,6 +3697,15 @@ "node": ">=4" } }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -3522,6 +3896,43 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup": { + "version": "4.24.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.3.tgz", + "integrity": "sha512-HBW896xR5HGmoksbi3JBDtmVzWiPAYqp7wip50hjQ67JbDz61nyoMPdqu1DvVW9asYb2M65Z20ZHsyJCMqMyDg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.24.3", + "@rollup/rollup-android-arm64": "4.24.3", + "@rollup/rollup-darwin-arm64": "4.24.3", + "@rollup/rollup-darwin-x64": "4.24.3", + "@rollup/rollup-freebsd-arm64": "4.24.3", + "@rollup/rollup-freebsd-x64": "4.24.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.3", + "@rollup/rollup-linux-arm-musleabihf": "4.24.3", + "@rollup/rollup-linux-arm64-gnu": "4.24.3", + "@rollup/rollup-linux-arm64-musl": "4.24.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.3", + "@rollup/rollup-linux-riscv64-gnu": "4.24.3", + "@rollup/rollup-linux-s390x-gnu": "4.24.3", + "@rollup/rollup-linux-x64-gnu": "4.24.3", + "@rollup/rollup-linux-x64-musl": "4.24.3", + "@rollup/rollup-win32-arm64-msvc": "4.24.3", + "@rollup/rollup-win32-ia32-msvc": "4.24.3", + "@rollup/rollup-win32-x64-msvc": "4.24.3", + "fsevents": "~2.3.2" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -3671,6 +4082,15 @@ "node": ">=6" } }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/serve-static": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", @@ -3804,6 +4224,12 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/smob": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", + "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", + "dev": true + }, "node_modules/sonic-boom": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.0.1.tgz", @@ -3977,6 +4403,30 @@ "express": ">=4.0.0 || >=5.0.0-beta" } }, + "node_modules/terser": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz", + "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, "node_modules/tgrid": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tgrid/-/tgrid-1.0.3.tgz", @@ -4199,11 +4649,11 @@ } }, "node_modules/typia": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/typia/-/typia-6.10.0.tgz", - "integrity": "sha512-BYOga6Yk7p3/dV73Bfqr4XUBNgf1TBuF3ucEYYzTbC6VpKK8wqDPLUID+YNqLSy+Ud3NupytI/jPBSdKikYTMw==", + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/typia/-/typia-6.11.3.tgz", + "integrity": "sha512-M4tNvgs1J0SWVd4eyIKnicJC2of/IlD9cZ46QZ2PbyF7yu+Wg6oUWS1NwYP8wjXo8h6LKIGeUVy7W9JsCgZYnw==", "dependencies": { - "@samchon/openapi": "^1.0.0", + "@samchon/openapi": "^1.1.1", "commander": "^10.0.0", "comment-json": "^4.2.3", "inquirer": "^8.2.5", diff --git a/packages/migrate/package.json b/packages/migrate/package.json index eb246827f..baea14352 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -1,16 +1,17 @@ { "name": "@nestia/migrate", - "version": "0.18.2", + "version": "0.19.0", "description": "Migration program from swagger to NestJS", - "main": "lib/index.js", "typings": "lib/index.d.ts", + "main": "lib/index.js", + "module": "lib/index.mjs", "bin": { "@nestia/migrate": "lib/executable/migrate.js" }, "scripts": { - "build": "rimraf lib && tsc", + "build": "rimraf lib && tsc && rollup -c", "bundle": "ts-node src/executable/bundle.ts", - "dev": "npm run build -- --watch", + "dev": "rimraf lib && tsc --watch", "package:next": "npm publish --access public --tag next", "prepare": "ts-patch install && typia patch && npm run bundle", "test": "node lib/test" @@ -37,13 +38,15 @@ "homepage": "https://nestia.io", "devDependencies": { "@nestia/benchmark": "^0.2.3", - "@nestia/core": "^3.14.0", + "@nestia/core": "^3.18.0", "@nestia/e2e": "^0.7.0", - "@nestia/fetcher": "^3.14.0", + "@nestia/fetcher": "^3.18.0", "@nestjs/common": "^10.3.8", "@nestjs/core": "^10.3.8", "@nestjs/platform-express": "^10.3.8", "@nestjs/platform-fastify": "^10.3.8", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.1", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/cli-progress": "^3.11.5", "@types/express": "^4.17.21", @@ -56,6 +59,7 @@ "dotenv-expand": "^10.0.0", "express": "^4.19.2", "rimraf": "^5.0.1", + "rollup": "^4.24.3", "serialize-error": "^4.1.0", "source-map-support": "^0.5.21", "swagger-ui-express": "^5.0.0", @@ -65,13 +69,13 @@ "typescript-transform-paths": "^3.4.6" }, "dependencies": { - "@samchon/openapi": "^1.1.0", + "@samchon/openapi": "^1.1.2", "commander": "10.0.0", "inquirer": "8.2.5", "prettier": "^3.2.5", "tstl": "^3.0.0", "typescript": "^5.5.4", - "typia": "^6.11.0" + "typia": "^6.11.3" }, "files": [ "lib", diff --git a/packages/migrate/rollup.config.js b/packages/migrate/rollup.config.js new file mode 100644 index 000000000..f948ecc19 --- /dev/null +++ b/packages/migrate/rollup.config.js @@ -0,0 +1,29 @@ +const typescript = require("@rollup/plugin-typescript"); +const terser = require("@rollup/plugin-terser"); + +module.exports = { + input: "./src/index.ts", + output: { + dir: "lib", + format: "esm", + entryFileNames: "[name].mjs", + sourcemap: true, + }, + plugins: [ + typescript({ + tsconfig: "tsconfig.json", + module: "ES2020", + target: "ES2020", + }), + terser({ + format: { + comments: "some", + beautify: true, + ecma: "2020", + }, + compress: false, + mangle: false, + module: true, + }), + ], +}; diff --git a/packages/migrate/src/MigrateApplication.ts b/packages/migrate/src/MigrateApplication.ts index 93f93efd5..09ea26bad 100644 --- a/packages/migrate/src/MigrateApplication.ts +++ b/packages/migrate/src/MigrateApplication.ts @@ -14,14 +14,19 @@ import { IHttpMigrateProgram } from "./structures/IHttpMigrateProgram"; export class MigrateApplication { private constructor(public readonly document: OpenApi.IDocument) {} - public static async create( + public static create( document: | SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument | OpenApi.IDocument, - ): Promise> { - const result = typia.validate(document); + ): IValidation { + const result: IValidation< + | SwaggerV2.IDocument + | OpenApiV3.IDocument + | OpenApiV3_1.IDocument + | OpenApi.IDocument + > = typia.validate(document); if (result.success === false) return result; return { success: true, @@ -37,7 +42,7 @@ export class MigrateApplication { simulate: config.simulate, e2e: config.e2e, }); - return { + const output: MigrateApplication.IOutput = { program, files: [ ...NEST_TEMPLATE, @@ -47,6 +52,7 @@ export class MigrateApplication { ], errors: program.errors, }; + return this.finalize(config, output); } public sdk(config: MigrateApplication.IConfig): MigrateApplication.IOutput { @@ -56,7 +62,7 @@ export class MigrateApplication { simulate: config.simulate, e2e: config.e2e, }); - return { + const output: MigrateApplication.IOutput = { program, files: [ ...SDK_TEMPLATE, @@ -71,6 +77,21 @@ export class MigrateApplication { ], errors: program.errors, }; + return this.finalize(config, output); + } + + private finalize( + config: MigrateApplication.IConfig, + outupt: MigrateApplication.IOutput, + ): MigrateApplication.IOutput { + if (config.package) + outupt.files = outupt.files.map((file) => ({ + ...file, + content: file.content + .split(`@ORGANIZATION/PROJECT`) + .join(config.package), + })); + return outupt; } } export namespace MigrateApplication { @@ -82,5 +103,6 @@ export namespace MigrateApplication { export interface IConfig { simulate: boolean; e2e: boolean; + package?: string; } } diff --git a/packages/migrate/src/internal/MigrateCommander.ts b/packages/migrate/src/internal/MigrateCommander.ts index 7c0872e3f..23d90f2d8 100644 --- a/packages/migrate/src/internal/MigrateCommander.ts +++ b/packages/migrate/src/internal/MigrateCommander.ts @@ -45,7 +45,7 @@ export namespace MigrateCommander { })(); const result: IValidation = - await MigrateApplication.create(document); + MigrateApplication.create(document); if (result.success === false) { console.log(result.errors); throw new Error( diff --git a/packages/migrate/src/internal/MigrateInquirer.ts b/packages/migrate/src/internal/MigrateInquirer.ts index d7f150994..8a5ded1b0 100644 --- a/packages/migrate/src/internal/MigrateInquirer.ts +++ b/packages/migrate/src/internal/MigrateInquirer.ts @@ -8,6 +8,7 @@ export namespace MigrateInquirer { output: string; simulate: boolean; e2e: boolean; + package: string; } export const parse = async (): Promise => { @@ -20,6 +21,7 @@ export namespace MigrateInquirer { commander.program.option("--output [directory]", "output directory path"); commander.program.option("--simulate", "Mockup simulator"); commander.program.option("--e2e [boolean]", "Generate E2E tests"); + commander.program.option("--package [name]", "Package name"); // INTERNAL PROCEDURES const questioned = { value: false }; @@ -69,6 +71,7 @@ export namespace MigrateInquirer { ); partial.input ??= await input("input")("Swagger file location"); partial.output ??= await input("output")("Output directory path"); + partial.package ??= await input("package")("Package name"); if (partial.simulate) partial.simulate = (partial.simulate as any) === "true"; else diff --git a/packages/migrate/src/test/index.ts b/packages/migrate/src/test/index.ts index 42aa64e77..0caa18fbd 100644 --- a/packages/migrate/src/test/index.ts +++ b/packages/migrate/src/test/index.ts @@ -49,7 +49,15 @@ const execute = const app: MigrateApplication = result.data; const { files } = - config.mode === "nest" ? app.nest(config) : app.sdk(config); + config.mode === "nest" + ? app.nest({ + ...config, + package: project, + }) + : app.sdk({ + ...config, + package: project, + }); await MigrateFileArchiver.archive({ mkdir: fs.promises.mkdir, @@ -91,13 +99,12 @@ const iterate = async (directory: string): Promise => { ["nest", true], ["sdk", true], ["sdk", false], - ] as const) { + ] as const) await execute({ mode, simulate: flag, e2e: flag, })(project)(document); - } } } }; diff --git a/website/package-lock.json b/website/package-lock.json index 25803d2c5..9803a1e5c 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -14,7 +14,7 @@ "@mui/icons-material": "5.15.6", "@mui/material": "5.15.6", "@mui/system": "5.15.6", - "@nestia/editor": "^0.5.1", + "@nestia/editor": "^0.6.1", "jszip": "^3.10.1", "next": "14.2.13", "nextra": "^2.13.4", @@ -1069,12 +1069,12 @@ } }, "node_modules/@nestia/editor": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@nestia/editor/-/editor-0.5.1.tgz", - "integrity": "sha512-95VEBe3Hp5/0H89WMgaCmm3Ck+857TSTTmcqWWSnBZ3aSJAFTMapyhZFmaYXjL3aAydTgbHyidS11YXx0lhVog==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@nestia/editor/-/editor-0.6.1.tgz", + "integrity": "sha512-cPzTfi2V/ncKkcH12bga4TZo7am7nXGNypM5MG/9No8ps0NUYMeYXkxl+xlH8Q6VwHVuoe9bYfUCB/PqLWULsg==", "dependencies": { "@mui/material": "^5.15.6", - "@nestia/migrate": "^0.18.2", + "@nestia/migrate": "^0.19.0", "@stackblitz/sdk": "^1.11.0", "js-yaml": "^4.1.0", "prettier": "^3.3.3", @@ -1083,17 +1083,17 @@ } }, "node_modules/@nestia/migrate": { - "version": "0.18.2", - "resolved": "https://registry.npmjs.org/@nestia/migrate/-/migrate-0.18.2.tgz", - "integrity": "sha512-HtcNBzmWn1N7O6OOo5klonSbrlBfKk5JIzkFdtrXkvscwhualjEHeXESYpI2JHcx1q9l7ddsaErcZm54blXP2A==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@nestia/migrate/-/migrate-0.19.0.tgz", + "integrity": "sha512-tiyAMekErvBV9dIYfpXeI2NUbT3VMyD9SPIBfJUCHmxxl42xxQ2eysjuSt0dnneU4s+7gstTblL+yrjKPATMlw==", "dependencies": { - "@samchon/openapi": "^1.0.2", + "@samchon/openapi": "^1.1.2", "commander": "10.0.0", "inquirer": "8.2.5", "prettier": "^3.2.5", "tstl": "^3.0.0", "typescript": "^5.5.4", - "typia": "^6.10.0" + "typia": "^6.11.3" }, "bin": { "migrate": "lib/executable/migrate.js" diff --git a/website/package.json b/website/package.json index e604a543b..634291366 100644 --- a/website/package.json +++ b/website/package.json @@ -23,8 +23,7 @@ "@mui/icons-material": "5.15.6", "@mui/material": "5.15.6", "@mui/system": "5.15.6", - "@nestia/editor": "^0.5.1", - "jszip": "^3.10.1", + "@nestia/editor": "^0.6.2", "next": "14.2.13", "nextra": "^2.13.4", "nextra-theme-docs": "^2.13.4", @@ -35,6 +34,7 @@ "@types/node": "18.11.10", "@types/react": "18.0.35", "gh-pages": "^5.0.0", + "jszip": "^3.10.1", "next-sitemap": "^4.2.3", "rimraf": "^5.0.0", "ts-node": "^10.9.2", diff --git a/website/pages/docs/editor.mdx b/website/pages/docs/editor.mdx index 97d4cda2a..67715eb05 100644 --- a/website/pages/docs/editor.mdx +++ b/website/pages/docs/editor.mdx @@ -23,7 +23,7 @@ Here are the some example projects generated by `@nestia/editor`. Traveling thos
    {EDITOR_EXAMPLES.map((example) => (
  • - {example.title} @@ -47,7 +47,10 @@ import { SwaggerV2, OpenApiV3, OpenApiV3_1 } from "@samchon/openapi"; const document: SwaggerV2 | OpenApiV3 | OpenApiV3_1; - + ``` @@ -70,16 +73,38 @@ Unzip and place your `swagger.json` file into the extracted directory. Just download unzip the above [`editor.zip`](/downloads/editor.zip) file, and place your `swagger.json` (or `swagger.yaml`) file into the extracted directory. When you open the unzipped `index.html` in your browser, you can see the `@nestia/editor` is serving the "TypeScript Swagger Editor" application with your `swagger.json` (or `swagger.yaml`) file. -Also, if you want to activate the Mockup Simulator or automatic e2e test functions' generation, guide the users to fill the `simulate` and `e2e` query parameters with `true` in the URL address like `http://localhost/?simulate=true&e2e=true`. +Also, if you want to specify the package name, or activate the Mockup Simulator, open the `index.html` file of unzipped and edit some variables like below. Guiding the users th fill these `package`, `simulate` and `e2e` query parameters like `http://localhost/?simulate=true&e2e=true` can be an alternative way. By the way, if you do not place the `swagger.json` (or `swagger.yaml`) file into the directory, the `@nestia/editor` will just show you the "Swagger File Uploader" (`NestiaEditorUploader`) instead. +```html filename="editor/index.html" showLineNumbers {14-16} + + + + + Nestia Editor + + + +
    + + + +``` + ## ` + ``` You also can embed the `@nestia/editor` with static URL address. @@ -94,7 +119,7 @@ If you wanna see the example cases of the `