Repository navigation
🪧 fix: Resolve SDK Declarations Under Node16 and NodeNext - #738
Conversation
|
Head
Run locally on this head (Node 24.16.0, TypeScript 5.5.3): |
|
@codex review the latest head, final review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
@librechat/agentsis"type": "module"but publishes.d.tsfiles with extensionless relative specifiers. TypeScript consumers onmoduleResolution: node16/nodenextcannot resolve them: root exports such asRunfail withTS2305, and some re-exports degrade toany.bundlerconsumers are unaffected.Fixes #684
Fix
scripts/fix-dts-extensions.mjsruns at the end ofbuild:typesand rewrites relative specifiers indist/typesto.jsor/index.jswhen that declaration exists. Explicit extensions, bare specifiers and targets with no declaration are left alone.config/runtime-package.test.mjspacks the real tarball and typechecks a.mtsconsumer of the root and the/runtimebarrel under both Bundler and NodeNext.@ts-expect-errorprobes fail if an export becomesany.validate.ymlruns the rewriter's unit test (test:declaration-extensions).The pinned
tsc-alias1.9.7 full-path flags do not fix a declarations-only tree.Packed consumer, TypeScript 5.5.3
TS2305onRun,toStoredMessage,Providers; 6 unused@ts-expect-error(TS2578) where exports were missing oranyNotes
any, which can surface type errors that were hidden (compare ⏪ revert: Defer The.d.tsAlias Rewrite, Restore Packaging Fixes (v3.5.1) #415)..ctsconsumer still getsTS1471.Credit
The declaration-rewriting approach is @tang-ontheway's, from #722. This PR adds the packed-tarball consumer regression and the CI wiring; #722's fork CI is waiting on approval, and its code was not checked out or run here. Maintainers can land either.