Summary
Add explicit Node and Bun entrypoints so the package can expose runtime-appropriate APIs instead of shipping a single Node-oriented build.
Motivation
The package already documents Bun installation in README.md:44-45, but it currently publishes only one ESM entrypoint via main and types in package.json:6-7. The build also emits only src/index.ts today (package.json:13, tsup.config.ts:4-9). Runtime-facing modules import Node APIs directly (src/mdfind.ts:1-3, src/mdls.ts:1-2, plus src/mdutil.ts, src/mdimport.ts, src/live-search.ts, src/query-builder.ts, and src/discover.ts), so there is no dedicated seam for Bun-specific process execution.
Proposed Behavior
- Expose distinct package entrypoints for Node and Bun, backed by a shared public API surface.
- Introduce an interop layer that abstracts process execution and stream handling so Node implementations can use
node:child_process while Bun entrypoints can use Bun-native APIs where appropriate.
- Update package exports and build output so consumers can import the correct runtime entrypoint explicitly and TypeScript resolves the matching declarations.
- Document the supported import paths and runtime expectations.
Acceptance Criteria
Implementation Notes
package.json:6-7 and package.json:13 currently publish/build a single dist/index.js output.
tsup.config.ts:4-9 defines only one build entry (src/index.ts).
src/index.ts:1-36 is a single barrel export today and likely needs sibling runtime entry barrels.
src/mdfind.ts:1-3 and src/mdls.ts:1-2 show the current direct Node API dependency pattern that the interop layer should absorb.
- No similar open issues were found from searches for
bun, entrypoint exports, or node bun.
Summary
Add explicit Node and Bun entrypoints so the package can expose runtime-appropriate APIs instead of shipping a single Node-oriented build.
Motivation
The package already documents Bun installation in
README.md:44-45, but it currently publishes only one ESM entrypoint viamainandtypesinpackage.json:6-7. The build also emits onlysrc/index.tstoday (package.json:13,tsup.config.ts:4-9). Runtime-facing modules import Node APIs directly (src/mdfind.ts:1-3,src/mdls.ts:1-2, plussrc/mdutil.ts,src/mdimport.ts,src/live-search.ts,src/query-builder.ts, andsrc/discover.ts), so there is no dedicated seam for Bun-specific process execution.Proposed Behavior
node:child_processwhile Bun entrypoints can use Bun-native APIs where appropriate.Acceptance Criteria
package.jsonuses anexportsmap for runtime-specific entrypoints instead of onlymain/types.tsupbuilds separate outputs for the shared surface plus Node/Bun-specific entry files.node:child_processdirectly in each public module.Implementation Notes
package.json:6-7andpackage.json:13currently publish/build a singledist/index.jsoutput.tsup.config.ts:4-9defines only one build entry (src/index.ts).src/index.ts:1-36is a single barrel export today and likely needs sibling runtime entry barrels.src/mdfind.ts:1-3andsrc/mdls.ts:1-2show the current direct Node API dependency pattern that the interop layer should absorb.bun,entrypoint exports, ornode bun.