{"id":29273412,"url":"https://github.com/shtse8/bun-plugin-dts","last_synced_at":"2026-02-21T03:01:24.865Z","repository":{"id":285692598,"uuid":"959013836","full_name":"shtse8/bun-plugin-dts","owner":"shtse8","description":"A Bun plugin to automatically generate TypeScript declaration files (.d.ts) during build.","archived":false,"fork":false,"pushed_at":"2025-04-10T03:04:31.000Z","size":25,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T22:42:53.780Z","etag":null,"topics":["build-tool","bun","bun-plugin","declaration-files","dts","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shtse8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"shtse8","buy_me_a_coffee":"shtse8"}},"created_at":"2025-04-02T06:07:19.000Z","updated_at":"2025-04-06T03:22:09.000Z","dependencies_parsed_at":"2025-04-02T07:22:58.242Z","dependency_job_id":"22b5a6b8-1608-4b95-a712-bf178958d61b","html_url":"https://github.com/shtse8/bun-plugin-dts","commit_stats":null,"previous_names":["shtse8/bun-plugin-dts"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/shtse8/bun-plugin-dts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtse8%2Fbun-plugin-dts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtse8%2Fbun-plugin-dts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtse8%2Fbun-plugin-dts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtse8%2Fbun-plugin-dts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shtse8","download_url":"https://codeload.github.com/shtse8/bun-plugin-dts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shtse8%2Fbun-plugin-dts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","bun","bun-plugin","declaration-files","dts","typescript"],"created_at":"2025-07-05T02:36:00.252Z","updated_at":"2026-02-21T03:01:24.826Z","avatar_url":"https://github.com/shtse8.png","language":"TypeScript","funding_links":["https://github.com/sponsors/shtse8","https://buymeacoffee.com/shtse8"],"categories":[],"sub_categories":[],"readme":"# @shtse8/bun-plugin-dts\n\n[![npm version](https://badge.fury.io/js/%40shtse8%2Fbun-plugin-dts.svg)](https://badge.fury.io/js/%40shtse8%2Fbun-plugin-dts)\n[![CI](https://github.com/shtse8/bun-plugin-dts/actions/workflows/publish.yml/badge.svg)](https://github.com/shtse8/bun-plugin-dts/actions/workflows/publish.yml)\n\nA plugin for [Bun](https://bun.sh) that generates TypeScript declaration files\n(`.d.ts`) during the `bun build` process.\n\n## Problem\n\nBun's built-in bundler (`bun build`) is incredibly fast, but it currently does\nnot generate `.d.ts` files automatically. This makes it difficult to publish\nTypeScript libraries built with Bun, as consumers rely on these files for type\nchecking and autocompletion.\n\n`@shtse8/bun-plugin-dts` solves this by hooking into the build process and using\nthe TypeScript Compiler API to generate the necessary declaration files\nalongside your JavaScript output.\n\n## Installation\n\n```bash\nbun add --dev @shtse8/bun-plugin-dts\n```\n\nYou also need `typescript` installed, which is likely already in your project:\n\n```bash\nbun add --dev typescript\n```\n\n## Usage\n\nImport the plugin and add it to the `plugins` array in your `Bun.build`\nconfiguration.\n\n**Example `build.ts`:**\n\n```typescript\nimport Bun from \"bun\";\nimport dts from \"@shtse8/bun-plugin-dts\"; // Import the plugin\n\nawait Bun.build({\n    entrypoints: [\"./src/index.ts\"],\n    outdir: \"./dist\",\n    target: \"bun\", // Or your desired target\n    plugins: [\n        dts(), // Add the plugin here\n    ],\n    // ... other build options\n});\n\nconsole.log(\"Build complete!\");\n```\n\nThe plugin will automatically:\n\n1. Find your `tsconfig.json` in the project `root`.\n2. Read the entry points and output directory (`outdir`) from the `Bun.build`\n   config.\n3. Generate `.d.ts` files corresponding to your entry points within the\n   specified `outdir`.\n\n## Configuration (Optional)\n\nCurrently, the plugin automatically detects settings from your `tsconfig.json`\nand `Bun.build` configuration. Explicit plugin options may be added in the\nfuture if needed.\n\n## Contributing\n\nContributions are welcome! Please feel free to open an issue or submit a pull\nrequest on the [GitHub repository](https://github.com/shtse8/bun-plugin-dts).\n\n## Support\n\nIf you find this plugin helpful, consider supporting the development:\n\n[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black)](https://buymeacoffee.com/shtse8)\n\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file\nfor details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshtse8%2Fbun-plugin-dts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshtse8%2Fbun-plugin-dts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshtse8%2Fbun-plugin-dts/lists"}