From 3e4fbe6b005a903759d3c6eb2541cd6828f90e40 Mon Sep 17 00:00:00 2001 From: Gabriel Massadas <5445926+G4brym@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:01:23 +0100 Subject: [PATCH] Bump swagger ui and redocs ui versions (#170) --- .github/workflows/create-pullrequest-prerelease.yml | 10 +++++----- .github/workflows/main.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- .github/workflows/write-prerelease-comment.yml | 8 ++++---- docs/pages/routers/hono.md | 2 +- docs/pages/routers/itty-router.md | 2 +- package.json | 3 ++- src/ui.ts | 8 ++++---- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/create-pullrequest-prerelease.yml b/.github/workflows/create-pullrequest-prerelease.yml index 36f20d5..7350524 100644 --- a/.github/workflows/create-pullrequest-prerelease.yml +++ b/.github/workflows/create-pullrequest-prerelease.yml @@ -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" @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ce4afd..fc0f861 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bbf6550..65d3846 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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" diff --git a/.github/workflows/write-prerelease-comment.yml b/.github/workflows/write-prerelease-comment.yml index d613f7f..31ab992 100644 --- a/.github/workflows/write-prerelease-comment.yml +++ b/.github/workflows/write-prerelease-comment.yml @@ -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({ @@ -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, @@ -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 }} ``` diff --git a/docs/pages/routers/hono.md b/docs/pages/routers/hono.md index 7af7df4..fe000fe 100644 --- a/docs/pages/routers/hono.md +++ b/docs/pages/routers/hono.md @@ -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' diff --git a/docs/pages/routers/itty-router.md b/docs/pages/routers/itty-router.md index 87f3468..6e68260 100644 --- a/docs/pages/routers/itty-router.md +++ b/docs/pages/routers/itty-router.md @@ -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' diff --git a/package.json b/package.json index 102747d..b7ebd1f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ui.ts b/src/ui.ts index a3a1c90..cced4e3 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -7,13 +7,13 @@ export function getSwaggerUI(schemaUrl: string): string { SwaggerUI - +
- - + + + ` }