create-projx 1.3.6 → 1.4.1
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/README.md +82 -0
- package/dist/index.js +1770 -94
- package/package.json +1 -1
- package/src/templates/docker-compose.dev.yml.ejs +28 -18
- package/src/templates/docker-compose.yml.ejs +18 -12
package/README.md
CHANGED
|
@@ -126,6 +126,13 @@ npx create-projx <name> [options]
|
|
|
126
126
|
npx create-projx init
|
|
127
127
|
npx create-projx add <components...>
|
|
128
128
|
npx create-projx update
|
|
129
|
+
npx create-projx diff
|
|
130
|
+
npx create-projx pin <patterns...>
|
|
131
|
+
npx create-projx unpin <patterns...>
|
|
132
|
+
npx create-projx pin --list
|
|
133
|
+
npx create-projx doctor [--fix]
|
|
134
|
+
npx create-projx gen entity <name>
|
|
135
|
+
npx create-projx sync [--url <url>]
|
|
129
136
|
|
|
130
137
|
--components <list> Comma-separated: fastapi,fastify,frontend,mobile,e2e,infra
|
|
131
138
|
--no-git Skip git init
|
|
@@ -134,6 +141,81 @@ npx create-projx update
|
|
|
134
141
|
-h, --help Show help
|
|
135
142
|
```
|
|
136
143
|
|
|
144
|
+
### Preview Changes
|
|
145
|
+
|
|
146
|
+
See what `update` would change before applying:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
cd my-app
|
|
150
|
+
npx create-projx diff
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Shows file-by-file analysis: clean updates, files needing merge, user-only changes, and skipped files.
|
|
154
|
+
|
|
155
|
+
### Pin / Unpin Files
|
|
156
|
+
|
|
157
|
+
Skip files from future template updates without editing JSON:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npx create-projx pin backend/pyproject.toml # skip this file
|
|
161
|
+
npx create-projx pin "backend/src/**" # skip with glob
|
|
162
|
+
npx create-projx unpin backend/pyproject.toml # allow updates again
|
|
163
|
+
npx create-projx pin --list # show all pinned files
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Files inside a component directory are added to that component's `.projx-component` skip list. Root-level files are added to `.projx` skip.
|
|
167
|
+
|
|
168
|
+
### Health Check
|
|
169
|
+
|
|
170
|
+
Diagnose issues with your projx setup:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
npx create-projx doctor # check everything
|
|
174
|
+
npx create-projx doctor --fix # auto-fix what's possible
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Checks: config validity, component markers, baseline ref, stale worktrees, skip pattern coverage.
|
|
178
|
+
|
|
179
|
+
### Generate Entities
|
|
180
|
+
|
|
181
|
+
Scaffold a new entity across all components in your project:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
npx create-projx gen entity invoice # interactive
|
|
185
|
+
npx create-projx gen entity invoice --fields "name:string,amount:number" # non-interactive
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Generates based on what's in your `.projx`:
|
|
189
|
+
|
|
190
|
+
| Component | Generated |
|
|
191
|
+
| --------- | --------- |
|
|
192
|
+
| `fastapi` | `src/entities/<name>/_model.py` — auto-discovered by registry |
|
|
193
|
+
| `fastify` | `src/modules/<name>/schemas.ts` + `index.ts` + Prisma model + app.ts import |
|
|
194
|
+
| `frontend` | `src/types/<name>.ts` — TypeScript interface + Create/Update variants |
|
|
195
|
+
| `mobile` | `lib/entities/<name>/model.dart` — Dart class with fromJson/toJson/copyWith |
|
|
196
|
+
|
|
197
|
+
No migrations — run `alembic revision --autogenerate` or `npx prisma migrate dev` when ready.
|
|
198
|
+
|
|
199
|
+
### Sync Types
|
|
200
|
+
|
|
201
|
+
Regenerate all frontend/mobile types from a running backend:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
npx create-projx sync # auto-detects URL
|
|
205
|
+
npx create-projx sync --url http://localhost:8000/api/v1/_meta # explicit URL
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Fetches `/_meta` from your backend, generates typed interfaces for every entity. Run after any backend change — new field, renamed column, new entity.
|
|
209
|
+
|
|
210
|
+
The generic `api.ts` client accepts type parameters:
|
|
211
|
+
|
|
212
|
+
```tsx
|
|
213
|
+
import type { Invoice } from '../types/invoice';
|
|
214
|
+
|
|
215
|
+
const { data } = await api.list<Invoice>('/invoices'); // data: Invoice[]
|
|
216
|
+
const item = await api.get<Invoice>('/invoices', id); // item: Invoice
|
|
217
|
+
```
|
|
218
|
+
|
|
137
219
|
## Rename Component Directories
|
|
138
220
|
|
|
139
221
|
Rename `fastapi/` to `backend/`? Just rename the folder — the `.projx-component` marker file moves with it. The `update` command auto-discovers where each component lives by scanning for these markers. No config changes needed.
|