@palbase/backend 25.0.4 → 25.1.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/dist/bin/palbase-backend.cjs +260 -12
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +1 -1
- package/dist/{chunk-AILPKEK5.js → chunk-VDF2T4AS.js} +261 -13
- package/dist/chunk-VDF2T4AS.js.map +1 -0
- package/dist/engine/index.cjs +260 -12
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.js +1 -1
- package/docs/README.md +4 -3
- package/docs/llms-full.txt +4 -3
- package/package.json +1 -1
- package/template/AGENTS.md +3 -1
- package/template/controllers/notes.controller.ts +2 -2
- package/template/services/note.service.ts +5 -3
- package/dist/chunk-AILPKEK5.js.map +0 -1
package/dist/engine/index.js
CHANGED
package/docs/README.md
CHANGED
|
@@ -133,8 +133,9 @@ export class TodoService {
|
|
|
133
133
|
|
|
134
134
|
/** The wired instance. Controllers import THIS, never the class. It is also the
|
|
135
135
|
* ONLY supported way to hold a dependency: a controller, job, hook or webhook is
|
|
136
|
-
* constructed with no arguments, and one that declares a constructor parameter
|
|
137
|
-
*
|
|
136
|
+
* constructed with no arguments, and one that declares a constructor parameter is
|
|
137
|
+
* refused with the class named — at decoration time for jobs/hooks/webhooks, and
|
|
138
|
+
* when the route table is built at boot for a controller. */
|
|
138
139
|
export const todoService = new TodoService(Database.tables.todos);
|
|
139
140
|
```
|
|
140
141
|
|
|
@@ -150,7 +151,7 @@ import { CreateTodoBody } from "../models/todos/create.js";
|
|
|
150
151
|
export default class TodosController {
|
|
151
152
|
// The service arrives as an IMPORTED SINGLETON, not a constructor parameter:
|
|
152
153
|
// the runtime constructs this class with no arguments, and one that declares a
|
|
153
|
-
// parameter is refused at
|
|
154
|
+
// parameter is refused when the route table is built at boot, with the class named.
|
|
154
155
|
|
|
155
156
|
@Get("") // GET /todos → operationId todos.list
|
|
156
157
|
async list(@User() user: UserT): Promise<TodoSchema[]> { // return type → 200 response schema
|
package/docs/llms-full.txt
CHANGED
|
@@ -141,8 +141,9 @@ export class TodoService {
|
|
|
141
141
|
|
|
142
142
|
/** The wired instance. Controllers import THIS, never the class. It is also the
|
|
143
143
|
* ONLY supported way to hold a dependency: a controller, job, hook or webhook is
|
|
144
|
-
* constructed with no arguments, and one that declares a constructor parameter
|
|
145
|
-
*
|
|
144
|
+
* constructed with no arguments, and one that declares a constructor parameter is
|
|
145
|
+
* refused with the class named — at decoration time for jobs/hooks/webhooks, and
|
|
146
|
+
* when the route table is built at boot for a controller. */
|
|
146
147
|
export const todoService = new TodoService(Database.tables.todos);
|
|
147
148
|
```
|
|
148
149
|
|
|
@@ -158,7 +159,7 @@ import { CreateTodoBody } from "../models/todos/create.js";
|
|
|
158
159
|
export default class TodosController {
|
|
159
160
|
// The service arrives as an IMPORTED SINGLETON, not a constructor parameter:
|
|
160
161
|
// the runtime constructs this class with no arguments, and one that declares a
|
|
161
|
-
// parameter is refused at
|
|
162
|
+
// parameter is refused when the route table is built at boot, with the class named.
|
|
162
163
|
|
|
163
164
|
@Get("") // GET /todos → operationId todos.list
|
|
164
165
|
async list(@User() user: UserT): Promise<TodoSchema[]> { // return type → 200 response schema
|
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -58,7 +58,9 @@ wrong in this runtime:
|
|
|
58
58
|
- **A DI container, or injection via decorators** — the only supported way to hold
|
|
59
59
|
a dependency is a module-level singleton. A controller, job, hook or webhook is
|
|
60
60
|
constructed with **no arguments**; one that declares a constructor parameter is
|
|
61
|
-
refused
|
|
61
|
+
refused with the class named — at decoration time for `jobs/`, `hooks/` and
|
|
62
|
+
`webhooks/`, and when the route table is built at boot for a controller. The
|
|
63
|
+
release never serves either way.
|
|
62
64
|
- **`middleware/`** — nothing mounts it and the engine has no middleware pipeline.
|
|
63
65
|
Code written against it deploys, never runs, and nothing reports it. Put
|
|
64
66
|
cross-cutting work in a service; use route options for auth and rate limits.
|
|
@@ -18,8 +18,8 @@ import { noteService } from "../services/note.service";
|
|
|
18
18
|
//
|
|
19
19
|
// The dependency is a MODULE-LEVEL SINGLETON, imported. It is not a constructor
|
|
20
20
|
// parameter: the runtime constructs this class with no arguments, and a
|
|
21
|
-
// controller that declares one is refused
|
|
22
|
-
// than handed `undefined` in production.
|
|
21
|
+
// controller that declares one is refused when the route table is built at boot,
|
|
22
|
+
// with the class named — rather than handed `undefined` in production.
|
|
23
23
|
|
|
24
24
|
// The schemas are in `models/notes/create.ts`. A controller with one endpoint
|
|
25
25
|
// can keep them beside the routes; the moment there are two, they go to
|
|
@@ -16,9 +16,11 @@ import type { Tables } from "@palbase/backend/env";
|
|
|
16
16
|
// is what a controller imports. That module-level singleton is also the
|
|
17
17
|
// supported way to hold a dependency ANYWHERE in this runtime: a controller,
|
|
18
18
|
// hook, job or webhook is constructed with no arguments, and one that declares
|
|
19
|
-
// a constructor parameter is
|
|
20
|
-
//
|
|
21
|
-
// production.
|
|
19
|
+
// a constructor parameter is REFUSED, with the class named — there is no
|
|
20
|
+
// injector to fill it, so the field would otherwise be `undefined` in
|
|
21
|
+
// production. The refusal fires at decoration time for a job, hook or webhook,
|
|
22
|
+
// and when the route table is built at boot for a controller; either way the
|
|
23
|
+
// release never serves.
|
|
22
24
|
//
|
|
23
25
|
// `Database.tables.notes` is typed from `db/public.ts` through the generated
|
|
24
26
|
// `palbase-env.d.ts`, which `palbase build` writes. Before the first build that
|