Skip to content

Convert/typescript #3

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 5 commits into from
May 30, 2020
Merged
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
add tutorial config typings
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed May 30, 2020
commit 046f4614b6f6532f669e88f9a8430840bfc14db1
82 changes: 82 additions & 0 deletions typings/tutorial.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
export type Maybe<T> = T | null;

export type TutorialConfig = {
appVersions: TutorialAppVersions;
testRunner: TestRunnerConfig;
repo: TutorialRepo;
dependencies?: TutorialDependency[];
};

/** Logical groupings of tasks */
export type Level = {
id: string;
title: string;
/** A summary of the level */
summary: string;
/** The lesson content of the level, parsed as markdown */
content: string;
/** Actions run on level start up for configuring setup */
setup?: Maybe<StepActions>;
/** A set of tasks for users linked to unit tests */
steps: Array<Step>;
};

/** A level task */
export type Step = {
id: string;
content: string;
setup: StepActions;
solution: Maybe<StepActions>;
subtasks?: { [testName: string]: boolean };
};

/** A tutorial for use in VSCode CodeRoad */
export type Tutorial = {
id: string;
version: string;
summary: TutorialSummary;
config: TutorialConfig;
levels: Array<Level>;
};

/** Summary of tutorial used when selecting tutorial */
export type TutorialSummary = {
title: string;
description: string;
};

export type StepActions = {
commands?: string[];
commits: string[];
files?: string[];
watchers?: string[];
filter?: string;
subtasks?: boolean;
};

export interface TestRunnerArgs {
filter?: string;
tap: string;
}

export interface TestRunnerConfig {
command: string;
args?: TestRunnerArgs;
directory?: string;
setup?: StepActions;
}

export interface TutorialRepo {
uri: string;
branch: string;
}

export interface TutorialDependency {
name: string;
version: string;
message?: string;
}

export interface TutorialAppVersions {
vscode: string;
}