Skip to content

Commit 6fa6e7f

Browse files
committed
Avoid examples tarball based approach
1 parent 4412919 commit 6fa6e7f

File tree

9 files changed

+25785
-27036
lines changed

9 files changed

+25785
-27036
lines changed

examples/README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,43 @@
1-
# Getting Started with Create React App
1+
# react-datocms Examples
22

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.
441

542
## Available Scripts
643

0 commit comments

Comments
 (0)