You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update CLAUDE.md's "Common Commands" section for the Yarn 4
workspaces world:
- Explain the committed Yarn 4 binary + yarnPath dispatch (no
Corepack required).
- Replace `cd package && yarn ...` examples with root-level
`yarn lint`, `yarn build`, `yarn test:unit` (forwarded via
`yarn workspace`).
- Drop the `yarn install --frozen-lockfile` / `yarn install-all`
snippets; explain the single-root `yarn install` with its
postinstall (husky install + shared-native sync).
- Note that Lerna is gone and the release pipeline runs via
`yarn workspaces foreach`.
Update examples/README.md to clarify that the three example apps in
this repo are now workspaces wired via `workspace:^`; keep the
existing `link:` guidance scoped to "consuming the SDK from an app
outside this monorepo," which is its actual use case.
Copy file name to clipboardExpand all lines: CLAUDE.md
+27-20Lines changed: 27 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,50 +6,56 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
7
7
Stream Chat React Native SDK monorepo. The main SDK code lives in `package/` (published as `stream-chat-react-native-core`). Built on top of the `stream-chat` JS client library.
8
8
9
+
This is a **Yarn 4 (Berry)** workspace monorepo. The Yarn binary lives in `.yarn/releases/yarn-4.14.1.cjs` and is invoked via `yarnPath` in `.yarnrc.yml`; any globally-installed Yarn launcher (e.g. the Homebrew Yarn 1.x) auto-delegates to it. No Corepack required.
10
+
11
+
Workspaces: `package`, `package/native-package`, `package/expo-package`, `examples/SampleApp`, `examples/ExpoMessaging`, `examples/TypeScriptMessaging`. There is a single root `yarn.lock`.
12
+
9
13
## Common Commands
10
14
11
-
All commands below run from the repo root unless noted otherwise.
15
+
All commands below run from the repo root.
16
+
17
+
### Install
18
+
19
+
```bash
20
+
yarn install # Set up every workspace (single root lockfile)
21
+
yarn install --immutable # CI-style; fail if yarn.lock would change
22
+
```
23
+
24
+
The root `package/`'s `postinstall` runs `husky install` and `yarn shared-native:sync` automatically.
12
25
13
26
### Build
14
27
15
28
```bash
16
-
yarn build # Build all packages (runs in package/)
17
-
cd package && yarn build # Build SDK directly
29
+
yarn build # SDK build (commonjs + esm + types)
30
+
yarn workspace stream-chat-react-native-core build # Same, explicit form
yarn lint-fix# Auto-fix lint and formatting issues
25
38
```
26
39
27
40
### Test
28
41
29
42
```bash
30
-
cd package && yarn test:unit # Run all unit tests (sets TZ=UTC)
31
-
cd package && yarn test:coverage # Run with coverage report
32
-
cd package && TZ=UTC npx jest path/to/test.test.tsx # Run a single test file
43
+
yarn test:unit # All unit tests (sets TZ=UTC)
44
+
yarn test:coverage # With coverage report
45
+
yarn workspace stream-chat-react-native-core test:unit # Same as `yarn test:unit`
46
+
cd package && TZ=UTC npx jest path/to/test.test.tsx # Single test file
33
47
```
34
48
35
49
Tests use Jest with `react-native` preset and `@testing-library/react-native`. Test files live alongside source at `src/**/__tests__/*.test.ts(x)`. Mock builders are in `src/mock-builders/`.
36
50
37
51
To run a single test, you can also temporarily add the file path to the `testRegex` array in `package/jest.config.js`.
Copy file name to clipboardExpand all lines: examples/README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
This directory contains all the example apps that uses our Stream Chat React Native SDK components.
1
+
This directory contains all the example apps that use our Stream Chat React Native SDK components.
2
2
3
-
On RN <= 0.72, symlink was not supported by default so the setup has to be done locally through metro config to run the project within the monorepo. The guide below addresses the same.
3
+
The three apps -- `SampleApp`, `ExpoMessaging`, `TypeScriptMessaging` -- are Yarn 4 workspaces of the repo root. A single `yarn install` at the repo root sets all of them up; their SDK dependencies (`stream-chat-react-native-core`, `stream-chat-react-native`, `stream-chat-expo`) are wired via `workspace:^`, and each app's `metro.config.js` adds the SDK source to Metro's watch folders and resolution table.
4
+
5
+
On RN <= 0.72, symlink was not supported by default so the setup has to be done locally through metro config to run the project within the monorepo. The guide below addresses the same -- it remains useful when you want to consume a locally-cloned SDK from an app that lives **outside** this monorepo.
4
6
5
7
### Running a local SDK clone on your app
6
8
@@ -19,6 +21,8 @@ Replace the `stream-chat-react-native` dependency with following:
19
21
"stream-chat-expo": "link:../stream-chat-react-native/package/expo-package", // If youre using expo
20
22
```
21
23
24
+
(Within this repo, the in-monorepo apps use `"workspace:^"` instead of `link:` -- the snippet above is for an app that lives outside the monorepo.)
25
+
22
26
Here I am assuming that the clone of `stream-chat-react-native` and your app are under common directory. For example,
0 commit comments