|
| 1 | +--- |
| 2 | +id:config-file |
| 3 | +title:Config File |
| 4 | +sidebar_label:Config File |
| 5 | +--- |
| 6 | + |
| 7 | +An overview of the yaml configuration. |
| 8 | + |
| 9 | +```yaml |
| 10 | +# A configuration file for a CodeRoad Tutorial |
| 11 | +# This is a YAML-formatted file. |
| 12 | + |
| 13 | +## Your personal version of the tutorial |
| 14 | +## |
| 15 | +version:'0.1.0' |
| 16 | + |
| 17 | +## Data used to populate the tutorial summary page |
| 18 | +## |
| 19 | +summary: |
| 20 | +## The title of your tutorial. Required. |
| 21 | +## |
| 22 | +title:'' |
| 23 | +## A description of your tutorial. Required. |
| 24 | +## |
| 25 | +description:'' |
| 26 | +## Data used to configure and setup the tutorial |
| 27 | +## |
| 28 | +config: |
| 29 | +## Test runner setup. |
| 30 | +testRunner: |
| 31 | +## The command called to run the test runner. For example "npm run test", or a path to the test runner binary. Required. |
| 32 | +command:./node_modules/.bin/mocha |
| 33 | +## Standard arguments used by a given test runner |
| 34 | +args: |
| 35 | +## The command arg used to filter tests. Used by "subtasks" |
| 36 | +filter:--grep |
| 37 | +## The command arg used to convert test runner output to TAP format. See https://testanything.org/ for more. Required. |
| 38 | +tap:--reporter=mocha-tap-reporter |
| 39 | +## The directory where to run the test runner from. If not specified, tests will run from the root of the project. Optional. |
| 40 | +directory:coderoad |
| 41 | +## Commits to load to setup the test runner. Optional. |
| 42 | +setup: |
| 43 | +## A list of commits to load to setup the tutorial |
| 44 | +commits: |
| 45 | + -commit1 |
| 46 | + -commit2 |
| 47 | +## A list of commands to run to configure the tutorial |
| 48 | +commands: |
| 49 | + -npm install |
| 50 | +## App versions helps to ensure compatability with the Extension |
| 51 | +appVersions: |
| 52 | +## Ensure compatability with a minimal VSCode CodeRoad version |
| 53 | +vscode:'>=0.7.0' |
| 54 | +## Repo information to load code from |
| 55 | +## |
| 56 | +repo: |
| 57 | +## The uri path to the repo containing the code commits. Required. |
| 58 | +uri:https://github.com/coderoad/fcc-learn-npm |
| 59 | +## The branch on the repo uri that contains the code commits. Required. |
| 60 | +branch:v0.3.0 |
| 61 | +## A list of tutorial dependencies to ensure the environment is setup for the tutorial. Optional. |
| 62 | +## The dependencies will be checked by running `dependency.name` --version and comparing it to the version provided. |
| 63 | +## |
| 64 | +dependencies: |
| 65 | +## The name of the dependency |
| 66 | + -name:node |
| 67 | +## The version requirement. See https://github.com/npm/node-semver for options. |
| 68 | +version:'>=10' |
| 69 | +## A level is made up of |
| 70 | +levels: |
| 71 | + -id:L1 |
| 72 | +steps: |
| 73 | +## Example 1: Opening files |
| 74 | + -id:L1S1 |
| 75 | +## Setup for the first task. Required. |
| 76 | +setup: |
| 77 | +## Files to open in a text editor when the task loads. Optional. |
| 78 | +files: |
| 79 | + -package.json |
| 80 | +## Commits to load when the task loads. These should include failing tests. Required. |
| 81 | +commits: |
| 82 | + -commit3 |
| 83 | +## Solution for the first task. Required. |
| 84 | +solution: |
| 85 | +## Files to open when the solution loads. Optional. |
| 86 | +files: |
| 87 | + -package.json |
| 88 | +## Commits that complete the task. All tests should pass when the commits load. These commits will not be loaded by the tutorial user in normal tutorial activity. |
| 89 | +commits: |
| 90 | + -commit4 |
| 91 | +## Example Two: Running commands |
| 92 | + -id:L1S2 |
| 93 | +setup: |
| 94 | +commits: |
| 95 | + -commit5 |
| 96 | +## CLI commands that are run when the task loads. Optional. |
| 97 | +commands: |
| 98 | + -npm install |
| 99 | +solution: |
| 100 | +commits: |
| 101 | + -commit6 |
| 102 | +commands: |
| 103 | + -npm install |
| 104 | +## Example Three: Watchers |
| 105 | + -id:L1S3 |
| 106 | +setup: |
| 107 | +files: |
| 108 | + -package.json |
| 109 | +commits: |
| 110 | + -commit7 |
| 111 | +## Listeners that run tests when a file or directory changes. |
| 112 | +watchers: |
| 113 | + -package.json |
| 114 | + -node_modules/some-package |
| 115 | +solution: |
| 116 | +files: |
| 117 | + -package.json |
| 118 | +commits: |
| 119 | + -commit8 |
| 120 | +## Example Four: Subtasks |
| 121 | + -id:L1S4 |
| 122 | +setup: |
| 123 | +commits: |
| 124 | + -commit8 |
| 125 | +commands: |
| 126 | +## A filter is a regex that limits the test results |
| 127 | + -filter:'^Example 2' |
| 128 | +## A feature that shows subtasks: all filtered active test names and the status of the tests (pass/fail). |
| 129 | + -subtasks:true |
| 130 | +solution: |
| 131 | +commits: |
| 132 | + -commit9 |
| 133 | + -id:L2 |
| 134 | +steps: |
| 135 | + -id:L2S1 |
| 136 | +setup: |
| 137 | +commits: |
| 138 | + -commit10 |
| 139 | +solution: |
| 140 | +commits: |
| 141 | + -commit7 |
| 142 | +``` |