@adaptivestone/framework 5.0.0-rc.9 → 5.0.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,73 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.0.0] - 2026-06-19
9
+
10
+ First stable release of the **v5** series — a major rewrite. v5 is
11
+ TypeScript-first and ESM-only, replaces Express's hidden router with a
12
+ framework-owned tree-based router, makes validation validator-agnostic via
13
+ [Standard Schema](https://standardschema.dev/), and hardens auth and boot.
14
+
15
+ This section is an upgrade-oriented summary. The granular per-change notes
16
+ (every `[NEW]` / `[FIX]` / `[BREAKING]`) live in the `5.0.0-rc.1` … `5.0.0-rc.9`
17
+ entries below; nothing changed in behavior between rc.9 and this release.
18
+
19
+ ### Highlights
20
+
21
+ - **Full TypeScript support, including Mongoose models.** New `BaseModel`
22
+ statics-based model type; per-controller route/handler type generation
23
+ (`npm run gen` → `<File>.routes.gen.ts` + `genTypes.d.ts`) so handler
24
+ signatures, `req.appInfo`, `params`, and `query` are typed from the real
25
+ resolved middleware chain. Typed `getConfig` / `getModel`.
26
+ - **Tree-based router.** A framework-owned `RouteRegistry` replaces Express's
27
+ internal router: structural specificity (static > param > splat), per-segment
28
+ URL decoding, `405` + `Allow`, `400` on malformed paths, HEAD→GET fallback,
29
+ and a boot-time route-tree log. Walkable by codegen / future emitters.
30
+ - **Standard Schema validation.** Yup ≥1.7, Zod, Valibot, and ArkType work out
31
+ of the box; pluggable `ValidatorDriver` + `ValidateService.register()`;
32
+ framework-owned `ValidationError` with structured `.issues`.
33
+ - **Security hardening.** Random, SHA-256-hashed session / recovery /
34
+ verification tokens with enforced expiry; per-user-salt versioned scrypt
35
+ password scheme; standard security headers on by default; account-enumeration
36
+ oracles closed; credentials no longer written to logs.
37
+ - **Robust lifecycle.** Graceful shutdown on `SIGTERM`/`SIGINT` (drains
38
+ in-flight requests, tears down mongo/redis/logger); fail-fast boot (Mongo and
39
+ `AUTH_SALT` required); crash-loop protection for clustered workers.
40
+ - **Runtime.** ESM-only, Node ≥ 24, runs `.ts` sources natively with no build
41
+ step. New helpers/models: `AppInstance`, `Lock`, `i18nService`, `IpDetector`,
42
+ and test helpers (`getTestServerURL`, `serverInstance`).
43
+
44
+ ### Breaking changes (v4 → v5)
45
+
46
+ Read the `5.0.0-rc.1` entry below for the full text and migration notes; the
47
+ condensed list:
48
+
49
+ - **Runtime & deps:** Node ≥ 24, ESM-only (no CommonJS); Express 5, Mongoose 9,
50
+ Vitest 4, i18next 24, `@redis/client` v6 (RESP3 default). Jest support and
51
+ `minimist` CLI parsing removed.
52
+ - **Validation:** Yup is now an **optional peer dependency** (validator-agnostic
53
+ Standard Schema). Legacy `{validate, cast}` validators, internal driver
54
+ classes, and Yup `req:` context in `.test()`/`.when()` removed; `ValidateService`
55
+ surface trimmed; `relatedRequest/QueryParameters` default to `null`.
56
+ - **Routing:** path syntax narrowed to literals, `:name`, and `{*name}` splats —
57
+ Express 5 optional params (`{:name}`) and inline regex are unsupported; replace
58
+ bare `_` route params with `*splat`. Route-type codegen requires statically
59
+ analyzable controllers. OpenAPI/documentation generation removed (returns later
60
+ with per-vendor `toJsonSchema`).
61
+ - **Models & auth:** all models must extend `BaseModel`. `AUTH_SALT` is required
62
+ (no default) and Mongo is required at boot. Default auth response changed to
63
+ `{ data: { token, user } }`. On upgrade, **all existing sessions and
64
+ recovery/verification links are invalidated** (token hardening); passwords
65
+ migrate silently on next login. `POST /auth/send-recovery-email` and
66
+ `/auth/send-verification` now return a uniform `200` (no account-existence
67
+ oracle) — update any frontend that branched on the old `400`. `RateLimiter`
68
+ now requires `IpDetector` earlier in the chain.
69
+ - **Removed / moved:** the email module moved to
70
+ `@adaptivestone/framework-module-email`; `staticFiles` middleware, `VIEWS`
71
+ folders, and `nodemailer-sendmail-transport` removed. The package `exports` map
72
+ is scoped to the public surface — internal subpaths are no longer importable
73
+ (see "Public API & stability" in the README).
74
+
8
75
  ## [5.0.0-rc.9] - 2026-06-15
9
76
 
10
77
  - **[FIX]** Regression in rc.8: a model whose `modelSchema` reuses a pre-built
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptivestone/framework",
3
- "version": "5.0.0-rc.9",
3
+ "version": "5.0.0",
4
4
  "description": "Adaptive stone node js framework",
5
5
  "type": "module",
6
6
  "engines": {