diff --git a/.changeset/boundary-try.md b/.changeset/boundary-try.md deleted file mode 100644 index 93d0827..0000000 --- a/.changeset/boundary-try.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"faultline": minor ---- - -Add `boundary.try(error)` — a non-throwing variant of a boundary that returns `Result` instead of throwing on an unmapped tag. Boundaries usually sit at a transport edge where an uncaught throw is costly; `.try()` lets you handle an unexpected (untyped/foreign) error tag as a value. Exposes the `BoundaryViolationError` type. diff --git a/.changeset/cli-node-publishable.md b/.changeset/cli-node-publishable.md deleted file mode 100644 index 884818f..0000000 --- a/.changeset/cli-node-publishable.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"faultline-cli": minor ---- - -The CLI is now publishable to npm and runs on plain Node.js (>=18). The `bin` points at a built `dist/index.js` with a Node shebang (previously a raw `.ts` file with a `bun` shebang), `typescript` is declared as a runtime dependency, and the package ships a `files` allowlist, README, LICENSE, and full repository metadata. diff --git a/.changeset/eslint-plugin-publish-fixes.md b/.changeset/eslint-plugin-publish-fixes.md deleted file mode 100644 index 792fcff..0000000 --- a/.changeset/eslint-plugin-publish-fixes.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"eslint-plugin-faultline": minor ---- - -Rule improvements and publish-readiness fixes. - -Rules: -- `throw-type-mismatch` now inspects all overload signatures, not just the first — overloaded functions are fully checked for transitive error propagation. -- `throw-type-mismatch` reports `throw ` when the surrounding function declares a `TypedPromise` error type and the thrown variable's type has no resolvable `_tag`. -- `uncovered-catch` no longer misattributes throws inside async closures (e.g. `setTimeout(async () => ...)`) to the outer try's catch. -- Published `LIMITATIONS.md` documenting patterns the rules can't detect, plus an 11-pattern torture-fixture corpus guarding the rules. - -Packaging: -- Ship the previously-missing `README.md` (it was already listed in `files`). -- Derive `meta.version` from `package.json` at build time so it can no longer drift from the published version (was hardcoded `0.1.0`). -- Run tests as part of `prepublishOnly`. diff --git a/.changeset/redaction-globstar.md b/.changeset/redaction-globstar.md deleted file mode 100644 index 15ad9fd..0000000 --- a/.changeset/redaction-globstar.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"faultline": minor ---- - -Redaction: support a `**` globstar segment in `redactPaths` to redact a key at any depth (e.g. `**.password`). Redaction paths are matched against the serialized error structure and a non-matching path is a silent no-op (it fails open), so `**.` is now the recommended form for sensitive keys — it can't silently miss a nested occurrence the way a brittle exact path can. Documented this behavior in the README and SECURITY.md. - -Also clarified (docs only, no behavior change): `attemptAsync`/`TaskResult` cancellation is cooperative — aborting short-circuits *subsequent* steps and stops the caller waiting, but does not preempt in-flight work unless your function threads the `AbortSignal` through. And `defineBoundary` throws `System.BoundaryViolation` (preserving the original as cause) when an unmapped error tag reaches it. diff --git a/.changeset/taskresult-cancellation.md b/.changeset/taskresult-cancellation.md deleted file mode 100644 index eee3754..0000000 --- a/.changeset/taskresult-cancellation.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"faultline": minor ---- - -TaskResult cancellation, rejection safety, and API pruning. - -Breaking changes: -- `TaskResult.toPromise()` removed. Use `.run()` instead — same signature. -- TaskResult chain methods (`.map`, `.andThen`, `.catchTag`, etc.) now widen their error union to include `System.Cancelled`. Exhaustive `match()` over a TaskResult needs a `'System.Cancelled'` handler or a `_` branch. -- `TaskResult.fromPromise` return type now widens to include `System.Unexpected`. Factory rejections are no longer unhandled — they are caught and wrapped as `System.Unexpected` with the original throw preserved as `.cause`. - -Added: -- TaskResult chain steps check `context.signal?.aborted` between every step. Aborting the signal mid-pipeline short-circuits the remaining steps to `System.Cancelled` instead of running them to completion. diff --git a/packages/eslint-plugin-faultline/CHANGELOG.md b/packages/eslint-plugin-faultline/CHANGELOG.md new file mode 100644 index 0000000..3e87274 --- /dev/null +++ b/packages/eslint-plugin-faultline/CHANGELOG.md @@ -0,0 +1,20 @@ +# eslint-plugin-faultline + +## 0.3.0 + +### Minor Changes + +- 7a010cc: Rule improvements and publish-readiness fixes. + + Rules: + + - `throw-type-mismatch` now inspects all overload signatures, not just the first — overloaded functions are fully checked for transitive error propagation. + - `throw-type-mismatch` reports `throw ` when the surrounding function declares a `TypedPromise` error type and the thrown variable's type has no resolvable `_tag`. + - `uncovered-catch` no longer misattributes throws inside async closures (e.g. `setTimeout(async () => ...)`) to the outer try's catch. + - Published `LIMITATIONS.md` documenting patterns the rules can't detect, plus an 11-pattern torture-fixture corpus guarding the rules. + + Packaging: + + - Ship the previously-missing `README.md` (it was already listed in `files`). + - Derive `meta.version` from `package.json` at build time so it can no longer drift from the published version (was hardcoded `0.1.0`). + - Run tests as part of `prepublishOnly`. diff --git a/packages/eslint-plugin-faultline/package.json b/packages/eslint-plugin-faultline/package.json index 055d563..bb9b27f 100644 --- a/packages/eslint-plugin-faultline/package.json +++ b/packages/eslint-plugin-faultline/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-faultline", - "version": "0.2.0", + "version": "0.3.0", "description": "ESLint rules for type-safe error handling — checks that catch blocks cover all throwable error types.", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -12,16 +12,24 @@ } } }, - "files": ["dist", "README.md", "LICENSE"], + "files": [ + "dist", + "README.md", + "LICENSE" + ], "scripts": { "build": "tsdown src/index.ts --format cjs --dts", "test": "bun test", "typecheck": "bunx tsc --noEmit", "prepublishOnly": "bun run typecheck && bun run test && bun run build" }, - "publishConfig": { "access": "public" }, + "publishConfig": { + "access": "public" + }, "sideEffects": false, - "engines": { "node": ">=18.0.0" }, + "engines": { + "node": ">=18.0.0" + }, "repository": { "type": "git", "url": "https://github.com/danfry1/faultline.git", @@ -42,5 +50,13 @@ "tsdown": "^0.9.0", "typescript": "^5.9.3" }, - "keywords": ["eslint", "eslintplugin", "typescript", "errors", "error-handling", "type-safe", "faultline"] + "keywords": [ + "eslint", + "eslintplugin", + "typescript", + "errors", + "error-handling", + "type-safe", + "faultline" + ] } diff --git a/packages/faultline-cli/CHANGELOG.md b/packages/faultline-cli/CHANGELOG.md new file mode 100644 index 0000000..9ae01e8 --- /dev/null +++ b/packages/faultline-cli/CHANGELOG.md @@ -0,0 +1,7 @@ +# faultline-cli + +## 0.2.0 + +### Minor Changes + +- 7a010cc: The CLI is now publishable to npm and runs on plain Node.js (>=18). The `bin` points at a built `dist/index.js` with a Node shebang (previously a raw `.ts` file with a `bun` shebang), `typescript` is declared as a runtime dependency, and the package ships a `files` allowlist, README, LICENSE, and full repository metadata. diff --git a/packages/faultline-cli/package.json b/packages/faultline-cli/package.json index 0fc3d4d..0e6cb22 100644 --- a/packages/faultline-cli/package.json +++ b/packages/faultline-cli/package.json @@ -1,6 +1,6 @@ { "name": "faultline-cli", - "version": "0.1.0", + "version": "0.2.0", "description": "CLI for Faultline — error catalog, lint, doctor, and flow graph.", "type": "module", "bin": { diff --git a/packages/faultline/CHANGELOG.md b/packages/faultline/CHANGELOG.md index 83011ce..325f2c6 100644 --- a/packages/faultline/CHANGELOG.md +++ b/packages/faultline/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 0.3.0 + +### Minor Changes + +- 7a010cc: Add `boundary.try(error)` — a non-throwing variant of a boundary that returns `Result` instead of throwing on an unmapped tag. Boundaries usually sit at a transport edge where an uncaught throw is costly; `.try()` lets you handle an unexpected (untyped/foreign) error tag as a value. Exposes the `BoundaryViolationError` type. +- 7a010cc: Redaction: support a `**` globstar segment in `redactPaths` to redact a key at any depth (e.g. `**.password`). Redaction paths are matched against the serialized error structure and a non-matching path is a silent no-op (it fails open), so `**.` is now the recommended form for sensitive keys — it can't silently miss a nested occurrence the way a brittle exact path can. Documented this behavior in the README and SECURITY.md. + + Also clarified (docs only, no behavior change): `attemptAsync`/`TaskResult` cancellation is cooperative — aborting short-circuits _subsequent_ steps and stops the caller waiting, but does not preempt in-flight work unless your function threads the `AbortSignal` through. And `defineBoundary` throws `System.BoundaryViolation` (preserving the original as cause) when an unmapped error tag reaches it. + +- 7a010cc: TaskResult cancellation, rejection safety, and API pruning. + + Breaking changes: + + - `TaskResult.toPromise()` removed. Use `.run()` instead — same signature. + - TaskResult chain methods (`.map`, `.andThen`, `.catchTag`, etc.) now widen their error union to include `System.Cancelled`. Exhaustive `match()` over a TaskResult needs a `'System.Cancelled'` handler or a `_` branch. + - `TaskResult.fromPromise` return type now widens to include `System.Unexpected`. Factory rejections are no longer unhandled — they are caught and wrapped as `System.Unexpected` with the original throw preserved as `.cause`. + + Added: + + - TaskResult chain steps check `context.signal?.aborted` between every step. Aborting the signal mid-pipeline short-circuits the remaining steps to `System.Cancelled` instead of running them to completion. + ## 0.1.0 Initial release. diff --git a/packages/faultline/faultline-0.2.0.tgz b/packages/faultline/faultline-0.2.0.tgz new file mode 100644 index 0000000..4de941e Binary files /dev/null and b/packages/faultline/faultline-0.2.0.tgz differ diff --git a/packages/faultline/package.json b/packages/faultline/package.json index 4885e2b..eaddc0c 100644 --- a/packages/faultline/package.json +++ b/packages/faultline/package.json @@ -1,6 +1,6 @@ { "name": "faultline", - "version": "0.2.0", + "version": "0.3.0", "description": "The incremental type-safe error system for TypeScript.", "author": "Daniel Fry", "license": "MIT",