{"_id":"@unjsio/rollup-plugin-dts","name":"@unjsio/rollup-plugin-dts","dist-tags":{"latest":"5.0.0-rc.1"},"versions":{"5.0.0-rc.1":{"name":"@unjsio/rollup-plugin-dts","version":"5.0.0-rc.1","description":"A rollup plugin that will bundle up your .d.ts definition files.","keywords":["rollup-plugin","typescript","dts","@types"],"author":{"name":"Arpad Borsos","email":"arpad.borsos@googlemail.com"},"license":"LGPL-3.0","repository":{"type":"git","url":"git+https://github.com/Swatinem/rollup-plugin-dts.git"},"bugs":{"url":"https://github.com/Swatinem/rollup-plugin-dts/issues"},"funding":{"url":"https://github.com/sponsors/Swatinem"},"homepage":"https://github.com/Swatinem/rollup-plugin-dts#readme","engines":{"node":">=v14"},"type":"module","main":"./dist/rollup-plugin-dts.cjs","exports":{"types":"./dist/rollup-plugin-dts.d.ts","import":"./dist/rollup-plugin-dts.mjs","require":"./dist/rollup-plugin-dts.cjs"},"types":"./dist/rollup-plugin-dts.d.ts","sideEffects":false,"scripts":{"clean":"rimraf dist","prebuild":"npm run clean","build":"tsc && rollup --bundleConfigAsCjs -c .build/rollup.config.js","prepublishOnly":"npm run test","pretest":"npm run build","test":"c8 node .build/tests/index.js"},"prettier":{"printWidth":120,"trailingComma":"all"},"devDependencies":{"@types/babel__code-frame":"^7.0.3","@types/d3-drag":"^3.0.1","@types/estree":"1.0.0","@types/fs-extra":"^9.0.13","@types/node":"^18.11.0","@types/react":"^18.0.21","c8":"^7.12.0","fs-extra":"^10.1.0","rimraf":"^3.0.2","rollup":"3.1.0","typescript":"4.8.4"},"peerDependencies":{"rollup":"^3.0.0","typescript":"^4.1"},"optionalDependencies":{"@babel/code-frame":"^7.18.6"},"dependencies":{"magic-string":"^0.26.7","@babel/code-frame":"^7.18.6"},"gitHead":"4a547671d9337770c2189cd0fc8b90b036d8aa90","_id":"@unjsio/rollup-plugin-dts@5.0.0-rc.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-ygcyY5+1PfKjxO6mNlfFWrA1hv9GaMIJMppL+zKqp1zRsDag9jmf7D3isnRWiiE0DSlBHjGGCiKFZ5c5XcWzTA==","shasum":"c4d0d4b5eebebcfdb17dccc3158f2daed51e3cc4","tarball":"https://registry.npmjs.org/@unjsio/rollup-plugin-dts/-/rollup-plugin-dts-5.0.0-rc.1.tgz","fileCount":7,"unpackedSize":176411,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjGvHWrm6EzC0h6arwYsgD4JZnywCB1DKFDvLx5x7zIAIgSxc23zQyHkNWHIKjwIh6W17vvDSKfmxShbI9ATLy1kI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSoulACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4qQ//XVR/+AteP+f33QW0XlNYDzyT5dbf14oxYSNPAKpMtK5T2rzF\r\nfRocVlNdwkV8KHZX96h5P/9wZ1X/a8ZqTyqDTXxSSlyR4wFMH6cBD0HOkSoz\r\nVlO2cfJy5i++EIjRpPXBJPh8f7Nydsp65N9W0Y+Kmf4aJ8yyLozV2uTAu2mv\r\npTZwjKr5SHGW2k3Qm36oXF4I50OIIIHLbW33VhncBCbuJYSETMzpg7N6Jdu5\r\n87fjF+MBTMq/LrXz8QcyT9pOeh6XT7IeLPa9fMm/HFp4XopJUKwtgktrBpvD\r\no/kbcSyGrXwzzMPj8ROj61Pg8wHeRTc4KOqgXEQ2lSi34tKW9s9ZQK/zA9sU\r\npnInHM1tty7sRnI8TfVLBoWPSLGzgljMiTva67ax1fUg3yNaVvALF8DQrjDx\r\nzfRbVmDt4fNHRrfbZp6yyqe67ep5wNXO7DLR0sXWXt48dXS/pkjoqLUtSXBo\r\niuHkKL6Y4JsJ+Y+xhge3UJNc0Xl0+vjubeKXVS8Q++LhIIMfMF2JArTCodfq\r\nLAJThXh1KMoZHMSNWg82LyU8//vrNjM26lQWAnZnOoZSqQOZ3t2TQ6Tj7l5t\r\niK9nXg9Yv9QbdwDyWrXB+TAea1xhq0Dbso3oPQdK9w5S+VeTvehEk3fKsH1o\r\nSuqLX8Ro7UKyQl3Ff/6N5LD5gY8f50hEx4g=\r\n=Eusr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-dts_5.0.0-rc.1_1665829797200_0.48956053155140333"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-15T10:29:57.150Z","5.0.0-rc.1":"2022-10-15T10:29:57.407Z","modified":"2022-10-15T10:29:57.544Z"},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"description":"A rollup plugin that will bundle up your .d.ts definition files.","homepage":"https://github.com/Swatinem/rollup-plugin-dts#readme","keywords":["rollup-plugin","typescript","dts","@types"],"repository":{"type":"git","url":"git+https://github.com/Swatinem/rollup-plugin-dts.git"},"author":{"name":"Arpad Borsos","email":"arpad.borsos@googlemail.com"},"bugs":{"url":"https://github.com/Swatinem/rollup-plugin-dts/issues"},"license":"LGPL-3.0","readme":"# rollup-plugin-dts\n\n[![Build Status](https://github.com/Swatinem/rollup-plugin-dts/workflows/CI/badge.svg)](https://github.com/Swatinem/rollup-plugin-dts/actions?workflow=CI)\n[![Coverage Status](https://img.shields.io/codecov/c/github/Swatinem/rollup-plugin-dts.svg)](https://codecov.io/gh/Swatinem/rollup-plugin-dts)\n\nThis is a plugin that lets you roll-up your `.d.ts` definition files.\n\n## Usage\n\nInstall the package from `npm`:\n\n    $ npm install --save-dev rollup-plugin-dts\n\nAdd it to your `rollup.config.js`:\n\n```js\nimport dts from \"rollup-plugin-dts\";\n\nconst config = [\n  // …\n  {\n    input: \"./my-input/index.d.ts\",\n    output: [{ file: \"dist/my-library.d.ts\", format: \"es\" }],\n    plugins: [dts()],\n  },\n];\n\nexport default config;\n```\n\nAnd then instruct typescript where to find your definitions inside your `package.json`:\n\n```json\n  \"types\": \"dist/my-library.d.ts\",\n```\n\n**NOTE** that the plugin will automatically mark any external library\n(`@types` for example) as `external`, so those will be excluded from bundling.\n\n## What to expect\n\nWhile this plugin is fairly complete, it does not support all imaginable use-cases.\nIn particular, the plugin works best with already existing `.d.ts` files generated\nby the typescript compiler from idiomatic code.\n\nWorking with `.ts(x)` or even `.js(x)` (when setting `allowJs: true`) does work,\nbut is not recommended.\n\nThe plugin does its own import resolution through the typescript compiler, and\nusage together with other resolution plugins, such as `node-resolve` can lead\nto errors and is not recommended.\n\nAll external dependencies from `node_modules` are automatically excluded from\nbundling. This can be overridden using the `respectExternal` setting, but it is\ngenerally not recommended. While rollup of external `@types` generally works,\nit is not recommended.\n\n## Why?\n\nWell, ideally TypeScript should just do all this itself, and it even has a\n[proposal](https://github.com/Microsoft/TypeScript/issues/4433) to do that.\nBut there hasn’t been any progress in ~3 years.\n\nSome projects, like [rollup itself](https://github.com/rollup/rollup/blob/24fe07f39da8e4225f4bc4f797331930d8405ec2/src/rollup/types.d.ts)\ngo the route of completely separating their public interfaces in a separate file.\n\n## Alternatives\n\n- [API Extractor](https://api-extractor.com/)\n- [dts-bundle-generator](https://github.com/timocov/dts-bundle-generator)\n- [rollup-plugin-ts](https://github.com/wessberg/rollup-plugin-ts)\n- [tsc-prog](https://github.com/jeremyben/tsc-prog)\n\n[See](https://github.com/Swatinem/rollup-plugin-dts/issues/5)\n[some](https://github.com/Swatinem/rollup-plugin-dts/issues/13)\n[discussions](https://github.com/timocov/dts-bundle-generator/issues/68)\nabout some of these projects and their tradeoffs.\n\n## [How does it work](./docs/how-it-works.md)\n\n## License\n\nThe code is licensed under the copyleft **LGPL-3.0**. I have no intention to\nlicense this under any non-copyleft license.\n","readmeFilename":"README.md"}