Skip to content

Commit

Permalink
Update Swagger UI to v4.1.3 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Dec 28, 2021
1 parent 4f3aed6 commit 575524c
Show file tree
Hide file tree
Showing 23 changed files with 65 additions and 41 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cloc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
- name: Count Lines Of Code
id: loc
run: |
curl -OL https://github.com/vearutop/sccdiff/releases/download/v1.0.1/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz
curl -sLO https://github.com/vearutop/sccdiff/releases/download/v1.0.1/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz
OUTPUT=$(cd pr && ../sccdiff -basedir ../base)
OUTPUT="${OUTPUT//'%'/'%25'}"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "${OUTPUT}"
OUTPUT="${OUTPUT//$'\n'/%0A}"
echo "::set-output name=diff::$OUTPUT"
- name: Comment Code Lines
continue-on-error: true
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: golangci/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.41.1
version: v1.43.0

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/gorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ name: gorelease
on:
pull_request:
env:
GO111MODULE: "on"
GO_VERSION: 1.17.x
jobs:
gorelease:
strategy:
matrix:
go-version: [ 1.17.x ]
runs-on: ubuntu-latest
steps:
- name: Install Go
- name: Install Go stable
if: env.GO_VERSION != 'tip'
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
go-version: ${{ env.GO_VERSION }}
- name: Install Go tip
if: env.GO_VERSION == 'tip'
run: |
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
ls -lah gotip.tar.gz
mkdir -p ~/sdk/gotip
tar -C ~/sdk/gotip -xzf gotip.tar.gz
~/sdk/gotip/bin/go version
echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
- name: Gorelease cache
Expand All @@ -28,17 +35,16 @@ jobs:
run: |
test -e ~/go/bin/gorelease || go install golang.org/x/exp/cmd/gorelease@latest
OUTPUT=$(gorelease || exit 0)
OUTPUT="${OUTPUT//'%'/'%25'}"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "${OUTPUT}"
OUTPUT="${OUTPUT//$'\n'/%0A}"
echo "::set-output name=report::$OUTPUT"
- name: Comment Report
continue-on-error: true
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: gorelease
message: |
### API Changes
### Go API Changes
<pre>
${{ steps.gorelease.outputs.report }}
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ linters:
- scopelint # deprecated
- ifshort # too many false positives
- golint # deprecated
- varnamelen
- tagliatelle
- errname
- ireturn

issues:
exclude-use-default: false
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#GOLANGCI_LINT_VERSION := "v1.41.1" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v1.43.0" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down Expand Up @@ -34,7 +34,7 @@ endif
# Add your custom targets here.

SWAGGER_UI_VERSION_V3 := v3.52.5
SWAGGER_UI_VERSION_V4 := v4.0.1
SWAGGER_UI_VERSION_V4 := v4.1.3

## Update assets for Swagger UI v3
update-v3:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ UI [v3.52.4](https://github.com/swagger-api/swagger-ui/releases/tag/v3.52.4).
### V4

Static assets for `v4` are built from Swagger
UI [v4.0.1](https://github.com/swagger-api/swagger-ui/releases/tag/v4.0.1).
UI [v4.1.3](https://github.com/swagger-api/swagger-ui/releases/tag/v4.1.3).

[CDN-based](https://cdnjs.com/libraries/swagger-ui) `v4cdn` uses Swagger
UI [v4.0.1](https://github.com/swagger-api/swagger-ui/releases/tag/v4.0.1).
UI [v4.1.3](https://github.com/swagger-api/swagger-ui/releases/tag/v4.1.3).


## How to use
Expand Down
10 changes: 7 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module github.com/swaggest/swgui

go 1.16
go 1.17

require (
github.com/bool64/dev v0.1.42
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/bool64/dev v0.2.4
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/vearutop/statigz v1.1.5
)

require (
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
golang.org/x/net v0.0.0-20211105192438-b53810dc28af // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/tools v0.1.7 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/andybalholm/brotli v1.0.3 h1:fpcw+r1N1h0Poc1F/pHbW40cUm/lMEQslZtCkBQ0UnM=
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bool64/dev v0.1.41/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
github.com/bool64/dev v0.1.42 h1:Ps0IvNNf/v1MlIXt8Q5YKcKjYsIVLY/fb/5BmA7gepg=
github.com/bool64/dev v0.1.42/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
github.com/bool64/dev v0.2.4 h1:eXhpZE+A5Ka2Yjnbm+gQmwj3hgxnYklyyZz5cKtgHiM=
github.com/bool64/dev v0.2.4/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
1 change: 1 addition & 0 deletions v3/cdn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build swguicdn
// +build swguicdn

package v3
Expand Down
1 change: 1 addition & 0 deletions v3/embedded.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !swguicdn
// +build !swguicdn

package v3
Expand Down
1 change: 1 addition & 0 deletions v3/static/embed.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.16
// +build go1.16

// Package static contains files to embed.
Expand Down
1 change: 1 addition & 0 deletions v3emb/cdn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build swguicdn
// +build swguicdn

package v3emb
Expand Down
1 change: 1 addition & 0 deletions v3emb/embedded.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.16 && !swguicdn
// +build go1.16,!swguicdn

package v3emb
Expand Down
1 change: 1 addition & 0 deletions v4/cdn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build swguicdn
// +build swguicdn

package v4
Expand Down
1 change: 1 addition & 0 deletions v4/embedded.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !swguicdn
// +build !swguicdn

package v4
Expand Down
30 changes: 15 additions & 15 deletions v4/static.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions v4/static/embed.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.16
// +build go1.16

// Package static contains files to embed.
Expand Down
Binary file modified v4/static/swagger-ui-bundle.js.gz
Binary file not shown.
Binary file modified v4/static/swagger-ui-standalone-preset.js.gz
Binary file not shown.
Binary file modified v4/static/swagger-ui.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion v4cdn/cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v4cdn

const (
// AssetsBase is a base URL for the assets.
AssetsBase = "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.0.1/"
AssetsBase = "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/"

// FaviconBase is a base URL for favicons.
FaviconBase = "https://petstore.swagger.io/"
Expand Down
1 change: 1 addition & 0 deletions v4emb/cdn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build swguicdn
// +build swguicdn

package v4emb
Expand Down
1 change: 1 addition & 0 deletions v4emb/embedded.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.16 && !swguicdn
// +build go1.16,!swguicdn

package v4emb
Expand Down

0 comments on commit 575524c

Please sign in to comment.