|
1 |
| -# Create R18 Turborepo <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 40px"/> |
| 1 | +# Create React18 Turborepo <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 40px"/> |
2 | 2 |
|
3 |
| -[](https://github.com/react18-tools/create-r18-turborepo/actions/workflows/test.yml) [](https://codeclimate.com/github/react18-tools/create-r18-turborepo/maintainability) [](https://codecov.io/gh/react18-tools/create-r18-turborepo) [](https://www.npmjs.com/package/create-r18-turborepo) [](https://www.npmjs.com/package/create-r18-turborepo)  [](https://gitpod.io/from-referrer/) |
| 3 | +[](https://github.com/react18-tools/create-r18-turborepo/actions/workflows/test.yml) |
| 4 | +[](https://qlty.sh/gh/react18-tools/projects/create-r18-turborepo) |
| 5 | +[](https://codecov.io/gh/react18-tools/create-r18-turborepo) |
| 6 | +[](https://www.npmjs.com/package/create-r18-turborepo) |
| 7 | +[](https://www.npmjs.com/package/create-r18-turborepo) |
| 8 | + |
4 | 9 |
|
5 |
| -Create R18 Turborepo is a comprehensive library designed to unlock the full potential of React 18 server components. It provides customizable loading animation components and a fullscreen loader container, seamlessly integrating with React and Next.js. |
| 10 | +🚀 **Bootstrap your next Turborepo project in seconds** — powered by [react18-tools/turborepo-template](https://github.com/react18-tools/turborepo-template). |
| 11 | +This CLI wraps `create-turbo` and automatically runs `pnpm rebrand` to set up your project for immediate development. |
6 | 12 |
|
7 |
| -✅ Fully Treeshakable (import from `create-r18-turborepo/client/loader-container`) |
| 13 | +--- |
8 | 14 |
|
9 |
| -✅ Fully TypeScript Supported |
| 15 | +## ✨ Features |
10 | 16 |
|
11 |
| -✅ Leverages the power of React 18 Server components |
| 17 | +- 📦 One-liner project creation (`pnpm create r18 my-app`) |
| 18 | +- 👨💻 Interactive mode — prompts for project name if not provided |
| 19 | +- 🎨 Auto-runs `pnpm rebrand` to customize boilerplate naming |
| 20 | +- ⚡ Works with **pnpm** by default |
| 21 | +- 🔗 Built on top of official `create-turbo` flow |
12 | 22 |
|
13 |
| -✅ Compatible with all React 18 build systems/tools/frameworks |
| 23 | +--- |
14 | 24 |
|
15 |
| -✅ Documented with [Typedoc](https://react18-tools.github.io/create-r18-turborepo) ([Docs](https://react18-tools.github.io/create-r18-turborepo)) |
| 25 | +## 📦 Installation |
16 | 26 |
|
17 |
| -✅ Examples for Next.js, and Vite |
| 27 | +Run with `pnpx` or `pnpm create` — no need to install globally. |
18 | 28 |
|
19 |
| -> <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Star [this repository](https://github.com/react18-tools/create-r18-turborepo) and share it with your friends. |
20 |
| -
|
21 |
| -## Getting Started |
22 |
| - |
23 |
| -### Installation |
| 29 | +### Canonical package (recommended) |
24 | 30 |
|
25 | 31 | ```bash
|
26 |
| -pnpm add create-r18-turborepo |
| 32 | +pnpx create-r18-turborepo-template my-app |
27 | 33 | ```
|
28 | 34 |
|
29 |
| -**_or_** |
| 35 | +### Short aliases (same package, same version) |
30 | 36 |
|
31 | 37 | ```bash
|
32 |
| -npm install create-r18-turborepo |
| 38 | +pnpm create r18 my-app |
| 39 | +pnpx create-r18 my-app |
| 40 | +pnpx create-r18-turbo my-app |
| 41 | +pnpx turborepo-template-init my-app |
33 | 42 | ```
|
34 | 43 |
|
35 |
| -**_or_** |
| 44 | +👉 For docs and issues, always refer to **`create-r18-turborepo-template`**. |
36 | 45 |
|
37 |
| -```bash |
38 |
| -yarn add create-r18-turborepo |
39 |
| -``` |
| 46 | +--- |
| 47 | + |
| 48 | +## 🚀 Usage |
40 | 49 |
|
41 |
| -## Want Lite Version? [](https://www.npmjs.com/package/create-r18-turborepo-lite) [](https://www.npmjs.com/package/create-r18-turborepo-lite) [](https://www.npmjs.com/package/create-r18-turborepo-lite) |
| 50 | +### Create a project with a name |
42 | 51 |
|
43 | 52 | ```bash
|
44 |
| -pnpm add create-r18-turborepo-lite |
| 53 | +pnpm create r18 my-app |
45 | 54 | ```
|
46 | 55 |
|
47 |
| -**or** |
| 56 | +### Interactive (prompts for name) |
48 | 57 |
|
49 | 58 | ```bash
|
50 |
| -npm install create-r18-turborepo-lite |
| 59 | +pnpm create r18 |
51 | 60 | ```
|
52 | 61 |
|
53 |
| -**or** |
| 62 | +👉 If you press Enter without typing, it defaults to: |
54 | 63 |
|
55 |
| -```bash |
56 |
| -yarn add create-r18-turborepo-lite |
| 64 | +``` |
| 65 | +react18-tools-turborepo-template |
57 | 66 | ```
|
58 | 67 |
|
59 |
| -> You need `r18gs` as a peer-dependency |
60 |
| -
|
61 |
| -### Import Styles |
| 68 | +--- |
62 | 69 |
|
63 |
| -You can import styles globally or within specific components. |
| 70 | +## 🔧 What it does |
64 | 71 |
|
65 |
| -```css |
66 |
| -/* globals.css */ |
67 |
| -@import "create-r18-turborepo/dist"; |
68 |
| -``` |
| 72 | +1. Runs `create-turbo` with the **react18-tools/turborepo-template** example. |
| 73 | +2. Uses **pnpm** as the package manager. |
| 74 | +3. Creates the project folder with your chosen name. |
| 75 | +4. Runs `pnpm rebrand` inside the project to customize boilerplate. |
69 | 76 |
|
70 |
| -```tsx |
71 |
| -// layout.tsx |
72 |
| -import "create-r18-turborepo/dist/index.css"; |
73 |
| -``` |
| 77 | +--- |
74 | 78 |
|
75 |
| -For selective imports: |
| 79 | +## 🛠 Example |
76 | 80 |
|
77 |
| -```css |
78 |
| -/* globals.css */ |
79 |
| -@import "create-r18-turborepo/dist/client"; /** required if you are using LoaderContainer */ |
80 |
| -@import "create-r18-turborepo/dist/server/bars/bars1"; |
| 81 | +```bash |
| 82 | +pnpm create r18 turbo-demo |
81 | 83 | ```
|
82 | 84 |
|
83 |
| -### Usage |
| 85 | +Output: |
84 | 86 |
|
85 |
| -Using loaders is straightforward. |
| 87 | +``` |
| 88 | +🔨 Creating turborepo project: turbo-demo |
| 89 | +... |
| 90 | +🚀 Rebranding project in turbo-demo |
| 91 | +✅ Done! Your project is ready in: /path/to/turbo-demo |
| 92 | +``` |
86 | 93 |
|
87 |
| -```tsx |
88 |
| -import { Bars1 } from "create-r18-turborepo/dist/server/bars/bars1"; |
| 94 | +--- |
89 | 95 |
|
90 |
| -export default function MyComponent() { |
91 |
| - return someCondition ? <Bars1 /> : <>Something else...</>; |
92 |
| -} |
93 |
| -``` |
| 96 | +## 📚 Related |
94 | 97 |
|
95 |
| -For detailed API and options, refer to [the API documentation](https://react18-tools.github.io/create-r18-turborepo). |
| 98 | +- [Turborepo Docs](https://turbo.build/repo/docs) |
| 99 | +- [react18-tools/turborepo-template](https://github.com/react18-tools/turborepo-template) |
96 | 100 |
|
97 |
| -**Using LoaderContainer** |
| 101 | +--- |
98 | 102 |
|
99 |
| -`LoaderContainer` is a fullscreen component. You can add this component directly in your layout and then use `useLoader` hook to toggle its visibility. |
| 103 | +## 🤝 Contributing |
100 | 104 |
|
101 |
| -```tsx |
102 |
| -// layout.tsx |
103 |
| -<LoaderContainer /> |
104 |
| - ... |
105 |
| -``` |
| 105 | +PRs and feedback are welcome! |
| 106 | +If you use this tool at your company, please consider [starring the template repo](https://github.com/react18-tools/turborepo-template) ⭐ |
106 | 107 |
|
107 |
| -```tsx |
108 |
| -// some other page or component |
109 |
| -import { useLoader } from "create-r18-turborepo/dist/hooks"; |
110 |
| - |
111 |
| -export default MyComponent() { |
112 |
| - const { setLoading } = useLoader(); |
113 |
| - useCallback(()=>{ |
114 |
| - setLoading(true); |
115 |
| - ...do some work |
116 |
| - setLoading(false); |
117 |
| - }, []) |
118 |
| - ... |
119 |
| -} |
120 |
| -``` |
| 108 | +--- |
121 | 109 |
|
122 | 110 | ## License
|
123 | 111 |
|
124 | 112 | This library is licensed under the MPL-2.0 open-source license.
|
125 | 113 |
|
126 |
| - |
127 |
| - |
128 | 114 | > <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Please enroll in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsor](https://github.com/sponsors/mayank1513) our work.
|
129 | 115 |
|
130 | 116 | <hr />
|
|
0 commit comments