Skip to content

Commit 2f4e5cd

Browse files
committed
fix tsc updated typings
Signed-off-by: shmck <[email protected]>
1 parent a95568f commit 2f4e5cd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async function build (args: string[]) {
9191
// parse yaml skeleton config
9292
let skeleton
9393
try {
94-
skeleton = yamlParser.load(_yaml)
94+
skeleton = yamlParser.load(_yaml) as T.TutorialSkeleton
9595
if (!skeleton || !Object.keys(skeleton).length) {
9696
throw new Error(`Skeleton at "${options.yaml}" is invalid`)
9797
}

src/validate.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
createTestRunner
1010
} from './utils/exec'
1111
import { getCommits, CommitLogObject } from './utils/commits'
12+
import { TutorialSkeleton } from '../typings/tutorial'
1213

1314
interface Options {
1415
yaml: string
@@ -34,14 +35,15 @@ async function validate (args: string[]) {
3435
// parse yaml config
3536
let skeleton
3637
try {
37-
skeleton = yamlParser.load(_yaml)
38+
skeleton = yamlParser.load(_yaml) as TutorialSkeleton
3839

3940
if (!skeleton) {
4041
throw new Error('Invalid yaml file contents')
4142
}
4243
} catch (e) {
4344
console.error('Error parsing yaml')
4445
console.error(e.message)
46+
return
4547
}
4648

4749
const codeBranch: string = skeleton.config.repo.branch
@@ -106,7 +108,7 @@ async function validate (args: string[]) {
106108
await cherryPick(stepSetupCommits)
107109
}
108110
// run commands
109-
if (step.setup.commands) {
111+
if (step?.setup?.commands) {
110112
console.info(`--- Running setup commands...`)
111113
await runCommands(step.setup.commands)
112114
}

typings/tutorial.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,8 @@ export interface TutorialDependency {
8686
export interface TutorialAppVersions {
8787
vscode: string
8888
}
89+
90+
export interface TutorialSkeleton {
91+
config: TutorialConfig
92+
levels: Level[]
93+
}

0 commit comments

Comments
 (0)