types condition in package.json exports should come first according to the Node.js specification

Open
#17,029 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #17004 by @alexicum — closed without merging
  • #17109 by @saiv0n — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
57/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
json, node.js, typescript
Domain
build-system

Research direction

Start with the listed package.json exports in autoconfig, containers-shared, deploy-helpers, shared-ast-primitives, workers-auth, and workers-utils. Read the Node.js community conditions guidance linked in the issue, then check the package exports for the ordering of the "types" condition. Done means each applicable exports condition places "types" first.

Written by the indexing model from the issue text.

Description

package:containers-shared package:deploy-helpers package:workers-auth package:workers-utils

[autoconfig,containers-shared,deploy-helpers,shared-ast-primitives,workers-auth,workers-utils]

I have a ready PR (#17004) fixing this issue:

  • Places the types condition first in package.json exports across all six affected packages.
  • Sets "platform": "browser" for browser.ts and prometheus-metrics.ts in packages/workers-utils/tsdown.config.ts to keep them free of Node.js shims.

"types" - can be used by typing systems to resolve the typing file for the given export. This condition should always be included first.

All local checks (oxfmt, check:private-packages, check:fixtures, and package builds) pass.

Could a maintainer please add me as a registered contributor (in .github/VOUCHED.td) and reopen PR #17004 for review? Thanks!

Dominant language
TypeScript
Stars
4.7k
Forks
1.7k
Avg merge
1d 22h
Merged PRs (30d)
282

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/workers-sdk

All issues in cloudflare/workers-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.