CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-turbo

High-performance build system for JavaScript and TypeScript codebases with intelligent caching and task scheduling.

Pending
Overview
Eval results
Files

package-management.mddocs/

Package Management

Tools for analyzing, filtering, and managing packages within your monorepo structure, including package listing and workspace pruning functionality.

Capabilities

List Packages

List and analyze packages in your monorepo with flexible filtering and output options.

turbo ls [packages...] [options]

# List all packages
turbo ls

# List specific packages with details
turbo ls @myorg/web-app @myorg/api

# List only affected packages
turbo ls --affected

# List packages matching filter
turbo ls --filter="@myorg/*"

List Options:

# Package filtering
--affected                         # Show only packages affected by changes
--filter <selector> / -F           # Package selector (pnpm syntax)

# Output formatting
--output <format>                  # Output format (pretty|json)

Usage Examples:

# List all packages in human-readable format
turbo ls

# List packages as JSON for programmatic use
turbo ls --output=json

# Show only packages affected by changes since main branch
turbo ls --affected

# List packages in a specific scope
turbo ls --filter="@myorg/*"

# Get details about specific packages
turbo ls web-app ui-lib --output=json

Prune Workspace

Create a subset of your monorepo containing only the specified packages and their dependencies.

turbo prune <scope> [options]

# Prune to specific package
turbo prune @myorg/web-app

# Prune multiple packages
turbo prune @myorg/web-app @myorg/api

# Prune for Docker deployment
turbo prune @myorg/web-app --docker

Prune Options:

# Output configuration
--out-dir <path>                   # Output directory (default: "out")

# Docker optimization
--docker                           # Enable Docker-optimized output

# File handling
--use-gitignore <bool>             # Respect .gitignore when copying (default: true)

Usage Examples:

# Create subset for web app deployment
turbo prune @myorg/web-app --out-dir=deploy

# Prune for Docker with optimized layer structure
turbo prune @myorg/api --docker --out-dir=docker-context

# Prune without respecting .gitignore
turbo prune @myorg/web-app --use-gitignore=false

# Prune multiple related packages
turbo prune @myorg/web-app @myorg/shared-lib

Package Filtering

Advanced package selection using pnpm-style selectors for precise targeting.

# Filter syntax patterns
--filter="<package-name>"          # Exact package name
--filter="@scope/*"                # All packages in scope
--filter="./apps/*"                # Packages in directory
--filter="...@myorg/web-app"       # Package and its dependencies
--filter="@myorg/web-app..."       # Package and its dependents
--filter="...[HEAD~1]"             # Changed packages since commit
--filter="...{./apps/web}"         # Dependencies of package in directory

Filter Examples:

# Select specific package
turbo run build --filter="@myorg/web-app"

# Select all packages in apps directory
turbo run build --filter="./apps/*"

# Select package and all its dependencies
turbo run build --filter="...@myorg/web-app"

# Select package and all its dependents
turbo run build --filter="@myorg/shared-lib..."

# Select only changed packages
turbo run test --filter="...[HEAD~1]"

# Combine multiple filters
turbo run build --filter="@myorg/*" --filter="!@myorg/old-*"

Affected Package Detection

Automatically detect which packages have changed and need to be rebuilt or tested.

# Affected package options
--affected                         # Only include affected packages

# Works with most commands
turbo run build --affected
turbo run test --affected  
turbo ls --affected

Usage Examples:

# Run tests only for affected packages
turbo run test --affected

# Build only what has changed
turbo run build --affected

# List affected packages for review
turbo ls --affected --output=json

Package Information Types

interface PackageInfo {
  name: string;
  version: string;
  path: string;
  packageJson: PackageJson;
  dependencies: string[];
  devDependencies: string[];
  scripts: Record<string, string>;
}

interface PackageJson {
  name: string;
  version: string;
  scripts?: Record<string, string>;
  dependencies?: Record<string, string>;
  devDependencies?: Record<string, string>;
  peerDependencies?: Record<string, string>;
  workspaces?: string[] | WorkspaceConfig;
}

interface WorkspaceConfig {
  packages: string[];
  nohoist?: string[];
}

interface PruneOptions {
  scope: string[];
  docker: boolean;
  output_dir: string;
  use_gitignore: boolean;
}

interface ListOptions {
  packages: string[];
  affected: boolean;
  filter: string[];
  output: "pretty" | "json";
}

Install with Tessl CLI

npx tessl i tessl/npm-turbo

docs

caching-performance.md

code-generation.md

index.md

package-management.md

remote-cache.md

system-management.md

task-execution.md

tile.json