@nestia/editor 0.6.0-dev.20241030-6 → 0.6.0-dev.20241101

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/editor",
3
- "version": "0.6.0-dev.20241030-6",
3
+ "version": "0.6.0-dev.20241101",
4
4
  "typings": "lib/index.d.ts",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "homepage": "https://nestia.io",
34
34
  "dependencies": {
35
35
  "@mui/material": "^5.15.6",
36
- "@nestia/migrate": "^0.18.2",
36
+ "@nestia/migrate": "^0.19.0-dev.20241101",
37
37
  "@stackblitz/sdk": "^1.11.0",
38
38
  "js-yaml": "^4.1.0",
39
39
  "prettier": "^3.3.3",
@@ -23,6 +23,7 @@ export function NestiaEditorApplication() {
23
23
  return asset !== null ? (
24
24
  <NestiaEditorIframe
25
25
  swagger={asset.url}
26
+ package={asset.package}
26
27
  simulate={asset.simulate}
27
28
  e2e={asset.e2e}
28
29
  />
@@ -51,15 +52,21 @@ async function getAsset(): Promise<IAsset | null> {
51
52
  (await findSwagger("./swagger.yaml"));
52
53
  if (url === null) return null;
53
54
 
54
- const simulate: string | null = query.get("simulate");
55
- const e2e: string | null = query.get("e2e");
56
55
  const mode: string | null = query.get("mode");
56
+ const packageName: string | null =
57
+ query.get("package") ?? (window as any).package;
58
+ const simulate: boolean | string | null =
59
+ query.get("simulate") ?? (window as any).simulate;
60
+ const e2e: boolean | string | null = query.get("e2e") ?? (window as any).e2e;
57
61
  return {
62
+ mode: mode === "nest" ? "nest" : "sdk",
63
+ package: packageName ?? "@ORGANIZATION/PROJECT",
58
64
  url,
59
65
  simulate:
60
- simulate !== null ? simulate === "true" || simulate === "1" : false,
61
- e2e: e2e !== null ? e2e === "true" || e2e === "1" : false,
62
- mode: mode === "nest" ? "nest" : "sdk",
66
+ simulate !== null
67
+ ? simulate === true || simulate === "true" || simulate === "1"
68
+ : false,
69
+ e2e: e2e !== null ? e2e === true || e2e === "true" || e2e === "1" : false,
63
70
  };
64
71
  }
65
72
 
@@ -69,8 +76,9 @@ async function findSwagger(file: string): Promise<string | null> {
69
76
  }
70
77
 
71
78
  interface IAsset {
79
+ mode: "nest" | "sdk";
80
+ package: string;
72
81
  url: string;
73
82
  simulate: boolean;
74
83
  e2e: boolean;
75
- mode: "nest" | "sdk";
76
84
  }
@@ -53,6 +53,7 @@ export function NestiaEditorIframe(props: NestiaEditorIframe.IProps) {
53
53
  document,
54
54
  simulate: props.simulate ?? true,
55
55
  e2e: props.e2e ?? true,
56
+ package: props.package ?? "@ORGANIZATION/PROJECT",
56
57
  });
57
58
  } catch (exp) {
58
59
  return {
@@ -189,6 +190,7 @@ export namespace NestiaEditorIframe {
189
190
  | SwaggerV2.IDocument
190
191
  | OpenApiV3.IDocument
191
192
  | OpenApiV3_1.IDocument;
193
+ package?: string;
192
194
  simulate?: boolean;
193
195
  e2e?: boolean;
194
196
 
@@ -6,6 +6,7 @@ import {
6
6
  Radio,
7
7
  RadioGroup,
8
8
  Switch,
9
+ TextField,
9
10
  } from "@mui/material";
10
11
  import { OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@samchon/openapi";
11
12
  import StackBlitzSDK from "@stackblitz/sdk";
@@ -19,6 +20,7 @@ export function NestiaEditorUploader(props: NestiaEditorUploader.IProps) {
19
20
  const [mode, setMode] = React.useState<"nest" | "sdk">("sdk");
20
21
  const [simulate, setSimulate] = React.useState(true);
21
22
  const [e2e, setE2e] = React.useState(true);
23
+ const [name, setName] = React.useState("@ORGINIZATION/PROJECT");
22
24
 
23
25
  // RESULT
24
26
  const [document, setDocument] = React.useState<
@@ -79,7 +81,13 @@ export function NestiaEditorUploader(props: NestiaEditorUploader.IProps) {
79
81
  <NestiaEditorFileUploader onChange={handleSwagger} />
80
82
  <br />
81
83
  <FormControl fullWidth style={{ paddingLeft: 15 }}>
82
- <FormLabel> Mode </FormLabel>
84
+ <TextField
85
+ onChange={(e) => setName(e.target.value)}
86
+ defaultValue={name}
87
+ label="Package Name"
88
+ variant="outlined"
89
+ />
90
+ <FormLabel style={{ paddingTop: 20 }}> Mode </FormLabel>
83
91
  <RadioGroup
84
92
  defaultValue={mode}
85
93
  onChange={(_e, value) => setMode(value as "nest" | "sdk")}
@@ -10,6 +10,7 @@ export namespace NestiaEditorComposer {
10
10
  document: SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument;
11
11
  e2e: boolean;
12
12
  simulate: boolean;
13
+ package?: string;
13
14
  /**
14
15
  * @internal
15
16
  */