From 93d404af5ec02bf7016c36984ce35b5a98777fe0 Mon Sep 17 00:00:00 2001 From: dreamhunter2333 Date: Fri, 30 Jan 2026 22:13:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=9E=E9=80=80=20chanfana=20?= =?UTF-8?q?=E5=88=B0=20v2=EF=BC=8Cv3=20=E6=9C=89=20breaking=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chanfana 3.0.0 导致 OpenAPI 端点报错: TypeError Cannot read properties of undefined (reading 'parent') Co-Authored-By: Claude Opus 4.5 --- package.json | 2 +- pnpm-lock.yaml | 29 ++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 354f7ab..c14b82d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "cf-typegen": "wrangler types --include-env=false" }, "dependencies": { - "chanfana": "^3.0.0", + "chanfana": "^2.8.3", "hono": "^4.11.7", "zod": "^3.25.76" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cab4b7d..15b87b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: chanfana: - specifier: ^3.0.0 - version: 3.0.0 + specifier: ^2.8.3 + version: 2.8.3 hono: specifier: ^4.11.7 version: 4.11.7 @@ -24,10 +24,10 @@ importers: packages: - '@asteasolutions/zod-to-openapi@8.4.0': - resolution: {integrity: sha512-Ckp971tmTw4pnv+o7iK85ldBHBKk6gxMaoNyLn3c2Th/fKoTG8G3jdYuOanpdGqwlDB0z01FOjry2d32lfTqrA==} + '@asteasolutions/zod-to-openapi@7.3.4': + resolution: {integrity: sha512-/2rThQ5zPi9OzVwes6U7lK1+Yvug0iXu25olp7S0XsYmOqnyMfxH7gdSQjn/+DSOHRg7wnotwGJSyL+fBKdnEA==} peerDependencies: - zod: ^4.0.0 + zod: ^3.20.2 '@cloudflare/kv-asset-handler@0.4.2': resolution: {integrity: sha512-SIOD2DxrRRwQ+jgzlXCqoEFiKOFqaPjhnNTGKXSRLvp1HiOvapLaFG2kEr9dYQTYe8rKrd9uvDUzmAITeNyaHQ==} @@ -404,8 +404,8 @@ packages: blake3-wasm@2.1.5: resolution: {integrity: sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==} - chanfana@3.0.0: - resolution: {integrity: sha512-O143r9g6HlFeIdk05hEQyRIQEXTV+tjjF8fmOvByNT6zqKIzFbrs+IqnZ6reC/2s3j0XHzYZ38FE9qfTlR1PMw==} + chanfana@2.8.3: + resolution: {integrity: sha512-OBefbT8n+CeRYkC6lUoRgySTFbth+3LetxiNrCe0t+WgpQhhoIxPlo+lDYvNrLJgtsQr7XuPazm8yyxR8zwB7g==} hasBin: true cookie@1.1.1: @@ -523,15 +523,12 @@ packages: zod@3.25.76: resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} - zod@4.3.6: - resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} - snapshots: - '@asteasolutions/zod-to-openapi@8.4.0(zod@4.3.6)': + '@asteasolutions/zod-to-openapi@7.3.4(zod@3.25.76)': dependencies: openapi3-ts: 4.5.0 - zod: 4.3.6 + zod: 3.25.76 '@cloudflare/kv-asset-handler@0.4.2': {} @@ -768,13 +765,13 @@ snapshots: blake3-wasm@2.1.5: {} - chanfana@3.0.0: + chanfana@2.8.3: dependencies: - '@asteasolutions/zod-to-openapi': 8.4.0(zod@4.3.6) + '@asteasolutions/zod-to-openapi': 7.3.4(zod@3.25.76) js-yaml: 4.1.1 openapi3-ts: 4.5.0 yargs-parser: 22.0.0 - zod: 4.3.6 + zod: 3.25.76 cookie@1.1.1: {} @@ -930,5 +927,3 @@ snapshots: youch-core: 0.3.3 zod@3.25.76: {} - - zod@4.3.6: {}