{"id":15866,"library":"ts-project-bundle","title":"TypeScript Project Bundler","description":"ts-project-bundle is an experimental command-line interface (CLI) tool designed to simplify the bundling of TypeScript projects that leverage TypeScript's project references feature. Versioned at 0.0.12 and explicitly marked as a \"prototype,\" it offers a basic mechanism to combine a main TypeScript project and its declared library dependencies into a single output directory, preserving their relative folder structure. Unlike full-featured bundlers such as Webpack or Rollup, ts-project-bundle focuses on the compilation and file restructuring aspects, relying on `tsc --build` for the initial compilation phase. Its primary differentiator is its direct integration with TypeScript project references, aiming to provide a lightweight solution for consolidating compiled output, particularly useful in monorepo environments where multiple interdependent TypeScript packages need to be deployed together. The tool's development appears to have ceased, with no significant updates since late 2022, indicating an abandoned status.","status":"abandoned","version":"0.0.12","language":"javascript","source_language":"en","source_url":"https://ashleydavis@github.com/ashleydavis/ts-project-bundle","tags":["javascript","typescript"],"install":[{"cmd":"npm install ts-project-bundle","lang":"bash","label":"npm"},{"cmd":"yarn add ts-project-bundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add ts-project-bundle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime dependency for compiling TypeScript projects and utilizing project references. The tool wraps `tsc --build`.","package":"typescript","optional":false}],"imports":[{"note":"This package is a command-line interface (CLI) tool. It is executed directly via `npx` or a `package.json` script, and does not expose a programmatic API for `import` or `require`.","symbol":"ts-project-bundle","correct":"npx ts-project-bundle [options]"}],"quickstart":{"code":"# Assume current working directory is a monorepo root: ~/my-monorepo\n# This quickstart demonstrates creating a simple monorepo with two TypeScript packages,\n# 'common' and 'api', where 'api' depends on 'common' via project references.\n\n# 1. Create dummy package 'common'\nmkdir -p packages/common/src\necho 'export const getGreeting = (name: string) => `Hello, ${name}!`;' > packages/common/src/index.ts\necho '{ \"compilerOptions\": { \"outDir\": \"dist\", \"rootDir\": \"src\", \"target\": \"es2020\", \"module\": \"commonjs\", \"strict\": true }, \"include\": [\"src\"] }' > packages/common/tsconfig.json\ncd packages/common\nnpm init -y # Initialize common package\ncd ../.. # Back to monorepo root\n\n# 2. Create dummy package 'api' that depends on 'common'\nmkdir -p packages/api/src\necho 'import { getGreeting } from \"@myorg/common\"; console.log(getGreeting(\"World\"));' > packages/api/src/index.ts\necho '{ \"compilerOptions\": { \"outDir\": \"dist\", \"rootDir\": \"src\", \"target\": \"es2020\", \"module\": \"commonjs\", \"strict\": true, \"baseUrl\": \".\", \"paths\": { \"@myorg/common\": [\"../common/src\"] } }, \"references\": [{ \"path\": \"../common\" }], \"include\": [\"src\"] }' > packages/api/tsconfig.json\ncd packages/api\nnpm init -y # Initialize api package\nnpm install --save-dev ts-project-bundle typescript # Install ts-project-bundle and TS locally\n\n# 3. Crucial: Compile the project and its references using tsc --build\nnpx tsc --build\n\n# 4. Run ts-project-bundle from the 'api' package\n# --root points to the monorepo root (where 'packages' is)\n# --project points to the current 'api' directory\n# --out specifies the output folder relative to the project (api)\nnpx ts-project-bundle --root=../../ --project=. --out=./out-bundle\n\necho \"\\nCheck the 'packages/api/out-bundle' directory for the bundled output.\"\n","lang":"bash","description":"Demonstrates how to install and run `ts-project-bundle` on a minimal TypeScript project leveraging project references, compiling and consolidating its output into a single directory structure."},"warnings":[{"fix":"Use with caution for experimental purposes only. Do not rely on it for critical applications.","message":"The package is explicitly marked as a 'prototype' (version 0.0.12) and is not intended for production use. Its API and behavior are unstable and subject to change without warning.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Consider alternatives for robust bundling solutions like `esbuild`, `Rollup.js`, or `Webpack` that are actively maintained. If used, be prepared to fork and maintain the codebase yourself.","message":"Development of `ts-project-bundle` appears to be abandoned, with the last commit in September 2022. There is no active maintenance, bug fixes, or feature development expected.","severity":"gotcha","affected_versions":">=0.0.12"},{"fix":"Ensure your TypeScript projects are properly configured with project references and `tsconfig.json` files in all relevant directories.","message":"This tool is fundamentally designed around TypeScript Project References. Projects not configured with `tsconfig.json` `references` will not leverage its core functionality and may fail.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Always execute `npx tsc --build` in your main project directory before running `ts-project-bundle` to ensure all dependencies are built.","message":"The tool requires `npx tsc --build` to be run *before* `ts-project-bundle` to ensure all dependent projects are compiled. Skipping this step will result in bundling uncompiled or outdated code.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"Ensure the directory where `ts-project-bundle` is run, or the directory specified by `--project`, contains a valid `tsconfig.json` file.","cause":"The specified project directory (or current working directory if not specified) is not a valid TypeScript project or is missing its `tsconfig.json` file.","error":"Error: Project directory does not contain a tsconfig.json file."},{"fix":"Verify that your main project's `tsconfig.json` includes valid `references` to its dependent TypeScript libraries, ensuring all paths are correct.","cause":"The main project's `tsconfig.json` does not contain a `references` array, or the paths specified within it are invalid/unresolvable.","error":"Error: No TypeScript project references found for project: [path]"},{"fix":"Address any compilation errors reported by `tsc --build` before attempting to bundle. Ensure all projects compile successfully independently.","cause":"TypeScript compilation failed due to syntax errors, missing dependencies, or incorrect `tsconfig.json` configurations in the main project or its referenced projects.","error":"Command failed with exit code 1: tsc --build"},{"fix":"Carefully review the `--root` and `--project` arguments to ensure they correctly point to the monorepo root and the main project directory, respectively, relative to where the command is executed.","cause":"This often occurs when the `--root` or `--project` paths are incorrectly specified, leading the bundler to look for files in the wrong locations or failing to resolve module paths correctly.","error":"Error: ENOENT: no such file or directory, stat '/path/to/missing/file'"}],"ecosystem":"npm"}