From b9ee4b256b7ece8487a0a7e1828c9ef9c48dabeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wictor=20Wil=C3=A9n?= Date: Wed, 10 Nov 2021 15:48:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20an=20issue=20with=20tele?= =?UTF-8?q?metry=20when=20opted=20out=20of=20telemetry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generator-teams/src/app/templates/package.json | 4 ++-- packages/yoteams-build-core/CHANGELOG.md | 1 + packages/yoteams-build-core/package.json | 2 +- packages/yoteams-build-core/src/index.ts | 6 ++++-- packages/yoteams-deploy/package.json | 2 +- packages/yoteams-deploy/src/index.ts | 10 +++++----- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/generator-teams/src/app/templates/package.json b/packages/generator-teams/src/app/templates/package.json index a5732648..146e944c 100644 --- a/packages/generator-teams/src/app/templates/package.json +++ b/packages/generator-teams/src/app/templates/package.json @@ -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": [ diff --git a/packages/yoteams-build-core/CHANGELOG.md b/packages/yoteams-build-core/CHANGELOG.md index f4bd9ed0..33a9884a 100644 --- a/packages/yoteams-build-core/CHANGELOG.md +++ b/packages/yoteams-build-core/CHANGELOG.md @@ -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*> diff --git a/packages/yoteams-build-core/package.json b/packages/yoteams-build-core/package.json index 9ddd05ea..75c2d5db 100644 --- a/packages/yoteams-build-core/package.json +++ b/packages/yoteams-build-core/package.json @@ -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": { diff --git a/packages/yoteams-build-core/src/index.ts b/packages/yoteams-build-core/src/index.ts index 8d32b99d..155822de 100644 --- a/packages/yoteams-build-core/src/index.ts +++ b/packages/yoteams-build-core/src/index.ts @@ -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(); + } }; /** diff --git a/packages/yoteams-deploy/package.json b/packages/yoteams-deploy/package.json index 5352cbd7..9dee211f 100644 --- a/packages/yoteams-deploy/package.json +++ b/packages/yoteams-deploy/package.json @@ -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": { diff --git a/packages/yoteams-deploy/src/index.ts b/packages/yoteams-deploy/src/index.ts index b2dca71e..67fd4ca2 100644 --- a/packages/yoteams-deploy/src/index.ts +++ b/packages/yoteams-deploy/src/index.ts @@ -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); @@ -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);