@nine-lab/nine-mu 0.1.16 → 0.1.18

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.
@@ -1,4 +1,4 @@
1
- import { nine, trace } from '@nine-lab/nine-util';
1
+ import { nine, trace, api } from '@nine-lab/nine-util';
2
2
 
3
3
  export class NineMuService {
4
4
  constructor(connectorUrl) {
@@ -13,9 +13,9 @@ export class NineMuService {
13
13
  */
14
14
  async generate(command, targets, currentRoutes) {
15
15
  try {
16
- trace.log(`🚀 Fab 공정 시작: "${command}" [대상: ${targets.join(', ')}]`);
16
+ trace.log(`공정 시작: "${command}" [대상: ${targets.join(', ')}]`);
17
17
 
18
- const response = await fetch(`${this.connectorUrl}/api/fab/generate`, {
18
+ const response = await fetch(`${this.connectorUrl}/api/mu/generate`, {
19
19
  method: 'POST',
20
20
  headers: { 'Content-Type': 'application/json' },
21
21
  body: JSON.stringify({
@@ -34,7 +34,86 @@ export class NineMuService {
34
34
 
35
35
  return result;
36
36
  } catch (error) {
37
- trace.error("❌ Fab Service Error:", error);
37
+ trace.error("NineMu Service Error:", error);
38
+ throw error;
39
+ }
40
+ }
41
+
42
+ #getSourcePath = (menuUrl) => {
43
+ return null;
44
+ };
45
+
46
+ async generateAll(command) {
47
+
48
+ }
49
+
50
+ async generateAll_BAK(command, targets, currentRoutes) {
51
+ /**
52
+ api.post("/nine-mu/source/read", { menuUrl : "/admin/payment/order-list", feProjectName: pkg.name }).then((res) => {
53
+ trace.log(res);
54
+ }); */
55
+
56
+ try {
57
+ trace.log(`공정 시작: "${command}" [대상: ${targets.join(', ')}]`);
58
+
59
+ /**
60
+ * return {
61
+ * package: packageName,
62
+ * namespace: namespace,
63
+ * baseClass: fileName,
64
+ * //resultType: this.#parent.config.basePackage.split(".").slice(0, -1).join(".") + ".core.utils.CamelCaseMap",
65
+ * resultType: "com.ninelab.ai.util.CamelCaseMap",
66
+ * mybatis: `${cleaned.split(".").slice(0, -1).join("/")}/${fileName}Mapper.xml`,
67
+ * //javascript: `${javascript}.jsx`,
68
+ * //javascriptFrom: `${javascriptFrom}.jsx`,
69
+ * //javascriptTo: `${javascriptTo}.jsx`,
70
+ * classFrom: classFrom,
71
+ * classTo: classTo,
72
+ * activeIndex: activeIndex,
73
+ * emptyIndex: emptyIndex,
74
+ * mybatisPullPath: `${this.#parent.settings.beProjectName}/src/main/resources/mapper/${cleaned.split(".").slice(0, -1).join("/")}/${fileName}Mapper.xml`,
75
+ * controllerPullPath: `${this.#parent.settings.beProjectName}/src/main/java/${packageName.replaceAll(".", "/")}/controller/${fileName}Controller.java`,
76
+ * servicePullPath: `${this.#parent.settings.beProjectName}/src/main/java/${packageName.replaceAll(".", "/")}/service/${fileName}Service.java`,
77
+ * //javascriptPullPath: `${this.#parent.settings.feProjectName}${javascript}.jsx`,
78
+ * javascriptFrom: `${this.#parent.settings.feProjectName}/src/views/${javascriptFrom}.jsx`,
79
+ * javascriptTo: `${this.#parent.settings.feProjectName}/src/views/${javascriptTo}.jsx`,
80
+ * };
81
+ */
82
+ const srcPath = this.#getSourcePath("/admin/payment/order-list");
83
+ const srcPath1 = {
84
+ mybatis : "",
85
+ servicePullPath : "",
86
+ controllerPullPath : "",
87
+ javascriptFrom : "",
88
+ javascriptTo : "",
89
+ };
90
+
91
+ trace.log(srcPath);
92
+ const src = await api.post("/nine-ai/source/read", srcPath);
93
+ trace.log(src);
94
+
95
+ const response = await fetch(`${this.connectorUrl}/api/mu/generateAll`, {
96
+ method: 'POST',
97
+ headers: { 'Content-Type': 'application/json' },
98
+ body: JSON.stringify({
99
+ //command,
100
+ //targets,
101
+ projectType: 'spring-react',
102
+ //currentRoutes
103
+ })
104
+ });
105
+
106
+ trace.log(response);
107
+
108
+ const result = await response.json();
109
+
110
+ if (!result.success) {
111
+ throw new Error(result.error || "소스 생성 중 서버 오류가 발생했습니다.");
112
+ }
113
+
114
+ return result;
115
+ } catch (error) {
116
+ trace.error("NineMu Service Error:", error);
38
117
  throw error;
39
118
  }
40
119
  }
package/vite.config.js CHANGED
@@ -9,7 +9,7 @@ export default defineConfig({
9
9
  build: {
10
10
  lib: {
11
11
  entry: resolve(__dirname, 'src/index.js'),
12
- name: 'NineFab',
12
+ name: 'NineMu',
13
13
  fileName: (format) => `nine-mu.${format === 'es' ? 'js' : 'umd.js'}`,
14
14
  formats: ['es', 'umd']
15
15
  },