Skip to content

Commit 7285fc1

Browse files
committed
support reset commands/vscode-commands
Signed-off-by: shmck <[email protected]>
1 parent 7da0e08 commit 7285fc1

File tree

4 files changed

+59
-13
lines changed

4 files changed

+59
-13
lines changed

Diff for: src/schema/meta.ts

+22
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,25 @@ export default {
4747
type: "string",
4848
},
4949
},
50+
vscode_command_array: {
51+
type: "array",
52+
description:
53+
"An array of VSCode commands that can be called using the vscode commands API.",
54+
items: {
55+
anyOf: [
56+
{
57+
type: "string",
58+
description: "A VSCode command without params",
59+
},
60+
{
61+
type: "array",
62+
description: "A VSCode command with params",
63+
minLength: 2,
64+
maxLength: 2,
65+
},
66+
],
67+
},
68+
},
5069
commit_array: {
5170
type: "array",
5271
description:
@@ -105,6 +124,9 @@ export default {
105124
commands: {
106125
$ref: "#/definitions/command_array",
107126
},
127+
vscodeCommands: {
128+
$ref: "#/definitions/vscode_command_array",
129+
},
108130
watchers: {
109131
type: "array",
110132
items: {

Diff for: src/schema/skeleton.ts

+18-6
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,20 @@ export default {
5656
required: ["command", "args"],
5757
},
5858
setup: {
59-
$ref: "#/definitions/setup_action_without_commits",
59+
type: "object",
6060
description:
61-
"Setup actions or commands used for setting up the test runner on tutorial launch",
61+
"Setup commits or commands used for setting up the test runner on tutorial launch",
62+
properties: {
63+
commits: {
64+
$ref: "#/definitions/commit_array",
65+
},
66+
commands: {
67+
$ref: "#/definitions/command_array",
68+
},
69+
vscodeCommands: {
70+
$ref: "#/definitions/vscode_command_array",
71+
},
72+
},
6273
},
6374
repo: {
6475
type: "object",
@@ -84,10 +95,11 @@ export default {
8495
type: "object",
8596
description: "Configuration options for resetting a tutorial",
8697
properties: {
87-
command: {
88-
type: "string",
89-
description: "An optional command to run on reset",
90-
examples: ["npm install"],
98+
commands: {
99+
$ref: "#/definitions/command_array",
100+
},
101+
vscodeCommands: {
102+
$ref: "#/definitions/vscode_command_array",
91103
},
92104
},
93105
additionalProperties: false,

Diff for: src/schema/tutorial.ts

+17-5
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,20 @@ export default {
7575
required: ["command", "args"],
7676
},
7777
setup: {
78-
$ref: "#/definitions/setup_action",
78+
type: "object",
7979
description:
8080
"Setup commits or commands used for setting up the test runner on tutorial launch",
81+
properties: {
82+
commits: {
83+
$ref: "#/definitions/commit_array",
84+
},
85+
commands: {
86+
$ref: "#/definitions/command_array",
87+
},
88+
vscodeCommands: {
89+
$ref: "#/definitions/vscode_command_array",
90+
},
91+
},
8192
},
8293
repo: {
8394
type: "object",
@@ -103,10 +114,11 @@ export default {
103114
type: "object",
104115
description: "Configuration options for resetting a tutorial",
105116
properties: {
106-
command: {
107-
type: "string",
108-
description: "An optional command to run on reset",
109-
examples: ["npm install"],
117+
commands: {
118+
$ref: "#/definitions/command_array",
119+
},
120+
vscodeCommands: {
121+
$ref: "#/definitions/vscode_command_array",
110122
},
111123
},
112124
additionalProperties: false,

Diff for: tests/parse.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ Description.
999999
branch: "aBranch",
10001000
},
10011001
reset: {
1002-
command: "some command",
1002+
commands: ["some command"],
10031003
},
10041004
dependencies: [
10051005
{
@@ -1035,7 +1035,7 @@ Description.
10351035
branch: "aBranch",
10361036
},
10371037
reset: {
1038-
command: "some command",
1038+
commands: ["some command"],
10391039
},
10401040
dependencies: [
10411041
{

0 commit comments

Comments
 (0)