@nine-lab/nine-mu 0.1.361 → 0.1.362

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.361",
3
+ "version": "0.1.362",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -8,15 +8,15 @@ export const NineExceptionStyles = {
8
8
  minHeight: '100%',
9
9
  flexGrow: 1,
10
10
  padding: '25px',
11
- background: '#121314', // 터미널 다크 블랙 배경
12
- // ⭐ 모든 요소의 폰트 크기, 패딩, 높이 기준을 부모 레벨에서 완벽히 통일
11
+ background: '#121314',
13
12
  fontFamily: 'Consolas, Monaco, "Courier New", monospace',
14
- fontSize: '14px',
15
- lineHeight: '1.6', // 줄간격을 터미널 배시 화면 비율(1.6)로 고정
16
- color: '#999', // 기본 텍스트 색상 #999 적용
17
13
  textAlign: 'left',
18
14
  boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
19
- boxSizing: 'border-box'
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ gap: '10px',
18
+ // ⭐ 수정: 아까 보기 좋았던 넉넉하고 정돈된 줄간격 비율로 복구
19
+ lineHeight: '1.5'
20
20
  },
21
21
  // 1. 모든 라인의 display 형식을 'block'으로 맞추고 마진/패딩을 0으로 통일
22
22
  systemError: {
@@ -41,10 +41,12 @@ export const NineExceptionStyles = {
41
41
  },
42
42
  // 3. 에러 위치 추적 라인
43
43
  locationRow: {
44
- color: '#666',
44
+ color: '#999',
45
45
  margin: '0',
46
46
  padding: '0',
47
- display: 'block'
47
+ display: 'block',
48
+ fontFamily: 'inherit',
49
+ fontSize: 'inherit'
48
50
  },
49
51
  // 4. 하단 영역의 flex와 gap을 완전히 제거하여 줄간격 왜곡 원천 차단
50
52
  footer: {
@@ -158,13 +160,26 @@ export class NineExceptionHook extends React.Component {
158
160
  const customStyles = this.props.styles || {};
159
161
 
160
162
  // 🔍 React 컴포넌트 스택에서 파일명과 라인 번호 추출
163
+ // 🔍 React 컴포넌트 스택에서 파일명과 라인 번호 추출기 (경로 정밀 정제 버전)
161
164
  let errorLocation = '';
162
165
  if (this.state.errorInfo?.componentStack) {
163
166
  const lines = this.state.errorInfo.componentStack.trim().split('\n');
164
167
  const targetLine = lines[0] || '';
168
+
169
+ // 1. 기존 방식대로 컴포넌트 이름과 전체 경로를 먼저 매칭합니다.
165
170
  const match = targetLine.match(/at\s+(\w+)\s+\((.*)\)/) || targetLine.match(/at\s+(.*)/);
166
171
  if (match) {
167
- errorLocation = match[2] ? `${match[1]} (${match[2]})` : match[1];
172
+ const componentName = match[1];
173
+ let rawPath = match[2] || '';
174
+
175
+ // 2. ⭐ 핵심: 경로에서 'http://localhost:5173/admin' 또는 'http://.../any-path' 파트를 찾아 통째로 날려버립니다.
176
+ if (rawPath.includes('http://') || rawPath.includes('https://')) {
177
+ // URL 객체나 정규식을 이용해 도메인 영역을 지우고 /src 포맷만 남깁니다.
178
+ rawPath = rawPath.replace(/^https?:\/\/[^\/]+/, '');
179
+ }
180
+
181
+ // 3. 컴포넌트 이름 뒤에 깔끔해진 /src 경로만 붙여줍니다.
182
+ errorLocation = rawPath ? `${componentName} (${rawPath})` : componentName;
168
183
  } else {
169
184
  errorLocation = targetLine.trim();
170
185
  }