Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use prettier more #1109

Merged
merged 3 commits into from
May 31, 2023
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
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Hi! We're really excited that you are interested in contributing to Redocly CLI.
- Abide by our [Code of Conduct](https://redocly.com/code-of-conduct/) in all your interactions on this repository, and show patience and respect to other community members.

## Pull Request Guidelines

Before submitting a pull request, please make sure the following is done:

1. Fork the repository and create your branch from `main`.
Expand All @@ -38,7 +39,7 @@ $ npm install # or npm i

### Commonly used NPM scripts

``` bash
```bash
# run a separate CLI command
$ npm run <command>

Expand Down
9 changes: 8 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,41 @@ about: Create a report to help us improve
title: ''
labels: 'Type: Bug'
assignees: ''

---

**Describe the bug**

<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
Steps to reproduce the behavior:

1. Given this `redocly.yaml` file
2. And this OpenAPI file(s)
3. Run this command with these arguments... `redocly ...`
4. See error

**Expected behavior**

<!-- A clear and concise description of what you expected to happen. -->

**Logs**

<!-- If applicable, add logs to help explain your problem. -->

**OpenAPI definition**

<!-- If applicable, add an OpenAPI definition and `.redocly.yaml` configuration file that helps reproduce the problem.
At a minimum, please state the specification version(s) you're using (e.g. 2.0, 3.0, 3.1). -->

**Redocly Version(s)**

<!-- What version of Redocly CLI are you using? -->

**`Node.js` Version(s)**

<!-- What version of `node.js` are you using? -->

**Additional context**

<!-- Add any other context about the problem here. -->
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ about: Suggest an idea for this project
title: ''
labels: 'Type: Enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**

<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**

<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**

<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**

<!-- Add any other context or screenshots about the feature request here. -->
48 changes: 24 additions & 24 deletions .github/workflows/deploy-s3-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ jobs:
if: ${{ github.event.label.name == 'deploy_s3_sandbox' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: node --version
- run: npm --version
- name: cache node modules
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-
- uses: actions/checkout@v3
- run: node --version
- run: npm --version
- name: cache node modules
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-

- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test

- name: Bundle into single file
run: npm run webpack-bundle
- name: Bundle into single file
run: npm run webpack-bundle

- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
80 changes: 40 additions & 40 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,60 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci

- name: Bundle into single file
run: npm run webpack-bundle
- name: Bundle into single file
run: npm run webpack-bundle

- name: Upload to AWS S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: openapi-cli-dist
- name: Upload to AWS S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: openapi-cli-dist

- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
publish:
needs: [test, deploy]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- run: npm ci
- run: npm ci

- name: Publish to NPM
run: cd packages/core && npm publish && cd ../cli && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to NPM
run: cd packages/core && npm publish && cd ../cli && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
dockerhub:
needs: [publish]
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dist/
packages/cli/lib/
packages/core/lib/
*snapshot.js
packages/core/src/rules/__tests__/fixtures/invalid-yaml.yaml
resources/output/invalid.json
__tests__/webpack-bundle/bundle-workflows/metafile.json
12 changes: 6 additions & 6 deletions __tests__/bundle/bundle-anchor/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ paths:
main_data:
$anchor: main_data
type: object
properties:
properties:
foo:
type: string
type: object
oneOf:
- properties:
wrapper:
$ref: '#main_data'
- $ref: '#main_data'
example:
- properties:
wrapper:
$ref: '#main_data'
- $ref: '#main_data'
example:
foo: TEST
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "string"
}
{ 'type': 'string' }
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "string"
}
{ 'type': 'string' }
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "string"
}
{ 'type': 'string' }
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "string"
}
{ 'type': 'string' }
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "string"
}
{ 'type': 'string' }
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"type": "string"
}
{ 'type': 'string' }
4 changes: 2 additions & 2 deletions __tests__/join/decorate/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ paths:
get:
summary: Get user by ID
responses:
"200":
'200':
description: OK
"404":
'404':
description: Not found
4 changes: 2 additions & 2 deletions __tests__/join/decorate/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ paths:
x-private: true
summary: Get an order by ID for a specific user
responses:
"200":
'200':
description: OK
"404":
'404':
description: Not found
2 changes: 1 addition & 1 deletion __tests__/join/fails-if-no-info-section/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ paths:
operationId: exampleBar
responses:
'201':
description: example description
description: example description
2 changes: 1 addition & 1 deletion __tests__/join/fails-if-no-info-section/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ paths:
format: int
responses:
'200':
description: example description
description: example description
4 changes: 2 additions & 2 deletions __tests__/join/ignore-decorators/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ paths:
get:
summary: Get user by ID
responses:
"200":
'200':
description: OK
"404":
'404':
description: Not found
4 changes: 2 additions & 2 deletions __tests__/join/ignore-decorators/foo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ paths:
x-private: true
summary: Get an order by ID for a specific user
responses:
"200":
'200':
description: OK
"404":
'404':
description: Not found
4 changes: 2 additions & 2 deletions __tests__/join/multiple-tags-in-same-files/bar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ paths:

'/dog/{dogId}':
post:
tags:
- Dog
tags:
- Dog
summary: Dog example
operationId: exampleDogId
responses:
Expand Down
6 changes: 3 additions & 3 deletions __tests__/join/prefix-tags-with-filename/bar.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
tags:
tags:
- name: Pet
description: Pet Discription
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
Expand All @@ -18,4 +18,4 @@ paths:
operationId: exampleBar
responses:
'201':
description: example description
description: example description
6 changes: 3 additions & 3 deletions __tests__/join/prefix-tags-with-filename/foo.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
tags:
tags:
- name: Pet
description: Pet Discription
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
Expand All @@ -26,4 +26,4 @@ paths:
format: int
responses:
'200':
description: example description
description: example description
Loading
Loading