fix: patch dist ESM import extensions#3
Open
peterxing wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2 by making the published
dist/Node ESM-compatible after TypeScript emits extensionless relative imports.Changes:
tscdist rewrite that appends.jsto relativeimport/export ... from/ dynamicimport()specifiers when the emitted target exists.d.tsrelative specifiers so published declarations match the runtime JS specifiersrm -rf distclean command with a tiny Node clean scriptVerification
corepack pnpm install --frozen-lockfile --ignore-scriptscorepack pnpm run typecheckcorepack pnpm run buildcorepack pnpm run test:unit— 25 files / 230 tests passedcorepack pnpm exec prettier --check package.json scripts/clean.mjs scripts/fix-esm-imports.mjscorepack pnpm exec eslint scripts/clean.mjs scripts/fix-esm-imports.mjsgit diff --checkimport('@goatnetwork/agentkit')-> 162 exportsimport('@goatnetwork/agentkit/core')-> 21 exportsimport('@goatnetwork/agentkit/providers')-> 3 exportsimport('@goatnetwork/agentkit/plugins')-> 129 exportsNote: full
pnpm run lintstill reports the existing repo-wide warnings plus an existing unusedbeforeEacherror intests/unit/x402-merchant.test.ts; the touched scripts lint cleanly.