diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index ea300447b2..4fc74cc8d2 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Redoc Contributing Guide
-Hi! We're really excited that you are interested in contributing to Redoc. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.
+Hi! We're really excited that you are interested in contributing to ReDoc. This is the wrong place to do that if you don't work at Bandwidth :). Please contribute to [Redocly/redoc](https://github.com/Redocly/redoc) instead. If you are from Bandwidth, before submitting your contribution, please make sure to take a moment and read through the following guidelines.
- [Redoc Contributing Guide](#redoc-contributing-guide)
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index ac93ae372f..a906281aa6 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -1,8 +1,9 @@
name: Publish Package to NPM on Release
on:
- push:
- branches: [main]
+ release:
+ types:
+ - published
jobs:
bundle:
@@ -23,8 +24,13 @@ jobs:
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-
- - run: npm ci
- - run: npm run bundle
+
+ - name: Clean Install
+ run: npm ci
+
+ - name: Bundle
+ run: npm run bundle
+
- name: Store bundle artifact
uses: actions/upload-artifact@v4
with:
@@ -36,43 +42,38 @@ jobs:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - run: npm ci
- - run: npm test
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Clean Install
+ run: npm ci
+
+ - name: Unit Test
+ run: npm test
+
e2e-tests:
name: E2E Tests
needs: [bundle]
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - run: npm ci
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Clean Install
+ run: npm ci
+
- name: Download bundled artifact
uses: actions/download-artifact@v4
with:
name: bundles
path: bundles
- - run: npm run e2e
- check-version:
- name: Check Version
- runs-on: ubuntu-latest
- needs: [bundle, unit-tests, e2e-tests]
- outputs:
- changed: ${{ steps.check.outputs.changed }}
- steps:
- - name: Checkout repository
- uses: actions/checkout@v3
- - name: Set up Node.js
- uses: actions/setup-node@v3
- - name: Check if version has been updated
- id: check
- uses: EndBug/version-check@v2.0.1
- with:
- file-url: https://cdn.jsdelivr.net/npm/redoc/package.json
- static-checking: localIsNew
+
+ - name: E2E Test
+ run: npm run e2e
+
publish:
- name: Publish to NPM
- needs: [check-version]
- if: needs.check-version.outputs.changed == 'true'
+ name: Publish
+ needs: [unit-tests, e2e-tests]
runs-on: ubuntu-latest
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
steps:
@@ -105,41 +106,72 @@ jobs:
- name: Before deploy
run: npm ci && npm run declarations
- publish-cdn:
- name: Publish to CDN
- needs: [check-version]
- if: needs.check-version.outputs.changed == 'true'
+ - name: Publish npm Package
+ run: |
+ npm version $RELEASE_VERSION --no-git-tag-version
+ npm publish --access public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
+
+ publish-beta:
+ name: Publish Beta to NPM
+ needs: [unit-tests, e2e-tests]
runs-on: ubuntu-latest
+ if: ${{ github.event.release.prerelease }}
steps:
- - name: Checkout repository
- uses: actions/checkout@v3
- - name: Configure AWS
- uses: aws-actions/configure-aws-credentials@v1
+ - name: Check Branch Name Format
+ run: |
+ re=v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+
+ if ! [[ ${{ github.event.release.target_commitish }} =~ $re ]]; then
+ echo "Target branch does not match expected regex pattern for beta releases ($re)."
+ echo "${{ github.event.release.target_commitish }}"
+ echo "Please update your branch name to match the expected regex pattern."
+ exit 1
+ fi
+
+ - name: Set Release Version
+ run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
+
+ - name: Check Release Version Format
+ run: |
+ re=[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+
+ if ! [[ $RELEASE_VERSION =~ $re ]]; then
+ echo "Tag does not match expected regex pattern for beta releases (v$re)."
+ echo $RELEASE_VERSION
+ echo "Please update your tag to match the expected regex pattern."
+ exit 1
+ fi
+
+ - name: Setup Node
+ uses: actions/setup-node@v4
with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- aws-region: us-east-1
- - name: Download all artifact
- uses: actions/download-artifact@v3
- - name: Publish to S3
- run: npm run publish-cdn
-
- invalidate-cache:
- name: Clear cache
- runs-on: ubuntu-latest
- needs: [check-version, publish, publish-cdn]
- if: needs.check-version.outputs.changed == 'true'
- steps:
- - name: Checkout repository
- uses: actions/checkout@v3
- - name: Configure AWS
- uses: aws-actions/configure-aws-credentials@v1
+ node-version: '18.x'
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Download bundled artifacts
+ uses: actions/download-artifact@v4
with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- aws-region: us-east-1
- - name: Invalidate cache
- run: ./scripts/invalidate-cache.sh
- shell: bash
+ name: bundles
+ path: bundles
+
+ - name: Cache node modules
+ uses: actions/cache@v4
+ 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: Before deploy
+ run: npm ci && npm run declarations
+
+ - name: Publish npm Package
+ run: |
+ npm version $RELEASE_VERSION --no-git-tag-version
+ npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
diff --git a/README.md b/README.md
index cf1612aba1..543f98a10c 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
-# Generate beautiful API documentation from OpenAPI
+## Generate beautiful API documentation from OpenAPI
[![npm](http://img.shields.io/npm/v/redoc.svg)](https://www.npmjs.com/package/redoc) [![License](https://img.shields.io/npm/l/redoc.svg)](https://github.com/Redocly/redoc/blob/main/LICENSE)
diff --git a/docs/deployment/intro.md b/docs/deployment/intro.md
index e80b0a0daf..02aa53448f 100644
--- a/docs/deployment/intro.md
+++ b/docs/deployment/intro.md
@@ -104,7 +104,7 @@ npm install -g http-server
Then, `cd` into your project directory and run the following command:
```node
-http-server
+http - server;
```
The output after entering the command provides the local URL where the preview can be accessed.
diff --git a/e2e/integration/menu.e2e.ts b/e2e/integration/menu.e2e.ts
index 61dcf1d677..c999b3f75c 100644
--- a/e2e/integration/menu.e2e.ts
+++ b/e2e/integration/menu.e2e.ts
@@ -7,43 +7,6 @@ describe('Menu', () => {
cy.get('.menu-content').find('li').should('have.length', 35);
});
- it('should sync active menu items while scroll', () => {
- cy.contains('h2', 'Introduction')
- .scrollIntoView()
- .get('[role=menuitem] > label.active')
- .should('have.text', 'Introduction');
-
- cy.contains('h2', 'Add a new pet to the store')
- .scrollIntoView()
- .wait(100)
- .get('[role=menuitem] > label.active')
- .children()
- .last()
- .should('have.text', 'Add a new pet to the store')
- .should('be.visible');
- });
-
- it('should sync active menu items while scroll back and scroll again', () => {
- cy.contains('h2', 'Add a new pet to the store')
- .scrollIntoView()
- .wait(100)
- .get('[role=menuitem] > label.active')
- .children()
- .last()
- .should('have.text', 'Add a new pet to the store')
- .should('be.visible');
-
- cy.contains('h1', 'Swagger Petstore').scrollIntoView().wait(100);
-
- cy.contains('h2', 'Introduction')
- .scrollIntoView()
- .wait(100)
- .get('[role=menuitem] > label.active')
- .should('have.text', 'Introduction');
-
- cy.url().should('include', '#section/Introduction');
- });
-
it('should update URL hash when clicking on menu items', () => {
cy.contains('[role=menuitem] > label.-depth1', 'pet').click({ force: true });
cy.get('li[data-item-id="schema/Cat"]')
diff --git a/package-lock.json b/package-lock.json
index 5c78b96318..fab4e016c0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
- "name": "redoc",
- "version": "2.2.0",
+ "name": "bandwidth-redoc",
+ "version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "name": "redoc",
- "version": "2.2.0",
+ "name": "bandwidth-redoc",
+ "version": "0.1.0",
"license": "MIT",
"dependencies": {
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
@@ -15867,6 +15867,7 @@
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
+ "isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
@@ -17942,9 +17943,9 @@
}
},
"node_modules/tslib": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
- "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA=="
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
+ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"node_modules/tsutils": {
"version": "3.21.0",
@@ -30934,6 +30935,7 @@
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
+ "isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
@@ -32503,9 +32505,9 @@
}
},
"tslib": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz",
- "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA=="
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
+ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
},
"tsutils": {
"version": "3.21.0",
diff --git a/package.json b/package.json
index c87eb08624..551d6aaa12 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
- "name": "redoc",
- "version": "2.2.0",
- "description": "ReDoc",
+ "name": "bandwidth-redoc",
+ "version": "0.1.0",
+ "description": "Bandwidth ReDoc Fork",
"repository": {
"type": "git",
"url": "git://github.com/Bandwidth/redoc"
diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx
index 96eca64648..b71dc81bfa 100644
--- a/src/components/Endpoint/Endpoint.tsx
+++ b/src/components/Endpoint/Endpoint.tsx
@@ -48,7 +48,7 @@ export class Endpoint extends React.Component
https://gitlab.com/.well-known/openid-configuration
basic
write:pets
read:pets
) Get access to data while protecting your account credentials. +"
write:pets
read:pets
) Get access to data while protecting your account credentials. OAuth2 is also a safer and more secure way to give you access.
implicit
http://petstore.swagger.io/api/oauth/dialog
write:pets
read:pets
write:pets
- modify pets in your account
read:pets
- read your pets
-GitLab Personal Access Token description
-PRIVATE-TOKEN
GitLab OpenIdConnect description
-https://gitlab.com/.well-known/openid-configuration
basic
GitLab Personal Access Token description
+PRIVATE-TOKEN
GitLab OpenIdConnect description
+https://gitlab.com/.well-known/openid-configuration
basic