Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

## Installation

After cloning this repo...
Install command-line dependencies:

```shell
npm i && npm install -g swagger-repo && npm install -g redoc-cli
npm run cleanBuildPackage
npm install -g @redocly/openapi-cli && npm install -g redoc-cli
```

Install CLI:

```shell
npm install -g gh-openapi-docs
```

## Set up
Expand Down Expand Up @@ -37,7 +42,7 @@ Where `branchPath` is the repo root if the current branch is `master`, otherwise
Run the command...

```shell
./bin/gh-openapi-docs
gh-openapi-docs
```

You should see console logs that look like this:
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@
"update-notifier": "3.0.1",
"yargs-parser": "15.0.0"
},
"bin": "./dist/gh-openapi-docs.js",
"bin": "./dist/bundle.js",
"main": "./src/lib/index.js",
"scripts": {
"fetch": "node src/fetchpages.js",
"build:swagger": "node src/swagger-ui.js",
"build:redoc": "node src/redoc-ui.js",
"clean": "rm -rf dist/* bin/*",
"build": "npx webpack --mode=development",
"package": "npx pkg -o ./bin/gh-openapi-docs .",
"cleanBuild": "npm run clean && npm run build",
"cleanBuildPackage": "npm run cleanBuild && npm run package",
"prepublish": "npm run cleanBuildPackage"
"prepublish": "npm run cleanBuild"
},
"devDependencies": {
"@babel/core": "^7.8.7",
Expand All @@ -40,7 +39,6 @@
"@babel/polyfill": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"babel-loader": "^8.0.6",
"pkg": "^4.4.4",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.10"
}
Expand Down
9 changes: 7 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const path = require('path');
const webpack = require('webpack');

module.exports = {
target: "node",
entry: {
'gh-openapi-docs': './src/gh-openapi-docs.js'
},
output: {
path: path.resolve(__dirname, 'dist')
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
resolve: {
modules: [
Expand All @@ -32,5 +34,8 @@ module.exports = {
}
}
]
}
},
plugins: [
new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true })
]
}