Skip to content

canship 0.8.0

Choose a tag to compare

@Tasomei Tasomei released this 10 Oct 10:33
· 20 commits to main since this release

Added

Route coverage

  • Hono OpenAPIHono.openapi() handlers, openapiRoutes() batches, and route configurations imported from other modules. Unresolved batch entries mark coverage incomplete instead of being skipped silently.
  • Project router factories (const app = makeApp()) for Express, Hono and Fastify, including single-target tsconfig/jsconfig paths and explicitly linked workspace packages.

Baselines and comparison

  • Baseline v4 with optional acceptance reasons and UTC expiry. --baseline-review, --baseline-prune and --baseline-accept print reviewed candidates without changing the source file; --baseline-migrate upgrades v2/v3 baselines.
  • Stable v3 finding identity: title, wording and line moves no longer change a finding's identity.
  • --compare=before.json --with=after.json lists added, persisting and no-longer-observed findings in the terminal, JSON or an offline HTML view. Absence is not reported as a fix.

Scanning workflow

  • --workspace=PATH scans explicit subprojects independently, each with its own configuration and baseline.
  • --exclude=PATH excludes literal paths and discloses them in every report.
  • --explain-config, --doctor and a bundled JSON schema for canship.config.json with line/column diagnostics.
  • --init=config|ci|ci-workspaces|pre-commit previews templates without writing files.
  • --share-summary prints counts and scope flags without paths or project text.
  • Interactive progress and Ctrl+C cancellation; the scan() API accepts signal and onProgress.
  • --build-info identifies development, prerelease and release builds.

Reports

  • Scoped before/after remediation examples in the terminal, HTML and fix prompts.
  • HTML confidence filter, stable finding links and accessibility improvements.

Opt-in deployment probes

  • --probe=https://… previews an HTTPS HEAD/OPTIONS plan; requests are sent only with the matching --confirm-probe digest. Static scans remain offline.

VS Code extension (development preview)

  • Bundled scanner, Problems integration, fix-prompt copy and reviewed line suppressions. Not published to the Marketplace; see the extension README to build a local VSIX.

Fixed

  • Conditional middleware no longer protects routes registered outside its branch.
  • Authentication middleware re-exported through a barrel module (export * from, export { name } from) is now followed to its definition, and Hono routes that helper functions register on a sub-app mounted from another file now inherit that mount's middleware. Previously such routes were reported as unauthenticated writes at likely confidence.
  • Consistent verdicts and follow-up commands across terminal, HTML and JSON; PowerShell-safe quoting on Windows.
  • Stable errors[].code values and a final output status when report writing fails.

Compatibility

  • New baselines are v4. v2/v3 remain readable; older scanners reject v4 instead of ignoring expiry.
  • GitHub code scanning alert identity was verified across repeated uploads, moved lines, changed wording/version and a partial fix. GitHub's own line hash also covers nearby code, so editing adjacent lines can still open a new alert.
  • The Action now defaults to 0.8.0, and the README pins the Action commit that uses it.

Usage

npx canship@0.8.0 .

Requires Node.js 18 or later; no runtime dependencies. Static scanning does not execute project code or make network requests. Findings describe static evidence and do not prove exploitability.

npm package · Documentation · 简体中文 · Changes since 0.7.1

Source commit: 0700a3d119573b1d13c5f5b60f4e93ab87244b35.