Skip to content

feat: add support for continue config #94

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
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
18 changes: 18 additions & 0 deletions src/schema/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ export default {
additionalProperties: false,
required: ["uri", "branch"],
},
continue: {
type: "object",
description: "Configuration options for continuing a tutorial",
properties: {
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
},
additionalProperties: false,
},
reset: {
type: "object",
description: "Configuration options for resetting a tutorial",
Expand Down Expand Up @@ -164,6 +177,11 @@ export default {
description:
"An event triggered on tutorial startup. Sends tutorialId",
},
continue: {
type: "boolean",
description:
"An event triggered when continuing a tutorial. Sends tutorialId",
},
reset: {
type: "boolean",
description:
Expand Down
20 changes: 19 additions & 1 deletion src/schema/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ export default {
additionalProperties: false,
required: ["uri", "branch"],
},
continue: {
type: "object",
description: "Configuration options for continuing a tutorial",
properties: {
commands: {
$ref: "#/definitions/command_array",
},
vscodeCommands: {
$ref: "#/definitions/vscode_command_array",
},
},
additionalProperties: false,
},
reset: {
type: "object",
description: "Configuration options for resetting a tutorial",
Expand Down Expand Up @@ -183,6 +196,11 @@ export default {
description:
"An event triggered on tutorial startup. Sends tutorialId",
},
continue: {
type: "boolean",
description:
"An event triggered when continuing a tutorial. Sends tutorialId",
},
reset: {
type: "boolean",
description:
Expand Down Expand Up @@ -298,5 +316,5 @@ export default {
},
},
additionalProperties: false,
required: ["version", "summary", "config", "levels"],
required: ["id", "version", "summary", "config", "levels"],
};
1 change: 1 addition & 0 deletions src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export function parse (params: ParseParams): any {
const mdContent: TutorialFrame = parseMdContent(params.text + '\n\n')

const parsed: Partial<T.Tutorial> = {
id: params.skeleton.id,
version: params.skeleton.version,
summary: mdContent.summary,
config: params.skeleton.config || {},
Expand Down