File tree Expand file tree Collapse file tree 3 files changed +195
-42
lines changed Expand file tree Collapse file tree 3 files changed +195
-42
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,50 @@ A flexible JSON object linter with out of the box support for OpenAPI v2 and v3
16
16
17
17
## Installation
18
18
19
- ``` shell
19
+ ### Local Installation
20
+
21
+ ``` bash
20
22
npm install @stoplight/spectral
21
23
```
22
24
25
+ ### Global Installation
26
+
27
+ ``` bash
28
+ npm install -g @stoplight/spectral
29
+ ```
30
+
23
31
Supports Node v8.3+.
24
32
33
+ ### Executable binaries
34
+
35
+ For users without Node and/or NPM/Yarn, we provide standalone packages for all major platforms:
36
+
37
+ - x64 Windows
38
+ - x64 MacOS
39
+ - x64 Linux
40
+
41
+ You can find them [ here] ( https://github.com/stoplightio/spectral/releases ) .
42
+ Once downloaded, you can proceed with the standard procedure for running any CLI tool.
43
+
44
+ ``` bash
45
+ ./spectral-macos lint petstore.yaml
46
+ ```
47
+
48
+ Note, the binaries are * not* auto-updatable, therefore you will need to download a new version on your own.
49
+
50
+ #### Installing binaries system-wide
51
+
52
+ ##### Linux
53
+
54
+ ``` bash
55
+ sudo mv ./spectral-linux /usr/local/bin/spectral
56
+ ```
57
+
58
+ You may need to restart your terminal.
59
+ Now, ` spectral ` command will be accessible in your terminal.
60
+
61
+ Head over to [ releases] ( https://github.com/stoplightio/spectral/releases ) for the latest binaries.
62
+
25
63
## Usage
26
64
27
65
### CLI
Original file line number Diff line number Diff line change 40
40
},
41
41
"scripts" : {
42
42
"build" : " sl-scripts build && oclif-dev manifest && node ./scripts/prepare-cli" ,
43
+ "build.binary" : " yarn build && cp yarn.lock dist && cd dist && yarn && pkg . --out-path ./bin" ,
43
44
"build.docs" : " sl-scripts build:typedoc" ,
44
45
"commit" : " git-cz" ,
45
46
"lint" : " tslint 'src/**/*.ts'" ,
54
55
},
55
56
"dependencies" : {
56
57
"@oclif/command" : " ^1.0" ,
58
+ "@oclif/config" : " ^1.12.11" ,
57
59
"@oclif/plugin-help" : " ^2.0" ,
58
60
"@stoplight/json" : " ^1.8.0" ,
59
61
"@stoplight/json-ref-resolver" : " ^1.2.2" ,
60
62
"@stoplight/types" : " ^4.0.0" ,
61
63
"@stoplight/yaml" : " ^2.1.1" ,
62
64
"ajv" : " 6.x.x" ,
63
65
"chalk" : " ^2.4.2" ,
64
- "jsonpath" : " https://github.com/stoplightio/jsonpath#78140eb1980d4ff385780e2fa12177735685ec3e " ,
66
+ "jsonpath" : " https://github.com/stoplightio/jsonpath#f1c0e9e634da2d45671b7639fa0a99afc807da17 " ,
65
67
"lodash" : " >=4.17.5" ,
66
68
"node-fetch" : " 2.x.x" ,
67
69
"strip-ansi" : " ^5.2.0" ,
81
83
"fs-extra" : " ^7.0.1" ,
82
84
"jest" : " 24.5.x" ,
83
85
"nock" : " ^10.0.6" ,
86
+ "pkg" : " 4.3.7" ,
84
87
"ts-jest" : " 24.0.x" ,
85
88
"tslint" : " 5.14.0" ,
86
89
"tslint-config-stoplight" : " 1.2.0" ,
110
113
},
111
114
"release" : {
112
115
"extends" : " @stoplight/scripts/release"
116
+ },
117
+ "pkg" : {
118
+ "scripts" : [
119
+ " cli/**/*.js"
120
+ ]
113
121
}
114
122
}
You can’t perform that action at this time.
0 commit comments