create-croissant 0.1.41 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/README.md +46 -27
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -12,33 +12,35 @@ npx create-croissant@latest
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 🌟 Features
|
|
16
16
|
|
|
17
|
-
- **
|
|
17
|
+
- **Web (Platform)**: [TanStack Start](https://tanstack.com/start) for a seamless, type-safe React experience.
|
|
18
|
+
- **Mobile**: [Expo](https://expo.dev/) (React Native) for cross-platform mobile development.
|
|
19
|
+
- **Desktop**: [Electron](https://www.electronjs.org/) with [electron-vite](https://electron-vite.org/) for native desktop applications.
|
|
18
20
|
- **Authentication**: [Better Auth](https://www.better-auth.com/) with Drizzle adapter and PostgreSQL.
|
|
19
21
|
- **API**: [oRPC](https://orpc.sh/) with a modular, namespaced router for end-to-end type-safety.
|
|
20
22
|
- **Database**: [Drizzle ORM](https://orm.drizzle.team/) with PostgreSQL and Docker Compose setup.
|
|
21
23
|
- **Styling**: [shadcn/ui](https://ui.shadcn.com/) components with Tailwind CSS.
|
|
22
|
-
- **Monorepo**: Powered by [Turborepo](https://turbo.build/) for lightning-fast builds and smart task orchestration.
|
|
23
|
-
- **Developer Experience**:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
This project uses **Turborepo** to manage the monorepo efficiently. Turbo understands the dependency graph between our packages and optimizes our workflow in several ways:
|
|
28
|
-
|
|
29
|
-
- **Smart Caching**: Tasks like `build` and `lint` are cached. If the code hasn't changed, Turbo will replay the logs and output instantly.
|
|
30
|
-
- **Parallel Execution**: Run tasks across multiple packages simultaneously without stepping on each other's toes.
|
|
31
|
-
- **Task Pipelines**: Defines the relationship between tasks (e.g., "don't build the app until its dependencies are built").
|
|
32
|
-
|
|
33
|
-
You can see the configuration in `turbo.json`.
|
|
24
|
+
- **Monorepo Management**: Powered by [Turborepo](https://turbo.build/) for lightning-fast builds and smart task orchestration.
|
|
25
|
+
- **Developer Experience**:
|
|
26
|
+
- Path aliases (`@/`) for clean imports.
|
|
27
|
+
- Strict TypeScript across the entire stack.
|
|
28
|
+
- Ultra-fast linting and formatting with [Oxc](https://oxc.rs/) (`oxlint` and `oxfmt`).
|
|
34
29
|
|
|
35
30
|
## 📁 Project Structure
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
- `
|
|
39
|
-
- `
|
|
40
|
-
- `
|
|
41
|
-
|
|
32
|
+
### Apps
|
|
33
|
+
- `apps/platform`: The main TanStack Start web application.
|
|
34
|
+
- `apps/mobile`: Expo-powered mobile application.
|
|
35
|
+
- `apps/desktop`: Electron-powered desktop application.
|
|
36
|
+
|
|
37
|
+
### Packages
|
|
38
|
+
- `packages/auth` (`@workspace/auth`): Authentication logic and Better Auth configuration.
|
|
39
|
+
- `packages/db` (`@workspace/db`): Database schema, migrations, and Drizzle client.
|
|
40
|
+
- `packages/orpc` (`@workspace/orpc`): Type-safe API router and definitions.
|
|
41
|
+
- `packages/ui` (`@workspace/ui`): Shared UI components and global styles.
|
|
42
|
+
- `packages/config-typescript` (`@workspace/config-typescript`): Shared TypeScript configurations.
|
|
43
|
+
- `packages/create-croissant`: The CLI tool for scaffolding new projects.
|
|
42
44
|
|
|
43
45
|
## 🛠️ Getting Started
|
|
44
46
|
|
|
@@ -89,40 +91,44 @@ npm run db:push --filter @workspace/db
|
|
|
89
91
|
npm run dev
|
|
90
92
|
```
|
|
91
93
|
|
|
92
|
-
The application will be available at `http://localhost:3000`.
|
|
94
|
+
The web application will be available at `http://localhost:3000`.
|
|
93
95
|
|
|
94
96
|
## 📦 Scripts
|
|
95
97
|
|
|
96
98
|
All scripts are orchestrated by Turborepo. You can run them from the root directory:
|
|
97
99
|
|
|
100
|
+
### Core Scripts
|
|
98
101
|
- `npm run dev`: Start all applications in development mode.
|
|
99
102
|
- `npm run build`: Build all applications for production.
|
|
100
103
|
- `npm run quality`: Run all quality checks (linting and formatting) using Oxc.
|
|
101
104
|
- `npm run quality:fix`: Automatically fix linting and formatting issues using Oxc.
|
|
102
105
|
- `npm run typecheck`: Run TypeScript type checking across the workspace.
|
|
106
|
+
- `npm run ci`: Run linting, type-checking, and build (used in CI/CD).
|
|
103
107
|
|
|
104
108
|
### 🗄️ Database Scripts
|
|
105
|
-
|
|
106
109
|
These handle Docker and Drizzle operations:
|
|
107
|
-
|
|
108
110
|
- `npm run db:up`: Start the PostgreSQL Docker container.
|
|
109
111
|
- `npm run db:down`: Stop and remove the database container.
|
|
110
112
|
- `npm run db:logs`: Tail logs from the database container.
|
|
111
113
|
- `npm run db:push --filter @workspace/db`: Push Drizzle schema to the database.
|
|
112
114
|
- `npm run db:studio --filter @workspace/db`: Open Drizzle Studio to explore your data.
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
## 🎯 Turborepo Power
|
|
115
117
|
|
|
118
|
+
### Filtering Tasks
|
|
116
119
|
Turbo allows you to run tasks for specific packages using the `--filter` flag:
|
|
117
120
|
|
|
118
121
|
```bash
|
|
119
|
-
# Only lint the
|
|
120
|
-
npm run lint -- --filter
|
|
122
|
+
# Only lint the platform app
|
|
123
|
+
npm run lint -- --filter platform
|
|
121
124
|
|
|
122
125
|
# Build the db package and everything that depends on it
|
|
123
126
|
npm run build -- --filter @workspace/db...
|
|
124
127
|
```
|
|
125
128
|
|
|
129
|
+
### Smart Caching
|
|
130
|
+
Tasks like `build` and `lint` are cached. If the code hasn't changed, Turbo will replay the logs and output instantly.
|
|
131
|
+
|
|
126
132
|
## 🔗 oRPC & Type Safety
|
|
127
133
|
|
|
128
134
|
The project uses oRPC for end-to-end type safety. The router is modularized for better maintainability:
|
|
@@ -140,16 +146,29 @@ type Inputs = InferRouterInputs<typeof router>;
|
|
|
140
146
|
type Outputs = InferRouterOutputs<typeof router>;
|
|
141
147
|
```
|
|
142
148
|
|
|
143
|
-
## 🧱
|
|
149
|
+
## 🧱 UI Components
|
|
144
150
|
|
|
145
151
|
To add components to the shared UI package:
|
|
146
152
|
|
|
147
153
|
```bash
|
|
148
|
-
npx shadcn@latest add [component-name] -c apps/
|
|
154
|
+
npx shadcn@latest add [component-name] -c apps/platform
|
|
149
155
|
```
|
|
150
156
|
|
|
151
157
|
This will place the UI components in `packages/ui/src/components`.
|
|
152
158
|
|
|
159
|
+
## 🛡️ Quality & Git Hooks
|
|
160
|
+
|
|
161
|
+
This project uses **Husky** to ensure code quality. When pushing to the `main` branch, it automatically runs the CI pipeline (`npm run ci`) to prevent broken code from being pushed.
|
|
162
|
+
|
|
163
|
+
Formatting and linting are handled by **Oxc**, which is significantly faster than ESLint and Prettier.
|
|
164
|
+
|
|
165
|
+
- **Linting**: `oxlint`
|
|
166
|
+
- **Formatting**: `oxfmt`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
Built with ❤️ for the ultimate developer experience.
|
|
171
|
+
|
|
153
172
|
## 🛡️ License
|
|
154
173
|
|
|
155
174
|
MIT
|