📝 Add index pages for documentation sections#6845
Conversation
Adds a landing page to every doc category that previously had none, using the same `index.md` + `<DocCardList />` pattern as the tutorials section. Each page carries a specific cross-cutting insight (arbitraries pipeline, shrink targets, two-level configuration model, ...) rather than rephrasing its children. The migration category has only one guide, so its `_category_.json` is re-pointed directly at that guide instead of adding a boilerplate index.
|
|
👋 It looks like the PR template was not used for this pull request. Please edit the PR description to use the template, or close this PR and open a new one that uses it. The template includes:
Thank you for your contribution! 🙏 |
@fast-check/ava
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
Converts `*italic*` to `_italic_` per the repo's prettier config.
|
@claude do we still need the category.json if we have the index pages? if not drop them |
|
Claude finished @dubzzz's task in 7m 24s —— View job Done —
|
Co-authored-by: Nicolas DUBIEN <[email protected]>
With index.md pages in each category, the _category_.json files are no longer needed — sidebar_position in the index frontmatter replaces the category position and the H1 replaces the label. Moves each position value into the corresponding index.md and deletes the 10 redundant _category_.json files. Keeps migration/_category_.json (no index page there). Also applies review feedback: drop Oxford commas and unnecessary bold/italic formatting in configuration/index.md.
| Combiners are the only arbitraries in fast-check that do not generate anything on their own. They take one or more existing arbitraries as input and return a new one — they are the functional glue that lets a handful of primitives and composites cover the full space of values a real codebase cares about. | ||
|
|
||
| You will reach for a combiner whenever you want to: | ||
|
|
||
| - **promote plain values** into the arbitrary world (`constant`, `constantFrom`), | ||
| - **choose between alternatives** (`oneof`, `option`), | ||
| - **tie arbitraries together recursively** (`letrec`) to generate trees, ASTs, or JSON-like structures, | ||
| - **refine or transform** an existing arbitrary with `.filter`, `.map`, `.chain`, or adjust its shrinking with `noShrink` / `limitShrink`. | ||
|
|
||
| Because every combiner wraps another arbitrary, shrinking composes too: the combiner preserves (or deliberately limits) the shrink behaviour of the arbitrary it wraps, so a counterexample through `oneof(...).map(...)` still collapses toward the simple values defined by the innermost primitive. |
There was a problem hiding this comment.
| Combiners are the only arbitraries in fast-check that do not generate anything on their own. They take one or more existing arbitraries as input and return a new one — they are the functional glue that lets a handful of primitives and composites cover the full space of values a real codebase cares about. | |
| You will reach for a combiner whenever you want to: | |
| - **promote plain values** into the arbitrary world (`constant`, `constantFrom`), | |
| - **choose between alternatives** (`oneof`, `option`), | |
| - **tie arbitraries together recursively** (`letrec`) to generate trees, ASTs, or JSON-like structures, | |
| - **refine or transform** an existing arbitrary with `.filter`, `.map`, `.chain`, or adjust its shrinking with `noShrink` / `limitShrink`. | |
| Because every combiner wraps another arbitrary, shrinking composes too: the combiner preserves (or deliberately limits) the shrink behaviour of the arbitrary it wraps, so a counterexample through `oneof(...).map(...)` still collapses toward the simple values defined by the innermost primitive. | |
| Combiners are the only arbitraries in fast-check that do not generate anything on their own. They take one or more existing arbitraries as input and return a new one. They are the functional glue that lets a handful of primitives and composites cover the full space of values a real codebase cares about. | |
| You will reach for a combiner whenever you want to: | |
| - **promote plain values** into the arbitrary world (`constant`, `constantFrom`), | |
| - **choose between alternatives** (`oneof`, `option`), | |
| - **tie arbitraries together recursively** (`letrec`) to generate trees, ASTs or JSON-like structures, | |
| - **refine or transform** an existing arbitrary with `.filter`, `.map`, `.chain`, or adjust its shrinking with `noShrink` / `limitShrink`. | |
| Because every combiner wraps another arbitrary, shrinking composes too: the combiner preserves (or deliberately limits) the shrink behaviour of the arbitrary it wraps, so a counterexample through `oneof(...).map(...)` still collapses toward the simple values defined by the innermost primitive. |
Split em-dash run-on into two sentences, drop Oxford comma.
|
|
||
| # Composites | ||
|
|
||
| Composite arbitraries take other arbitraries as input and assemble them into structured values. An `array` is built from an arbitrary for its elements, a `record` is built from arbitraries for each of its fields, and so on — there is no "random structure" to speak of, only a shape you describe and a child arbitrary that fills it. |
There was a problem hiding this comment.
| Composite arbitraries take other arbitraries as input and assemble them into structured values. An `array` is built from an arbitrary for its elements, a `record` is built from arbitraries for each of its fields, and so on — there is no "random structure" to speak of, only a shape you describe and a child arbitrary that fills it. | |
| Composite arbitraries take other arbitraries as input and assemble them into structured values. An `array` is built from an arbitrary for its elements, a `record` is built from arbitraries for each of its fields and so on. There is no "random structure" to speak of, only a shape you describe and a child arbitrary that fills it. |
Split em-dash run-on into two sentences, drop Oxford comma.
|
|
||
| Two concepts recur on every page in this section and are worth learning once: | ||
|
|
||
| - **Size control.** Most composites accept `minLength` / `maxLength` bounds and a `size` modifier that scales how large generated values tend to be in practice (see [`size` explained](/docs/configuration/larger-entries-by-default/#size-explained)). These are the main knobs to keep generation costs under control when your children are themselves expensive. |
There was a problem hiding this comment.
| - **Size control.** Most composites accept `minLength` / `maxLength` bounds and a `size` modifier that scales how large generated values tend to be in practice (see [`size` explained](/docs/configuration/larger-entries-by-default/#size-explained)). These are the main knobs to keep generation costs under control when your children are themselves expensive. | |
| - **Size control.** Most composites accept `minLength` / `maxLength` bounds and a `size` modifier that scales how large generated values tend to be in practice (see [`size` explained](/docs/configuration/larger-entries-by-default/#size-explained)). |
Remove trailing sentence per reviewer feedback.
| Two concepts recur on every page in this section and are worth learning once: | ||
|
|
||
| - **Size control.** Most composites accept `minLength` / `maxLength` bounds and a `size` modifier that scales how large generated values tend to be in practice (see [`size` explained](/docs/configuration/larger-entries-by-default/#size-explained)). These are the main knobs to keep generation costs under control when your children are themselves expensive. | ||
| - **Two-dimensional shrinking.** When a test fails on a composite, fast-check shrinks along two axes independently: the **structure** (it tries shorter arrays, fewer object keys, smaller tuples) _and_ the **contents** (each surviving element is shrunk by its own arbitrary). This is why counterexamples on nested data tend to collapse cleanly to the minimal offender rather than to an opaque blob. |
There was a problem hiding this comment.
| - **Two-dimensional shrinking.** When a test fails on a composite, fast-check shrinks along two axes independently: the **structure** (it tries shorter arrays, fewer object keys, smaller tuples) _and_ the **contents** (each surviving element is shrunk by its own arbitrary). This is why counterexamples on nested data tend to collapse cleanly to the minimal offender rather than to an opaque blob. | |
| - **Two-dimensional shrinking.** When a test fails on a composite, fast-check shrinks along two axes independently: the **structure** (it tries shorter arrays, fewer object keys, smaller tuples) and the **contents** (each surviving element is shrunk by its own arbitrary). This is why counterexamples on nested data tend to collapse cleanly to the minimal offender rather than to an opaque blob. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6845 +/- ##
==========================================
- Coverage 94.86% 94.75% -0.11%
==========================================
Files 209 211 +2
Lines 5665 5778 +113
Branches 1489 1526 +37
==========================================
+ Hits 5374 5475 +101
- Misses 283 295 +12
Partials 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Adds a landing/index page to every documentation category that previously had none, using the same
index.md+<DocCardList />pattern that thetutorials/section already uses. Each new page carries a specific cross-cutting insight (arbitraries pipeline, canonical shrink targets, two-level configuration model, …) instead of rephrasing its children —<DocCardList />handles the child listing automatically.The
migration/category has only one guide today; rather than adding a boilerplate landing page, its_category_.jsonis re-pointed directly atfrom-3.x-to-4.xso clicking the sidebar category opens the guide.New files (10):
website/docs/introduction/index.mdwebsite/docs/core-blocks/index.mdwebsite/docs/core-blocks/arbitraries/index.mdwebsite/docs/core-blocks/arbitraries/primitives/index.mdwebsite/docs/core-blocks/arbitraries/composites/index.mdwebsite/docs/core-blocks/arbitraries/combiners/index.mdwebsite/docs/core-blocks/arbitraries/fake-data/index.mdwebsite/docs/configuration/index.mdwebsite/docs/advanced/index.mdwebsite/docs/tutorials/quick-start/index.mdModified (1):
website/docs/migration/_category_.json— addedlink: { type: "doc", id: "migration/from-3.x-to-4.x" }Verified locally with
pnpm exec docusaurus build: every new URL renders with breadcrumb, H1, prose, and the childDocCardListcards. No broken links or slug conflicts.Checklist
— Don't delete this checklist and make sure you do the following before opening the PR
pnpm run bumpor by following the instructions from the changeset bot🐛(vitest) Something...) when the change targets a package other thanfast-check