Skip to content

Commit

Permalink
Bump swagger ui and redocs ui versions (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
G4brym authored Aug 23, 2024
1 parent 5d8fce9 commit 3e4fbe6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/create-pullrequest-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
Expand All @@ -21,8 +21,8 @@ jobs:
- name: Create package
run: npm pack

- name: Upload packaged itty-router-openapi artifact
- name: Upload packaged chanfana artifact
uses: actions/upload-artifact@v4
with:
name: npm-package-itty-router-openapi-${{ github.event.number }} # encode the PR number into the artifact name
path: cloudflare-itty-router-openapi-*.tgz
name: npm-package-chanfana-${{ github.event.number }} # encode the PR number into the artifact name
path: chanfana-*.tgz
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/write-prerelease-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Write comment to the PR
steps:
- name: 'Put PR and workflow ID on the environment'
uses: actions/github-script@v5
uses: actions/github-script@v7
with:
script: |
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand All @@ -23,7 +23,7 @@ jobs:
});
for (const artifact of allArtifacts.data.artifacts) {
// Extract the PR number from the artifact name
const match = /^npm-package-itty-router-openapi-(\d+)$/.exec(artifact.name);
const match = /^npm-package-chanfana-(\d+)$/.exec(artifact.name);
if (match) {
require("fs").appendFileSync(
process.env.GITHUB_ENV,
Expand All @@ -43,11 +43,11 @@ jobs:
You can install this latest build in your project with:
```sh
npm install --save https://prerelease-registry.devprod.cloudflare.dev/itty-router-openapi/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-itty-router-openapi-${{ env.WORKFLOW_RUN_PR }}
npm install --save https://prerelease-registry.devprod.cloudflare.dev/chanfana/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-itty-router-openapi-${{ env.WORKFLOW_RUN_PR }}
```
Or you can immediately run this with `npx`:
```sh
npx https://prerelease-registry.devprod.cloudflare.dev/itty-router-openapi/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-itty-router-openapi-${{ env.WORKFLOW_RUN_PR }}
npx https://prerelease-registry.devprod.cloudflare.dev/chanfana/runs/${{ env.WORKFLOW_RUN_ID }}/npm-package-itty-router-openapi-${{ env.WORKFLOW_RUN_PR }}
```
2 changes: 1 addition & 1 deletion docs/pages/routers/hono.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Minimal Hono example

```ts
import { fromHono, OpenAPIRoute } from '@cloudflare/itty-router-openapi'
import { fromHono, OpenAPIRoute } from 'chanfana'
import { Hono } from 'hono'
import { z } from 'zod'

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/routers/itty-router.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Minimal itty-router example

```ts
import { fromIttyRouter, OpenAPIRoute } from '@cloudflare/itty-router-openapi'
import { fromIttyRouter, OpenAPIRoute } from 'chanfana'
import { Router } from "itty-router";
import { z } from 'zod'

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"lint": "npm run prettify",
"prepare": "husky install",
"test": "jest --no-cache --runInBand --config jestconfig.json --verbose",
"coverage": "jest --no-cache --runInBand --config jestconfig.json --verbose --coverage"
"coverage": "jest --no-cache --runInBand --config jestconfig.json --verbose --coverage",
"deploy-docs": "cd docs && mkdocs build && wrangler pages deploy site --project-name chanfana --branch main"
},
"keywords": [
"cloudflare",
Expand Down
8 changes: 4 additions & 4 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export function getSwaggerUI(schemaUrl: string): string {
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content="SwaggerIU"/>
<title>SwaggerUI</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.1.3/swagger-ui.css" integrity="sha256-E/mOzOnpZQnAvL2yXfW0rsfpSaprdFBfmXJzczi3gTM=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.17.14/swagger-ui.css" integrity="sha256-QBcPDuhZ0X+SExunBzKaiKBw5PZodNETZemnfSMvYRc=" crossorigin="anonymous">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlMb//2ux//9or///ZKz//wlv5f8JcOf/CnXv/why7/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB2vi/wZo3/9ytf//b7P//2uw//+BvP//DHbp/w568P8Md+//CnXv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApv4/8HbOH/lMf//3W3//9ytf//brL//w946v8SfvH/EHzw/w558P8AAAAAAAAAAAAAAAAAAAAAAAAAABF56f8Ndef/C3Dj/whs4f98u///eLn//3W3//+Evv//FoPx/xSA8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AMAAOAHAADgBwAA8A8AAA==" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.1.3/swagger-ui-bundle.js" integrity="sha256-fvmqNaMjo2s1Lv9gHQWhflWOQDVuK9AJNZUZseYkyxc=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.1.3/swagger-ui-standalone-preset.js" integrity="sha256-3kqKvSMkHWZKQ9wa4cM9ag012N457PJLKY2d1E1M4uo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.17.14/swagger-ui-bundle.js" integrity="sha256-wuSp7wgUSDn/R8FCAgY+z+TlnnCk5xVKJr1Q2IDIi6E=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.17.14/swagger-ui-standalone-preset.js" integrity="sha256-M7em9a/KxJAv35MoG+LS4S2xXyQdOEYG5ubRd0W3+G8=" crossorigin="anonymous"></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
Expand Down Expand Up @@ -55,7 +55,7 @@ export function getReDocUI(schemaUrl: string): string {
</head>
<body>
<redoc spec-url="${schemaUrl}"></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@2.0.0-rc.58/bundles/redoc.standalone.js" integrity="sha256-zi9Rf8HhROfqNF2Y/MdJLco0EgHu9F2UfixAeLBlgrc=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/redoc@2.1.5/bundles/redoc.standalone.js" integrity="sha256-vlwzMMjDW4/OsppbdVKtRb/8L9lJT+LhqC+pQXnrX48=" crossorigin="anonymous"></script>
</body>
</html>`
}

0 comments on commit 3e4fbe6

Please sign in to comment.