Skip to content

Commit 84bebd5

Browse files
committed
chore(syncpack): update pinVersion to use local core package
1 parent 3678ab1 commit 84bebd5

3 files changed

Lines changed: 34 additions & 20 deletions

File tree

.syncpackrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"label": "Use workspace protocol when developing local packages",
66
"dependencies": ["$LOCAL"],
77
"dependencyTypes": ["peer", "dev", "prod"],
8-
"pinVersion": "workspace:*"
8+
"pinVersion": "file:../core"
99
}
1010
]
1111
}

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,52 @@ A concise, type-safe error handling toolkit for TypeScript inspired by Rust's th
1515
`@thaterror/core` package to define domain-driven error families with zero boilerplate, then adopt
1616
or serialize them with optional adapters (for example, a `pino` adapter is available).
1717

18-
This repository is split into focused packages:
18+
## The Core Value
19+
20+
Handling `Error` in large-scale TypeScript projects can be frustrating:
21+
22+
- `instanceof` is not always reliable across different packages, multiple versions, or due to structural typing matches.
23+
- Error context (Payload) is often lost during propagation.
24+
- Integrating third-party errors (e.g., `Hono`, `TypeORM`, `SyntaxError`) into your domain model usually requires messy
25+
manual conversion.
1926

20-
- [packages/core](./packages/core) — the main library: how to define errors, strong typing, adapters.
21-
- [packages/pino-adapter](./packages/pino-adapter) — a small adapter to serialize `ThatError` instances for `pino`.
27+
`thaterror` solves these with a **Schema-first** philosophy, bringing **Rust-like ergonomics** to TypeScript error
28+
handling.
2229

23-
Quick links
30+
## ✨ Features
2431

25-
- Core docs and examples: ./packages/core/README.md
26-
- Pino adapter: ./packages/pino-adapter/README.md
32+
- **🎯 Zero Boilerplate**: A single `That` call generates error factories with built-in type guards and payload
33+
support.
34+
- **🏗️ Domain-Driven**: Define error families that encapsulate your business logic.
35+
- **🌉 Native Integration**: "Naturalize" external errors into your family using `enroll` and `bridge`.
36+
- **🧠 Intelligent Transformation**: The `from` method provides strict type checking, ensuring only registered error
37+
types are processed.
38+
- **🦾 Total Type Safety**: Perfect type narrowing that automatically infers payload types from your schema.
39+
- **🦀 thiserror-like Experience**: Declarative, robust, and designed for developers who value type correctness.
40+
41+
## 🚀 Quick Start
42+
43+
This repository is split into focused packages:
44+
45+
- [@thaterror/core](./packages/core) — the main library: how to define errors, strong typing, adapters.
46+
- [@thaterror/pino-adapter](./packages/pino-adapter) — a small adapter to serialize `ThatError` instances for `pino`.
2747

2848
Installation
2949

3050
To use the core library:
3151

3252
```bash
33-
npm install @thaterror/core
34-
# or with bun
3553
bun add @thaterror/core
54+
// or with npm
55+
npm install @thaterror/core
3656
```
3757

3858
If you want the pino adapter for structured logging:
3959

4060
```bash
41-
npm install @thaterror/pino-adapter pino
61+
bun add @thaterror/pino-adapter pino
4262
```
4363

44-
Why split the docs?
45-
46-
- The repo root stays as a short project overview and entry point.
47-
- `packages/core` contains the concrete usage examples, API examples and advanced topics.
48-
- Package READMEs (like the pino adapter) are short and focused on integration and examples.
49-
5064
Contributing
5165

5266
See the individual package READMEs for development and testing instructions.

packages/core/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Define a family of domain errors with a single `That()` call and get:
1717
- `enroll` and `bridge` to map external errors into your family
1818
- Optional adapters (e.g. pino) for logging and serialization
1919

20-
## Installation
20+
## 📦 Installation
2121

2222
```bash
2323
npm install @thaterror/core
2424
# or with bun
2525
bun add @thaterror/core
2626
```
2727

28-
## Quick Start
28+
## 🚀 Quick Start
2929

3030
Create a central `errors.ts` to define your family:
3131

@@ -56,7 +56,7 @@ if (e instanceof Error) {
5656
}
5757
```
5858

59-
## Adopting external errors
59+
## 🧪 Adopting external errors
6060

6161
### enroll (one-to-one)
6262

@@ -106,7 +106,7 @@ try {
106106
}
107107
```
108108

109-
## Deterministic Tracing with `.with()`
109+
## 🎯 Deterministic Tracing with `.with()`
110110

111111
When creating errors inside callbacks (for example, `ResultAsync.fromPromise`), V8 may capture a stack trace that
112112
starts inside the callback library rather than your code. Calling `.with()` within the callback preserves the stack

0 commit comments

Comments
 (0)