From f7fd7f35b01d946ae8fb7a3e2a52f8e6511c58a4 Mon Sep 17 00:00:00 2001 From: dk <2597375+Thesephi@users.noreply.github.com> Date: Fri, 6 Dec 2024 18:25:07 +0100 Subject: [PATCH] Release/0.12.2 (#38) * v0.12.2 - see CHANGELOG for details * updated GitHub actions --- .github/workflows/pr.yml | 6 +++--- .github/workflows/publish.yml | 4 ++-- .github/workflows/runtime-tests.yml | 8 ++++---- CHANGELOG.md | 14 ++++++++++++++ README.md | 27 ++++++++++++++++++++------- jsr.json | 2 +- mod.ts | 3 ++- src/oasStore.ts | 2 +- 8 files changed, 47 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7a134f7..a15427e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -18,9 +18,9 @@ jobs: - uses: actions/checkout@v4 - name: Setup Deno - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x - name: Verify formatting run: deno fmt --check @@ -34,6 +34,6 @@ jobs: deno coverage cov_profile --lcov --output=cov_profile.lcov - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0df66de..809f30e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,9 +16,9 @@ jobs: - uses: actions/checkout@v4 - name: Setup Deno - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x - name: Verify formatting run: deno fmt --check diff --git a/.github/workflows/runtime-tests.yml b/.github/workflows/runtime-tests.yml index bed9c86..a57ee1c 100644 --- a/.github/workflows/runtime-tests.yml +++ b/.github/workflows/runtime-tests.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: ["18.x", "20.x"] + node-version: ["18.x", "20.x", "22.x"] steps: - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: ["18.x", "20.x"] + node-version: ["18.x", "20.x", "22.x"] steps: - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 @@ -57,9 +57,9 @@ jobs: steps: - uses: actions/setup-node@v4 # needed to call the scaffolding `npm create` command - name: Setup Deno - uses: denoland/setup-deno@v1 # needed to perform the actual tests + uses: denoland/setup-deno@v2 # needed to perform the actual tests with: - deno-version: v1.x + deno-version: v2.x - name: Scaffold App run: npm create oak-deno@latest -- -y - name: Perform Tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 07d7716..7da13cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [0.12.2] - 2024-12-06 + +### Added + +- `OakOpenApiSpec` and `useOak` are explicitly exported for consumption + +### Changed + +- README content update + +### Fixed + +- underscore character is now supported in OAS path param name + ## [0.12.1] - 2024-11-05 ### Changed diff --git a/README.md b/README.md index 1ded138..15932bf 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,6 @@ Prerequisite: ### Example: Retrieving path parameters -```bash -deno add @oak/oak @dklab/oak-routing-ctrl -``` - ```ts // main.ts @@ -201,18 +197,35 @@ curl -H"x-foo: lorem" localhost:1993/foo/bar ### Node.js +If you're on Node.js 22 (or above), please consult this example boilerplate: +https://replit.com/@0x97FB9/auto-swagger-node-alpha + +If you're on Node.js 21 (or below), then the example workflow below may apply to +you. + +
+View Example for Node.js 21 and below + +_ + +You can start with a boilerplate + ```bash npm create oak-nodejs-esbuild@latest ``` -
-View Example +_ + +Or you can start from scratch + +friendly note: if something doesn't work as advertised in this section, +please file an issue, thanks! ```bash npm i @jsr/oak__oak @jsr/dklab__oak-routing-ctrl # note that `npx jsr i {package}` also works, but -# installing directly from the `@jsr` scope may result +# installing directly from the `@jsr` scope might result # in better dependency resolutions ``` diff --git a/jsr.json b/jsr.json index 48b77b9..2acb861 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@dklab/oak-routing-ctrl", - "version": "0.12.1", + "version": "0.12.2", "exports": { ".": "./mod.ts", "./mod": "./mod.ts" diff --git a/mod.ts b/mod.ts index a77d6a3..b644165 100644 --- a/mod.ts +++ b/mod.ts @@ -1,4 +1,5 @@ export { useOakServer } from "./src/useOakServer.ts"; +export { useOakServer as useOak } from "./src/useOakServer.ts"; export { useOas } from "./src/useOas.ts"; export { Controller } from "./src/Controller.ts"; export { @@ -13,4 +14,4 @@ export { Delete } from "./src/Delete.ts"; export { Options } from "./src/Options.ts"; export { Head } from "./src/Head.ts"; -export { z, type zInfer } from "./deps.ts"; +export { type OakOpenApiSpec, z, type zInfer } from "./deps.ts"; diff --git a/src/oasStore.ts b/src/oasStore.ts index bad929a..2feacdb 100644 --- a/src/oasStore.ts +++ b/src/oasStore.ts @@ -17,7 +17,7 @@ const getRouteId = ( */ const getOasCompatPath = (path: string) => path.replace( - /\/:([a-zA-Z0-9]*)/g, + /\/:([a-zA-Z0-9_]*)/g, "/{$1}", );