Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: swagger-api/swagger-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 77f4651cbf5b3767f0d79c91fd337de82b6ddee6
Choose a base ref
...
head repository: swagger-api/swagger-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2879773f3f7f8f63d7b5cdf589b2356a8d83f3e5
Choose a head ref
Loading
Showing 405 changed files with 59,741 additions and 25,857 deletions.
46 changes: 0 additions & 46 deletions .babelrc

This file was deleted.

25 changes: 25 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"header-max-length": [
2,
"always",
69
],
"scope-case": [
2,
"always",
[
"camel-case",
"kebab-case",
"upper-case"
]
],
"subject-case": [
0,
"always"
]
}
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
parser: babel-eslint
parser: "@babel/eslint-parser"
env:
browser: true
node: true
es6: true
jest: true
jest/globals: true
parserOptions:
ecmaFeatures:
jsx: true
@@ -13,6 +15,7 @@ plugins:
- react
- mocha
- import
- jest
settings:
react:
pragma: React
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest an new feature or enhancement for this project
about: Suggest a new feature or enhancement for this project

---

23 changes: 23 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
commit-message:
prefix: "chore"
include: "scope"
open-pull-requests-limit: 3
ignore:
# node-fetch must be synced manually
- dependency-name: "node-fetch"
- dependency-name: "release-it"
- dependency-name: "@release-it/conventional-changelog"

- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"

17 changes: 17 additions & 0 deletions .github/workflows/dependabot-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Merge me!

on:
pull_request_target:

jobs:
merge-me:
name: Merge me!
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Merge me!
uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
command: squash and merge
20 changes: 20 additions & 0 deletions .github/workflows/docker-image-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Security scan for docker image

on:
workflow_dispatch:
schedule:
- cron: '30 4 * * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/swaggerapi/swagger-ui:unstable'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
84 changes: 84 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CYPRESS_CACHE_FOLDER: cypress/cache

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache Cypress binary
id: cache-cypress-binary
uses: actions/cache@v2
with:
path: cypress/cache
key: cypress-binary-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: |
steps.cache-node-modules.outputs.cache-hit != 'true' ||
steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: npm ci
- name: Lint code for errors only
run: npm run lint-errors
- name: Run all tests
run: npm run just-test-in-node && npm run test:unit-jest
env:
CI: true
- name: Build SwaggerUI
run: npm run build
- name: Test build artifacts
run: npm run test:artifact

e2e-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: ['+(a11y|security|bugs)/**/*.js', 'features/**/+(o|d)*.js', 'features/**/m*.js', 'features/**/!(o|d|m)*.js']

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache Cypress binary
id: cache-cypress-binary
uses: actions/cache@v2
with:
path: cypress/cache
key: cypress-binary-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: |
steps.cache-node-modules.outputs.cache-hit != 'true' ||
steps.cache-cypress-binary.outputs.cache-hit != 'true'
run: npm ci
- name: Cypress Test
run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/tests/${{ matrix.containers }}"'
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -8,11 +8,17 @@ npm-debug.log*
.eslintcache
*.iml
selenium-debug.log
chromedriver.log
test/e2e/db.json
docs/_book
dev-helpers/examples

# dist
flavors/**/dist/*
/lib
/es
dist/log*

# Cypress
test/e2e-cypress/screenshots
test/e2e-cypress/videos
test/e2e-cypress/videos
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint -e
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.js": "eslint"
}
2 changes: 2 additions & 0 deletions .mocharc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive: true
require: ['esm','@babel/register','source-map-support', 'test/mocha/setup.js']
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
*
*/
!README.md
!NOTICE
!package.json
!dist/swagger-ui.js
!dist/swagger-ui.js.map
!dist/swagger-ui-standalone-preset.js
!dist/swagger-ui-standalone-preset.js.map
!dist/swagger-ui-es-bundle.js
!dist/swagger-ui-es-bundle.js.map
!dist/swagger-ui-es-bundle-core.js
!dist/swagger-ui-es-bundle-core.js.map
!dist/swagger-ui.css
!dist/swagger-ui.css.map
!dist/oauth2-redirect.html
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-prefix="="
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.8
3 changes: 3 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"settingsInheritedFrom": "swagger-api/whitesource-config@main"
}
58 changes: 0 additions & 58 deletions CONTRIBUTING.md

This file was deleted.

Loading