From 65d19c71c5dd4d47142e013621c3904a08da2823 Mon Sep 17 00:00:00 2001 From: Aaron Prill Date: Tue, 8 Apr 2025 15:01:21 -0400 Subject: [PATCH] Updated @scalar/hono-api-reference to latest (v0.8.0) and then updated configure-open-api.ts to replace apiReference with new Scalar member. --- package.json | 2 +- pnpm-lock.yaml | 95 +++++++++++++++++++++++------------ src/lib/configure-open-api.ts | 9 ++-- 3 files changed, 68 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 4e68355..ae37467 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@hono/node-server": "^1.13.8", "@hono/zod-openapi": "^0.18.4", "@libsql/client": "^0.14.0", - "@scalar/hono-api-reference": "^0.5.184", + "@scalar/hono-api-reference": "^0.8.0", "dotenv": "^16.4.7", "dotenv-expand": "^12.0.1", "drizzle-orm": "^0.33.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48f2bbc..b14ef48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: ^0.14.0 version: 0.14.0 '@scalar/hono-api-reference': - specifier: ^0.5.184 - version: 0.5.184(hono@4.7.4) + specifier: ^0.8.0 + version: 0.8.0(hono@4.7.4) dotenv: specifier: ^16.4.7 version: 16.4.7 @@ -153,13 +153,13 @@ packages: resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/parser@7.26.10': - resolution: {integrity: sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==} + '@babel/parser@7.27.0': + resolution: {integrity: sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/types@7.26.10': - resolution: {integrity: sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==} + '@babel/types@7.27.0': + resolution: {integrity: sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==} engines: {node: '>=6.9.0'} '@clack/core@0.4.1': @@ -1024,22 +1024,22 @@ packages: cpu: [x64] os: [win32] - '@scalar/core@0.1.1': - resolution: {integrity: sha512-7qnZp8ykrXoKScFIZcwt638CuFFyj7G3SsgVfD5liNgb533K8/lhWqdmp1vK2u4BKKJ9GBAPKMlWZE/+yA8WTw==} + '@scalar/core@0.2.6': + resolution: {integrity: sha512-if8qr0McLFijNvKl3Vtv9CPrMsjijbxbDSlgXErr6Y45h8KsM2kVaVf0pzirh3daBD3y+Yl0sqtTVkpAelsoSw==} engines: {node: '>=18'} - '@scalar/hono-api-reference@0.5.184': - resolution: {integrity: sha512-vRSRwJkN1Xo5dW9KYQJlGpKZ+Nh9qH+x1sn0qf6/Lx8QLPyyEpNm1EEddKaIN6qd5wrtVjDN6adQhfAfcYGHzw==} + '@scalar/hono-api-reference@0.8.0': + resolution: {integrity: sha512-qpDeEj4YeB6+CJHt/ddj1KzDAYZfOmiD3QxOg0/t8IeWB1t4QImYySaWWzxIk9IoZpnOmaH2kq43GA/cfJ2Wfg==} engines: {node: '>=18'} peerDependencies: hono: ^4.0.0 - '@scalar/openapi-types@0.1.9': - resolution: {integrity: sha512-HQQudOSQBU7ewzfnBW9LhDmBE2XOJgSfwrh5PlUB7zJup/kaRkBGNgV2wMjNz9Af/uztiU/xNrO179FysmUT+g==} + '@scalar/openapi-types@0.2.0': + resolution: {integrity: sha512-waiKk12cRCqyUCWTOX0K1WEVX46+hVUK+zRPzAahDJ7G0TApvbNkuy5wx7aoUyEk++HHde0XuQnshXnt8jsddA==} engines: {node: '>=18'} - '@scalar/types@0.0.40': - resolution: {integrity: sha512-0J6o+yZzgZEvl3KhvLTAGiXXyrCeEPKvs9gUWQDf1Rb5NfFxF0lA10ougCQCwVJIguWNEzZfOUiSoAFzGy2EqQ==} + '@scalar/types@0.1.6': + resolution: {integrity: sha512-4GQ9VwyZm5WiOsinCIioGfByQWI+K8cY/jce9EoaJ906mXOyHfwp6lQF/ddnEJ4ptkflKkGdEQ6jm+6PnwlB5w==} engines: {node: '>=18'} '@stylistic/eslint-plugin@2.13.0': @@ -1075,6 +1075,9 @@ packages: '@types/node@22.13.10': resolution: {integrity: sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==} + '@types/node@22.14.0': + resolution: {integrity: sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -2321,14 +2324,19 @@ packages: resolution: {integrity: sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg==} engines: {node: '>=12.0.0'} + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + nanoid@3.3.8: resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - nanoid@3.3.9: - resolution: {integrity: sha512-SppoicMGpZvbF1l3z4x7No3OlIjP7QJvC9XR7AhZr1kL133KHnKPztkKDc+Ir4aJ/1VhTySrtKhrsycmrMQfvg==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + nanoid@5.1.5: + resolution: {integrity: sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==} + engines: {node: ^18 || >=20} hasBin: true napi-build-utils@2.0.0: @@ -2843,6 +2851,10 @@ packages: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} + type-fest@4.39.1: + resolution: {integrity: sha512-uW9qzd66uyHYxwyVBYiwS4Oi0qZyUqwjU+Oevr6ZogYiXt99EOYtwvzMSLw1c3lYo2HzJsep/NB23iEVEgjG/w==} + engines: {node: '>=16'} + typescript@5.7.3: resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} engines: {node: '>=14.17'} @@ -2854,6 +2866,9 @@ packages: undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + unist-util-is@6.0.0: resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} @@ -3100,11 +3115,11 @@ snapshots: '@babel/helper-validator-identifier@7.25.9': {} - '@babel/parser@7.26.10': + '@babel/parser@7.27.0': dependencies: - '@babel/types': 7.26.10 + '@babel/types': 7.27.0 - '@babel/types@7.26.10': + '@babel/types@7.27.0': dependencies: '@babel/helper-string-parser': 7.25.9 '@babel/helper-validator-identifier': 7.25.9 @@ -3660,21 +3675,25 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.29.1': optional: true - '@scalar/core@0.1.1': + '@scalar/core@0.2.6': dependencies: - '@scalar/types': 0.0.40 + '@scalar/types': 0.1.6 - '@scalar/hono-api-reference@0.5.184(hono@4.7.4)': + '@scalar/hono-api-reference@0.8.0(hono@4.7.4)': dependencies: - '@scalar/core': 0.1.1 + '@scalar/core': 0.2.6 hono: 4.7.4 - '@scalar/openapi-types@0.1.9': {} + '@scalar/openapi-types@0.2.0': + dependencies: + zod: 3.24.2 - '@scalar/types@0.0.40': + '@scalar/types@0.1.6': dependencies: - '@scalar/openapi-types': 0.1.9 + '@scalar/openapi-types': 0.2.0 '@unhead/schema': 1.11.20 + nanoid: 5.1.5 + type-fest: 4.39.1 zod: 3.24.2 '@stylistic/eslint-plugin@2.13.0(eslint@9.22.0)(typescript@5.7.3)': @@ -3691,7 +3710,7 @@ snapshots: '@types/better-sqlite3@7.6.11': dependencies: - '@types/node': 22.13.10 + '@types/node': 22.14.0 optional: true '@types/debug@4.1.12': @@ -3719,6 +3738,11 @@ snapshots: dependencies: undici-types: 6.20.0 + '@types/node@22.14.0': + dependencies: + undici-types: 6.21.0 + optional: true + '@types/normalize-package-data@2.4.4': {} '@types/unist@3.0.3': {} @@ -3896,7 +3920,7 @@ snapshots: '@vue/compiler-core@3.5.11': dependencies: - '@babel/parser': 7.26.10 + '@babel/parser': 7.27.0 '@vue/shared': 3.5.11 entities: 4.5.0 estree-walker: 2.0.2 @@ -3909,7 +3933,7 @@ snapshots: '@vue/compiler-sfc@3.5.11': dependencies: - '@babel/parser': 7.26.10 + '@babel/parser': 7.27.0 '@vue/compiler-core': 3.5.11 '@vue/compiler-dom': 3.5.11 '@vue/compiler-ssr': 3.5.11 @@ -5241,9 +5265,11 @@ snapshots: mylas@2.1.13: {} + nanoid@3.3.11: {} + nanoid@3.3.8: {} - nanoid@3.3.9: {} + nanoid@5.1.5: {} napi-build-utils@2.0.0: optional: true @@ -5426,7 +5452,7 @@ snapshots: postcss@8.5.3: dependencies: - nanoid: 3.3.9 + nanoid: 3.3.11 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -5783,12 +5809,17 @@ snapshots: type-fest@0.8.1: {} + type-fest@4.39.1: {} + typescript@5.7.3: {} ufo@1.5.4: {} undici-types@6.20.0: {} + undici-types@6.21.0: + optional: true + unist-util-is@6.0.0: dependencies: '@types/unist': 3.0.3 diff --git a/src/lib/configure-open-api.ts b/src/lib/configure-open-api.ts index b8c252c..bd621cd 100644 --- a/src/lib/configure-open-api.ts +++ b/src/lib/configure-open-api.ts @@ -1,4 +1,4 @@ -import { apiReference } from "@scalar/hono-api-reference"; +import { Scalar } from '@scalar/hono-api-reference'; import type { AppOpenAPI } from "./types"; @@ -15,16 +15,15 @@ export default function configureOpenAPI(app: AppOpenAPI) { app.get( "/reference", - apiReference({ + Scalar({ + url: "/doc", theme: "kepler", layout: "classic", defaultHttpClient: { targetKey: "js", clientKey: "fetch", }, - spec: { - url: "/doc", - }, }), ); } +