From 59e2662a5554ab149da1fdb982286e0ca772b567 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 29 Jul 2026 15:29:11 +0100 Subject: [PATCH] fix: force nitro to trace undici aliases --- nuxt.config.ts | 22 +++++++++++ package.json | 6 +-- pnpm-lock.yaml | 103 +++++++++---------------------------------------- 3 files changed, 44 insertions(+), 87 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index d2fc3d70..13a0ecdc 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,4 +1,5 @@ import { mkdir, writeFile } from 'node:fs/promises' +import { createRequire } from 'node:module' import { dirname } from 'node:path' import process from 'node:process' @@ -197,6 +198,27 @@ export default defineNuxtConfig({ compatibilityDate: '2025-06-09', nitro: { + externals: { + // `@atproto-labs/fetch-node` depends on undici via npm aliases + // (`undici_v6`, etc.), which nitro's externals tracing collapses to the + // real package name, breaking the aliased imports at runtime. + // https://github.com/nitrojs/nitro/issues/1574 + traceAlias: Object.fromEntries( + ['undici_v6', 'undici_v7', 'undici_v8'].flatMap(alias => { + try { + let req = createRequire(import.meta.url) + for (const hop of ['@atproto/oauth-client-node', '@atproto-labs/handle-resolver-node', '@atproto-labs/fetch-node']) { + req = createRequire(req.resolve(hop)) + } + const { version } = req(`${alias}/package.json`) + return [[`.nitro/undici@${version}`, alias]] + } + catch { + return [] + } + }), + ), + }, replace: { 'import.meta.test': isTest, }, diff --git a/package.json b/package.json index bb6f30b3..223ec492 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ }, "dependencies": { "@atcute/bluesky-richtext-segmenter": "^3.0.2", - "@atproto/api": "^0.19.19", - "@atproto/lexicon": "^0.6.2", + "@atproto/api": "^0.20.34", + "@atproto/lexicon": "^0.7.7", "@atproto/oauth-client-node": "0.4.9", "@formkit/drag-and-drop": "0.5.3", "@iconify-json/ri": "^1.2.10", @@ -89,7 +89,7 @@ "vue-router": "5.2.0" }, "devDependencies": { - "@atproto/common-web": "0.4.21", + "@atproto/common-web": "0.5.6", "@commitlint/cli": "21.2.1", "@commitlint/config-conventional": "21.2.0", "@nuxt/test-utils": "4.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3219b7b..8b3926dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,11 +15,11 @@ importers: specifier: ^3.0.2 version: 3.0.2 '@atproto/api': - specifier: ^0.19.19 - version: 0.19.19 + specifier: ^0.20.34 + version: 0.20.34 '@atproto/lexicon': - specifier: ^0.6.2 - version: 0.6.2 + specifier: ^0.7.7 + version: 0.7.7 '@atproto/oauth-client-node': specifier: 0.4.9 version: 0.4.9 @@ -190,8 +190,8 @@ importers: version: 5.2.0(@vue/compiler-sfc@3.5.40)(esbuild@0.28.0)(rolldown@1.2.0)(rollup@4.62.3)(vite@8.1.5(@types/node@25.6.0)(esbuild@0.28.0)(jiti@2.7.0)(terser@5.49.0)(yaml@2.9.0))(vue@3.5.40(typescript@6.0.3))(webpack@5.105.2(cssnano@8.0.2(postcss@8.5.24))(csso@5.0.5)(esbuild@0.28.0)(lightningcss@1.32.0)(postcss@8.5.24)) devDependencies: '@atproto/common-web': - specifier: 0.4.21 - version: 0.4.21 + specifier: 0.5.6 + version: 0.5.6 '@commitlint/cli': specifier: 21.2.1 version: 21.2.1(@types/node@25.6.0)(conventional-commits-parser@7.1.1)(typescript@6.0.3) @@ -312,11 +312,9 @@ packages: resolution: {integrity: sha512-3YH03xg99ZUS6Fq/6jcKRiZwUbzDb58xmS7ibg0y4+dukwrHa92cV/md76RpQJkAo9KYBvwLETdvF6fNtwIoGw==} engines: {node: '>=22'} - '@atproto/api@0.19.19': - resolution: {integrity: sha512-8pwyN3qM1HnaJzL297OBjfxwLLJvNHkFDr5smoFRLXEDiyPprQfbsH7YrGsJfX8Cez+KcHZAuZTY4Hh6NUBwBQ==} - - '@atproto/common-web@0.4.21': - resolution: {integrity: sha512-Odq+wdk3YNasGCjjlpl3bCIPvqYHige5DLfMkIffNv/2PI/iIj5ZvAvMvJlJ59OhReKSxtpI0invx5UQPc3+fw==} + '@atproto/api@0.20.34': + resolution: {integrity: sha512-nKfCLkH2Al58YupLGtoVIucZ5XjtN9sU5oOTI70lp8J4nxl52C/Tk7AktcWe+Nx7st3I0fUgf+C5cHePgvwT0w==} + engines: {node: '>=22'} '@atproto/common-web@0.5.6': resolution: {integrity: sha512-5Y4MIK9dpkJPiKiE6u7iEHitxj+g3aAU2GfGL686JlKE2zDKD4y18BJb+uVek6nXQKb5XOdNVvw+7BHarpn8Fw==} @@ -338,23 +336,14 @@ packages: resolution: {integrity: sha512-tq7TUDmNfe1yDfpRgdGQMJdl9TUlJmREQNCag9yg5w8Evu+TOiFiLgiOCbo7X4ouRPSgd1DpOzXbUa8UyKKMZA==} engines: {node: '>=22'} - '@atproto/lex-data@0.0.15': - resolution: {integrity: sha512-ZsbGiaM5S3CnGrcTMbDGON3bLZzCi/Mx9UvcMREKSRujnF68eHgMiXxJqvykP7+QpOX6tYCK93axZkuJVhtSEw==} - '@atproto/lex-data@0.1.5': resolution: {integrity: sha512-TEM6GHuYpNm4O90LjNgbYq1Gmcr875S+BHrDxkg4PB5w/nlsz4HlbkGQG/WP/xbIV5O8TF5nNHDpCZ5ezTRrFA==} engines: {node: '>=22'} - '@atproto/lex-json@0.0.16': - resolution: {integrity: sha512-IgLgQ0krshVlrIYZ+heTBDbCnM3LmAgWvsaYn5MxvKA3LcBot3PG3ptdO8VOweVZ+WgCLuo39cz9EbUmIbqdtg==} - '@atproto/lex-json@0.1.4': resolution: {integrity: sha512-ENR2cWkVrES+UL6TovbCRdX9BJOyHHJUS8jYx3Lxp3j4vEphjn/u+DW7bWloST2O8ID2OuVlt6+28ftNEEjmQQ==} engines: {node: '>=22'} - '@atproto/lexicon@0.6.2': - resolution: {integrity: sha512-p3Ly6hinVZW0ETuAXZMeUGwuMm3g8HvQMQ41yyEE6AL0hAkfeKFaZKos6BdBrr6CjkpbrDZqE8M+5+QOceysMw==} - '@atproto/lexicon@0.7.7': resolution: {integrity: sha512-92VH2oEsJdrIVNy7WY8rGn99ANNVglyUffoN7GJc0mxKi+fXN5iVlJ2cOyTfYABhr2ldSiptZWXEPEdBaIR9/A==} engines: {node: '>=22'} @@ -371,16 +360,10 @@ packages: resolution: {integrity: sha512-x75O0HsKB1IGfBikAQrrTX6EL8Rt4Q0+wMcwhZQRGPk/N/WqbYbsW3Powj4R8ZJKSfWCpVfaw32Piu1pTi891Q==} engines: {node: '>=22'} - '@atproto/syntax@0.5.4': - resolution: {integrity: sha512-9XJOpMAgsGFxMEIp8nJ8AIWv+krrY1xQMj+wULbbXhQztQV+9aZ0TbG9Jtn3Op2or8Kr6OqyWR4ga9Z189kKDw==} - '@atproto/syntax@0.7.2': resolution: {integrity: sha512-tZ1Tr0R9pK4bI4Zs69t29cjMlCFQvRNBeNkqJC5pGeNuCt64D0eoF7s/AlqeVmYppClmQ0xJquggGgsMDP6j7w==} engines: {node: '>=22'} - '@atproto/xrpc@0.7.7': - resolution: {integrity: sha512-K1ZyO/BU8JNtXX5dmPp7b5UrkLMMqpsIa/Lrj5D3Su+j1Xwq1m6QJ2XJ1AgjEjkI1v4Muzm7klianLE6XGxtmA==} - '@atproto/xrpc@0.8.6': resolution: {integrity: sha512-yVfKrlwZBBm44Ft9jDvHcTCwQ1ElqSlzXHWhT/KcqE+u24EAhWVFosfABfGbUByB/PmN8eLJ06FsWo5pUQcMNQ==} engines: {node: '>=22'} @@ -3366,8 +3349,8 @@ packages: peerDependencies: postcss: ^8.1.0 - await-lock@2.2.2: - resolution: {integrity: sha512-aDczADvlvTGajTDjcjpJMqRkOF6Qdz3YbPZm/PyW6tKPkx2hlYBzxMhEywM/tU72HrVZjgl5VCdRuMlA7pZ8Gw==} + await-lock@3.0.0: + resolution: {integrity: sha512-eO6fLiSnrJrMdjWMNK8zbVRXPs2TKJg78iKZd9wDpN3na5tcoV6EoeiOlMgk2QaAQ1gIrK1YuMsJHXWqz89tSA==} b4a@1.8.0: resolution: {integrity: sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg==} @@ -5477,9 +5460,6 @@ packages: multiformats@14.0.5: resolution: {integrity: sha512-vbIm83F2yZ1pWJGS0yl0ysracIvv56LtbrIyiIQHoLdYDJOMoLfVFsXhh9DUH4SFdkdkFhucyWniihsNzVEjkQ==} - multiformats@9.9.0: - resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} - mustache@4.2.0: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true @@ -6869,9 +6849,6 @@ packages: ufo@1.6.4: resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==} - uint8arrays@3.0.0: - resolution: {integrity: sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA==} - ultrahtml@1.7.0: resolution: {integrity: sha512-2xRd0VHoAQE4M+vF/DvFFB7pUV0ZxTW1TLi7lHQWnF/Sb5TPeEUV/l+hxcNnGO00ZXGnR0voCMmYRKQf+rvJ2g==} @@ -7622,24 +7599,17 @@ snapshots: '@atproto-labs/simple-store@0.4.4': {} - '@atproto/api@0.19.19': + '@atproto/api@0.20.34': dependencies: - '@atproto/common-web': 0.4.21 - '@atproto/lexicon': 0.6.2 - '@atproto/syntax': 0.5.4 - '@atproto/xrpc': 0.7.7 - await-lock: 2.2.2 - multiformats: 9.9.0 + '@atproto/common-web': 0.5.6 + '@atproto/lexicon': 0.7.7 + '@atproto/syntax': 0.7.2 + '@atproto/xrpc': 0.8.6 + await-lock: 3.0.0 + multiformats: 13.4.2 tlds: 1.261.0 zod: 3.25.76 - '@atproto/common-web@0.4.21': - dependencies: - '@atproto/lex-data': 0.0.15 - '@atproto/lex-json': 0.0.16 - '@atproto/syntax': 0.5.4 - zod: 3.25.76 - '@atproto/common-web@0.5.6': dependencies: '@atproto/lex-data': 0.1.5 @@ -7667,37 +7637,17 @@ snapshots: multiformats: 13.4.2 zod: 3.25.76 - '@atproto/lex-data@0.0.15': - dependencies: - multiformats: 9.9.0 - tslib: 2.8.1 - uint8arrays: 3.0.0 - unicode-segmenter: 0.14.5 - '@atproto/lex-data@0.1.5': dependencies: multiformats: 13.4.2 tslib: 2.8.1 unicode-segmenter: 0.14.5 - '@atproto/lex-json@0.0.16': - dependencies: - '@atproto/lex-data': 0.0.15 - tslib: 2.8.1 - '@atproto/lex-json@0.1.4': dependencies: '@atproto/lex-data': 0.1.5 tslib: 2.8.1 - '@atproto/lexicon@0.6.2': - dependencies: - '@atproto/common-web': 0.4.21 - '@atproto/syntax': 0.5.4 - iso-datestring-validator: 2.2.2 - multiformats: 9.9.0 - zod: 3.25.76 - '@atproto/lexicon@0.7.7': dependencies: '@atproto/common-web': 0.5.6 @@ -7739,20 +7689,11 @@ snapshots: '@atproto/jwk': 0.7.4 zod: 3.25.76 - '@atproto/syntax@0.5.4': - dependencies: - tslib: 2.8.1 - '@atproto/syntax@0.7.2': dependencies: iso-datestring-validator: 2.2.2 tslib: 2.8.1 - '@atproto/xrpc@0.7.7': - dependencies: - '@atproto/lexicon': 0.6.2 - zod: 3.25.76 - '@atproto/xrpc@0.8.6': dependencies: '@atproto/lexicon': 0.7.7 @@ -11093,7 +11034,7 @@ snapshots: postcss: 8.5.24 postcss-value-parser: 4.2.0 - await-lock@2.2.2: {} + await-lock@3.0.0: {} b4a@1.8.0: {} @@ -13580,8 +13521,6 @@ snapshots: multiformats@14.0.5: {} - multiformats@9.9.0: {} - mustache@4.2.0: {} nano-staged@1.0.2: {} @@ -15446,10 +15385,6 @@ snapshots: ufo@1.6.4: {} - uint8arrays@3.0.0: - dependencies: - multiformats: 9.9.0 - ultrahtml@1.7.0: {} unconfig-core@7.5.0: -- 2.54.0