Skip to content

Commit

Permalink
fix: binary building (#113)
Browse files Browse the repository at this point in the history
Can now build binaries via `yarn build.binary`.
  • Loading branch information
P0lip authored and Marc MacLeod committed Mar 28, 2019
1 parent d588f62 commit d6e0f2d
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 42 deletions.
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,50 @@ A flexible JSON object linter with out of the box support for OpenAPI v2 and v3

## Installation

```shell
### Local Installation

```bash
npm install @stoplight/spectral
```

### Global Installation

```bash
npm install -g @stoplight/spectral
```

Supports Node v8.3+.

### Executable binaries

For users without Node and/or NPM/Yarn, we provide standalone packages for all major platforms:

- x64 Windows
- x64 MacOS
- x64 Linux

You can find them [here](https://github.com/stoplightio/spectral/releases).
Once downloaded, you can proceed with the standard procedure for running any CLI tool.

```bash
./spectral-macos lint petstore.yaml
```

Note, the binaries are *not* auto-updatable, therefore you will need to download a new version on your own.

#### Installing binaries system-wide

##### Linux

```bash
sudo mv ./spectral-linux /usr/local/bin/spectral
```

You may need to restart your terminal.
Now, `spectral` command will be accessible in your terminal.

Head over to [releases](https://github.com/stoplightio/spectral/releases) for the latest binaries.

## Usage

### CLI
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
},
"scripts": {
"build": "sl-scripts build && oclif-dev manifest && node ./scripts/prepare-cli",
"build.binary": "yarn build && cp yarn.lock dist && cd dist && yarn && pkg . --out-path ./bin",
"build.docs": "sl-scripts build:typedoc",
"commit": "git-cz",
"lint": "tslint 'src/**/*.ts'",
Expand All @@ -54,14 +55,15 @@
},
"dependencies": {
"@oclif/command": "^1.0",
"@oclif/config": "^1.12.11",
"@oclif/plugin-help": "^2.0",
"@stoplight/json": "^1.8.0",
"@stoplight/json-ref-resolver": "^1.2.2",
"@stoplight/types": "^4.0.0",
"@stoplight/yaml": "^2.1.1",
"ajv": "6.x.x",
"chalk": "^2.4.2",
"jsonpath": "https://github.com/stoplightio/jsonpath#78140eb1980d4ff385780e2fa12177735685ec3e",
"jsonpath": "https://github.com/stoplightio/jsonpath#f1c0e9e634da2d45671b7639fa0a99afc807da17",
"lodash": ">=4.17.5",
"node-fetch": "2.x.x",
"strip-ansi": "^5.2.0",
Expand All @@ -81,6 +83,7 @@
"fs-extra": "^7.0.1",
"jest": "24.5.x",
"nock": "^10.0.6",
"pkg": "4.3.7",
"ts-jest": "24.0.x",
"tslint": "5.14.0",
"tslint-config-stoplight": "1.2.0",
Expand Down Expand Up @@ -110,5 +113,10 @@
},
"release": {
"extends": "@stoplight/scripts/release"
},
"pkg": {
"scripts": [
"cli/**/*.js"
]
}
}
Loading

0 comments on commit d6e0f2d

Please sign in to comment.