@microsoft/applicationinsights-react-native 2.4.2-nightly.2111-08 → 2.4.2-nightly.2111-09
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/Tests/External/DummyReactNative.js +25 -0
- package/Tests/Unit/src/reactnativeplugin.tests.ts +180 -0
- package/Tests/UnitTests.html +63 -0
- package/Tests/tsconfig.json +15 -0
- package/api-extractor.json +361 -0
- package/applicationinsights-react-native.build.error.log +27 -0
- package/applicationinsights-react-native.build.log +286 -0
- package/browser/applicationinsights-react-native.js +1 -1
- package/browser/applicationinsights-react-native.js.map +1 -1
- package/browser/applicationinsights-react-native.min.js +1 -1
- package/browser/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.api.json +1 -1
- package/dist/applicationinsights-react-native.d.ts +1 -1
- package/dist/applicationinsights-react-native.js +1 -1
- package/dist/applicationinsights-react-native.js.map +1 -1
- package/dist/applicationinsights-react-native.min.js +1 -1
- package/dist/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.rollup.d.ts +1 -1
- package/dist-esm/Interfaces/INativeDevice.js +1 -1
- package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
- package/dist-esm/Interfaces/index.js +1 -1
- package/dist-esm/ReactNativePlugin.js +1 -1
- package/dist-esm/index.js +1 -1
- package/microsoft-applicationinsights-react-native-2.4.2-nightly.2111-09.tgz +0 -0
- package/package.json +4 -4
- package/rollup.config.js +147 -0
- package/temp/applicationinsights-react-native.api.md +53 -0
- package/tslint.json +5 -0
- package/types/tsdoc-metadata.json +1 -1
package/dist-esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2111-
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2111-09
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { ReactNativePlugin } from "./ReactNativePlugin";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-react-native",
|
|
3
|
-
"version": "2.4.2-nightly.2111-
|
|
3
|
+
"version": "2.4.2-nightly.2111-09",
|
|
4
4
|
"description": "Microsoft Application Insights React Native Plugin",
|
|
5
5
|
"main": "dist-esm/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"eslint-plugin-node": "^11.1.0",
|
|
38
38
|
"eslint-plugin-promise": "^5.1.0",
|
|
39
39
|
"qunit": "^2.11.2",
|
|
40
|
-
"react": "^17.0.
|
|
40
|
+
"react": "^17.0.2",
|
|
41
41
|
"react-native": "^0.64.2",
|
|
42
42
|
"react-native-device-info": "^5.6.5",
|
|
43
43
|
"globby": "^11.0.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"uglify-js": "^3.11.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@microsoft/applicationinsights-common": "2.7.2-nightly.2111-
|
|
57
|
-
"@microsoft/applicationinsights-core-js": "2.7.2-nightly.2111-
|
|
56
|
+
"@microsoft/applicationinsights-common": "2.7.2-nightly.2111-09",
|
|
57
|
+
"@microsoft/applicationinsights-core-js": "2.7.2-nightly.2111-09",
|
|
58
58
|
"@microsoft/applicationinsights-shims": "2.0.0",
|
|
59
59
|
"@microsoft/dynamicproto-js": "^1.1.4"
|
|
60
60
|
},
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
2
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
3
|
+
import replace from "@rollup/plugin-replace";
|
|
4
|
+
import cleanup from "rollup-plugin-cleanup";
|
|
5
|
+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
6
|
+
import { uglify } from "../../tools/rollup-plugin-uglify3-js/dist/esm/rollup-plugin-uglify3-js";
|
|
7
|
+
import { importCheck } from "@microsoft/applicationinsights-rollup-es3";
|
|
8
|
+
import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/node/removedynamic";
|
|
9
|
+
import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm";
|
|
10
|
+
|
|
11
|
+
const version = require("./package.json").version;
|
|
12
|
+
const inputName = "index"
|
|
13
|
+
const outputName = "applicationinsights-react-native";
|
|
14
|
+
const banner = [
|
|
15
|
+
"/*!",
|
|
16
|
+
` * Application Insights JavaScript SDK - React Native Plugin, ${version}`,
|
|
17
|
+
" * Copyright (c) Microsoft and contributors. All rights reserved.",
|
|
18
|
+
" */"
|
|
19
|
+
].join("\n");
|
|
20
|
+
|
|
21
|
+
const replaceValues = {
|
|
22
|
+
"// Copyright (c) Microsoft Corporation. All rights reserved.": "",
|
|
23
|
+
"// Licensed under the MIT License.": ""
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function doCleanup() {
|
|
27
|
+
return cleanup({
|
|
28
|
+
comments: [
|
|
29
|
+
'some',
|
|
30
|
+
/^.\s*@DynamicProtoStub/i,
|
|
31
|
+
/^\*\*\s*@class\s*$/
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const browserRollupConfigFactory = isProduction => {
|
|
37
|
+
const browserRollupConfig = {
|
|
38
|
+
input: `dist-esm/${inputName}.js`,
|
|
39
|
+
output: {
|
|
40
|
+
file: `browser/${outputName}.js`,
|
|
41
|
+
banner: banner,
|
|
42
|
+
format: "umd",
|
|
43
|
+
name: "Microsoft.ApplicationInsights",
|
|
44
|
+
extend: true,
|
|
45
|
+
freeze: false,
|
|
46
|
+
sourcemap: true
|
|
47
|
+
},
|
|
48
|
+
plugins: [
|
|
49
|
+
dynamicRemove(),
|
|
50
|
+
replace({
|
|
51
|
+
preventAssignment: true,
|
|
52
|
+
delimiters: ["", ""],
|
|
53
|
+
values: replaceValues
|
|
54
|
+
}),
|
|
55
|
+
importCheck({ exclude: [ "applicationinsights-react-native" ] }),
|
|
56
|
+
peerDepsExternal(),
|
|
57
|
+
nodeResolve({
|
|
58
|
+
browser: true,
|
|
59
|
+
preferBuiltins: true,
|
|
60
|
+
dedupe: [ "react", "react-dom" ]
|
|
61
|
+
}),
|
|
62
|
+
commonjs(),
|
|
63
|
+
doCleanup(),
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
if (isProduction) {
|
|
68
|
+
browserRollupConfig.output.file = `browser/${outputName}.min.js`;
|
|
69
|
+
browserRollupConfig.plugins.push(
|
|
70
|
+
uglify({
|
|
71
|
+
ie8: true,
|
|
72
|
+
toplevel: true,
|
|
73
|
+
compress: {
|
|
74
|
+
passes:3,
|
|
75
|
+
unsafe: true
|
|
76
|
+
},
|
|
77
|
+
output: {
|
|
78
|
+
preamble: banner,
|
|
79
|
+
webkit:true
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return browserRollupConfig;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const nodeUmdRollupConfigFactory = (isProduction) => {
|
|
89
|
+
const nodeRollupConfig = {
|
|
90
|
+
input: `dist-esm/${inputName}.js`,
|
|
91
|
+
output: {
|
|
92
|
+
file: `dist/${outputName}.js`,
|
|
93
|
+
banner: banner,
|
|
94
|
+
format: "umd",
|
|
95
|
+
name: "Microsoft.ApplicationInsights",
|
|
96
|
+
extend: true,
|
|
97
|
+
freeze: false,
|
|
98
|
+
sourcemap: true
|
|
99
|
+
},
|
|
100
|
+
plugins: [
|
|
101
|
+
dynamicRemove(),
|
|
102
|
+
replace({
|
|
103
|
+
preventAssignment: true,
|
|
104
|
+
delimiters: ["", ""],
|
|
105
|
+
values: replaceValues
|
|
106
|
+
}),
|
|
107
|
+
importCheck({ exclude: [ "applicationinsights-react-native" ] }),
|
|
108
|
+
peerDepsExternal(),
|
|
109
|
+
nodeResolve({
|
|
110
|
+
browser: true,
|
|
111
|
+
preferBuiltins: true,
|
|
112
|
+
dedupe: [ "react", "react-dom" ]
|
|
113
|
+
}),
|
|
114
|
+
commonjs(),
|
|
115
|
+
doCleanup()
|
|
116
|
+
]
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
if (isProduction) {
|
|
120
|
+
nodeRollupConfig.output.file = `dist/${outputName}.min.js`;
|
|
121
|
+
nodeRollupConfig.plugins.push(
|
|
122
|
+
uglify({
|
|
123
|
+
ie8: true,
|
|
124
|
+
toplevel: true,
|
|
125
|
+
compress: {
|
|
126
|
+
passes:3,
|
|
127
|
+
unsafe: true
|
|
128
|
+
},
|
|
129
|
+
output: {
|
|
130
|
+
preamble: banner,
|
|
131
|
+
webkit:true
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return nodeRollupConfig;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
updateDistEsmFiles(replaceValues, banner);
|
|
141
|
+
|
|
142
|
+
export default [
|
|
143
|
+
browserRollupConfigFactory(true),
|
|
144
|
+
browserRollupConfigFactory(false),
|
|
145
|
+
nodeUmdRollupConfigFactory(true),
|
|
146
|
+
nodeUmdRollupConfigFactory(false)
|
|
147
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
## API Report File for "@microsoft/applicationinsights-react-native"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';
|
|
8
|
+
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
|
|
9
|
+
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
10
|
+
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
11
|
+
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
12
|
+
import { ITelemetryPlugin } from '@microsoft/applicationinsights-core-js';
|
|
13
|
+
|
|
14
|
+
// @public (undocumented)
|
|
15
|
+
export interface INativeDevice {
|
|
16
|
+
deviceClass?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
model?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
export interface IReactNativePluginConfig {
|
|
23
|
+
// (undocumented)
|
|
24
|
+
disableDeviceCollection?: boolean;
|
|
25
|
+
// (undocumented)
|
|
26
|
+
disableExceptionCollection?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// @public (undocumented)
|
|
30
|
+
export class ReactNativePlugin extends BaseTelemetryPlugin {
|
|
31
|
+
constructor(config?: IReactNativePluginConfig);
|
|
32
|
+
// (undocumented)
|
|
33
|
+
identifier: string;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
initialize(config?: IReactNativePluginConfig | object, // need `| object` to coerce to interface
|
|
36
|
+
core?: IAppInsightsCore, extensions?: IPlugin[]): void;
|
|
37
|
+
// (undocumented)
|
|
38
|
+
_nextPlugin?: ITelemetryPlugin;
|
|
39
|
+
// (undocumented)
|
|
40
|
+
priority: number;
|
|
41
|
+
// (undocumented)
|
|
42
|
+
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
43
|
+
// (undocumented)
|
|
44
|
+
setDeviceId(newId: string): void;
|
|
45
|
+
// (undocumented)
|
|
46
|
+
setDeviceModel(newModel: string): void;
|
|
47
|
+
// (undocumented)
|
|
48
|
+
setDeviceType(newType: string): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// (No @packageDocumentation comment for this package)
|
|
52
|
+
|
|
53
|
+
```
|
package/tslint.json
ADDED