[BUG] Investigate changing the sideEffects: false to list only the files that include the shims module from the all AI modules so that webpack can evaluate correctly #1509 (#1523)

Investigate removing the globals __extends() and __assign() populated by applicationinsights-shims #1280
This commit is contained in:
Nev 2021-04-15 13:43:41 -07:00 коммит произвёл GitHub
Родитель 841adbbe1f
Коммит 1c39bf97fa
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
57 изменённых файлов: 946 добавлений и 3881 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -249,6 +249,7 @@ temp
# Rush files
common/temp/**
package-deps.json
package-lock.json
# test output
aicore.tests.js*

Просмотреть файл

@ -46,6 +46,7 @@
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -56,11 +57,12 @@
"source-map-loader": "^0.2.3",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
"typescript": "2.5.3",
"tslib": "^1.13.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-analytics-js": "2.6.1",
"@microsoft/applicationinsights-channel-js": "2.6.1",
"@microsoft/applicationinsights-common": "2.6.1",

Просмотреть файл

@ -1,5 +1,3 @@
import '@microsoft/applicationinsights-shims';
export {
IApplicationInsights,
Snippet,

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "AISKU/types",

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
import {
IConfiguration,
AppInsightsCore,

Просмотреть файл

@ -25,6 +25,7 @@
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -32,12 +33,13 @@
"rollup": "^2.32.0",
"source-map-loader": "^0.2.3",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-common": "2.6.1",
"@microsoft/applicationinsights-channel-js": "2.6.1",
"@microsoft/applicationinsights-core-js": "2.6.1"

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "AISKULight/types",

Просмотреть файл

@ -29,12 +29,14 @@
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"qunit": "^2.9.1",
@ -42,7 +44,7 @@
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/applicationinsights-common": "2.6.1"
},

Просмотреть файл

@ -1,3 +1 @@
import '@microsoft/applicationinsights-shims';
export { Sender } from "./Sender";

Просмотреть файл

@ -10,8 +10,9 @@
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"declaration": true,
"declarationDir": "channels/applicationinsights-channel-js/types",
"outDir": "dist-esm",

Просмотреть файл

@ -41,10 +41,14 @@
"@rollup/plugin-replace": "^2.3.3",
"rollup": "^2.32.0",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"qunit": "^2.9.1",
"sinon": "^7.3.1"
"sinon": "^7.3.1",
"globby": "^11.0.0",
"magic-string": "^0.25.7"
},
"dependencies": {
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/dynamicproto-js": "^1.1.1"
}
}

Просмотреть файл

@ -1,4 +1,5 @@
import nodeResolve from "@rollup/plugin-node-resolve";
import { updateDistEsmFiles } from "../../../tools/updateDistEsm/updateDistEsm";
const version = require("./package.json").version;
const outputName = "ai-test-framework";
@ -29,6 +30,8 @@ const nodeUmdRollupConfigFactory = () => {
return nodeRollupConfig;
}
updateDistEsmFiles({}, banner);
export default [
nodeUmdRollupConfigFactory(),
];

Просмотреть файл

@ -7,8 +7,9 @@
"moduleResolution": "node",
"target": "es5",
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"alwaysStrict": true,
"declaration": true,
"outDir": "dist-esm/",

213
common/config/rush/npm-shrinkwrap.json сгенерированный
Просмотреть файл

@ -37,7 +37,7 @@
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"magic-string": "^0.25.5",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
@ -46,6 +46,7 @@
"serve-static": "^1.13.2",
"sinon": "^7.3.1",
"source-map-loader": "^0.2.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -296,7 +297,7 @@
"node_modules/@rush-temp/ai-test-framework": {
"version": "0.0.0",
"resolved": "file:projects/ai-test-framework.tgz",
"integrity": "sha512-WXprhiwM0LXd9FmrKuJj3pM0kfg5o7SA3wZT6dqLnFs+pPqdxo5MY/C72yynRIwGCAEl76Y6C48d4cteB+ciVQ==",
"integrity": "sha512-SGS14RvVIb/R+vYt3PmaPKsejWquFdnSs4EN2BsipWFBdHoYJYoe8PW9BOSWtRTytQiKlvLxRNOGh5SQjv2A1Q==",
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
@ -304,12 +305,15 @@
"@rollup/plugin-replace": "^2.3.3",
"@types/qunit": "^2.5.3",
"@types/sinon": "4.3.3",
"globby": "^11.0.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -319,7 +323,7 @@
"node_modules/@rush-temp/applicationinsights-analytics-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-analytics-js.tgz",
"integrity": "sha512-OxMO4WPk36/qDooV6cLtuFh/3VDJ5XgkqkWPdLNLFZ49oerLM6WjD5eKdmAy3HKAi2Qz6VML2p4q2dRrgTdbkQ==",
"integrity": "sha512-aYP9huPMtmqsXVT+iDeJYZRM6qFir0Im/1NgucKyoouhrTyw3pdyiSeyfshnwhY7JLjxlzH33z/GReCFJ4k9KA==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -331,10 +335,12 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -343,7 +349,7 @@
"node_modules/@rush-temp/applicationinsights-channel-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-channel-js.tgz",
"integrity": "sha512-vYQ6rp659jcHfG3pjjCkN+3SjnCVX6yy80rWiTHF3rJRbljYv9T1cKIwL3yMX648Izb7+BHwuXx7Zma/fa77Ng==",
"integrity": "sha512-Mrizq3LQAgVPgQOZ1WJSRjD4OxCxYBdVTWI7W9CG63V71iXxpMLFhwEt5cuUE4Bs7qE2ZDAfVomMC7PSQoNm+Q==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -357,10 +363,12 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -369,7 +377,7 @@
"node_modules/@rush-temp/applicationinsights-clickanalytics-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-clickanalytics-js.tgz",
"integrity": "sha512-F/qquAth7cf2nQlSz6Ral5PEhRw4BoPJKJc+obipE6uECa+xQAwBNmnHnEAXn85YboKrFCN9rtZ9S7uEFwSF3g==",
"integrity": "sha512-CkLuoMdX4VoN6eaJrCd11QY/zDnhbFIwiFxhskBLwYUyyBsO2gEG4gbifEB42ZxeJb2QC7zqhZg1KjezfegJoQ==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -381,8 +389,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -391,27 +401,7 @@
"node_modules/@rush-temp/applicationinsights-common": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-common.tgz",
"integrity": "sha512-FA4jfOgCdQJlYPJi8DrHLTo8VXPauNQN5f4eMN6njAzH9CENJT2ESmNRa+j+bCgSB5cHOyO1xtLzRAxPQi/W+g==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
}
},
"node_modules/@rush-temp/applicationinsights-core-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-core-js.tgz",
"integrity": "sha512-0I8raFF6JUCqioRyHZAamLWvw3SukKlYKRz9AF7/te1o+vgdLcav2F6PEiDT7dd+I5FmCGRsFKih9ei/KdLP9w==",
"integrity": "sha512-PnlUfO19Q8uiM9hZo07TCR9V7w/PRT4QR0VvovmNAfGO9VfZ13ziFxsbOaynXyyuuhRf5mGpElb1+Cy3fiJG+A==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -422,10 +412,35 @@
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
}
},
"node_modules/@rush-temp/applicationinsights-core-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-core-js.tgz",
"integrity": "sha512-6Dx19Y9IOGkibyCSOXsGTDCXmKjZmwU+Mix5fcVou2UE3yNj3mQr+CPaV8Ron+tRpezWBNMGoP9Y5kMrtBle7Q==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"globby": "^11.0.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -435,7 +450,7 @@
"node_modules/@rush-temp/applicationinsights-debugplugin-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-debugplugin-js.tgz",
"integrity": "sha512-54muE9HgDuGjcQZSGccIyQ9BgUnPFzuDlT9k9mvI7VJ5U0AjHfstUZ5UcNX79sShPxxO9y67CyNU4zwysou3zA==",
"integrity": "sha512-a5JrCyWRVT4YLm97utUTlmbbB+0zyurCu3y9qMVsuWkwH81uyd5IziMGWlV0+LwG/MSyz1ZUrIJONBeEB3EQYQ==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -447,8 +462,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -457,7 +474,7 @@
"node_modules/@rush-temp/applicationinsights-dependencies-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-dependencies-js.tgz",
"integrity": "sha512-WLquiV4az+IRVQjn5iNTZxnMzAIogZZx7YJTRa7be8kRD3dvrEiBgNWie6LXPMdLQnGDicD9WzNkkaxHePyWMA==",
"integrity": "sha512-kjsFmuUui2JcxNsPnxKBgGuCpj4/xDs5TWsDYJHfFDH+dQ8YWCRleVeXL5XI+Hk+E+OW4r+CTDc0TiWIBNRhuw==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -469,8 +486,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -479,7 +498,7 @@
"node_modules/@rush-temp/applicationinsights-properties-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-properties-js.tgz",
"integrity": "sha512-qrcDgSF2Z711HeSajVXUBDlerBAX0kqOZ8ixH6sDMPxjdZvWSWn+1sFbPESC1T3hbl8CyDD1A6KLFxYM9Awxqg==",
"integrity": "sha512-czHXFnizeTw70iSgsu/1PHBbvDP0+0sIlG21QiP9nk5k7qcaEaacn6ZAb3di46jkfs0Pm0EYkv5HojWNPqHysA==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -491,10 +510,12 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -503,7 +524,7 @@
"node_modules/@rush-temp/applicationinsights-rollup-es3": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-rollup-es3.tgz",
"integrity": "sha512-AapKyJXx3l/2bta+7Y7NckO4Yw4yxDJWLNj8TPs/4wZRzlZfjYCIpMPD6dVhfXQXnJIzXG+11qbY2EBgO/UsRQ==",
"integrity": "sha512-5BR7vDonxxPIjStxWtEg6zRYViQqW5hC0U5z1QQOE63olWdA9xKpYtJcOdvDgzvduzcWvw0y8clWDxhqv3Ssog==",
"dependencies": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
@ -512,9 +533,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"magic-string": "^0.25.5",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-minify-es": "^1.1.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -524,7 +546,7 @@
"node_modules/@rush-temp/applicationinsights-rollup-plugin-uglify3-js": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-rollup-plugin-uglify3-js.tgz",
"integrity": "sha512-hNeYmDWmyR61QMAY8SwKTiHZFc25ltTSVV6SbiBBzgExPT0K2emWH7nQ4R4z6fxRAEaage1qsiT7q7MA9FAGmw==",
"integrity": "sha512-dCxW2EZLbR8PINR/cT5GI7Nl7o8Fv3wAorzWg6XRZb0oH9jb7UDXKZjDlh2BpWc0mKWmk5K5j38jHMsEIiyBKw==",
"dependencies": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
@ -535,6 +557,7 @@
"grunt-tslint": "^5.0.2",
"rollup": "^2.32.0",
"rollup-plugin-minify-es": "^1.1.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -564,7 +587,7 @@
"node_modules/@rush-temp/applicationinsights-web": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-web.tgz",
"integrity": "sha512-trCKRtRTXsqZckW3U1b/XR0DvsaNbd2YAqMYXP7vRbS3qHlqXO0MJhgmVxZ0UXnDyX1OIJqyfflCUfvg7VBucQ==",
"integrity": "sha512-BJ+HUtg3j2xnhlq8U0nsgoOc9Ztmk62/3QXaX2HLex0Oh98IZnKPfNgRqFEe8rypJEgkkJfhM4IBAKpq6aXCbQ==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -580,6 +603,7 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
@ -587,6 +611,7 @@
"serve-static": "^1.13.2",
"sinon": "^7.3.1",
"source-map-loader": "^0.2.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -595,7 +620,7 @@
"node_modules/@rush-temp/applicationinsights-web-basic": {
"version": "0.0.0",
"resolved": "file:projects/applicationinsights-web-basic.tgz",
"integrity": "sha512-zYOyqDm+GSYZhbOebbUT/ei8/5M1YB5ERNIIVBqZtW5PiT0UtcFvV64O9C/dEEzDmSuMF2ebOSHk65MtTRXkBQ==",
"integrity": "sha512-xErVRneQtCtuqunHadRixE0c+TMxqw+yMO22pOU+F9TlVRglcVJUcVLFEwtt5xxO/I+8vDRvPXs2YEWdOxBqyA==",
"dependencies": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -607,9 +632,11 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"source-map-loader": "^0.2.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -3314,19 +3341,19 @@
}
},
"node_modules/mime-db": {
"version": "1.46.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz",
"integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==",
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.29",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz",
"integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==",
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"dependencies": {
"mime-db": "1.46.0"
"mime-db": "1.47.0"
},
"engines": {
"node": ">= 0.6"
@ -5688,7 +5715,7 @@
},
"@rush-temp/ai-test-framework": {
"version": "file:projects\\ai-test-framework.tgz",
"integrity": "sha512-WXprhiwM0LXd9FmrKuJj3pM0kfg5o7SA3wZT6dqLnFs+pPqdxo5MY/C72yynRIwGCAEl76Y6C48d4cteB+ciVQ==",
"integrity": "sha512-SGS14RvVIb/R+vYt3PmaPKsejWquFdnSs4EN2BsipWFBdHoYJYoe8PW9BOSWtRTytQiKlvLxRNOGh5SQjv2A1Q==",
"requires": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
@ -5696,12 +5723,15 @@
"@rollup/plugin-replace": "^2.3.3",
"@types/qunit": "^2.5.3",
"@types/sinon": "4.3.3",
"globby": "^11.0.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -5710,7 +5740,7 @@
},
"@rush-temp/applicationinsights-analytics-js": {
"version": "file:projects\\applicationinsights-analytics-js.tgz",
"integrity": "sha512-OxMO4WPk36/qDooV6cLtuFh/3VDJ5XgkqkWPdLNLFZ49oerLM6WjD5eKdmAy3HKAi2Qz6VML2p4q2dRrgTdbkQ==",
"integrity": "sha512-aYP9huPMtmqsXVT+iDeJYZRM6qFir0Im/1NgucKyoouhrTyw3pdyiSeyfshnwhY7JLjxlzH33z/GReCFJ4k9KA==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5722,10 +5752,12 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5733,7 +5765,7 @@
},
"@rush-temp/applicationinsights-channel-js": {
"version": "file:projects\\applicationinsights-channel-js.tgz",
"integrity": "sha512-vYQ6rp659jcHfG3pjjCkN+3SjnCVX6yy80rWiTHF3rJRbljYv9T1cKIwL3yMX648Izb7+BHwuXx7Zma/fa77Ng==",
"integrity": "sha512-Mrizq3LQAgVPgQOZ1WJSRjD4OxCxYBdVTWI7W9CG63V71iXxpMLFhwEt5cuUE4Bs7qE2ZDAfVomMC7PSQoNm+Q==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5747,10 +5779,12 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5758,7 +5792,7 @@
},
"@rush-temp/applicationinsights-clickanalytics-js": {
"version": "file:projects\\applicationinsights-clickanalytics-js.tgz",
"integrity": "sha512-F/qquAth7cf2nQlSz6Ral5PEhRw4BoPJKJc+obipE6uECa+xQAwBNmnHnEAXn85YboKrFCN9rtZ9S7uEFwSF3g==",
"integrity": "sha512-CkLuoMdX4VoN6eaJrCd11QY/zDnhbFIwiFxhskBLwYUyyBsO2gEG4gbifEB42ZxeJb2QC7zqhZg1KjezfegJoQ==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5770,8 +5804,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5779,26 +5815,7 @@
},
"@rush-temp/applicationinsights-common": {
"version": "file:projects\\applicationinsights-common.tgz",
"integrity": "sha512-FA4jfOgCdQJlYPJi8DrHLTo8VXPauNQN5f4eMN6njAzH9CENJT2ESmNRa+j+bCgSB5cHOyO1xtLzRAxPQi/W+g==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
}
},
"@rush-temp/applicationinsights-core-js": {
"version": "file:projects\\applicationinsights-core-js.tgz",
"integrity": "sha512-0I8raFF6JUCqioRyHZAamLWvw3SukKlYKRz9AF7/te1o+vgdLcav2F6PEiDT7dd+I5FmCGRsFKih9ei/KdLP9w==",
"integrity": "sha512-PnlUfO19Q8uiM9hZo07TCR9V7w/PRT4QR0VvovmNAfGO9VfZ13ziFxsbOaynXyyuuhRf5mGpElb1+Cy3fiJG+A==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5809,10 +5826,34 @@
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
}
},
"@rush-temp/applicationinsights-core-js": {
"version": "file:projects\\applicationinsights-core-js.tgz",
"integrity": "sha512-6Dx19Y9IOGkibyCSOXsGTDCXmKjZmwU+Mix5fcVou2UE3yNj3mQr+CPaV8Ron+tRpezWBNMGoP9Y5kMrtBle7Q==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"globby": "^11.0.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -5821,7 +5862,7 @@
},
"@rush-temp/applicationinsights-debugplugin-js": {
"version": "file:projects\\applicationinsights-debugplugin-js.tgz",
"integrity": "sha512-54muE9HgDuGjcQZSGccIyQ9BgUnPFzuDlT9k9mvI7VJ5U0AjHfstUZ5UcNX79sShPxxO9y67CyNU4zwysou3zA==",
"integrity": "sha512-a5JrCyWRVT4YLm97utUTlmbbB+0zyurCu3y9qMVsuWkwH81uyd5IziMGWlV0+LwG/MSyz1ZUrIJONBeEB3EQYQ==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5833,8 +5874,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5842,7 +5885,7 @@
},
"@rush-temp/applicationinsights-dependencies-js": {
"version": "file:projects\\applicationinsights-dependencies-js.tgz",
"integrity": "sha512-WLquiV4az+IRVQjn5iNTZxnMzAIogZZx7YJTRa7be8kRD3dvrEiBgNWie6LXPMdLQnGDicD9WzNkkaxHePyWMA==",
"integrity": "sha512-kjsFmuUui2JcxNsPnxKBgGuCpj4/xDs5TWsDYJHfFDH+dQ8YWCRleVeXL5XI+Hk+E+OW4r+CTDc0TiWIBNRhuw==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5854,8 +5897,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5863,7 +5908,7 @@
},
"@rush-temp/applicationinsights-properties-js": {
"version": "file:projects\\applicationinsights-properties-js.tgz",
"integrity": "sha512-qrcDgSF2Z711HeSajVXUBDlerBAX0kqOZ8ixH6sDMPxjdZvWSWn+1sFbPESC1T3hbl8CyDD1A6KLFxYM9Awxqg==",
"integrity": "sha512-czHXFnizeTw70iSgsu/1PHBbvDP0+0sIlG21QiP9nk5k7qcaEaacn6ZAb3di46jkfs0Pm0EYkv5HojWNPqHysA==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5875,10 +5920,12 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"sinon": "^7.3.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5886,7 +5933,7 @@
},
"@rush-temp/applicationinsights-rollup-es3": {
"version": "file:projects\\applicationinsights-rollup-es3.tgz",
"integrity": "sha512-AapKyJXx3l/2bta+7Y7NckO4Yw4yxDJWLNj8TPs/4wZRzlZfjYCIpMPD6dVhfXQXnJIzXG+11qbY2EBgO/UsRQ==",
"integrity": "sha512-5BR7vDonxxPIjStxWtEg6zRYViQqW5hC0U5z1QQOE63olWdA9xKpYtJcOdvDgzvduzcWvw0y8clWDxhqv3Ssog==",
"requires": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
@ -5895,9 +5942,10 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"magic-string": "^0.25.5",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-minify-es": "^1.1.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -5906,7 +5954,7 @@
},
"@rush-temp/applicationinsights-rollup-plugin-uglify3-js": {
"version": "file:projects\\applicationinsights-rollup-plugin-uglify3-js.tgz",
"integrity": "sha512-hNeYmDWmyR61QMAY8SwKTiHZFc25ltTSVV6SbiBBzgExPT0K2emWH7nQ4R4z6fxRAEaage1qsiT7q7MA9FAGmw==",
"integrity": "sha512-dCxW2EZLbR8PINR/cT5GI7Nl7o8Fv3wAorzWg6XRZb0oH9jb7UDXKZjDlh2BpWc0mKWmk5K5j38jHMsEIiyBKw==",
"requires": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
@ -5917,6 +5965,7 @@
"grunt-tslint": "^5.0.2",
"rollup": "^2.32.0",
"rollup-plugin-minify-es": "^1.1.1",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
@ -5944,7 +5993,7 @@
},
"@rush-temp/applicationinsights-web": {
"version": "file:projects\\applicationinsights-web.tgz",
"integrity": "sha512-trCKRtRTXsqZckW3U1b/XR0DvsaNbd2YAqMYXP7vRbS3qHlqXO0MJhgmVxZ0UXnDyX1OIJqyfflCUfvg7VBucQ==",
"integrity": "sha512-BJ+HUtg3j2xnhlq8U0nsgoOc9Ztmk62/3QXaX2HLex0Oh98IZnKPfNgRqFEe8rypJEgkkJfhM4IBAKpq6aXCbQ==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5960,6 +6009,7 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"grunt-tslint": "^5.0.2",
"magic-string": "^0.25.7",
"qunit": "^2.9.1",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
@ -5967,6 +6017,7 @@
"serve-static": "^1.13.2",
"sinon": "^7.3.1",
"source-map-loader": "^0.2.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -5974,7 +6025,7 @@
},
"@rush-temp/applicationinsights-web-basic": {
"version": "file:projects\\applicationinsights-web-basic.tgz",
"integrity": "sha512-zYOyqDm+GSYZhbOebbUT/ei8/5M1YB5ERNIIVBqZtW5PiT0UtcFvV64O9C/dEEzDmSuMF2ebOSHk65MtTRXkBQ==",
"integrity": "sha512-xErVRneQtCtuqunHadRixE0c+TMxqw+yMO22pOU+F9TlVRglcVJUcVLFEwtt5xxO/I+8vDRvPXs2YEWdOxBqyA==",
"requires": {
"@microsoft/api-extractor": "^7.9.11",
"@microsoft/dynamicproto-js": "^1.1.1",
@ -5986,9 +6037,11 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"magic-string": "^0.25.7",
"rollup": "^2.32.0",
"rollup-plugin-cleanup": "3.2.1",
"source-map-loader": "^0.2.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3"
@ -8112,16 +8165,16 @@
"integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg=="
},
"mime-db": {
"version": "1.46.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz",
"integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ=="
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw=="
},
"mime-types": {
"version": "2.1.29",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz",
"integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==",
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"requires": {
"mime-db": "1.46.0"
"mime-db": "1.47.0"
}
},
"minimatch": {

Просмотреть файл

@ -27,7 +27,9 @@
"@microsoft/applicationinsights-properties-js": "2.6.1",
"@microsoft/api-extractor" : "^7.9.11",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -44,7 +46,7 @@
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/applicationinsights-common": "2.6.1"
},

Просмотреть файл

@ -1,6 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
export { ApplicationInsights } from "./JavaScriptSDK/ApplicationInsights";
export { IAppInsightsInternal } from "./JavaScriptSDK/Telemetry/PageViewManager";

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "extensions/applicationinsights-analytics-js/types",

Просмотреть файл

@ -22,7 +22,9 @@
"@microsoft/applicationinsights-properties-js": "2.6.1",
"@microsoft/api-extractor" : "^7.9.11",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -37,7 +39,7 @@
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims": "1.0.3",
"@microsoft/applicationinsights-shims": "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/applicationinsights-common": "2.6.1"
},

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
import { ClickAnalyticsPlugin, BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator } from "./ClickAnalyticsPlugin";
export { ClickAnalyticsPlugin, BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator }

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "extensions/applicationinsights-clickanalytics-js/types",

Просмотреть файл

@ -25,11 +25,13 @@
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
"@microsoft/api-extractor" : "^7.9.11",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -42,7 +44,7 @@
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-common": "2.6.1",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/applicationinsights-shims": "1.0.3"
"@microsoft/applicationinsights-shims": "2.0.0"
},
"license": "MIT"
}

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
import DebugPlugin from "./DebugPlugin";
export { DebugPlugin };

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "extensions/applicationinsights-debugplugin-js/types",

Просмотреть файл

@ -25,11 +25,13 @@
"@microsoft/applicationinsights-rollup-es3" : "1.1.3",
"@microsoft/api-extractor" : "^7.9.11",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -40,7 +42,7 @@
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/applicationinsights-common": "2.6.1"
},

Просмотреть файл

@ -1,6 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
export { AjaxMonitor as AjaxPlugin, IDependenciesPlugin, XMLHttpRequestInstrumented, IInstrumentationRequirements } from "./ajax";
export { ajaxRecord } from "./ajaxRecord";

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "extensions/applicationinsights-dependencies-js/types",

Просмотреть файл

@ -26,11 +26,13 @@
"@microsoft/applicationinsights-rollup-es3" : "1.1.3",
"@microsoft/api-extractor" : "^7.9.11",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"grunt": "^1.3.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -43,7 +45,7 @@
},
"dependencies": {
"@microsoft/dynamicproto-js": "^1.1.1",
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/applicationinsights-common": "2.6.1"
},

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
import PropertiesPlugin from "./PropertiesPlugin";
import { TelemetryTrace } from "./Context/TelemetryTrace";
import { TelemetryContext } from './TelemetryContext'

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "extensions/applicationinsights-properties-js/types",

Просмотреть файл

@ -46,7 +46,8 @@
"ts-jest": "^24.0.2",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.9.3"
"typescript": "^3.9.3",
"tslib": "^2.0.0"
},
"dependencies": {
"@microsoft/applicationinsights-shims": "^1.0.3",

Просмотреть файл

@ -34,7 +34,8 @@
"rollup-plugin-cleanup": "3.2.1",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.9.7"
"typescript": "^3.9.7",
"tslib": "^2.0.0"
},
"dependencies": {
"@microsoft/applicationinsights-common": "^2.6.0",

Просмотреть файл

@ -446,30 +446,30 @@ module.exports = function (grunt) {
grunt.registerTask("common", ["ts:common"]);
grunt.registerTask("module", ["ts:module"]);
grunt.registerTask("ai", ["ts:appinsights"]);
grunt.registerTask("aitests", ["ts:appinsights", "ts:appinsightstests", "qunit:aitests"]);
grunt.registerTask("aitests", ["ts:appinsightstests", "qunit:aitests"]);
grunt.registerTask("aisku", ["ts:aisku"]);
grunt.registerTask("aiskulite", ["ts:aiskulite"]);
grunt.registerTask("snippetvnext", ["uglify:snippetvNext"]);
grunt.registerTask("aiskutests", ["ts:aisku", "ts:aiskutests", "qunit:aisku"]);
grunt.registerTask("aiskutests", ["ts:aiskutests", "qunit:aisku"]);
grunt.registerTask("test", ["ts:default", "ts:test", "ts:testSchema", "ts:testE2E", "qunit:all"]);
grunt.registerTask("test1ds", ["coretest", "common", "propertiestests", "depstest", "aitests", "aiskutests", "reactnativetests", "reacttests"]);
grunt.registerTask("coretest", ["ts:core", "ts:coretest", "qunit:core"]);
grunt.registerTask("coretest", ["ts:coretest", "qunit:core"]);
grunt.registerTask("commontest", ["ts:common", "ts:commontest", "qunit:common"]);
grunt.registerTask("properties", ["ts:properties"]);
grunt.registerTask("propertiestests", ["ts:properties", "ts:propertiestests", "qunit:properties"]);
grunt.registerTask("propertiestests", ["ts:propertiestests", "qunit:properties"]);
grunt.registerTask("reactnative", ["ts:reactnative"]);
grunt.registerTask("reactnativetests", ["qunit:reactnative"]);
grunt.registerTask("deps", ["ts:deps"]);
grunt.registerTask("depstest", ["ts:deps", "ts:depstest", "qunit:deps"]);
grunt.registerTask("depstest", ["ts:depstest", "qunit:deps"]);
grunt.registerTask("debugplugin", ["ts:debugplugin"]);
grunt.registerTask("aichannel", ["ts:aichannel"]);
grunt.registerTask("aichanneltest", ["ts:aichannel", "ts:aichanneltest", "qunit:aichannel"]);
grunt.registerTask("aichanneltest", ["ts:aichanneltest", "qunit:aichannel"]);
grunt.registerTask("rollupuglify", ["ts:rollupuglify"]);
grunt.registerTask("rollupes3", ["ts:rollupes3", "ts:rollupes3test", "qunit:rollupes3"]);
grunt.registerTask("rollupes3test", ["ts:rollupes3", "ts:rollupes3test", "qunit:rollupes3"]);
grunt.registerTask("rollupes3test", ["ts:rollupes3test", "qunit:rollupes3"]);
grunt.registerTask("shims", ["ts:shims", "ts:shimstest", "qunit:shims"]);
grunt.registerTask("shimstest", ["ts:shims", "ts:shimstest", "qunit:shims"]);
grunt.registerTask("shimstest", ["ts:shimstest", "qunit:shims"]);
grunt.registerTask("clickanalytics", ["ts:clickanalytics"]);
grunt.registerTask("clickanalyticstests", ["ts:clickanalytics", "ts:clickanalyticstests", "qunit:clickanalytics"]);
grunt.registerTask("clickanalyticstests", ["ts:clickanalyticstests", "qunit:clickanalytics"]);
grunt.registerTask("tst-framework", ["ts:tst-framework"]);
};

3501
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -37,6 +37,7 @@
"tslint-microsoft-contrib": "^5.2.1",
"tslint-config-prettier": "^1.18.0",
"typescript": "2.5.3",
"whatwg-fetch": "^3.0.0"
"whatwg-fetch": "^3.0.0",
"typedoc": "^0.16.9"
}
}

Просмотреть файл

@ -33,11 +33,14 @@
"rollup-plugin-cleanup": "3.2.1",
"rollup": "^2.32.0",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0"
"tslint-config-prettier": "^1.18.0",
"globby": "^11.0.0",
"magic-string": "^0.25.7"
},
"dependencies": {
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/applicationinsights-core-js": "2.6.1",
"@microsoft/dynamicproto-js": "^1.1.1"
},

Просмотреть файл

@ -4,6 +4,7 @@ import replace from "@rollup/plugin-replace";
import cleanup from "rollup-plugin-cleanup";
import { es3Poly, es3Check, importCheck } from "@microsoft/applicationinsights-rollup-es3";
import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/node/removedynamic";
import { updateDistEsmFiles } from "../../tools/updateDistEsm/updateDistEsm";
const version = require("./package.json").version;
const outputName = "applicationinsights-common";
@ -14,6 +15,11 @@ const banner = [
" */"
].join("\n");
const replaceValues = {
"// Copyright (c) Microsoft Corporation. All rights reserved.": "",
"// Licensed under the MIT License.": ""
};
function doCleanup() {
return cleanup({
comments: [
@ -41,10 +47,7 @@ const browserRollupConfigFactory = isProduction => {
replace({
preventAssignment: true,
delimiters: ["", ""],
values: {
"// Copyright (c) Microsoft Corporation. All rights reserved.": "",
"// Licensed under the MIT License.": ""
}
values: replaceValues
}),
importCheck({ exclude: [ "applicationinsights-common-js" ] }),
nodeResolve({
@ -95,10 +98,7 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
replace({
preventAssignment: true,
delimiters: ["", ""],
values: {
"// Copyright (c) Microsoft Corporation. All rights reserved.": "",
"// Licensed under the MIT License.": ""
}
values: replaceValues
}),
importCheck({ exclude: [ "applicationinsights-common-js" ] }),
nodeResolve(),
@ -129,6 +129,8 @@ const nodeUmdRollupConfigFactory = (isProduction) => {
return nodeRollupConfig;
};
updateDistEsmFiles(replaceValues, banner);
export default [
nodeUmdRollupConfigFactory(true),
nodeUmdRollupConfigFactory(false),

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
export {
IUtil, Util, ICorrelationIdHelper, CorrelationIdHelper,
IDateTimeUtils, DateTimeUtils, dateTimeUtilsNow, dateTimeUtilsDuration,

Просмотреть файл

@ -9,8 +9,9 @@
"alwaysStrict": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationDir": "shared/AppInsightsCommon/types",

Просмотреть файл

@ -6,8 +6,9 @@
"module": "amd",
"moduleResolution": "node",
"target": "es6",
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"alwaysStrict": true,
"declaration": true
},

Просмотреть файл

@ -40,6 +40,7 @@
"grunt-contrib-qunit": "^3.1.0",
"grunt-ts": "^6.0.0-beta.22",
"globby": "^11.0.0",
"magic-string": "^0.25.7",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
@ -49,11 +50,12 @@
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
"typescript": "2.5.3",
"tslib": "^1.13.0",
"qunit": "^2.9.1",
"sinon": "^7.3.1"
},
"dependencies": {
"@microsoft/applicationinsights-shims" : "1.0.3",
"@microsoft/applicationinsights-shims" : "2.0.0",
"@microsoft/dynamicproto-js": "^1.1.1"
}
}

Просмотреть файл

@ -3,7 +3,7 @@
"use strict";
import {
getGlobal as shimsGetGlobal, strShimUndefined, strShimObject, strShimPrototype, strShimFunction
getGlobal, strShimUndefined, strShimObject, strShimPrototype, strShimFunction
} from "@microsoft/applicationinsights-shims";
import { strContains } from "./HelperFuncs";
@ -14,11 +14,6 @@ import { strContains } from "./HelperFuncs";
* functions/properties only need to include those that are used within their own modules.
*/
export const strUndefined = strShimUndefined;
export const strObject = strShimObject;
export const strPrototype = strShimPrototype;
export const strFunction = strShimFunction;
const strWindow = "window";
const strDocument = "document";
const strNavigator = "navigator";
@ -45,20 +40,6 @@ export function setEnableEnvMocks(enabled: boolean) {
_enableMocks = enabled;
}
/**
* Returns the current global scope object, for a normal web page this will be the current
* window, for a Web Worker this will be current worker global scope via "self". The internal
* implementation returns the first available instance object in the following order
* - globalThis (New standard)
* - self (Will return the current window instance for supported browsers)
* - window (fallback for older browser implementations)
* - global (NodeJS standard)
* - <null> (When all else fails)
* While the return type is a Window for the normal case, not all environments will support all
* of the properties or functions.
*/
export const getGlobal:() => Window = shimsGetGlobal;
/**
* Return the named global object if available, will return null if the object is not available.
* @param name The globally named object
@ -86,7 +67,7 @@ export function getGlobalInst<T>(name:string): T {
* Defined as a function to support lazy / late binding environments.
*/
export function hasWindow(): boolean {
return Boolean(typeof window === strObject && window);
return Boolean(typeof window === strShimObject && window);
}
/**
@ -111,7 +92,7 @@ export function getWindow(): Window | null {
* Defined as a function to support lazy / late binding environments.
*/
export function hasDocument(): boolean {
return Boolean(typeof document === strObject && document);
return Boolean(typeof document === strShimObject && document);
}
/**
@ -136,7 +117,7 @@ export function getDocument(): Document | null {
* Defined as a function to support lazy / late binding environments.
*/
export function hasNavigator(): boolean {
return Boolean(typeof navigator === strObject && navigator);
return Boolean(typeof navigator === strShimObject && navigator);
}
/**
@ -160,7 +141,7 @@ export function getNavigator(): Navigator | null {
* Defined as a function to support lazy / late binding environments.
*/
export function hasHistory(): boolean {
return Boolean(typeof history === strObject && history);
return Boolean(typeof history === strShimObject && history);
}
/**
@ -189,7 +170,7 @@ export function getLocation(checkForMock?: boolean): Location | null {
}
}
if (typeof location === strObject && location) {
if (typeof location === strShimObject && location) {
return location;
}
@ -200,7 +181,7 @@ export function getLocation(checkForMock?: boolean): Location | null {
* Returns the global console object
*/
export function getConsole(): Console | null {
if (typeof console !== strUndefined) {
if (typeof console !== strShimUndefined) {
return console;
}
@ -224,7 +205,7 @@ export function getPerformance(): Performance | null {
* Defined as a function to support lazy / late binding environments.
*/
export function hasJSON(): boolean {
return Boolean((typeof JSON === strObject && JSON) || getGlobalInst(strJSON) !== null);
return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);
}
/**

Просмотреть файл

@ -1,6 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { strShimUndefined, strShimObject, strShimPrototype, strShimFunction, objCreateFn } from "@microsoft/applicationinsights-shims";
import {
strShimUndefined, strShimObject, strShimFunction, throwTypeError,
ObjClass, ObjProto, ObjAssign, ObjHasOwnProperty, ObjDefineProperty
} from "@microsoft/applicationinsights-shims";
// RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly
@ -10,13 +13,8 @@ const strAttachEvent = "attachEvent";
const strAddEventHelper = "addEventListener";
const strDetachEvent = "detachEvent";
const strRemoveEventListener = "removeEventListener";
const strHasOwnProperty = "hasOwnProperty";
const ObjClass = Object;
const ObjProto = ObjClass[strShimPrototype];
const _objHasOwnProperty = ObjProto[strHasOwnProperty];
const _objDefineProperty = ObjClass["defineProperty"];
const _objAssign = ObjClass["assign"];
const _objDefineProperty = ObjDefineProperty;
const _objFreeze = ObjClass["freeze"];
const _objSeal = ObjClass["seal"];
@ -45,7 +43,7 @@ export function isNotNullOrUndefined(value: any): boolean {
}
export function hasOwnProperty(obj: any, prop: string): boolean {
return obj && _objHasOwnProperty.call(obj, prop);
return obj && ObjHasOwnProperty.call(obj, prop);
};
export function isObject(value: any): boolean {
@ -134,7 +132,7 @@ export function normalizeJsName(name: string): string {
export function objForEachKey(target: any, callbackfn: (name: string, value: any) => void) {
if (target) {
for (let prop in target) {
if (_objHasOwnProperty.call(target, prop)) {
if (ObjHasOwnProperty.call(target, prop)) {
callbackfn.call(target, prop, target[prop]);
}
}
@ -411,13 +409,13 @@ export function objKeys(obj: {}): string[] {
var objType = typeof obj;
if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {
throw new TypeError('objKeys called on non-object');
throwTypeError('objKeys called on non-object');
}
let result: string[] = [];
for (let prop in obj) {
if (obj && _objHasOwnProperty.call(obj, prop)) {
if (obj && ObjHasOwnProperty.call(obj, prop)) {
result.push(prop);
}
}
@ -426,7 +424,7 @@ export function objKeys(obj: {}): string[] {
let dontEnumsLength = _objKeysDontEnums.length;
for (let lp = 0; lp < dontEnumsLength; lp++) {
if (obj && _objHasOwnProperty.call(obj, _objKeysDontEnums[lp])) {
if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) {
result.push(_objKeysDontEnums[lp]);
}
}
@ -654,7 +652,7 @@ export function optimizeObject<T>(theObject: T): T {
// V8 Optimization to cause the JIT compiler to create a new optimized object for looking up the own properties
// primarily for object with <= 19 properties for >= 20 the effect is reduced or non-existent
if (theObject) {
theObject = ObjClass(_objAssign ? _objAssign({}, theObject) : theObject);
theObject = ObjClass(ObjAssign ? ObjAssign({}, theObject) : theObject);
}
return theObject;

Просмотреть файл

@ -4,9 +4,7 @@
import {
IInstrumentHooksCallbacks, IInstrumentHooks, IInstrumentHook, IInstrumentCallDetails, InstrumentorHooksCallback
} from "../JavaScriptSDK.Interfaces/IInstrumentHooks";
import {
strFunction, strPrototype
} from "./EnvUtils"
import { strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims";
import { hasOwnProperty } from "./HelperFuncs";
const aiInstrumentHooks = "_aiHooks";
@ -159,7 +157,7 @@ function _getObjProto(target:any) {
}
// target[Constructor] May break if the constructor has been changed or removed
let newProto = target[str__Proto] || target[strPrototype] || target[strConstructor];
let newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
if(newProto) {
return newProto;
}
@ -190,7 +188,7 @@ function _getOwner(target:any, name:string, checkPrototype:boolean): any {
*/
export function InstrumentProto(target:any, funcName:string, callbacks: IInstrumentHooksCallbacks): IInstrumentHook {
if (target) {
return InstrumentFunc(target[strPrototype], funcName, callbacks, false);
return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false);
}
return null;
@ -204,7 +202,7 @@ export function InstrumentProto(target:any, funcName:string, callbacks: IInstrum
*/
export function InstrumentProtos(target:any, funcNames:string[], callbacks: IInstrumentHooksCallbacks): IInstrumentHook[] {
if (target) {
return InstrumentFuncs(target[strPrototype], funcNames, callbacks, false);
return InstrumentFuncs(target[strShimPrototype], funcNames, callbacks, false);
}
return null;
@ -222,7 +220,7 @@ export function InstrumentFunc(target:any, funcName:string, callbacks: IInstrume
let owner = _getOwner(target, funcName, checkPrototype);
if (owner) {
let fn = owner[funcName]
if (typeof fn === strFunction) {
if (typeof fn === strShimFunction) {
let aiHook:IInstrumentHooks = fn[aiInstrumentHooks];
if (!aiHook) {
// Only hook the function once

Просмотреть файл

@ -1,6 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
export { IConfiguration } from "./JavaScriptSDK.Interfaces/IConfiguration";
export { IChannelControls, MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";
export { ITelemetryPlugin, IPlugin } from "./JavaScriptSDK.Interfaces/ITelemetryPlugin";
@ -29,13 +28,18 @@ export {
objFreeze, objSeal
} from './JavaScriptSDK/HelperFuncs';
export {
getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto,
getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto,
hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON,
isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction,
isReactNative, getConsole, dumpObj, isIE, getIEVersion,
setEnableEnvMocks
} from "./JavaScriptSDK/EnvUtils";
export {
objCreateFn as objCreate
getGlobal,
objCreateFn as objCreate,
strShimPrototype as strPrototype,
strShimFunction as strFunction,
strShimUndefined as strUndefined,
strShimObject as strObject
} from '@microsoft/applicationinsights-shims';
export { NotificationManager } from "./JavaScriptSDK/NotificationManager";
export { INotificationManager } from "./JavaScriptSDK.Interfaces/INotificationManager";

Просмотреть файл

@ -7,8 +7,9 @@
"moduleResolution": "node",
"target": "es3",
"forceConsistentCasingInFileNames": true,
"importHelpers": false,
"importHelpers": true,
"noEmitHelpers": true,
"skipLibCheck": true,
"alwaysStrict": true,
"declaration": true,
"declarationDir": "shared/AppInsightsCore/types",

Просмотреть файл

@ -45,7 +45,8 @@
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
"typescript": "2.5.3",
"magic-string": "^0.25.5"
"tslib": "^1.13.0",
"magic-string": "^0.25.7"
},
"dependencies": {
}

Просмотреть файл

@ -36,7 +36,8 @@
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0",
"tslint-microsoft-contrib": "^5.2.1",
"typescript": "2.5.3"
"typescript": "2.5.3",
"tslib": "^1.13.0"
},
"dependencies": {
"uglify-js": "^3.11.0"

Просмотреть файл

@ -7,14 +7,14 @@
"moduleResolution": "node",
"target": "es5",
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"importHelpers": false,
"noEmitHelpers": false,
"alwaysStrict": true,
"declaration": true,
"outDir": "./out",
"rootDir": "tools/rollup-plugin-uglify3-js",
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
"allowSyntheticDefaultImports": true
},
"files": [
]

Просмотреть файл

@ -9,9 +9,21 @@ This project exists to break the dependency on the version of tslib that is used
mostly due to several breaking changes that have reduced our ability to publish fixes.
While the Application Insights JS SDK will use the stubs defined in this packaging for the browser instances (those that are
uploaded to the CDN) they are built using the polyfill pattern, so if a global implementation of __extend() and __assign() already exist
uploaded to the CDN) they are built using the polyfill pattern, so if a global implementation of __extends() and __assign() already exist
those versions will be used.
## Global _extends() and __assign() changes - v2.0.0 or greater
From v2.0.0 or greater the globally defined ```__extends()``` and ```__assign()``` methods are no longer exposed as global by default.
If you need to expose the TsLib helpers globally (which occurred by default for v1.x.x) you now will need to import and call the ```__exposeGlobalTsLib()``` function.
```javascript
import { __exposeGlobalTsLib } from "@microsoft/applicationinsights-shims";
__exposeGlobalTsLib();
```
## Build:
```
npm install -g grunt-cli

Просмотреть файл

@ -1,11 +1,19 @@
/// <reference path="../TestFramework/TestClass.ts" />
import {
objCreateFn, getGlobal, __extendsFn, __assignFn,
objCreateFn, getGlobal,
strShimFunction, strShimHasOwnProperty, strShimObject, strShimPrototype, strShimUndefined
} from "../../src/applicationinsights-shims";
//import * as sinon from 'sinon';
import {
__extendsFn, __assignFn, __objAssignFnImpl
} from "../../src/TsLibShims";
import {
__exposeGlobalTsLib
} from "../../src/TsLibGlobals";
__exposeGlobalTsLib();
export class ShimsTests extends TestClass {
@ -13,29 +21,91 @@ export class ShimsTests extends TestClass {
public testInitialize() {
this._global = getGlobal();
try {
delete this._global.__assign;
delete this._global.__extends;
} catch (e) {
// Can't do anything if the cleanup fails
}
}
public registerTests() {
this.testCase({
name: "__extends should exist",
name: "__extends should exist as a global",
test: () => {
__exposeGlobalTsLib();
QUnit.assert.ok(this._global.__extends !== undefined, "__extends should exist");
QUnit.assert.ok(this._global.__extends === __extendsFn, "Check that it came from ");
QUnit.assert.ok(this._global.__extends === __extendsFn, "Check that it came from the shims module");
}
});
this.testCase({
name: "__assign should exist and be assigned to Object.assign or embedded __assignFn",
name: "__assign should exist as a global and be assigned to Object.assign or embedded __assignFn",
test: () => {
QUnit.assert.ok(this._global.__assign !== undefined, "__extends should exist");
__exposeGlobalTsLib();
QUnit.assert.ok(this._global.__assign !== undefined, "__assign should exist");
if ((Object as any).assign) {
QUnit.assert.ok(this._global.__assign === (Object as any).assign, "Check that it came from ");
QUnit.assert.ok(this._global.__assign === (Object as any).assign, "Check that it came from the shims module");
} else {
QUnit.assert.ok(this._global.__assign === __assignFn, "Check that it came from ");
QUnit.assert.ok(this._global.__assign === __objAssignFnImpl, "Check that it came from the shims module");
}
}
});
this.testCase({
name: "__assignFn should be assigned to Object.assign or embedded __assignFn",
test: () => {
QUnit.assert.ok(__assignFn !== undefined, "__assignFn should exist");
if ((Object as any).assign) {
QUnit.assert.ok(__assignFn === (Object as any).assign, "Check that it came from the shims module");
} else {
QUnit.assert.ok(this._global.__assign === __objAssignFnImpl, "Check that it came from the shims module");
}
}
});
this.testCase({
name: "__objAssignImplFn should be assigned values to target",
test: () => {
let t = __objAssignFnImpl({}, {a:1}, {b:2});
QUnit.equal(t.a, 1, "Checking expected value");
QUnit.equal(t.b, 2, "Checking expected value");
// check overwrite
t = __objAssignFnImpl({a:0}, {a:1}, {b:2});
QUnit.equal(t.a, 1, "Checking expected value");
QUnit.equal(t.b, 2, "Checking expected value");
// check target
t = __objAssignFnImpl({x:0}, {a:1}, {b:2});
QUnit.equal(t.x, 0, "Checking expected value");
QUnit.equal(t.a, 1, "Checking expected value");
QUnit.equal(t.b, 2, "Checking expected value");
}
});
this.testCase({
name: "__assignFn should be assigned values to target",
test: () => {
let t = __assignFn({}, {a:1}, {b:2});
QUnit.equal(t.a, 1, "Checking expected value");
QUnit.equal(t.b, 2, "Checking expected value");
// check overwrite
t = __assignFn({a:0}, {a:1}, {b:2});
QUnit.equal(t.a, 1, "Checking expected value");
QUnit.equal(t.b, 2, "Checking expected value");
// check target
t = __assignFn({x:0}, {a:1}, {b:2});
QUnit.equal(t.x, 0, "Checking expected value");
QUnit.equal(t.a, 1, "Checking expected value");
QUnit.equal(t.b, 2, "Checking expected value");
}
});
this.testCase({
name: "objCreateFn should exist",
test: () => {

Просмотреть файл

@ -1,7 +1,7 @@
{
"name": "@microsoft/applicationinsights-shims",
"author": "Microsoft Application Insights Team",
"version": "1.0.3",
"version": "2.0.0",
"description": "Microsoft Application Insights JavaScript SDK - Shim functions",
"homepage": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims",
"keywords": [
@ -29,8 +29,8 @@
},
"license": "MIT",
"sideEffects": [
"**/*.js",
"**/*.ts"
"**/TsLibGlobals.js",
"**/TsLibGlobals.ts"
],
"devDependencies": {
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",

Просмотреть файл

@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export const strShimFunction = "function";
export const strShimObject = "object";
export const strShimUndefined = "undefined";
export const strShimPrototype = "prototype";
export const strShimHasOwnProperty = "hasOwnProperty";
export const strDefault = "default";
export const ObjClass = Object;
export const ObjProto = ObjClass[strShimPrototype];
export const ObjAssign = ObjClass["assign"];
export const ObjCreate = ObjClass["create"];
export const ObjDefineProperty = ObjClass["defineProperty"];
export const ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];

Просмотреть файл

@ -0,0 +1,71 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { ObjCreate, strShimFunction, strShimObject, strShimPrototype, strShimUndefined } from "./Constants";
declare var globalThis: Window;
declare var global: Window;
/**
* Returns the current global scope object, for a normal web page this will be the current
* window, for a Web Worker this will be current worker global scope via "self". The internal
* implementation returns the first available instance object in the following order
* - globalThis (New standard)
* - self (Will return the current window instance for supported browsers)
* - window (fallback for older browser implementations)
* - global (NodeJS standard)
* - <null> (When all else fails)
* While the return type is a Window for the normal case, not all environments will support all
* of the properties or functions.
*/
export function getGlobal(): Window {
if (typeof globalThis !== strShimUndefined && globalThis) {
return globalThis;
}
if (typeof self !== strShimUndefined && self) {
return self;
}
if (typeof window !== strShimUndefined && window) {
return window;
}
if (typeof global !== strShimUndefined && global) {
return global;
}
return null;
}
export function throwTypeError(message: string): never {
throw new TypeError(message);
}
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations
* @param obj Object to use as a prototype. May be null
*/
export function objCreateFn(obj: any): any {
var func = ObjCreate;
// Use build in Object.create
if (func) {
// Use Object create method if it exists
return func(obj);
}
if (obj == null) {
return {};
}
var type = typeof obj;
if (type !== strShimObject && type !== strShimFunction) {
throwTypeError('Object prototype may only be an Object:' + obj);
}
function tmpFunc() {}
tmpFunc[strShimPrototype] = obj;
return new (tmpFunc as any)();
}

Просмотреть файл

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { ObjAssign, strShimUndefined } from "./Constants";
import { getGlobal } from "./Helpers";
import { __assignFn, __createBindingFn, __extendsFn } from "./TsLibShims";
// To address compile time errors declaring these here
declare var __extends:(d: any, b: any) => any;
declare var __assign:(t: any) => any;
declare var __createBinding:(o: any, m: any, k: any, k2?: any) => void;
export function __exposeGlobalTsLib() {
let globalObj:any = getGlobal() || {};
// tslint:disable: only-arrow-functions
(function (root: any, assignFn, extendsFn, createBindingFn) {
// Assign the globally scoped versions of the functions -- used when consuming individual ts files
// If check is to support NativeScript where these are marked as readonly
if (!root.__assign) {
root.__assign = ObjAssign || assignFn;
}
if (!root.__extends) {
root.__extends = extendsFn;
}
if (!root.__createBinding) {
root.__createBinding = createBindingFn;
}
})(globalObj, __assignFn, __extendsFn, __createBindingFn);
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly
if (!__assign) { __assign = globalObj.__assign; }
if (!__extends) { __extends = globalObj.__extends; }
if (!__createBinding) { __createBinding = globalObj.__createBinding; }
}

Просмотреть файл

@ -0,0 +1,253 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {
ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto,
strDefault, strShimFunction, strShimHasOwnProperty, strShimPrototype
} from "./Constants";
import { getGlobal, objCreateFn, throwTypeError } from "./Helpers";
// Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and
// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights
// can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime
// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require
// them.
export const SymbolObj = (getGlobal()||{})["Symbol"];
export const ReflectObj = (getGlobal()||{})["Reflect"];
export const __hasSymbol = !!SymbolObj;
export const __hasReflect = !!ReflectObj;
const strDecorate = "decorate";
const strMetadata = "metadata";
const strGetOwnPropertySymbols = "getOwnPropertySymbols";
const strIterator = "iterator";
export declare type ObjAssignFunc = (t: any, ...sources:any[]) => any;
export var __objAssignFnImpl: ObjAssignFunc = function(t: any): any {
// tslint:disable-next-line: ban-comma-operator
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (ObjProto[strShimHasOwnProperty].call(s, p)) {
(t as any)[p] = s[p];
}
}
}
return t;
}
export var __assignFn: ObjAssignFunc = ObjAssign || __objAssignFnImpl;
// tslint:disable-next-line: only-arrow-functions
var extendStaticsFn = function(d: any, b: any): any {
extendStaticsFn = ObjClass["setPrototypeOf"] ||
// tslint:disable-next-line: only-arrow-functions
({ __proto__: [] } instanceof Array && function (d: any, b: any) { d.__proto__ = b; }) ||
// tslint:disable-next-line: only-arrow-functions
function (d: any, b: any) {
for (var p in b) {
if (b[strShimHasOwnProperty](p)) {
d[p] = b[p];
}
}
};
return extendStaticsFn(d, b);
};
export function __extendsFn(d: any, b: any) {
if (typeof b !== strShimFunction && b !== null) {
throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
}
extendStaticsFn(d, b);
function __() { this.constructor = d; }
// tslint:disable-next-line: ban-comma-operator
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new (__ as any)());
}
export function __restFn(s: any, e: any) {
var t = {};
for (var k in s) {
if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) {
t[k] = s[k];
}
}
if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) {
for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) {
t[p[i]] = s[p[i]];
}
}
}
return t;
}
export function __decorateFn(decorators: any, target: any, key: any, desc: any) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d;
if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) {
r = ReflectObj[strDecorate](decorators, target, key, desc);
} else {
for (var i = decorators.length - 1; i >= 0; i--) {
// tslint:disable-next-line:no-conditional-assignment
if (d = decorators[i]) {
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
}
}
}
// tslint:disable-next-line:ban-comma-operator
return c > 3 && r && ObjDefineProperty(target, key, r), r;
}
export function __paramFn(paramIndex: number, decorator: Function) {
return function (target: any, key: any) {
decorator(target, key, paramIndex);
}
}
export function __metadataFn(metadataKey: any, metadataValue: any) {
if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) {
return ReflectObj[strMetadata](metadataKey, metadataValue);
}
}
export function __exportStarFn(m: any, o: any) {
for (var p in m) {
if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) {
__createBindingFn(o, m, p);
}
}
}
export function __createBindingFn(o: any, m: any, k: any, k2?: any) {
if (k2 === undefined) {
k2 = k;
}
if (ObjCreate) {
ObjDefineProperty(o, k2, {
enumerable: true,
get() {
return m[k];
}
});
} else {
o[k2] = m[k];
}
}
export function __valuesFn(o: any) {
var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0;
if (m) {
return m.call(o);
}
if (o && typeof o.length === "number") {
return {
next () {
if (o && i >= o.length) {
o = void 0;
}
return { value: o && o[i++], done: !o };
}
};
}
throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
export function __readFn(o: any, n: any) {
var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]];
if (!m) {
return o;
}
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
ar.push(r.value);
}
} catch (error) {
e = {
error
};
} finally {
try {
// tslint:disable-next-line:no-conditional-assignment
if (r && !r.done && (m = i["return"])) {
m.call(i);
}
} finally {
if (e) {
// tslint:disable-next-line:no-unsafe-finally
throw e.error;
}
}
}
return ar;
}
/** @deprecated */
export function __spreadArraysFn() {
var theArgs = arguments;
// Calculate new total size
for (var s = 0, i = 0, il = theArgs.length; i < il; i++) {
s += theArgs[i].length;
}
// Create new full array
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) {
r[k] = a[j];
}
}
return r;
}
export function __spreadArrayFn(to: any, from: any) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
to[j] = from[i];
}
return to;
}
export function __makeTemplateObjectFn(cooked: any, raw: any) {
if (ObjDefineProperty) {
ObjDefineProperty(cooked, "raw", { value: raw });
} else {
cooked.raw = raw;
}
return cooked;
};
export function __importStarFn(mod: any) {
if (mod && mod.__esModule) {
return mod;
}
var result = {};
if (mod != null) {
for (var k in mod) {
if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) {
__createBindingFn(result, mod, k);
}
}
}
// Set default module
if (ObjCreate) {
ObjDefineProperty( result, strDefault, { enumerable: true, value: mod });
} else {
result[strDefault] = mod;
}
return result;
};
export function __importDefaultFn(mod:any) {
return (mod && mod.__esModule) ? mod : { strDefault: mod };
}

Просмотреть файл

@ -1,126 +1,45 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export const strShimFunction = "function";
export const strShimObject = "object";
export const strShimUndefined = "undefined";
export const strShimPrototype = "prototype";
export const strShimHasOwnProperty = "hasOwnProperty";
export {
strShimFunction,
strShimObject,
strShimUndefined,
strShimPrototype,
strShimHasOwnProperty,
strDefault,
ObjClass,
ObjProto,
ObjAssign,
ObjCreate,
ObjDefineProperty,
ObjHasOwnProperty
} from "./Constants"
// To address compile time errors declaring these here
declare var globalThis: Window;
declare var global: Window;
declare var __extends:(d: any, b: any) => any;
declare var __assign:(t: any) => any;
export {
throwTypeError,
objCreateFn,
getGlobal
} from "./Helpers"
/**
* Returns the current global scope object, for a normal web page this will be the current
* window, for a Web Worker this will be current worker global scope via "self". The internal
* implementation returns the first available instance object in the following order
* - globalThis (New standard)
* - self (Will return the current window instance for supported browsers)
* - window (fallback for older browser implementations)
* - global (NodeJS standard)
* - <null> (When all else fails)
* While the return type is a Window for the normal case, not all environments will support all
* of the properties or functions.
*/
export function getGlobal(): Window {
if (typeof globalThis !== strShimUndefined && globalThis) {
return globalThis;
}
export {
__assignFn,
__extendsFn,
__restFn,
__spreadArrayFn,
__spreadArraysFn,
__decorateFn,
__paramFn,
__metadataFn,
__createBindingFn,
__valuesFn,
__readFn,
__makeTemplateObjectFn,
__importDefaultFn,
__importStarFn,
__exportStarFn,
} from "./TsLibShims"
if (typeof self !== strShimUndefined && self) {
return self;
}
if (typeof window !== strShimUndefined && window) {
return window;
}
if (typeof global !== strShimUndefined && global) {
return global;
}
return null;
}
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations
* @param obj Object to use as a prototype. May be null
*/
export function objCreateFn(obj: any): any {
var func = Object["create"];
// Use build in Object.create
if (func) {
// Use Object create method if it exists
return func(obj);
}
if (obj == null) {
return {};
}
var type = typeof obj;
if (type !== strShimObject && type !== strShimFunction) {
throw new TypeError('Object prototype may only be an Object:' + obj);
}
function tmpFunc() {}
tmpFunc[strShimPrototype] = obj;
return new (tmpFunc as any)();
}
export function __assignFn(t: any) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) {
t[p] = s[p];
}
}
}
return t;
}
// tslint:disable-next-line: only-arrow-functions
var __extendStaticsFn = function(d: any, b: any): any {
__extendStaticsFn = Object["setPrototypeOf"] ||
// tslint:disable-next-line: only-arrow-functions
({ __proto__: [] } instanceof Array && function (d: any, b: any) { d.__proto__ = b; }) ||
// tslint:disable-next-line: only-arrow-functions
function (d: any, b: any) {
for (var p in b) {
if (b[strShimHasOwnProperty](p)) {
d[p] = b[p];
}
}
};
return __extendStaticsFn(d, b);
};
export function __extendsFn(d: any, b: any) {
__extendStaticsFn(d, b);
function __() { this.constructor = d; }
// tslint:disable-next-line: ban-comma-operator
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new (__ as any)());
}
let globalObj:any = getGlobal() || {};
// tslint:disable: only-arrow-functions
(function (root: any, assignFn, extendsFn) {
// Assign the globally scoped versions of the functions -- used when consuming individual ts files
// If check is to support NativeScript where these are marked as readonly
if (!root.__assign) {
root.__assign = (Object as any).assign || assignFn;
}
if (!root.__extends) {
root.__extends = extendsFn;
}
})(globalObj, __assignFn, __extendsFn);
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly
if (!__assign) { __assign = globalObj.__assign; }
if (!__extends) { __extends = globalObj.__extends; }
export {
__exposeGlobalTsLib
} from "./TsLibGlobals"

Просмотреть файл

@ -4,6 +4,25 @@ import MagicString from 'magic-string';
const fs = require("fs");
const globby = require("globby");
// Remap tslib functions to shim v2.0.0 functions
const remapTsLibFuncs = {
"__extends": "__extendsFn",
"__assign": "__assignFn",
"__rest": "__restFn",
"__spreadArray": "__spreadArrayFn",
"__spreadArrays": "__spreadArraysFn",
"__decorate": "__decorateFn",
"__param": "__paramFn",
"__metadata": "__metadataFn",
"__values": "__valuesFn",
"__read":"__readFn",
"__createBinding": "__createBindingFn",
"__importDefault": "__importDefaultFn",
"__importStar": "__importStarFn",
"__exportStar": "__exportStarFn",
"__makeTemplateObject": "__makeTemplateObjectFn"
};
// You can use the following site to validate the resulting map file is valid
// http://sokra.github.io/source-map-visualization/#custom
@ -40,8 +59,147 @@ const getLines = (theValue) => {
return lines;
};
const updateDistEsmFiles = (replaceValues, banner) => {
function replaceTsLibImports(orgSrc, src, theString) {
// replace tslib import usage with "import { xxx, xxx } from "tslib";
const detectTsLibUsage = /import[\s]*\{([^}]*)\}[\s]*from[\s]*\"tslib\";/g;
let matches = detectTsLibUsage.exec(orgSrc);
while (matches != null) {
let newImports = [];
let imports = matches[1];
let tokens = imports.trim().split(",");
tokens.forEach(token => {
let theToken = token.trim();
let remapKey = remapTsLibFuncs[theToken];
if (!remapKey) {
throw "Unsupported tslib function \"" + theToken + "\" detected from -- " + matches[0] + "";
}
newImports.push(remapKey + " as " + theToken);
});
let newImport = "import { " + newImports.join(", ") + " } from \"@microsoft/applicationinsights-shims\";";
var idx = orgSrc.indexOf(matches[0]);
if (idx !== -1) {
console.log(`Replacing [${matches[0]}] with [${newImport}]`);
theString.overwrite(idx, idx + matches[0].length, newImport);
src = src.replace(matches[0], newImport);
}
// Find next
matches = detectTsLibUsage.exec(orgSrc);
}
return src;
}
function replaceTsLibStarImports(orgSrc, src, theString) {
// replace tslib import usage with "import { xxx, xxx } from "tslib";
const detectTsLibUsage = /import[\s]*\*[\s]*as[\s]*([^\s]*)[\s]*from[\s]*\"tslib\";/g;
let matches = detectTsLibUsage.exec(orgSrc);
while (matches != null) {
let newImports = [];
let importPrefix = matches[1].trim();
let importLen = importPrefix.length + 1;
let idx = orgSrc.indexOf(importPrefix + ".");
while (idx !== -1) {
let funcEnd = orgSrc.indexOf("(", idx + importLen);
if (funcEnd !== -1) {
let funcName = orgSrc.substring(idx + importLen, funcEnd);
let newImport = remapTsLibFuncs[funcName];
if (!newImport) {
throw "Unsupported tslib function \"" + orgSrc.substring(idx, funcEnd) + "\" detected from -- " + matches[0];
}
// Add new import, if not already present
if (newImports.indexOf(newImport) == -1) {
newImports.push(newImport);
}
let matchedValue = orgSrc.substring(idx, funcEnd + 1);
let newValue = newImport + "(";
console.log(`Replacing Usage [${matchedValue}] with [${newValue}]`);
theString.overwrite(idx, idx + matchedValue.length, newValue);
// replace in the new source output as well
src = src.replace(matchedValue, newValue);
}
// Find next usage
idx = orgSrc.indexOf(importPrefix + ".", idx + importLen);
}
let newImport = "import { " + newImports.join(", ") + " } from \"@microsoft/applicationinsights-shims\";";
idx = orgSrc.indexOf(matches[0]);
console.log(`Replacing [${matches[0]}] with [${newImport}]`);
theString.overwrite(idx, idx + matches[0].length, newImport);
src = src.replace(matches[0], newImport);
// Find next
matches = detectTsLibUsage.exec(orgSrc);
}
return src;
}
function removeDynamicProtoStubs(orgSrc, src, theString, inputFile) {
const dynRemove = dynamicRemove();
var result = dynRemove.transform(orgSrc, inputFile);
if (result !== null && result.code) {
src = result.code;
console.log("Prototypes removed...");
// Figure out removed lines
var orgLines = getLines(orgSrc);
var newLines = getLines(result.code);
var line = 0;
var newLine = 0;
while (line < orgLines.length) {
var matchLine = orgLines[line];
var matchNewLine = newLines[newLine];
var replaceText = "";
line++;
if (matchLine.value === matchNewLine.value) {
newLine++;
} else {
console.log("Line Changed: " + matchLine.value);
var endFound = false;
var endLine = 0;
// Skip over removed lines (There may be more than 1 function being removed)
for (var nextLp = 0; endFound === false && newLine + nextLp < newLines.length; nextLp++) {
if (newLine + nextLp < newLines.length) {
for (var lp = 0; line + lp < orgLines.length; lp++) {
if (orgLines[line + lp].value === newLines[newLine + nextLp].value) {
endFound = true;
for (var i = 0; i < nextLp; i++) {
if (replaceText.length) {
replaceText += "\n";
}
replaceText += newLines[newLine + i].value;
}
endLine = line + lp;
newLine = newLine + nextLp;
break;
}
}
}
}
if (endFound) {
console.log("Detected Removed lines " + line + " to " + endLine);
theString.overwrite(matchLine.idx, orgLines[endLine - 1].idx + orgLines[endLine - 1].len, replaceText);
line = endLine;
} else {
throw "Missing line - " + matchLine.value;
}
}
}
}
return src;
}
const updateDistEsmFiles = (replaceValues, banner, replaceTsLib = true, removeDynamic = true) => {
const files = globby.sync("./dist-esm/**/*.js");
files.map(inputFile => {
console.log("Loading - " + inputFile);
@ -53,59 +211,17 @@ const getLines = (theValue) => {
var orgSrc = src;
var theString = new MagicString(orgSrc);
var result = dynRemove.transform(orgSrc, inputFile);
if (result !== null && result.code) {
src = result.code;
console.log("Prototypes removed...");
// Figure out removed lines
var orgLines = getLines(orgSrc);
var newLines = getLines(result.code);
var line = 0;
var newLine = 0;
while (line < orgLines.length) {
var matchLine = orgLines[line];
var matchNewLine = newLines[newLine];
var replaceText = "";
line++;
if (matchLine.value === matchNewLine.value) {
newLine++;
} else {
console.log("Line Changed: " + matchLine.value);
var endFound = false;
var endLine = 0;
// Skip over removed lines (There may be more than 1 function being removed)
for (var nextLp = 0; endFound === false && newLine + nextLp < newLines.length; nextLp++) {
if (newLine + nextLp < newLines.length) {
for (var lp = 0; line + lp < orgLines.length; lp++) {
if (orgLines[line + lp].value === newLines[newLine + nextLp].value) {
endFound = true;
for (var i = 0; i < nextLp; i++) {
if (replaceText.length) {
replaceText += "\n";
}
replaceText += newLines[newLine + i].value;
}
endLine = line + lp;
newLine = newLine + nextLp;
break;
}
}
}
}
if (endFound) {
console.log("Detected Removed lines " + line + " to " + endLine);
theString.overwrite(matchLine.idx, orgLines[endLine - 1].idx + orgLines[endLine - 1].len, replaceText);
line = endLine;
} else {
throw "Missing line - " + matchLine.value;
}
}
}
if (removeDynamic) {
src = removeDynamicProtoStubs(orgSrc, src, theString, inputFile);
}
if (replaceTsLib) {
// replace any tslib imports with the shims module versions
src = replaceTsLibImports(orgSrc, src, theString);
src = replaceTsLibStarImports(orgSrc, src, theString);
}
// Replace the header
Object.keys(replaceValues).forEach((value) => {
src = src.replace(value, replaceValues[value]);
@ -114,11 +230,14 @@ const getLines = (theValue) => {
theString.overwrite(idx, idx + value.length, replaceValues[value]);
}
});
// Rewrite the file
theString.prepend(banner + "\n");
src = banner + "\n" + src;
// Remove any force banner from the file
let replaceBanner = banner.replace("/*!", "/*");
theString.prepend(replaceBanner + "\n");
src = replaceBanner + "\n" + src;
src = src.trim();
fs.writeFileSync(inputFile, src);
if (mapFile) {