Skip to content

fix: correct jest-either type exports#1684

Merged
goblindegook merged 1 commit into
PacoteJS:mainfrom
YfengJ:codex/fix-jest-either-types
Jun 22, 2026
Merged

fix: correct jest-either type exports#1684
goblindegook merged 1 commit into
PacoteJS:mainfrom
YfengJ:codex/fix-jest-either-types

Conversation

@YfengJ

@YfengJ YfengJ commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • point @pacote/jest-either package types metadata at the generated ESM declaration file
  • add an exports["."].types condition so TypeScript NodeNext consumers can resolve the root package types

Why

The published @pacote/jest-either@6.0.1 package declares types: lib/index.d.ts, but the npm tarball contains lib/esm/index.d.ts and lib/cjs/index.d.ts instead. Because the package also defines exports, TypeScript NodeNext consumers cannot resolve the root package declarations without an explicit types export condition.

Validation

  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm exec biome check package.json packages/jest-either/package.json
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm --filter @pacote/jest-either... build
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm vitest run packages/jest-either/test
  • COREPACK_ENABLE_PROJECT_SPEC=0 corepack pnpm lint — exits 0; reports two existing unused-suppression warnings in packages/error/src/index.ts
  • npm pack --dry-run --ignore-scripts --json ./packages/jest-either
  • packed packages/jest-either, installed it into a temporary NodeNext TypeScript consumer, and verified import matchers, * as named from "@pacote/jest-either" compiles with tsc --noEmit
  • git diff --check

Comment thread scripts/verify-package-entrypoints.mjs Outdated
@@ -0,0 +1,87 @@
import { execFileSync } from 'node:child_process'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch but a script to validate the format of a declarative file such as package.json should not be necessary. Happy to merge if you remove this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing. I removed the package entrypoint verification script and the root test:package hook, leaving only the @pacote/jest-either package metadata fix. I also updated the PR description with the current validation commands.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@YfengJ YfengJ force-pushed the codex/fix-jest-either-types branch from 09e6978 to 1548ff8 Compare June 22, 2026 12:54
@goblindegook goblindegook merged commit c683835 into PacoteJS:main Jun 22, 2026
@YfengJ

YfengJ commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for merging this. I appreciate the guidance on keeping the package metadata fix focused.

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