create-projx 1.1.2 → 1.3.0

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Projx
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/create-projx)](https://www.npmjs.com/package/create-projx)
4
+ [![CI](https://github.com/ukanhaupa/projx/actions/workflows/ci.yml/badge.svg)](https://github.com/ukanhaupa/projx/actions/workflows/ci.yml)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+
3
7
  Production-grade project scaffolder. Pick your stack, get a fully wired project with auth, database, CI/CD, and E2E tests — ready to deploy.
4
8
 
5
9
  ## The Problem
@@ -54,32 +58,58 @@ Interactive prompt lets you pick components. Or specify them directly:
54
58
  npx create-projx my-app --components fastapi,fastify,frontend,mobile,e2e,infra
55
59
  ```
56
60
 
57
- ### Add Components Later
61
+ ### Adopt an Existing Project
62
+
63
+ Already have a project? Initialize projx to get the scaffolding (CI, hooks, docker-compose) without overwriting your code:
64
+
65
+ ```bash
66
+ cd my-existing-app
67
+ npx create-projx init
68
+ ```
69
+
70
+ Auto-detects components by scanning for `fastapi` in pyproject.toml, `react`/`fastify` in package.json, `flutter` in pubspec.yaml, and `.tf` files. Confirms each mapping, creates a `projx/baseline` branch with the template, and merges it — preserving all your existing code while establishing the ancestry link that makes future updates work.
58
71
 
59
- Already have a project? Add more components anytime:
72
+ ### Add Components Later
60
73
 
61
74
  ```bash
62
75
  cd my-app
63
76
  npx create-projx add frontend mobile
64
77
  ```
65
78
 
66
- This copies the new component directories, regenerates shared files (docker-compose, CI, pre-commit hooks) to include them, and installs dependencies.
79
+ Copies the new component directories, regenerates shared files (docker-compose, CI, pre-commit hooks) to include them, and installs dependencies.
67
80
 
68
81
  ### Update Scaffolding
69
82
 
70
- When we improve templates, update your project's scaffolding without touching your code:
83
+ When templates improve, update your project:
71
84
 
72
85
  ```bash
73
86
  cd my-app
74
87
  npx create-projx@latest update
75
88
  ```
76
89
 
77
- This updates template files (base models, middleware, configs, Dockerfiles, CI) tracked in `.projx` manifest. Files you created (new entities, pages, features) are never touched.
90
+ Uses a `projx/baseline` branch that tracks the raw template state. When you update, the baseline advances to the new template version and merges into your branch using git's three-way merge:
91
+
92
+ - **Files only the template changed** — auto-merged, no action needed
93
+ - **Files only you changed** — preserved, untouched
94
+ - **Files both sides changed** — git conflict, you resolve
95
+
96
+ ```bash
97
+ # If conflicts occur:
98
+ git status # see conflicted files
99
+ # resolve conflicts in your editor
100
+ git add . && git commit # finish the merge
101
+
102
+ # Or abort:
103
+ git merge --abort
104
+ ```
105
+
106
+ Your custom files (controllers, pages, middleware) are never deleted. Files you created that don't exist in the template are always preserved.
78
107
 
79
108
  ## Options
80
109
 
81
110
  ```
82
111
  npx create-projx <name> [options]
112
+ npx create-projx init
83
113
  npx create-projx add <components...>
84
114
  npx create-projx update
85
115
 
@@ -90,19 +120,34 @@ npx create-projx update
90
120
  -h, --help Show help
91
121
  ```
92
122
 
123
+ ## Rename Component Directories
124
+
125
+ 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.
126
+
127
+ ```
128
+ backend/.projx-component → { "components": ["fastapi"] }
129
+ web/.projx-component → { "components": ["frontend"] }
130
+ ```
131
+
132
+ CI, setup.sh, pre-commit hooks, and docker-compose are all regenerated with your custom directory names.
133
+
93
134
  ## What a Scaffolded Project Looks Like
94
135
 
95
136
  ```
96
137
  my-app/
97
- ├── fastapi/ # Auto-entity CRUD backend
98
- ├── frontend/ # Auto-entity UI from /_meta
99
- ├── e2e/ # Playwright E2E tests
100
- ├── docker-compose.yml # Production (backend + frontend + SSL)
101
- ├── docker-compose.dev.yml # Development (PostgreSQL + hot reload)
102
- ├── .github/workflows/ # CI per component
103
- ├── .githooks/pre-commit # Format + lint on commit
104
- ├── setup.sh # Install all deps
105
- └── .projx # Manifest (tracks template files for updates)
138
+ ├── fastapi/ # Auto-entity CRUD backend
139
+ │ └── .projx-component # Identifies this as the fastapi component
140
+ ├── frontend/ # Auto-entity UI from /_meta
141
+ │ └── .projx-component
142
+ ├── e2e/ # Playwright E2E tests
143
+ │ └── .projx-component
144
+ ├── docker-compose.yml # Production (backend + frontend + SSL)
145
+ ├── docker-compose.dev.yml # Development (PostgreSQL + hot reload)
146
+ ├── .github/workflows/ # CI per component (runs only on changes)
147
+ ├── .githooks/pre-commit # Format + lint on commit
148
+ ├── .vscode/ # Editor settings + recommended extensions
149
+ ├── setup.sh # Install all deps
150
+ └── .projx # Components list + version
106
151
  ```
107
152
 
108
153
  Only the components you selected appear. Shared files (docker-compose, CI, hooks) are generated to match your selection.
@@ -121,9 +166,10 @@ The core idea: define a data model, get everything else for free.
121
166
 
122
167
  - JWT auth with Keycloak (pluggable providers)
123
168
  - Docker Compose for dev and prod
124
- - GitHub Actions CI per component
169
+ - GitHub Actions CI per component (path-filtered — only runs when that component changes)
125
170
  - Pre-commit hooks (format + lint + typecheck)
126
171
  - Secret detection in pre-commit
172
+ - VS Code settings + recommended extensions
127
173
  - 80% test coverage enforced
128
174
  - Auto-entity discovery across all stacks
129
175
 
@@ -139,6 +185,20 @@ cd projx
139
185
 
140
186
  The CLI lives in `cli/`. Templates are the root-level component directories (`fastapi/`, `frontend/`, etc.).
141
187
 
188
+ ```bash
189
+ cd cli
190
+ npm test # run tests
191
+ npm run build # build CLI
192
+ ```
193
+
194
+ ## Badge
195
+
196
+ Add this to your project's README:
197
+
198
+ ```md
199
+ [![Built with Projx](https://img.shields.io/badge/Built%20with-Projx-blue)](https://github.com/ukanhaupa/projx)
200
+ ```
201
+
142
202
  ## License
143
203
 
144
204
  MIT