@routier/core 0.1.0-rc.1 → 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 +99 -89
- 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 +102 -86
- package/dist/expressions/index.js.map +1 -1
- package/dist/index.js +1737 -2418
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +73 -9
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/TrampolinePipeline.d.ts +0 -8
- package/dist/pipeline/index.js +71 -174
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.js +302 -479
- 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 +1119 -1483
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/types/SchemaNumber.d.ts +1 -0
- package/dist/schema/property/types/SchemaString.d.ts +1 -0
- package/dist/schema/testSchemas.test.d.ts +37 -16
- 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.d.ts +1 -0
- package/dist/utilities/index.js +103 -117
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/logger.d.ts +8 -0
- package/dist/utilities/types.d.ts +17 -2
- package/package.json +3 -2
- 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,25 +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
|
-
/*
|
|
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");
|
|
127
120
|
|
|
128
121
|
|
|
129
122
|
|
|
130
123
|
|
|
131
|
-
|
|
124
|
+
|
|
125
|
+
class PerformanceCapability extends _Capability__rspack_import_0.Capability {
|
|
132
126
|
callTraceManager;
|
|
133
127
|
performanceTracker;
|
|
134
128
|
filter;
|
|
@@ -136,8 +130,8 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
136
130
|
constructor(options) {
|
|
137
131
|
super();
|
|
138
132
|
this.filter = options?.filter ?? (() => true);
|
|
139
|
-
this.callTraceManager = new
|
|
140
|
-
this.performanceTracker = new
|
|
133
|
+
this.callTraceManager = new _tracing_CallTraceManager__rspack_import_1.CallTraceManager();
|
|
134
|
+
this.performanceTracker = new _performance_PerformanceTracker__rspack_import_2.PerformanceTracker();
|
|
141
135
|
}
|
|
142
136
|
apply(instance) {
|
|
143
137
|
this.explore(instance, (meta, info) => {
|
|
@@ -159,12 +153,12 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
159
153
|
depth = callTrace.length - 1;
|
|
160
154
|
const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
|
|
161
155
|
this.performanceTracker.startMethodTiming(operationId, path);
|
|
162
|
-
|
|
163
|
-
|
|
156
|
+
_utilities__rspack_import_3.logger.log(`\n${'═'.repeat(60)}`);
|
|
157
|
+
_utilities__rspack_import_3.logger.log(`▶ ORIGIN [${operationId}] ${path}`);
|
|
164
158
|
if (args.length > 0) {
|
|
165
|
-
|
|
159
|
+
_utilities__rspack_import_3.logger.log(` Args:`, (0,_utilities__rspack_import_4.stringifyObject)(args, 4, 0));
|
|
166
160
|
}
|
|
167
|
-
|
|
161
|
+
_utilities__rspack_import_3.logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
|
|
168
162
|
}
|
|
169
163
|
else {
|
|
170
164
|
operationId = this.callTraceManager.getActiveOperationId();
|
|
@@ -175,9 +169,9 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
175
169
|
const childMethodKey = `${operationId}:${path}`;
|
|
176
170
|
this.childDurations.set(childMethodKey, []);
|
|
177
171
|
this.performanceTracker.startMethodTiming(operationId, path);
|
|
178
|
-
|
|
172
|
+
_utilities__rspack_import_3.logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);
|
|
179
173
|
if (args.length > 0) {
|
|
180
|
-
|
|
174
|
+
_utilities__rspack_import_3.logger.log(`${indent} Args:`, (0,_utilities__rspack_import_4.stringifyObject)(args, 4, 0));
|
|
181
175
|
}
|
|
182
176
|
}
|
|
183
177
|
try {
|
|
@@ -193,14 +187,14 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
193
187
|
const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);
|
|
194
188
|
const overhead = duration - totalChildTime;
|
|
195
189
|
const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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}`);
|
|
199
193
|
if (childDurations.length > 0) {
|
|
200
|
-
|
|
201
|
-
|
|
194
|
+
_utilities__rspack_import_3.logger.log(` Children Duration: ${formattedTotalChildTime} (${childDurations.length} calls)`);
|
|
195
|
+
_utilities__rspack_import_3.logger.log(` Overhead: ${formattedOverhead}`);
|
|
202
196
|
}
|
|
203
|
-
|
|
197
|
+
_utilities__rspack_import_3.logger.log(`${'═'.repeat(60)}\n`);
|
|
204
198
|
this.childDurations.delete(operationId);
|
|
205
199
|
this.performanceTracker.cleanupOperation(operationId);
|
|
206
200
|
this.callTraceManager.endOperation();
|
|
@@ -213,9 +207,9 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
213
207
|
const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);
|
|
214
208
|
const overhead = duration - totalChildTime;
|
|
215
209
|
const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));
|
|
216
|
-
|
|
210
|
+
_utilities__rspack_import_3.logger.log(`${indent} ✓ ${formattedDuration}`);
|
|
217
211
|
if (childDurations.length > 0) {
|
|
218
|
-
|
|
212
|
+
_utilities__rspack_import_3.logger.log(`${indent} Children: ${formattedTotalChildTime} (${childDurations.length} calls), Overhead: ${formattedOverhead}`);
|
|
219
213
|
}
|
|
220
214
|
// Clean up child method tracking
|
|
221
215
|
this.childDurations.delete(childMethodKey);
|
|
@@ -252,29 +246,27 @@ class PerformanceCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Cap
|
|
|
252
246
|
}
|
|
253
247
|
|
|
254
248
|
|
|
255
|
-
}
|
|
256
|
-
"./src/capabilities/TracingCapability.ts"
|
|
257
|
-
/*!***********************************************!*\
|
|
258
|
-
!*** ./src/capabilities/TracingCapability.ts ***!
|
|
259
|
-
\***********************************************/
|
|
260
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
249
|
+
},
|
|
250
|
+
"./src/capabilities/TracingCapability.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
261
251
|
__webpack_require__.r(__webpack_exports__);
|
|
262
252
|
__webpack_require__.d(__webpack_exports__, {
|
|
263
253
|
TracingCapability: () => (TracingCapability)
|
|
264
254
|
});
|
|
265
|
-
/*
|
|
266
|
-
/*
|
|
267
|
-
/*
|
|
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");
|
|
259
|
+
|
|
268
260
|
|
|
269
261
|
|
|
270
262
|
|
|
271
|
-
class TracingCapability extends
|
|
263
|
+
class TracingCapability extends _Capability__rspack_import_0.Capability {
|
|
272
264
|
callTraceManager;
|
|
273
265
|
filter;
|
|
274
266
|
constructor(options) {
|
|
275
267
|
super();
|
|
276
268
|
this.filter = options?.filter ?? (() => true);
|
|
277
|
-
this.callTraceManager = new
|
|
269
|
+
this.callTraceManager = new _tracing_CallTraceManager__rspack_import_1.CallTraceManager();
|
|
278
270
|
}
|
|
279
271
|
apply(instance) {
|
|
280
272
|
this.explore(instance, (meta, info) => {
|
|
@@ -291,20 +283,20 @@ class TracingCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Capabil
|
|
|
291
283
|
operationId = this.callTraceManager.startNewOperation();
|
|
292
284
|
const callTrace = this.callTraceManager.addMethodToTrace(path);
|
|
293
285
|
const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
_utilities__rspack_import_2.logger.log(`\n${'═'.repeat(60)}`);
|
|
287
|
+
_utilities__rspack_import_2.logger.log(`▶ ORIGIN [${operationId}] ${path}`);
|
|
296
288
|
if (args.length > 0) {
|
|
297
|
-
|
|
289
|
+
_utilities__rspack_import_2.logger.log(` Args:`, (0,_utilities_strings__rspack_import_3.stringifyObject)(args, 4, 0));
|
|
298
290
|
}
|
|
299
|
-
|
|
291
|
+
_utilities__rspack_import_2.logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);
|
|
300
292
|
}
|
|
301
293
|
else {
|
|
302
294
|
operationId = this.callTraceManager.getActiveOperationId();
|
|
303
295
|
const callTrace = this.callTraceManager.addMethodToTrace(path);
|
|
304
296
|
const indent = ' '.repeat(Math.min(callTrace.length - 1, 4));
|
|
305
|
-
|
|
297
|
+
_utilities__rspack_import_2.logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);
|
|
306
298
|
if (args.length > 0) {
|
|
307
|
-
|
|
299
|
+
_utilities__rspack_import_2.logger.log(`${indent} Args:`, (0,_utilities_strings__rspack_import_3.stringifyObject)(args, 4, 0));
|
|
308
300
|
}
|
|
309
301
|
}
|
|
310
302
|
try {
|
|
@@ -323,12 +315,8 @@ class TracingCapability extends _Capability__WEBPACK_IMPORTED_MODULE_0__.Capabil
|
|
|
323
315
|
}
|
|
324
316
|
|
|
325
317
|
|
|
326
|
-
}
|
|
327
|
-
"./src/capabilities/performance/PerformanceTracker.ts"
|
|
328
|
-
/*!************************************************************!*\
|
|
329
|
-
!*** ./src/capabilities/performance/PerformanceTracker.ts ***!
|
|
330
|
-
\************************************************************/
|
|
331
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
318
|
+
},
|
|
319
|
+
"./src/capabilities/performance/PerformanceTracker.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
332
320
|
__webpack_require__.r(__webpack_exports__);
|
|
333
321
|
__webpack_require__.d(__webpack_exports__, {
|
|
334
322
|
PerformanceTracker: () => (PerformanceTracker)
|
|
@@ -394,23 +382,19 @@ class PerformanceTracker {
|
|
|
394
382
|
}
|
|
395
383
|
|
|
396
384
|
|
|
397
|
-
}
|
|
398
|
-
"./src/capabilities/tracing/CallTraceManager.ts"
|
|
399
|
-
/*!******************************************************!*\
|
|
400
|
-
!*** ./src/capabilities/tracing/CallTraceManager.ts ***!
|
|
401
|
-
\******************************************************/
|
|
402
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
385
|
+
},
|
|
386
|
+
"./src/capabilities/tracing/CallTraceManager.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
403
387
|
__webpack_require__.r(__webpack_exports__);
|
|
404
388
|
__webpack_require__.d(__webpack_exports__, {
|
|
405
389
|
CallTraceManager: () => (CallTraceManager)
|
|
406
390
|
});
|
|
407
|
-
/*
|
|
391
|
+
/* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/uuid.ts");
|
|
408
392
|
|
|
409
393
|
class CallTraceManager {
|
|
410
394
|
activeOperationId = null;
|
|
411
395
|
activeCallStack = [];
|
|
412
396
|
startNewOperation() {
|
|
413
|
-
const operationId = (0,
|
|
397
|
+
const operationId = (0,_utilities__rspack_import_0.uuid)(8);
|
|
414
398
|
this.activeOperationId = operationId;
|
|
415
399
|
this.activeCallStack = [];
|
|
416
400
|
return operationId;
|
|
@@ -451,12 +435,49 @@ class CallTraceManager {
|
|
|
451
435
|
}
|
|
452
436
|
|
|
453
437
|
|
|
454
|
-
}
|
|
455
|
-
"./src/utilities/
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
438
|
+
},
|
|
439
|
+
"./src/utilities/logger.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
440
|
+
__webpack_require__.r(__webpack_exports__);
|
|
441
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
442
|
+
logger: () => (logger)
|
|
443
|
+
});
|
|
444
|
+
const isDevelopment = () => {
|
|
445
|
+
if (typeof process === 'undefined' || process.env == null) {
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
const env = "development"?.toLowerCase();
|
|
449
|
+
return env === 'dev' || env === 'development' || env === 'test';
|
|
450
|
+
};
|
|
451
|
+
const shouldLog = isDevelopment();
|
|
452
|
+
const tryLog = (type, ...args) => {
|
|
453
|
+
if (shouldLog) {
|
|
454
|
+
console[type](...args);
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
const logger = {
|
|
458
|
+
log: (...args) => {
|
|
459
|
+
tryLog("log", ...args);
|
|
460
|
+
},
|
|
461
|
+
info: (...args) => {
|
|
462
|
+
tryLog("info", ...args);
|
|
463
|
+
},
|
|
464
|
+
warn: (...args) => {
|
|
465
|
+
tryLog("warn", ...args);
|
|
466
|
+
},
|
|
467
|
+
error: (...args) => {
|
|
468
|
+
tryLog("error", ...args);
|
|
469
|
+
},
|
|
470
|
+
debug: (...args) => {
|
|
471
|
+
tryLog("debug", ...args);
|
|
472
|
+
},
|
|
473
|
+
table: (...args) => {
|
|
474
|
+
tryLog("table", ...args);
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
},
|
|
480
|
+
"./src/utilities/strings.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
460
481
|
__webpack_require__.r(__webpack_exports__);
|
|
461
482
|
__webpack_require__.d(__webpack_exports__, {
|
|
462
483
|
fastHash: () => (fastHash),
|
|
@@ -617,12 +638,8 @@ function stringifyPlainObject(obj, maxDepth, currentDepth) {
|
|
|
617
638
|
}
|
|
618
639
|
|
|
619
640
|
|
|
620
|
-
}
|
|
621
|
-
"./src/utilities/uuid.ts"
|
|
622
|
-
/*!*******************************!*\
|
|
623
|
-
!*** ./src/utilities/uuid.ts ***!
|
|
624
|
-
\*******************************/
|
|
625
|
-
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
641
|
+
},
|
|
642
|
+
"./src/utilities/uuid.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
626
643
|
__webpack_require__.r(__webpack_exports__);
|
|
627
644
|
__webpack_require__.d(__webpack_exports__, {
|
|
628
645
|
uuid: () => (uuid),
|
|
@@ -679,10 +696,9 @@ const uuidv4 = () => {
|
|
|
679
696
|
};
|
|
680
697
|
|
|
681
698
|
|
|
682
|
-
}
|
|
699
|
+
},
|
|
683
700
|
|
|
684
701
|
});
|
|
685
|
-
/************************************************************************/
|
|
686
702
|
// The module cache
|
|
687
703
|
var __webpack_module_cache__ = {};
|
|
688
704
|
|
|
@@ -706,7 +722,6 @@ return module.exports;
|
|
|
706
722
|
|
|
707
723
|
}
|
|
708
724
|
|
|
709
|
-
/************************************************************************/
|
|
710
725
|
// webpack/runtime/define_property_getters
|
|
711
726
|
(() => {
|
|
712
727
|
__webpack_require__.d = (exports, definition) => {
|
|
@@ -731,23 +746,18 @@ __webpack_require__.r = (exports) => {
|
|
|
731
746
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
732
747
|
};
|
|
733
748
|
})();
|
|
734
|
-
/************************************************************************/
|
|
735
749
|
var __webpack_exports__ = {};
|
|
736
750
|
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
737
751
|
(() => {
|
|
738
|
-
|
|
739
|
-
/*!***********************************!*\
|
|
740
|
-
!*** ./src/capabilities/index.ts ***!
|
|
741
|
-
\***********************************/
|
|
742
752
|
__webpack_require__.r(__webpack_exports__);
|
|
743
753
|
__webpack_require__.d(__webpack_exports__, {
|
|
744
|
-
Capability: () => (/* reexport safe */
|
|
745
|
-
PerformanceCapability: () => (/* reexport safe */
|
|
746
|
-
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)
|
|
747
757
|
});
|
|
748
|
-
/*
|
|
749
|
-
/*
|
|
750
|
-
/*
|
|
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");
|
|
751
761
|
|
|
752
762
|
|
|
753
763
|
|