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

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
@@ -32,6 +32,7 @@ Important repo-mode rules:
32
32
  - do not assume `node_modules/prisma-php/dist/docs` is the active docs location for this workspace
33
33
  - do not assume `vendor/tsnc/prisma-php/src` exists locally in this workspace unless the task explicitly provides or references it
34
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
+ - keep each `dist/docs/*.md` page AI-discoverable on its own by making the frontmatter description and opening guidance explicit about when agents should read that file and which nearby docs to consult next
35
36
 
36
37
  ### 2. Consumer app mode
37
38
 
@@ -74,6 +75,12 @@ Before generating code, examples, instructions, or reviews, choose the documenta
74
75
  - **Project setup, folder placement, route file choice, feature placement, or overall file conventions**
75
76
  Read `project-structure.md`
76
77
 
78
+ - **CLI project creation, starter kits, feature flags, or `npx pp update project` usage**
79
+ Read `commands.md`
80
+
81
+ - **Backend-only Prisma PHP usage, API-first projects, `backendOnly`, separate frontend consumers, or CORS setup for API routes**
82
+ Read `backend-only.md`
83
+
77
84
  - **Creating a page, layout, nested route, dynamic route, or normal UI route**
78
85
  Read `layouts-and-pages.md`
79
86
 
@@ -83,12 +90,18 @@ Before generating code, examples, instructions, or reviews, choose the documenta
83
90
  - **Loading data, calling backend logic from the frontend, `pp.fetchFunction(...)`, `#[Exposed]`, route-local mutations, streaming responses, or interactive backend validation**
84
91
  Read `fetching-data.md`
85
92
 
93
+ - **AI integration, provider SDKs, chat UIs, streamed assistant output, or deciding between page-local assistant UI, websocket, and MCP tools**
94
+ Read `get-started-ia.md`, then use `fetching-data.md`, `validator.md`, `websocket.md`, or `mcp.md` as needed
95
+
86
96
  - **PulsePoint runtime behavior such as `pp.state`, `pp.effect`, `pp-for`, `pp-spread`, or `pp-ref`**
87
97
  Read `pulsepoint.md`
88
98
 
89
99
  - **Validation, sanitization, `PP\Validator`, `PP\Rule`, field validation, form validation, live validation, or request validation rules**
90
100
  Read `validator.md`, then apply the relevant local guidance from `fetching-data.md`, `error-handling.md`, and `route-handlers.md`
91
101
 
102
+ - **Environment variables, `.env`, `PP\Env`, `Env::get`, `Env::string`, `Env::bool`, `Env::int`, feature flags, host and port config, or runtime bootstrap settings**
103
+ Read `env.md`, then verify the official env docs at `env` and `env-file`
104
+
92
105
  - **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
106
  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
107
 
@@ -119,6 +132,9 @@ Before generating code, examples, instructions, or reviews, choose the documenta
119
132
  - **API-style routes, JSON responses, handlers, webhooks, form-processing endpoints, `route.php`, or request validation in handlers**
120
133
  Read `route-handlers.md`
121
134
 
135
+ - **Swagger or OpenAPI generation, `swaggerDocs`, `pphp-swagger.json`, `create-swagger-docs`, or `settings/prisma-schema-config.json`**
136
+ Read `swagger-docs.md`
137
+
122
138
  - **Upgrading Prisma PHP, enabling features, syncing framework-managed project files, or running project updates**
123
139
  Read `upgrading.md`
124
140
 
@@ -130,12 +146,16 @@ Before generating code, examples, instructions, or reviews, choose the documenta
130
146
  The current Prisma PHP docs shipped here include:
131
147
 
132
148
  - `authentication.md`
149
+ - `backend-only.md`
133
150
  - `caching.md`
151
+ - `commands.md`
134
152
  - `components.md`
135
153
  - `email.md`
154
+ - `env.md`
136
155
  - `error-handling.md`
137
156
  - `fetching-data.md`
138
157
  - `file-manager.md`
158
+ - `get-started-ia.md`
139
159
  - `index.md`
140
160
  - `installation.md`
141
161
  - `layouts-and-pages.md`
@@ -145,11 +165,12 @@ The current Prisma PHP docs shipped here include:
145
165
  - `project-structure.md`
146
166
  - `pulsepoint.md`
147
167
  - `route-handlers.md`
168
+ - `swagger-docs.md`
148
169
  - `upgrading.md`
149
170
  - `validator.md`
150
171
  - `websocket.md`
151
172
 
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`.
173
+ 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`, and `websocket.md`, plus newer behavior documented in `fetching-data.md` and `metadata-and-og-images.md`.
153
174
 
154
175
  ## Framework-generated files
155
176
 
@@ -432,6 +453,26 @@ Important email rules:
432
453
  - prefer the documented fluent API such as `to(...)`, `subject(...)`, `html(...)`, `text(...)`, `attach(...)`, and `send()`
433
454
  - use `raw()` only when low-level PHPMailer access is genuinely needed
434
455
 
456
+ ## Env rules
457
+
458
+ 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.
459
+
460
+ Use this env workflow:
461
+
462
+ 1. read `env.md`
463
+ 2. inspect `.env` or the deployment environment when the task depends on actual values
464
+ 3. inspect the bootstrap or server entry file that loads or consumes the environment
465
+ 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
466
+ 5. inspect `vendor/tsnc/prisma-php/src/Env.php` only if the docs do not answer the task
467
+
468
+ Important env rules:
469
+
470
+ - prefer `PP\Env` over repeated ad hoc `getenv()` parsing in documented Prisma PHP code paths
471
+ - use `Env::string(...)`, `Env::bool(...)`, and `Env::int(...)` for typed access with defaults
472
+ - use `Env::get(...)` when raw nullable string access is actually needed
473
+ - remember that `PP\Env` reads values from `getenv()`, `$_ENV`, and `$_SERVER`; it does not parse `.env` by itself
474
+ - keep secrets and deployment-specific settings in `.env` or the real runtime environment, not hardcoded in route files or components
475
+
435
476
  ## WebSocket rules
436
477
 
437
478
  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.18",
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.