codeshape
v3.1.5
Published
Code postprocessing utility: typecheck, lint, format, compile, emit types
Maintainers
Readme
codeshape
Code postprocessing utility, a thin abstraction layer over evolving toolsets.
Usage: npx codeshape [...space-separated tasks] [...--flags]
Default entry point: ./index.ts
Performed tasks:
typecheck(withtsgofrom@typescript/native-preview)lint,format(with@biomejs/biome)- use
--no-committo skip the fix commit - use
-m <message>to set a fix commit message (default:lint) - use
--vcs-disabledto opt out from using.gitignore - use a
.lintignoreplain-text file to list specific path patterns to be ignored by this task (in a format similar to.gitignore) - use a
.lintincludeplain-text file to list specific path patterns to be handled by this task (in a format similar to.gitignore) (default: the entire current directory), mark excluded paths with a leading!in this file
- use
compile(withtsdown)- use
--no-dtsto skip emitting a type declaration file - use
--esm-onlyto produce only an ESM.jsfile (default: ESM.mjsand CJS.cjs) - use
--compile-input <...space-separated paths>(default:./index.ts) and--compile-output <path>(default:./dist) to set an entry point and an output directory - use
--compile-platformto set a target platform (default:node, other options:browser,neutral) - use
--minifyto minify the output - use
--tsconfig <path>to point to a custom TS config file
- use
Use npx codeshape check as a shorthand version of npx codeshape typecheck lint format.
Example 1: npx codeshape runs typechecking, linting, formatting, adds a fix commit if needed, compiles ./index.ts to ./dist/index.mjs and ./dist/index.cjs, emits type declarations to ./dist/index.d.ts.
Example 2: npx codeshape check --no-commit runs typechecking, linting, formatting (without adding a fix commit).
Example 3: npx codeshape typecheck runs typechecking.
Any of these one-liners can be run in a directory or added to package.json scripts without manually installing packages.
