- Notifications
You must be signed in to change notification settings - Fork2
Support webhook in the coderoad cli#85
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
255 changes: 152 additions & 103 deletionssrc/schema/skeleton.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,208 +1,257 @@ | ||
import meta from"./meta"; | ||
export default { | ||
title:"Skeleton Schema", | ||
description: | ||
"A CodeRoad tutorial config schema. This data is paired up with the markdown to create a tutorial", | ||
...meta, | ||
type:"object", | ||
properties: { | ||
version: { | ||
$ref:"#/definitions/semantic_version", | ||
description:"The tutorial version. Must be unique for the tutorial.", | ||
examples: ["0.1.0", "1.0.0"], | ||
}, | ||
// config | ||
config: { | ||
type:"object", | ||
properties: { | ||
testRunner: { | ||
type:"object", | ||
description:"The test runner configuration", | ||
properties: { | ||
command: { | ||
type:"string", | ||
description:"Command line to start the test runner", | ||
examples: ["./node_modules/.bin/mocha"], | ||
}, | ||
args: { | ||
type:"object", | ||
description: | ||
"A configuration of command line args for your test runner", | ||
properties: { | ||
filter: { | ||
type:"string", | ||
description: | ||
"the command line arg for filtering tests with a regex pattern", | ||
examples: ["--grep"], | ||
}, | ||
tap: { | ||
type:"string", | ||
description: | ||
"The command line arg for configuring a TAP reporter. See https://github.com/sindresorhus/awesome-tap for examples.", | ||
examples: ["--reporter=mocha-tap-reporter"], | ||
}, | ||
}, | ||
additionalProperties: false, | ||
required: ["tap"], | ||
}, | ||
directory: { | ||
type:"string", | ||
description:"An optional folder for the test runner", | ||
examples: ["coderoad"], | ||
}, | ||
}, | ||
required: ["command", "args"], | ||
}, | ||
setup: { | ||
type:"object", | ||
description: | ||
"Setup commits or commands used for setting up the test runner on tutorial launch", | ||
properties: { | ||
commits: { | ||
$ref:"#/definitions/commit_array", | ||
}, | ||
commands: { | ||
$ref:"#/definitions/command_array", | ||
}, | ||
vscodeCommands: { | ||
$ref:"#/definitions/vscode_command_array", | ||
}, | ||
}, | ||
}, | ||
repo: { | ||
type:"object", | ||
description:"The repo holding the git commits for the tutorial", | ||
properties: { | ||
uri: { | ||
type:"string", | ||
description:"The uri source of the tutorial", | ||
format:"uri", | ||
examples: ["https://github.com/name/tutorial-name.git"], | ||
}, | ||
branch: { | ||
description: | ||
"The branch of the repo where the tutorial config file exists", | ||
type:"string", | ||
examples: ["master"], | ||
}, | ||
}, | ||
additionalProperties: false, | ||
required: ["uri", "branch"], | ||
}, | ||
reset: { | ||
type:"object", | ||
description:"Configuration options for resetting a tutorial", | ||
properties: { | ||
commands: { | ||
$ref:"#/definitions/command_array", | ||
}, | ||
vscodeCommands: { | ||
$ref:"#/definitions/vscode_command_array", | ||
}, | ||
}, | ||
additionalProperties: false, | ||
}, | ||
dependencies: { | ||
type:"array", | ||
description:"A list of tutorial dependencies", | ||
items: { | ||
type:"object", | ||
properties: { | ||
name: { | ||
type:"string", | ||
description: | ||
"The command line process name of the dependency. It will be checked by running `name --version`", | ||
examples: ["node", "python"], | ||
}, | ||
version: { | ||
type:"string", | ||
description: | ||
"The version requirement. See https://github.com/npm/node-semver for options", | ||
examples: [">=10"], | ||
}, | ||
}, | ||
required: ["name", "version"], | ||
}, | ||
}, | ||
appVersions: { | ||
type:"object", | ||
description: | ||
"A list of compatable coderoad versions. Currently only a VSCode extension.", | ||
properties: { | ||
vscode: { | ||
type:"string", | ||
description: | ||
"The version range for coderoad-vscode that this tutorial is compatable with", | ||
examples: [">=0.7.0"], | ||
}, | ||
}, | ||
}, | ||
webhook: { | ||
type: "object", | ||
description: | ||
"An optional configuration for webhooks triggered by events such as init, step/level/tutorial complete", | ||
properties: { | ||
url: { | ||
type: "string", | ||
description: "URL for POST restful webhook request", | ||
examples: ["https://example.com/webhook"], | ||
}, | ||
events: { | ||
type: "object", | ||
description: "An object of events to trigger on", | ||
properties: { | ||
init: { | ||
type: "boolean", | ||
description: | ||
"An event triggered on tutorial startup. Sends tutorialId", | ||
}, | ||
reset: { | ||
type: "boolean", | ||
description: | ||
"An event triggered on reset of a tutorial. Sends tutorialId", | ||
}, | ||
step_complete: { | ||
type: "boolean", | ||
description: | ||
"An event triggered on completion of a step. Sends tutorialId, levelId & stepId", | ||
}, | ||
level_complete: { | ||
step_complete: { | ||
type: "boolean", | ||
description: | ||
"An event triggered on completion of a level. Sends tutorialId & levelId", | ||
}, | ||
}, | ||
tutorial_complete: { | ||
step_complete: { | ||
type: "boolean", | ||
description: | ||
"An event triggered on completion of a tutorial. Sends tutorialId", | ||
}, | ||
}, | ||
}, | ||
additionalProperties: false, | ||
}, | ||
}, | ||
required: ["url", "events"], | ||
}, | ||
}, | ||
additionalProperties: false, | ||
required: ["testRunner", "repo"], | ||
}, | ||
// levels | ||
levels: { | ||
type:"array", | ||
description: | ||
'Levels are the stages a user goes through in the tutorial. A level may contain a group of tasks called "steps" that must be completed to proceed', | ||
items: { | ||
type:"object", | ||
properties: { | ||
id: { | ||
type:"string", | ||
description:"A level id", | ||
examples: ["1", "11"], | ||
}, | ||
setup: { | ||
$ref:"#/definitions/setup_action_without_commits", | ||
description: | ||
"An optional point for running actions, commands or opening files", | ||
}, | ||
steps: { | ||
type:"array", | ||
items: { | ||
type:"object", | ||
properties: { | ||
id: { | ||
type:"string", | ||
description:"A level id", | ||
examples: ["1.1", "11.12"], | ||
}, | ||
setup: { | ||
allOf: [ | ||
{ | ||
$ref:"#/definitions/setup_action_without_commits", | ||
description: | ||
"A point for running actions, commands and/or opening files", | ||
}, | ||
], | ||
}, | ||
solution: { | ||
allOf: [ | ||
{ | ||
$ref:"#/definitions/setup_action_without_commits", | ||
description: | ||
"The solution can be loaded if the user gets stuck. It can run actions, commands and/or open files", | ||
}, | ||
{ | ||
required: [], | ||
}, | ||
], | ||
}, | ||
}, | ||
required: ["id"], | ||
}, | ||
}, | ||
}, | ||
required: ["id"], | ||
}, | ||
minItems: 1, | ||
}, | ||
}, | ||
additionalProperties: false, | ||
required: ["version", "config", "levels"], | ||
}; |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.