Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf457a01

Browse files
committed
log tutorial start
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent2d96577 commitf457a01

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

‎src/channel/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { exec } from '../services/node'
2020
import{WORKSPACE_ROOT,TUTORIAL_URL}from'../environment'
2121
importresetfrom'../services/reset'
2222
importgetLastCommitHashfrom'../services/reset/lastHash'
23+
import{onEvent}from'../services/telemetry'
2324

2425
constreadFileAsync=promisify(readFile)
2526

@@ -128,6 +129,12 @@ class Channel implements Channel {
128129
try{
129130
constdata:TT.Tutorial=action.payload.tutorial
130131

132+
onEvent('tutorial_start',{
133+
tutorial_id:data.id,
134+
tutorial_version:data.version,
135+
tutorial_title:data.summary.title,
136+
})
137+
131138
// validate extension version
132139
constexpectedAppVersion=data.config?.appVersions?.vscode
133140
if(expectedAppVersion){

‎src/editor/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ class Editor {
2323
workspaceState:this.vscodeExt.workspaceState,
2424
})
2525

26+
constsubscribe=(sub:any)=>{
27+
this.vscodeExt.subscriptions.push(sub)
28+
}
29+
2630
// register commands
2731
for(constcmdincommands){
2832
constcommand:vscode.Disposable=vscode.commands.registerCommand(cmd,commands[cmd])
29-
this.vscodeExt.subscriptions.push(command)
33+
subscribe(command)
3034
}
3135

32-
telemetry.activate()
36+
telemetry.activate(subscribe)
3337
}
3438
publicdeactivate=():void=>{
3539
// cleanup subscriptions/tasks

‎src/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const EXTENSION_ID = 'coderoad'
88
// Node env
99
exporttypeEnv='test'|'local'|'development'|'production'
1010
//@ts-ignore
11-
exportconstNODE_ENV:Env=process.env.NODE_ENV||'production'
11+
exportconstNODE_ENV:Env=process.env.NODE_ENV||'development'
1212

1313
// toggle logging in development
1414
exportconstLOG=false

‎src/services/telemetry/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ interface Measurements {
1717

1818
letreporter:any
1919

20-
exportconstactivate=():void=>{
20+
exportconstactivate=(subscribeFn:(reporter:any)=>void):void=>{
2121
if(NODE_ENV==='production'){
2222
reporter=newTelemetryReporter(EXTENSION_ID,VERSION,INSTRUMENTATION_KEY)
23+
subscribeFn(reporter)
2324
}
2425
}
2526

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp