@usearazzo/cli 1.0.1-alpha.10 → 1.0.1-alpha.12

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.
Files changed (2) hide show
  1. package/README.md +22 -54
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -16,79 +16,47 @@
16
16
 
17
17
  ---
18
18
 
19
- ## What it does
19
+ ## Get started
20
20
 
21
- This package puts the toolkit behind a single `usearazzo` binary. Its one command today is `validate`, a thin wrapper around [@usearazzo/validator](https://github.com/usearazzo/arazzo-toolkit/tree/main/packages/validator#readme): it checks an Arazzo document, local file or remote URL, and prints every problem with the location that caused it.
22
-
23
- ## Installation
24
-
25
- ```sh
26
- npm install --global @usearazzo/cli
27
- ```
28
-
29
- Or run it without installing:
21
+ Validate an Arazzo document. Nothing to install:
30
22
 
31
23
  ```sh
32
24
  npx @usearazzo/cli validate adopt-a-pet.arazzo.yaml
33
25
  ```
34
26
 
35
- Requires Node.js 20.10 or newer.
27
+ <a href="https://usearazzo.com/cli/"><img alt="usearazzo validate reporting two duplicate stepId errors in one Arazzo document and a missing step description warning in another, each with its line range and rule code" src="https://raw.githubusercontent.com/usearazzo/arazzo-toolkit/main/packages/cli/assets/validate-demo.svg"></a>
36
28
 
37
- ## Usage
29
+ The argument is a path, a `file:` URI, or an HTTP(S) URL. Every problem comes with the line range that caused it and the code of the rule it broke.
38
30
 
39
- ```console
40
- $ usearazzo validate adopt-a-pet.arazzo.yaml
41
- adopt-a-pet.arazzo.yaml
42
- 2:1-2:5 error 9010300 should always have a 'version'
43
- 2:1-2:5 warning 9010101 Info 'description' should be present and non-empty string.
44
- 2:1-2:5 hint 9010401 Info 'summary' is recommended to be present and a non-empty string.
45
- 9:5-18:1 hint 9040203 Workflow 'summary' is recommended to be present and a non-empty string.
46
- 12:9-18:1 warning 9050201 Step 'description' should be present and non-empty string.
47
- 17:21-17:29 error 9070401 Success action "stepId" must reference an existing step in the same workflow.
31
+ Prefer a global install?
48
32
 
49
- ✖ 6 problems (2 errors, 2 warnings, 2 hints)
33
+ ```sh
34
+ npm install --global @usearazzo/cli
35
+ usearazzo --help
50
36
  ```
51
37
 
52
- The argument is a path, a `file:` URI, or an HTTP(S) URL. Relative source descriptions resolve against the document's location.
53
-
54
- | Option | Description |
55
- |---|---|
56
- | `-f, --format <format>` | Output format: `stylish` (default) or `json` |
57
- | `--json` | Shorthand for `--format json` |
58
- | `-o, --output <file>` | Write the report to a file instead of stdout. Never the input document |
59
- | `-c, --config <file>` | Configuration file. Defaults to the first [configuration file](#configuration-file) found in the current working directory |
60
- | `--json-schema-validation` | Also run JSON Schema validation (off by default) |
61
- | `--max-problems <n>` | Report at most `n` problems. The exit code still counts all of them |
62
- | `--fail-severity <severity>` | Lowest severity that fails the run: `error` (default), `warning`, `info`, `hint` |
63
-
64
- ### Exit codes
38
+ Requires Node.js 20.10 or newer.
65
39
 
66
- - `0`: no problem at or above `--fail-severity`.
67
- - `1`: at least one problem at or above `--fail-severity`, or the document, the configuration file, or the output file could not be read or written. The reason goes to stderr.
40
+ ## Commands
68
41
 
69
- ## Configuration file
42
+ | Command | What it does |
43
+ | :------ | :----------- |
44
+ | [`validate`](https://usearazzo.com/docs/cli/#validate) | Validate and lint an Arazzo 1.0.x or 1.1.0 document, from a file or a URL. Wraps [@usearazzo/validator](https://github.com/usearazzo/arazzo-toolkit/tree/main/packages/validator#readme). |
70
45
 
71
- `usearazzo` looks for a configuration file in the current working directory, the way Spectral looks for its ruleset. The first match among `.usearazzo.yaml`, `.usearazzo.yml`, `.usearazzo.json`, `usearazzo.yaml`, `usearazzo.yml` and `usearazzo.json` wins; parent directories are not searched. `--config` points at any other file, relative to the current working directory.
46
+ Built for CI: the exit code gates on a severity you choose (`--fail-severity`), and problems are available as JSON (`--format json`). Settings can live in a `.usearazzo.yaml` or `.usearazzo.json` file in the working directory.
72
47
 
73
- The file is YAML or JSON. Its `languageService` key is the [SpecLynx ApiDOM Language Service](https://www.npmjs.com/package/@speclynx/api-languageservice) context that `@usearazzo/validator` takes, deep-merged over the validator's defaults:
48
+ ## Documentation
74
49
 
75
- ```yaml
76
- languageService:
77
- validationContext:
78
- jsonSchemaValidation: true # default: false
79
- semanticValidation: true # default: true
80
- referenceValidation: true # default: true
81
- semanticLinting: true # default: true
82
- parseContext:
83
- arazzo:
84
- sourceDescriptionsResolution: true # fetch and parse source descriptions (default: true)
85
- ```
50
+ Every option is documented on [usearazzo.com](https://usearazzo.com/) and in `usearazzo <command> --help`:
86
51
 
87
- Command-line flags win over the configuration file, and the configuration file wins over the validator's defaults.
52
+ - **[UseArazzo CLI](https://usearazzo.com/cli/)** introduces the CLI: what it does in a terminal and in CI. Start here when you are deciding whether it fits.
53
+ - **[CLI Reference](https://usearazzo.com/docs/cli/)** covers every command and option, both output formats, the exit codes, the configuration file, and running in CI. Start here when you know what you want to run.
88
54
 
89
- ## Documentation
55
+ ## Supported versions
90
56
 
91
- See the [@usearazzo/validator README](https://github.com/usearazzo/arazzo-toolkit/tree/main/packages/validator#readme) for what is checked, and the [Validator API Reference](https://usearazzo.com/docs/validator/) for every diagnostic code and rule.
57
+ - [Arazzo 1.0.0](https://spec.openapis.org/arazzo/v1.0.0)
58
+ - [Arazzo 1.0.1](https://spec.openapis.org/arazzo/v1.0.1)
59
+ - [Arazzo 1.1.0](https://spec.openapis.org/arazzo/v1.1.0)
92
60
 
93
61
  ## Part of the Arazzo Toolkit
94
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usearazzo/cli",
3
- "version": "1.0.1-alpha.10",
3
+ "version": "1.0.1-alpha.12",
4
4
  "description": "Command-line interface for Arazzo documents: validate and lint from your terminal or CI/CD pipeline.",
5
5
  "keywords": [
6
6
  "arazzo",
@@ -48,7 +48,7 @@
48
48
  "license": "Apache-2.0",
49
49
  "dependencies": {
50
50
  "@babel/runtime-corejs3": "^8.0.6",
51
- "@usearazzo/validator": "1.0.1-alpha.10",
51
+ "@usearazzo/validator": "1.0.1-alpha.12",
52
52
  "chalk": "^5.6.2",
53
53
  "commander": "^14.0.3",
54
54
  "ramda-adjunct": "^6.1.0",
@@ -62,5 +62,5 @@
62
62
  "NOTICE",
63
63
  "README.md"
64
64
  ],
65
- "gitHead": "b940d0343c00a30130ca1926479651bd45ee4bdb"
65
+ "gitHead": "cc5d9b2fb744662650068a5993ebcdd19e8568c2"
66
66
  }