Skip to content

fix(exports): configure package exports and npm distribution (#568) - #646

Merged
k-deejah merged 1 commit into
Sorokit:mainfrom
extolkom:fix/568-package-exports-npm-distribution
Sep 2, 2026
Merged

fix(exports): configure package exports and npm distribution (#568)#646
k-deejah merged 1 commit into
Sorokit:mainfrom
extolkom:fix/568-package-exports-npm-distribution

Conversation

@extolkom

@extolkom extolkom commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #568

package.json declared "private": false (intended for npm publishing) but
was missing main, module, exports, and files fields. Without files,
npm publish would have included src/, dev config, and other repo internals
in the tarball. Without main/module/exports, consumers would get no
working entry point.

Changes

  • src/index.ts: new root library entry point re-exporting the public API
  • package.json: added main, module, types, exports (with types/
    import/require conditions), and files: ["dist", "README.md", "CHANGELOG.md"]
  • vite.config.ts / vite.lib.config.ts: library build mode outputting
    dist/index.js (ESM), dist/index.cjs (CJS), dist/style.css, with the
    dts plugin generating type declarations
  • tsconfig.lib.json: scoped TypeScript config for the declaration build

Verification — INCOMPLETE, do not merge yet

  • npm run build — succeeds and produces the expected dist/ output
    (index.js, index.cjs, index.d.ts, style.css) — not yet confirmed with
    real output pasted here
  • npm pack --dry-run — tarball file list contains only dist/,
    README.md, CHANGELOG.md — not yet confirmed
  • Real consumer smoke test: pack + install into a scratch project,
    confirm both import (ESM) and require (CJS) resolve and work, and
    TypeScript sees correct types with no missing-declaration error — not
    yet run
  • Existing test suite and lint — not yet confirmed clean after this change
  • size-limit check (added in this change) — not yet confirmed passing
  • CI workflow steps replicated locally exactly — not yet confirmed

Acceptance criteria

  • package.json has main, module, exports, and files fields — implemented,
    pending pack verification above
  • npm pack produces a tarball containing only dist/, README.md, CHANGELOG.md
  • Library build outputs to dist/
  • Consumer importing sorokit-ui gets the ESM build by default
  • TypeScript types exported alongside the build output

@drips-wave

drips-wave Bot commented Sep 2, 2026

Copy link
Copy Markdown

@extolkom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@k-deejah
k-deejah merged commit 9e70213 into Sorokit:main Sep 2, 2026
4 checks passed
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.

package.json missing exports main module and files fields for npm distribution

2 participants