create-prisma-php-app 5.0.0-alpha.17 → 5.0.0-alpha.19

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 CHANGED
@@ -2,66 +2,51 @@
2
2
 
3
3
  # Prisma PHP AI Agent Rules
4
4
 
5
- This repository is the Prisma PHP package and docs workspace, not a generated Prisma PHP application.
5
+ This AGENTS.md belongs in the root of a Prisma PHP application.
6
6
 
7
- Treat `dist/docs/index.md` as the entry point for Prisma PHP guidance in this repo, then read the matching document in `dist/docs` before generating, editing, reviewing, or documenting framework-specific behavior.
7
+ Treat `./node_modules/prisma-php/dist/docs/index.md` as the entry point for Prisma PHP guidance, then read the matching document in `./node_modules/prisma-php/dist/docs` before generating, editing, reviewing, or documenting framework-specific behavior.
8
8
 
9
- Do not guess framework behavior from Laravel, Next.js, React, Vue, Livewire, Alpine, Symfony, Socket.IO, or generic PHP habits. Prisma PHP's local docs and the current repository context are the source of truth.
9
+ Do not guess framework behavior from Laravel, Next.js, React, Vue, Livewire, Alpine, Symfony, Socket.IO, or generic PHP habits. Prisma PHP's installed docs in `./node_modules/prisma-php/dist/docs` and the current project files are the source of truth.
10
10
 
11
- ## Repository mode vs app mode
11
+ ## Documentation source of truth
12
12
 
13
- There are two valid Prisma PHP contexts, and AI must not mix them up.
14
-
15
- ### 1. Package/docs repo mode
16
-
17
- This workspace is package/docs repo mode.
18
-
19
- In this repo, use this order first:
13
+ For Prisma PHP projects, use this order first:
20
14
 
21
15
  1. the user's explicit request
22
- 2. `dist/docs/index.md`
23
- 3. the relevant document in `dist/docs`
24
- 4. `.github/copilot-instructions.md`
25
- 5. `package.json` and nearby repo files
26
- 6. Prisma PHP core internals only when the docs still leave a gap
16
+ 2. `./prisma-php.json`
17
+ 3. the relevant installed document in `./node_modules/prisma-php/dist/docs`
18
+ 4. `./AGENTS.md`
19
+ 5. project-local conventions and existing app files
20
+ 6. Prisma PHP core internals in `vendor/tsnc/prisma-php/src` only when the docs still leave a gap
27
21
  7. general framework knowledge as the last fallback
28
22
 
29
- Important repo-mode rules:
30
-
31
- - do not assume `./prisma-php.json` exists in this repository
32
- - do not assume `node_modules/prisma-php/dist/docs` is the active docs location for this workspace
33
- - do not assume `vendor/tsnc/prisma-php/src` exists locally in this workspace unless the task explicitly provides or references it
34
- - when editing or improving Prisma PHP guidance in this repo, keep `AGENTS.md`, `.github/copilot-instructions.md`, and `dist/docs` aligned with each other
35
-
36
- ### 2. Consumer app mode
23
+ Important rules:
37
24
 
38
- When a task is about a generated Prisma PHP application rather than this package repo, use this app-mode order:
25
+ - treat `./node_modules/prisma-php/dist/docs` as the single documentation source of truth for the installed Prisma PHP version
26
+ - expect `./AGENTS.md` at the project root
27
+ - when the installed docs and a habit from another framework conflict, follow Prisma PHP
28
+ - when updating Prisma PHP package/docs sources, keep `AGENTS.md`, `.github/copilot-instructions.md`, and `dist/docs` aligned so the published docs stay correct after install
39
29
 
40
- 1. the user's explicit request
41
- 2. `./prisma-php.json`
42
- 3. installed Prisma PHP docs in `node_modules/prisma-php/dist/docs`
43
- 4. project-local conventions and existing app files
44
- 5. Prisma PHP core internals in `vendor/tsnc/prisma-php/src`
45
- 6. general framework knowledge
30
+ ## Installed docs location
46
31
 
47
- If a documented Prisma PHP rule conflicts with a habit from another framework, follow Prisma PHP.
32
+ In Prisma PHP applications, the installed docs live in:
48
33
 
49
- ## Source of truth in this repo
34
+ ```txt
35
+ node_modules/prisma-php/dist/docs
36
+ ```
50
37
 
51
- The Prisma PHP docs shipped in this repository live in:
38
+ The current docs entry point for the installed version is:
52
39
 
53
40
  ```txt
54
- dist/docs
41
+ node_modules/prisma-php/dist/docs/index.md
55
42
  ```
56
43
 
57
- The current docs entry point in this repository is:
44
+ The project root should also include:
58
45
 
59
46
  ```txt
60
- dist/docs/index.md
47
+ AGENTS.md
61
48
  ```
62
49
 
63
- When updating AI guidance for Prisma PHP itself, treat `dist/docs` as the authoritative local documentation surface for this workspace.
64
-
65
50
  ## Required doc-routing map
66
51
 
67
52
  Before generating code, examples, instructions, or reviews, choose the documentation file based on the task.
@@ -74,21 +59,36 @@ Before generating code, examples, instructions, or reviews, choose the documenta
74
59
  - **Project setup, folder placement, route file choice, feature placement, or overall file conventions**
75
60
  Read `project-structure.md`
76
61
 
62
+ - **CLI project creation, starter kits, feature flags, or `npx pp update project` usage**
63
+ Read `commands.md`
64
+
65
+ - **Backend-only Prisma PHP usage, API-first projects, `backendOnly`, separate frontend consumers, or CORS setup for API routes**
66
+ Read `backend-only.md`
67
+
77
68
  - **Creating a page, layout, nested route, dynamic route, or normal UI route**
78
69
  Read `layouts-and-pages.md`
79
70
 
80
71
  - **Creating, editing, composing, or reviewing PHPX components, props, children, fragments, icons, buttons, accordions, or component file placement**
81
72
  Read `components.md`
82
73
 
74
+ - **TypeScript frontend tooling, the `typescript` feature flag, the root `ts/` directory, `ts/main.ts`, npm packages, or registered browser helpers used from template expressions and PulsePoint scripts**
75
+ Read `typescript.md`, then use `pulsepoint.md`, `layouts-and-pages.md`, or `components.md` for the affected component boundary
76
+
83
77
  - **Loading data, calling backend logic from the frontend, `pp.fetchFunction(...)`, `#[Exposed]`, route-local mutations, streaming responses, or interactive backend validation**
84
78
  Read `fetching-data.md`
85
79
 
80
+ - **AI integration, provider SDKs, chat UIs, streamed assistant output, or deciding between page-local assistant UI, websocket, and MCP tools**
81
+ Read `get-started-ia.md`, then use `fetching-data.md`, `validator.md`, `websocket.md`, or `mcp.md` as needed
82
+
86
83
  - **PulsePoint runtime behavior such as `pp.state`, `pp.effect`, `pp-for`, `pp-spread`, or `pp-ref`**
87
84
  Read `pulsepoint.md`
88
85
 
89
86
  - **Validation, sanitization, `PP\Validator`, `PP\Rule`, field validation, form validation, live validation, or request validation rules**
90
87
  Read `validator.md`, then apply the relevant local guidance from `fetching-data.md`, `error-handling.md`, and `route-handlers.md`
91
88
 
89
+ - **Environment variables, `.env`, `PP\Env`, `Env::get`, `Env::string`, `Env::bool`, `Env::int`, feature flags, host and port config, or runtime bootstrap settings**
90
+ Read `env.md`, then verify the official env docs at `env` and `env-file`
91
+
92
92
  - **File uploads, `multipart/form-data`, `$_FILES`, `PP\FileManager\UploadFile`, rename flows, replace flows, delete flows, allowed file types, upload size rules, or file manager UI behavior**
93
93
  Read `file-manager.md`, then verify the official File Manager docs and, when internals matter, the core upload file at `vendor/tsnc/prisma-php/src/FileManager/UploadFile.php`
94
94
 
@@ -119,6 +119,9 @@ Before generating code, examples, instructions, or reviews, choose the documenta
119
119
  - **API-style routes, JSON responses, handlers, webhooks, form-processing endpoints, `route.php`, or request validation in handlers**
120
120
  Read `route-handlers.md`
121
121
 
122
+ - **Swagger or OpenAPI generation, `swaggerDocs`, `pphp-swagger.json`, `create-swagger-docs`, or `settings/prisma-schema-config.json`**
123
+ Read `swagger-docs.md`
124
+
122
125
  - **Upgrading Prisma PHP, enabling features, syncing framework-managed project files, or running project updates**
123
126
  Read `upgrading.md`
124
127
 
@@ -130,12 +133,16 @@ Before generating code, examples, instructions, or reviews, choose the documenta
130
133
  The current Prisma PHP docs shipped here include:
131
134
 
132
135
  - `authentication.md`
136
+ - `backend-only.md`
133
137
  - `caching.md`
138
+ - `commands.md`
134
139
  - `components.md`
135
140
  - `email.md`
141
+ - `env.md`
136
142
  - `error-handling.md`
137
143
  - `fetching-data.md`
138
144
  - `file-manager.md`
145
+ - `get-started-ia.md`
139
146
  - `index.md`
140
147
  - `installation.md`
141
148
  - `layouts-and-pages.md`
@@ -145,11 +152,13 @@ The current Prisma PHP docs shipped here include:
145
152
  - `project-structure.md`
146
153
  - `pulsepoint.md`
147
154
  - `route-handlers.md`
155
+ - `swagger-docs.md`
156
+ - `typescript.md`
148
157
  - `upgrading.md`
149
158
  - `validator.md`
150
159
  - `websocket.md`
151
160
 
152
- When adding or reviewing AI guidance, do not stop at older docs only. Make sure the guidance also covers `email.md`, `mcp.md`, and `websocket.md`, plus newer behavior documented in `fetching-data.md` and `metadata-and-og-images.md`.
161
+ When adding or reviewing AI guidance, do not stop at older docs only. Make sure the guidance also covers `backend-only.md`, `email.md`, `env.md`, `get-started-ia.md`, `mcp.md`, `swagger-docs.md`, `typescript.md`, and `websocket.md`, plus newer behavior documented in `fetching-data.md` and `metadata-and-og-images.md`.
153
162
 
154
163
  ## Framework-generated files
155
164
 
@@ -249,7 +258,6 @@ Use this pattern:
249
258
  1. PHP first
250
259
  2. exactly one parent root element
251
260
  3. keep any component-local `<script>` inside that root element
252
- 4. let Prisma PHP inject `pp-component` for that boundary automatically
253
261
 
254
262
  Example:
255
263
 
@@ -260,7 +268,7 @@ Example:
260
268
 
261
269
  ?>
262
270
 
263
- <div>
271
+ <div pp-component="search-box">
264
272
  <h2>Search</h2>
265
273
  <input value="{query}" />
266
274
  <script>
@@ -340,20 +348,11 @@ In a consumer app, also verify `backendOnly` in `prisma-php.json`:
340
348
 
341
349
  Use this workflow unless the user asks for something narrower.
342
350
 
343
- ### For this repository
344
-
345
- 1. read `dist/docs/index.md`
346
- 2. read the relevant document in `dist/docs`
347
- 3. inspect nearby docs, examples, and guidance files in this repo
348
- 4. keep `AGENTS.md` and `.github/copilot-instructions.md` aligned with the documented behavior
349
- 5. inspect framework internals only when the docs still leave a real gap
350
-
351
- ### For consumer app examples or generated-app tasks
352
-
353
351
  1. read `./prisma-php.json`
354
- 2. read the relevant installed doc from `node_modules/prisma-php/dist/docs`
355
- 3. inspect nearby project files that match the route, feature, or component being changed
356
- 4. inspect `vendor/tsnc/prisma-php/src` only if the docs do not answer the task
352
+ 2. read the relevant installed doc from `./node_modules/prisma-php/dist/docs`
353
+ 3. inspect `./AGENTS.md` for project-level Prisma PHP guidance
354
+ 4. inspect nearby project files that match the route, feature, or component being changed
355
+ 5. inspect `vendor/tsnc/prisma-php/src` only if the docs do not answer the task
357
356
 
358
357
  Do not jump directly into framework internals if the current docs already answer the task.
359
358
 
@@ -432,6 +431,26 @@ Important email rules:
432
431
  - prefer the documented fluent API such as `to(...)`, `subject(...)`, `html(...)`, `text(...)`, `attach(...)`, and `send()`
433
432
  - use `raw()` only when low-level PHPMailer access is genuinely needed
434
433
 
434
+ ## Env rules
435
+
436
+ When the task involves `.env`, `PP\Env`, feature flags, ports, host names, timezones, API keys, numeric limits, or other runtime configuration values, read `env.md` first.
437
+
438
+ Use this env workflow:
439
+
440
+ 1. read `env.md`
441
+ 2. inspect `.env` or the deployment environment when the task depends on actual values
442
+ 3. inspect the bootstrap or server entry file that loads or consumes the environment
443
+ 4. inspect the feature-specific doc such as `email.md`, `mcp.md`, `websocket.md`, `get-started-ia.md`, or `prisma-php-orm.md` when the env values belong to that feature
444
+ 5. inspect `vendor/tsnc/prisma-php/src/Env.php` only if the docs do not answer the task
445
+
446
+ Important env rules:
447
+
448
+ - prefer `PP\Env` over repeated ad hoc `getenv()` parsing in documented Prisma PHP code paths
449
+ - use `Env::string(...)`, `Env::bool(...)`, and `Env::int(...)` for typed access with defaults
450
+ - use `Env::get(...)` when raw nullable string access is actually needed
451
+ - remember that `PP\Env` reads values from `getenv()`, `$_ENV`, and `$_SERVER`; it does not parse `.env` by itself
452
+ - keep secrets and deployment-specific settings in `.env` or the real runtime environment, not hardcoded in route files or components
453
+
435
454
  ## WebSocket rules
436
455
 
437
456
  When the task involves realtime messaging, presence, live dashboards, `Ratchet`, or browser `WebSocket`, read `websocket.md` first.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "5.0.0-alpha.17",
3
+ "version": "5.0.0-alpha.19",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/dist/README.md DELETED
@@ -1,213 +0,0 @@
1
- # Prisma PHP
2
-
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
-
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
-
7
- ## Getting Started
8
-
9
- Create a new Prisma PHP project:
10
-
11
- ```bash
12
- npx create-prisma-php-app@latest my-app
13
- ```
14
-
15
- Start the development server:
16
-
17
- ```bash
18
- npm run dev
19
- ```
20
-
21
- Open the local app in your browser after the dev server starts.
22
-
23
- ## Prerequisites
24
-
25
- Before creating a Prisma PHP project, make sure you have:
26
-
27
- - Node.js 22.x or higher
28
- - PHP 8.2 or higher
29
- - Composer 2.x or higher
30
- - XAMPP or another local PHP environment
31
-
32
- If you are using XAMPP on Windows, enabling `extension=zip` in `php.ini` is recommended so Composer dependencies install correctly.
33
-
34
- ## What Prisma PHP Includes
35
-
36
- Prisma PHP brings together the core pieces needed to build full-stack PHP apps:
37
-
38
- - **Native PHP + modern reactivity** with PulsePoint
39
- - **PHPX component system** for reusable UI composition
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
43
- - **CLI scaffolding** for new apps, starter kits, and optional features
44
- - **Flexible deployment options** for local development and production workflows
45
-
46
- ## Common Create Commands
47
-
48
- Create a default full-stack app:
49
-
50
- ```bash
51
- npx create-prisma-php-app@latest my-app
52
- ```
53
-
54
- Create a project with common options:
55
-
56
- ```bash
57
- npx create-prisma-php-app@latest my-app --tailwindcss --typescript
58
- ```
59
-
60
- Use a starter kit:
61
-
62
- ```bash
63
- npx create-prisma-php-app my-app --starter-kit=fullstack
64
- ```
65
-
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.
67
-
68
- ## Documentation
69
-
70
- Prisma PHP ships with local documentation for the installed project version.
71
-
72
- The installed docs live here:
73
-
74
- ```txt
75
- node_modules/prisma-php/dist/docs
76
- ```
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
-
111
- ## Project Capability Manifest
112
-
113
- Prisma PHP uses `prisma-php.json` at the repository root as the source of truth for enabled framework features and local environment configuration.
114
-
115
- Use it to verify capabilities such as:
116
-
117
- - Tailwind CSS support
118
- - backend-only mode
119
- - Prisma ORM support
120
- - Swagger docs
121
- - WebSocket support
122
- - MCP support
123
- - TypeScript support
124
- - local development paths and BrowserSync settings
125
-
126
- Do not assume a feature is enabled unless `prisma-php.json` confirms it.
127
-
128
- ## Documentation Map
129
-
130
- Use these docs as the main entry points for common work:
131
-
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
146
-
147
- ## Recommended Development Approach
148
-
149
- When working in Prisma PHP:
150
-
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
155
-
156
- ## Route and File Conventions
157
-
158
- Prisma PHP uses file-based routing with special route files such as:
159
-
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
166
-
167
- For task-specific route decision rules and framework generation rules, read `AGENTS.md`.
168
-
169
- ## PulsePoint and Frontend Reactivity
170
-
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.
172
-
173
- When working with runtime features such as:
174
-
175
- - `pp.state`
176
- - `pp.effect`
177
- - `pp.ref`
178
- - `pp-for`
179
- - `pp-spread`
180
- - `pp-ref`
181
-
182
- read the installed Prisma PHP docs for the current version first, then consult:
183
-
184
- ```txt
185
- https://pulsepoint.tsnc.tech/llms
186
- ```
187
-
188
- ## Project Structure
189
-
190
- A generated Prisma PHP project typically includes folders like these:
191
-
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
- ```
202
-
203
- ## Updating Existing Projects
204
-
205
- When enabling features or syncing framework-managed project files:
206
-
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.
210
-
211
- ## Learn More
212
-
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.