@microsoft/applicationinsights-angularplugin-js
Advanced tools
Comparing version 2.5.10 to 2.5.11
104
package.json
{ | ||
"name": "@microsoft/applicationinsights-angularplugin-js", | ||
"version": "2.5.10", | ||
"description": "Microsoft Application Insights Angular plugin", | ||
"main": "dist/applicationinsights-angularplugin-js.js", | ||
"module": "dist-esm/applicationinsights-angularplugin-js.js", | ||
"types": "types/applicationinsights-angularplugin-js.d.ts", | ||
"sideEffects": false, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-angularplugin-js" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "npm install && npm run build", | ||
"build": "npm run build:esm && npm run build:browser", | ||
"build:esm": "tsc -p tsconfig.json", | ||
"build:browser": "rollup -c", | ||
"test": "cd Tests/test-app && npm install && ng test", | ||
"lint": "tslint -p tsconfig.json" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/applicationinsights-rollup-es3": "1.1.3", | ||
"@microsoft/applicationinsights-properties-js": "2.5.10", | ||
"@angular/core": "~8.1.2", | ||
"@angular/router": "~8.1.2", | ||
"grunt": "1.0.1", | ||
"rollup": "^0.66.0", | ||
"rollup-plugin-commonjs": "^9.3.4", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-uglify": "^6.0.0", | ||
"ts-node": "^8.3.0", | ||
"typescript": "~3.4.3", | ||
"rxjs": "~6.4.0", | ||
"types": "^0.1.1", | ||
"zone.js": "~0.9.1", | ||
"@angular/common": "~8.1.2", | ||
"@angular/platform-browser": "~8.1.2", | ||
"tslint": "^5.19.0", | ||
"tslint-config-prettier": "^1.18.0" | ||
}, | ||
"dependencies": { | ||
"@microsoft/applicationinsights-shims": "^1.0.3", | ||
"@microsoft/applicationinsights-common": "2.5.10", | ||
"@microsoft/applicationinsights-core-js": "2.5.10" | ||
}, | ||
"license": "MIT" | ||
"name": "@microsoft/applicationinsights-angularplugin-js", | ||
"version": "2.5.11", | ||
"description": "Microsoft Application Insights Angular plugin", | ||
"main": "dist/bundles/microsoft-applicationinsights-angularplugin-js.umd.js", | ||
"module": "dist/fesm2015/microsoft-applicationinsights-angularplugin-js.js", | ||
"types": "dist/microsoft-applicationinsights-angularplugin-js.d.ts", | ||
"metadata": "dist/microsoft-applicationinsights-angularplugin-js.metadata.json", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-angularplugin-js" | ||
}, | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build --prod", | ||
"test": "ng test", | ||
"lint": "ng lint" | ||
}, | ||
"dependencies": { | ||
"@angular/animations": "~11.0.6", | ||
"@angular/common": "~11.0.6", | ||
"@angular/compiler": "~11.0.6", | ||
"@angular/core": "~11.0.6", | ||
"@angular/forms": "~11.0.6", | ||
"@angular/platform-browser": "~11.0.6", | ||
"@angular/platform-browser-dynamic": "~11.0.6", | ||
"@angular/router": "~11.0.6", | ||
"@microsoft/applicationinsights-common": "2.5.11", | ||
"@microsoft/applicationinsights-core-js": "2.5.11", | ||
"findup-sync": "^4.0.0", | ||
"grunt-cli": "^1.3.2", | ||
"nopt": "^5.0.0", | ||
"pify": "^2.3.0", | ||
"rxjs": "~6.6.0", | ||
"tslib": "^2.0.0", | ||
"zone.js": "~0.10.2" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "~0.1100.6", | ||
"@angular/cli": "~11.0.6", | ||
"@angular/compiler-cli": "~11.0.6", | ||
"@types/jasmine": "~3.6.0", | ||
"@types/node": "^12.11.1", | ||
"codelyzer": "^6.0.0", | ||
"jasmine-core": "~3.6.0", | ||
"jasmine-spec-reporter": "~5.0.0", | ||
"karma": "~5.1.0", | ||
"karma-chrome-launcher": "~3.1.0", | ||
"karma-coverage": "~2.0.3", | ||
"karma-jasmine": "~4.0.0", | ||
"karma-jasmine-html-reporter": "^1.5.0", | ||
"ng-packagr": "^11.0.0", | ||
"protractor": "~7.0.0", | ||
"ts-node": "~8.3.0", | ||
"tslint": "~6.1.0", | ||
"typescript": "~4.0.2", | ||
"@microsoft/applicationinsights-properties-js": "2.5.11" | ||
} | ||
} |
@@ -11,3 +11,2 @@ # Microsoft Application Insights JavaScript SDK - Angular Plugin | ||
- Tracking of router changes | ||
- Angular components usage statistics | ||
@@ -27,6 +26,7 @@ Angular Plugin for the Application Insights Javascript SDK | ||
Set up an instance of Application Insights in the entry component in your app: | ||
```js | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Component } from '@angular/core'; | ||
import { ApplicationInsights } from '@microsoft/applicationinsights-web'; | ||
import { AngularPlugin, AngularPluginService } from '@microsoft/applicationinsights-angularplugin-js'; | ||
import { AngularPlugin } from '@microsoft/applicationinsights-angularplugin-js'; | ||
import { Router } from '@angular/router'; | ||
@@ -39,11 +39,8 @@ | ||
}) | ||
export class AppComponent implements OnInit { | ||
private appInsights; | ||
export class AppComponent { | ||
constructor( | ||
private router: Router, | ||
private angularPluginService: AngularPluginService | ||
private router: Router | ||
){ | ||
var angularPlugin = new AngularPlugin(); | ||
this.angularPluginService.init(angularPlugin, this.router); | ||
this.appInsights = new ApplicationInsights({ config: { | ||
const appInsights = new ApplicationInsights({ config: { | ||
instrumentationKey: 'YOUR_INSTRUMENTATION_KEY_GOES_HERE', | ||
@@ -55,43 +52,7 @@ extensions: [angularPlugin], | ||
} }); | ||
appInsights.loadAppInsights(); | ||
} | ||
ngOnInit() { | ||
this.appInsights.loadAppInsights(); | ||
} | ||
} | ||
``` | ||
If you need to use trackMetric method to track Angular component usage, add `AngularPluginService` as a provider in providers list in `app.module.ts` file: | ||
```js | ||
import { AngularPluginService } from '@microsoft/applicationinsights-angularplugin-js'; | ||
@NgModule({ | ||
... | ||
providers: [ AngularPluginService ], | ||
}) | ||
export class AppModule { } | ||
``` | ||
Make the `trackMetric` call in the `ngOnDestroy` method in the component you want to track the lifetime with. When this component gets destroyed, it will trigger a trackMetric event sent with the time user stayed on this page, and the component name. | ||
```js | ||
import { Component, OnDestroy, HostListener } from '@angular/core'; | ||
import { AngularPluginService } from '@microsoft/applicationinsights-angularplugin-js'; | ||
@Component({ | ||
selector: 'app-test', | ||
templateUrl: './test.component.html', | ||
styleUrls: ['./test.component.css'] | ||
}) | ||
export class TestComponent implements OnDestroy { | ||
constructor(private angularPluginService: AngularPluginService) {} | ||
@HostListener('window:beforeunload') | ||
ngOnDestroy() { | ||
this.angularPluginService.trackMetric(); | ||
} | ||
} | ||
``` | ||
## Contributing | ||
@@ -101,6 +62,6 @@ | ||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us | ||
the rights to use your contribution. For details, visit https://cla.microsoft.com. | ||
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. | ||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide | ||
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions | ||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide | ||
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions | ||
provided by the bot. You will only need to do this once across all repos using our CLA. | ||
@@ -112,11 +73,19 @@ | ||
## Trademarks | ||
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft | ||
trademarks or logos is subject to and must follow | ||
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). | ||
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. | ||
Any use of third-party trademarks or logos are subject to those third-party's policies. | ||
### Note | ||
Angular plugin is using newer version of typescript, make sure to build and test before you create a pull request. | ||
Navigate to the root folder of Angular plugin, under /extensions/applicationinsights-angularplugin-js: | ||
``` | ||
Angular plugin is using newer version of typescript, make sure to build and test before you create a pull request. | ||
Navigate to the root folder of Angular plugin, under /applicationinsights-angularplugin-js: | ||
```js | ||
npm install | ||
npm run build | ||
npm run test | ||
``` | ||
@@ -127,2 +96,1 @@ | ||
[MIT](LICENSE) | ||
{ | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"baseUrl": "src", | ||
"module": "es6", | ||
"outDir": "dist-esm", | ||
"baseUrl": "./", | ||
"outDir": "./dist/out-tsc", | ||
"sourceMap": true, | ||
"declaration": true, | ||
"declarationDir": "./types", | ||
"declaration": false, | ||
"downlevelIteration": true, | ||
"experimentalDecorators": true, | ||
"moduleResolution": "node", | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"target": "es5", | ||
"rootDir": "./src", | ||
"importHelpers": true, | ||
"target": "es2015", | ||
"module": "es2020", | ||
"lib": [ | ||
"es2017", | ||
"es2018", | ||
"dom" | ||
] | ||
}, | ||
"include": [ | ||
"./src/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
], | ||
"paths": { | ||
"applicationinsights-angularplugin-js": [ | ||
"dist/applicationinsights-angularplugin-js/applicationinsights-angularplugin-js", | ||
"dist/applicationinsights-angularplugin-js" | ||
] | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114711
17
21
665
2
90
1
+ Added@angular/animations@~11.0.6
+ Added@angular/common@~11.0.6
+ Added@angular/compiler@~11.0.6
+ Added@angular/core@~11.0.6
+ Added@angular/forms@~11.0.6
+ Added@angular/router@~11.0.6
+ Addedfindup-sync@^4.0.0
+ Addedgrunt-cli@^1.3.2
+ Addednopt@^5.0.0
+ Addedpify@^2.3.0
+ Addedrxjs@~6.6.0
+ Addedtslib@^2.0.0
+ Addedzone.js@~0.10.2
+ Added@angular/animations@11.0.9(transitive)
+ Added@angular/common@11.0.9(transitive)
+ Added@angular/compiler@11.0.9(transitive)
+ Added@angular/core@11.0.9(transitive)
+ Added@angular/forms@11.0.9(transitive)
+ Added@angular/platform-browser@11.0.9(transitive)
+ Added@angular/platform-browser-dynamic@11.0.9(transitive)
+ Added@angular/router@11.0.9(transitive)
+ Added@microsoft/applicationinsights-common@2.5.11(transitive)
+ Added@microsoft/applicationinsights-core-js@2.5.11(transitive)
+ Addedabbrev@1.1.1(transitive)
+ Addedarray-each@1.0.1(transitive)
+ Addedarray-slice@1.1.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addeddetect-file@1.0.0(transitive)
+ Addedexpand-tilde@2.0.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfindup-sync@4.0.0(transitive)
+ Addedfined@1.2.0(transitive)
+ Addedflagged-respawn@1.0.1(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedglobal-modules@1.0.0(transitive)
+ Addedglobal-prefix@1.0.2(transitive)
+ Addedgrunt-cli@1.5.0(transitive)
+ Addedgrunt-known-options@2.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhomedir-polyfill@1.0.3(transitive)
+ Addedini@1.3.8(transitive)
+ Addedinterpret@1.1.0(transitive)
+ Addedis-absolute@1.0.0(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-relative@1.0.0(transitive)
+ Addedis-unc-path@1.0.0(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedkind-of@6.0.3(transitive)
+ Addedliftup@3.0.1(transitive)
+ Addedmake-iterator@1.0.1(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addednopt@5.0.0(transitive)
+ Addedobject.defaults@1.1.0(transitive)
+ Addedobject.map@1.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedparse-filepath@1.0.2(transitive)
+ Addedparse-passwd@1.0.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-root@0.1.1(transitive)
+ Addedpath-root-regex@0.1.2(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedrechoir@0.7.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedresolve-dir@1.0.1(transitive)
+ Addedrxjs@6.6.7(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtslib@1.14.12.7.0(transitive)
+ Addedunc-path-regex@0.1.2(transitive)
+ Addedv8flags@4.0.1(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedzone.js@0.10.3(transitive)
- Removed@microsoft/applicationinsights-common@2.5.10(transitive)
- Removed@microsoft/applicationinsights-core-js@2.5.10(transitive)