Skip to content

Fix published package leaking raw .ts sources into consumer type-chec…#523

Merged
plusminushalf merged 2 commits into
mainfrom
fix/type-checks
Jul 9, 2026
Merged

Fix published package leaking raw .ts sources into consumer type-chec…#523
plusminushalf merged 2 commits into
mainfrom
fix/type-checks

Conversation

@plusminushalf

Copy link
Copy Markdown
Member

…ks (#522)

Consumers on legacy moduleResolution "node" (node10) resolved subpath imports like permissionless/accounts to raw .ts sources instead of the compiled declarations, because node10 ignores the exports map and prefers .ts over .d.ts in directory lookups. The sources then got type-checked with the consumer's own compiler flags, surfacing errors under flags stricter than the library's build (noUncheckedIndexedAccess).

  • Ship a proxy package.json in every exported subpath directory (viem parity; the pattern existed for actions/ but was never completed), redirecting node10 resolution to _types/_esm/_cjs
  • Move the 7 file-based barrel subpaths (actions/{erc7579,pimlico, passkeyServer,etherspot,smartAccount}, clients/{pimlico, passkeyServer}) into directories, since a .ts file beats a directory proxy under node10; package-specifier imports are unaffected
  • Exclude test files, vitest config, and coverage from the tarball via a files field; raw .ts sources are intentionally kept for debugging
  • Enable noUncheckedIndexedAccess and fix the resulting errors across permissionless, wagmi, and mock-paymaster so shipped sources stay clean even when consumers type-check them with that flag
  • Add a package-types CI job that packs the tarball and type-checks it as node10 and bundler consumers to prevent regressions
  • Delete the broken types/package.json proxy (pointed at a nonexistent declaration file; ./types was never exported)

…ks (#522)

Consumers on legacy moduleResolution "node" (node10) resolved subpath
imports like permissionless/accounts to raw .ts sources instead of the
compiled declarations, because node10 ignores the exports map and
prefers .ts over .d.ts in directory lookups. The sources then got
type-checked with the consumer's own compiler flags, surfacing errors
under flags stricter than the library's build (noUncheckedIndexedAccess).

- Ship a proxy package.json in every exported subpath directory
  (viem parity; the pattern existed for actions/ but was never
  completed), redirecting node10 resolution to _types/_esm/_cjs
- Move the 7 file-based barrel subpaths (actions/{erc7579,pimlico,
  passkeyServer,etherspot,smartAccount}, clients/{pimlico,
  passkeyServer}) into directories, since a .ts file beats a directory
  proxy under node10; package-specifier imports are unaffected
- Exclude test files, vitest config, and coverage from the tarball via
  a files field; raw .ts sources are intentionally kept for debugging
- Enable noUncheckedIndexedAccess and fix the resulting errors across
  permissionless, wagmi, and mock-paymaster so shipped sources stay
  clean even when consumers type-check them with that flag
- Add a package-types CI job that packs the tarball and type-checks it
  as node10 and bundler consumers to prevent regressions
- Delete the broken types/package.json proxy (pointed at a
  nonexistent declaration file; ./types was never exported)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f90ee52

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@pimlico/mock-paymaster Patch
permissionless Patch
@permissionless/wagmi Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.41%. Comparing base (66ba553) to head (f90ee52).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...less/actions/pimlico/estimateErc20PaymasterCost.ts 0.00% 7 Missing ⚠️
...issionless/accounts/kernel/toKernelSmartAccount.ts 0.00% 6 Missing ⚠️
...issionless/accounts/simple/toSimpleSmartAccount.ts 64.70% 6 Missing ⚠️
...onless/accounts/biconomy/toBiconomySmartAccount.ts 72.72% 3 Missing ⚠️
...rmissionless/accounts/light/toLightSmartAccount.ts 72.72% 3 Missing ⚠️
.../permissionless/accounts/safe/signUserOperation.ts 0.00% 3 Missing ⚠️
...permissionless/accounts/safe/toSafeSmartAccount.ts 25.00% 2 Missing and 1 partial ⚠️
...sionless/accounts/thirdweb/utils/decodeCallData.ts 57.14% 3 Missing ⚠️
...missionless/accounts/trust/utils/decodeCallData.ts 57.14% 3 Missing ⚠️
...kages/permissionless/actions/smartAccount/index.ts 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
- Coverage   78.67%   78.41%   -0.26%     
==========================================
  Files         105      105              
  Lines        8950     8988      +38     
  Branches      564      570       +6     
==========================================
+ Hits         7041     7048       +7     
- Misses       1883     1914      +31     
  Partials       26       26              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
permissionless (esm) 239.99 KB (0%)
permissionless (cjs) 369.11 KB (0%)

Without an explicit types option, tsc auto-includes every
node_modules/@types package from parent directories, so the monorepo
root's hoisted typings leaked into the fixture program. In CI,
@types/pg failed to resolve pg-protocol/dist/messages under
skipLibCheck: false and broke the bundler consumer check. The fixture
must only type-check the packed permissionless tarball, not workspace
typings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@plusminushalf

Copy link
Copy Markdown
Member Author

Fixes #522

@plusminushalf plusminushalf merged commit 992f52f into main Jul 9, 2026
5 of 7 checks passed
@plusminushalf plusminushalf deleted the fix/type-checks branch July 9, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants