@dynatrace/react-native-plugin 2.343.1 → 2.345.1

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.
Files changed (53) hide show
  1. package/README.md +638 -660
  2. package/android/build.gradle +6 -2
  3. package/files/plugin-runtime.gradle +17 -33
  4. package/files/plugin.gradle +1 -1
  5. package/instrumentation/BabelPluginDynatrace.js +1 -1
  6. package/instrumentation/libs/UserInteraction.js +20 -6
  7. package/instrumentation/libs/react-navigation/ReactNavigation.js +14 -58
  8. package/instrumentation/libs/withOnPressMonitoring.js +3 -54
  9. package/internal.d.ts +1 -0
  10. package/internal.js +3 -1
  11. package/ios/DynatraceRNBridge.mm +9 -0
  12. package/lib/core/configuration/ConfigurationHandler.js +0 -21
  13. package/lib/dynatrace-reporter.js +1 -30
  14. package/lib/dynatrace-transformer.js +6 -34
  15. package/lib/next/configuration/INativeRuntimeConfiguration.js +0 -1
  16. package/lib/next/configuration/RuntimeConfigurationObserver.js +1 -6
  17. package/lib/next/navigation/NavigationTracker.js +93 -0
  18. package/lib/next/navigation/useNavigationTracking.js +54 -0
  19. package/package.json +9 -21
  20. package/public.js +3 -1
  21. package/react-native-dynatrace.podspec +1 -1
  22. package/scripts/Android.js +1 -20
  23. package/scripts/Config.js +0 -4
  24. package/scripts/Deprecations.js +18 -0
  25. package/scripts/Install.js +13 -0
  26. package/scripts/PathsConstants.js +0 -4
  27. package/scripts/Uninstall.js +0 -15
  28. package/scripts/core/InstrumentCall.js +2 -3
  29. package/scripts/util/DeprecationReport.js +24 -0
  30. package/types.d.ts +212 -10
  31. package/instrumentation/DynatraceInstrumentation.js +0 -1
  32. package/instrumentation/libs/community/Picker.InstrInfo.js +0 -20
  33. package/instrumentation/libs/community/gesture-handler/Touchables.InstrInfo.js +0 -25
  34. package/instrumentation/libs/react-native/RefreshControl.InstrInfo.js +0 -12
  35. package/instrumentation/libs/react-native/Switch.InstrInfo.js +0 -12
  36. package/instrumentation/libs/react-native/Touchables.InstrInfo.js +0 -25
  37. package/instrumentation/model/Reference.js +0 -2
  38. package/instrumentation/parser/Babel.js +0 -60
  39. package/instrumentation/parser/ParserUtil.js +0 -11
  40. package/lib/features/ui-interaction/Config.js +0 -42
  41. package/lib/features/ui-interaction/IUserInteractionEvent.js +0 -16
  42. package/lib/features/ui-interaction/Plugin.Fragment.Test.js +0 -170
  43. package/lib/features/ui-interaction/Plugin.js +0 -289
  44. package/lib/features/ui-interaction/RootDetection.js +0 -51
  45. package/lib/features/ui-interaction/RootWrapper.js +0 -236
  46. package/lib/features/ui-interaction/Run.js +0 -38
  47. package/lib/features/ui-interaction/Runtime.js +0 -843
  48. package/lib/features/ui-interaction/TouchMetaResolver.js +0 -493
  49. package/lib/features/ui-interaction/Types.js +0 -14
  50. package/lib/metro/getSourceMapInfo.js +0 -26
  51. package/scripts/LineOffsetAnalyze.js +0 -25
  52. package/scripts/core/LineOffsetAnalyzeCall.js +0 -165
  53. package/scripts/util/SourceMapUtil.js +0 -68
@@ -1,493 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTouchElementMeta = void 0;
4
- class TouchMetaResolver {
5
- constructor(config) {
6
- this.rootWrapperLikePatterns = [
7
- /Animated/,
8
- /Controller/,
9
- /Detector/,
10
- /NativeComponent/,
11
- /Wrapper/,
12
- /Clipping/,
13
- ];
14
- this.genericContainerCodeTagNames = new Set([
15
- 'View',
16
- 'Background',
17
- 'Drawer',
18
- 'DrawerView',
19
- 'DrawerViewBase',
20
- 'Freeze',
21
- 'DelayedFreeze',
22
- 'Suspender',
23
- 'MaybeScreen',
24
- 'MaybeScreenContainer',
25
- 'Screen',
26
- 'ScreenContainer',
27
- 'RNSScreen',
28
- 'RNSScreenContainer',
29
- 'GestureHandlerRootView',
30
- 'RNGestureHandlerRootView',
31
- 'PanGestureHandler',
32
- ]);
33
- this.internalCodeTagExactNames = new Set([
34
- 'main(RootComponent)',
35
- 'PerformanceLoggerContext',
36
- 'RootTagContext',
37
- 'Wrapped',
38
- 'AnalyticsRoot',
39
- ]);
40
- this.uselessWrapperCodeTagExactNames = new Set([
41
- 'DynatraceFunctionalComponent',
42
- 'DynatraceClassComponent',
43
- 'NavigationContainer',
44
- 'BaseNavigationContainer',
45
- 'Navigator',
46
- 'DrawerNavigator',
47
- 'SafeAreaProviderCompat',
48
- 'Handler',
49
- 'AnimatedComponent',
50
- 'Component',
51
- 'ScreenNavigationContainer',
52
- 'ScreenWrapper',
53
- 'Suspense',
54
- 'AnimatedScreen',
55
- 'ScreenComponent',
56
- 'KeyboardControllerViewAnimated',
57
- ]);
58
- this.internalCodeTagPatterns = [
59
- /Context$/,
60
- /Provider$/,
61
- /^Route(?:\(|$)/,
62
- /^Animated(?:Component)?\(.+\)$/,
63
- /^Anonymous$/,
64
- /NavigationContent/,
65
- /NavigationStateListenerProvider/,
66
- /PreventRemoveProvider/,
67
- /EnsureSingleNavigator/,
68
- /SceneView/,
69
- /StaticContainer/,
70
- /GestureHandler/,
71
- /expo-router\/build\//,
72
- ];
73
- this.pressHandlers = [
74
- 'onPress',
75
- 'onLongPress',
76
- 'onPressIn',
77
- 'onPressOut',
78
- ];
79
- this.config = Object.assign({ filterInternalCodeTags: true }, config);
80
- }
81
- resolve(event) {
82
- var _a, _b, _c, _d;
83
- try {
84
- const raw = event;
85
- const targetInst = (_a = raw._targetInst) !== null && _a !== void 0 ? _a : (_b = raw.nativeEvent) === null || _b === void 0 ? void 0 : _b._targetInst;
86
- const touchElementName = (_c = this.getNodeName(targetInst)) !== null && _c !== void 0 ? _c : 'unknown';
87
- const touchPath = this.buildAppCodeTagPathFromNode(targetInst !== null && targetInst !== void 0 ? targetInst : null);
88
- const pressNode = this.findPressNode(targetInst !== null && targetInst !== void 0 ? targetInst : null);
89
- const press = pressNode === null
90
- ? null
91
- : {
92
- elementName: (_d = this.getNodeName(pressNode)) !== null && _d !== void 0 ? _d : 'unknown',
93
- appCodeTagPath: this.buildAppCodeTagPathFromNode(pressNode),
94
- isParent: Boolean(pressNode !== targetInst),
95
- };
96
- return {
97
- touch: {
98
- elementName: touchElementName,
99
- appCodeTagPath: touchPath,
100
- },
101
- press,
102
- };
103
- }
104
- catch (_e) {
105
- return {
106
- touch: { elementName: 'unknown', appCodeTagPath: 'unknown' },
107
- press: null,
108
- };
109
- }
110
- }
111
- buildAppCodeTagPathFromNode(node) {
112
- var _a;
113
- if (node === null) {
114
- return 'unknown';
115
- }
116
- const targetToRootCodeTags = [];
117
- let pathCursor = node;
118
- while (pathCursor !== null) {
119
- const codeTagSegment = this.getNodeCodeTagSegment(pathCursor);
120
- if (codeTagSegment !== null) {
121
- targetToRootCodeTags.push(codeTagSegment);
122
- }
123
- pathCursor = (_a = pathCursor.return) !== null && _a !== void 0 ? _a : null;
124
- }
125
- const normalizedCodeTags = this.collapseConsecutiveDuplicates(targetToRootCodeTags);
126
- const rootToTargetCodeTags = [...normalizedCodeTags].reverse();
127
- const appRootTrimmedCodeTags = this.trimToAppRoot(rootToTargetCodeTags);
128
- const uiRootTrimmedCodeTags = this.trimToUiRootAnchor(appRootTrimmedCodeTags);
129
- const dtPathPreferredCodeTags = this.preferDtPathCodeTags(uiRootTrimmedCodeTags);
130
- const dtPathPreferredCodeTagNames = dtPathPreferredCodeTags.map((segment) => segment.name);
131
- const trimmedRootToTargetCodeTags = this.trimFrameworkPrefix(dtPathPreferredCodeTagNames);
132
- const filteredRootToTargetCodeTags = this.config.filterInternalCodeTags
133
- ? this.filterAppCodeTags(trimmedRootToTargetCodeTags)
134
- : trimmedRootToTargetCodeTags;
135
- const dedupedFilteredRootToTargetCodeTags = this.collapseConsecutiveDuplicateNames(filteredRootToTargetCodeTags);
136
- let appRootToTargetCodeTags = ['unknown'];
137
- if (dedupedFilteredRootToTargetCodeTags.length > 0) {
138
- appRootToTargetCodeTags = dedupedFilteredRootToTargetCodeTags;
139
- }
140
- else if (trimmedRootToTargetCodeTags.length > 0) {
141
- appRootToTargetCodeTags = trimmedRootToTargetCodeTags;
142
- }
143
- return appRootToTargetCodeTags.join('/') || 'unknown';
144
- }
145
- getNodeName(node) {
146
- var _a, _b;
147
- if (node === null || node === undefined) {
148
- return null;
149
- }
150
- const props = (_a = node.memoizedProps) !== null && _a !== void 0 ? _a : {};
151
- const dtActionName = props.dtActionName;
152
- if (typeof dtActionName === 'string' &&
153
- dtActionName.trim().length > 0) {
154
- return dtActionName.trim();
155
- }
156
- const testId = props.testID;
157
- if (typeof testId === 'string' && testId.trim().length > 0) {
158
- return testId;
159
- }
160
- const accessibilityLabel = props.accessibilityLabel;
161
- if (typeof accessibilityLabel === 'string' &&
162
- accessibilityLabel.trim().length > 0) {
163
- return accessibilityLabel;
164
- }
165
- const dtPathIdName = this.getCodeTagNameFromDtPathId(props);
166
- if (dtPathIdName !== null) {
167
- return dtPathIdName;
168
- }
169
- const codeTagName = this.getNodeCodeTagName(node);
170
- const isTextLike = codeTagName === 'Text' || codeTagName === 'RCTText';
171
- const shouldReadChildrenText = isTextLike || this.hasPressHandler(props);
172
- if (shouldReadChildrenText) {
173
- const childText = this.extractTextFromChildren(props.children);
174
- if (childText !== null) {
175
- return childText;
176
- }
177
- }
178
- return ((_b = this.getComponentTypeName(node.elementType)) !== null && _b !== void 0 ? _b : this.getComponentTypeName(node.type));
179
- }
180
- findPressNode(startNode) {
181
- var _a;
182
- let cursor = startNode;
183
- while (cursor !== null) {
184
- if (this.hasPressHandler(cursor.memoizedProps)) {
185
- return cursor;
186
- }
187
- cursor = (_a = cursor.return) !== null && _a !== void 0 ? _a : null;
188
- }
189
- return null;
190
- }
191
- collapseConsecutiveDuplicates(items) {
192
- const result = [];
193
- for (const item of items) {
194
- const previous = result.at(-1);
195
- if (previous === undefined || previous.name !== item.name) {
196
- result.push(item);
197
- continue;
198
- }
199
- if (item.fromDtPathId && !previous.fromDtPathId) {
200
- previous.fromDtPathId = true;
201
- }
202
- if (item.isUiRoot && !previous.isUiRoot) {
203
- previous.isUiRoot = true;
204
- }
205
- }
206
- return result;
207
- }
208
- trimToUiRootAnchor(rootToTargetCodeTags) {
209
- if (rootToTargetCodeTags.length === 0) {
210
- return rootToTargetCodeTags;
211
- }
212
- let uiRootIndex = -1;
213
- for (let i = rootToTargetCodeTags.length - 1; i >= 0; i--) {
214
- if (rootToTargetCodeTags[i].isUiRoot) {
215
- uiRootIndex = i;
216
- break;
217
- }
218
- }
219
- if (uiRootIndex < 0) {
220
- return rootToTargetCodeTags;
221
- }
222
- return rootToTargetCodeTags.slice(uiRootIndex);
223
- }
224
- trimToAppRoot(rootToTargetCodeTags) {
225
- if (rootToTargetCodeTags.length === 0) {
226
- return rootToTargetCodeTags;
227
- }
228
- let start = 0;
229
- const analyticsRootIndex = rootToTargetCodeTags.findIndex((segment) => segment.name === 'AnalyticsRoot');
230
- if (analyticsRootIndex < 0) {
231
- return [];
232
- }
233
- start = analyticsRootIndex + 1;
234
- const enforceStableRootSignal = rootToTargetCodeTags
235
- .slice(start)
236
- .some((segment) => segment.fromDtPathId || segment.isUiRoot);
237
- while (start < rootToTargetCodeTags.length - 1) {
238
- const segment = rootToTargetCodeTags[start];
239
- const name = segment.name;
240
- const isProviderLike = /Provider(?:Compat)?$/.test(name);
241
- const isBlacklistedStart = this.shouldDropCodeTagName(name, false);
242
- const hasStableRootSignal = segment.fromDtPathId || segment.isUiRoot;
243
- const shouldSkipByRootRule = enforceStableRootSignal && !hasStableRootSignal;
244
- const isLikelyWrapperRoot = !hasStableRootSignal &&
245
- this.rootWrapperLikePatterns.some((pattern) => pattern.test(name));
246
- if (!isProviderLike &&
247
- !isBlacklistedStart &&
248
- !shouldSkipByRootRule &&
249
- !isLikelyWrapperRoot) {
250
- break;
251
- }
252
- start += 1;
253
- }
254
- return rootToTargetCodeTags.slice(start);
255
- }
256
- collapseConsecutiveDuplicateNames(items) {
257
- const result = [];
258
- for (const item of items) {
259
- if (result.at(-1) !== item) {
260
- result.push(item);
261
- }
262
- }
263
- return result;
264
- }
265
- preferDtPathCodeTags(rootToTargetCodeTags) {
266
- if (rootToTargetCodeTags.length === 0) {
267
- return rootToTargetCodeTags;
268
- }
269
- const firstDtPathIndex = rootToTargetCodeTags.findIndex((segment) => segment.fromDtPathId);
270
- if (firstDtPathIndex < 0) {
271
- return rootToTargetCodeTags;
272
- }
273
- const fromFirstDtPath = rootToTargetCodeTags.slice(firstDtPathIndex);
274
- return fromFirstDtPath.filter((segment, index) => {
275
- if (segment.fromDtPathId) {
276
- return true;
277
- }
278
- const isLeaf = index === fromFirstDtPath.length - 1;
279
- return !this.shouldDropCodeTagName(segment.name, isLeaf);
280
- });
281
- }
282
- isInternalCodeTagName(name) {
283
- if (this.internalCodeTagExactNames.has(name)) {
284
- return true;
285
- }
286
- return this.internalCodeTagPatterns.some((pattern) => pattern.test(name));
287
- }
288
- shouldDropCodeTagName(name, isLeaf) {
289
- if (name.trim().length === 0) {
290
- return true;
291
- }
292
- if (!isLeaf && this.uselessWrapperCodeTagExactNames.has(name)) {
293
- return true;
294
- }
295
- if (this.isInternalCodeTagName(name)) {
296
- return true;
297
- }
298
- if (!isLeaf && this.genericContainerCodeTagNames.has(name)) {
299
- return true;
300
- }
301
- return false;
302
- }
303
- filterAppCodeTags(rootToTargetTags) {
304
- return rootToTargetTags.filter((name, index) => {
305
- const isLeaf = index === rootToTargetTags.length - 1;
306
- return !this.shouldDropCodeTagName(name, isLeaf);
307
- });
308
- }
309
- hasPressHandler(props) {
310
- if (props === null || props === undefined) {
311
- return false;
312
- }
313
- for (const key of this.pressHandlers) {
314
- if (typeof props[key] === 'function') {
315
- return true;
316
- }
317
- }
318
- return false;
319
- }
320
- trimFrameworkPrefix(rootToTargetTags) {
321
- if (rootToTargetTags.length === 0) {
322
- return rootToTargetTags;
323
- }
324
- let indexRouteMarker = -1;
325
- for (let i = rootToTargetTags.length - 1; i >= 0; i--) {
326
- if (rootToTargetTags[i] === 'Index' ||
327
- rootToTargetTags[i].startsWith('Index(')) {
328
- indexRouteMarker = i;
329
- break;
330
- }
331
- }
332
- if (indexRouteMarker >= 0 &&
333
- indexRouteMarker < rootToTargetTags.length - 1) {
334
- return rootToTargetTags.slice(indexRouteMarker + 1);
335
- }
336
- const touchCaptureIndex = rootToTargetTags.lastIndexOf('TouchCapture');
337
- if (touchCaptureIndex >= 0 &&
338
- touchCaptureIndex < rootToTargetTags.length - 1) {
339
- return rootToTargetTags.slice(touchCaptureIndex + 1);
340
- }
341
- return rootToTargetTags;
342
- }
343
- extractTextFromChildren(children, maxDepth = 5) {
344
- var _a;
345
- if (maxDepth <= 0) {
346
- return null;
347
- }
348
- if (typeof children === 'string' || typeof children === 'number') {
349
- const str = String(children).trim();
350
- return str.length > 0 ? str : null;
351
- }
352
- if (Array.isArray(children)) {
353
- for (const child of children) {
354
- const text = this.extractTextFromChildren(child, maxDepth - 1);
355
- if (text !== null) {
356
- return text;
357
- }
358
- }
359
- }
360
- if (typeof children === 'object' &&
361
- children !== null &&
362
- 'props' in children &&
363
- typeof children.props === 'object') {
364
- const nestedChildren = (_a = children.props) === null || _a === void 0 ? void 0 : _a.children;
365
- return this.extractTextFromChildren(nestedChildren, maxDepth - 1);
366
- }
367
- return null;
368
- }
369
- getCodeTagNameFromDtPathId(props) {
370
- if (props === null || props === undefined) {
371
- return null;
372
- }
373
- const rawDtPathId = props.dtPathID;
374
- if (typeof rawDtPathId !== 'string') {
375
- return null;
376
- }
377
- const trimmedDtPathId = rawDtPathId.trim();
378
- if (trimmedDtPathId.length === 0) {
379
- return null;
380
- }
381
- const strippedSuffix = trimmedDtPathId.replace(/_\d+_\d+$/, '');
382
- const normalizedName = this.normalizeCodeTagName(strippedSuffix);
383
- return normalizedName;
384
- }
385
- hasUiRootMarker(props) {
386
- if (props === null || props === undefined) {
387
- return false;
388
- }
389
- const rawUiRoot = props.dtUIRoot;
390
- if (rawUiRoot === null || rawUiRoot === undefined) {
391
- return false;
392
- }
393
- if (typeof rawUiRoot === 'boolean') {
394
- return rawUiRoot;
395
- }
396
- if (typeof rawUiRoot === 'string') {
397
- const normalized = rawUiRoot.trim().toLowerCase();
398
- return normalized.length > 0 && normalized !== 'false';
399
- }
400
- return true;
401
- }
402
- getComponentTypeName(value) {
403
- var _a, _b, _c, _d;
404
- if (value === null || value === undefined) {
405
- return null;
406
- }
407
- if (typeof value === 'string') {
408
- return value;
409
- }
410
- if (typeof value === 'function') {
411
- return ((_b = (_a = value
412
- .displayName) !== null && _a !== void 0 ? _a : value.name) !== null && _b !== void 0 ? _b : null);
413
- }
414
- if (typeof value === 'object') {
415
- const objectValue = value;
416
- return (_d = (_c = objectValue.displayName) !== null && _c !== void 0 ? _c : objectValue.name) !== null && _d !== void 0 ? _d : null;
417
- }
418
- return null;
419
- }
420
- normalizeCodeTagName(name) {
421
- if (name === null) {
422
- return null;
423
- }
424
- const trimmedName = name.trim();
425
- if (trimmedName.length === 0) {
426
- return null;
427
- }
428
- if (trimmedName === 'RCTView' ||
429
- trimmedName === 'RNView' ||
430
- trimmedName === 'View') {
431
- return 'View';
432
- }
433
- if (trimmedName === 'RCTText' ||
434
- trimmedName === 'RNText' ||
435
- trimmedName === 'Text') {
436
- return 'Text';
437
- }
438
- if (trimmedName === 'RCTScrollView' || trimmedName === 'ScrollView') {
439
- return 'ScrollView';
440
- }
441
- if (trimmedName === 'VirtualizedList') {
442
- return 'FlatList';
443
- }
444
- return trimmedName;
445
- }
446
- getNodeCodeTagName(node) {
447
- var _a, _b;
448
- return (_b = (_a = this.getNodeCodeTagSegment(node)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null;
449
- }
450
- getNodeCodeTagSegment(node) {
451
- var _a, _b;
452
- if (node === null || node === undefined) {
453
- return null;
454
- }
455
- const isUiRoot = this.hasUiRootMarker(node.memoizedProps);
456
- const fromDtPathId = this.getCodeTagNameFromDtPathId(node.memoizedProps);
457
- if (fromDtPathId !== null) {
458
- return {
459
- name: fromDtPathId,
460
- fromDtPathId: true,
461
- isUiRoot,
462
- };
463
- }
464
- const dtInfoName = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a._dtInfo) === null || _b === void 0 ? void 0 : _b.name;
465
- if (typeof dtInfoName === 'string' && dtInfoName.trim().length > 0) {
466
- return {
467
- name: dtInfoName.trim(),
468
- fromDtPathId: false,
469
- isUiRoot,
470
- };
471
- }
472
- const fromElementType = this.normalizeCodeTagName(this.getComponentTypeName(node.elementType));
473
- if (fromElementType !== null) {
474
- return {
475
- name: fromElementType,
476
- fromDtPathId: false,
477
- isUiRoot,
478
- };
479
- }
480
- const fromType = this.normalizeCodeTagName(this.getComponentTypeName(node.type));
481
- if (fromType !== null) {
482
- return {
483
- name: fromType,
484
- fromDtPathId: false,
485
- isUiRoot,
486
- };
487
- }
488
- return null;
489
- }
490
- }
491
- const resolver = new TouchMetaResolver();
492
- const getTouchElementMeta = (event) => resolver.resolve(event);
493
- exports.getTouchElementMeta = getTouchElementMeta;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Literals = void 0;
4
- exports.Literals = {
5
- ReactFragmentFQN: 'React.Fragment',
6
- NavigatorProp: 'Navigator',
7
- PluginName: 'dt-user-interaction',
8
- LogTag: '[dt] instrumented:',
9
- RawHandlerTag: '[DT raw] handler',
10
- KeySuffixPrefix: '~dt@',
11
- DefaultRuntimeImport: '@dynatrace/react-native-plugin/lib/features/ui-interaction/Runtime',
12
- DefaultArtifactsDir: 'node_modules/@dynatrace/react-native-plugin/build/ui_instrumented',
13
- DefaultRootName: 'AnalyticsRoot',
14
- };
@@ -1,26 +0,0 @@
1
- 'use strict';
2
- const pathNode = require('path');
3
- const pathsConstants = require('@dynatrace/react-native-plugin/scripts/PathsConstants').default;
4
- const fileOperation = require('@dynatrace/react-native-plugin/scripts/FileOperationHelper').default;
5
- const INSTRUMENTED_FILE_EXTENSION = require('@dynatrace/react-native-plugin/scripts/util/InstrumentUtil').INSTRUMENTED_FILE_EXTENSION;
6
- const originalSourceMapInfo = require('./getSourceMapInfoOrig');
7
- const getSourceMapInfo = (module, options) => {
8
- let dataOrig;
9
- if (originalSourceMapInfo.default !== undefined) {
10
- dataOrig = originalSourceMapInfo.default(module, options);
11
- }
12
- else {
13
- dataOrig = originalSourceMapInfo(module, options);
14
- }
15
- try {
16
- if (!options.excludeSource) {
17
- const correctPath = module.path.replace(pathsConstants.getApplicationPath(), '') +
18
- INSTRUMENTED_FILE_EXTENSION;
19
- dataOrig.source = fileOperation.readTextFromFileSync(pathNode.join(pathsConstants.getBuildPath(), correctPath));
20
- }
21
- }
22
- catch (e) {
23
- }
24
- return dataOrig;
25
- };
26
- module.exports = getSourceMapInfo;
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const GetValuesFromPackage_1 = require("../lib/core/util/GetValuesFromPackage");
5
- const PathsConstants_1 = require("../scripts/PathsConstants");
6
- const LineOffsetAnalyzeCall_1 = require("./core/LineOffsetAnalyzeCall");
7
- module.exports = (() => {
8
- var _a, _b;
9
- const args = process.argv.slice(2);
10
- const parsedArgs = args.reduce((acc, arg) => {
11
- const [key, value] = arg.split('=');
12
- if (key && value !== undefined) {
13
- acc[key] = value;
14
- }
15
- return acc;
16
- }, {});
17
- const options = {
18
- projectRoot: parsedArgs.projectRoot || PathsConstants_1.default.getApplicationPath(),
19
- buildPath: parsedArgs.buildPath || PathsConstants_1.default.getBuildPath(),
20
- sourcemapPath: parsedArgs.sourcemapPath,
21
- appBundleInfo: Object.assign(Object.assign({}, (0, GetValuesFromPackage_1.getHostAppBundleInfo)(PathsConstants_1.default.getPackageJsonFile())), { pluginVersion: (_b = (_a = (0, GetValuesFromPackage_1.getHostAppBundleInfo)(PathsConstants_1.default.getInternalPackageJsonFile(), true)) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : '0' }),
22
- };
23
- const analyzer = new LineOffsetAnalyzeCall_1.LineOffsetAnalyzer(options);
24
- analyzer.run();
25
- })();