@adaptivestone/framework 5.0.0 → 5.0.1
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/CHANGELOG.md +42 -176
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,218 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [5.0.1] - 2026-06-20
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Widen the optional peer dependency range for `@adaptivestone/framework-module-email` to `^1.0.0 || ^2.0.0`. Email module v2 no longer bundles Pug — template engines are opt-in and registered by the consumer via `Mail.registerTemplateEngine` — so the framework now accepts both the v1 and v2 lines. The dependency remains optional; projects that don't send email are unaffected. See the [email module changelog](https://github.com/adaptivestone/framework-module-email/blob/main/CHANGELOG.md) for v2 migration notes.
|
|
7
12
|
|
|
8
13
|
## [5.0.0] - 2026-06-19
|
|
9
14
|
|
|
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.
|
|
15
|
+
First stable release of the **v5** series — a major rewrite. v5 is TypeScript-first and ESM-only, replaces Express's hidden router with a framework-owned tree-based router, makes validation validator-agnostic via [Standard Schema](https://standardschema.dev/), and hardens auth and boot.
|
|
14
16
|
|
|
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.
|
|
17
|
+
This section is an upgrade-oriented summary. The granular per-change notes (every `[NEW]` / `[FIX]` / `[BREAKING]`) live in the `5.0.0-rc.1` … `5.0.0-rc.9` entries below; nothing changed in behavior between rc.9 and this release.
|
|
18
18
|
|
|
19
19
|
### Highlights
|
|
20
20
|
|
|
21
|
-
- **Full TypeScript support, including Mongoose models.** New `BaseModel`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **
|
|
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`).
|
|
21
|
+
- **Full TypeScript support, including Mongoose models.** New `BaseModel` statics-based model type; per-controller route/handler type generation (`npm run gen` → `<File>.routes.gen.ts` + `genTypes.d.ts`) so handler signatures, `req.appInfo`, `params`, and `query` are typed from the real resolved middleware chain. Typed `getConfig` / `getModel`.
|
|
22
|
+
- **Tree-based router.** A framework-owned `RouteRegistry` replaces Express's internal router: structural specificity (static > param > splat), per-segment URL decoding, `405` + `Allow`, `400` on malformed paths, HEAD→GET fallback, and a boot-time route-tree log. Walkable by codegen / future emitters.
|
|
23
|
+
- **Standard Schema validation.** Yup ≥1.7, Zod, Valibot, and ArkType work out of the box; pluggable `ValidatorDriver` + `ValidateService.register()`; framework-owned `ValidationError` with structured `.issues`.
|
|
24
|
+
- **Security hardening.** Random, SHA-256-hashed session / recovery / verification tokens with enforced expiry; per-user-salt versioned scrypt password scheme; standard security headers on by default; account-enumeration oracles closed; credentials no longer written to logs.
|
|
25
|
+
- **Robust lifecycle.** Graceful shutdown on `SIGTERM`/`SIGINT` (drains in-flight requests, tears down mongo/redis/logger); fail-fast boot (Mongo and `AUTH_SALT` required); crash-loop protection for clustered workers.
|
|
26
|
+
- **Runtime.** ESM-only, Node ≥ 24, runs `.ts` sources natively with no build step. New helpers/models: `AppInstance`, `Lock`, `i18nService`, `IpDetector`, and test helpers (`getTestServerURL`, `serverInstance`).
|
|
43
27
|
|
|
44
28
|
### Breaking changes (v4 → v5)
|
|
45
29
|
|
|
46
|
-
Read the `5.0.0-rc.1` entry below for the full text and migration notes; the
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- **
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- **
|
|
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).
|
|
30
|
+
Read the `5.0.0-rc.1` entry below for the full text and migration notes; the condensed list:
|
|
31
|
+
|
|
32
|
+
- **Runtime & deps:** Node ≥ 24, ESM-only (no CommonJS); Express 5, Mongoose 9, Vitest 4, i18next 24, `@redis/client` v6 (RESP3 default). Jest support and `minimist` CLI parsing removed.
|
|
33
|
+
- **Validation:** Yup is now an **optional peer dependency** (validator-agnostic Standard Schema). Legacy `{validate, cast}` validators, internal driver classes, and Yup `req:` context in `.test()`/`.when()` removed; `ValidateService` surface trimmed; `relatedRequest/QueryParameters` default to `null`.
|
|
34
|
+
- **Routing:** path syntax narrowed to literals, `:name`, and `{*name}` splats — Express 5 optional params (`{:name}`) and inline regex are unsupported; replace bare `_` route params with `*splat`. Route-type codegen requires statically analyzable controllers. OpenAPI/documentation generation removed (returns later with per-vendor `toJsonSchema`).
|
|
35
|
+
- **Models & auth:** all models must extend `BaseModel`. `AUTH_SALT` is required (no default) and Mongo is required at boot. Default auth response changed to `{ data: { token, user } }`. On upgrade, **all existing sessions and recovery/verification links are invalidated** (token hardening); passwords migrate silently on next login. `POST /auth/send-recovery-email` and `/auth/send-verification` now return a uniform `200` (no account-existence oracle) — update any frontend that branched on the old `400`. `RateLimiter` now requires `IpDetector` earlier in the chain.
|
|
36
|
+
- **Removed / moved:** the email module moved to `@adaptivestone/framework-module-email`; `staticFiles` middleware, `VIEWS` folders, and `nodemailer-sendmail-transport` removed. The package `exports` map is scoped to the public surface — internal subpaths are no longer importable (see "Public API & stability" in the README).
|
|
74
37
|
|
|
75
38
|
## [5.0.0-rc.9] - 2026-06-15
|
|
76
39
|
|
|
77
|
-
- **[FIX]** Regression in rc.8: a model whose `modelSchema` reuses a pre-built
|
|
78
|
-
mongoose `Schema` instance as a (sub-)document definition (`field: SubSchema`
|
|
79
|
-
or `[SubSchema]` — a standard Mongoose pattern) failed to type-check at every
|
|
80
|
-
`findOne(...)` call site with `TS2615` ("circularly references itself in mapped
|
|
81
|
-
type"). The rc.8 marker-scan (`HasTsOverride`) recursed over `keyof Schema`,
|
|
82
|
-
and a `Schema` instance isn't a constructor, so it wasn't treated as a leaf —
|
|
83
|
-
the scan descended into the instance's self-referential internals
|
|
84
|
-
(`childSchemas`, `options`, `session`, …). `IsLeafFieldDef` now treats a
|
|
85
|
-
`Schema` instance as a leaf (it can carry no `__tsType` marker anyway), so the
|
|
86
|
-
scan stops there. Type-only; a `tsc`-gate fixture pins it.
|
|
40
|
+
- **[FIX]** Regression in rc.8: a model whose `modelSchema` reuses a pre-built mongoose `Schema` instance as a (sub-)document definition (`field: SubSchema` or `[SubSchema]` — a standard Mongoose pattern) failed to type-check at every `findOne(...)` call site with `TS2615` ("circularly references itself in mapped type"). The rc.8 marker-scan (`HasTsOverride`) recursed over `keyof Schema`, and a `Schema` instance isn't a constructor, so it wasn't treated as a leaf — the scan descended into the instance's self-referential internals (`childSchemas`, `options`, `session`, …). `IsLeafFieldDef` now treats a `Schema` instance as a leaf (it can carry no `__tsType` marker anyway), so the scan stops there. Type-only; a `tsc`-gate fixture pins it.
|
|
87
41
|
|
|
88
42
|
## [5.0.0-rc.8] - 2026-06-15
|
|
89
43
|
|
|
90
|
-
- **[FIX]** Instance methods are now callable on the hydrated document without
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
`(schema.methods.x as …).call(doc, …)` cast. The caller-facing projection now
|
|
98
|
-
strips the authored `this` (a method accessed on its own document always has
|
|
99
|
-
the right `this` at runtime), while method bodies stay type-checked against
|
|
100
|
-
their declared `this`. Purely a type change, no runtime impact; a `tsc`-gate
|
|
101
|
-
test pins it.
|
|
102
|
-
|
|
103
|
-
- **[FIX]** A virtual now resolves to its getter's return type on the document
|
|
104
|
-
(e.g. `doc.fullName` is `string`) instead of the leaked raw definition
|
|
105
|
-
(`string & { get(): string; options: … }`). The virtuals slot fed to
|
|
106
|
-
Mongoose's inner document type was the raw `{ get, set, options }` object; it
|
|
107
|
-
is now the resolved `VirtualType<…>`, matching the override slot. Type-only.
|
|
108
|
-
|
|
109
|
-
- **[FIX]** `createdAt` / `updatedAt` are now typed as a non-null `Date` on the
|
|
110
|
-
hydrated document instead of `Date | null | undefined`. Mongoose always sets
|
|
111
|
-
the timestamps, so the nullable type only forced a needless guard at every
|
|
112
|
-
read. Type-only change.
|
|
113
|
-
|
|
114
|
-
- **[FIX]** Cleaner `TsTypeOverride` typing (rc.7 feature). The override mapping
|
|
115
|
-
no longer recurses into built-in instances (`ObjectId` refs, `Date`, `Map`) —
|
|
116
|
-
they showed as `ApplyTsOverrides<ObjectId, …>` in hovers though the recursion
|
|
117
|
-
was a no-op — and a marker-free schema (the common case) now skips the mapping
|
|
118
|
-
entirely, so its document type is the plain Mongoose inference with no wrapper
|
|
119
|
-
in hovers and no extra compile work. Type-only; no change to which types
|
|
120
|
-
resolve, only how cleanly.
|
|
44
|
+
- **[FIX]** Instance methods are now callable on the hydrated document without `this`-binding casts. A method whose body needs a narrower shape can declare an explicit `this: <bridge>` (a populated ref, a non-null plugin-reshaped field, reassignable sibling methods); that bridge was carried verbatim onto the document type, so a direct `doc.method(...)` call failed the this-context check (`TS2684`) — the framework-computed hydrated doc is deliberately not assignable to the narrower bridge — and every call site needed a `(schema.methods.x as …).call(doc, …)` cast. The caller-facing projection now strips the authored `this` (a method accessed on its own document always has the right `this` at runtime), while method bodies stay type-checked against their declared `this`. Purely a type change, no runtime impact; a `tsc`-gate test pins it.
|
|
45
|
+
|
|
46
|
+
- **[FIX]** A virtual now resolves to its getter's return type on the document (e.g. `doc.fullName` is `string`) instead of the leaked raw definition (`string & { get(): string; options: … }`). The virtuals slot fed to Mongoose's inner document type was the raw `{ get, set, options }` object; it is now the resolved `VirtualType<…>`, matching the override slot. Type-only.
|
|
47
|
+
|
|
48
|
+
- **[FIX]** `createdAt` / `updatedAt` are now typed as a non-null `Date` on the hydrated document instead of `Date | null | undefined`. Mongoose always sets the timestamps, so the nullable type only forced a needless guard at every read. Type-only change.
|
|
49
|
+
|
|
50
|
+
- **[FIX]** Cleaner `TsTypeOverride` typing (rc.7 feature). The override mapping no longer recurses into built-in instances (`ObjectId` refs, `Date`, `Map`) — they showed as `ApplyTsOverrides<ObjectId, …>` in hovers though the recursion was a no-op — and a marker-free schema (the common case) now skips the mapping entirely, so its document type is the plain Mongoose inference with no wrapper in hovers and no extra compile work. Type-only; no change to which types resolve, only how cleanly.
|
|
121
51
|
|
|
122
52
|
## [5.0.0-rc.7] - 2026-06-15
|
|
123
53
|
|
|
124
|
-
- **[NEW]** Per-field compile-time type overrides for plugin-reshaped fields. A
|
|
125
|
-
schema field intersected with the new `TsTypeOverride<T>` marker is typed as
|
|
126
|
-
`T` on `getModel(...).findOne()` results and method `this`, instead of the type
|
|
127
|
-
Mongoose infers from `type:` — so a field a runtime plugin reshapes
|
|
128
|
-
(`mongoose-intl`, encrypted fields, custom getters) keeps its static and
|
|
129
|
-
runtime types in sync, removing the casts that previously bridged the gap. The
|
|
130
|
-
marker is a phantom (`__tsType`, never set at runtime); applied by a deep
|
|
131
|
-
mapped type (`ApplyTsOverrides`) that recurses into nested objects and
|
|
132
|
-
subdocument arrays. Opt-in and a strict **no-op** for any field without the
|
|
133
|
-
marker, so existing models are unchanged.
|
|
54
|
+
- **[NEW]** Per-field compile-time type overrides for plugin-reshaped fields. A schema field intersected with the new `TsTypeOverride<T>` marker is typed as `T` on `getModel(...).findOne()` results and method `this`, instead of the type Mongoose infers from `type:` — so a field a runtime plugin reshapes (`mongoose-intl`, encrypted fields, custom getters) keeps its static and runtime types in sync, removing the casts that previously bridged the gap. The marker is a phantom (`__tsType`, never set at runtime); applied by a deep mapped type (`ApplyTsOverrides`) that recurses into nested objects and subdocument arrays. Opt-in and a strict **no-op** for any field without the marker, so existing models are unchanged.
|
|
134
55
|
|
|
135
56
|
## [5.0.0-rc.6] - 2026-06-14
|
|
136
57
|
|
|
137
|
-
- **[FIX]** The `User` auth helpers are now reusable on a **customized** `User`
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
methods (`generateToken`, `getPublic`, `send{Verification,PasswordRecovery}Email`)
|
|
141
|
-
were typed against the framework's own schema (`this: UserModelLite`), so on a
|
|
142
|
-
project model with a different shape every call site hit `TS2684` and needed a
|
|
143
|
-
cast. They're now typed against small structural contracts (`UserAuthDoc` /
|
|
144
|
-
`UserAuthInstance` / `UserAuthModel`, all newly exported) describing only the
|
|
145
|
-
fields each helper touches — the framework's `User` and a project's replacement
|
|
146
|
-
both satisfy them, and return types stay precise. This makes the supported
|
|
147
|
-
customization paths cast-free: `extends User` to **add** fields, or compose
|
|
148
|
-
(`extends BaseModel` + spread `User.modelStatics` / `modelInstanceMethods`) to
|
|
149
|
-
**reshape** them (an i18n `name`, a singular `role`, …) — a field-type
|
|
150
|
-
*replacement* can't go through `extends` (static-getter covariance, `TS2417`).
|
|
151
|
-
Both paths are documented on the `User` class. A `tsc`-gate test pins them.
|
|
152
|
-
|
|
153
|
-
- **[FIX]** Config-type codegen no longer drops env-only keys. A config value
|
|
154
|
-
read straight from the environment with no default (`saltSecret:
|
|
155
|
-
process.env.AUTH_SALT`) is `undefined` at gen time, so the value-based pass
|
|
156
|
-
omitted it from `getConfig('…')`'s type and every read needed an `as` cast.
|
|
157
|
-
Codegen now reads the config **source** (via `oxc-parser`, no value import) and
|
|
158
|
-
types a bare `process.env.X` as `string | undefined` (and `process.env.X!` as
|
|
159
|
-
`string`) — from the source, so the result is the same whether or not the var
|
|
160
|
-
happened to be set during codegen (deterministic output, no `--check` drift).
|
|
161
|
-
Keys without an env read (literals, `process.env.X || default`) are still typed
|
|
162
|
-
from their value as before. Secrets are never serialized (types only). Nested
|
|
163
|
-
keys and `NODE_ENV`-specific config files are handled.
|
|
58
|
+
- **[FIX]** The `User` auth helpers are now reusable on a **customized** `User` model without `this`-binding casts. The statics (`getUserByEmailAndPassword`, `getUserBy{Token,Email,VerificationToken,PasswordRecoveryToken}`) and instance methods (`generateToken`, `getPublic`, `send{Verification,PasswordRecovery}Email`) were typed against the framework's own schema (`this: UserModelLite`), so on a project model with a different shape every call site hit `TS2684` and needed a cast. They're now typed against small structural contracts (`UserAuthDoc` / `UserAuthInstance` / `UserAuthModel`, all newly exported) describing only the fields each helper touches — the framework's `User` and a project's replacement both satisfy them, and return types stay precise. This makes the supported customization paths cast-free: `extends User` to **add** fields, or compose (`extends BaseModel` + spread `User.modelStatics` / `modelInstanceMethods`) to **reshape** them (an i18n `name`, a singular `role`, …) — a field-type *replacement* can't go through `extends` (static-getter covariance, `TS2417`). Both paths are documented on the `User` class. A `tsc`-gate test pins them.
|
|
59
|
+
|
|
60
|
+
- **[FIX]** Config-type codegen no longer drops env-only keys. A config value read straight from the environment with no default (`saltSecret: process.env.AUTH_SALT`) is `undefined` at gen time, so the value-based pass omitted it from `getConfig('…')`'s type and every read needed an `as` cast. Codegen now reads the config **source** (via `oxc-parser`, no value import) and types a bare `process.env.X` as `string | undefined` (and `process.env.X!` as `string`) — from the source, so the result is the same whether or not the var happened to be set during codegen (deterministic output, no `--check` drift). Keys without an env read (literals, `process.env.X || default`) are still typed from their value as before. Secrets are never serialized (types only). Nested keys and `NODE_ENV`-specific config files are handled.
|
|
164
61
|
|
|
165
62
|
## [5.0.0-rc.5] - 2026-06-14
|
|
166
63
|
|
|
167
|
-
- **[FIX]** Route-type codegen extends the rc.4 untyped-`.js` degradation to
|
|
168
|
-
middleware in the `appInfo` provides chain. A controller guarded by an untyped
|
|
169
|
-
`.js` middleware (no sibling `.d.ts`) produced a gen file that did `import type
|
|
170
|
-
Mw from './Mw.js'` to build its `UnionAppInfoProvides<…>` chain — a `TS7016` in
|
|
171
|
-
a strict consumer build with no `allowJs`. Such a middleware is now dropped
|
|
172
|
-
from both the import and the chain (it contributes nothing to `appInfo`)
|
|
173
|
-
instead of breaking the typecheck. Typed middleware — `.ts`, `.js` with a
|
|
174
|
-
sibling `.d.ts`, or the framework's own (bare specifiers ship declarations) —
|
|
175
|
-
keep their precise `appInfo` contributions. Same incremental `.js` → `.ts`
|
|
176
|
-
migration goal as rc.4, now covering middleware as well as controllers.
|
|
64
|
+
- **[FIX]** Route-type codegen extends the rc.4 untyped-`.js` degradation to middleware in the `appInfo` provides chain. A controller guarded by an untyped `.js` middleware (no sibling `.d.ts`) produced a gen file that did `import type Mw from './Mw.js'` to build its `UnionAppInfoProvides<…>` chain — a `TS7016` in a strict consumer build with no `allowJs`. Such a middleware is now dropped from both the import and the chain (it contributes nothing to `appInfo`) instead of breaking the typecheck. Typed middleware — `.ts`, `.js` with a sibling `.d.ts`, or the framework's own (bare specifiers ship declarations) — keep their precise `appInfo` contributions. Same incremental `.js` → `.ts` migration goal as rc.4, now covering middleware as well as controllers.
|
|
177
65
|
|
|
178
66
|
## [5.0.0-rc.4] - 2026-06-14
|
|
179
67
|
|
|
180
|
-
- **[FIX]** Route-type codegen no longer emits an untyped self-import for `.js`
|
|
181
|
-
controllers. A schema-bearing controller still written in JavaScript with no
|
|
182
|
-
sibling `.d.ts` produced a gen file that did `import type Ctrl from
|
|
183
|
-
'./Ctrl.js'`, which fails with `TS7016` ("could not find a declaration file")
|
|
184
|
-
in a `strict` consumer build without `allowJs` — turning `rc.3`'s
|
|
185
|
-
now-succeeding `npm run gen` into a red typecheck. Such controllers now degrade
|
|
186
|
-
gracefully: the gen file skips the self-import and their inline request/query
|
|
187
|
-
schemas fall back to the base `Record<string, unknown>`. `.ts` controllers (and
|
|
188
|
-
`.js` with a sibling `.d.ts`) keep precise `InferOutput` types. Unblocks
|
|
189
|
-
incremental `.js` → `.ts` migration.
|
|
68
|
+
- **[FIX]** Route-type codegen no longer emits an untyped self-import for `.js` controllers. A schema-bearing controller still written in JavaScript with no sibling `.d.ts` produced a gen file that did `import type Ctrl from './Ctrl.js'`, which fails with `TS7016` ("could not find a declaration file") in a `strict` consumer build without `allowJs` — turning `rc.3`'s now-succeeding `npm run gen` into a red typecheck. Such controllers now degrade gracefully: the gen file skips the self-import and their inline request/query schemas fall back to the base `Record<string, unknown>`. `.ts` controllers (and `.js` with a sibling `.d.ts`) keep precise `InferOutput` types. Unblocks incremental `.js` → `.ts` migration.
|
|
190
69
|
|
|
191
70
|
## [5.0.0-rc.3] - 2026-06-13
|
|
192
71
|
|
|
193
|
-
- **[CHANGE]** Route-type codegen now skips controllers it can't statically
|
|
194
|
-
analyze instead of aborting the whole run. A controller whose `routes` /
|
|
195
|
-
`middleware` / `getHttpPath` uses a loop, conditional, computed value, or
|
|
196
|
-
`super` (e.g. one that extends another controller and merges `super.routes`) is
|
|
197
|
-
skipped with a warning; types are still generated for every other controller,
|
|
198
|
-
and the skipped one works at runtime (only its generated request types are
|
|
199
|
-
omitted). Previously a single such controller failed `npm run gen` for the
|
|
200
|
-
entire project.
|
|
72
|
+
- **[CHANGE]** Route-type codegen now skips controllers it can't statically analyze instead of aborting the whole run. A controller whose `routes` / `middleware` / `getHttpPath` uses a loop, conditional, computed value, or `super` (e.g. one that extends another controller and merges `super.routes`) is skipped with a warning; types are still generated for every other controller, and the skipped one works at runtime (only its generated request types are omitted). Previously a single such controller failed `npm run gen` for the entire project.
|
|
201
73
|
|
|
202
74
|
## [5.0.0-rc.2] - 2026-06-13
|
|
203
75
|
|
|
204
76
|
Patch over `rc.1`, fixing a regression for consumers that extend the framework.
|
|
205
77
|
|
|
206
|
-
- **[FIX]** Restored `./config/*` to the package `exports` map (it was dropped in
|
|
207
|
-
`rc.1`). Extending a framework default config — `import http from
|
|
208
|
-
'@adaptivestone/framework/config/http.js'`, then re-exporting an edited copy
|
|
209
|
-
from your own `src/config/http.ts` — threw `ERR_PACKAGE_PATH_NOT_EXPORTED` and
|
|
210
|
-
broke app boot. `config/*` is the intended Tier-2 extension surface and is
|
|
211
|
-
importable again.
|
|
78
|
+
- **[FIX]** Restored `./config/*` to the package `exports` map (it was dropped in `rc.1`). Extending a framework default config — `import http from '@adaptivestone/framework/config/http.js'`, then re-exporting an edited copy from your own `src/config/http.ts` — threw `ERR_PACKAGE_PATH_NOT_EXPORTED` and broke app boot. `config/*` is the intended Tier-2 extension surface and is importable again.
|
|
212
79
|
|
|
213
80
|
## [5.0.0-rc.1] - 2026-06-13
|
|
214
81
|
|
|
215
|
-
This is a big release that contains a lot of new features and breaking changes.
|
|
216
|
-
Main feature of that release is full TypeScript support including mongoose models.
|
|
82
|
+
This is a big release that contains a lot of new features and breaking changes. Main feature of that release is full TypeScript support including mongoose models.
|
|
217
83
|
|
|
218
84
|
### New Features
|
|
219
85
|
|
|
@@ -230,7 +96,7 @@ Main feature of that release is full TypeScript support including mongoose model
|
|
|
230
96
|
- **[NEW]** `IpDetector` middleware for detecting proxies and `X-Forwarded-For` headers.
|
|
231
97
|
- **[NEW]** Test helpers getTestServerURL and serverInstance.
|
|
232
98
|
- **[NEW]** Rate limiter middleware - add consumeResult function to allow user middleware as a regular rate limiter
|
|
233
|
-
- **[NEW]** Ip detector middleware - add getIpAdressFromIncomingMessage function to allow user middleware as a detector of id adresses without middleware
|
|
99
|
+
- **[NEW]** Ip detector middleware - add getIpAdressFromIncomingMessage function to allow user middleware as a detector of id adresses without middleware
|
|
234
100
|
- **[NEW]** Introduce i18nService (ability to user i18n not only inside middleware)
|
|
235
101
|
- **[NEW]** [Standard Schema](https://standardschema.dev/) validation. Yup ≥1.7, Zod, Valibot, ArkType supported.
|
|
236
102
|
- **[NEW]** Pluggable `ValidatorDriver` + `ValidateService.register(driver)` for custom validators.
|
|
@@ -515,7 +381,7 @@ Main feature of that release is full TypeScript support including mongoose model
|
|
|
515
381
|
|
|
516
382
|
## [5.0.0-beta.32] - 2025-08-21
|
|
517
383
|
|
|
518
|
-
- **[NEW]** Ip detector middleware - add getIpAdressFromIncomingMessage function to allow user middleware as a detector of id adresses without middleware
|
|
384
|
+
- **[NEW]** Ip detector middleware - add getIpAdressFromIncomingMessage function to allow user middleware as a detector of id adresses without middleware
|
|
519
385
|
|
|
520
386
|
---
|
|
521
387
|
|
|
@@ -541,7 +407,7 @@ Main feature of that release is full TypeScript support including mongoose model
|
|
|
541
407
|
|
|
542
408
|
## [5.0.0-beta.28] - 2025-07-29
|
|
543
409
|
|
|
544
|
-
- **[UPDATE]** Inside CLI allow to have a negative values
|
|
410
|
+
- **[UPDATE]** Inside CLI allow to have a negative values
|
|
545
411
|
- **[UPDATE]** Update deps.
|
|
546
412
|
|
|
547
413
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptivestone/framework",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Adaptive stone node js framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"i18next": "^26.0.1",
|
|
64
64
|
"i18next-fs-backend": "^2.0.0",
|
|
65
65
|
"mongoose": "^9.0.0",
|
|
66
|
-
"oxc-parser": "^0.
|
|
66
|
+
"oxc-parser": "^0.137.0",
|
|
67
67
|
"rate-limiter-flexible": "^11.0.0",
|
|
68
68
|
"winston": "^3.3.3",
|
|
69
69
|
"winston-transport": "^4.9.0"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@sentry/node": "^10.34.0",
|
|
75
75
|
"@types/express": "^5.0.1",
|
|
76
76
|
"@types/formidable": "^3.4.5",
|
|
77
|
-
"@types/node": "^
|
|
77
|
+
"@types/node": "^26.0.0",
|
|
78
78
|
"@typescript/native-preview": "^7.0.0-dev.20260604.1",
|
|
79
79
|
"@vitest/coverage-v8": "^4.0.0",
|
|
80
80
|
"lefthook": "^2.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"zod": "^4.0.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@adaptivestone/framework-module-email": "^1.0.0",
|
|
88
|
+
"@adaptivestone/framework-module-email": "^1.0.0 || ^2.0.0",
|
|
89
89
|
"@sentry/core": "^10.34.0",
|
|
90
90
|
"@sentry/node": "^10.34.0",
|
|
91
91
|
"mongodb-memory-server": "^11.0.0",
|