Skip to content

test: validate exports map paths in package test#28245

Merged
carlosmiei merged 7 commits intoccxt:masterfrom
pcriadoperez:test/validate-exports-map
Mar 30, 2026
Merged

test: validate exports map paths in package test#28245
carlosmiei merged 7 commits intoccxt:masterfrom
pcriadoperez:test/validate-exports-map

Conversation

@pcriadoperez
Copy link
Copy Markdown
Contributor

@pcriadoperez pcriadoperez commented Mar 25, 2026

Summary

  • Adds test-exports.mjs to utils/package-test/ that validates all file paths in package.json "exports" map exist in the installed (packed) tarball
  • Integrates the check into utils/package-test.sh alongside the existing ESM/CJS runtime tests

This would have caught the broken CJS types export fixed in #28229, where require.types pointed to index.d.ts which was excluded by .npmignore.

Test plan

  • Verified test fails when require.types points to ./index.d.ts (not in tarball): [Exports] MISSING: exports...require.types -> ./index.d.ts
  • Verified test passes when require.types points to ./js/ccxt.d.ts (in tarball): [Exports] All paths valid

Add test-exports.mjs that verifies all file paths in package.json
"exports" map exist in the packed tarball. This would have caught
the broken CJS types export (ccxt#28229) where require.types pointed
to index.d.ts which was excluded by .npmignore.
Add dist/ccxt.d.cts so CJS consumers using moduleResolution node16/nodenext
get proper type resolution instead of TS1479 errors. Update package test to
include a tsc type-check step for CJS types.
Move CJS type declaration generation into rollup.config.js instead of
manually committing the file, consistent with how dist/cjs/package.json
is already generated.
… checks

Expand package test coverage to include ESM type-checking with node16,
bundler moduleResolution for Vite/Next.js/webpack users, and destructured
CJS require imports.
Place CJS type declaration at the package root instead of dist/, avoiding
the unnecessary ../js/ relative path. Update .npmignore, package.json
exports map, and rollup config accordingly.
Keep the CJS type declaration filename consistent with the original
index.d.ts convention.
@carlosmiei carlosmiei merged commit 1d44cd1 into ccxt:master Mar 30, 2026
6 of 11 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.

3 participants