@@ -5,6 +5,7 @@ import Context from '../services/context/context'
55import { send } from '../commands'
66import { WORKSPACE_ROOT , TUTORIAL_URL } from '../environment'
77import fetch from 'node-fetch'
8+ import logger from '../services/logger'
89
910const onStartup = async ( context : Context ) : Promise < void > => {
1011 try {
@@ -36,10 +37,12 @@ const onStartup = async (context: Context): Promise<void> => {
3637 // NEW: no stored tutorial, must start new tutorial
3738 if ( ! tutorial || ! tutorial . version ) {
3839 if ( TUTORIAL_URL ) {
40+ logger ( `Using tutorial url from env: ${ TUTORIAL_URL } ` )
3941 // if a tutorial URL is added, launch on startup
4042 try {
4143 const tutorialRes = await fetch ( TUTORIAL_URL )
42- const tutorial = await tutorialRes . json ( )
44+ const tutorial : TT . Tutorial = await tutorialRes . json ( )
45+ logger ( `Tutorial: ${ tutorial ?. summary ?. title } (${ tutorial ?. version } )` )
4346 send ( { type : 'START_TUTORIAL_FROM_URL' , payload : { tutorial } } )
4447 return
4548 } catch ( e : any ) {
@@ -54,6 +57,7 @@ const onStartup = async (context: Context): Promise<void> => {
5457
5558 // CONTINUE_FROM_PROGRESS
5659 const { position } = await context . onContinue ( tutorial )
60+ logger ( `Continuing tutorial from progress: level ${ position ?. levelId } step ${ position ?. stepId } ` )
5761 // communicate to client the tutorial & stepProgress state
5862 send ( { type : 'LOAD_STORED_TUTORIAL' , payload : { env, tutorial, position } } )
5963 } catch ( e : any ) {
0 commit comments