@nine-lab/nine-mu 0.1.363 โ†’ 0.1.364

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-mu",
3
- "version": "0.1.363",
3
+ "version": "0.1.364",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -10,6 +10,7 @@ export const NineExceptionStyles = {
10
10
  padding: '25px',
11
11
  background: '#121314',
12
12
  fontFamily: 'Consolas, Monaco, "Courier New", monospace',
13
+ fontSize: '14px',
13
14
  textAlign: 'left',
14
15
  boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
15
16
  display: 'flex',
@@ -156,30 +157,44 @@ export class NineExceptionHook extends React.Component {
156
157
  return this.props.fallback(this.state.error);
157
158
  }
158
159
 
159
- const errorMessage = this.state.error?.message || String(this.state.error);
160
+ // 1. ๐Ÿ” ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ƒ์„ธํ™” (๊ธฐ๋ณธ ๋ฉ”์‹œ์ง€ ์™ธ์— ์—๋Ÿฌ ํƒ€์ž…๊ณผ ํ•ต์‹ฌ ์š”์•ฝ ์ถ”์ถœ)
161
+ let errorMessage = '';
162
+ if (this.state.error) {
163
+ const errorName = this.state.error.name ? `[${this.state.error.name}] ` : '';
164
+ const mainMessage = this.state.error.message || String(this.state.error);
165
+
166
+ // ์—๋Ÿฌ ๊ฐ์ฒด์˜ stack ์ •๋ณด๊ฐ€ ์žˆ์œผ๋ฉด ์ฒซ ๋ฒˆ์งธ ๋ผ์ธ(์ƒ์„ธ ์›์ธ)์„ ์กฐํ•ฉํ•ฉ๋‹ˆ๋‹ค.
167
+ if (this.state.error.stack) {
168
+ const stackLines = this.state.error.stack.split('\n');
169
+ // stack์˜ ์ฒซ ์ค„์ด ์ด๋ฏธ ์—๋Ÿฌ๋ช…์„ ํฌํ•จํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์œผ๋ฏ€๋กœ ์ •์ œํ•˜์—ฌ ๋งค์นญ
170
+ errorMessage = stackLines[0].includes(mainMessage)
171
+ ? stackLines[0]
172
+ : `${errorName}${mainMessage}`;
173
+ } else {
174
+ errorMessage = `${errorName}${mainMessage}`;
175
+ }
176
+ } else {
177
+ errorMessage = 'Unknown runtime exception occurred.';
178
+ }
179
+
160
180
  const customStyles = this.props.styles || {};
161
181
 
162
- // ๐Ÿ” React ์ปดํฌ๋„ŒํŠธ ์Šคํƒ์—์„œ ํŒŒ์ผ๋ช…๊ณผ ๋ผ์ธ ๋ฒˆํ˜ธ ์ถ”์ถœ
163
- // ๐Ÿ” React ์ปดํฌ๋„ŒํŠธ ์Šคํƒ์—์„œ ํŒŒ์ผ๋ช…๊ณผ ๋ผ์ธ ๋ฒˆํ˜ธ ์ถ”์ถœ๊ธฐ (๊ฒฝ๋กœ ์ •๋ฐ€ ์ •์ œ ๋ฒ„์ „)
182
+ // 2. ๐Ÿ” React ์ปดํฌ๋„ŒํŠธ ์Šคํƒ์—์„œ ๋กœ์ปฌํ˜ธ์ŠคํŠธ ์ฃผ์†Œ๋ฅผ ๊ฑท์–ด๋‚ธ ๊น”๋”ํ•œ ๊ฒฝ๋กœ ์ถ”์ถœ
164
183
  let errorLocation = '';
165
184
  if (this.state.errorInfo?.componentStack) {
166
185
  const lines = this.state.errorInfo.componentStack.trim().split('\n');
167
186
  const targetLine = lines[0] || '';
168
187
 
169
- // 1. ๊ธฐ์กด ๋ฐฉ์‹๋Œ€๋กœ ์ปดํฌ๋„ŒํŠธ ์ด๋ฆ„๊ณผ ์ „์ฒด ๊ฒฝ๋กœ๋ฅผ ๋จผ์ € ๋งค์นญํ•ฉ๋‹ˆ๋‹ค.
170
188
  const match = targetLine.match(/at\s+(\w+)\s+\((.*)\)/) || targetLine.match(/at\s+(.*)/);
171
189
  if (match) {
172
190
  const componentName = match[1];
173
191
  let rawPath = match[2] || '';
174
192
 
175
- // 2. โญ ํ•ต์‹ฌ: ๊ฒฝ๋กœ์—์„œ 'http://localhost:5173/admin' ๋˜๋Š” 'http://.../any-path' ํŒŒํŠธ๋ฅผ ์ฐพ์•„ ํ†ต์งธ๋กœ ๋‚ ๋ ค๋ฒ„๋ฆฝ๋‹ˆ๋‹ค.
176
193
  if (rawPath.includes('http://') || rawPath.includes('https://')) {
177
- // URL ๊ฐ์ฒด๋‚˜ ์ •๊ทœ์‹์„ ์ด์šฉํ•ด ๋„๋ฉ”์ธ ์˜์—ญ์„ ์ง€์šฐ๊ณ  /src ํฌ๋งท๋งŒ ๋‚จ๊น๋‹ˆ๋‹ค.
178
194
  rawPath = rawPath.replace(/^https?:\/\/[^\/]+/, '');
179
195
  }
180
196
 
181
- // 3. ์ปดํฌ๋„ŒํŠธ ์ด๋ฆ„ ๋’ค์— ๊น”๋”ํ•ด์ง„ /src ๊ฒฝ๋กœ๋งŒ ๋ถ™์—ฌ์ค๋‹ˆ๋‹ค.
182
- errorLocation = rawPath ? `${componentName} (${rawPath})` : componentName;
197
+ errorLocation = rawPath ? `at ${componentName} (${rawPath})` : `at ${componentName}`;
183
198
  } else {
184
199
  errorLocation = targetLine.trim();
185
200
  }
@@ -191,24 +206,24 @@ export class NineExceptionHook extends React.Component {
191
206
  style: { ...NineExceptionStyles.container, ...customStyles.container, ...this.props.containerStyle }
192
207
  },
193
208
 
194
- // 1. [SYSTEM] ๋ผ์ธ
209
+ // 1. ์—๋Ÿฌ ๊ฐ์ง€ ๋กœ๊ทธ
195
210
  React.createElement(
196
211
  'div',
197
212
  { style: { ...NineExceptionStyles.systemError, ...customStyles.systemError } },
198
213
  '[SYSTEM] COMPONENT RENDER ERROR DETECTED'
199
214
  ),
200
215
 
201
- // 2. aa is not defined ๋ผ์ธ
216
+ // 2. ์ƒ์„ธํ™”๋œ ์—๋Ÿฌ ๋‚ด์šฉ (์˜ˆ: ReferenceError: aa is not defined)
202
217
  React.createElement('pre', { style: { ...NineExceptionStyles.pre, ...customStyles.pre } }, errorMessage),
203
218
 
204
- // 3. at MemberUsers ๋ผ์ธ
219
+ // 3. ํŒŒ์‹ฑ๋œ ์—๋Ÿฌ ๋ฐœ์ƒ ํŒŒ์ผ๋ช… ๋ฐ ๋ผ์ธ ์œ„์น˜
205
220
  errorLocation && React.createElement(
206
221
  'div',
207
222
  { style: { ...NineExceptionStyles.locationRow, ...customStyles.locationRow } },
208
- ` at ${errorLocation}`
223
+ errorLocation
209
224
  ),
210
225
 
211
- // 4. CLI ํ”„๋กฌํ”„ํŠธ ๋ฐ ํ›„์† ๊ฒฐ๊ณผ ๋ผ์ธ ์˜์—ญ
226
+ // 4. CLI ํ”„๋กฌํ”„ํŠธ ์˜์—ญ
212
227
  React.createElement(
213
228
  'div',
214
229
  { style: { ...NineExceptionStyles.footer, ...customStyles.footer } },
@@ -228,18 +243,17 @@ export class NineExceptionHook extends React.Component {
228
243
  React.createElement('span', null, '/n)?')
229
244
  ),
230
245
 
231
- // display: 'block'๊ณผ margin/padding 0์„ ์ฃผ์–ด ๋‹ค๋ฅธ ๋ผ์ธ๋“ค๊ณผ ์˜ค์ฐจ ์—†์ด ๊ฐ„๊ฒฉ์„ ๋งž์ถค
232
246
  this.state.reportStatus === 'sending' && React.createElement(
233
247
  'div',
234
- { style: { color: '#ED8936', margin: '0', padding: '0', display: 'block' } },
248
+ { style: { color: '#ED8936', margin: '0' } },
235
249
  '>> Connecting to Control Tower... Sending payload.'
236
250
  ),
237
251
 
238
252
  this.state.reportStatus === 'success' && React.createElement(
239
253
  'div',
240
- { style: { margin: '0', padding: '0', display: 'block' } },
241
- React.createElement('div', { style: { color: '#38A169', fontWeight: 'bold', display: 'block', margin: '0' } }, '>> Transmit complete. Core engine initialized.'),
242
- React.createElement('div', { style: { color: '#A0AEC0', fontStyle: 'italic', fontSize: '13px', display: 'block', margin: '4px 0 0 0' } }, 'AI๊ฐ€ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์žฌ์ˆ˜์ •ํ•˜๋Š” ๋™์•ˆ ์ž ์‹œ๋งŒ ๊ธฐ๋‹ค๋ ค์ฃผ์„ธ์š”...')
254
+ { style: { display: 'flex', flexDirection: 'column', gap: '12px', margin: '0' } },
255
+ React.createElement('div', { style: { color: '#38A169', fontWeight: 'bold' } }, '>> Transmit complete. Core engine initialized.'),
256
+ React.createElement('div', { style: { color: '#A0AEC0', fontStyle: 'italic', fontSize: '13px' } }, 'AI๊ฐ€ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์žฌ์ˆ˜์ •ํ•˜๋Š” ๋™์•ˆ ์ž ์‹œ๋งŒ ๊ธฐ๋‹ค๋ ค์ฃผ์„ธ์š”...')
243
257
  )
244
258
  )
245
259
  );