@trops/dash-check 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +309 -2
- package/cli/bin.js +12 -0
- package/cli/index.d.ts +7 -0
- package/cli/index.js +566 -0
- package/examples/changes-match-plan.bad.json +4 -0
- package/examples/changes-match-plan.check.js +10 -0
- package/examples/changes-match-plan.sample.json +4 -0
- package/examples/every-acceptance-has-a-test.bad.json +3 -0
- package/examples/every-acceptance-has-a-test.check.js +19 -0
- package/examples/every-acceptance-has-a-test.sample.json +3 -0
- package/examples/helpers/changelog.js +23 -0
- package/examples/jira-comment-from-job.bad.json +5 -0
- package/examples/jira-comment-from-job.check.js +10 -0
- package/examples/jira-comment-from-job.sample.json +5 -0
- package/examples/merge-outcome.bad.json +4 -0
- package/examples/merge-outcome.check.js +9 -0
- package/examples/merge-outcome.sample.json +4 -0
- package/examples/on-branch.bad.json +6 -0
- package/examples/on-branch.check.js +12 -0
- package/examples/on-branch.sample.json +6 -0
- package/examples/plan-complete.bad.json +5 -0
- package/examples/plan-complete.check.js +14 -0
- package/examples/plan-complete.sample.json +5 -0
- package/examples/pr-ci.bad.json +4 -0
- package/examples/pr-ci.check.js +12 -0
- package/examples/pr-ci.sample.json +4 -0
- package/examples/ready-for-review.bad.json +6 -0
- package/examples/ready-for-review.check.json +12 -0
- package/examples/ready-for-review.sample.json +6 -0
- package/examples/setup.bad.json +6 -0
- package/examples/setup.check.js +8 -0
- package/examples/setup.sample.json +6 -0
- package/examples/ticket-has-acceptance.bad.json +4 -0
- package/examples/ticket-has-acceptance.check.js +10 -0
- package/examples/ticket-has-acceptance.sample.json +4 -0
- package/examples/validate.bad.json +6 -0
- package/examples/validate.check.js +14 -0
- package/examples/validate.sample.json +6 -0
- package/examples/work-committed.bad.json +13 -0
- package/examples/work-committed.check.js +13 -0
- package/examples/work-committed.sample.json +5 -0
- package/examples/workspace-cleaned.bad.json +4 -0
- package/examples/workspace-cleaned.check.js +7 -0
- package/examples/workspace-cleaned.sample.json +4 -0
- package/helpers/commands.js +62 -0
- package/helpers/files.js +74 -0
- package/helpers/git.js +116 -0
- package/helpers/github.js +77 -0
- package/helpers/handoff.js +80 -0
- package/helpers/index.d.ts +15 -0
- package/helpers/index.js +36 -0
- package/helpers/node.js +106 -0
- package/helpers/plan.js +55 -0
- package/helpers/tracker.js +60 -0
- package/index.d.ts +325 -0
- package/index.js +86 -0
- package/lib/adapters/fs.js +85 -0
- package/lib/adapters/git.js +87 -0
- package/lib/adapters/github.js +151 -0
- package/lib/adapters/run.js +76 -0
- package/lib/adapters/tool.js +64 -0
- package/lib/context.js +102 -0
- package/lib/discover.js +102 -0
- package/lib/expect.js +238 -0
- package/lib/glob.js +89 -0
- package/lib/handoff.js +68 -0
- package/lib/helper.js +219 -0
- package/lib/register.js +35 -0
- package/lib/runner.js +214 -0
- package/lib/scope.js +107 -0
- package/lib/util.js +122 -0
- package/lib/values.js +138 -0
- package/package.json +59 -4
- package/recipe/index.d.ts +70 -0
- package/recipe/index.js +381 -0
- package/recipe/schema.json +55 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://github.com/trops/dash-check/recipe/schema.json",
|
|
4
|
+
"title": "dash-check recipe",
|
|
5
|
+
"description": "A check made of steps: helpers (use) and value expectations (expect). It holds no code, so it is safe to store on a bot, share and edit in a UI.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["name", "steps"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"$schema": { "type": "string" },
|
|
11
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 200, "description": "What the check proves" },
|
|
12
|
+
"description": { "type": "string", "maxLength": 2000 },
|
|
13
|
+
"version": { "type": "integer", "minimum": 1, "description": "The recipe format's version (1)" },
|
|
14
|
+
"steps": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"minItems": 1,
|
|
17
|
+
"maxItems": 100,
|
|
18
|
+
"items": { "oneOf": [{ "$ref": "#/definitions/useStep" }, { "$ref": "#/definitions/expectStep" }] }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"definitions": {
|
|
22
|
+
"when": {
|
|
23
|
+
"type": ["string", "boolean"],
|
|
24
|
+
"description": "Run the step only when this is truthy: a value path (handoff.prUrl) or a placeholder ({mergeWhenGreen}); a leading ! turns it around"
|
|
25
|
+
},
|
|
26
|
+
"message": { "type": "string", "maxLength": 2000, "description": "What a failure says instead (the fix)" },
|
|
27
|
+
"label": { "type": "string", "maxLength": 200, "description": "The row's own name (default: the helper's label)" },
|
|
28
|
+
"useStep": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": ["use"],
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"properties": {
|
|
33
|
+
"use": { "type": "string", "pattern": "^[a-z][A-Za-z0-9]*(\\.[a-z][A-Za-z0-9]*)+$", "description": "A helper's id, e.g. git.committedSince" },
|
|
34
|
+
"with": { "type": "object", "description": "The helper's params; strings can hold {placeholders} from settings, item and row" },
|
|
35
|
+
"when": { "$ref": "#/definitions/when" },
|
|
36
|
+
"message": { "$ref": "#/definitions/message" },
|
|
37
|
+
"label": { "$ref": "#/definitions/label" }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"expectStep": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"required": ["expect", "matcher"],
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"properties": {
|
|
45
|
+
"expect": { "type": "string", "pattern": "^[A-Za-z_$][\\w$-]*(\\.[\\w$-]+)*$", "description": "A value by path: handoff.files, item.id, env.DASH_BRANCH, repo.baseBranch" },
|
|
46
|
+
"matcher": { "type": "string", "pattern": "^to[A-Z][A-Za-z0-9]*$", "description": "A matcher's id, e.g. toHaveLengthAtLeast" },
|
|
47
|
+
"args": { "type": "array", "description": "The matcher's params, in order; strings can hold {placeholders}" },
|
|
48
|
+
"not": { "type": "boolean", "description": "Expect the opposite" },
|
|
49
|
+
"when": { "$ref": "#/definitions/when" },
|
|
50
|
+
"message": { "$ref": "#/definitions/message" },
|
|
51
|
+
"label": { "$ref": "#/definitions/label" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|