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

Commitac037f2

Browse files
committed
minor updates
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent078bea0 commitac037f2

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

‎src/actions/setupActions.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ import openFiles from './utils/openFiles'
66
importrunCommandsfrom'./utils/runCommands'
77
importonErrorfrom'../services/sentry/onError'
88

9-
asyncfunctionwait(ms:number){
10-
returnnewPromise((resolve)=>{
11-
setTimeout(resolve,ms)
12-
})
13-
}
14-
159
interfaceSetupActions{
1610
actions:TT.StepActions
1711
send:(action:T.Action)=>void// send messages to client
@@ -35,8 +29,6 @@ export const setupActions = async ({ actions, send, path }: SetupActions): Promi
3529
// 3. start file watchers
3630
loadWatchers(watchers||[])
3731

38-
awaitwait(1000)
39-
4032
// 4. run command
4133
awaitrunCommands({commands:commands||[], send, path}).catch(onError)
4234
}

‎src/channel/index.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,30 +76,31 @@ class Channel implements Channel {
7676
consttutorial:TT.Tutorial|null=this.context.tutorial.get()
7777

7878
// new tutorial
79-
if(!tutorial||!tutorial.id){
80-
this.send({type:'START_NEW_TUTORIAL',payload:{ env}})
81-
return
82-
}
79+
this.send({type:'START_NEW_TUTORIAL',payload:{ env}})
80+
return
8381

84-
// set tutorial
85-
const{ position, progress}=awaitthis.context.setTutorial(this.workspaceState,tutorial)
82+
// disable continue until fixed
8683

87-
if(progress.complete){
88-
// tutorial is already complete
89-
this.send({type:'TUTORIAL_ALREADY_COMPLETE',payload:{ env}})
90-
return
91-
}
92-
// communicate to client the tutorial & stepProgress state
93-
this.send({type:'LOAD_STORED_TUTORIAL',payload:{ env, tutorial, progress, position}})
84+
// // set tutorial
85+
// const { position, progress } = await this.context.setTutorial(this.workspaceState, tutorial)
9486

95-
return
87+
// if (progress.complete) {
88+
// // tutorial is already complete
89+
// this.send({ type: 'TUTORIAL_ALREADY_COMPLETE', payload: { env }})
90+
// return
91+
// }
92+
// // communicate to client the tutorial & stepProgress state
93+
// this.send({ type: 'LOAD_STORED_TUTORIAL', payload: { env, tutorial, progress, position }})
94+
95+
// return
9696
}catch(e){
9797
consterror={
9898
type:'UnknownError',
9999
message:`Location: Editor startup\n\n${e.message}`,
100100
}
101101
this.send({type:'EDITOR_STARTUP_FAILED',payload:{ error}})
102102
}
103+
return
103104

104105
// clear tutorial local storage
105106
case'TUTORIAL_CLEAR':
@@ -203,14 +204,14 @@ class Channel implements Channel {
203204

204205
// report back to the webview that setup is complete
205206
this.send({type:'TUTORIAL_CONFIGURED'})
206-
return
207207
}catch(e){
208208
consterror={
209209
type:'UnknownError',
210210
message:`Location: EditorTutorialConfig.\n\n${e.message}`,
211211
}
212212
this.send({type:'TUTORIAL_CONFIGURE_FAIL',payload:{ error}})
213213
}
214+
return
214215
case'EDITOR_TUTORIAL_CONTINUE_CONFIG':
215216
try{
216217
consttutorialContinue:TT.Tutorial|null=this.context.tutorial.get()
@@ -224,14 +225,14 @@ class Channel implements Channel {
224225
})
225226
// update the current stepId on startup
226227
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)
227-
return
228228
}catch(e){
229229
consterror={
230230
type:'UnknownError',
231231
message:`Location: Editor tutorial continue config.\n\n${e.message}`,
232232
}
233233
this.send({type:'CONTINUE_FAILED',payload:{ error}})
234234
}
235+
return
235236
case'EDITOR_VALIDATE_SETUP':
236237
try{
237238
// check workspace is selected
@@ -272,14 +273,14 @@ class Channel implements Channel {
272273
return
273274
}
274275
this.send({type:'SETUP_VALIDATED'})
275-
return
276276
}catch(e){
277277
consterror={
278278
type:'UknownError',
279279
message:e.message,
280280
}
281281
this.send({type:'VALIDATE_SETUP_FAILED',payload:{ error}})
282282
}
283+
return
283284
case'EDITOR_REQUEST_WORKSPACE':
284285
openWorkspace()
285286
return
@@ -329,7 +330,7 @@ class Channel implements Channel {
329330
case'TEST_PASS':
330331
consttutorial=this.context.tutorial.get()
331332
if(!tutorial){
332-
thrownewError('Error with current tutorial')
333+
thrownewError('Error with current tutorial. Tutorial may be missing an id.')
333334
}
334335
// update local storage stepProgress
335336
constprogress=this.context.progress.setStepComplete(tutorial,action.payload.stepId)

‎src/editor/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface CreateCommandProps {
2020
exportconstcreateCommands=({ extensionPath, workspaceState}:CreateCommandProps)=>{
2121
// React panel webview
2222
letwebview:any
23-
letcurrentStepId=''
23+
letcurrentStepId:string|null=''
2424
lettestRunner:any
2525

2626
return{
@@ -79,7 +79,7 @@ export const createCommands = ({ extensionPath, workspaceState }: CreateCommandP
7979
},
8080
[COMMANDS.RUN_TEST]:(current:Payload|undefined,onSuccess:()=>void)=>{
8181
// use stepId from client, or last set stepId
82-
constpayload:Payload={stepId:current&&current.stepId.length ?current.stepId :currentStepId}
82+
constpayload:Payload={stepId:current&&current.stepId?.length ?current.stepId :currentStepId}
8383
testRunner(payload,onSuccess)
8484
},
8585
}

‎src/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ export type Env = 'test' | 'local' | 'development' | 'production'
1414
exportconstNODE_ENV:Env=process.env.NODE_ENV||'production'
1515

1616
// toggle logging in development
17-
exportconstLOG:boolean=
18-
(process.env.REACT_APP_LOG||'').toLowerCase()==='true'&&process.env.NODE_ENV!=='production'
17+
exportconstLOG:boolean=(process.env.REACT_APP_LOG||'').toLowerCase()==='true'
1918

2019
// error logging tool
2120
exportconstSENTRY_DSN:string|null=process.env.SENTRY_DSN||null

‎src/services/logger/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import{LOG}from'../../environment'
22

3-
constlogger=(message:string|string[])=>{
3+
exporttypeLog=string|object|null
4+
5+
constlogger=(...messages:Log[]):void=>{
46
if(!LOG){
57
return
68
}
7-
if(Array.isArray(message)){
8-
message.forEach(console.log)
9-
}else{
10-
console.log(message)
9+
// Inside vscode, you console.log does not allow more than 1 param
10+
// to get around it, we can log with multiple log statements
11+
for(constmessageofmessages){
12+
if(typeofmessage==='object'){
13+
console.log(JSON.stringify(message))
14+
}else{
15+
console.log(message)
16+
}
1117
}
1218
}
1319

‎src/services/testRunner/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { clearOutput, displayOutput } from './output'
88
import{formatFailOutput}from'./formatOutput'
99

1010
exportinterfacePayload{
11-
stepId:string
11+
stepId:string|null
1212
}
1313

1414
interfaceCallbacks{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp