{"versions":{"0.0.1":{"name":"fix-dts-default-cjs-exports","type":"module","version":"0.0.1","packageManager":"pnpm@10.4.1","description":"Utility to fix TypeScript declarations when using default exports in CommonJS.","author":{"name":"userquin","email":"userquin@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/userquin/fix-dts-default-cjs-exports.git"},"bugs":{"url":"https://github.com/userquin/fix-dts-default-cjs-exports/issues"},"keywords":["rollup","cjs","typescript","default exports"],"sideEffects":false,"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./rollup":{"import":{"types":"./dist/rollup.d.mts","default":"./dist/rollup.mjs"},"require":{"types":"./dist/rollup.d.cts","default":"./dist/rollup.cjs"}},"./package.json":"./package.json"},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","typesVersions":{"*":{"rollup":["./dist/rollup.cts"]}},"scripts":{"prepack":"pkgroll --clean-dist","test:full":"pnpm test:coverage && pnpm test:attw","test:coverage":"vitest run --coverage","test":"vitest","lint":"eslint .","lint:fix":"pnpm lint --fix","release":"bumpp && npm publish","test:attw":"pnpm test:reexport-types && pnpm test:reexport-default && pnpm test:mixed-declarations","test:reexport-types":"attw --pack ./test/cjs-types-fixture/reexport-types","test:reexport-default":"attw --pack ./test/cjs-types-fixture/reexport-default","test:mixed-declarations":"attw --pack ./test/cjs-types-fixture/mixed-declarations"},"dependencies":{"magic-string":"^0.30.17","mlly":"^1.7.4","rollup":"^4.34.8"},"devDependencies":{"@antfu/eslint-config":"^4.3.0","@arethetypeswrong/cli":"^0.17.4","@types/node":"^20.14.8","@vitest/coverage-v8":"^3.0.6","bumpp":"^10.0.3","eslint":"^9.21.0","pathe":"^2.0.3","pkgroll":"^2.11.0","typescript":"^5.7.3","unbuild":"3.3.1","vitest":"^3.0.6"},"_id":"fix-dts-default-cjs-exports@0.0.1","gitHead":"392951897d383c32b3b9746ee5c931cc63a6935e","homepage":"https://github.com/userquin/fix-dts-default-cjs-exports#readme","_nodeVersion":"20.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Qa2130+SIawxFxux+yeveoHzgpY346kchfW8IcmVTZnjHWa4VC/ublBT3D5HIs9vbnKWE1GJyYfRei2J3ARRBg==","shasum":"afa6ea9624b1c038c0d8d24e80d908e0c536e196","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-0.0.1.tgz","fileCount":13,"unpackedSize":31253,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICKhdI2367tUpRHaC6EgmGoZD31PqmozRnD7b/KrzuO5AiEA3H1UAb9k2TqWJskCgrue+FNwh52GIwf30cj2MWpy/oE="}],"size":6303},"_npmUser":{"name":"anonymous","email":"userquin@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"userquin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fix-dts-default-cjs-exports_0.0.1_1740336841600_0.21554262613287434"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-23T18:54:01.804Z","publish_time":1740336841804,"_source_registry_name":"default","contributors":[]},"1.0.0":{"name":"fix-dts-default-cjs-exports","type":"module","version":"1.0.0","packageManager":"pnpm@10.4.1","description":"Utility to fix TypeScript declarations when using default exports in CommonJS.","author":{"name":"userquin","email":"userquin@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/userquin/fix-dts-default-cjs-exports.git"},"bugs":{"url":"https://github.com/userquin/fix-dts-default-cjs-exports/issues"},"keywords":["rollup","cjs","typescript","default exports"],"sideEffects":false,"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./rollup":{"import":{"types":"./dist/rollup.d.mts","default":"./dist/rollup.mjs"},"require":{"types":"./dist/rollup.d.cts","default":"./dist/rollup.cjs"}}},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","typesVersions":{"*":{"rollup":["./dist/rollup.d.ts"]}},"scripts":{"prepack":"pkgroll --clean-dist","test:full":"pnpm test:coverage && pnpm test:attw","test:coverage":"vitest run --coverage","test":"vitest","lint":"eslint .","lint:fix":"pnpm lint --fix","release":"bumpp && npm publish","test:attw":"pnpm test:reexport-types && pnpm test:reexport-default && pnpm test:mixed-declarations","test:reexport-types":"attw --pack test/fixtures/reexport-types","test:reexport-default":"attw --pack test/fixtures/reexport-default","test:mixed-declarations":"attw --pack test/fixtures/mixed-declarations"},"dependencies":{"magic-string":"^0.30.17","mlly":"^1.7.4","rollup":"^4.34.8"},"devDependencies":{"@antfu/eslint-config":"^4.3.0","@arethetypeswrong/cli":"^0.17.4","@types/node":"^20.14.8","@vitest/coverage-v8":"^3.0.6","bumpp":"^10.0.3","eslint":"^9.21.0","pathe":"^2.0.3","pkgroll":"^2.11.0","typescript":"^5.7.3","unbuild":"3.3.1","vitest":"^3.0.6"},"_id":"fix-dts-default-cjs-exports@1.0.0","gitHead":"109e83e6898dab15e997ddf38d428c09d99fc3a8","homepage":"https://github.com/userquin/fix-dts-default-cjs-exports#readme","_nodeVersion":"20.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-i9Vd++WOWo6JilNgZvNvmy1T0r+/j7vikghQSEhKIuDwz4GjUrYj+Z18zlL7MleYNxE+xE6t3aG7LiAwA1P+dg==","shasum":"ac60bd54158e0b02143d1dcb47183b49ced1a5fc","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.0.tgz","fileCount":18,"unpackedSize":42943,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCDS9RsX91hXn7c9M247IaSmQhECWJBBiwe4WsNH+jLeAIhAKnLZTq+Ffq0Q8vfQKUR4+emoOnruRPY6l9Y6SZVyCqJ"}],"size":7124},"_npmUser":{"name":"anonymous","email":"userquin@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"userquin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fix-dts-default-cjs-exports_1.0.0_1740590215455_0.6554903407324326"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-26T17:16:55.632Z","publish_time":1740590215632,"_source_registry_name":"default","contributors":[]},"1.0.1":{"name":"fix-dts-default-cjs-exports","type":"module","version":"1.0.1","packageManager":"pnpm@10.6.3","description":"Utility to fix TypeScript declarations when using default exports in CommonJS.","author":{"name":"userquin","email":"userquin@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/userquin/fix-dts-default-cjs-exports.git"},"bugs":{"url":"https://github.com/userquin/fix-dts-default-cjs-exports/issues"},"keywords":["rollup","cjs","typescript","default exports"],"sideEffects":false,"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./rollup":{"import":{"types":"./dist/rollup.d.mts","default":"./dist/rollup.mjs"},"require":{"types":"./dist/rollup.d.cts","default":"./dist/rollup.cjs"}}},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","typesVersions":{"*":{"rollup":["./dist/rollup.d.ts"]}},"scripts":{"prepack":"pkgroll --clean-dist","test:full":"pnpm test:coverage && pnpm test:attw","test:coverage":"vitest run --coverage","test":"vitest","lint":"eslint .","lint:fix":"pnpm lint --fix","release":"bumpp && npm publish","test:attw":"pnpm test:reexport-types && pnpm test:reexport-default && pnpm test:mixed-declarations","test:reexport-types":"attw --pack test/fixtures/reexport-types","test:reexport-default":"attw --pack test/fixtures/reexport-default","test:mixed-declarations":"attw --pack test/fixtures/mixed-declarations"},"dependencies":{"magic-string":"^0.30.17","mlly":"^1.7.4","rollup":"^4.34.8"},"devDependencies":{"@antfu/eslint-config":"^4.3.0","@arethetypeswrong/cli":"^0.17.4","@types/node":"^20.14.8","@vitest/coverage-v8":"^3.0.6","bumpp":"^10.0.3","eslint":"^9.21.0","pathe":"^2.0.3","pkgroll":"^2.11.0","typescript":"^5.7.3","unbuild":"3.3.1","vitest":"^3.0.6"},"_id":"fix-dts-default-cjs-exports@1.0.1","gitHead":"da36479e00b50f08ba7afd60c673f606f0db79e6","homepage":"https://github.com/userquin/fix-dts-default-cjs-exports#readme","_nodeVersion":"20.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==","shasum":"955cb6b3d519691c57828b078adadf2cb92e9549","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz","fileCount":18,"unpackedSize":43250,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCP/tD8ePnzUpkQKWBrmCZN/Ym/IIjyHRrjgNLxYmKp2wIgHNmGj2wiF+a3OOgu8v/Awolk79JMBkAeR58ttQQ7h/g="}],"size":7148},"_npmUser":{"name":"anonymous","email":"userquin@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"daniel@roe.dev"},{"name":"anonymous","email":"userquin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fix-dts-default-cjs-exports_1.0.1_1742292251668_0.22040591042293078"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-03-18T10:04:11.838Z","publish_time":1742292251838,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.0.1"},"name":"fix-dts-default-cjs-exports","time":{"created":"2025-02-23T18:54:36.705Z","modified":"2025-03-18T10:05:25.618Z","0.0.1":"2025-02-23T18:54:01.804Z","1.0.0":"2025-02-26T17:16:55.632Z","1.0.1":"2025-03-18T10:04:11.838Z"},"readme":"# Fix TypeScript Declarations for default CJS exports\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n\nThis utility will allow you to fix the TypeScript declaration in CommonJS modules when using default exports.\n\nCheck the CJS fixtures in the test folder and the [CJS](./CJS.md) document for further details when using `rollup-plugin-dts`.\n\n## Features\n\n- 🚀 Fix default exports in CommonJS modules via API or Rollup plugin\n- ✨ Generate CommonJS `d.ts` and `d.cts` files from `d.mts` files\n- 💥 Use it with custom builders like [unbuild](https://github.com/unjs/unbuild), [tsup](https://github.com/egoist/tsup) or [pkgroll](https://github.com/privatenumber/pkgroll) (right now only `unbuild` supported, `tsup` and `pkgroll` don't allow adding Rollup plugins)\n\n## unbuild\n\n> [!NOTE]\n>\n> [unbuild](https://github.com/unjs/unbuild) `v3.5.0` uses the Rollup plugin from this package to fix the default exports in CommonJS modules.\n\nFor older `unbuild` versions, you can add the Rollup plugin from this package using the `rollup:dts:options` hook.\n\n> [!WARNING]\n>\n> You should register the plugin directly when enabling `rollup.emitCJS = true` option, otherwise you can get wrong transformations.\n>\n> The plugin exposed here is just a helper to fix the default exports in CommonJS modules, it cannot control what files are being generated, check the [declaration](https://github.com/unjs/unbuild?tab=readme-ov-file#configuration) option in the readme file.\n\nYou will need to remove its current internal plugin adding the one provided by this package:\n```ts\n// build.config.ts\nimport { FixDtsDefaultCjsExportsPlugin } from 'fix-dts-default-cjs-exports/rollup'\nimport { defineBuildConfig } from 'unbuild'\n\nexport default defineBuildConfig({\n  entries: ['<your-entry-points>'],\n  declaration: true,\n  clean: true,\n  rollup: { emitCJS: true },\n  hooks: {\n    'rollup:dts:options': (ctx, options) => {\n      /* uncomment this block if you want to remove the unbuild internal plugin\n      options.plugins = plugins.filter((p) => {\n        if (!p || typeof p === 'string' || Array.isArray(p) || !('name' in p))\n          return true\n\n        return p.name !== 'unbuild-fix-cjs-export-type'\n      })\n      */\n      options.plugins.push(FixDtsDefaultCjsExportsPlugin({\n        warn: message => ctx.warnings.add(message)\n      }))\n    }\n  }\n})\n```\n\n## tsup\n\nSince [tsup](https://github.com/egoist/tsup) doesn't expose any hook to allow change internal configuration, we need a change in the package to include the Rollup plugin from this package instead its built-in one.\n\n## pkgroll\n\n[pkgroll](https://github.com/privatenumber/pkgroll) is exposing only the `cli`, we need a change in the package to include the Rollup plugin from this package instead its built-in one.\n\n## License\n\n[MIT](./LICENSE) License © 2025-PRESENT [Joaquín Sánchez](https://github.com/userquin)\n\n<!-- Badges -->\n\n[npm-version-src]: https://img.shields.io/npm/v/fix-dts-default-cjs-exports?style=flat&colorA=18181B&colorB=F0DB4F\n[npm-version-href]: https://npmjs.com/package/fix-dts-default-cjs-exports\n[npm-downloads-src]: https://img.shields.io/npm/dm/fix-dts-default-cjs-exports?style=flat&colorA=18181B&colorB=F0DB4F\n[npm-downloads-href]: https://npmjs.com/package/fix-dts-default-cjs-exports\n[license-src]: https://img.shields.io/github/license/userquin/fix-dts-default-cjs-exports.svg?style=flat&colorA=18181B&colorB=F0DB4F\n[license-href]: https://github.com/userquin/fix-dts-default-cjs-exports/blob/main/LICENSE","users":{}}