@dynatrace/react-native-plugin 2.225.0 → 2.231.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/README.md +31 -6
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/dynatrace/android/agent/DynatraceRNBridge.java +10 -0
- package/files/plugin.gradle +1 -1
- package/ios/DynatraceRNBridge.m +11 -0
- package/ios/lib/Dynatrace.xcframework/Info.plist +69 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Dynatrace +0 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Headers/Dynatrace.h +952 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Headers/Framework.h +18 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Info.plist +0 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_armv7/Dynatrace.framework/Modules/module.modulemap +6 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +952 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Headers/Framework.h +18 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/Modules/module.modulemap +6 -0
- package/ios/lib/Dynatrace.xcframework/ios-arm64_i386_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +147 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Dynatrace +0 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Dynatrace.h +952 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Headers/Framework.h +18 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Info.plist +0 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64/Dynatrace.framework/Modules/module.modulemap +6 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Dynatrace +0 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Dynatrace.h +952 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Headers/Framework.h +18 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Info.plist +0 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/Modules/module.modulemap +6 -0
- package/ios/lib/Dynatrace.xcframework/tvos-arm64_x86_64-simulator/Dynatrace.framework/_CodeSignature/CodeResources +135 -0
- package/lib/community/Picker.js +33 -0
- package/lib/dynatrace-reporter.js +30 -0
- package/lib/dynatrace-transformer.js +50 -0
- package/lib/instrumentor/base/Application.js +17 -0
- package/lib/instrumentor/base/Dynatrace.js +275 -0
- package/lib/instrumentor/base/DynatraceAction.js +66 -0
- package/lib/instrumentor/base/DynatraceBridge.js +5 -0
- package/lib/instrumentor/base/ElementHelper.js +58 -0
- package/lib/instrumentor/base/ErrorHandler.js +52 -0
- package/lib/instrumentor/base/Logger.js +15 -0
- package/lib/instrumentor/base/NullAction.js +27 -0
- package/lib/instrumentor/base/Picker.js +32 -0
- package/lib/instrumentor/base/RefreshControl.js +35 -0
- package/lib/instrumentor/base/Touchable.js +103 -0
- package/lib/instrumentor/base/UserPrivacyOptions.js +22 -0
- package/lib/instrumentor/base/configuration/AutoStartupConfiguration.js +17 -0
- package/lib/instrumentor/base/configuration/Configuration.js +26 -0
- package/lib/instrumentor/base/configuration/ConfigurationDefaults.js +13 -0
- package/lib/instrumentor/base/configuration/ManualStartupConfiguration.js +34 -0
- package/lib/instrumentor/base/interface/IAutoConfiguration.js +2 -0
- package/lib/instrumentor/base/interface/IDynatrace.js +2 -0
- package/lib/instrumentor/base/interface/IDynatraceAction.js +2 -0
- package/lib/instrumentor/base/interface/IDynatraceBridge.js +2 -0
- package/lib/instrumentor/base/interface/IDynatraceProperties.js +2 -0
- package/lib/instrumentor/base/interface/ILogger.js +2 -0
- package/lib/instrumentor/base/model/DataCollectionLevel.js +11 -0
- package/lib/instrumentor/base/model/LogLevel.js +8 -0
- package/lib/instrumentor/base/model/Platform.js +9 -0
- package/lib/instrumentor/base/util/StringUtils.js +8 -0
- package/lib/instrumentor/dynatrace-instrumentation.js +1 -0
- package/lib/instrumentor/model/reference.js +2 -0
- package/lib/instrumentor/model/types.js +16 -0
- package/lib/instrumentor/parser/babel.js +63 -0
- package/lib/jsx-runtime.js +41 -0
- package/lib/metro/getSourceMapInfo.js +22 -0
- package/lib/react/Component.js +68 -0
- package/lib/react-native/RefreshControl.js +14 -0
- package/lib/react-native/Touchables.js +63 -0
- package/lib/react-native/index.js +12 -0
- package/lib/react-native.js +25 -0
- package/package.json +155 -1
- package/scripts/android.js +123 -0
- package/scripts/api/CustomArguments.js +2 -0
- package/scripts/api/CustomArgumentsBuilder.js +2 -0
- package/scripts/api/model/Platform.js +8 -0
- package/scripts/config.js +73 -0
- package/scripts/core/CustomArgumentsBuilderImpl.js +22 -0
- package/scripts/core/CustomArgumentsImpl.js +33 -0
- package/scripts/core/InstrumentCall.js +89 -0
- package/scripts/fileOperationHelper.js +184 -0
- package/scripts/install.js +47 -0
- package/scripts/instrument.js +7 -0
- package/scripts/ios.js +179 -0
- package/scripts/logger.js +79 -0
- package/scripts/pathsConstants.js +60 -0
- package/scripts/start.js +6 -0
- package/scripts/uninstall.js +80 -0
- package/scripts/util/CustomArgumentUtil.js +57 -0
- package/scripts/util/SourceMapUtil.js +30 -0
- package/scripts/util/StartUtil.js +9 -0
- package/scripts/util/instrumentUtil.js +28 -0
- package/typings/react-native-dynatrace.d.ts +6 -0
- package/util/constants.js +0 -4
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const logger_1 = require("./logger");
|
|
14
|
+
const fileOperationHelper_1 = require("./fileOperationHelper");
|
|
15
|
+
const pathsConstants_1 = require("./pathsConstants");
|
|
16
|
+
const android = require("./android");
|
|
17
|
+
const ios_1 = require("./ios");
|
|
18
|
+
const nodePath = require("path");
|
|
19
|
+
module.exports = (function () {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
yield modifyPackageJson();
|
|
22
|
+
yield removeGradleModification();
|
|
23
|
+
yield removePListModification();
|
|
24
|
+
});
|
|
25
|
+
}());
|
|
26
|
+
function modifyPackageJson() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
try {
|
|
29
|
+
let pathToPackageJson = pathsConstants_1.default.getPackageJsonFile();
|
|
30
|
+
let packageJson = yield fileOperationHelper_1.default.readTextFromFile(pathToPackageJson);
|
|
31
|
+
let packageJsonParsed = JSON.parse(packageJson);
|
|
32
|
+
if (packageJsonParsed.scripts != undefined && packageJsonParsed.scripts.instrumentDynatrace != undefined) {
|
|
33
|
+
delete packageJsonParsed.scripts.instrumentDynatrace;
|
|
34
|
+
yield fileOperationHelper_1.default.writeTextToFile(pathToPackageJson, JSON.stringify(packageJsonParsed));
|
|
35
|
+
logger_1.default.logMessageSync("Modified package.json - Removed the instrumentDynatrace script!", logger_1.default.INFO);
|
|
36
|
+
}
|
|
37
|
+
yield removePatchMetroSourceMap();
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
logger_1.default.logMessageSync("Could not find package.json - please remove instrumentDynatrace script manually!", logger_1.default.WARNING);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function removePatchMetroSourceMap() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
logger_1.default.logMessageSync("Undo Patching SourceMap generation of Metro .. ", logger_1.default.INFO);
|
|
47
|
+
try {
|
|
48
|
+
let currentSourceMapPath = nodePath.join(pathsConstants_1.default.getMetroSouceMapPath(), "getSourceMapInfo.js");
|
|
49
|
+
let origSourceMapPath = nodePath.join(pathsConstants_1.default.getMetroSouceMapPath(), "getSourceMapInfoOrig.js");
|
|
50
|
+
yield fileOperationHelper_1.default.checkIfFileExists(origSourceMapPath);
|
|
51
|
+
yield fileOperationHelper_1.default.deleteFile(currentSourceMapPath);
|
|
52
|
+
yield fileOperationHelper_1.default.renameFile(origSourceMapPath, currentSourceMapPath);
|
|
53
|
+
logger_1.default.logMessageSync("Removed patch for SourceMap generation of Metro!", logger_1.default.INFO);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
logger_1.default.logMessageSync("Removing of patch for SourceMap generation failed!", logger_1.default.ERROR);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function removeGradleModification() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
try {
|
|
63
|
+
let path = yield fileOperationHelper_1.default.checkIfFileExists(nodePath.join(pathsConstants_1.default.getAndroidFolder(), "build.gradle"));
|
|
64
|
+
android.instrumentAndroidPlatform(path, true);
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
logger_1.default.logMessageSync("Removal of Gradle modification didnt work!", logger_1.default.ERROR);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function removePListModification() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
try {
|
|
74
|
+
ios_1.default.modifyPListFile(undefined, undefined, true);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
logger_1.default.logMessageSync("Removal of PList modification didnt work!", logger_1.default.ERROR);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearCustomArguments = exports.readCustomArguments = exports.writeCustomArguments = exports.parseCommandLine = exports.PROCESS_CUSTOM_ARGUMENT_NAME = void 0;
|
|
4
|
+
const CustomArgumentsBuilderImpl_1 = require("../core/CustomArgumentsBuilderImpl");
|
|
5
|
+
const CustomArgumentsImpl_1 = require("../core/CustomArgumentsImpl");
|
|
6
|
+
exports.PROCESS_CUSTOM_ARGUMENT_NAME = "dtCustomArguments";
|
|
7
|
+
function parseCommandLine(inputArgs) {
|
|
8
|
+
let parsedArgs = new CustomArgumentsBuilderImpl_1.CustomArgumentsBuilderImpl();
|
|
9
|
+
inputArgs.forEach(function (entry) {
|
|
10
|
+
let parts = entry.split("=");
|
|
11
|
+
if (parts.length == 2) {
|
|
12
|
+
switch (parts[0]) {
|
|
13
|
+
case "gradle":
|
|
14
|
+
parsedArgs.withGradleArgument(parts[1]);
|
|
15
|
+
break;
|
|
16
|
+
case "config":
|
|
17
|
+
parsedArgs.withConfigurationArgument(parts[1]);
|
|
18
|
+
break;
|
|
19
|
+
case "plist":
|
|
20
|
+
parsedArgs.withPlistArgument(parts[1]);
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return parsedArgs.build();
|
|
26
|
+
}
|
|
27
|
+
exports.parseCommandLine = parseCommandLine;
|
|
28
|
+
function writeCustomArguments(customArguments) {
|
|
29
|
+
if (!customArguments.isEmpty()) {
|
|
30
|
+
const customArgumentsJson = JSON.stringify(customArguments);
|
|
31
|
+
process.env[exports.PROCESS_CUSTOM_ARGUMENT_NAME] = customArgumentsJson;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.writeCustomArguments = writeCustomArguments;
|
|
35
|
+
function readCustomArguments() {
|
|
36
|
+
try {
|
|
37
|
+
if (process.env[exports.PROCESS_CUSTOM_ARGUMENT_NAME] != undefined) {
|
|
38
|
+
const parseCustomArguments = JSON.parse(process.env[exports.PROCESS_CUSTOM_ARGUMENT_NAME]);
|
|
39
|
+
return new CustomArgumentsImpl_1.CustomArgumentsImpl(parseCustomArguments.configurationPath, parseCustomArguments.gradlePath, parseCustomArguments.plistPath);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return new CustomArgumentsImpl_1.CustomArgumentsImpl();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return new CustomArgumentsImpl_1.CustomArgumentsImpl();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.readCustomArguments = readCustomArguments;
|
|
50
|
+
function clearCustomArguments() {
|
|
51
|
+
try {
|
|
52
|
+
process.env[exports.PROCESS_CUSTOM_ARGUMENT_NAME] = undefined;
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.clearCustomArguments = clearCustomArguments;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.patchMetroSourceMap = exports.SOURCE_MAP_FILE = exports.SOURCE_MAP_BACKUP_FILE = void 0;
|
|
4
|
+
const logger_1 = require("../logger");
|
|
5
|
+
const pathsConstants_1 = require("../pathsConstants");
|
|
6
|
+
const fileOperationHelper_1 = require("../fileOperationHelper");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
exports.SOURCE_MAP_BACKUP_FILE = "getSourceMapInfoOrig.js";
|
|
9
|
+
exports.SOURCE_MAP_FILE = "getSourceMapInfo.js";
|
|
10
|
+
function patchMetroSourceMap() {
|
|
11
|
+
logger_1.default.logMessageSync("Patching SourceMap generation of Metro .. ", logger_1.default.INFO);
|
|
12
|
+
let origSourceMapPath = path_1.join(pathsConstants_1.default.getMetroSouceMapPath(), exports.SOURCE_MAP_BACKUP_FILE);
|
|
13
|
+
try {
|
|
14
|
+
fileOperationHelper_1.default.checkIfFileExistsSync(origSourceMapPath);
|
|
15
|
+
logger_1.default.logMessageSync("Patching of SourceMap already happened!", logger_1.default.INFO);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
try {
|
|
19
|
+
let currentSourceMapPath = path_1.join(pathsConstants_1.default.getMetroSouceMapPath(), exports.SOURCE_MAP_FILE);
|
|
20
|
+
fileOperationHelper_1.default.checkIfFileExistsSync(currentSourceMapPath);
|
|
21
|
+
fileOperationHelper_1.default.renameFileSync(currentSourceMapPath, origSourceMapPath);
|
|
22
|
+
fileOperationHelper_1.default.copyFileSync(pathsConstants_1.default.getOurSourceMapFile(), currentSourceMapPath);
|
|
23
|
+
logger_1.default.logMessageSync("Patching of SourceMap successful!", logger_1.default.INFO);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
logger_1.default.logMessageSync("Patching of SourceMap generation failed!", logger_1.default.ERROR);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.patchMetroSourceMap = patchMetroSourceMap;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startArgumentsCheck = void 0;
|
|
4
|
+
const CustomArgumentUtil_1 = require("../util/CustomArgumentUtil");
|
|
5
|
+
function startArgumentsCheck() {
|
|
6
|
+
let customArguments = CustomArgumentUtil_1.parseCommandLine(process.argv.slice(2));
|
|
7
|
+
CustomArgumentUtil_1.writeCustomArguments(customArguments);
|
|
8
|
+
}
|
|
9
|
+
exports.startArgumentsCheck = startArgumentsCheck;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showVersionOfPlugin = exports.isPlatformAvailable = void 0;
|
|
4
|
+
const logger_1 = require("../logger");
|
|
5
|
+
const fileOperationHelper_1 = require("../fileOperationHelper");
|
|
6
|
+
const pathsConstants_1 = require("../pathsConstants");
|
|
7
|
+
function isPlatformAvailable(path, platform) {
|
|
8
|
+
try {
|
|
9
|
+
fileOperationHelper_1.default.checkIfFileExistsSync(path);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
logger_1.default.logMessageSync(`${platform} Location doesn't exist - Skip ${platform} instrumentation and configuration.`, logger_1.default.WARNING);
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.isPlatformAvailable = isPlatformAvailable;
|
|
18
|
+
function showVersionOfPlugin() {
|
|
19
|
+
try {
|
|
20
|
+
let packageJsonContent = fileOperationHelper_1.default.readTextFromFileSync(pathsConstants_1.default.getInternalPackageJsonFile());
|
|
21
|
+
let packageJsonContentObj = JSON.parse(packageJsonContent);
|
|
22
|
+
logger_1.default.logMessageSync("Dynatrace React Native Plugin - Version " + packageJsonContentObj.version, logger_1.default.INFO);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
logger_1.default.logMessageSync("Dynatrace React Native Plugin - Version NOT READABLE", logger_1.default.WARNING);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.showVersionOfPlugin = showVersionOfPlugin;
|
|
@@ -261,6 +261,12 @@ export declare class DynatraceAction {
|
|
|
261
261
|
* @param {Platform} platform - if empty default is both platforms
|
|
262
262
|
*/
|
|
263
263
|
leaveAction(platform?: Platform): void;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Cancel action
|
|
267
|
+
* @param {Platform} platform - if empty default is both platforms
|
|
268
|
+
*/
|
|
269
|
+
cancel(platform?: Platform): void;
|
|
264
270
|
}
|
|
265
271
|
|
|
266
272
|
/**
|
package/util/constants.js
DELETED