|
1 | | -# Getting Started with Create React App |
| 1 | +# react-datocms Examples |
2 | 2 |
|
3 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
| 3 | +This is an example application demonstrating the usage of `react-datocms` library. |
| 4 | + |
| 5 | +This project uses [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) to link to the parent `react-datocms` package. |
| 6 | + |
| 7 | +## Local Development |
| 8 | + |
| 9 | +From the **repository root**, run: |
| 10 | + |
| 11 | +```bash |
| 12 | +npm install # Installs dependencies for both root and examples |
| 13 | +npm run build # Builds the react-datocms library |
| 14 | +cd examples |
| 15 | +npm start # Runs the example app |
| 16 | +``` |
| 17 | + |
| 18 | +## Deployment Options |
| 19 | + |
| 20 | +### Option 1: Deploy with Local/Unreleased Changes (from repository root) |
| 21 | + |
| 22 | +Use this to showcase features that haven't been published to npm yet. |
| 23 | + |
| 24 | +**Netlify/Vercel Configuration:** |
| 25 | +- **Base directory:** (leave empty / root) |
| 26 | +- **Build command:** `npm run build:examples` |
| 27 | +- **Publish directory:** `examples/build` |
| 28 | + |
| 29 | +This builds the local version of `react-datocms` and uses it in the examples. |
| 30 | + |
| 31 | +### Option 2: Deploy with Published npm Version (from examples folder only) |
| 32 | + |
| 33 | +Use this to showcase the latest published version from npm. |
| 34 | + |
| 35 | +**Netlify/Vercel Configuration:** |
| 36 | +- **Base directory:** `examples` |
| 37 | +- **Build command:** `npm install && npm run build` |
| 38 | +- **Publish directory:** `build` |
| 39 | + |
| 40 | +This installs `react-datocms` from the npm registry and uses it in the examples. |
4 | 41 |
|
5 | 42 | ## Available Scripts |
6 | 43 |
|
|
0 commit comments