Skip to content

Prepare release, fix build typings #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix tsc updated typings
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Apr 3, 2021
commit 2f4e5cd371a24fdcd30be4ed1656108e847de804
2 changes: 1 addition & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function build (args: string[]) {
// parse yaml skeleton config
let skeleton
try {
skeleton = yamlParser.load(_yaml)
skeleton = yamlParser.load(_yaml) as T.TutorialSkeleton
if (!skeleton || !Object.keys(skeleton).length) {
throw new Error(`Skeleton at "${options.yaml}" is invalid`)
}
Expand Down
6 changes: 4 additions & 2 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
createTestRunner
} from './utils/exec'
import { getCommits, CommitLogObject } from './utils/commits'
import { TutorialSkeleton } from '../typings/tutorial'

interface Options {
yaml: string
Expand All @@ -34,14 +35,15 @@ async function validate (args: string[]) {
// parse yaml config
let skeleton
try {
skeleton = yamlParser.load(_yaml)
skeleton = yamlParser.load(_yaml) as TutorialSkeleton

if (!skeleton) {
throw new Error('Invalid yaml file contents')
}
} catch (e) {
console.error('Error parsing yaml')
console.error(e.message)
return
}

const codeBranch: string = skeleton.config.repo.branch
Expand Down Expand Up @@ -106,7 +108,7 @@ async function validate (args: string[]) {
await cherryPick(stepSetupCommits)
}
// run commands
if (step.setup.commands) {
if (step?.setup?.commands) {
console.info(`--- Running setup commands...`)
await runCommands(step.setup.commands)
}
Expand Down
5 changes: 5 additions & 0 deletions typings/tutorial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,8 @@ export interface TutorialDependency {
export interface TutorialAppVersions {
vscode: string
}

export interface TutorialSkeleton {
config: TutorialConfig
levels: Level[]
}