{"id":15239097,"url":"https://github.com/ryoppippi/bun-plugin-isolated-decl","last_synced_at":"2025-04-10T13:13:29.355Z","repository":{"id":246818425,"uuid":"823345947","full_name":"ryoppippi/bun-plugin-isolated-decl","owner":"ryoppippi","description":"This is ultrafast dts generator powered by Bun and oxc","archived":false,"fork":false,"pushed_at":"2025-03-26T18:10:05.000Z","size":823,"stargazers_count":19,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T11:48:39.464Z","etag":null,"topics":["bun","bun-plugin","dts","oxc","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/bun-plugin-isolated-decl","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryoppippi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yaml","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},"funding":{"github":"ryoppippi"}},"created_at":"2024-07-02T21:34:30.000Z","updated_at":"2025-03-26T18:10:08.000Z","dependencies_parsed_at":"2025-01-27T13:34:40.371Z","dependency_job_id":"d62a5354-bb50-48c1-b7cc-43ca05f1449b","html_url":"https://github.com/ryoppippi/bun-plugin-isolated-decl","commit_stats":null,"previous_names":["ryoppippi/bun-plugin-isolated-decl"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fbun-plugin-isolated-decl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fbun-plugin-isolated-decl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fbun-plugin-isolated-decl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryoppippi%2Fbun-plugin-isolated-decl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryoppippi","download_url":"https://codeload.github.com/ryoppippi/bun-plugin-isolated-decl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225653,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bun","bun-plugin","dts","oxc","typescript"],"created_at":"2024-09-29T10:05:18.261Z","updated_at":"2025-04-10T13:13:28.809Z","avatar_url":"https://github.com/ryoppippi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ryoppippi"],"categories":[],"sub_categories":[],"readme":"# bun-plugin-isolated-decl\n\n[![NPM Version](https://img.shields.io/npm/v/bun-plugin-isolated-decl)](https://www.npmjs.com/package/bun-plugin-isolated-decl)\n\nA Bun plugin for generating isolated declaration files (.d.ts) from TypeScript sources using the oxc-transformer. This is the Bun-specific version of [unplugin-isolated-decl](https://github.com/unplugin/unplugin-isolated-decl).\n\n## Features\n\n- ⚡ **Ultra-Fast**: Generates `.d.ts` files significantly faster than `tsc`\n- 🔧 **Powered by oxc**: Utilises the efficient [`oxc-transformer`](https://www.npmjs.com/package/oxc-transform) for blazing-fast performance\n- 🔌 **Bun Integration**: Seamlessly integrates with Bun's build process\n- 🚀 **Zero Config**: Works out of the box with no configuration required\n- 🎯 **Focused Functionality**: Optimised for TypeScript 5.5's isolatedDeclarations option\n- 🔄 **Ecosystem Compatibility**: Bun version of [`unplugin-isolated-decl`](https://github.com/unplugin/unplugin-isolated-decl/tree/main)\n\n## Installation\n\nInstall the plugin and its peer dependencies:\n\n```bash\nbun add -d bun-plugin-isolated-decl typescript oxc-transform\n```\n\n## Usage\n\n```typescript\nimport isolatedDecl from 'bun-plugin-isolated-decl';\nawait Bun.build({\n\tentrypoints: ['./index.ts'],\n\toutdir: './dist',\n\tplugins: [isolatedDecl()],\n\t// ... other configuration options\n});\n```\n\nYou can also check the example script: [tests](./tests/).\n\n### Options\n\nYou can pass options to the plugin:\n\n```typescript\nisolatedDecl({\n\tforceGenerate: true // Generate declaration files even if there are errors\n});\n```\n\n| Option          | Type    | Default | Description                                                                   |\n| --------------- | ------- | ------- | ----------------------------------------------------------------------------- |\n| `forceGenerate` | boolean | `false` | If true, generates declaration files even when there are errors in the source |\n\n## How it works\n\n1. The plugin processes all entrypoints specified in your Bun build configuration.\n2. For each entrypoint, it uses the oxc-transformer to generate isolated declaration files.\n3. If errors are encountered and `forceGenerate` is false, it will log the errors and skip generation for that file.\n4. Generated declaration files are written to the specified `outdir` with a `.d.ts` extension.\n\n## Comparison with [`bun-plugin-dts`](https://github.com/wobsoriano/bun-plugin-dts)\n\nWhile both plugins aim to generate declaration files, they have some key differences:\n\n1. **Speed**: `bun-plugin-isolated-decl` is significantly faster than `bun-plugin-dts` due to its use of oxc-transformer instead of tsc.\n\n2. **Compatibility**:\n\n   - `bun-plugin-dts` uses tsc and can generate types for all TypeScript code.\n   - `bun-plugin-isolated-decl` is optimised for and limited to source code that is compatible with TypeScript 5.5's isolatedDeclarations option.\n\n3. **Use Case**:\n   - Choose `bun-plugin-dts` if you need comprehensive type generation for all TypeScript features.\n   - Choose `bun-plugin-isolated-decl` if you prioritise speed and your codebase is compatible with isolated declarations.\n\n## Limitations and Advantages\n\n- **Limitation**: This plugin can only handle source code that is compatible with TypeScript 5.5's isolatedDeclarations option. It may not work for all TypeScript projects, especially those using advanced type features.\n\n- **Advantage**: For compatible codebases, this plugin offers extremely fast declaration file generation, significantly outperforming traditional tsc-based solutions.\n\n## Relationship to [`unplugin-isolated-decl`](https://github.com/unplugin/unplugin-isolated-decl/tree/main)\n\n`bun-plugin-isolated-decl` is the Bun-specific implementation of [ `unplugin-isolated-decl` ](https://github.com/unplugin/unplugin-isolated-decl).\n\n## Licence\n\nISC Licence\n\n## Author\n\nryoppippi\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Issues\n\nIf you find a bug or have a suggestion, please file an issue on the GitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryoppippi%2Fbun-plugin-isolated-decl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryoppippi%2Fbun-plugin-isolated-decl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryoppippi%2Fbun-plugin-isolated-decl/lists"}