{"id":19427810,"url":"https://github.com/stacksjs/dtsx","last_synced_at":"2025-04-04T06:10:08.432Z","repository":{"id":257946226,"uuid":"872136801","full_name":"stacksjs/dtsx","owner":"stacksjs","description":"⚡ Extremely fast \u0026 configurable DTS emitter.","archived":false,"fork":false,"pushed_at":"2025-02-15T09:06:54.000Z","size":1948,"stargazers_count":111,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T09:26:10.546Z","etag":null,"topics":["dev-tool","dts","dts-emitter","generator","isolated-declarations","types","typescript"],"latest_commit_sha":null,"homepage":"https://dtsx.netlify.app","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/stacksjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["stacksjs","chrisbbreuer"],"open_collective":"stacksjs"}},"created_at":"2024-10-13T21:41:38.000Z","updated_at":"2025-02-14T08:00:56.000Z","dependencies_parsed_at":"2025-02-22T13:27:39.843Z","dependency_job_id":"8c4f22cc-a7e8-4533-a283-9f2332983cbd","html_url":"https://github.com/stacksjs/dtsx","commit_stats":null,"previous_names":["stacksjs/dts-generation","stacksjs/dtsx"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdtsx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdtsx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdtsx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stacksjs%2Fdtsx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stacksjs","download_url":"https://codeload.github.com/stacksjs/dtsx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246777791,"owners_count":20832033,"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":["dev-tool","dts","dts-emitter","generator","isolated-declarations","types","typescript"],"created_at":"2024-11-10T14:12:58.488Z","updated_at":"2025-04-04T06:10:08.407Z","avatar_url":"https://github.com/stacksjs.png","language":"TypeScript","funding_links":["https://github.com/sponsors/stacksjs","https://github.com/sponsors/chrisbbreuer","https://opencollective.com/stacksjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/stacksjs/dtsx/blob/main/.github/art/cover.jpg?raw=true\" alt=\"Social Card of this repo\"\u003e\u003c/p\u003e\n\n[![npm version][npm-version-src]][npm-version-href]\n[![GitHub Actions][github-actions-src]][github-actions-href]\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\u003c!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --\u003e\n\u003c!-- [![Codecov][codecov-src]][codecov-href] --\u003e\n\n# dtsx\n\n\u003e A library that helps you generate TypeScript declaration files from your project. Given we do not know the user's input ever, we need to never hardcode based results based from our examples, always create a dynamic solution.\n\n## Features\n\n- ⚡ Extremely fast .d.ts generation\n- ⚙️ Highly configurable\n- 🪶 Lightweight library\n- 🤖 Cross-platform binary\n\n## Install\n\n```bash\nbun install -d @stacksjs/dtsx\n```\n\n\u003c_@npmjs.com\u003e, please allow us to use the `dtsx` package name 🙏_\n\n\u003c!-- _Alternatively, you can install:_\n\n```bash\nbrew install dtsx # wip\npkgx install dtsx # wip\n``` --\u003e\n\n## Get Started\n\nThere are two ways of using this \".d.ts generation\" tool: _as a library or as a CLI._\n\n_But before you get started, please ensure you enabled `isolatedDeclarations` in your `tsconfig.json` file._\n\n```json\n{\n  \"compilerOptions\": {\n    \"isolatedDeclarations\": true\n  }\n}\n```\n\n## Library\n\nGiven the npm package is installed, you can use the `generate` function to generate TypeScript declaration files from your project.\n\n### Usage\n\n```ts\nimport type { DtsGenerationOptions } from '@stacksjs/dtsx'\nimport { generate } from '@stacksjs/dtsx'\n\nconst options: DtsGenerationOptions = {\n  cwd: './', // default: process.cwd()\n  root: './src', // default: './src'\n  entrypoints: ['**/*.ts'], // default: ['**/*.ts']\n  outdir: './dist', // default: './dist'\n  clean: true, // default: false\n  verbose: true, // default: false\n  // keepComments: true, // coming soon\n}\n\nawait generate(options)\n```\n\n_Available options:_\n\nLibrary usage can also be configured using a `dts.config.ts` _(or `dts.config.js`)_ file which is automatically loaded when running the `./dtsx` _(or `bunx dtsx`)_ command. It is also loaded when the `generate` function is called, unless custom options are provided.\n\n```ts\n// dts.config.ts (or dts.config.js)\n\nexport default {\n  cwd: './',\n  root: './src',\n  entrypoints: ['**/*.ts'],\n  outdir: './dist',\n  keepComments: true,\n  clean: true,\n  verbose: true,\n}\n```\n\n_You may also run:_\n\n```bash\n./dtsx generate\n\n# if the package is installed, you can also run:\n# bunx dtsx generate\n```\n\n## CLI\n\nThe `dtsx` CLI provides a simple way to generate TypeScript declaration files from your project. Here's how to use it:\n\n### Usage\n\nGenerate declaration files using the default options:\n\n```bash\ndtsx generate\n```\n\n_Or use custom options:_\n\n```bash\n# Generate declarations for specific entry points:\ndtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types\n\n# Generate declarations with custom configuration:\ndtsx generate --root ./lib --outdir ./types --clean\n\ndtsx --help\ndtsx --version\n```\n\n_Available options:_\n\n- `--cwd \u003cpath\u003e`: Set the current working directory _(default: current directory)_\n- `--root \u003cpath\u003e`: Specify the root directory of the project _(default: './src')_\n- `--entrypoints \u003cfiles\u003e`: Define entry point files _(comma-separated, default: '**/*.ts')_\n- `--outdir \u003cpath\u003e`: Set the output directory for generated .d.ts files _(default: './dist')_\n- `--keep-comments`: Keep comments in generated .d.ts files _(default: true)_\n- `--clean`: Clean output directory before generation _(default: false)_\n- `--tsconfig \u003cpath\u003e`: Specify the path to tsconfig.json _(default: 'tsconfig.json')_\n- `--verbose`: Enable verbose output _(default: false)_\n\nTo learn more, head over to the [documentation](https://dtsx.stacksjs.org/).\n\n## Testing\n\n```bash\nbun test\n```\n\n## Changelog\n\nPlease see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.\n\n## Contributing\n\nPlease review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.\n\n## Community\n\nFor help, discussion about best practices, or any other conversation that would benefit from being searchable:\n\n[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)\n\nFor casual chit-chat with others using this package:\n\n[Join the Stacks Discord Server](https://discord.gg/stacksjs)\n\n## Postcardware\n\n“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where `dtsx` is being used! We showcase them on our website too.\n\nOur address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎\n\n## Sponsors\n\nWe would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.\n\n- [JetBrains](https://www.jetbrains.com/)\n- [The Solana Foundation](https://solana.com/)\n\n## Credits\n\n- [Chris Breuer](https://github.com/chrisbbreuer)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/dtsx/tree/main/LICENSE.md) for more information.\n\nMade with 💙\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/@stacksjs/dtsx?style=flat-square\n[npm-version-href]: https://npmjs.com/package/@stacksjs/dtsx\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/dtsx/ci.yml?style=flat-square\u0026branch=main\n[github-actions-href]: https://github.com/stacksjs/dtsx/actions?query=workflow%3Aci\n\n\u003c!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/dtsx/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/stacksjs/dtsx --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fdtsx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstacksjs%2Fdtsx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstacksjs%2Fdtsx/lists"}