@remotex-labs/xmap 3.0.5 → 4.0.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.
@@ -1,61 +1,20 @@
1
+
1
2
  /**
2
- * Interface representing a stack frame in a stack trace.
3
- *
4
- * This structure provides detailed information about the location
5
- * of a specific frame in the stack trace, primarily used in error debugging and stack analysis.
6
- * It optionally includes information about the line, column, file, function name, and other details
7
- * about the origin of the code.
8
- *
9
- * Properties:
10
- * - source: The source code relevant to the stack frame.
11
- * - line: An optional line number in the code associated with this frame.
12
- * - column: An optional column number in the line associated with this frame.
13
- * - fileName: The name of the file associated with the frame, if available.
14
- * - functionName: The name of the function where the stack frame is located, if available.
15
- * - eval: Indicates if the stack frame originates from an evaluated script.
16
- * - async: Indicates if the stack frame is part of an asynchronous operation.
17
- * - native: Indicates if the stack frame is part of native code execution.
18
- * - constructor: Indicates if the frame is related to an object constructor invocation.
19
- * - evalOrigin: Optional information about the origin of the code if it resulted from an eval execution,
20
- * including line number, column number, file name, and function name.
21
- *
22
- * @since 3.0.0
3
+ * This file was automatically generated by xBuild.
4
+ * DO NOT EDIT MANUALLY.
5
+ */
6
+ /**
7
+ * Export interfaces
23
8
  */
24
- export interface StackFrame {
25
- source: string;
26
- line?: number;
27
- column?: number;
28
- fileName?: string;
29
- functionName?: string;
30
- eval: boolean;
31
- async: boolean;
32
- native: boolean;
33
- constructor: boolean;
34
- evalOrigin?: {
35
- line?: number;
36
- column?: number;
37
- fileName?: string;
38
- functionName?: string;
39
- };
40
- }
41
9
  /**
42
- * Represents a fully parsed error stack trace with structured information
43
- *
44
- * @see StackFrame
45
- * @since 2.1.0
10
+ * Import will remove at compile time
46
11
  */
47
- export interface ParsedStackTrace {
48
- name: string;
49
- message: string;
50
- stack: StackFrame[];
51
- rawStack: string;
52
- }
53
12
  /**
54
13
  * Enumeration of JavaScript engines that can be detected from stack traces
55
14
  *
56
15
  * @since 2.1.0
57
16
  */
58
- export declare const enum JSEngines {
17
+ declare const enum JSEngines {
59
18
  V8 = 0,
60
19
  SPIDERMONKEY = 1,
61
20
  JAVASCRIPT_CORE = 2,
@@ -107,14 +66,14 @@ export declare function normalizePath(filePath: string): string;
107
66
  * Creates a default stack frame object with initial values
108
67
  *
109
68
  * @param source - The original source line from the stack trace
110
- * @returns A new StackFrame object with default null values
69
+ * @returns A new StackFrameInterface object with default null values
111
70
  *
112
- * @see ParsedStackTrace
113
- * @see StackFrame
71
+ * @see ParsedStackTraceInterface
72
+ * @see StackFrameInterface
114
73
  *
115
74
  * @since 2.1.0
116
75
  */
117
- export declare function createDefaultFrame(source: string): StackFrame;
76
+ export declare function createDefaultFrame(source: string): StackFrameInterface;
118
77
  /**
119
78
  * Safely parses a string value to an integer, handling undefined and null cases
120
79
  *
@@ -132,10 +91,10 @@ export declare function createDefaultFrame(source: string): StackFrame;
132
91
  */
133
92
  export declare function safeParseInt(value: string | undefined | null): number | undefined;
134
93
  /**
135
- * Parses a V8 JavaScript engine stack trace line into a structured StackFrame object
94
+ * Parses a V8 JavaScript engine stack trace line into a structured StackFrameInterface object
136
95
  *
137
96
  * @param line - The stack trace line to parse
138
- * @returns A StackFrame object containing the parsed information
97
+ * @returns A StackFrameInterface object containing the parsed information
139
98
  *
140
99
  * @remarks
141
100
  * Handles both standard V8 stack frames and eval-generated stack frames which
@@ -152,17 +111,17 @@ export declare function safeParseInt(value: string | undefined | null): number |
152
111
  *
153
112
  * @throws Error - If the line format doesn't match any known V8 pattern
154
113
  *
155
- * @see StackFrame
114
+ * @see StackFrameInterface
156
115
  * @see createDefaultFrame
157
116
  *
158
117
  * @since 2.1.0
159
118
  */
160
- export declare function parseV8StackLine(line: string): StackFrame;
119
+ export declare function parseV8StackLine(line: string): StackFrameInterface;
161
120
  /**
162
- * Parses a SpiderMonkey JavaScript engine stack trace line into a structured StackFrame object
121
+ * Parses a SpiderMonkey JavaScript engine stack trace line into a structured StackFrameInterface object
163
122
  *
164
123
  * @param line - The stack trace line to parse
165
- * @returns A StackFrame object containing the parsed information
124
+ * @returns A StackFrameInterface object containing the parsed information
166
125
  *
167
126
  * @remarks
168
127
  * Handles both standard SpiderMonkey stack frames and eval/Function-generated stack frames
@@ -177,17 +136,17 @@ export declare function parseV8StackLine(line: string): StackFrame;
177
136
  * parseSpiderMonkeyStackLine("evalFn@/source.js line 5 > eval:1:5");
178
137
  * ```
179
138
  *
180
- * @see StackFrame
139
+ * @see StackFrameInterface
181
140
  * @see createDefaultFrame
182
141
  *
183
142
  * @since 2.1.0
184
143
  */
185
- export declare function parseSpiderMonkeyStackLine(line: string): StackFrame;
144
+ export declare function parseSpiderMonkeyStackLine(line: string): StackFrameInterface;
186
145
  /**
187
- * Parses a JavaScriptCore engine stack trace line into a structured StackFrame object
146
+ * Parses a JavaScriptCore engine stack trace line into a structured StackFrameInterface object
188
147
  *
189
148
  * @param line - The stack trace line to parse
190
- * @returns A StackFrame object containing the parsed information
149
+ * @returns A StackFrameInterface object containing the parsed information
191
150
  *
192
151
  * @remarks
193
152
  * Handles both standard JavaScriptCore stack frames and eval-generated stack frames.
@@ -202,18 +161,18 @@ export declare function parseSpiderMonkeyStackLine(line: string): StackFrame;
202
161
  * parseJavaScriptCoreStackLine("eval code@");
203
162
  * ```
204
163
  *
205
- * @see StackFrame
164
+ * @see StackFrameInterface
206
165
  * @see createDefaultFrame
207
166
  *
208
167
  * @since 2.1.0
209
168
  */
210
- export declare function parseJavaScriptCoreStackLine(line: string): StackFrame;
169
+ export declare function parseJavaScriptCoreStackLine(line: string): StackFrameInterface;
211
170
  /**
212
171
  * Parses a stack trace line based on the detected JavaScript engine
213
172
  *
214
173
  * @param line - The stack trace line to parse
215
174
  * @param engine - The JavaScript engine type that generated the stack trace
216
- * @returns A StackFrame object containing the parsed information
175
+ * @returns A StackFrameInterface object containing the parsed information
217
176
  *
218
177
  * @remarks
219
178
  * Delegates to the appropriate parsing function based on the JavaScript engine.
@@ -232,12 +191,12 @@ export declare function parseJavaScriptCoreStackLine(line: string): StackFrame;
232
191
  *
233
192
  * @since 2.1.0
234
193
  */
235
- export declare function parseStackLine(line: string, engine: JSEngines): StackFrame;
194
+ export declare function parseStackLine(line: string, engine: JSEngines): StackFrameInterface;
236
195
  /**
237
196
  * Parses a complete error stack trace into a structured format
238
197
  *
239
198
  * @param error - Error object or error message string to parse
240
- * @returns A ParsedStackTrace object containing structured stack trace information
199
+ * @returns A ParsedStackTraceInterface object containing structured stack trace information
241
200
  *
242
201
  * @remarks
243
202
  * Automatically detects the JavaScript engine from the stack format.
@@ -252,15 +211,68 @@ export declare function parseStackLine(line: string, engine: JSEngines): StackFr
252
211
  * const parsedStack = parseErrorStack(error);
253
212
  * console.log(parsedStack.name); // "Error"
254
213
  * console.log(parsedStack.message); // "Something went wrong"
255
- * console.log(parsedStack.stack); // Array of StackFrame objects
214
+ * console.log(parsedStack.stack); // Array of StackFrameInterface objects
256
215
  * }
257
216
  * ```
258
217
  *
259
- * @see ParsedStackTrace
260
- * @see StackFrame
218
+ * @see ParsedStackTraceInterface
219
+ * @see StackFrameInterface
261
220
  * @see parseStackLine
262
221
  * @see detectJSEngine
263
222
  *
264
223
  * @since 2.1.0
265
224
  */
266
- export declare function parseErrorStack(error: Error | string): ParsedStackTrace;
225
+ export declare function parseErrorStack(error: Error | string): ParsedStackTraceInterface;
226
+
227
+ /**
228
+ * Interface representing a stack frame in a stack trace.
229
+ *
230
+ * This structure provides detailed information about the location
231
+ * of a specific frame in the stack trace, primarily used in error debugging and stack analysis.
232
+ * It optionally includes information about the line, column, file, function name, and other details
233
+ * about the origin of the code.
234
+ *
235
+ * Properties:
236
+ * - source: The source code relevant to the stack frame.
237
+ * - line: An optional line number in the code associated with this frame.
238
+ * - column: An optional column number in the line associated with this frame.
239
+ * - fileName: The name of the file associated with the frame, if available.
240
+ * - functionName: The name of the function where the stack frame is located, if available.
241
+ * - eval: Indicates if the stack frame originates from an evaluated script.
242
+ * - async: Indicates if the stack frame is part of an asynchronous operation.
243
+ * - native: Indicates if the stack frame is part of native code execution.
244
+ * - constructor: Indicates if the frame is related to an object constructor invocation.
245
+ * - evalOrigin: Optional information about the origin of the code if it resulted from an eval execution,
246
+ * including line number, column number, file name, and function name.
247
+ *
248
+ * @since 3.0.0
249
+ */
250
+ export interface StackFrameInterface {
251
+ source: string;
252
+ line?: number;
253
+ column?: number;
254
+ fileName?: string;
255
+ functionName?: string;
256
+ eval: boolean;
257
+ async: boolean;
258
+ native: boolean;
259
+ constructor: boolean;
260
+ evalOrigin?: {
261
+ line?: number;
262
+ column?: number;
263
+ fileName?: string;
264
+ functionName?: string;
265
+ };
266
+ }
267
+ /**
268
+ * Represents a fully parsed error stack trace with structured information
269
+ *
270
+ * @see StackFrameInterface
271
+ * @since 2.1.0
272
+ */
273
+ export interface ParsedStackTraceInterface {
274
+ name: string;
275
+ message: string;
276
+ stack: StackFrameInterface[];
277
+ rawStack: string;
278
+ }
package/package.json CHANGED
@@ -5,10 +5,10 @@
5
5
  "types": "./dist/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
7
7
  "author": "Garefild",
8
- "version": "3.0.5",
8
+ "version": "4.0.0",
9
9
  "license": "Mozilla Public License Version 2.0",
10
10
  "description": "A library with a sourcemap parser and TypeScript code formatter for the CLI",
11
- "homepage": "https://github.com/remotex-lab/xMap",
11
+ "homepage": "https://remotex-labs.github.io/xMap/",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "git+https://github.com/remotex-lab/xMap.git"
@@ -32,7 +32,7 @@
32
32
  "typescript runner"
33
33
  ],
34
34
  "engines": {
35
- "node": ">=18"
35
+ "node": ">=20"
36
36
  },
37
37
  "typesVersions": {
38
38
  "*": {
@@ -86,19 +86,26 @@
86
86
  "lint": "xbuild --tc && eslint . -c ./eslint.config.mjs",
87
87
  "ci:test": "jest",
88
88
  "ci:clean": "rm -rf ./dist",
89
- "ci:build": "npm run build"
89
+ "ci:build": "npm run build",
90
+ "docs:dev": "vitepress dev docs",
91
+ "docs:build": "vitepress build docs",
92
+ "docs:preview": "vitepress preview docs"
90
93
  },
91
94
  "devDependencies": {
92
- "jest": "^29.7.0",
93
- "eslint": "^9.24.0",
94
- "typescript-eslint": "^8.29.0",
95
+ "jest": "^30.0.5",
96
+ "eslint": "^9.28.0",
97
+ "vitepress": "^1.6.4",
98
+ "typescript-eslint": "^8.40.0",
95
99
  "eslint-plugin-tsdoc": "^0.4.0",
96
- "@swc/jest": "^0.2.37",
97
- "@types/jest": "^29.5.14",
98
- "@types/node": "^22.14.0",
99
- "@remotex-labs/xbuild": "^1.5.7"
100
+ "vitepress-versioning-plugin": "^1.3.0",
101
+ "eslint-plugin-perfectionist": "^4.15.0",
102
+ "@swc/jest": "^0.2.39",
103
+ "@types/jest": "^30.0.0",
104
+ "@types/node": "^24.3.0",
105
+ "@remotex-labs/xbuild": "^1.6.0"
100
106
  },
101
107
  "dependencies": {
102
- "typescript": "^5.8.3"
108
+ "typescript": "^5.9.2",
109
+ "@remotex-labs/xansi": "^1.1.1"
103
110
  }
104
111
  }