ide-assi 0.133.0 → 0.135.0

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.
@@ -193513,28 +193513,20 @@ class IdeAi
193513
193513
  #generateRealFile = async (filePath, src) => {
193514
193514
 
193515
193515
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
193516
- let params = [];
193517
- let params1 = [];
193518
- files.forEach((file) => {
193519
193516
 
193520
- /**
193521
- params1.push({
193517
+ const params = await Promise.all(
193518
+ files.map(async (file) => ({
193522
193519
  path: `/tmpl/${file}`,
193523
193520
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
193524
- }); */
193525
-
193526
- params.push({
193527
- path: `aaa`,
193528
- contents: "aa",
193529
- });
193530
- });
193521
+ }))
193522
+ );
193531
193523
 
193532
- console.log(JSON.stringify({list:params}), JSON.stringify({list:params1}));
193524
+ console.log(JSON.stringify({list:params}));
193533
193525
 
193534
193526
  await fetch(`/api/source/generateRealFile`, {
193535
193527
  method: "POST",
193536
193528
  headers: { "Content-Type": "application/json" },
193537
- body: JSON.stringify({list:params})
193529
+ body: JSON.stringify({ list: params })
193538
193530
  });
193539
193531
 
193540
193532
  return;
@@ -193509,28 +193509,20 @@ class IdeAi
193509
193509
  #generateRealFile = async (filePath, src) => {
193510
193510
 
193511
193511
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
193512
- let params = [];
193513
- let params1 = [];
193514
- files.forEach((file) => {
193515
193512
 
193516
- /**
193517
- params1.push({
193513
+ const params = await Promise.all(
193514
+ files.map(async (file) => ({
193518
193515
  path: `/tmpl/${file}`,
193519
193516
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
193520
- }); */
193521
-
193522
- params.push({
193523
- path: `aaa`,
193524
- contents: "aa",
193525
- });
193526
- });
193517
+ }))
193518
+ );
193527
193519
 
193528
- console.log(JSON.stringify({list:params}), JSON.stringify({list:params1}));
193520
+ console.log(JSON.stringify({list:params}));
193529
193521
 
193530
193522
  await fetch(`/api/source/generateRealFile`, {
193531
193523
  method: "POST",
193532
193524
  headers: { "Content-Type": "application/json" },
193533
- body: JSON.stringify({list:params})
193525
+ body: JSON.stringify({ list: params })
193534
193526
  });
193535
193527
 
193536
193528
  return;
@@ -219,28 +219,20 @@ export class IdeAi
219
219
  #generateRealFile = async (filePath, src) => {
220
220
 
221
221
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
222
- let params = [];
223
- let params1 = [];
224
- files.forEach((file) => {
225
222
 
226
- /**
227
- params1.push({
223
+ const params = await Promise.all(
224
+ files.map(async (file) => ({
228
225
  path: `/tmpl/${file}`,
229
226
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
230
- }); */
227
+ }))
228
+ );
231
229
 
232
- params.push({
233
- path: `aaa`,
234
- contents: "aa",
235
- });
236
- });
237
-
238
- console.log(JSON.stringify({list:params}), JSON.stringify({list:params1}));
230
+ console.log(JSON.stringify({list:params}));
239
231
 
240
232
  await fetch(`/api/source/generateRealFile`, {
241
233
  method: "POST",
242
234
  headers: { "Content-Type": "application/json" },
243
- body: JSON.stringify({list:params})
235
+ body: JSON.stringify({ list: params })
244
236
  });
245
237
 
246
238
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.133.0",
4
+ "version": "0.135.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -219,28 +219,20 @@ export class IdeAi
219
219
  #generateRealFile = async (filePath, src) => {
220
220
 
221
221
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
222
- let params = [];
223
- let params1 = [];
224
- files.forEach((file) => {
225
222
 
226
- /**
227
- params1.push({
223
+ const params = await Promise.all(
224
+ files.map(async (file) => ({
228
225
  path: `/tmpl/${file}`,
229
226
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
230
- }); */
227
+ }))
228
+ );
231
229
 
232
- params.push({
233
- path: `aaa`,
234
- contents: "aa",
235
- });
236
- });
237
-
238
- console.log(JSON.stringify({list:params}), JSON.stringify({list:params1}));
230
+ console.log(JSON.stringify({list:params}));
239
231
 
240
232
  await fetch(`/api/source/generateRealFile`, {
241
233
  method: "POST",
242
234
  headers: { "Content-Type": "application/json" },
243
- body: JSON.stringify({list:params})
235
+ body: JSON.stringify({ list: params })
244
236
  });
245
237
 
246
238
  return;