@nestia/editor 0.1.0 → 0.1.1

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,11 +1,11 @@
1
1
  {
2
2
  "name": "@nestia/editor",
3
- "version": "0.1.0",
4
- "typings": "lib/index.d.ts",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
5
  "main": "lib/index.js",
6
- "module": "lib/index.mjs",
6
+ "typings": "lib/index.d.ts",
7
7
  "scripts": {
8
- "build:lib": "tsc --project tsconfig.lib.json && rollup -c",
8
+ "build:lib": "rimraf lib && tsc --project tsconfig.lib.json",
9
9
  "build:static": "tsc -b && vite build",
10
10
  "dev": "vite",
11
11
  "lint": "eslint .",
@@ -43,8 +43,6 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@eslint/js": "^9.13.0",
46
- "@rollup/plugin-terser": "^0.4.4",
47
- "@rollup/plugin-typescript": "^12.1.1",
48
46
  "@types/js-yaml": "^4.0.9",
49
47
  "@types/react": "^18.3.11",
50
48
  "@types/react-dom": "^18.3.1",
@@ -55,7 +53,7 @@
55
53
  "globals": "^15.11.0",
56
54
  "react": "^18.3.1",
57
55
  "react-dom": "^18.3.1",
58
- "rollup": "^4.24.2",
56
+ "rimraf": "^6.0.1",
59
57
  "typescript": "^5.6.2",
60
58
  "typescript-eslint": "^8.10.0",
61
59
  "vite": "^5.4.9"
package/lib/index.mjs DELETED
@@ -1,346 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
-
3
- import { Typography, Stepper, Step, StepLabel, StepContent, CircularProgress, Alert, AlertTitle, FormControl, FormLabel, RadioGroup, FormControlLabel, Radio, Switch, Button } from "@mui/material";
4
-
5
- import StackBlitzSDK from "@stackblitz/sdk";
6
-
7
- import { useState, useEffect } from "react";
8
-
9
- import { JSONTree } from "react-json-tree";
10
-
11
- import { MigrateApplication } from "@nestia/migrate";
12
-
13
- import prettierEsTreePlugin from "prettier/plugins/estree";
14
-
15
- import prettierTsPlugin from "prettier/plugins/typescript";
16
-
17
- import { format } from "prettier/standalone";
18
-
19
- import { load } from "js-yaml";
20
-
21
- import FileUpload from "react-mui-fileuploader";
22
-
23
- var NestiaEditorComposer;
24
-
25
- (function(NestiaEditorComposer) {
26
- NestiaEditorComposer.nest = props => compose({
27
- openFile: "README.md,test/start.ts",
28
- startScript: [ "build:test,test", "" ],
29
- migrate: app => app.nest(props)
30
- })(props);
31
- NestiaEditorComposer.sdk = props => compose({
32
- openFile: "README.md,test/start.ts",
33
- startScript: [ "swagger", "hello" ],
34
- migrate: app => app.sdk(props)
35
- })(props);
36
- const compose = config => async props => {
37
- if (props.files !== undefined) return {
38
- success: true,
39
- data: {
40
- files: props.files,
41
- openFile: config.openFile,
42
- startScript: config.startScript
43
- },
44
- errors: []
45
- };
46
- const result = await MigrateApplication.create(props.document);
47
- if (result.success === false) return result;
48
- const app = result.data;
49
- const {files} = config.migrate(app);
50
- for (const f of files) if (f.file.substring(f.file.length - 3) === ".ts") f.content = await format(f.content, {
51
- parser: "typescript",
52
- plugins: [ prettierEsTreePlugin, prettierTsPlugin ]
53
- });
54
- return {
55
- success: true,
56
- data: {
57
- files: Object.fromEntries(files.map((f => [ [ f.location, f.location.length ? "/" : "", f.file ].join(""), f.content ]))),
58
- openFile: config.openFile,
59
- startScript: config.startScript
60
- },
61
- errors: []
62
- };
63
- };
64
- })(NestiaEditorComposer || (NestiaEditorComposer = {}));
65
-
66
- function NestiaEditorIframe(props) {
67
- const [id] = useState(`reactia-editor-div-${Math.random().toString().substring(2)}`);
68
- const [step, setStep] = useState(0);
69
- const [fetchError, setFetchError] = useState(null);
70
- const [operations, setOperationCount] = useState({});
71
- const [composerError, setComposerError] = useState(null);
72
- useEffect((() => {
73
- (async () => {
74
- setStep(0);
75
- const document = typeof props.swagger === "string" ? await getDocument(props.swagger) : props.swagger;
76
- if (typeof document === "string") {
77
- setFetchError(document);
78
- return;
79
- } else setOperationCount(aggregateOperation(document));
80
- setStep(1);
81
- const result = await NestiaEditorComposer.sdk({
82
- document,
83
- simulate: props.simulate ?? true,
84
- e2e: props.e2e ?? true
85
- });
86
- if (result.success === false) {
87
- setComposerError(result.errors);
88
- return;
89
- }
90
- setStep(2);
91
- StackBlitzSDK.embedProject(id, {
92
- title: document.info?.title ?? "Nestia Editor",
93
- template: "node",
94
- files: result.data.files
95
- }, {
96
- width: "100%",
97
- height: "100%",
98
- openFile: result.data.openFile,
99
- startScript: result.data.startScript
100
- });
101
- })().catch((() => {}));
102
- }), []);
103
- return jsx("div", {
104
- id,
105
- style: {
106
- width: "100%",
107
- height: "100%",
108
- overflow: "hidden"
109
- },
110
- children: jsxs("div", {
111
- style: {
112
- padding: 25,
113
- overflow: "auto"
114
- },
115
- children: [ jsx(Typography, {
116
- variant: "h4",
117
- children: "Nestia Editor"
118
- }), jsx("hr", {}), jsx("br", {}), jsxs(Stepper, {
119
- activeStep: step,
120
- orientation: "vertical",
121
- nonLinear: true,
122
- children: [ jsxs(Step, {
123
- children: [ jsx(StepLabel, {
124
- children: jsx(Typography, {
125
- variant: "h5",
126
- children: "Loading OpenAPI Document"
127
- })
128
- }), jsxs(StepContent, {
129
- children: [ jsx("br", {}), jsx(CircularProgress, {
130
- size: 100,
131
- color: "success"
132
- }), jsx("br", {}), jsx("br", {}), typeof props.swagger === "string" ? jsxs(Fragment, {
133
- children: [ jsx("p", {
134
- children: "Fetching OpenAPI Document from"
135
- }), jsx("p", {
136
- children: jsx("a", {
137
- href: props.swagger,
138
- target: "_blank",
139
- children: props.swagger
140
- })
141
- }) ]
142
- }) : "Delivering OpenAPI Document to the composer", fetchError !== null ? jsxs(Alert, {
143
- severity: "error",
144
- children: [ jsx(AlertTitle, {
145
- children: "Fetch Error"
146
- }), fetchError ]
147
- }) : null ]
148
- }) ]
149
- }, 0), jsxs(Step, {
150
- children: [ jsx(StepLabel, {
151
- children: jsx(Typography, {
152
- variant: "h5",
153
- children: "Generating Software Development Kit"
154
- })
155
- }), jsxs(StepContent, {
156
- children: [ jsx("br", {}), jsx(CircularProgress, {
157
- size: 100,
158
- color: "success"
159
- }), jsx("br", {}), jsx("br", {}), "Generating SDK funtions...", jsx("br", {}), jsxs("ul", {
160
- children: [ jsxs("li", {
161
- children: [ "total operations: #", Object.values(operations).reduce(((a, b) => a + b), 0).toLocaleString() ]
162
- }), Object.entries(operations).map((([method, count]) => jsxs("li", {
163
- children: [ method, ": #", count.toLocaleString() ]
164
- }))) ]
165
- }), composerError !== null ? jsxs(Fragment, {
166
- children: [ jsx("br", {}), jsxs(Alert, {
167
- severity: "error",
168
- children: [ jsx(AlertTitle, {
169
- children: "Composition Error"
170
- }), jsx(JSONTree, {
171
- data: composerError
172
- }) ]
173
- }) ]
174
- }) : null ]
175
- }) ]
176
- }, 1), jsxs(Step, {
177
- children: [ jsx(StepLabel, {
178
- children: jsx(Typography, {
179
- variant: "h5",
180
- children: "Composing TypeScript Project"
181
- })
182
- }), jsx(StepContent, {}) ]
183
- }, 2) ]
184
- }) ]
185
- })
186
- });
187
- }
188
-
189
- const getDocument = async url => {
190
- try {
191
- const response = await fetch(url);
192
- if (response.status !== 200) return await response.text();
193
- return await response.json();
194
- } catch (error) {
195
- if (error instanceof Error) return error.message;
196
- return "Unknown error";
197
- }
198
- };
199
-
200
- const aggregateOperation = document => {
201
- const map = {};
202
- if (!(typeof document === "object" && document !== null)) return map;
203
- for (const collection of Object.values(document.paths ?? {})) if (typeof collection === "object" && collection !== null) for (const [method] of Object.entries(collection)) if (method === "head" || method === "get" || method === "post" || method === "patch" || method === "put" || method === "delete") map[method] = (map[method] ?? 0) + 1;
204
- return map;
205
- };
206
-
207
- function NestiaEditorFileUploader(props) {
208
- const [elements, setElements] = useState([]);
209
- const onChange = async array => {
210
- if (array.length === 0) {
211
- props.onChange(null, null);
212
- return;
213
- }
214
- const file = array[array.length - 1];
215
- const buffer = await file.arrayBuffer();
216
- const content = (new TextDecoder).decode(buffer);
217
- const extension = file.name.split(".").pop();
218
- try {
219
- const json = extension === "json" ? JSON.parse(content) : load(content);
220
- props.onChange(json, null);
221
- } catch {
222
- props.onChange(null, extension === "json" ? "Invalid JSON file" : "Invalid YAML file");
223
- return;
224
- }
225
- if (array.length > 1) setElements([ file ]);
226
- };
227
- return jsx(FileUpload, {
228
- defaultFiles: elements,
229
- onFilesChange: onChange,
230
- acceptedType: ".json, .yaml",
231
- getBase64: false,
232
- multiFile: false,
233
- maxUploadFiles: 1,
234
- title: "Swagger file uploader",
235
- header: "Drag and drop a Swagger file here",
236
- buttonLabel: "Click Here",
237
- rightLabel: "to select swagger.json/yaml file",
238
- buttonRemoveLabel: "Clear"
239
- });
240
- }
241
-
242
- function NestiaEditorUploader(props) {
243
- const [mode, setMode] = useState("sdk");
244
- const [simulate, setSimulate] = useState(true);
245
- const [e2e, setE2e] = useState(true);
246
- const [document, setDocument] = useState(null);
247
- const [progress, setProgress] = useState(false);
248
- const handleError = error => {
249
- if (props.onError) props.onError(error); else alert(error);
250
- };
251
- const handleSwagger = (document, error) => {
252
- setDocument(document);
253
- if (error !== null) handleError(error);
254
- };
255
- const generate = async () => {
256
- if (document === null) return;
257
- setProgress(true);
258
- try {
259
- const result = await NestiaEditorComposer[mode]({
260
- document,
261
- e2e,
262
- simulate
263
- });
264
- if (result.success === true) {
265
- StackBlitzSDK.openProject({
266
- title: document.info?.title ?? "Nestia Editor",
267
- template: "node",
268
- files: result.data.files
269
- }, {
270
- newWindow: true,
271
- openFile: result.data.openFile,
272
- startScript: result.data.startScript
273
- });
274
- } else {
275
- handleError(JSON.stringify(result.errors, null, 2));
276
- }
277
- } catch (exp) {
278
- handleError(exp instanceof Error ? exp.message : "unknown error");
279
- }
280
- setProgress(false);
281
- };
282
- return jsxs(Fragment, {
283
- children: [ jsx(NestiaEditorFileUploader, {
284
- onChange: handleSwagger
285
- }), jsx("br", {}), jsxs(FormControl, {
286
- fullWidth: true,
287
- style: {
288
- paddingLeft: 15
289
- },
290
- children: [ jsx(FormLabel, {
291
- children: " Mode "
292
- }), jsxs(RadioGroup, {
293
- defaultValue: mode,
294
- onChange: (_e, value) => setMode(value),
295
- style: {
296
- paddingLeft: 15
297
- },
298
- children: [ jsx(FormControlLabel, {
299
- value: "sdk",
300
- control: jsx(Radio, {}),
301
- label: "Software Development Kit"
302
- }), jsx(FormControlLabel, {
303
- value: "nest",
304
- control: jsx(Radio, {}),
305
- label: "NestJS Project"
306
- }) ]
307
- }), jsx(FormLabel, {
308
- style: {
309
- paddingTop: 20
310
- },
311
- children: " Options "
312
- }), jsx(FormControlLabel, {
313
- label: "Mockup Simulator",
314
- style: {
315
- paddingTop: 5,
316
- paddingLeft: 15
317
- },
318
- control: jsx(Switch, {
319
- checked: simulate,
320
- onChange: () => setSimulate(!simulate)
321
- })
322
- }), jsx(FormControlLabel, {
323
- label: "E2E Test Functions",
324
- style: {
325
- paddingLeft: 15
326
- },
327
- control: jsx(Switch, {
328
- checked: e2e,
329
- onChange: () => setE2e(!e2e)
330
- })
331
- }) ]
332
- }), jsx("br", {}), jsx("br", {}), jsx(Button, {
333
- component: "a",
334
- fullWidth: true,
335
- variant: "contained",
336
- color: "info",
337
- size: "large",
338
- disabled: progress === true || document === null,
339
- onClick: () => generate(),
340
- children: progress ? "Generating..." : "Generate Editor"
341
- }) ]
342
- });
343
- }
344
-
345
- export { NestiaEditorIframe, NestiaEditorUploader };
346
- //# sourceMappingURL=index.mjs.map
package/lib/index.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/internal/NestiaEditorComposer.ts","../src/NestiaEditorIframe.tsx","../src/internal/NestiaEditorFileUploader.tsx","../src/NestiaEditorUploader.tsx"],"sourcesContent":[null,null,null,null],"names":["NestiaEditorComposer","nest","props","compose","openFile","startScript","migrate","app","sdk","config","async","files","undefined","success","data","errors","result","MigrateApplication","create","document","f","file","substring","length","content","format","parser","plugins","prettierEsTreePlugin","prettierTsPlugin","Object","fromEntries","map","location","join","NestiaEditorIframe","id","useState","Math","random","toString","step","setStep","fetchError","setFetchError","operations","setOperationCount","composerError","setComposerError","useEffect","swagger","getDocument","aggregateOperation","simulate","e2e","StackBlitzSDK","embedProject","title","info","template","width","height","catch","_jsx","style","overflow","children","_jsxs","padding","Typography","variant","Stepper","activeStep","orientation","nonLinear","Step","StepLabel","StepContent","CircularProgress","size","color","href","target","Alert","severity","AlertTitle","values","reduce","a","b","toLocaleString","entries","method","count","_Fragment","JSONTree","url","response","fetch","status","text","json","error","Error","message","collection","paths","NestiaEditorFileUploader","elements","setElements","onChange","array","buffer","arrayBuffer","TextDecoder","decode","extension","name","split","pop","JSON","parse","load","FileUpload","defaultFiles","onFilesChange","acceptedType","getBase64","multiFile","maxUploadFiles","header","buttonLabel","rightLabel","buttonRemoveLabel","NestiaEditorUploader","mode","setMode","setSimulate","setE2e","setDocument","progress","setProgress","handleError","onError","alert","handleSwagger","generate","openProject","newWindow","stringify","exp","FormControl","fullWidth","paddingLeft","FormLabel","RadioGroup","defaultValue","_e","value","FormControlLabel","control","Radio","label","paddingTop","Switch","checked","Button","component","disabled","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOM,IAAWA;;CAAjB,SAAiBA;IAgBFA,qBAAAC,OAAQC,SACnBC,QAAQ;QACNC,UAAU;QACVC,aAAa,EAAC,mBAAmB;QACjCC,SAAUC,OAAQA,IAAIN,KAAKC;MAH7BC,CAIGD;IAEQF,qBAAAQ,MAAON,SAClBC,QAAQ;QACNC,UAAU;QACVC,aAAa,EAAC,WAAW;QACzBC,SAAUC,OAAQA,IAAIC,IAAIN;MAH5BC,CAIGD;IAEL,MAAMC,UACHM,UAKDC,MAAOR;QACL,IAAIA,MAAMS,UAAUC,WAClB,OAAO;YACLC,SAAS;YACTC,MAAM;gBACJH,OAAOT,MAAMS;gBACbP,UAAUK,OAAOL;gBACjBC,aAAaI,OAAOJ;;YAEtBU,QAAQ;;QAEZ,MAAMC,eACEC,mBAAmBC,OAAOhB,MAAMiB;QACxC,IAAIH,OAAOH,YA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