Skip to content

Commit 625a561

Browse files
committed
feat: telemetry
1 parent 024e700 commit 625a561

13 files changed

Lines changed: 372 additions & 175 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010
permissions:
1111
contents: write
12+
env:
13+
RUNNER_MIXPANEL_TOKEN: ${{ vars.RUNNER_MIXPANEL_TOKEN }}
1214
steps:
1315
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1416
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
@@ -28,17 +30,17 @@ jobs:
2830
github-token: ${{ secrets.GITHUB_TOKEN }}
2931
release-url: ${{ github.event.release.url }}
3032

31-
- name: Publish to Open VSX Registry
33+
- name: Publish to Visual Studio Marketplace
3234
uses: HaaLeo/publish-vscode-extension@ca5561daa085dee804bf9f37fe0165785a9b14db # v2
33-
id: publishToOpenVSX
3435
with:
3536
extensionFile: extension.vsix
36-
pat: ${{ secrets.OPEN_VSX_TOKEN }}
37-
registryUrl: https://open-vsx.org
37+
pat: ${{ secrets.VSCE_PAT }}
38+
registryUrl: https://marketplace.visualstudio.com
3839

39-
- name: Publish to Visual Studio Marketplace
40+
- name: Publish to Open VSX Registry
4041
uses: HaaLeo/publish-vscode-extension@ca5561daa085dee804bf9f37fe0165785a9b14db # v2
42+
id: publishToOpenVSX
4143
with:
4244
extensionFile: extension.vsix
43-
pat: ${{ secrets.VSCE_PAT }}
44-
registryUrl: https://marketplace.visualstudio.com
45+
pat: ${{ secrets.OPEN_VSX_TOKEN }}
46+
registryUrl: https://open-vsx.org

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ dist-ssr
2727

2828
*.tsbuildinfo
2929
extension.vsix
30+
.env

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ For a quick start guide:
4848

4949
All configuration descriptions can be accessed via the VS Code settings UI (<kbd>Ctrl</kbd> + <kbd>,</kbd>) by searching for `@ext:typed-sigterm.oi-runner-2`.
5050

51+
## Telemetry
52+
53+
OI Runner++ collects some telemetry data to help improve the extension (e.g., understanding which VS Code versions need to be supported). You can search for `mixpanel.track` in the source code repository to see what information is collected.
54+
55+
Telemetry data does not include personal or sensitive information and is used for statistical purposes only. You can disable telemetry by setting VS Code's `telemetry.feedback.enabled` to `false` and restarting VS Code.
56+
5157
## Credits
5258

5359
This project is deeply inspired by [OI Runner](https://github.com/CmdBlockZQG/oi-runner). Thanks to [@CmdBlockZQG](https://github.com/CmdBlockZQG) and other contributors of OI Runner.

README.zh-CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848

4949
所有配置说明都可通过 VS Code 设置界面 (<kbd>Ctrl</kbd> + <kbd>,</kbd>) 访问,搜索 `@ext:typed-sigterm.oi-runner-2` 即可找到。
5050

51+
## 遥测
52+
53+
OI Runner++ 会收集一些遥测数据以帮助改进插件(比如了解需要兼容到哪个 VS Code 版本),你可以在源代码仓库中搜索 `mixpanel.track` 收集的信息。
54+
55+
遥测收集的信息不包含个人和敏感信息,仅用于统计目的。你可以在设置 VS Code `telemetry.feedback.enabled``false` 并重启 VS Code 来禁用遥测。
56+
5157
## 鸣谢
5258

5359
OI Runner++ 深受 [OI Runner](https://github.com/CmdBlockZQG/oi-runner) 启发,感谢 [@CmdBlockZQG](https://github.com/CmdBlockZQG) 及其他贡献者。

extension/config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1+
import type { ConfigLevel } from '../shared/events';
12
import path from 'node:path';
23
import * as vscode from 'vscode';
34
import { z } from 'zod/v4';
45
import { contributes } from '../package.json';
56
import { cachedFn } from './utils';
67

8+
export function isConfigured(): ConfigLevel {
9+
const info = vscode.workspace.getConfiguration().inspect('oi-runner-2');
10+
if (!info)
11+
return false;
12+
if (info.workspaceFolderValue)
13+
return 'workspace-folder';
14+
if (info.workspaceValue)
15+
return 'workspace';
16+
if (info.globalValue)
17+
return 'global';
18+
return false;
19+
}
20+
721
const ConfigManifest = contributes.configuration[0].properties;
822

923
const CommandSchema = z.tuple([z.string(), z.array(z.string())]);

extension/webview.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { EventMessage } from '../shared/events';
22
import * as vscode from 'vscode';
3+
import { version } from '../package.json';
34
import { EventMarker } from '../shared/events';
4-
import { getAutoSave, getConfiguredDefaultTask, getConfiguredTasks, getDefaultTask } from './config';
5+
import { getAutoSave, getConfiguredDefaultTask, getConfiguredTasks, getDefaultTask, isConfigured } from './config';
56
import { Runner } from './runner';
67
import { logger } from './utils';
78

@@ -129,6 +130,14 @@ class PanelProvider implements vscode.WebviewViewProvider, vscode.Disposable {
129130
compilable: !!v.compile,
130131
})),
131132
extensions: Object.keys(getConfiguredDefaultTask()),
133+
134+
id: vscode.env.machineId,
135+
telemetry: vscode.env.isTelemetryEnabled && {
136+
'Version': version,
137+
'VSCode Version': vscode.version,
138+
'Language': vscode.env.language,
139+
'Configured': isConfigured(),
140+
},
132141
});
133142
this._handleActiveEditorChange(vscode.window.activeTextEditor);
134143
break;

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@
237237
"@iconify-prerendered/vue-line-md": "^0.28.1746598136",
238238
"@tomjs/vite-plugin-vscode": "^4.2.1",
239239
"@typed-sigterm/eslint-config": "^1.4.1",
240+
"@types/js-md5": "^0.7.2",
241+
"@types/mixpanel-browser": "^2.60.0",
240242
"@types/node": "^22.15.29",
241243
"@types/ps-tree": "^1.1.6",
242244
"@types/vscode": "^1.94.0",
@@ -248,6 +250,8 @@
248250
"consola": "^3.4.2",
249251
"eslint": "^9.28.0",
250252
"husky": "^9.1.7",
253+
"js-md5": "^0.8.3",
254+
"mixpanel-browser": "^2.65.0",
251255
"monaco-editor": "^0.52.2",
252256
"nanoid": "^5.1.5",
253257
"ps-tree": "^1.2.0",

0 commit comments

Comments
 (0)