Skip to content

Commit 16396ec

Browse files
authored
Feat/await async calls (#564)
* prepare v0.19.1 release with improved logging Signed-off-by: shmck <shawn.j.mckay@gmail.com> * make calls async Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent fbf2be0 commit 16396ec

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coderoad",
3-
"version": "0.19.0",
3+
"version": "0.19.1",
44
"description": "Play interactive coding tutorials in your editor",
55
"keywords": [
66
"tutorial",

src/actions/onRunReset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ const onRunReset = async (action: ResetAction, context: Context): Promise<void>
2828
}
2929

3030
// load timeline until last pass commit
31-
reset({ branch, hash })
31+
await reset({ branch, hash })
3232

3333
// if tutorial.config.reset.command, run it
3434
const resetActions = tutorial?.config?.reset
3535
if (resetActions) {
36-
hooks.onReset(
36+
await hooks.onReset(
3737
{ commands: resetActions?.commands, vscodeCommands: resetActions?.vscodeCommands },
3838
tutorial?.id as string,
3939
)

src/actions/onTutorialConfigContinue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const onTutorialConfigContinue = async (action: T.Action, context: Context): Pro
3030
// if tutorial.config.reset.command, run it
3131
const continueActions = tutorialToContinue?.config?.continue
3232
if (continueActions) {
33-
hooks.onContinue(
33+
await hooks.onContinue(
3434
{ commands: continueActions?.commands, vscodeCommands: continueActions?.vscodeCommands },
3535
tutorialToContinue?.id as string,
3636
)

src/channel.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ class Channel implements Channel {
5959
case 'EDITOR_LEVEL_ENTER':
6060
case 'EDITOR_STEP_ENTER':
6161
await vscode.commands.executeCommand(COMMANDS.SET_CURRENT_POSITION, action.payload.position)
62-
hooks.onSetupEnter(action.payload.actions)
62+
await hooks.onSetupEnter(action.payload.actions)
6363
return
6464
// load solution step actions (git commits, commands, open files)
6565
case 'EDITOR_SOLUTION_ENTER':
6666
await vscode.commands.executeCommand(COMMANDS.SET_CURRENT_POSITION, action.payload.position)
67-
hooks.onSolutionEnter(action.payload.actions)
67+
await hooks.onSolutionEnter(action.payload.actions)
6868
return
6969
case 'EDITOR_SYNC_POSITION':
7070
// update progress when a level is deemed complete in the client
@@ -83,13 +83,13 @@ class Channel implements Channel {
8383
actions.onRunReset({ type: 'POSITION', position: action.payload.position }, this.context)
8484
return
8585
case 'EDITOR_STEP_COMPLETE':
86-
hooks.onStepComplete(action.payload)
86+
await hooks.onStepComplete(action.payload)
8787
return
8888
case 'EDITOR_LEVEL_COMPLETE':
89-
hooks.onLevelComplete(action.payload)
89+
await hooks.onLevelComplete(action.payload)
9090
return
9191
case 'EDITOR_TUTORIAL_COMPLETE':
92-
hooks.onTutorialComplete(action.payload)
92+
await hooks.onTutorialComplete(action.payload)
9393
return
9494
default:
9595
logger(`No match for action type: ${actionType}`)

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const createCommands = (commandProps: CreateCommandProps): { [key: string
7070
if (!alreadyConfigured) {
7171
const setupActions = data.config.setup
7272
if (setupActions) {
73-
hooks.onInit(setupActions, data.id)
73+
await hooks.onInit(setupActions, data.id)
7474
}
7575
}
7676
testRunner = createTestRunner(data, {

src/services/reset/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const reset = async ({ branch, hash }: Input): Promise<void> => {
3636
})
3737
// stash any current work
3838
await exec({
39-
command: 'git stash',
39+
command: 'git stash --include-untracked',
4040
}).catch(ignoreError)
4141

4242
// remove any other files

web-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coderoad-app",
3-
"version": "0.19.0",
3+
"version": "0.19.1",
44
"private": true,
55
"scripts": {
66
"analyze": "source-map-explorer 'build/static/js/*.js'",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy