Registry / devops / codeshape

codeshape

JSON →
library3.1.5jsnpmunverified

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.

npm install codeshape
INSTALL
IMPORT
SIG · CODESHAPE
C
codeshape
devopsjavascriptv3.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

codeshape
npx codeshape [...tasks] [--flags]
require('codeshape')
codeshape is a CLI tool, not a library. Use npx or global install.
tasks
npx codeshape typecheck
npx codeshape --typecheck
Tasks are positional arguments, not flags. Use 'check' as shorthand.
typecheck
npx codeshape lint format
npx codeshape --tasks lint,format
Separate tasks with spaces, not commas.

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
codeshape --version
Debug
Known issues
breakingcodeshape 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.
affects: >=3.0.0
deprecatedThe --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.
affects: >=3.0.0
gotchaRunning `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.
affects: *
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.
affects: *
gotchaCompilation 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.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Command failed: npx codeshape typecheck Could not find module '@typescript/native-preview'
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: Failed to parse .lintignore: Unknown rule
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: No such flag: --compile
The flag name is `--compile-input` not `--compile`.
fix
Use `--compile-input <path>` instead of `--compile`.
Error: Cannot determine current working directory
Running in a deleted or inaccessible directory.
fix
Change to a valid directory before running codeshape.
Upgrade
Version history
3.1.5latest on npm
Audit
Dependencies
@typescript/native-previewrequiredTypeScript native runtime for typechecking
@biomejs/biomerequiredLinting and formatting engine
tsdownrequiredCompilation and bundling
Agent activity
11 hits · last 30 days
node
8
Resources
codeshape — npm install codeshape · libregistry