Registry / devops / tsdx
library2.0.0jsnpmunverified

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.

npm install tsdx
INSTALL
IMPORT
SIG · TSDX
T
tsdx
devopsjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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.

# Create a new package interactively bunx tsdx create mylib # Navigate to the project cd mylib # Install dependencies and start development server bun install bun run dev // In src/index.ts (example content): export const sum = (a: number, b: number): number => a + b; export const multiply = (a: number, b: number): number => a * b; console.log(sum(1, 2)); // Should output 3
tsdx --version
Debug
Known issues
breakingTSDX 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.
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.
affects: >=2.0.0
breakingStarting 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+.
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.
affects: >=0.14.0 <2.0.0
deprecatedThe `rootDir: './'` setting in `tsconfig.json` was deprecated in v0.13.0. Projects should use `rootDir: './src'` instead to ensure correct compilation and avoid warnings.
fix
Update your `tsconfig.json` to explicitly set `"rootDir": "./src"`.
affects: >=0.13.0
gotchaAn 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.
fix
Upgrade TSDX to version 0.14.1 or later, which includes a fix for this upstream caching issue.
affects: >=0.13.0 <0.14.1
gotchaFaulty `tsconfig.json` `include` arrays, specifically including `test` files, could lead to type declarations being generated in `dist/` for test files and slowing down builds.
fix
Upgrade TSDX to version 0.13.1 or later, or manually ensure your `tsconfig.json`'s `include` array excludes `test` directories.
affects: >=0.13.0 <0.13.1
Errors
Common errors & fixes
(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'
An upstream cache bug in `rollup-plugin-typescript2` affecting certain build formats in older TSDX versions.
fix
Upgrade TSDX to version 0.14.1 or newer to resolve this caching issue.
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.
Running TSDX v2.x with an unsupported Node.js version.
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.
TSDX Build Warning: Your tsconfig.json `rootDir` is set to `./`. Please consider changing it to `./src` for optimal build performance and consistent behavior.
Using the deprecated `rootDir: './'` setting in `tsconfig.json`.
fix
Edit your `tsconfig.json` file and set `"rootDir": "./src"`.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
tsdx — npm install tsdx · libregistry