create-caspian-app 0.2.0-beta.21 → 0.2.0-beta.23
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.
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
- For current repo behavior, trust `main.py`, `src/lib/**`, `public/js/**`, `prisma/**`, and `src/app/**` over generic Caspian docs.
|
|
11
11
|
- For framework internals, trust `.venv/Lib/site-packages/casp/**` over generic or older upstream guidance.
|
|
12
12
|
- When docs and runtime disagree, align the docs to the code that actually runs in this workspace.
|
|
13
|
+
- When `prisma/schema.prisma` changes, follow this order: run `npx prisma migrate dev`; if the change affects seed flow or `prisma/seed.ts`, run `npx prisma generate` and then `npx prisma db seed`; then run `npx ppy generate` so the Python ORM stays aligned with the schema.
|
|
13
14
|
- Reuse the existing Python database layer in `src/lib/prisma/**`; do not create a second app-owned database abstraction unless the user explicitly asks for one.
|
|
15
|
+
- Treat `src/lib/prisma/__init__.py`, `src/lib/prisma/db.py`, `src/lib/prisma/models.py`, and `settings/prisma-schema.json` as generated outputs owned by `npx ppy generate`; do not create or hand-edit them manually.
|
|
14
16
|
- Keep auth policy in `src/lib/auth/auth_config.py` and keep auth bootstrap, middleware wiring, and provider registration in `main.py`.
|
|
15
17
|
- Use PulsePoint and `pp.rpc(...)` as the default frontend and client-to-server contract unless the user requests another stack.
|
|
16
18
|
- Treat `pp-component` on routes, layouts, and components, and `type="text/pp"` on owned PulsePoint scripts, as compiler-injected by the Python side; do not add them manually in authored templates unless the task is explicitly about runtime internals.
|
|
@@ -31,7 +33,7 @@
|
|
|
31
33
|
### `src/lib/**/*.py`
|
|
32
34
|
|
|
33
35
|
- Keep `src/lib/` for app-owned shared code, service wrappers, and reusable helpers.
|
|
34
|
-
- Reuse
|
|
36
|
+
- Reuse the generated `src/lib/prisma/` package for Python database access, but do not hand-edit files under `src/lib/prisma/`; regenerate them with `npx ppy generate` after schema changes.
|
|
35
37
|
- Keep auth policy in `src/lib/auth/auth_config.py`. Keep auth bootstrap and middleware order changes in `main.py`.
|
|
36
38
|
|
|
37
39
|
### `public/js/main.js`
|
|
@@ -59,8 +61,11 @@
|
|
|
59
61
|
|
|
60
62
|
- Treat `prisma/schema.prisma` as the data-model source of truth.
|
|
61
63
|
- Treat `prisma.config.ts` as the datasource and migration or seed configuration source of truth.
|
|
64
|
+
- After changing `prisma/schema.prisma`, run `npx prisma migrate dev` first so migrations and the development database stay aligned.
|
|
65
|
+
- If the schema change affects seed data or `prisma/seed.ts`, run `npx prisma generate` and then `npx prisma db seed`.
|
|
66
|
+
- Run `npx ppy generate` after every schema change so the Python ORM files and `settings/prisma-schema.json` stay aligned with Prisma.
|
|
62
67
|
- Keep Node-side generation and seeding aligned with `npx prisma generate` and `prisma/seed.ts`.
|
|
63
|
-
- Keep Python-side database access aligned with `src/lib/prisma
|
|
68
|
+
- Keep Python-side database access aligned with `src/lib/prisma/**`, and treat that directory as generated output rather than a manual editing surface.
|
|
64
69
|
|
|
65
70
|
### `.venv/Lib/site-packages/casp/**/*.py`
|
|
66
71
|
|
package/dist/AGENTS.md
CHANGED
|
@@ -40,7 +40,9 @@ Before making feature, tooling, or scaffolding decisions, read `caspian.config.j
|
|
|
40
40
|
- `main.py` applies auth settings with `configure_auth(build_auth_settings())` and registers `GithubProvider()` plus `GoogleProvider()`.
|
|
41
41
|
- This workspace already has an app-owned Python database layer in `src/lib/prisma/`.
|
|
42
42
|
- Reuse `src/lib/prisma/prisma`, `PrismaClient`, generated models, and helper types instead of creating a second Python database abstraction.
|
|
43
|
-
- Prisma schema source of truth is `prisma/schema.prisma
|
|
43
|
+
- Prisma schema source of truth is `prisma/schema.prisma`.
|
|
44
|
+
- The schema-change workflow in this workspace is: `npx prisma migrate dev`; if seed flow or `prisma/seed.ts` is involved, run `npx prisma generate` and then `npx prisma db seed`; then run `npx ppy generate`.
|
|
45
|
+
- `npx ppy generate` owns `src/lib/prisma/__init__.py`, `src/lib/prisma/db.py`, `src/lib/prisma/models.py`, and `settings/prisma-schema.json`; do not hand-edit those generated files.
|
|
44
46
|
- `caspian.config.json` is the first config file to check for enabled workspace features. In the current workspace it sets `backendOnly: false`, `tailwindcss: true`, `mcp: false`, `prisma: true`, `typescript: false`, and `componentScanDirs: ["src"]`.
|
|
45
47
|
- PulsePoint runtime code is shipped in `public/js/pp-reactive-v2.js` and loaded from `public/js/main.js`.
|
|
46
48
|
- `pp-component` is injected by the Python render pipeline onto page, layout, and component roots; authored route and component templates should not add it manually.
|
|
@@ -76,7 +78,8 @@ Use this map before making changes.
|
|
|
76
78
|
- Keep route-specific logic in `src/app/**`.
|
|
77
79
|
- Read `caspian.config.json` before deciding whether a Caspian feature should be used, documented, scaffolded, or avoided in the current workspace.
|
|
78
80
|
- Treat `.venv/Lib/site-packages/casp/**` as framework internals unless the task is explicitly about Caspian core behavior or installed-runtime documentation.
|
|
79
|
-
- When a task involves Python-side database access,
|
|
81
|
+
- When a task involves Python-side database access, reuse `src/lib/prisma/**` instead of introducing a parallel helper, but do not hand-edit generated files in that directory.
|
|
82
|
+
- When `prisma/schema.prisma` changes, run `npx prisma migrate dev` first. If seed flow or `prisma/seed.ts` is involved, run `npx prisma generate` and then `npx prisma db seed`. After that, run `npx ppy generate` so the Python ORM layer and `settings/prisma-schema.json` stay aligned.
|
|
80
83
|
- Keep auth policy in `src/lib/auth/auth_config.py`.
|
|
81
84
|
- Keep auth bootstrap, middleware ordering, provider wiring, and router behavior in `main.py`.
|
|
82
85
|
- Use PulsePoint and `pp.rpc(...)` as the default frontend and browser-to-server contract unless the user explicitly wants another stack.
|
|
@@ -92,7 +95,7 @@ Use this map before making changes.
|
|
|
92
95
|
|
|
93
96
|
The packaged docs in this workspace are already mostly aligned with the installed runtime, but keep these repo-specific clarifications in mind:
|
|
94
97
|
|
|
95
|
-
- `database.md`
|
|
98
|
+
- `database.md` is the source doc for the Prisma and Python ORM workflow in this repo: schema changes go through `npx prisma migrate dev`, optional `npx prisma generate` plus `npx prisma db seed`, then `npx ppy generate`, and generated ORM files under `src/lib/prisma/` plus `settings/prisma-schema.json` are not hand-edited.
|
|
96
99
|
- `state.md` is correct to warn that cross-request persistence depends on `request.state.session`, which is not bridged in the current `main.py`.
|
|
97
100
|
- `routing.md`, `components.md`, `auth.md`, `fetch-data.md`, `cache.md`, `pulsepoint.md`, and `validation.md` should continue to be validated against the installed `casp` package before any behavior claims are changed.
|
|
98
101
|
|