Skip to content

Commit 04f4a98

Browse files
authored
docs(agents): add build & run section, list TVOSExample (#3941)
## Description Adds a `## Build & run` section to `AGENTS.md` covering prerequisites, the library build (`yarn prepare`), and library TypeScript verification (`yarn check-types`). Also fixes `## Repository layout tips` so that `./TVOSExample/` is listed alongside `./FabricExample/`, and updates the `## Imports` section so TVOSExample is included in the path-alias rule. The `Verify TypeScript` subsection is intentionally library-only for now. Per-example tsconfig runs (`FabricExample/`, `TVOSExample/`, `apps/`) currently surface different sets of pre-existing errors when invoked directly, and there are no `check-types` scripts in the example app `package.json` files. Documenting them today would point agents at red baselines and teach them to ignore TS errors. A short caveat in the section records this; the example app surface will be documented once the underlying issues are resolved and a single entry point exists. ## Changes - Added `## Build & run` section to `AGENTS.md` with three subsections: - **Prerequisites** — `yarn install`, `yarn submodules`. - **Build the library** — `yarn prepare` and the resulting outputs under `./lib/`. - **Verify TypeScript** — `yarn check-types` plus a caveat explaining why example-app TS verification is not documented yet. - Added `./TVOSExample/` bullet to `## Repository layout tips`. - Added `./TVOSExample/` to the path-alias consumers list under `## Imports`. ## Test plan - `yarn check-types` runs cleanly on this branch (the only command newly documented in the `Verify TypeScript` subsection). - `yarn prepare` was not re-run as part of this PR (no behavioral change to the build pipeline; the script is unchanged in `package.json`). - No source code is modified; the diff is limited to `AGENTS.md`. ## Checklist - [ ] Included code example that can be used to test this change. - [ ] For visual changes, included screenshots / GIFs / recordings documenting the change. - [ ] For API changes, updated relevant public types. - [x] Ensured that CI passes
1 parent 9e9480d commit 04f4a98

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,58 @@ such as stack, tabs, split.
2222
- `./FabricExample/` - contains an example application, we use it to showcase the library
2323
capabilities and test the library. It is not published as part of the package.
2424

25+
- `./TVOSExample/` - tvOS example application, used to exercise the library on
26+
Apple TV. Like `FabricExample`, it consumes the shared sources from `./apps/`
27+
via path aliases. Not published as part of the package.
28+
2529
- `./apps/` - extracted JS (react-native) code of the `FabricExample` application;
2630
this is done to share the code with other example applications in the repository.
2731

2832
- `./react-navigation/` - this is a git submodule for a downstream library providing
2933
a complete navigation solution. It is not part of the library.
3034

35+
## Build & run
36+
37+
### Prerequisites
38+
39+
- `yarn install` — installs JS dependencies. Triggers the `prepare` lifecycle
40+
hook, which builds the library to `./lib/` (see below).
41+
- `yarn submodules` — initializes and builds the `react-navigation` git
42+
submodule. Only needed when working against that downstream library; not
43+
required to build or type-check the screens library itself.
44+
45+
### Build the library
46+
47+
```bash
48+
yarn prepare
49+
```
50+
51+
Runs `bob build` (`react-native-builder-bob`) and `husky install`. Outputs:
52+
53+
- `./lib/commonjs/` — CommonJS build
54+
- `./lib/module/` — ES module build
55+
- `./lib/typescript/``.d.ts` declarations (built via `tsconfig.build.json`)
56+
57+
Source of truth is `./src/` (see `react-native-builder-bob` config in
58+
`package.json`).
59+
60+
### Verify TypeScript
61+
62+
Library:
63+
64+
```bash
65+
yarn check-types
66+
```
67+
68+
Runs `tsc --noEmit` against the root `tsconfig.json` (covers `./src/`).
69+
70+
> Type-checking the example apps directly (`FabricExample/`, `TVOSExample/`,
71+
> `apps/`) is intentionally not documented here yet. Each app's `tsconfig.json`
72+
> currently surfaces a different set of pre-existing errors when run on its
73+
> own, and there are no `check-types` scripts in the example app
74+
> `package.json` files. This will be documented once the underlying issues
75+
> are resolved and a single entry point exists.
76+
3177
## Code conventions
3278

3379
- TypeScript-first. Always prefer TypeScript over JavaScript unless explicitly working in a JS-only context.
@@ -37,7 +83,7 @@ such as stack, tabs, split.
3783
## Imports
3884

3985
- Use relative imports within library packages (`./src/`).
40-
- Use path aliases (`@apps/*`, `@assets/*`) only in example apps (`./apps/`, `./FabricExample/`).
86+
- Use path aliases (`@apps/*`, `@assets/*`) only in example apps (`./apps/`, `./FabricExample/`, `./TVOSExample/`).
4187
- Never use absolute paths from project root as import paths.
4288

4389
## Git & refactoring

0 commit comments

Comments
 (0)