codeshape

raw JSON →
3.1.5 verified Fri May 01 auth: no javascript

Code postprocessing utility that abstracts over evolving toolsets: typecheck via @typescript/native-preview tsgo, lint/format via @biomejs/biome, compile via tsdown, emit type declarations. v3.1.5 is current stable. Active development. Key differentiator: single npx command replacing separate tsc, biome, and bundler steps, with zero config defaults but customizable via flags and config files.

error Error: Command failed: npx codeshape typecheck Could not find module '@typescript/native-preview'
cause Missing dependency when running without automatic npx resolution.
fix
Run npx codeshape in a directory where the package can find its dependencies, or install globally: npm i -g codeshape.
error Error: Failed to parse .lintignore: Unknown rule
cause The .lintignore file uses a custom format not compatible with gitignore.
fix
Ensure .lintignore uses the same format as .gitignore (each line a pattern).
error error: No such flag: --compile
cause The flag name is `--compile-input` not `--compile`.
fix
Use --compile-input <path> instead of --compile.
error Error: Cannot determine current working directory
cause Running in a deleted or inaccessible directory.
fix
Change to a valid directory before running codeshape.
breaking codeshape 3.x removed support for custom formatters other than biome. Use biome flags or config for formatting.
fix Migrate any custom formatter setup to biome configuration.
deprecated The --use-prettier flag was deprecated in v2 and removed in v3. Biome is the only formatter.
fix Remove --use-prettier, use --no-commit if needed.
gotcha Running `npx codeshape` without specifying tasks defaults to all tasks: typecheck, lint, format, compile.
fix Use explicit tasks like `npx codeshape check` to avoid unintended compilation.
gotcha .lintignore and .lintinclude files override each other; if both exist, .lintignore is applied after .lintinclude.
fix Use only one of the two to avoid confusion.
gotcha Compilation with --compile-platform neutral may generate code incompatible with Node.js APIs.
fix Set --compile-platform to 'node' for Node.js projects, 'browser' for browser projects.
npm install codeshape
yarn add codeshape
pnpm add codeshape

Runs typechecking, linting, formatting (without committing), then compiles ESM-only minified output from src/index.ts to build/.

npx codeshape typecheck lint format compile --no-commit --esm-only --minify --compile-input ./src/index.ts --compile-output ./build