From 61e9fc0308719588a56ce174d0ed8e14a52e29e9 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Sun, 30 Jan 2022 17:33:25 +0100 Subject: [PATCH 01/62] start preping 6.1.0 --- CHANGELOG.md | 7 ++++ package-lock.json | 16 +++++++++ package.json | 3 +- src/commands/Article.ts | 3 ++ src/commands/Folders.ts | 7 ++++ src/commands/Preview.ts | 3 ++ src/commands/Project.ts | 3 ++ src/commands/Template.ts | 3 ++ src/explorerView/ExplorerView.ts | 2 ++ src/extension.ts | 14 ++++++-- src/helpers/ContentType.ts | 3 ++ src/helpers/Extension.ts | 7 ++++ src/helpers/SettingsHelper.ts | 3 ++ src/helpers/Telemetry.ts | 59 ++++++++++++++++++++++++++++++++ src/listeners/MediaListener.ts | 6 ++++ 15 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 src/helpers/Telemetry.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 18d2e0cc..763b037c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [6.1.0] - 2022-02-xx + +### 🎨 Enhancements + +### 🐞 Fixes + + ## [6.0.0] - 2022-01-25 - [Release Notes](https://beta.frontmatter.codes/updates/v6.0.0) ### ✨ New features diff --git a/package-lock.json b/package-lock.json index e50bb758..cf028408 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "@types/react-dom": "17.0.0", "@types/vscode": "^1.63.0", "@vscode/codicons": "0.0.20", + "@vscode/extension-telemetry": "^0.4.7", "@vscode/webview-ui-toolkit": "^0.8.1", "@webpack-cli/serve": "^1.6.0", "ajv": "^8.8.2", @@ -903,6 +904,15 @@ "integrity": "sha512-LlO6K7nzrIWDCZN1Zi6J6ibxrpMibSAct+zNjAwpkNkwup6cJLx5diYvsOJODMPWOuQlBO21qkxtdkSRzW6+Jw==", "dev": true }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.4.7.tgz", + "integrity": "sha512-tXjChgxFN6EAfa6LIy/PE3fIbIvj0BnELUmGAG+8tUpsLY3g2iACcVM/UJJXtsU6db29tMqCLITUX2Dd3N06GA==", + "dev": true, + "engines": { + "vscode": "^1.60.0" + } + }, "node_modules/@vscode/webview-ui-toolkit": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@vscode/webview-ui-toolkit/-/webview-ui-toolkit-0.8.1.tgz", @@ -9936,6 +9946,12 @@ "integrity": "sha512-LlO6K7nzrIWDCZN1Zi6J6ibxrpMibSAct+zNjAwpkNkwup6cJLx5diYvsOJODMPWOuQlBO21qkxtdkSRzW6+Jw==", "dev": true }, + "@vscode/extension-telemetry": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.4.7.tgz", + "integrity": "sha512-tXjChgxFN6EAfa6LIy/PE3fIbIvj0BnELUmGAG+8tUpsLY3g2iACcVM/UJJXtsU6db29tMqCLITUX2Dd3N06GA==", + "dev": true + }, "@vscode/webview-ui-toolkit": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@vscode/webview-ui-toolkit/-/webview-ui-toolkit-0.8.1.tgz", diff --git a/package.json b/package.json index 17232b2e..b5b50495 100644 --- a/package.json +++ b/package.json @@ -1431,6 +1431,7 @@ "@types/react-dom": "17.0.0", "@types/vscode": "^1.63.0", "@vscode/codicons": "0.0.20", + "@vscode/extension-telemetry": "^0.4.7", "@vscode/webview-ui-toolkit": "^0.8.1", "@webpack-cli/serve": "^1.6.0", "ajv": "^8.8.2", @@ -1481,4 +1482,4 @@ "dependencies": { "node-fetch": "^2.6.7" } -} \ No newline at end of file +} diff --git a/src/commands/Article.ts b/src/commands/Article.ts index cfd5e11f..c0299311 100644 --- a/src/commands/Article.ts +++ b/src/commands/Article.ts @@ -12,6 +12,7 @@ import { DashboardData } from '../models/DashboardData'; import { ExplorerView } from '../explorerView/ExplorerView'; import { DateHelper } from '../helpers/DateHelper'; import { parseWinPath } from '../helpers/parseWinPath'; +import { Telemetry, TelemetryEvent } from '../helpers/Telemetry'; export class Article { @@ -165,6 +166,8 @@ export class Article { * Generate the slug based on the article title */ public static async generateSlug() { + Telemetry.send(TelemetryEvent.generateSlug); + const prefix = Settings.get(SETTING_SLUG_PREFIX) as string; const suffix = Settings.get(SETTING_SLUG_SUFFIX) as string; const updateFileName = Settings.get(SETTING_SLUG_UPDATE_FILE_NAME) as string; diff --git a/src/commands/Folders.ts b/src/commands/Folders.ts index 99116690..c2ebdd78 100644 --- a/src/commands/Folders.ts +++ b/src/commands/Folders.ts @@ -14,6 +14,7 @@ import { parseWinPath } from '../helpers/parseWinPath'; import { MediaHelpers } from '../helpers/MediaHelpers'; import { MediaListener, PagesListener } from '../listeners'; import { DEFAULT_FILE_TYPES } from '../constants/DefaultFileTypes'; +import { Telemetry, TelemetryEvent } from '../helpers/Telemetry'; export const WORKSPACE_PLACEHOLDER = `[[workspace]]`; @@ -68,6 +69,8 @@ export class Folders { MediaHelpers.resetMedia(); MediaListener.sendMediaFiles(0, folderName); } + + Telemetry.send(TelemetryEvent.addMediaFolder); } /** @@ -122,6 +125,8 @@ export class Folders { await Folders.update(folders); Notifications.info(`Folder registered`); + + Telemetry.send(TelemetryEvent.registerFolder); } } @@ -134,6 +139,8 @@ export class Folders { let folders = Folders.get(); folders = folders.filter(f => f.path !== folder.fsPath); await Folders.update(folders); + + Telemetry.send(TelemetryEvent.unregisterFolder); } } diff --git a/src/commands/Preview.ts b/src/commands/Preview.ts index 4b559335..c4372101 100644 --- a/src/commands/Preview.ts +++ b/src/commands/Preview.ts @@ -1,3 +1,4 @@ +import { Telemetry, TelemetryEvent } from './../helpers/Telemetry'; import { SETTING_PREVIEW_HOST, SETTING_PREVIEW_PATHNAME, CONTEXT } from './../constants'; import { ArticleHelper } from './../helpers/ArticleHelper'; import { join } from "path"; @@ -133,6 +134,8 @@ export class Preview {