Skip to content

Commit 51e3cb1

Browse files
authored
1 parent 335ef82 commit 51e3cb1

28 files changed

+691
-886
lines changed

.changeset/refactor-docs-ia.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"counterfact": patch
3+
---
4+
5+
Refactor docs information architecture: `docs/usage.md` is now a central hub page linking to individual feature pages under `docs/features/`, and pattern pages are consolidated under `docs/patterns/index.md`.

.github/issue-proposals/docs-pattern-persistent-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ A `Persistent State` pattern document would describe:
3939
- [ ] `--persist-state <path>` CLI flag (or equivalent) is implemented
4040
- [ ] Context classes can opt in to persistence by implementing a documented interface
4141
- [ ] `docs/patterns/persistent-state.md` is added following the established pattern format
42-
- [ ] The new pattern is linked in `docs/usage-patterns.md`
42+
- [ ] The new pattern is linked in `docs/patterns/index.md`
4343
- [ ] The reference doc is updated to describe the new CLI flag and context interface

.github/issue-proposals/docs-pattern-record-and-replay.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ A `Record and Replay` usage pattern document would describe:
3030

3131
- [ ] A `--record` (or equivalent) CLI flag is implemented that writes captured responses to handler files
3232
- [ ] `docs/patterns/record-and-replay.md` is added following the established pattern format (Context, Problem, Solution, Example, Consequences, Related Patterns)
33-
- [ ] The new pattern is linked in `docs/usage-patterns.md`
33+
- [ ] The new pattern is linked in `docs/patterns/index.md`
3434
- [ ] The reference doc is updated to describe the new CLI flag

.github/issue-proposals/docs-pattern-webhook-simulation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ A `Webhook Simulation` pattern document would describe:
3434

3535
- [ ] An outbound-call mechanism (e.g., `$.webhook()` or `$.emit()`) is implemented and documented
3636
- [ ] `docs/patterns/webhook-simulation.md` is added following the established pattern format
37-
- [ ] The new pattern is linked in `docs/usage-patterns.md`
37+
- [ ] The new pattern is linked in `docs/patterns/index.md`
3838
- [ ] The reference doc is updated to describe the new API

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ In five minutes, you turned a static spec into a working system:
178178
| | |
179179
|---|---|
180180
| [Getting started](./docs/getting-started.md) | Detailed walkthrough with state, REPL, and proxy |
181-
| [Usage guide](./docs/usage.md) | Routes, context, REPL, proxy, middleware, programmatic API |
182-
| [Usage patterns](./docs/usage-patterns.md) | Failures, latency, AI sandboxes, integration tests |
181+
| [Usage](./docs/usage.md) | Feature index: routes, context, REPL, proxy, middleware, and more |
182+
| [Patterns](./docs/patterns/index.md) | Failures, latency, AI sandboxes, integration tests |
183183
| [Reference](./docs/reference.md) | `$` API, CLI flags, architecture |
184184
| [How it compares](./docs/comparison.md) | json-server, WireMock, Prism, Microcks, MSW |
185185
| [FAQ](./docs/faq.md) | State, types, regeneration |

docs/comparison.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ npx counterfact@latest https://petstore3.swagger.io/api/v3/openapi.json api
102102
## See also
103103

104104
- [Getting started](./getting-started.md)
105-
- [Usage patterns](./usage-patterns.md)
105+
- [Patterns](./patterns/index.md)
106106
- [Reference](./reference.md)
107107
- [FAQ](./faq.md)
108-
- [Usage guide](./usage.md)
108+
- [Usage](./usage.md)

docs/context-change.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs/faq-generated-code.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

docs/faq.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ Wherever you tell it. The second argument to the CLI is the output directory. Us
287287
## See also
288288

289289
- [Getting started](./getting-started.md)
290-
- [Usage patterns](./usage-patterns.md)
290+
- [Patterns](./patterns/index.md)
291291
- [Reference](./reference.md)
292292
- [How it compares](./comparison.md)
293-
- [Generated code FAQ](./faq-generated-code.md)
294-
- [Usage guide](./usage.md)
293+
- [Usage](./usage.md)

docs/features/generated-code.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated Code
2+
3+
Counterfact generates two directories from your OpenAPI document:
4+
5+
- 📂 **`types/`** — fully typed request/response interfaces, auto-regenerated whenever the OpenAPI document changes. Don't edit these by hand.
6+
- 📂 **`routes/`** — one TypeScript file per API path. These are yours to edit. Out of the box each file returns a random, schema-valid response. You can leave them as-is or customize as much as you like.
7+
8+
See the [FAQ](../faq.md) for common questions about source control, editing, and regeneration.
9+
10+
No OpenAPI document? See [using Counterfact without OpenAPI](./without-openapi.md).
11+
12+
## See also
13+
14+
- [Routes](./routes.md) — writing route handlers, reading request data, building responses
15+
- [State](./state.md) — sharing state across routes with context objects
16+
- [Usage](../usage.md)

0 commit comments

Comments
 (0)