create-prisma-php-app 5.0.0-alpha.2 → 5.0.0-alpha.3
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/dist/AGENTS.md +39 -2
- package/dist/README.md +115 -98
- package/package.json +1 -1
package/dist/AGENTS.md
CHANGED
|
@@ -131,6 +131,43 @@ Before generating code, choose the documentation file based on the task.
|
|
|
131
131
|
- **General doc entry point and framework orientation**
|
|
132
132
|
Read `index.md`
|
|
133
133
|
|
|
134
|
+
## Default interactive UI and fetching rule
|
|
135
|
+
|
|
136
|
+
For normal full-stack Prisma PHP work, assume the user wants the **PulsePoint-first** approach unless they explicitly ask otherwise.
|
|
137
|
+
|
|
138
|
+
Default interaction stack:
|
|
139
|
+
|
|
140
|
+
1. render route UI with `index.php`
|
|
141
|
+
2. keep browser-side interactivity in **PulsePoint**
|
|
142
|
+
3. call backend PHP from the frontend with **`pp.fetchFunction(...)`**
|
|
143
|
+
4. mark callable PHP functions or methods with **`#[Exposed]`**
|
|
144
|
+
5. validate and normalize input on the PHP side with **`PP\Validator`**
|
|
145
|
+
|
|
146
|
+
Treat this as the default for:
|
|
147
|
+
|
|
148
|
+
- search
|
|
149
|
+
- filters
|
|
150
|
+
- pagination
|
|
151
|
+
- quick edit flows
|
|
152
|
+
- toggles
|
|
153
|
+
- dialogs and drawers
|
|
154
|
+
- inline validation
|
|
155
|
+
- route-local CRUD actions
|
|
156
|
+
- dashboard interactions
|
|
157
|
+
- similar reactive page behavior
|
|
158
|
+
|
|
159
|
+
Do **not** default to:
|
|
160
|
+
|
|
161
|
+
- a PHP-only interaction style
|
|
162
|
+
- ad hoc `fetch('/api/...')` patterns
|
|
163
|
+
- extra `route.php` files for page-local interactions that already fit `pp.fetchFunction(...)`
|
|
164
|
+
|
|
165
|
+
Choose a more PHP-only pattern only when:
|
|
166
|
+
|
|
167
|
+
- the user explicitly asks for PHP-only behavior
|
|
168
|
+
- the task is clearly non-reactive
|
|
169
|
+
- the task is a standalone API, webhook, integration endpoint, or public JSON handler
|
|
170
|
+
|
|
134
171
|
## Default workflow for AI agents
|
|
135
172
|
|
|
136
173
|
Use this workflow unless the user asks for something narrower:
|
|
@@ -151,9 +188,9 @@ When the task is about creating or editing a route, do not guess.
|
|
|
151
188
|
|
|
152
189
|
Important: creating a route means creating or updating the correct folder and route file under `src/app`. It does **not** mean editing generated route metadata. In particular, never update `files-list.json` by hand.
|
|
153
190
|
|
|
154
|
-
- Use `index.php` for rendered UI and normal page routes
|
|
191
|
+
- Use `index.php` for rendered UI and normal page routes, and default to PulsePoint plus `pp.fetchFunction(...)` for interactive behavior inside those routes unless the user explicitly asks for PHP-only behavior
|
|
155
192
|
- Use `layout.php` for shared UI that wraps route subtrees
|
|
156
|
-
- Use `route.php` for direct handlers such as JSON endpoints, API-style routes, AJAX handlers, form-processing endpoints, webhooks, or other no-view server logic
|
|
193
|
+
- Use `route.php` for direct handlers such as JSON endpoints, API-style routes, AJAX handlers, form-processing endpoints, webhooks, or other no-view server logic; do not default to `route.php` for normal route-local interactions that fit PulsePoint plus `pp.fetchFunction(...)`
|
|
157
194
|
- Use `not-found.php` for route-specific not-found UI
|
|
158
195
|
- Use `error.php` for route or app-level error UI
|
|
159
196
|
|
package/dist/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Prisma PHP is a modern full-stack PHP framework that combines native PHP, PulsePoint reactivity, PHPX components, and a Prisma-inspired ORM into one cohesive developer experience.
|
|
4
4
|
|
|
5
|
-
Build
|
|
5
|
+
Build reactive interfaces with a server-first mental model, structured routing, type-safe data access, and a project layout designed for real applications.
|
|
6
6
|
|
|
7
7
|
## Getting Started
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Create a new Prisma PHP project:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npx create-prisma-php-app@latest my-app
|
|
@@ -18,7 +18,7 @@ Start the development server:
|
|
|
18
18
|
npm run dev
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Open
|
|
21
|
+
Open the local app in your browser after the dev server starts.
|
|
22
22
|
|
|
23
23
|
## Prerequisites
|
|
24
24
|
|
|
@@ -36,10 +36,12 @@ If you are using XAMPP on Windows, enabling `extension=zip` in `php.ini` is reco
|
|
|
36
36
|
Prisma PHP brings together the core pieces needed to build full-stack PHP apps:
|
|
37
37
|
|
|
38
38
|
- **Native PHP + modern reactivity** with PulsePoint
|
|
39
|
-
- **PHPX component system**
|
|
39
|
+
- **PHPX component system** for reusable UI composition
|
|
40
40
|
- **Prisma PHP ORM** for schema-first, type-safe database access
|
|
41
|
+
- **Built-in authentication patterns** for sessions, route protection, RBAC, credentials auth, and provider login
|
|
42
|
+
- **File-based routing** with clear route file conventions
|
|
41
43
|
- **CLI scaffolding** for new apps, starter kits, and optional features
|
|
42
|
-
- **Flexible deployment options** for
|
|
44
|
+
- **Flexible deployment options** for local development and production workflows
|
|
43
45
|
|
|
44
46
|
## Common Create Commands
|
|
45
47
|
|
|
@@ -61,136 +63,151 @@ Use a starter kit:
|
|
|
61
63
|
npx create-prisma-php-app my-app --starter-kit=fullstack
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
Other documented flags include
|
|
66
|
+
Other documented flags may include capabilities such as WebSocket support, MCP support, backend-only mode, Swagger docs, and Prisma integration depending on the installed version.
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
- `--mcp`
|
|
68
|
-
- `--backend-only`
|
|
69
|
-
- `--swagger-docs`
|
|
70
|
-
- `--docker`
|
|
68
|
+
## Documentation
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
Prisma PHP ships with local documentation for the installed project version.
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
The installed docs live here:
|
|
75
73
|
|
|
76
|
-
```
|
|
77
|
-
prisma-php
|
|
78
|
-
├── prisma/ # schema, migrations, seed files
|
|
79
|
-
├── public/ # public entry point and assets
|
|
80
|
-
├── settings/ # project configuration
|
|
81
|
-
├── src/ # application source code
|
|
82
|
-
├── package.json # frontend/dev scripts
|
|
83
|
-
├── composer.json # PHP dependencies
|
|
84
|
-
└── prisma-php.json # Prisma PHP project capability manifest
|
|
74
|
+
```txt
|
|
75
|
+
node_modules/prisma-php/dist/docs
|
|
85
76
|
```
|
|
86
77
|
|
|
78
|
+
Treat these installed docs as the primary documentation source for the current project version.
|
|
79
|
+
|
|
80
|
+
You can also explore the public docs site:
|
|
81
|
+
|
|
82
|
+
```txt
|
|
83
|
+
https://prismaphp.tsnc.tech/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## AI Quick Start
|
|
87
|
+
|
|
88
|
+
If you are using AI-assisted development in a Prisma PHP project:
|
|
89
|
+
|
|
90
|
+
1. Read `./prisma-php.json` first.
|
|
91
|
+
2. Read the installed docs in `node_modules/prisma-php/dist/docs`.
|
|
92
|
+
3. Read `AGENTS.md` for task-routing rules, framework constraints, and code-generation guidance.
|
|
93
|
+
4. Inspect `vendor/tsnc/prisma-php/src` only when the docs do not answer the task.
|
|
94
|
+
|
|
95
|
+
### Default interactive UI rule
|
|
96
|
+
|
|
97
|
+
In Prisma PHP, AI should treat **PulsePoint as the default frontend interactivity model**.
|
|
98
|
+
|
|
99
|
+
For normal full-stack page work:
|
|
100
|
+
|
|
101
|
+
- render the page with `index.php`
|
|
102
|
+
- manage browser-side state and UI behavior with **PulsePoint**
|
|
103
|
+
- call PHP from the frontend with **`pp.fetchFunction(...)`**
|
|
104
|
+
- expose callable PHP functions with **`#[Exposed]`**
|
|
105
|
+
- validate incoming data on the PHP side with **`PP\Validator`**
|
|
106
|
+
|
|
107
|
+
Do **not** default to PHP-only refresh cycles, handcrafted `fetch('/api/...')` patterns, or extra `route.php` handlers for normal interactive page behavior when PulsePoint plus `pp.fetchFunction(...)` already fits the task.
|
|
108
|
+
|
|
109
|
+
Only prefer a more PHP-only interaction style when the **user explicitly asks for PHP-only behavior**, or when the task is clearly non-reactive.
|
|
110
|
+
|
|
87
111
|
## Project Capability Manifest
|
|
88
112
|
|
|
89
113
|
Prisma PHP uses `prisma-php.json` at the repository root as the source of truth for enabled framework features and local environment configuration.
|
|
90
114
|
|
|
91
|
-
|
|
115
|
+
Use it to verify capabilities such as:
|
|
92
116
|
|
|
93
|
-
-
|
|
117
|
+
- Tailwind CSS support
|
|
94
118
|
- backend-only mode
|
|
95
|
-
- Prisma ORM
|
|
96
|
-
- Tailwind CSS availability
|
|
119
|
+
- Prisma ORM support
|
|
97
120
|
- Swagger docs
|
|
98
|
-
-
|
|
121
|
+
- WebSocket support
|
|
99
122
|
- MCP support
|
|
100
123
|
- TypeScript support
|
|
101
|
-
- local development paths and BrowserSync
|
|
102
|
-
|
|
103
|
-
A typical file looks like this:
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"projectName": "test-latest",
|
|
108
|
-
"projectRootPath": "C:\\xampp\\htdocs\\projects\\prisma-php\\test\\test-latest",
|
|
109
|
-
"phpEnvironment": "XAMPP",
|
|
110
|
-
"phpRootPathExe": "C:\\xampp\\php\\php.exe",
|
|
111
|
-
"bsTarget": "http://localhost/projects/prisma-php/test/test-latest/",
|
|
112
|
-
"bsPathRewrite": {
|
|
113
|
-
"^/": "/projects/prisma-php/test/test-latest/"
|
|
114
|
-
},
|
|
115
|
-
"backendOnly": false,
|
|
116
|
-
"swaggerDocs": false,
|
|
117
|
-
"tailwindcss": true,
|
|
118
|
-
"websocket": false,
|
|
119
|
-
"mcp": false,
|
|
120
|
-
"prisma": false,
|
|
121
|
-
"typescript": false,
|
|
122
|
-
"version": "4.4.9",
|
|
123
|
-
"componentScanDirs": ["src", "vendor/tsnc/prisma-php/src"],
|
|
124
|
-
"excludeFiles": []
|
|
125
|
-
}
|
|
126
|
-
```
|
|
124
|
+
- local development paths and BrowserSync settings
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
Do not assume a feature is enabled unless `prisma-php.json` confirms it.
|
|
129
127
|
|
|
130
|
-
|
|
128
|
+
## Documentation Map
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
- do not assume Tailwind CSS, Prisma ORM, MCP, Swagger, TypeScript, or websocket support is enabled unless the file says so
|
|
134
|
-
- read the installed Prisma PHP docs for the current version before changing routing, layouts, middleware, or framework-specific behavior
|
|
135
|
-
- use `prisma-php.json` together with the installed docs to make safer decisions
|
|
130
|
+
Use these docs as the main entry points for common work:
|
|
136
131
|
|
|
137
|
-
|
|
132
|
+
- `index.md` for the general documentation entry point
|
|
133
|
+
- `project-structure.md` for project structure, route placement, and file conventions
|
|
134
|
+
- `layouts-and-pages.md` for pages, layouts, nested routes, and dynamic routes
|
|
135
|
+
- `components.md` for PHPX components, props, children, fragments, icons, buttons, and composition
|
|
136
|
+
- `fetching-data.md` for `pp.fetchFunction(...)`, `#[Exposed]`, and interactive backend flows
|
|
137
|
+
- `prisma-php-orm.md` for Prisma ORM, `schema.prisma`, migrations, and generated PHP classes
|
|
138
|
+
- `authentication.md` for auth strategy, sessions, RBAC, credentials auth, and provider flows
|
|
139
|
+
- `file-manager.md` for uploads, `multipart/form-data`, `$_FILES`, and `PP\FileManager\UploadFile`
|
|
140
|
+
- `route-handlers.md` for `route.php`, JSON responses, and direct server handlers
|
|
141
|
+
- `error-handling.md` for expected errors, `error.php`, `not-found.php`, and validation failures
|
|
142
|
+
- `caching.md` for cache behavior and `CacheHandler`
|
|
143
|
+
- `metadata-and-og-images.md` for metadata, title, description, icons, and head behavior
|
|
144
|
+
- `pulsepoint.md` for PulsePoint runtime usage and reactivity patterns
|
|
145
|
+
- `upgrading.md` for feature enablement and project update workflows
|
|
138
146
|
|
|
139
|
-
|
|
147
|
+
## Recommended Development Approach
|
|
140
148
|
|
|
141
|
-
|
|
149
|
+
When working in Prisma PHP:
|
|
142
150
|
|
|
143
|
-
|
|
151
|
+
- prefer the installed Prisma PHP docs over assumptions from other frameworks
|
|
152
|
+
- use `AGENTS.md` as the strict AI operating guide
|
|
153
|
+
- inspect nearby project files before generating new framework-specific code
|
|
154
|
+
- inspect framework internals only when the installed docs are not enough
|
|
144
155
|
|
|
145
|
-
|
|
156
|
+
## Route and File Conventions
|
|
146
157
|
|
|
147
|
-
-
|
|
148
|
-
- `findFirst`
|
|
149
|
-
- `findUnique`
|
|
150
|
-
- `create`
|
|
151
|
-
- `update`
|
|
152
|
-
- `delete`
|
|
153
|
-
- `upsert`
|
|
158
|
+
Prisma PHP uses file-based routing with special route files such as:
|
|
154
159
|
|
|
155
|
-
|
|
160
|
+
- `index.php` for rendered UI routes
|
|
161
|
+
- `layout.php` for shared UI wrappers
|
|
162
|
+
- `route.php` for direct handlers such as JSON or API-style endpoints
|
|
163
|
+
- `loading.php` for loading UI
|
|
164
|
+
- `not-found.php` for route-level not-found UI
|
|
165
|
+
- `error.php` for route-level or app-level error UI
|
|
156
166
|
|
|
157
|
-
- `
|
|
158
|
-
- `generate`
|
|
159
|
-
- `push`
|
|
160
|
-
- `reset`
|
|
167
|
+
For task-specific route decision rules and framework generation rules, read `AGENTS.md`.
|
|
161
168
|
|
|
162
|
-
##
|
|
169
|
+
## PulsePoint and Frontend Reactivity
|
|
163
170
|
|
|
164
|
-
Prisma PHP
|
|
171
|
+
Prisma PHP uses PulsePoint for browser-side reactivity, and AI should assume this is the **default choice** for interactive UI behavior in full-stack routes.
|
|
165
172
|
|
|
166
|
-
|
|
167
|
-
- **CI/CD deployment** with GitHub Actions
|
|
168
|
-
- **Docker deployment** for containerized environments
|
|
173
|
+
When working with runtime features such as:
|
|
169
174
|
|
|
170
|
-
|
|
175
|
+
- `pp.state`
|
|
176
|
+
- `pp.effect`
|
|
177
|
+
- `pp.ref`
|
|
178
|
+
- `pp-for`
|
|
179
|
+
- `pp-spread`
|
|
180
|
+
- `pp-ref`
|
|
171
181
|
|
|
172
|
-
|
|
173
|
-
npm run build
|
|
174
|
-
```
|
|
182
|
+
read the installed Prisma PHP docs for the current version first, then consult:
|
|
175
183
|
|
|
176
|
-
|
|
184
|
+
```txt
|
|
185
|
+
https://pulsepoint.tsnc.tech/llms
|
|
186
|
+
```
|
|
177
187
|
|
|
178
|
-
##
|
|
188
|
+
## Project Structure
|
|
179
189
|
|
|
180
|
-
|
|
190
|
+
A generated Prisma PHP project typically includes folders like these:
|
|
181
191
|
|
|
182
|
-
|
|
183
|
-
-
|
|
192
|
+
```text
|
|
193
|
+
prisma-php-project/
|
|
194
|
+
├── prisma/ # schema, migrations, seed files
|
|
195
|
+
├── public/ # public entry point and assets
|
|
196
|
+
├── settings/ # project configuration
|
|
197
|
+
├── src/ # application source code
|
|
198
|
+
├── package.json # frontend/dev scripts
|
|
199
|
+
├── composer.json # PHP dependencies
|
|
200
|
+
└── prisma-php.json # Prisma PHP project capability manifest
|
|
201
|
+
```
|
|
184
202
|
|
|
185
|
-
##
|
|
203
|
+
## Updating Existing Projects
|
|
186
204
|
|
|
187
|
-
|
|
205
|
+
When enabling features or syncing framework-managed project files:
|
|
188
206
|
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
207
|
+
1. Update `prisma-php.json` first.
|
|
208
|
+
2. Read `upgrading.md` in the installed docs.
|
|
209
|
+
3. Run the documented project update workflow for the current version.
|
|
192
210
|
|
|
193
|
-
##
|
|
211
|
+
## Learn More
|
|
194
212
|
|
|
195
|
-
|
|
196
|
-
- If PowerShell blocks local scripts during `npm run dev`, check your Windows execution policy.
|
|
213
|
+
Start with the installed docs for the current project version, use the topic-specific markdown guides for focused work, and rely on `AGENTS.md` when strict AI generation rules are needed.
|