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