ide-assi 0.142.0 → 0.144.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.
@@ -11170,16 +11170,19 @@ class ninegrid {
11170
11170
  }
11171
11171
  };
11172
11172
 
11173
- static decode = (args) => {
11174
- console.log(args);
11173
+ static decode = (...args) => {
11174
+ const key = args[0];
11175
11175
 
11176
- for (var i = 1; i < args.length ; i+=2) {
11177
- if (args[0] === args[i]) return args[i+1];
11176
+ for (let i = 1; i < args.length - 1; i += 2) {
11177
+ if (args[i] === key) return args[i + 1];
11178
11178
  }
11179
11179
 
11180
- return args.length % 2 == 0 ? args[args.length - 1] : null;
11180
+ // fallback 처리 (짝이 맞지 않을 경우)
11181
+ return args.length % 2 === 0 ? args[args.length - 1] : null;
11181
11182
  };
11182
11183
 
11184
+
11185
+
11183
11186
  static isMobile = () => {
11184
11187
  return /(iPhone|iPad|Android|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
11185
11188
  };
@@ -193325,8 +193328,9 @@ class IdeUtils
193325
193328
  static extractResponse = (response, gptServer) => {
193326
193329
 
193327
193330
  const extractJsonSnippet = (text) => {
193328
- const match = text.match(/```json([\s\S]*?)```/);
193329
- return match ? match[1].trim() : text;
193331
+ text.replace(/```[\s\S]*?```/g, '').trim();
193332
+ //const match = text.match(/```json([\s\S]*?)```/);
193333
+ //return match ? match[1].trim() : text;
193330
193334
  };
193331
193335
 
193332
193336
  let r;
@@ -193565,8 +193569,6 @@ class IdeAi
193565
193569
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
193566
193570
 
193567
193571
  const params = await Promise.all(
193568
-
193569
-
193570
193572
  files.map(async (file) => ({
193571
193573
  path: ninegrid.decode(file, "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript),
193572
193574
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
@@ -193609,11 +193611,6 @@ class IdeAi
193609
193611
  this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
193610
193612
  console.log(where);
193611
193613
 
193612
- console.log(where.mybatis, await ninegrid.decode("mybatis.xml", "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript, "xx"));
193613
-
193614
-
193615
-
193616
- /**
193617
193614
  const columnInfo = await this.#getColumnInfo(where.table);
193618
193615
 
193619
193616
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
@@ -193642,13 +193639,13 @@ class IdeAi
193642
193639
  });
193643
193640
  this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
193644
193641
 
193645
- const jsSrc = await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
193642
+ await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
193646
193643
  userPrompt: userPrompt,
193647
193644
  menuUrl: where.menu.url,
193648
193645
  controllerSource: controllerSrc,
193649
193646
  });
193650
193647
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
193651
- */
193648
+
193652
193649
  await this.#generateRealFile(where);
193653
193650
 
193654
193651
  return "OK";
@@ -11166,16 +11166,19 @@ class ninegrid {
11166
11166
  }
11167
11167
  };
11168
11168
 
11169
- static decode = (args) => {
11170
- console.log(args);
11169
+ static decode = (...args) => {
11170
+ const key = args[0];
11171
11171
 
11172
- for (var i = 1; i < args.length ; i+=2) {
11173
- if (args[0] === args[i]) return args[i+1];
11172
+ for (let i = 1; i < args.length - 1; i += 2) {
11173
+ if (args[i] === key) return args[i + 1];
11174
11174
  }
11175
11175
 
11176
- return args.length % 2 == 0 ? args[args.length - 1] : null;
11176
+ // fallback 처리 (짝이 맞지 않을 경우)
11177
+ return args.length % 2 === 0 ? args[args.length - 1] : null;
11177
11178
  };
11178
11179
 
11180
+
11181
+
11179
11182
  static isMobile = () => {
11180
11183
  return /(iPhone|iPad|Android|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
11181
11184
  };
@@ -193321,8 +193324,9 @@ class IdeUtils
193321
193324
  static extractResponse = (response, gptServer) => {
193322
193325
 
193323
193326
  const extractJsonSnippet = (text) => {
193324
- const match = text.match(/```json([\s\S]*?)```/);
193325
- return match ? match[1].trim() : text;
193327
+ text.replace(/```[\s\S]*?```/g, '').trim();
193328
+ //const match = text.match(/```json([\s\S]*?)```/);
193329
+ //return match ? match[1].trim() : text;
193326
193330
  };
193327
193331
 
193328
193332
  let r;
@@ -193561,8 +193565,6 @@ class IdeAi
193561
193565
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
193562
193566
 
193563
193567
  const params = await Promise.all(
193564
-
193565
-
193566
193568
  files.map(async (file) => ({
193567
193569
  path: ninegrid.decode(file, "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript),
193568
193570
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
@@ -193605,11 +193607,6 @@ class IdeAi
193605
193607
  this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
193606
193608
  console.log(where);
193607
193609
 
193608
- console.log(where.mybatis, await ninegrid.decode("mybatis.xml", "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript, "xx"));
193609
-
193610
-
193611
-
193612
- /**
193613
193610
  const columnInfo = await this.#getColumnInfo(where.table);
193614
193611
 
193615
193612
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
@@ -193638,13 +193635,13 @@ class IdeAi
193638
193635
  });
193639
193636
  this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
193640
193637
 
193641
- const jsSrc = await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
193638
+ await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
193642
193639
  userPrompt: userPrompt,
193643
193640
  menuUrl: where.menu.url,
193644
193641
  controllerSource: controllerSrc,
193645
193642
  });
193646
193643
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
193647
- */
193644
+
193648
193645
  await this.#generateRealFile(where);
193649
193646
 
193650
193647
  return "OK";
@@ -221,8 +221,6 @@ export class IdeAi
221
221
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
222
222
 
223
223
  const params = await Promise.all(
224
-
225
-
226
224
  files.map(async (file) => ({
227
225
  path: ninegrid.decode(file, "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript),
228
226
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
@@ -256,7 +254,7 @@ export class IdeAi
256
254
 
257
255
  const src = await this.#invoke(promptFile, params);
258
256
 
259
- const response3 = await fetch(`/api/source/generateTmplFile`, {
257
+ await fetch(`/api/source/generateTmplFile`, {
260
258
  method: "POST",
261
259
  headers: { "Content-Type": "application/json" },
262
260
  body: JSON.stringify({
@@ -279,11 +277,6 @@ export class IdeAi
279
277
  this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
280
278
  console.log(where);
281
279
 
282
- console.log(where.mybatis, await ninegrid.decode("mybatis.xml", "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript, "xx"));
283
-
284
-
285
-
286
- /**
287
280
  const columnInfo = await this.#getColumnInfo(where.table);
288
281
 
289
282
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
@@ -318,7 +311,7 @@ export class IdeAi
318
311
  controllerSource: controllerSrc,
319
312
  });
320
313
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
321
- */
314
+
322
315
  await this.#generateRealFile(where);
323
316
 
324
317
  return "OK";
@@ -18,8 +18,9 @@ export class IdeUtils
18
18
  static extractResponse = (response, gptServer) => {
19
19
 
20
20
  const extractJsonSnippet = (text) => {
21
- const match = text.match(/```json([\s\S]*?)```/);
22
- return match ? match[1].trim() : text;
21
+ text.replace(/```[\s\S]*?```/g, '').trim();
22
+ //const match = text.match(/```json([\s\S]*?)```/);
23
+ //return match ? match[1].trim() : text;
23
24
  };
24
25
 
25
26
  let r;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.142.0",
4
+ "version": "0.144.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -221,8 +221,6 @@ export class IdeAi
221
221
  const files = ["mybatis.xml", "service.java", "controller.java", "react.jsx"];
222
222
 
223
223
  const params = await Promise.all(
224
-
225
-
226
224
  files.map(async (file) => ({
227
225
  path: ninegrid.decode(file, "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript),
228
226
  contents: await fetch(`/api/templates/${file}`).then(res => res.text()),
@@ -256,7 +254,7 @@ export class IdeAi
256
254
 
257
255
  const src = await this.#invoke(promptFile, params);
258
256
 
259
- const response3 = await fetch(`/api/source/generateTmplFile`, {
257
+ await fetch(`/api/source/generateTmplFile`, {
260
258
  method: "POST",
261
259
  headers: { "Content-Type": "application/json" },
262
260
  body: JSON.stringify({
@@ -279,11 +277,6 @@ export class IdeAi
279
277
  this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
280
278
  console.log(where);
281
279
 
282
- console.log(where.mybatis, await ninegrid.decode("mybatis.xml", "mybatis.xml", where.mybatis, "service.java", where.service, "controller.java", where.controller, "react.jsx", where.javascript, "xx"));
283
-
284
-
285
-
286
- /**
287
280
  const columnInfo = await this.#getColumnInfo(where.table);
288
281
 
289
282
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
@@ -318,7 +311,7 @@ export class IdeAi
318
311
  controllerSource: controllerSrc,
319
312
  });
320
313
  this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
321
- */
314
+
322
315
  await this.#generateRealFile(where);
323
316
 
324
317
  return "OK";
@@ -18,8 +18,9 @@ export class IdeUtils
18
18
  static extractResponse = (response, gptServer) => {
19
19
 
20
20
  const extractJsonSnippet = (text) => {
21
- const match = text.match(/```json([\s\S]*?)```/);
22
- return match ? match[1].trim() : text;
21
+ text.replace(/```[\s\S]*?```/g, '').trim();
22
+ //const match = text.match(/```json([\s\S]*?)```/);
23
+ //return match ? match[1].trim() : text;
23
24
  };
24
25
 
25
26
  let r;