@spfn/core 0.3.0-beta.21 → 0.3.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.
- package/README.md +1 -1
- package/dist/authz/index.js +46 -10
- package/dist/authz/index.js.map +1 -1
- package/dist/errors/index.d.ts +18 -1
- package/dist/errors/index.js +46 -10
- package/dist/errors/index.js.map +1 -1
- package/dist/middleware/index.js +46 -10
- package/dist/middleware/index.js.map +1 -1
- package/package.json +3 -3
- package/src/errors/README.md +16 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spfn/core",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.23",
|
|
4
4
|
"description": "Full-stack TypeScript backend for Next.js: file-based typed routes, Drizzle entities and repositories, PostgreSQL transactions and a generated end-to-end client, in one fixed vertical slice per feature",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -230,13 +230,13 @@
|
|
|
230
230
|
"drizzle-kit": "1.0.0-rc.4",
|
|
231
231
|
"drizzle-orm": "1.0.0-rc.4",
|
|
232
232
|
"madge": "^8.0.0",
|
|
233
|
-
"next": "^16.3.
|
|
233
|
+
"next": "^16.3.8",
|
|
234
234
|
"tsup": "^8.5.0",
|
|
235
235
|
"vitest": "^4.0.6"
|
|
236
236
|
},
|
|
237
237
|
"peerDependencies": {
|
|
238
238
|
"drizzle-orm": ">=1.0.0-rc.4 <2",
|
|
239
|
-
"next": "^16.3.
|
|
239
|
+
"next": "^16.3.8"
|
|
240
240
|
},
|
|
241
241
|
"peerDependenciesMeta": {
|
|
242
242
|
"next": {
|
package/src/errors/README.md
CHANGED
|
@@ -276,6 +276,22 @@ const maybe = registry.tryDeserialize(body); // null if __type missing/unknown (
|
|
|
276
276
|
`getRegisteredTypes()`. Constructor accepts an array mixing single classes, arrays of
|
|
277
277
|
classes, and other `ErrorRegistry` instances (`ErrorRegistryInput[]`).
|
|
278
278
|
|
|
279
|
+
### Minified browser bundles
|
|
280
|
+
|
|
281
|
+
A production browser bundle renames classes — `PaymentFailedError` becomes `Q` — but keeps the
|
|
282
|
+
string a constructor assigns to `this.name`. The server is not minified, so `__type` still
|
|
283
|
+
carries the original class name. `append()` therefore keys each class by its constructor name
|
|
284
|
+
and also by the `name` its instances set for themselves, read once by building the class with
|
|
285
|
+
`{}`. A lookup tries the constructor name first, so an unminified registry resolves exactly as
|
|
286
|
+
it always has.
|
|
287
|
+
|
|
288
|
+
For a class to be restored in a minified browser:
|
|
289
|
+
|
|
290
|
+
- **Set `this.name` to the class name in the constructor.** A class that leaves it unset only
|
|
291
|
+
inherits its parent's name, and is not keyed under it — that key belongs to the parent.
|
|
292
|
+
- **Let the constructor build with `{}`.** One that throws without its fields is keyed by its
|
|
293
|
+
constructor name only.
|
|
294
|
+
|
|
279
295
|
---
|
|
280
296
|
|
|
281
297
|
## Custom errors
|