{"id":12195,"library":"tsdx","title":"TSDX","description":"TSDX is a zero-configuration command-line interface (CLI) for modern TypeScript package development, currently stable at version 2.0.0. It aims to simplify the creation, testing, and publication of TypeScript libraries by abstracting away complex build configurations. Version 2.0.0 represents a complete rewrite, transitioning to high-performance Rust-based tooling, including bunchee for bundling, Vitest for testing, OXLint for linting, and OXFmt for formatting. While it doesn't adhere to a fixed release cadence, major updates like v2.0.0 introduce significant architectural shifts and toolchain changes. Its key differentiators include the 'zero-config' philosophy, the integration of lightning-fast Rust tools for improved developer experience, built-in support for dual ESM/CommonJS outputs, and robust TypeScript declaration generation.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/jaredpalmer/tsdx","tags":["javascript","typescript","bundle","bunchee","vitest","oxlint"],"install":[{"cmd":"npm install tsdx","lang":"bash","label":"npm"},{"cmd":"yarn add tsdx","lang":"bash","label":"yarn"},{"cmd":"pnpm add tsdx","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[],"quickstart":{"code":"# Create a new package interactively\nbunx tsdx create mylib\n\n# Navigate to the project\ncd mylib\n\n# Install dependencies and start development server\nbun install\nbun run dev\n\n// In src/index.ts (example content):\nexport const sum = (a: number, b: number): number => a + b;\nexport const multiply = (a: number, b: number): number => a * b;\n\nconsole.log(sum(1, 2)); // Should output 3\n","lang":"typescript","description":"This quickstart demonstrates how to create a new TSDX project, install its dependencies using Bun, and start the development server for real-time compilation and testing."},"warnings":[{"fix":"Ensure your Node.js environment is Node.js 20 or newer. Consult the TSDX migration guide for detailed steps when upgrading from 0.x.","message":"TSDX v2.0.0 is a complete rewrite using a new toolchain (bunchee, Vitest, oxlint, oxfmt) that requires Node.js 20+. This represents a significant breaking change from previous 0.x versions.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade your Node.js installation to version 10 or higher for v0.x, or Node.js 20+ for v2.x, to ensure compatibility with TSDX and its underlying dependencies.","message":"Starting with TSDX v0.14.0, Node.js 8 is no longer supported; the minimum required Node.js version was updated to 10. Later, v2.0.0 increased this requirement to Node.js 20+.","severity":"breaking","affected_versions":">=0.14.0 <2.0.0"},{"fix":"Update your `tsconfig.json` to explicitly set `\"rootDir\": \"./src\"`.","message":"The `rootDir: './'` setting in `tsconfig.json` was deprecated in v0.13.0. Projects should use `rootDir: './src'` instead to ensure correct compilation and avoid warnings.","severity":"deprecated","affected_versions":">=0.13.0"},{"fix":"Upgrade TSDX to version 0.14.1 or later, which includes a fix for this upstream caching issue.","message":"An upstream cache bug in `rollup-plugin-typescript2` could lead to `ENOENT: no such file or directory, rename '[...]/node_modules/.cache/rollup-plugin-typescript2/...'` errors during builds, particularly with certain build format combinations.","severity":"gotcha","affected_versions":">=0.13.0 <0.14.1"},{"fix":"Upgrade TSDX to version 0.13.1 or later, or manually ensure your `tsconfig.json`'s `include` array excludes `test` directories.","message":"Faulty `tsconfig.json` `include` arrays, specifically including `test` files, could lead to type declarations being generated in `dist/` for test files and slowing down builds.","severity":"gotcha","affected_versions":">=0.13.0 <0.13.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade TSDX to version 0.14.1 or newer to resolve this caching issue.","cause":"An upstream cache bug in `rollup-plugin-typescript2` affecting certain build formats in older TSDX versions.","error":"(typescript) Error: ENOENT: no such file or directory, rename '[...]/my-lib/node_modules/.cache/rollup-plugin-typescript2/rpt2_4c61ae4392b9bd24f4d43d13a3f56419b8b5805d/code/cache_' -> '[...]/my-lib/node_modules/.cache/rollup-plugin-typescript2/rpt2_4c61ae4392b9bd24f4d43d13a3f56419b8b5805d/code/cache'"},{"fix":"Upgrade your Node.js installation to version 20 or higher. You can use a version manager like `nvm` or `fnm` to manage multiple Node.js versions.","cause":"Running TSDX v2.x with an unsupported Node.js version.","error":"Error: Your current Node.js version (X) does not meet the minimum requirement of >=20 for TSDX v2.x. Please upgrade your Node.js version."},{"fix":"Edit your `tsconfig.json` file and set `\"rootDir\": \"./src\"`.","cause":"Using the deprecated `rootDir: './'` setting in `tsconfig.json`.","error":"TSDX Build Warning: Your tsconfig.json `rootDir` is set to `./`. Please consider changing it to `./src` for optimal build performance and consistent behavior."}],"ecosystem":"npm"}