Skip to content

Commit

Permalink
Merge pull request #269 from wictorwilen/preview
Browse files Browse the repository at this point in the history
🐛 Fixed an issue with telemetry when opted out of telemetry
  • Loading branch information
wictorwilen authored Nov 10, 2021
2 parents 02b8987 + b9ee4b2 commit e01dfbd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/generator-teams/src/app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"vinyl": "2.2.1",
"webpack": "5.52.1",
"yargs": "^16.0.3",
"yoteams-build-core": "^1.5.0-preview",
"yoteams-deploy": "^1.1.0-preview",
"yoteams-build-core": "^1.5.0-preview2",
"yoteams-deploy": "^1.1.0-preview2",
"webpack-node-externals": "^3.0.0"
},
"browserslist": [
Expand Down
1 change: 1 addition & 0 deletions packages/yoteams-build-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

* Added telemetry, see https://github.com/pnp/generator-teams/blob/master/docs/docs/about/telemetry.md
* Added logging of ngrok inspection url (#267 by pschaeflein)

## [*1.4.0*]- <*2021-10-28*>

Expand Down
2 changes: 1 addition & 1 deletion packages/yoteams-build-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoteams-build-core",
"version": "1.5.0-preview",
"version": "1.5.0-preview2",
"description": "Core build Gulp tasks for Yo Teams, Microsoft Teams Apps Generator (https://aka.ms/yoteams)",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions packages/yoteams-build-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ export const dependenciesP = (gulp: GulpClient.Gulp, eventName: string, ...tasks
};

export const trackEvent = (eventName: string) => {
appInsights.defaultClient.trackEvent({ name: "yoteams-build-core:" + eventName });
appInsights.defaultClient.flush();
if (appInsights && appInsights.defaultClient) {
appInsights.defaultClient.trackEvent({ name: "yoteams-build-core:" + eventName });
appInsights.defaultClient.flush();
}
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/yoteams-deploy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoteams-deploy",
"version": "1.1.0-preview",
"version": "1.1.0-preview2",
"description": "Deployment Gulp tasks for Yo Teams, Microsoft Teams Apps Generator (https://aka.ms/yoteams)",
"main": "dist/index.js",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions packages/yoteams-deploy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as appInsights from "applicationinsights";
* @param eventName name of event to track
* @param tasks the tasks
*/
export const dependencies = (gulp: GulpClient.Gulp, eventName: string, ...tasks: Undertaker.Task[]) => {
export const dependencies = (gulp: GulpClient.Gulp, eventName: string, ...tasks: Undertaker.Task[]) => {
return (done: any) => {
trackEvent(eventName);
gulp.series(...tasks)(done);
Expand All @@ -33,13 +33,13 @@ export const dependenciesP = (gulp: GulpClient.Gulp, eventName: string, ...tasks
};
};


export const trackEvent = (eventName: string) => {
appInsights.defaultClient.trackEvent({ name: "yoteams-deploy:" + eventName });
appInsights.defaultClient.flush();
if (appInsights && appInsights.defaultClient) {
appInsights.defaultClient.trackEvent({ name: "yoteams-build-core:" + eventName });
appInsights.defaultClient.flush();
}
};


export const setup = (gulp: GulpClient.Gulp, config: any): void => {
deployTask(gulp, config);

Expand Down

0 comments on commit e01dfbd

Please sign in to comment.