fix: Publish a CommonJS entrypoint - #6
Closed
razor-x wants to merge 1 commit into
Closed
Conversation
Restore the dual-format build dropped in the template update: tsup builds dist/index.cjs and dist/index.d.cts from the same entrypoint, and the package exports a require condition matching @seamapi/url-search-params-serializer. Without it, CommonJS consumers such as nextlove fail with ERR_PACKAGE_PATH_NOT_EXPORTED. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015jWzL9LC7Q6bTGaXDoKq4z
Member
Author
|
Closing: no longer needed. nextlove is dropping its CommonJS build and consuming this package as ESM directly (see seamapi/nextlove#182), so the parser can stay ESM-only as the template intends. Generated by Claude Code |
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
The
0.2.1release (after the template update) publishes ESM-only — the package exports only animportcondition:CommonJS consumers fail with
Error: No "exports" main defined in .../@seamapi/url-search-params-parser/package.json. This blocks seamapi/nextlove#182, which consumes this package from nextlove's CJS build and its CJS-transformed test runner.Changes
Restores the dual-format build this repo had before the template update, matching @seamapi/url-search-params-serializer's packaging exactly:
tsup.config.tsbuildsdist/index.cjs+dist/index.d.cts(+ sourcemap) fromsrc/index.ts, run viapostbuild:entrypoints. The dts build passesignoreDeprecations: '6.0'because the tsconfig'sbaseUrl(used for path aliases) is reported as an error under TypeScript 6.exports["."].require→./dist/index.cjswith./dist/index.d.ctstypes.distadded to publishedfiles;tsupadded to devDependencies.Verification
require('@seamapi/url-search-params-parser')works from Node 22 and parses correctly (strict mode:foo=a,b&bar=2→{"foo":["a,b"],"bar":2}).importunchanged.npm test(73 tests) andnpm run lintpass.Releases as
0.2.2.Generated by Claude Code