Skip to content

Commit 47184c2

Browse files
timphandevclaude
andcommitted
docs: say where the consumers check each way users reach a type
List, next to each way of the rule on testing types the way users use them, the module or app of consumers/<package> that holds it, and add the ways that the consumers now check: a design system and the app that installs it, components, input that the types must reject, and the options of strict projects and of bundlers. A bug found outside the repository adds the code that shows it to the consumer whose users would write it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent e2b376b commit 47184c2

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

‎AGENTS.md‎

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,18 +271,33 @@ asserts the runtime outcome.
271271

272272
**Test types the way users use them.** A type that works on one inline
273273
call can still fail in a user's project. Check each public type, in a
274-
test or in an app of `consumers`, in each way users reach it:
274+
test or in an app of `consumers`, in each way users reach it. Each way
275+
names where `consumers/<package>` holds it, in the packages it applies
276+
to:
275277

276-
- inferred from an inline argument, and from a value declared before the
277-
call;
278+
- inferred from an inline argument (`app/inline.ts`), and from a value
279+
declared before the call (`app/types.ts`, and
280+
`library-isolated` for configs declared `as const`);
278281
- passed through a function of the user's that is generic over it, and
279-
returned from that function;
282+
returned from that function (`app/generic.ts`, `library/helpers.ts`);
280283
- exported from one module and used in another, with declarations
281-
emitted, as an app that installs the packed package compiles it;
282-
- with `isolatedDeclarations`;
284+
emitted, as an app that installs the packed package compiles it
285+
(`app/exported.ts` and `app/configured-recipes.ts` of class-recipe,
286+
`app/themed-*.ts` of native-recipe, `app/inline.ts` with
287+
`app/generic.ts`);
288+
- published by a design system, whose declarations tsc emits, and used
289+
and extended by an app that installs it and not the package
290+
(`library`, `library-app`);
291+
- with `isolatedDeclarations` (`library-isolated`);
283292
- nested or composed several levels deep, where its declarations must
284-
grow linearly;
285-
- with the oldest and the newest TypeScript that the packages support;
293+
grow linearly (`app/chain.ts` and each `app/*-chain.ts`);
294+
- rendered by components, in React for class-recipe and React Native for
295+
native-recipe (`app/components.tsx`);
296+
- rejected when the input is wrong, with the error at the mistake
297+
(`app/misuse.ts`);
298+
- with the oldest and the newest TypeScript that the packages support,
299+
and with the options of strict projects and of bundlers
300+
(`tsconfig.strictest.json`, `tsconfig.bundler.json`);
286301
- completed by an editor in a config written inline in the call: the
287302
names of its variants, options, and slots, and the values of each, in
288303
`base`, the variants, compound variants, and defaults, which each
@@ -300,7 +315,11 @@ patterns: the same type helper, the same check, the same example. When
300315
you fix a bug, find the pattern that caused it, then search every
301316
package, the docs, the skills, and the READMEs for that pattern. Fix
302317
each place in the same change, with a test for each, or say why a place
303-
is not affected. List in the commit body where you looked.
318+
is not affected. List in the commit body where you looked. When a bug
319+
was found outside the repository, by a user or a review, add the code
320+
that shows it to the app of `consumers` whose users would write it,
321+
next to the way of the list above that it belongs to, or add the way it
322+
shows if the list lacks it.
304323

305324
**Performance comes first.** A recipe and a slot recipe of any kind, a
306325
class name recipe and slot recipe, and a style recipe and slot style

0 commit comments

Comments
 (0)