@routier/core 0.1.0-rc.2 → 0.2.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.
- package/dist/assertions/index.js +4 -15
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.js +58 -97
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/index.js +21 -36
- package/dist/codegen/index.js.map +1 -1
- package/dist/collections/index.js +49 -92
- package/dist/collections/index.js.map +1 -1
- package/dist/errors/index.js +4 -15
- package/dist/errors/index.js.map +1 -1
- package/dist/expressions/index.js +62 -93
- package/dist/expressions/index.js.map +1 -1
- package/dist/index.js +1683 -2302
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +4 -15
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.js +30 -53
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.js +260 -361
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +6 -5
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +5 -5
- package/dist/plugins/replication/types.d.ts +1 -0
- package/dist/plugins/types.d.ts +1 -1
- package/dist/results/index.js +11 -26
- package/dist/results/index.js.map +1 -1
- package/dist/schema/SchemaDefinition.d.ts +7 -6
- package/dist/schema/index.js +1073 -1490
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/testSchemas.test.d.ts +14 -14
- package/dist/schema/types.d.ts +5 -3
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/index.js +61 -124
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/types.d.ts +17 -2
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/assertions/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
var __webpack_modules__ = ({
|
|
2
|
-
"./src/utilities/dates.ts"
|
|
3
|
-
/*!********************************!*\
|
|
4
|
-
!*** ./src/utilities/dates.ts ***!
|
|
5
|
-
\********************************/
|
|
6
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2
|
+
"./src/utilities/dates.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7
3
|
__webpack_require__.r(__webpack_exports__);
|
|
8
4
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
5
|
isDate: () => (isDate)
|
|
@@ -19,10 +15,9 @@ const isDate = (data) => {
|
|
|
19
15
|
};
|
|
20
16
|
|
|
21
17
|
|
|
22
|
-
}
|
|
18
|
+
},
|
|
23
19
|
|
|
24
20
|
});
|
|
25
|
-
/************************************************************************/
|
|
26
21
|
// The module cache
|
|
27
22
|
var __webpack_module_cache__ = {};
|
|
28
23
|
|
|
@@ -46,7 +41,6 @@ return module.exports;
|
|
|
46
41
|
|
|
47
42
|
}
|
|
48
43
|
|
|
49
|
-
/************************************************************************/
|
|
50
44
|
// webpack/runtime/define_property_getters
|
|
51
45
|
(() => {
|
|
52
46
|
__webpack_require__.d = (exports, definition) => {
|
|
@@ -71,14 +65,9 @@ __webpack_require__.r = (exports) => {
|
|
|
71
65
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
72
66
|
};
|
|
73
67
|
})();
|
|
74
|
-
/************************************************************************/
|
|
75
68
|
var __webpack_exports__ = {};
|
|
76
69
|
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
77
70
|
(() => {
|
|
78
|
-
|
|
79
|
-
/*!*********************************!*\
|
|
80
|
-
!*** ./src/assertions/index.ts ***!
|
|
81
|
-
\*********************************/
|
|
82
71
|
__webpack_require__.r(__webpack_exports__);
|
|
83
72
|
__webpack_require__.d(__webpack_exports__, {
|
|
84
73
|
assertDate: () => (assertDate),
|
|
@@ -87,10 +76,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
87
76
|
assertIsNotNull: () => (assertIsNotNull),
|
|
88
77
|
assertString: () => (assertString)
|
|
89
78
|
});
|
|
90
|
-
/*
|
|
79
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/dates.ts");
|
|
91
80
|
|
|
92
81
|
function assertDate(data) {
|
|
93
|
-
if ((0,
|
|
82
|
+
if ((0,_utilities__rspack_import_0.isDate)(data) === false) {
|
|
94
83
|
throw new TypeError('Value is not a Date');
|
|
95
84
|
}
|
|
96
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions/index.js","sources":["webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/assertions/index.ts"],"sourcesContent":["export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { isDate } from \"../utilities\";\n\nexport function assertDate(data: unknown): asserts data is Date {\n if (isDate(data) === false) {\n throw new TypeError('Value is not a Date');\n }\n}\n\nexport function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T> {\n if (data == null) {\n if (message == null) {\n throw new TypeError('Assertion failed, data is null');\n }\n\n if (typeof message === \"string\") {\n throw new TypeError(message);\n }\n\n throw new TypeError(message());\n }\n}\n\nexport function assertIsArray<T>(data: unknown, message?: string): asserts data is T[] {\n if (!Array.isArray(data)) {\n throw new TypeError(message ?? 'Assertion failed, data is not of type Array');\n }\n}\n\nexport function assertString(data: unknown, message?: string): asserts data is string {\n if (typeof data !== \"string\") {\n throw new TypeError(message ?? 'Assertion failed, data is not of type String');\n }\n}\n\nexport function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T {\n if (value instanceof Instance) {\n return;\n }\n\n if (value != null && typeof value === \"object\" && \"constructor\" in value) {\n throw new TypeError(`Value is not instance of type. Type: ${value.constructor.name}`);\n }\n\n throw new TypeError(`Value is not instance of type`);\n}"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assertions/index.js","sources":["webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/assertions/index.ts"],"sourcesContent":["export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { isDate } from \"../utilities\";\n\nexport function assertDate(data: unknown): asserts data is Date {\n if (isDate(data) === false) {\n throw new TypeError('Value is not a Date');\n }\n}\n\nexport function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T> {\n if (data == null) {\n if (message == null) {\n throw new TypeError('Assertion failed, data is null');\n }\n\n if (typeof message === \"string\") {\n throw new TypeError(message);\n }\n\n throw new TypeError(message());\n }\n}\n\nexport function assertIsArray<T>(data: unknown, message?: string): asserts data is T[] {\n if (!Array.isArray(data)) {\n throw new TypeError(message ?? 'Assertion failed, data is not of type Array');\n }\n}\n\nexport function assertString(data: unknown, message?: string): asserts data is string {\n if (typeof data !== \"string\") {\n throw new TypeError(message ?? 'Assertion failed, data is not of type String');\n }\n}\n\nexport function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T {\n if (value instanceof Instance) {\n return;\n }\n\n if (value != null && typeof value === \"object\" && \"constructor\" in value) {\n throw new TypeError(`Value is not instance of type. Type: ${value.constructor.name}`);\n }\n\n throw new TypeError(`Value is not instance of type`);\n}"],"names":[],"mappings":";;;;;;AAAO,MAAM,MAAM,GAAG,CAAC,IAAa,EAAgB,EAAE;IAClD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,YAAY,IAAI,CAAC;AAChC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;;ACNsC;AAE/B,SAAS,UAAU,CAAC,IAAa;IACpC,IAAI,sCAAM,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC/C,CAAC;AACL,CAAC;AAEM,SAAS,eAAe,CAAI,IAA0B,EAAE,OAAiC;IAC5F,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IACnC,CAAC;AACL,CAAC;AAEM,SAAS,aAAa,CAAI,IAAa,EAAE,OAAgB;IAC5D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,SAAS,CAAC,OAAO,IAAI,6CAA6C,CAAC,CAAC;IAClF,CAAC;AACL,CAAC;AAEM,SAAS,YAAY,CAAC,IAAa,EAAE,OAAgB;IACxD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,OAAO,IAAI,8CAA8C,CAAC,CAAC;IACnF,CAAC;AACL,CAAC;AAEM,SAAS,gBAAgB,CAAwC,KAAc,EAAE,QAAW;IAC/F,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QAC5B,OAAO;IACX,CAAC;IAED,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,aAAa,IAAI,KAAK,EAAE,CAAC;QACvE,MAAM,IAAI,SAAS,CAAC,yCAAyC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,IAAI,SAAS,CAAC,+BAA+B,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
var __webpack_modules__ = ({
|
|
2
|
-
"./src/capabilities/Capability.ts"
|
|
3
|
-
/*!****************************************!*\
|
|
4
|
-
!*** ./src/capabilities/Capability.ts ***!
|
|
5
|
-
\****************************************/
|
|
6
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2
|
+
"./src/capabilities/Capability.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
7
3
|
__webpack_require__.r(__webpack_exports__);
|
|
8
4
|
__webpack_require__.d(__webpack_exports__, {
|
|
9
5
|
Capability: () => (Capability)
|
|
@@ -110,27 +106,23 @@ class Capability {
|
|
|
110
106
|
}
|
|
111
107
|
|
|
112
108
|
|
|
113
|
-
}
|
|
114
|
-
"./src/capabilities/PerformanceCapability.ts"
|
|
115
|
-
/*!***************************************************!*\
|
|
116
|
-
!*** ./src/capabilities/PerformanceCapability.ts ***!
|
|
117
|
-
\***************************************************/
|
|
118
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
109
|
+
},
|
|
110
|
+
"./src/capabilities/PerformanceCapability.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
119
111
|
__webpack_require__.r(__webpack_exports__);
|
|
120
112
|
__webpack_require__.d(__webpack_exports__, {
|
|
121
113
|
PerformanceCapability: () => (PerformanceCapability)
|
|
122
114
|
});
|
|
123
|
-
/*
|
|
124
|
-
/*
|
|
125
|
-
/*
|
|
126
|
-
/*
|
|
127
|
-
/*
|
|
115
|
+
/* import */ var _utilities__rspack_import_4 = __webpack_require__("./src/utilities/strings.ts");
|
|
116
|
+
/* import */ var _Capability__rspack_import_0 = __webpack_require__("./src/capabilities/Capability.ts");
|
|
117
|
+
/* import */ var _performance_PerformanceTracker__rspack_import_2 = __webpack_require__("./src/capabilities/performance/PerformanceTracker.ts");
|
|
118
|
+
/* import */ var _tracing_CallTraceManager__rspack_import_1 = __webpack_require__("./src/capabilities/tracing/CallTraceManager.ts");
|
|
119
|
+
/* import */ var _utilities__rspack_import_3 = __webpack_require__("./src/utilities/logger.ts");
|
|
128
120
|
|
|
129
121
|
|
|
130
122
|
|
|
131
123
|
|
|
132
124
|
|
|
133
|
-
class PerformanceCapability extends
|
|
125
|
+
class PerformanceCapability extends _Capability__rspack_import_0.Capability {
|
|
134
126
|
callTraceManager;
|
|
135
127
|
performanceTracker;
|
|
136
128
|
filter;
|
|
@@ -138,8 +130,8 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
138
130
|
constructor(options) {
|
|
139
131
|
super();
|
|
140
132
|
this.filter = options?.filter ?? (() => true);
|
|
141
|
-
this.callTraceManager = new
|
|
142
|
-
this.performanceTracker = new
|
|
133
|
+
this.callTraceManager = new _tracing_CallTraceManager__rspack_import_1.CallTraceManager();
|
|
134
|
+
this.performanceTracker = new _performance_PerformanceTracker__rspack_import_2.PerformanceTracker();
|
|
143
135
|
}
|
|
144
136
|
apply(instance) {
|
|
145
137
|
this.explore(instance, (meta, info) => {
|
|
@@ -161,12 +153,12 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
161
153
|
depth = callTrace.length - 1;
|
|
162
154
|
const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
|
|
163
155
|
this.performanceTracker.startMethodTiming(operationId, path);
|
|
164
|
-
|
|
165
|
-
|
|
156
|
+
_utilities__rspack_import_3.logger.log(`\n${'═'.repeat(60)}`);
|
|
157
|
+
_utilities__rspack_import_3.logger.log(`▶ ORIGIN [${operationId}] ${path}`);
|
|
166
158
|
if (args.length > 0) {
|
|
167
|
-
|
|
159
|
+
_utilities__rspack_import_3.logger.log(` Args:`, (0,_utilities__rspack_import_4.stringifyObject)(args, 4, 0));
|
|
168
160
|
}
|
|
169
|
-
|
|
161
|
+
_utilities__rspack_import_3.logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
|
|
170
162
|
}
|
|
171
163
|
else {
|
|
172
164
|
operationId = this.callTraceManager.getActiveOperationId();
|
|
@@ -177,9 +169,9 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
177
169
|
const childMethodKey = `${operationId}:${path}`;
|
|
178
170
|
this.childDurations.set(childMethodKey, []);
|
|
179
171
|
this.performanceTracker.startMethodTiming(operationId, path);
|
|
180
|
-
|
|
172
|
+
_utilities__rspack_import_3.logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);
|
|
181
173
|
if (args.length > 0) {
|
|
182
|
-
|
|
174
|
+
_utilities__rspack_import_3.logger.log(`${indent} Args:`, (0,_utilities__rspack_import_4.stringifyObject)(args, 4, 0));
|
|
183
175
|
}
|
|
184
176
|
}
|
|
185
177
|
try {
|
|
@@ -195,14 +187,14 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
195
187
|
const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);
|
|
196
188
|
const overhead = duration - totalChildTime;
|
|
197
189
|
const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
_utilities__rspack_import_3.logger.log(`\n${'═'.repeat(60)}`);
|
|
191
|
+
_utilities__rspack_import_3.logger.log(`◀ COMPLETE [${operationId}] ${path}`);
|
|
192
|
+
_utilities__rspack_import_3.logger.log(` Total Duration: ${formattedDuration}`);
|
|
201
193
|
if (childDurations.length > 0) {
|
|
202
|
-
|
|
203
|
-
|
|
194
|
+
_utilities__rspack_import_3.logger.log(` Children Duration: ${formattedTotalChildTime} (${childDurations.length} calls)`);
|
|
195
|
+
_utilities__rspack_import_3.logger.log(` Overhead: ${formattedOverhead}`);
|
|
204
196
|
}
|
|
205
|
-
|
|
197
|
+
_utilities__rspack_import_3.logger.log(`${'═'.repeat(60)}\n`);
|
|
206
198
|
this.childDurations.delete(operationId);
|
|
207
199
|
this.performanceTracker.cleanupOperation(operationId);
|
|
208
200
|
this.callTraceManager.endOperation();
|
|
@@ -215,9 +207,9 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
215
207
|
const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);
|
|
216
208
|
const overhead = duration - totalChildTime;
|
|
217
209
|
const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));
|
|
218
|
-
|
|
210
|
+
_utilities__rspack_import_3.logger.log(`${indent} ✓ ${formattedDuration}`);
|
|
219
211
|
if (childDurations.length > 0) {
|
|
220
|
-
|
|
212
|
+
_utilities__rspack_import_3.logger.log(`${indent} Children: ${formattedTotalChildTime} (${childDurations.length} calls), Overhead: ${formattedOverhead}`);
|
|
221
213
|
}
|
|
222
214
|
// Clean up child method tracking
|
|
223
215
|
this.childDurations.delete(childMethodKey);
|
|
@@ -254,31 +246,27 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
254
246
|
}
|
|
255
247
|
|
|
256
248
|
|
|
257
|
-
}
|
|
258
|
-
"./src/capabilities/TracingCapability.ts"
|
|
259
|
-
/*!***********************************************!*\
|
|
260
|
-
!*** ./src/capabilities/TracingCapability.ts ***!
|
|
261
|
-
\***********************************************/
|
|
262
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
249
|
+
},
|
|
250
|
+
"./src/capabilities/TracingCapability.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
263
251
|
__webpack_require__.r(__webpack_exports__);
|
|
264
252
|
__webpack_require__.d(__webpack_exports__, {
|
|
265
253
|
TracingCapability: () => (TracingCapability)
|
|
266
254
|
});
|
|
267
|
-
/*
|
|
268
|
-
/*
|
|
269
|
-
/*
|
|
270
|
-
/*
|
|
255
|
+
/* import */ var _Capability__rspack_import_0 = __webpack_require__("./src/capabilities/Capability.ts");
|
|
256
|
+
/* import */ var _tracing_CallTraceManager__rspack_import_1 = __webpack_require__("./src/capabilities/tracing/CallTraceManager.ts");
|
|
257
|
+
/* import */ var _utilities_strings__rspack_import_3 = __webpack_require__("./src/utilities/strings.ts");
|
|
258
|
+
/* import */ var _utilities__rspack_import_2 = __webpack_require__("./src/utilities/logger.ts");
|
|
271
259
|
|
|
272
260
|
|
|
273
261
|
|
|
274
262
|
|
|
275
|
-
class TracingCapability extends
|
|
263
|
+
class TracingCapability extends _Capability__rspack_import_0.Capability {
|
|
276
264
|
callTraceManager;
|
|
277
265
|
filter;
|
|
278
266
|
constructor(options) {
|
|
279
267
|
super();
|
|
280
268
|
this.filter = options?.filter ?? (() => true);
|
|
281
|
-
this.callTraceManager = new
|
|
269
|
+
this.callTraceManager = new _tracing_CallTraceManager__rspack_import_1.CallTraceManager();
|
|
282
270
|
}
|
|
283
271
|
apply(instance) {
|
|
284
272
|
this.explore(instance, (meta, info) => {
|
|
@@ -295,20 +283,20 @@ class TracingCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Capabil
|
|
|
295
283
|
operationId = this.callTraceManager.startNewOperation();
|
|
296
284
|
const callTrace = this.callTraceManager.addMethodToTrace(path);
|
|
297
285
|
const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
|
|
298
|
-
|
|
299
|
-
|
|
286
|
+
_utilities__rspack_import_2.logger.log(`\n${'═'.repeat(60)}`);
|
|
287
|
+
_utilities__rspack_import_2.logger.log(`▶ ORIGIN [${operationId}] ${path}`);
|
|
300
288
|
if (args.length > 0) {
|
|
301
|
-
|
|
289
|
+
_utilities__rspack_import_2.logger.log(` Args:`, (0,_utilities_strings__rspack_import_3.stringifyObject)(args, 4, 0));
|
|
302
290
|
}
|
|
303
|
-
|
|
291
|
+
_utilities__rspack_import_2.logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
|
|
304
292
|
}
|
|
305
293
|
else {
|
|
306
294
|
operationId = this.callTraceManager.getActiveOperationId();
|
|
307
295
|
const callTrace = this.callTraceManager.addMethodToTrace(path);
|
|
308
296
|
const indent = ' '.repeat(Math.min(callTrace.length - 1, 4));
|
|
309
|
-
|
|
297
|
+
_utilities__rspack_import_2.logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);
|
|
310
298
|
if (args.length > 0) {
|
|
311
|
-
|
|
299
|
+
_utilities__rspack_import_2.logger.log(`${indent} Args:`, (0,_utilities_strings__rspack_import_3.stringifyObject)(args, 4, 0));
|
|
312
300
|
}
|
|
313
301
|
}
|
|
314
302
|
try {
|
|
@@ -327,12 +315,8 @@ class TracingCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Capabil
|
|
|
327
315
|
}
|
|
328
316
|
|
|
329
317
|
|
|
330
|
-
}
|
|
331
|
-
"./src/capabilities/performance/PerformanceTracker.ts"
|
|
332
|
-
/*!************************************************************!*\
|
|
333
|
-
!*** ./src/capabilities/performance/PerformanceTracker.ts ***!
|
|
334
|
-
\************************************************************/
|
|
335
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
318
|
+
},
|
|
319
|
+
"./src/capabilities/performance/PerformanceTracker.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
336
320
|
__webpack_require__.r(__webpack_exports__);
|
|
337
321
|
__webpack_require__.d(__webpack_exports__, {
|
|
338
322
|
PerformanceTracker: () => (PerformanceTracker)
|
|
@@ -398,23 +382,19 @@ class PerformanceTracker {
|
|
|
398
382
|
}
|
|
399
383
|
|
|
400
384
|
|
|
401
|
-
}
|
|
402
|
-
"./src/capabilities/tracing/CallTraceManager.ts"
|
|
403
|
-
/*!******************************************************!*\
|
|
404
|
-
!*** ./src/capabilities/tracing/CallTraceManager.ts ***!
|
|
405
|
-
\******************************************************/
|
|
406
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
385
|
+
},
|
|
386
|
+
"./src/capabilities/tracing/CallTraceManager.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
407
387
|
__webpack_require__.r(__webpack_exports__);
|
|
408
388
|
__webpack_require__.d(__webpack_exports__, {
|
|
409
389
|
CallTraceManager: () => (CallTraceManager)
|
|
410
390
|
});
|
|
411
|
-
/*
|
|
391
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/uuid.ts");
|
|
412
392
|
|
|
413
393
|
class CallTraceManager {
|
|
414
394
|
activeOperationId = null;
|
|
415
395
|
activeCallStack = [];
|
|
416
396
|
startNewOperation() {
|
|
417
|
-
const operationId = (0,
|
|
397
|
+
const operationId = (0,_utilities__rspack_import_0.uuid)(8);
|
|
418
398
|
this.activeOperationId = operationId;
|
|
419
399
|
this.activeCallStack = [];
|
|
420
400
|
return operationId;
|
|
@@ -455,12 +435,8 @@ class CallTraceManager {
|
|
|
455
435
|
}
|
|
456
436
|
|
|
457
437
|
|
|
458
|
-
}
|
|
459
|
-
"./src/utilities/logger.ts"
|
|
460
|
-
/*!*********************************!*\
|
|
461
|
-
!*** ./src/utilities/logger.ts ***!
|
|
462
|
-
\*********************************/
|
|
463
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
438
|
+
},
|
|
439
|
+
"./src/utilities/logger.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
464
440
|
__webpack_require__.r(__webpack_exports__);
|
|
465
441
|
__webpack_require__.d(__webpack_exports__, {
|
|
466
442
|
logger: () => (logger)
|
|
@@ -500,12 +476,8 @@ const logger = {
|
|
|
500
476
|
};
|
|
501
477
|
|
|
502
478
|
|
|
503
|
-
}
|
|
504
|
-
"./src/utilities/strings.ts"
|
|
505
|
-
/*!**********************************!*\
|
|
506
|
-
!*** ./src/utilities/strings.ts ***!
|
|
507
|
-
\**********************************/
|
|
508
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
479
|
+
},
|
|
480
|
+
"./src/utilities/strings.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
509
481
|
__webpack_require__.r(__webpack_exports__);
|
|
510
482
|
__webpack_require__.d(__webpack_exports__, {
|
|
511
483
|
fastHash: () => (fastHash),
|
|
@@ -666,12 +638,8 @@ function stringifyPlainObject(obj, maxDepth, currentDepth) {
|
|
|
666
638
|
}
|
|
667
639
|
|
|
668
640
|
|
|
669
|
-
}
|
|
670
|
-
"./src/utilities/uuid.ts"
|
|
671
|
-
/*!*******************************!*\
|
|
672
|
-
!*** ./src/utilities/uuid.ts ***!
|
|
673
|
-
\*******************************/
|
|
674
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
641
|
+
},
|
|
642
|
+
"./src/utilities/uuid.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
675
643
|
__webpack_require__.r(__webpack_exports__);
|
|
676
644
|
__webpack_require__.d(__webpack_exports__, {
|
|
677
645
|
uuid: () => (uuid),
|
|
@@ -728,10 +696,9 @@ const uuidv4 = () => {
|
|
|
728
696
|
};
|
|
729
697
|
|
|
730
698
|
|
|
731
|
-
}
|
|
699
|
+
},
|
|
732
700
|
|
|
733
701
|
});
|
|
734
|
-
/************************************************************************/
|
|
735
702
|
// The module cache
|
|
736
703
|
var __webpack_module_cache__ = {};
|
|
737
704
|
|
|
@@ -755,7 +722,6 @@ return module.exports;
|
|
|
755
722
|
|
|
756
723
|
}
|
|
757
724
|
|
|
758
|
-
/************************************************************************/
|
|
759
725
|
// webpack/runtime/define_property_getters
|
|
760
726
|
(() => {
|
|
761
727
|
__webpack_require__.d = (exports, definition) => {
|
|
@@ -780,23 +746,18 @@ __webpack_require__.r = (exports) => {
|
|
|
780
746
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
781
747
|
};
|
|
782
748
|
})();
|
|
783
|
-
/************************************************************************/
|
|
784
749
|
var __webpack_exports__ = {};
|
|
785
750
|
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
786
751
|
(() => {
|
|
787
|
-
|
|
788
|
-
/*!***********************************!*\
|
|
789
|
-
!*** ./src/capabilities/index.ts ***!
|
|
790
|
-
\***********************************/
|
|
791
752
|
__webpack_require__.r(__webpack_exports__);
|
|
792
753
|
__webpack_require__.d(__webpack_exports__, {
|
|
793
|
-
Capability: () => (/* reexport safe */
|
|
794
|
-
PerformanceCapability: () => (/* reexport safe */
|
|
795
|
-
TracingCapability: () => (/* reexport safe */
|
|
754
|
+
Capability: () => (/* reexport safe */ _Capability__rspack_import_0.Capability),
|
|
755
|
+
PerformanceCapability: () => (/* reexport safe */ _PerformanceCapability__rspack_import_1.PerformanceCapability),
|
|
756
|
+
TracingCapability: () => (/* reexport safe */ _TracingCapability__rspack_import_2.TracingCapability)
|
|
796
757
|
});
|
|
797
|
-
/*
|
|
798
|
-
/*
|
|
799
|
-
/*
|
|
758
|
+
/* import */ var _Capability__rspack_import_0 = __webpack_require__("./src/capabilities/Capability.ts");
|
|
759
|
+
/* import */ var _PerformanceCapability__rspack_import_1 = __webpack_require__("./src/capabilities/PerformanceCapability.ts");
|
|
760
|
+
/* import */ var _TracingCapability__rspack_import_2 = __webpack_require__("./src/capabilities/TracingCapability.ts");
|
|
800
761
|
|
|
801
762
|
|
|
802
763
|
|