Skip to content

Commit a616777

Browse files
docs(react): polish consumer guidance
1 parent 2a8cd51 commit a616777

File tree

2 files changed

+31
-27
lines changed

2 files changed

+31
-27
lines changed

docs/consuming-react-components.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ This guide explains how to consume the `@ourfuturehealth/react-components` packa
55
## Prerequisites
66

77
1. **Node.js** 20.19.0 or higher (Node.js 24 LTS recommended)
8-
2. **pnpm** (recommended) or npm as package manager
8+
2. A package manager that can install tarball dependencies (`pnpm`, `npm`, or Yarn)
99
3. A React application (React 19+ required)
1010

1111
## Installation
1212

13-
We do not publish `@ourfuturehealth/react-components` to the npm registry. Install the release tarball instead.
13+
We do not publish `@ourfuturehealth/react-components` to the npm registry. Install a GitHub release tarball instead.
1414

1515
```json
1616
{
1717
"dependencies": {
18-
"@ourfuturehealth/react-components": "https://github.com/ourfuturehealth/design-system-toolkit/releases/download/react-v0.6.0/ourfuturehealth-react-components-0.6.0.tgz",
18+
"@ourfuturehealth/react-components": "https://github.com/ourfuturehealth/design-system-toolkit/releases/download/react-v{version}/ourfuturehealth-react-components-{version}.tgz",
1919
"react": "^19.2.4",
2020
"react-dom": "^19.2.4"
2121
}
2222
}
2323
```
2424

25+
Replace `{version}` with the published React package version you want to install.
26+
2527
Then install with your package manager:
2628

2729
```bash
@@ -34,6 +36,8 @@ yarn install
3436

3537
This tarball-based install path is smoke-tested against Yarn 1, npm, and pnpm.
3638

39+
You do not need `pnpm` to consume the published package. `pnpm` is only required when working inside this monorepo.
40+
3741
### Unreleased maintainer testing
3842

3943
Do not point consumers at `#main` or the old git-subdirectory install syntax.
@@ -92,15 +96,15 @@ Each application should use one theme. Current theme bundles are:
9296
- `participant`
9397
- `research`
9498

95-
### Squad C (React) using participant
99+
### Participant theme
96100

97101
Use the participant styles export:
98102

99103
```tsx
100104
import '@ourfuturehealth/react-components/styles/participant';
101105
```
102106

103-
### Squad C (React) using research
107+
### Research theme
104108

105109
Use the matching themed styles export:
106110

@@ -133,7 +137,7 @@ The React components package currently provides the following components:
133137
- `CardCallout` - Feedback-style callout cards for informational, warning, success, and error messages
134138
- `CardDoDont` - Positive and negative recommendation lists
135139

136-
For complete component documentation and live examples, run Storybook:
140+
For complete component documentation and live examples, run Storybook locally from this repository:
137141

138142
```bash
139143
pnpm storybook
@@ -206,7 +210,7 @@ If you are testing unreleased code, build and pack the package locally instead.
206210
**Solution**:
207211

208212
- Verify the package is installed: `ls node_modules/@ourfuturehealth/react-components`
209-
- Run `pnpm install` or `npm install` again
213+
- Run your package-manager install command again
210214
- Confirm you are using the tarball URL install contract, not the old git-subdirectory syntax
211215

212216
### Styles not loading
@@ -225,10 +229,10 @@ Import this in your app's entry point (e.g., `main.tsx` or `App.tsx`).
225229

226230
**Error**: `Warning: Invalid hook call` or peer dependency warnings
227231

228-
**Solution**: The React components require React 19+. Update your React version:
232+
**Solution**: The React components require React 19+. Update your React version with your package manager, for example:
229233

230234
```bash
231-
pnpm add react@^19.2.4 react-dom@^19.2.4
235+
npm install react@^19.2.4 react-dom@^19.2.4
232236
```
233237

234238
### TypeScript errors
@@ -238,36 +242,36 @@ pnpm add react@^19.2.4 react-dom@^19.2.4
238242
**Solution**:
239243

240244
- Ensure `"moduleResolution": "bundler"` or `"moduleResolution": "node"` is set in your `tsconfig.json`
241-
- Run `pnpm install` to ensure type definitions are properly linked
245+
- Run your package-manager install command again to ensure type definitions are properly linked
242246

243-
## Development and Contributing
247+
## Contributing in this repository
244248

245-
For development and contributing to the React components:
249+
If you are contributing to the React library inside this monorepo rather than consuming the published package, use the local development guide instead:
246250

247-
1. Clone the repository
248-
2. Install dependencies: `pnpm install`
249-
3. Run Storybook: `pnpm storybook`
250-
4. Make changes in `packages/react-components/`
251-
5. Run tests: `pnpm test:react-components`
252-
6. Lint code: `pnpm lint:react-components`
253-
7. Build all packages: `pnpm build`
254-
255-
See the main [README.md](../README.md) for detailed setup instructions and the [contributing guide](../CONTRIBUTING.md) for guidelines.
251+
- [Running locally](./contributing/running-locally.md)
252+
- [Main repository README](../README.md)
253+
- [Contributing guide](../CONTRIBUTING.md)
256254

257255
## Example Consumer App
258256

259-
The monorepo includes an example consumer app demonstrating usage:
257+
The monorepo includes `packages/example-react-consumer-app/`, a small standalone app pinned to the latest published React release. It is useful when you want to verify the package in a real consumer setup rather than through a workspace dependency.
260258

261259
```bash
262-
# Run the example app
260+
# from the repository root
263261
pnpm dev:react-consumer
264262
```
265263

266-
The example app is located in `packages/example-react-consumer-app/` and shows how to consume the React components in a real application.
264+
Or run it directly from the app directory:
265+
266+
```bash
267+
cd packages/example-react-consumer-app
268+
npm install
269+
npm run dev
270+
```
267271

268272
## Need Help?
269273

270-
1. Check the [Storybook](https://github.com/ourfuturehealth/design-system-toolkit#storybook) for component examples
271-
2. Review the [example consumer app](../packages/example-react-consumer-app/)
274+
1. Review the [React package README](../packages/react-components/README.md)
275+
2. Review the [example consumer app README](../packages/example-react-consumer-app/README.md)
272276
3. Read the [upgrade guide](../UPGRADING.md) for migration instructions
273277
4. Open an issue on [GitHub](https://github.com/ourfuturehealth/design-system-toolkit/issues)

packages/example-react-consumer-app/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ If you need to validate unreleased React package changes in this app:
5353
2. In this directory, temporarily install that local tarball:
5454

5555
```bash
56-
npm install ../../ourfuturehealth-react-components-0.5.0.tgz
56+
npm install ../../ourfuturehealth-react-components-<version>.tgz
5757
```
5858

5959
3. Run the app again with `npm run dev` or `npm run build`.

0 commit comments

Comments
 (0)