@nestia/editor 14.0.0 → 14.0.2
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/README.md +1 -1
- package/dist/assets/{index-C1g1lYbd.js → index-rFcfd8RQ.js} +138 -137
- package/dist/index.html +1 -1
- package/lib/NestiaEditorApplication.d.ts +10 -0
- package/lib/NestiaEditorApplication.js +20 -4
- package/lib/NestiaEditorApplication.js.map +1 -1
- package/lib/NestiaEditorApplication.mjs +17 -1
- package/lib/NestiaEditorIframe.d.ts +31 -0
- package/lib/NestiaEditorIframe.js +22 -4
- package/lib/NestiaEditorIframe.js.map +1 -1
- package/lib/NestiaEditorIframe.mjs +49 -10
- package/lib/NestiaEditorModule.d.ts +46 -0
- package/lib/NestiaEditorModule.js +120 -30
- package/lib/NestiaEditorModule.js.map +1 -1
- package/lib/NestiaEditorModule.mjs +43 -23
- package/lib/NestiaEditorUploader.d.ts +19 -0
- package/lib/NestiaEditorUploader.js +15 -0
- package/lib/NestiaEditorUploader.js.map +1 -1
- package/lib/NestiaEditorUploader.mjs +18 -6
- package/lib/internal/NestiaEditorArchiver.d.ts +35 -3
- package/lib/internal/NestiaEditorArchiver.js +60 -8
- package/lib/internal/NestiaEditorArchiver.js.map +1 -1
- package/lib/internal/NestiaEditorArchiver.mjs +25 -5
- package/lib/internal/NestiaEditorComposer.d.ts +80 -0
- package/lib/internal/NestiaEditorComposer.js +33 -0
- package/lib/internal/NestiaEditorComposer.js.map +1 -1
- package/lib/internal/NestiaEditorComposer.mjs +8 -2
- package/lib/internal/NestiaEditorFileUploader.d.ts +21 -0
- package/lib/internal/NestiaEditorFileUploader.js +12 -0
- package/lib/internal/NestiaEditorFileUploader.js.map +1 -1
- package/lib/internal/NestiaEditorFileUploader.mjs +12 -0
- package/package.json +6 -5
- package/src/NestiaEditorApplication.tsx +19 -3
- package/src/NestiaEditorIframe.tsx +61 -6
- package/src/NestiaEditorModule.ts +139 -39
- package/src/NestiaEditorUploader.tsx +28 -0
- package/src/internal/NestiaEditorArchiver.ts +65 -10
- package/src/internal/NestiaEditorComposer.ts +96 -0
- package/src/internal/NestiaEditorFileUploader.tsx +21 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaEditorModule.js","sourceRoot":"","sources":["../src/NestiaEditorModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NestiaEditorModule.js","sourceRoot":"","sources":["../src/NestiaEditorModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAY,EAAE,+BAAW;AACzB,gDAAwB;AAExB,sFAAsF;AAEtF;;;;;;;;;;GAUG;AACH,IAAiB,kBAAkB,CAqHlC;AArHD,WAAiB,kBAAkB;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACU,wBAAK,GAAG,CAAO,KAY3B,EAAiB,EAAE;QAClB,MAAM,MAAM,GAAW,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC;aACpE,IAAI,CAAC,GAAG,CAAC;aACT,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;aACvB,IAAI,CAAC,EAAE,CAAC,CAAC;QACZ,MAAM,OAAO,GAAqB,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;QACrE,MAAM,KAAK,GAAW,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,WAAW,GAAkB;YACjC;gBACE,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,KAAK;aACf;YACD,GAAG,CAAC,MAAM,cAAc,CAAC,KAAK,CAAC,CA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,CAAC,CAAO,KAAK,EAAE,EAAE;QAAC,OAAA,CAAC;YACjC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CACjC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC/C,MAAM,CACP;SACF,CAAC,CAAA;IAAA,CAAC,CAAD,CAAC,CACJ,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,2EAA2E;AAC3E,MAAM,eAAe,GAAG,CACtB,WAA6B,EAC7B,QAAgB,EACC,EAAE;IACnB,OAAA,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC;QACnC,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAA;AAAA,CAAC,CAAD,CAAC;AAEzD,MAAM,UAAU,GAAG,CACjB,GAAW,EAGX,EAAE;IACF,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG;QACzB,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;IAClE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC,CAAA,CAAC"}
|
|
@@ -1,45 +1,65 @@
|
|
|
1
|
+
import { NESTIA_EDITOR_DEFAULT_PACKAGE } from "./internal/NestiaEditorDefaultPackage.mjs";
|
|
1
2
|
import * as fs from "fs";
|
|
3
|
+
import path from "path";
|
|
2
4
|
//#region src/NestiaEditorModule.ts
|
|
3
5
|
let NestiaEditorModule;
|
|
4
6
|
(function(_NestiaEditorModule) {
|
|
5
7
|
_NestiaEditorModule.setup = async (props) => {
|
|
6
|
-
const prefix =
|
|
8
|
+
const prefix = [getGlobalPrefix(props.application), props.path].join("/").split("/").filter((str) => str.length !== 0).map((str) => "/" + str).join("");
|
|
7
9
|
const adaptor = props.application.getHttpAdapter();
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
path: "/swagger.json",
|
|
16
|
-
type: "application/json",
|
|
17
|
-
content: JSON.stringify(typeof props.swagger === "string" ? await getSwagger(props.swagger) : props.swagger, null, 2)
|
|
18
|
-
},
|
|
19
|
-
await getJavaScript()
|
|
20
|
-
];
|
|
10
|
+
const index = await getIndex(props);
|
|
11
|
+
const staticFiles = [{
|
|
12
|
+
path: "/index.html",
|
|
13
|
+
type: "text/html",
|
|
14
|
+
content: index
|
|
15
|
+
}, ...await getJavaScripts(index)];
|
|
21
16
|
for (const f of staticFiles) adaptor.get(prefix + f.path, (_, res) => {
|
|
22
17
|
res.type(f.type);
|
|
23
18
|
return res.send(f.content);
|
|
24
19
|
});
|
|
25
|
-
|
|
20
|
+
let document = typeof props.swagger === "string" ? null : JSON.stringify(props.swagger, null, 2);
|
|
21
|
+
let pending = null;
|
|
22
|
+
adaptor.get(prefix + "/swagger.json", async (_, res) => {
|
|
23
|
+
try {
|
|
24
|
+
if (document === null) {
|
|
25
|
+
pending ??= (async () => JSON.stringify(await getSwagger(await resolveLocation(props.application, props.swagger)), null, 2))().finally(() => {
|
|
26
|
+
pending = null;
|
|
27
|
+
});
|
|
28
|
+
document = await pending;
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
res.status(502);
|
|
32
|
+
res.type("text/plain");
|
|
33
|
+
return res.send(error instanceof Error ? error.message : String(error));
|
|
34
|
+
}
|
|
35
|
+
res.type("application/json");
|
|
36
|
+
return res.send(document);
|
|
37
|
+
});
|
|
38
|
+
for (const p of prefix.length === 0 ? ["/"] : ["", "/"]) adaptor.get(prefix + p, (_, res) => {
|
|
26
39
|
return res.redirect(prefix + "/index.html");
|
|
27
40
|
});
|
|
28
41
|
};
|
|
29
42
|
const getGlobalPrefix = (app) => typeof app.config?.globalPrefix === "string" ? app.config.globalPrefix : "";
|
|
30
43
|
})(NestiaEditorModule || (NestiaEditorModule = {}));
|
|
31
44
|
const getIndex = async (props) => {
|
|
32
|
-
return (await fs.promises.readFile(`${__dirname}/../dist/index.html`, "utf8")).replace(
|
|
45
|
+
return (await fs.promises.readFile(`${__dirname}/../dist/index.html`, "utf8")).replace(JSON.stringify(NESTIA_EDITOR_DEFAULT_PACKAGE), () => JSON.stringify(props.package ?? "@ORGANIZATION/PROJECT")).replace("window.simulate = false", () => `window.simulate = ${!!props.simulate}`).replace("window.e2e = false", () => `window.e2e = ${!!props.e2e}`);
|
|
33
46
|
};
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
const getJavaScripts = async (index) => {
|
|
48
|
+
const scripts = /* @__PURE__ */ new Set();
|
|
49
|
+
for (const match of index.matchAll(/<script\b[^>]*\bsrc\s*=\s*(["'])(.*?)\1[^>]*>/gi)) {
|
|
50
|
+
const url = new URL(match[2], "https://nestia.invalid/");
|
|
51
|
+
if (url.origin !== "https://nestia.invalid" || url.pathname.startsWith("/assets/") === false || url.pathname.endsWith(".js") === false || url.search.length !== 0 || url.hash.length !== 0) throw new Error(`Unsupported editor script asset: ${match[2]}`);
|
|
52
|
+
scripts.add(url.pathname);
|
|
53
|
+
}
|
|
54
|
+
if (scripts.size === 0) throw new Error("The editor page references no JavaScript asset.");
|
|
55
|
+
return Promise.all([...scripts].map(async (asset) => ({
|
|
56
|
+
path: asset,
|
|
39
57
|
type: "application/javascript",
|
|
40
|
-
content: await fs.promises.readFile(
|
|
41
|
-
};
|
|
58
|
+
content: await fs.promises.readFile(path.join(__dirname, "../dist", asset.slice(1)), "utf8")
|
|
59
|
+
})));
|
|
42
60
|
};
|
|
61
|
+
/** An absolute URL as is; a path of the application at its own address. */
|
|
62
|
+
const resolveLocation = async (application, location) => /^[a-z][a-z\d+\-.]*:/i.test(location) ? location : new URL(location, await application.getUrl()).href;
|
|
43
63
|
const getSwagger = async (url) => {
|
|
44
64
|
const response = await fetch(url);
|
|
45
65
|
if (response.status !== 200) throw new Error(`Failed to fetch Swagger document from ${url}`);
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The uploader form: reads a Swagger file, and downloads the generated project.
|
|
3
|
+
*
|
|
4
|
+
* The user picks a document, a package name, the mode (SDK or NestJS project), and the options. The project is generated in the browser and downloaded as a zip file. Operations the converter could not handle are reported, so an incomplete project is never presented as complete.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation The form keeps its inputs in component state, composes on request with `NestiaEditorComposer`, and hands the files to `NestiaEditorArchiver`. Composition and archive failures, file-parser errors reported by the picker, and skipped operations reach the error handler. File-reading rejection belongs to the picker callback and is not caught by this form.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design One component owns the form state and delegates parsing the file, composing, and archiving to internal modules.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The defaults are the same product defaults as the iframe flow and the package name comes from the shared constant; an error goes to `onError` when given and to `alert` otherwise, with no fixture-specific path.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the inputs, the output, and how skipped operations are reported.
|
|
10
|
+
*/
|
|
1
11
|
export declare function NestiaEditorUploader(props: NestiaEditorUploader.IProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Properties of {@link NestiaEditorUploader}.
|
|
14
|
+
*
|
|
15
|
+
* @evidence contracts/common.md#principled-implementation The namespace holds the property type of the component with the same name, so the component and its inputs are one public identity.
|
|
16
|
+
* @evidence contracts/common.md#clear-and-simple-design It contains one interface with one optional callback.
|
|
17
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It adds no behavior; when the callback is absent the component reports errors with `alert`.
|
|
18
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the component the properties belong to.
|
|
19
|
+
*/
|
|
2
20
|
export declare namespace NestiaEditorUploader {
|
|
3
21
|
interface IProps {
|
|
22
|
+
/** Receives conversion errors and skipped-operation warnings; absent uses alert. */
|
|
4
23
|
onError?: (error: string) => void;
|
|
5
24
|
}
|
|
6
25
|
}
|
|
@@ -20,6 +20,16 @@ const NestiaEditorArchiver_1 = require("./internal/NestiaEditorArchiver");
|
|
|
20
20
|
const NestiaEditorComposer_1 = require("./internal/NestiaEditorComposer");
|
|
21
21
|
const NestiaEditorDefaultPackage_1 = require("./internal/NestiaEditorDefaultPackage");
|
|
22
22
|
const NestiaEditorFileUploader_1 = require("./internal/NestiaEditorFileUploader");
|
|
23
|
+
/**
|
|
24
|
+
* The uploader form: reads a Swagger file, and downloads the generated project.
|
|
25
|
+
*
|
|
26
|
+
* The user picks a document, a package name, the mode (SDK or NestJS project), and the options. The project is generated in the browser and downloaded as a zip file. Operations the converter could not handle are reported, so an incomplete project is never presented as complete.
|
|
27
|
+
*
|
|
28
|
+
* @evidence contracts/common.md#principled-implementation The form keeps its inputs in component state, composes on request with `NestiaEditorComposer`, and hands the files to `NestiaEditorArchiver`. Composition and archive failures, file-parser errors reported by the picker, and skipped operations reach the error handler. File-reading rejection belongs to the picker callback and is not caught by this form.
|
|
29
|
+
* @evidence contracts/common.md#clear-and-simple-design One component owns the form state and delegates parsing the file, composing, and archiving to internal modules.
|
|
30
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The defaults are the same product defaults as the iframe flow and the package name comes from the shared constant; an error goes to `onError` when given and to `alert` otherwise, with no fixture-specific path.
|
|
31
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the inputs, the output, and how skipped operations are reported.
|
|
32
|
+
*/
|
|
23
33
|
function NestiaEditorUploader(props) {
|
|
24
34
|
// PARAMETERS
|
|
25
35
|
const [mode, setMode] = react_1.default.useState("sdk");
|
|
@@ -58,6 +68,11 @@ function NestiaEditorUploader(props) {
|
|
|
58
68
|
name: NestiaEditorArchiver_1.NestiaEditorArchiver.name(name),
|
|
59
69
|
files: result.data.files,
|
|
60
70
|
});
|
|
71
|
+
if (result.data.skipped.length !== 0)
|
|
72
|
+
handleError([
|
|
73
|
+
"The project leaves out operations that could not be converted:",
|
|
74
|
+
...result.data.skipped.map((s) => ` - ${s.method} ${s.path}: ${s.messages.join(" ")}`),
|
|
75
|
+
].join("\n"));
|
|
61
76
|
}
|
|
62
77
|
else {
|
|
63
78
|
handleError(JSON.stringify(result.errors, null, 2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaEditorUploader.js","sourceRoot":"","sources":["../src/NestiaEditorUploader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CASuB;AAEvB,kDAA0B;AAE1B,0EAAuE;AACvE,0EAAuE;AACvE,sFAAsF;AACtF,kFAA+E;AAE/E,8BAAqC,KAAkC;IACrE,aAAa;IACb,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAiB,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,0DAA6B,CAAC,CAAC;IAEtE,SAAS;IACT,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAE5C,IAAI,CAAC,CAAC;IACR,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC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AAM,IAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAI,GAC/D,IACU,EACd,gCAAM,EACN,gCAAM,EACN,uBAAC,iBAAM,IACL,SAAS,EAAC,GAAG,EACb,SAAS,QACT,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,EAChD,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,YAExB,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB,GACzC,IACR,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import { NESTIA_EDITOR_DEFAULT_PACKAGE } from "./internal/NestiaEditorDefaultPackage.mjs";
|
|
1
2
|
import { NestiaEditorArchiver } from "./internal/NestiaEditorArchiver.mjs";
|
|
2
3
|
import { NestiaEditorComposer } from "./internal/NestiaEditorComposer.mjs";
|
|
3
|
-
import { NESTIA_EDITOR_DEFAULT_PACKAGE } from "./internal/NestiaEditorDefaultPackage.mjs";
|
|
4
4
|
import { NestiaEditorFileUploader } from "./internal/NestiaEditorFileUploader.mjs";
|
|
5
5
|
import { Button, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, Switch, TextField } from "@mui/material";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region src/NestiaEditorUploader.tsx
|
|
9
|
+
/**
|
|
10
|
+
* The uploader form: reads a Swagger file, and downloads the generated project.
|
|
11
|
+
*
|
|
12
|
+
* The user picks a document, a package name, the mode (SDK or NestJS project), and the options. The project is generated in the browser and downloaded as a zip file. Operations the converter could not handle are reported, so an incomplete project is never presented as complete.
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/common.md#principled-implementation The form keeps its inputs in component state, composes on request with `NestiaEditorComposer`, and hands the files to `NestiaEditorArchiver`. Composition and archive failures, file-parser errors reported by the picker, and skipped operations reach the error handler. File-reading rejection belongs to the picker callback and is not caught by this form.
|
|
15
|
+
* @evidence contracts/common.md#clear-and-simple-design One component owns the form state and delegates parsing the file, composing, and archiving to internal modules.
|
|
16
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The defaults are the same product defaults as the iframe flow and the package name comes from the shared constant; an error goes to `onError` when given and to `alert` otherwise, with no fixture-specific path.
|
|
17
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the inputs, the output, and how skipped operations are reported.
|
|
18
|
+
*/
|
|
9
19
|
function NestiaEditorUploader(props) {
|
|
10
20
|
const [mode, setMode] = React.useState("sdk");
|
|
11
21
|
const [keyword, setKeyword] = React.useState(true);
|
|
@@ -33,11 +43,13 @@ function NestiaEditorUploader(props) {
|
|
|
33
43
|
simulate,
|
|
34
44
|
package: name
|
|
35
45
|
});
|
|
36
|
-
if (result.success === true)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
if (result.success === true) {
|
|
47
|
+
NestiaEditorArchiver.download({
|
|
48
|
+
name: NestiaEditorArchiver.name(name),
|
|
49
|
+
files: result.data.files
|
|
50
|
+
});
|
|
51
|
+
if (result.data.skipped.length !== 0) handleError(["The project leaves out operations that could not be converted:", ...result.data.skipped.map((s) => ` - ${s.method} ${s.path}: ${s.messages.join(" ")}`)].join("\n"));
|
|
52
|
+
} else handleError(JSON.stringify(result.errors, null, 2));
|
|
41
53
|
} catch (exp) {
|
|
42
54
|
handleError(exp instanceof Error ? exp.message : "unknown error");
|
|
43
55
|
}
|
|
@@ -6,13 +6,45 @@
|
|
|
6
6
|
* WebContainer cannot execute. The editor therefore delivers the composed
|
|
7
7
|
* project as a downloadable zip archive instead of an embedded StackBlitz
|
|
8
8
|
* workspace.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation Packing is a synchronous zip of UTF-8 encoded entries through `fflate`, naming derives from the package name with a fixed character whitelist, and the download creates an object URL, clicks an anchor, and revokes the URL later.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design Three operations, each one browser or zip concern, in one namespace with no shared state.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The archive is built with the library's public functions and the download uses the standard anchor mechanism; nothing is patched.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation The namespace prose explains why the editor delivers a zip archive rather than an embedded workspace.
|
|
9
14
|
*/
|
|
10
15
|
export declare namespace NestiaEditorArchiver {
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Pack the composed project files into a zip archive.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/common.md#principled-implementation Each own file key names a synchronous ZipDeflate stream added to Zip. Filenames are values rather than dictionary properties, preserving prototype-related names without changing an object's prototype. UTF-8 encoding preserves text; ending the archive emits its directory, including for an empty project.
|
|
20
|
+
* @evidence contracts/common.md#clear-and-simple-design One loop supplies files to the public synchronous compression streams; the callback collects chunks which are copied once into the returned archive.
|
|
21
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It archives exactly the given files; no entry is added, filtered, or renamed.
|
|
22
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the input and output.
|
|
23
|
+
*/
|
|
12
24
|
const pack: (files: Record<string, string>) => Uint8Array;
|
|
13
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Compose a safe archive file name from a package name.
|
|
27
|
+
*
|
|
28
|
+
* A leading `@` is dropped and every run of characters outside letters,
|
|
29
|
+
* digits, `.`, `_`, and `-` becomes one `-`. A name with nothing left but
|
|
30
|
+
* dots, such as an empty package name, has no usable base for the archive, so
|
|
31
|
+
* the default package name is used instead. Other names retain their dots,
|
|
32
|
+
* including a leading dot.
|
|
33
|
+
*
|
|
34
|
+
* @evidence contracts/common.md#principled-implementation Dropping the `@` and replacing runs of characters outside the whitelist with one `-` yields a file name without path separators. Empty or dots-only bases use the default package name; otherwise dots are retained, so this is not a general rejection of hidden filenames or a validator of npm package names.
|
|
35
|
+
* @evidence contracts/common.md#clear-and-simple-design One private helper applies the character rule to the package name and to the default, so the rule exists once.
|
|
36
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule applies to every input; the only special case is the empty-name guard, which follows from the safe-name requirement.
|
|
37
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the character rule and the dots-only fallback.
|
|
38
|
+
*/
|
|
14
39
|
const name: (packageName: string) => string;
|
|
15
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Trigger a browser download of the packed archive.
|
|
42
|
+
*
|
|
43
|
+
* @evidence contracts/common.md#principled-implementation A Blob of the packed bytes is exposed through an object URL and an anchor with the `download` attribute is clicked, which is the browser's standard way to save generated content; the URL is revoked after 30 seconds so its memory is released.
|
|
44
|
+
* @evidence contracts/common.md#clear-and-simple-design One function, kept apart from `pack` so packing stays testable outside a browser.
|
|
45
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It uses the standard DOM and URL APIs; the delayed revocation is not a retry or a compensation.
|
|
46
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states that it triggers a browser download of the packed archive.
|
|
47
|
+
*/
|
|
16
48
|
const download: (props: {
|
|
17
49
|
name: string;
|
|
18
50
|
files: Record<string, string>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NestiaEditorArchiver = void 0;
|
|
4
4
|
const fflate_1 = require("fflate");
|
|
5
|
+
const NestiaEditorDefaultPackage_1 = require("./NestiaEditorDefaultPackage");
|
|
5
6
|
/**
|
|
6
7
|
* Archives a composed project into a zip file and hands it to the browser.
|
|
7
8
|
*
|
|
@@ -10,19 +11,70 @@ const fflate_1 = require("fflate");
|
|
|
10
11
|
* WebContainer cannot execute. The editor therefore delivers the composed
|
|
11
12
|
* project as a downloadable zip archive instead of an embedded StackBlitz
|
|
12
13
|
* workspace.
|
|
14
|
+
*
|
|
15
|
+
* @evidence contracts/common.md#principled-implementation Packing is a synchronous zip of UTF-8 encoded entries through `fflate`, naming derives from the package name with a fixed character whitelist, and the download creates an object URL, clicks an anchor, and revokes the URL later.
|
|
16
|
+
* @evidence contracts/common.md#clear-and-simple-design Three operations, each one browser or zip concern, in one namespace with no shared state.
|
|
17
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The archive is built with the library's public functions and the download uses the standard anchor mechanism; nothing is patched.
|
|
18
|
+
* @evidence contracts/common.md#meaningful-documentation The namespace prose explains why the editor delivers a zip archive rather than an embedded workspace.
|
|
13
19
|
*/
|
|
14
20
|
var NestiaEditorArchiver;
|
|
15
21
|
(function (NestiaEditorArchiver) {
|
|
16
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Pack the composed project files into a zip archive.
|
|
24
|
+
*
|
|
25
|
+
* @evidence contracts/common.md#principled-implementation Each own file key names a synchronous ZipDeflate stream added to Zip. Filenames are values rather than dictionary properties, preserving prototype-related names without changing an object's prototype. UTF-8 encoding preserves text; ending the archive emits its directory, including for an empty project.
|
|
26
|
+
* @evidence contracts/common.md#clear-and-simple-design One loop supplies files to the public synchronous compression streams; the callback collects chunks which are copied once into the returned archive.
|
|
27
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It archives exactly the given files; no entry is added, filtered, or renamed.
|
|
28
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the input and output.
|
|
29
|
+
*/
|
|
17
30
|
NestiaEditorArchiver.pack = (files) => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
const chunks = [];
|
|
32
|
+
const archive = new fflate_1.Zip((error, chunk) => {
|
|
33
|
+
if (error)
|
|
34
|
+
throw error;
|
|
35
|
+
chunks.push(chunk);
|
|
36
|
+
});
|
|
37
|
+
for (const [key, value] of Object.entries(files)) {
|
|
38
|
+
const entry = new fflate_1.ZipDeflate(key);
|
|
39
|
+
archive.add(entry);
|
|
40
|
+
entry.push((0, fflate_1.strToU8)(value), true);
|
|
41
|
+
}
|
|
42
|
+
archive.end();
|
|
43
|
+
const output = new Uint8Array(chunks.reduce((length, chunk) => length + chunk.length, 0));
|
|
44
|
+
let offset = 0;
|
|
45
|
+
for (const chunk of chunks) {
|
|
46
|
+
output.set(chunk, offset);
|
|
47
|
+
offset += chunk.length;
|
|
48
|
+
}
|
|
49
|
+
return output;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Compose a safe archive file name from a package name.
|
|
53
|
+
*
|
|
54
|
+
* A leading `@` is dropped and every run of characters outside letters,
|
|
55
|
+
* digits, `.`, `_`, and `-` becomes one `-`. A name with nothing left but
|
|
56
|
+
* dots, such as an empty package name, has no usable base for the archive, so
|
|
57
|
+
* the default package name is used instead. Other names retain their dots,
|
|
58
|
+
* including a leading dot.
|
|
59
|
+
*
|
|
60
|
+
* @evidence contracts/common.md#principled-implementation Dropping the `@` and replacing runs of characters outside the whitelist with one `-` yields a file name without path separators. Empty or dots-only bases use the default package name; otherwise dots are retained, so this is not a general rejection of hidden filenames or a validator of npm package names.
|
|
61
|
+
* @evidence contracts/common.md#clear-and-simple-design One private helper applies the character rule to the package name and to the default, so the rule exists once.
|
|
62
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule applies to every input; the only special case is the empty-name guard, which follows from the safe-name requirement.
|
|
63
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the character rule and the dots-only fallback.
|
|
64
|
+
*/
|
|
65
|
+
NestiaEditorArchiver.name = (packageName) => {
|
|
66
|
+
const base = compose(packageName);
|
|
67
|
+
return `${/^\.*$/.test(base) ? compose(NestiaEditorDefaultPackage_1.NESTIA_EDITOR_DEFAULT_PACKAGE) : base}.zip`;
|
|
22
68
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
69
|
+
const compose = (packageName) => packageName.replace(/^@/, "").replace(/[^A-Za-z0-9._-]+/g, "-");
|
|
70
|
+
/**
|
|
71
|
+
* Trigger a browser download of the packed archive.
|
|
72
|
+
*
|
|
73
|
+
* @evidence contracts/common.md#principled-implementation A Blob of the packed bytes is exposed through an object URL and an anchor with the `download` attribute is clicked, which is the browser's standard way to save generated content; the URL is revoked after 30 seconds so its memory is released.
|
|
74
|
+
* @evidence contracts/common.md#clear-and-simple-design One function, kept apart from `pack` so packing stays testable outside a browser.
|
|
75
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It uses the standard DOM and URL APIs; the delayed revocation is not a retry or a compensation.
|
|
76
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states that it triggers a browser download of the packed archive.
|
|
77
|
+
*/
|
|
26
78
|
NestiaEditorArchiver.download = (props) => {
|
|
27
79
|
const blob = new Blob([NestiaEditorArchiver.pack(props.files)], {
|
|
28
80
|
type: "application/zip",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaEditorArchiver.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorArchiver.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"NestiaEditorArchiver.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorArchiver.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAElD,6EAA6E;AAE7E;;;;;;;;;;;;;GAaG;AACH,IAAiB,oBAAoB,CA+EpC;AA/ED,WAAiB,oBAAoB;IACnC;;;;;;;OAOG;IACU,yBAAI,GAAG,CAAC,KAA6B,EAAc,EAAE;QAChE,MAAM,MAAM,GAAiB,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,IAAI,YAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACvC,IAAI,KAAK;gBAAE,MAAM,KAAK,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,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,CAAC,KAAK,CAAC,KAAK,CAA4B,CAAC,EAC9C;YACE,IAAI,EAAE,iBAAiB;SACxB,CACF,CAAC;QACF,MAAM,GAAG,GAAW,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAsB,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACrE,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;QAClB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC;QAC7B,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,KAAM,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC,EA/EgB,oBAAoB,aAApB,oBAAoB,GAApB,oBAAoB,QA+EpC"}
|
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NESTIA_EDITOR_DEFAULT_PACKAGE } from "./NestiaEditorDefaultPackage.mjs";
|
|
2
|
+
import { Zip, ZipDeflate, strToU8 } from "fflate";
|
|
2
3
|
//#region src/internal/NestiaEditorArchiver.ts
|
|
3
4
|
let NestiaEditorArchiver;
|
|
4
5
|
(function(_NestiaEditorArchiver) {
|
|
5
6
|
const pack = _NestiaEditorArchiver.pack = (files) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const chunks = [];
|
|
8
|
+
const archive = new Zip((error, chunk) => {
|
|
9
|
+
if (error) throw error;
|
|
10
|
+
chunks.push(chunk);
|
|
11
|
+
});
|
|
12
|
+
for (const [key, value] of Object.entries(files)) {
|
|
13
|
+
const entry = new ZipDeflate(key);
|
|
14
|
+
archive.add(entry);
|
|
15
|
+
entry.push(strToU8(value), true);
|
|
16
|
+
}
|
|
17
|
+
archive.end();
|
|
18
|
+
const output = new Uint8Array(chunks.reduce((length, chunk) => length + chunk.length, 0));
|
|
19
|
+
let offset = 0;
|
|
20
|
+
for (const chunk of chunks) {
|
|
21
|
+
output.set(chunk, offset);
|
|
22
|
+
offset += chunk.length;
|
|
23
|
+
}
|
|
24
|
+
return output;
|
|
9
25
|
};
|
|
10
|
-
_NestiaEditorArchiver.name = (packageName) =>
|
|
26
|
+
_NestiaEditorArchiver.name = (packageName) => {
|
|
27
|
+
const base = compose(packageName);
|
|
28
|
+
return `${/^\.*$/.test(base) ? compose(NESTIA_EDITOR_DEFAULT_PACKAGE) : base}.zip`;
|
|
29
|
+
};
|
|
30
|
+
const compose = (packageName) => packageName.replace(/^@/, "").replace(/[^A-Za-z0-9._-]+/g, "-");
|
|
11
31
|
_NestiaEditorArchiver.download = (props) => {
|
|
12
32
|
const blob = new Blob([pack(props.files)], { type: "application/zip" });
|
|
13
33
|
const url = URL.createObjectURL(blob);
|
|
@@ -1,18 +1,98 @@
|
|
|
1
1
|
import { OpenApiV3, OpenApiV3_1, OpenApiV3_2, SwaggerV2 } from "@typia/interface";
|
|
2
2
|
import { IValidation } from "typia";
|
|
3
|
+
/**
|
|
4
|
+
* Composes the files of a project from an OpenAPI document.
|
|
5
|
+
*
|
|
6
|
+
* It validates and converts the document with `@nestia/migrate`, then formats
|
|
7
|
+
* the TypeScript files with Prettier's standalone build.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The composer delegates conversion to `NestiaMigrateApplication`, which owns the OpenAPI semantics, and formats each `.ts` output with Prettier; a file that fails to format keeps its unformatted text.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One namespace with two public entry points that select the migration mode and retain the legacy workspace launch metadata; the shared flow is one private curried function.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Conversion and formatting use the public APIs of `@nestia/migrate` and Prettier; a formatting failure is logged and the file is kept as generated.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the composer produces and which libraries do the work.
|
|
13
|
+
*/
|
|
3
14
|
export declare namespace NestiaEditorComposer {
|
|
15
|
+
/**
|
|
16
|
+
* Input of the composer: the OpenAPI document, the generator options, and the
|
|
17
|
+
* package name.
|
|
18
|
+
*
|
|
19
|
+
* The internal `files` member bypasses conversion and returns the given files
|
|
20
|
+
* unchanged.
|
|
21
|
+
*
|
|
22
|
+
* @evidence contracts/common.md#principled-implementation The fields are the migrate options the editor exposes plus the document, and `files` lets a caller supply an already composed project.
|
|
23
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat property record; the document type is the union of the supported OpenAPI and Swagger versions.
|
|
24
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No field is defaulted here; the callers own the defaults.
|
|
25
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the inputs and the internal member.
|
|
26
|
+
*/
|
|
4
27
|
interface IProps {
|
|
28
|
+
/** OpenAPI or Swagger source to validate before conversion. */
|
|
5
29
|
document: SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument | OpenApiV3_2.IDocument;
|
|
30
|
+
/** Include generated E2E functions. */
|
|
6
31
|
e2e: boolean;
|
|
32
|
+
/** Group generated parameters into a keyword object. */
|
|
7
33
|
keyword: boolean;
|
|
34
|
+
/** Include SDK mockup simulators. */
|
|
8
35
|
simulate: boolean;
|
|
36
|
+
/** Package identity passed to the migration generator. */
|
|
9
37
|
package?: string;
|
|
10
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Output of the composer: the files, the files to open, the start script, and
|
|
41
|
+
* the skipped operations.
|
|
42
|
+
*
|
|
43
|
+
* @evidence contracts/common.md#principled-implementation The files carry the downloadable project and skipped exposes incomplete conversion. openFile and startScript are legacy workspace metadata with no reader in the current zip UI.
|
|
44
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat property record without behavior.
|
|
45
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Every member is produced by the composer or the migrate application; none is a fixture value.
|
|
46
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the members and the `skipped` member documents itself.
|
|
47
|
+
*/
|
|
11
48
|
interface IOutput {
|
|
49
|
+
/** Relative project paths mapped to UTF-8 text. */
|
|
12
50
|
files: Record<string, string>;
|
|
51
|
+
/** Legacy comma-separated workspace editor entry paths. */
|
|
13
52
|
openFile: string;
|
|
53
|
+
/** Legacy workspace launch commands; zip downloads do not execute them. */
|
|
14
54
|
startScript: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Operations `@nestia/migrate` could not convert, left out of the files.
|
|
57
|
+
*
|
|
58
|
+
* The CLI prints them; the editor reports them to its user, so a project
|
|
59
|
+
* lacking an operation never passes for a complete one.
|
|
60
|
+
*/
|
|
61
|
+
skipped: ISkipped[];
|
|
15
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* An operation that could not be converted: its upper-case HTTP method, its
|
|
65
|
+
* path, and the reasons.
|
|
66
|
+
*
|
|
67
|
+
* @evidence contracts/common.md#principled-implementation The migrate application reports errors by method, path, and messages, and the composer normalizes the method to upper case for display.
|
|
68
|
+
* @evidence contracts/common.md#clear-and-simple-design Three fields with no behavior.
|
|
69
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The values are copied from the migrate errors.
|
|
70
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states each field.
|
|
71
|
+
*/
|
|
72
|
+
interface ISkipped {
|
|
73
|
+
/** Upper-case HTTP method identifying the omitted operation. */
|
|
74
|
+
method: string;
|
|
75
|
+
/** OpenAPI path identifying the omitted operation. */
|
|
76
|
+
path: string;
|
|
77
|
+
/** Conversion diagnostics supplied by the migrate application. */
|
|
78
|
+
messages: string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Composes a NestJS project from an OpenAPI document.
|
|
82
|
+
*
|
|
83
|
+
* @evidence contracts/common.md#principled-implementation It runs the shared flow with the migrate application's `nest` output, the `README.md,test/start.ts` files to open, and the `build:test,test` start script.
|
|
84
|
+
* @evidence contracts/common.md#clear-and-simple-design A one-expression binding of the shared flow.
|
|
85
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The mode selects the public migrate operation. Returned launch metadata comes from the former embedded workspace flow; zip delivery does not read or execute it.
|
|
86
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the project kind produced.
|
|
87
|
+
*/
|
|
16
88
|
const nest: (props: IProps) => Promise<IValidation<IOutput>>;
|
|
89
|
+
/**
|
|
90
|
+
* Composes a software development kit project from an OpenAPI document.
|
|
91
|
+
*
|
|
92
|
+
* @evidence contracts/common.md#principled-implementation It runs the shared flow with the migrate application's `sdk` output, the `README.md,test/start.ts` files to open, and the `swagger` and `hello` start scripts.
|
|
93
|
+
* @evidence contracts/common.md#clear-and-simple-design A one-expression binding of the shared flow.
|
|
94
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The mode selects the public migrate operation. Returned launch metadata comes from the former embedded workspace flow; zip delivery does not read or execute it.
|
|
95
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the project kind produced.
|
|
96
|
+
*/
|
|
17
97
|
const sdk: (props: IProps) => Promise<IValidation<IOutput>>;
|
|
18
98
|
}
|
|
@@ -50,13 +50,40 @@ const migrate_1 = __importDefault(require("@nestia/migrate"));
|
|
|
50
50
|
const prettierEsTreePlugin = __importStar(require("prettier/plugins/estree"));
|
|
51
51
|
const prettierTsPlugin = __importStar(require("prettier/plugins/typescript"));
|
|
52
52
|
const standalone_1 = require("prettier/standalone");
|
|
53
|
+
/**
|
|
54
|
+
* Composes the files of a project from an OpenAPI document.
|
|
55
|
+
*
|
|
56
|
+
* It validates and converts the document with `@nestia/migrate`, then formats
|
|
57
|
+
* the TypeScript files with Prettier's standalone build.
|
|
58
|
+
*
|
|
59
|
+
* @evidence contracts/common.md#principled-implementation The composer delegates conversion to `NestiaMigrateApplication`, which owns the OpenAPI semantics, and formats each `.ts` output with Prettier; a file that fails to format keeps its unformatted text.
|
|
60
|
+
* @evidence contracts/common.md#clear-and-simple-design One namespace with two public entry points that select the migration mode and retain the legacy workspace launch metadata; the shared flow is one private curried function.
|
|
61
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Conversion and formatting use the public APIs of `@nestia/migrate` and Prettier; a formatting failure is logged and the file is kept as generated.
|
|
62
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the composer produces and which libraries do the work.
|
|
63
|
+
*/
|
|
53
64
|
var NestiaEditorComposer;
|
|
54
65
|
(function (NestiaEditorComposer) {
|
|
66
|
+
/**
|
|
67
|
+
* Composes a NestJS project from an OpenAPI document.
|
|
68
|
+
*
|
|
69
|
+
* @evidence contracts/common.md#principled-implementation It runs the shared flow with the migrate application's `nest` output, the `README.md,test/start.ts` files to open, and the `build:test,test` start script.
|
|
70
|
+
* @evidence contracts/common.md#clear-and-simple-design A one-expression binding of the shared flow.
|
|
71
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The mode selects the public migrate operation. Returned launch metadata comes from the former embedded workspace flow; zip delivery does not read or execute it.
|
|
72
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the project kind produced.
|
|
73
|
+
*/
|
|
55
74
|
NestiaEditorComposer.nest = (props) => compose({
|
|
56
75
|
openFile: "README.md,test/start.ts",
|
|
57
76
|
startScript: ["build:test,test", ""],
|
|
58
77
|
migrate: (app) => app.nest(props),
|
|
59
78
|
})(props);
|
|
79
|
+
/**
|
|
80
|
+
* Composes a software development kit project from an OpenAPI document.
|
|
81
|
+
*
|
|
82
|
+
* @evidence contracts/common.md#principled-implementation It runs the shared flow with the migrate application's `sdk` output, the `README.md,test/start.ts` files to open, and the `swagger` and `hello` start scripts.
|
|
83
|
+
* @evidence contracts/common.md#clear-and-simple-design A one-expression binding of the shared flow.
|
|
84
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The mode selects the public migrate operation. Returned launch metadata comes from the former embedded workspace flow; zip delivery does not read or execute it.
|
|
85
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the project kind produced.
|
|
86
|
+
*/
|
|
60
87
|
NestiaEditorComposer.sdk = (props) => __awaiter(this, void 0, void 0, function* () {
|
|
61
88
|
return compose({
|
|
62
89
|
openFile: "README.md,test/start.ts",
|
|
@@ -72,6 +99,7 @@ var NestiaEditorComposer;
|
|
|
72
99
|
files: props.files,
|
|
73
100
|
openFile: config.openFile,
|
|
74
101
|
startScript: config.startScript,
|
|
102
|
+
skipped: [],
|
|
75
103
|
},
|
|
76
104
|
};
|
|
77
105
|
const result = yield migrate_1.default.NestiaMigrateApplication.validate(props.document);
|
|
@@ -96,6 +124,11 @@ var NestiaEditorComposer;
|
|
|
96
124
|
files,
|
|
97
125
|
openFile: config.openFile,
|
|
98
126
|
startScript: config.startScript,
|
|
127
|
+
skipped: app.getData().errors.map((error) => ({
|
|
128
|
+
method: error.method.toUpperCase(),
|
|
129
|
+
path: error.path,
|
|
130
|
+
messages: error.messages,
|
|
131
|
+
})),
|
|
99
132
|
},
|
|
100
133
|
};
|
|
101
134
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaEditorComposer.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorComposer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAsC;AAQtC,MAAY,oBAAoB,oDAAgC;AAChE,MAAY,gBAAgB,wDAAoC;AAChE,oDAA6C;AAG7C,IAAiB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"NestiaEditorComposer.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorComposer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAsC;AAQtC,MAAY,oBAAoB,oDAAgC;AAChE,MAAY,gBAAgB,wDAAoC;AAChE,oDAA6C;AAG7C;;;;;;;;;;GAUG;AACH,IAAiB,oBAAoB,CAgKpC;AAhKD,WAAiB,oBAAoB;IAmFnC;;;;;;;OAOG;IACU,yBAAI,GAAG,CAAC,KAAa,EAAiC,EAAE,CACnE,OAAO,CAAC;QACN,QAAQ,E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