Skip to content

Commit fa09262

Browse files
committed
improve template-lib-monorepo
1 parent c1ba9d2 commit fa09262

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ It provides many features that help developers **build a React App quickly**:
2121

2222
## Getting stated
2323

24-
### Play with demo projects in your browser
24+
### Try it online on StackBlitz
2525

26-
Thanks to [StackBlitz WebContainers](https://blog.stackblitz.com/posts/introducing-webcontainers/), you can run vite-pages projects entirely in your browser! Checkout [vite-pages app demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-app?file=README.md&terminal=dev) or [vite-pages library demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-lib?file=README.md&terminal=dev).
26+
You can play with these demo projects in your browser, without installing anything on your machine.
27+
28+
- [app demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-app?file=README.md&terminal=dev)
29+
- [library demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-lib?file=README.md&terminal=dev)
30+
- [library monorepo demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-lib-monorepo?file=README.md&terminal=dev)
2731

2832
### Initialize a demo project locally
2933

doc-site/pages/$.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ It provides many features that help developers **build a React App quickly**:
3535

3636
## Getting stated
3737

38-
### Play with demo projects in your browser
38+
### Try it online on StackBlitz
3939

40-
Thanks to [StackBlitz WebContainers](https://blog.stackblitz.com/posts/introducing-webcontainers/), you can run vite-pages projects entirely in your browser! Checkout [vite-pages app demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-app?file=README.md&terminal=dev) or [vite-pages library demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-lib?file=README.md&terminal=dev).
40+
You can play with these demo projects in your browser, without installing anything on your machine.
41+
42+
- [app demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-app?file=README.md&terminal=dev)
43+
- [library demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-lib?file=README.md&terminal=dev)
44+
- [library monorepo demo](https://stackblitz.com/fork/github/vitejs/vite-plugin-react-pages/tree/main/packages/create-project/template-lib-monorepo?file=README.md&terminal=dev)
4145

4246
### Initialize a demo project locally
4347

packages/create-project/template-lib-monorepo/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
This is a demo project for [vite-plugin-react-pages](https://github.com/vitejs/vite-plugin-react-pages).
44
This project demonstrate how to develop libraries **in monorepo** using vite as your local develop environment.
55

6+
> This demo project setup both [pnpm workspaces](https://pnpm.io/workspaces) and [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces?v=true). You can use either one.
7+
68
## How to use
79

8-
`pnpm install` or `yarn install` (require yarn 1.x)
10+
`pnpm install` or `npm install` (require npm 7+)
911

1012
`cd packages/demos`
1113

12-
`pnpm run dev` You can play with demos of your packages in local develop environment.
14+
`pnpm run dev` or `npm run dev` You can play with demos of your packages in local develop environment.
1315

1416
Edit `packages/button/src/index.tsx` or other source files, the demos will inflect your change instantly.
1517
Edit `packages/button/demos/demo1.tsx` or other demo files, the demos will inflect your change instantly.

packages/create-project/template-lib-monorepo/_npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/create-project/template-lib-monorepo/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
"version": "0.0.2",
44
"private": true,
55
"scripts": {
6-
"dev": "cd packages/demos && npm run dev"
6+
"dev": "cd packages/demos && npm run dev",
7+
"dev-pnpm": "pnpm run --filter library-demos dev",
8+
"dev-npm": "npm run dev --workspace library-demos"
79
},
10+
"//comment": "The following workspaces config is used by `npm workspaces`. You can delete it if you use pnpm.",
811
"workspaces": [
912
"packages/*"
1013
]

0 commit comments

Comments
 (0)