@adaptivestone/framework 5.1.2 → 5.1.4
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 +66 -1
- package/dist/Cli.js +4 -4
- package/dist/Cli.js.map +1 -1
- package/dist/cluster.d.ts +3 -1
- package/dist/cluster.js +8 -64
- package/dist/cluster.js.map +1 -1
- package/dist/clusterRunner.d.ts +16 -0
- package/dist/clusterRunner.js +180 -0
- package/dist/clusterRunner.js.map +1 -0
- package/dist/codegen/appTypes.js +7 -6
- package/dist/codegen/appTypes.js.map +1 -1
- package/dist/codegen/astEmit.js +15 -8
- package/dist/codegen/astEmit.js.map +1 -1
- package/dist/codegen/astExtract.js +33 -24
- package/dist/codegen/astExtract.js.map +1 -1
- package/dist/codegen/astModel.js +2 -2
- package/dist/codegen/astResolve.js +3 -3
- package/dist/codegen/astSpec.js +2 -2
- package/dist/codegen/collectMetadata.d.ts +12 -0
- package/dist/codegen/emit.d.ts +10 -3
- package/dist/codegen/emit.js +50 -6
- package/dist/codegen/emit.js.map +1 -1
- package/dist/codegen/index.js +2 -2
- package/dist/codegen/index.js.map +1 -1
- package/dist/commands/CreateUser.d.ts +10 -10
- package/dist/commands/CreateUser.js +1 -1
- package/dist/commands/DropIndex.d.ts +1 -1
- package/dist/commands/DropIndex.js +1 -1
- package/dist/commands/GenerateRandomBytes.js +1 -1
- package/dist/commands/GenerateRandomBytes.js.map +1 -1
- package/dist/commands/GenerateTypes.d.ts +1 -1
- package/dist/commands/GenerateTypes.js +5 -5
- package/dist/commands/GenerateTypes.js.map +1 -1
- package/dist/commands/OpenApi.d.ts +1 -1
- package/dist/commands/OpenApi.js +4 -4
- package/dist/commands/OpenApi.js.map +1 -1
- package/dist/commands/Routes.js +4 -4
- package/dist/commands/Routes.js.map +1 -1
- package/dist/commands/SyncIndexes.js +1 -1
- package/dist/commands/SyncIndexes.js.map +1 -1
- package/dist/commands/migration/Create.d.ts +1 -1
- package/dist/commands/migration/Create.js +1 -1
- package/dist/commands/migration/Migrate.js +25 -3
- package/dist/commands/migration/Migrate.js.map +1 -1
- package/dist/config/cache.d.ts +1 -1
- package/dist/config/log.js +1 -1
- package/dist/controllers/Auth.js +54 -15
- package/dist/controllers/Auth.js.map +1 -1
- package/dist/controllers/Home.js +1 -1
- package/dist/controllers/index.d.ts +13 -1
- package/dist/controllers/index.js +64 -48
- package/dist/controllers/index.js.map +1 -1
- package/dist/folderConfig.js +2 -1
- package/dist/folderConfig.js.map +1 -1
- package/dist/helpers/crypto.js +1 -1
- package/dist/helpers/logger.d.ts +1 -1
- package/dist/helpers/redis/redisConnection.js +1 -1
- package/dist/index.js +2 -2
- package/dist/models/KeyValue.js +1 -1
- package/dist/models/Lock.js +18 -8
- package/dist/models/Lock.js.map +1 -1
- package/dist/models/Migration.js +1 -1
- package/dist/models/Sequence.js +1 -1
- package/dist/models/User.d.ts +3 -3
- package/dist/models/User.js +3 -3
- package/dist/models/UserOld.d.ts +10 -10
- package/dist/models/UserOld.js +17 -8
- package/dist/models/UserOld.js.map +1 -1
- package/dist/modules/AbstractCommand.js +1 -1
- package/dist/modules/AbstractCommand.js.map +1 -1
- package/dist/modules/AbstractConnector.js +1 -1
- package/dist/modules/AbstractController.js +3 -3
- package/dist/modules/AbstractModel.js +1 -1
- package/dist/modules/Base.js +2 -2
- package/dist/modules/BaseCli.d.ts +1 -1
- package/dist/modules/BaseCli.js +5 -2
- package/dist/modules/BaseCli.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +34 -17
- package/dist/server.js.map +1 -1
- package/dist/services/cache/Cache.js +9 -7
- package/dist/services/cache/Cache.js.map +1 -1
- package/dist/services/cache/drivers/MemoryDriver.js +6 -0
- package/dist/services/cache/drivers/MemoryDriver.js.map +1 -1
- package/dist/services/cache/drivers/RedisDriver.js +1 -1
- package/dist/services/documentation/OpenApiGenerator.js +54 -7
- package/dist/services/documentation/OpenApiGenerator.js.map +1 -1
- package/dist/services/http/HttpServer.d.ts +6 -1
- package/dist/services/http/HttpServer.js +16 -11
- package/dist/services/http/HttpServer.js.map +1 -1
- package/dist/services/http/builtinErrorHandlers.js +1 -1
- package/dist/services/http/builtinErrorHandlers.js.map +1 -1
- package/dist/services/http/httpErrors.js.map +1 -1
- package/dist/services/http/middleware/AbstractMiddleware.js +1 -1
- package/dist/services/http/middleware/Auth.js +1 -1
- package/dist/services/http/middleware/Cors.js +6 -2
- package/dist/services/http/middleware/Cors.js.map +1 -1
- package/dist/services/http/middleware/GetUserByToken.d.ts +10 -2
- package/dist/services/http/middleware/GetUserByToken.js +29 -12
- package/dist/services/http/middleware/GetUserByToken.js.map +1 -1
- package/dist/services/http/middleware/I18n.js +1 -1
- package/dist/services/http/middleware/IpDetector.js +1 -1
- package/dist/services/http/middleware/Pagination.d.ts +1 -1
- package/dist/services/http/middleware/Pagination.js +2 -2
- package/dist/services/http/middleware/PrepareAppInfo.js +8 -2
- package/dist/services/http/middleware/PrepareAppInfo.js.map +1 -1
- package/dist/services/http/middleware/RateLimiter.js +2 -2
- package/dist/services/http/middleware/RequestLogger.js +1 -1
- package/dist/services/http/middleware/RequestParser.js +1 -1
- package/dist/services/http/middleware/Role.js +1 -1
- package/dist/services/http/routing/ExpressAdapter.js +9 -1
- package/dist/services/http/routing/ExpressAdapter.js.map +1 -1
- package/dist/services/http/routing/RouteNode.d.ts +1 -1
- package/dist/services/http/routing/RouteRegistry.d.ts +7 -0
- package/dist/services/http/routing/RouteRegistry.js +8 -2
- package/dist/services/http/routing/RouteRegistry.js.map +1 -1
- package/dist/services/http/routing/formatTree.js.map +1 -1
- package/dist/services/i18n/I18n.js +1 -1
- package/dist/services/logging/SentryTransport.js.map +1 -1
- package/dist/services/validate/ValidateService.js +4 -4
- package/dist/services/validate/ValidateService.js.map +1 -1
- package/dist/services/validate/drivers/StandardSchemaDriver.js +1 -1
- package/dist/services/validate/drivers/YupDriver.js +1 -1
- package/dist/services/validate/drivers/YupDriver.js.map +1 -1
- package/dist/tests/frameworkVitestSetup.js +1 -1
- package/dist/tests/globalSetupNodeTest.js +1 -1
- package/dist/tests/globalSetupVitest.js +1 -1
- package/dist/tests/nodeRunner.node-test.js +3 -3
- package/dist/tests/nodeRunnerShared.node-test.js +2 -2
- package/dist/tests/setupFramework.js +3 -3
- package/dist/tests/setupFramework.js.map +1 -1
- package/dist/tests/setupNodeTest.js +1 -1
- package/dist/tests/setupVitest.js +1 -1
- package/dist/tests/testHelpers.d.ts +16 -16
- package/dist/tests/testHelpers.js +1 -1
- package/dist/types.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,72 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
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
6
|
|
|
7
|
-
## [
|
|
7
|
+
## [NEXT] - Unreleased
|
|
8
|
+
|
|
9
|
+
## [5.1.4] - 2026-07-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Public Node cluster runner.** Consumers can import `runCluster` from `@adaptivestone/framework/cluster.js` to run a worker callback across a configurable number of processes. The narrow API exposes worker count, shutdown timeout, and a structured lifecycle-event hook; fixed internal safety policy provides delayed abnormal-exit recovery and crash-loop protection without turning the framework into a configurable process manager. SIGTERM/SIGINT are forwarded, stuck workers are force-terminated after the timeout, the callback runs only in workers, and importing the entry has no side effects. Clustering is optional—systemd, PM2, Kubernetes, and similar deployment supervisors should normally own replica count and restarts themselves. The framework's `prod` entry now uses this same implementation and no longer enables file watching implicitly.
|
|
14
|
+
|
|
15
|
+
### Documentation
|
|
16
|
+
|
|
17
|
+
- **Controller routing now documents the runtime rule precisely.** The default mount path is the controller-folder prefix plus the lowercased class name; the filename does not determine the URL and exporting one controller class from multiple files mounts it multiple times. Multi-word class names are not implicitly kebab-cased.
|
|
18
|
+
- **Typed rate-limit policies and stable validation assertions are documented.** Reusable limiter option objects can live under `config/rateLimiter.ts` `policy`, where generated config types catch misspelled names before the selected object is passed directly to `RateLimiter`. The testing guide now explains that application validation keys remain raw unless the application locale folder is explicitly enabled, so ordinary API tests should assert keys and status codes rather than translated prose.
|
|
19
|
+
|
|
20
|
+
## [5.1.3] - 2026-07-18
|
|
21
|
+
|
|
22
|
+
### Security
|
|
23
|
+
|
|
24
|
+
- **`logout` now revokes the session the client actually authenticated with.** `postLogout` re-extracted the bearer token from the `Authorization` header only, while the `GetUserByToken` middleware that authenticates every Auth route accepts the token from `req.body.token` first (a supported path) and falls back to the header. A client that authenticated with a **body** token and called `logout` with that same body token got a `200 Ok` while its session token was never `$pull`-ed — the 30-day token stayed valid, undetectably. Both call sites now resolve the presented token through one shared `GetUserByToken.resolveToken(req)` (body first, then `Authorization`, `'null'` treated as absent, `Bearer` prefix stripped, trimmed), so logout always revokes the exact session the request authenticated with — including the case where a request carries both a body and a header token (the body-authenticated session is the one revoked). Logout without any token still returns `200`. The middleware's behavior is unchanged.
|
|
25
|
+
|
|
26
|
+
- **Request validation no longer echoes an internal error message to the client.** The validation-phase catch in `src/controllers/index.ts` returned `400 { errors: err.message }` for **any** thrown error, not only a framework `ValidationError` — so an error raised inside a schema's `.transform`/`.test` (e.g. an async validator that hits the database), or the developer-facing "no `ValidatorDriver` matches this schema" message, rode verbatim into the `400` body. A repro leaked a Mongo connection string (`mongodb://admin:s3cret@…`) to an unauthenticated client. A framework `ValidationError` still maps to `400` with the same path-keyed `errors` response body as before; every other error now routes through the same error-handler registry as a handler throw (`app.httpServer.resolveError` — consumer-registered handlers and built-in `HttpError` mapping apply), falling back to a generic `500` with the "Platform error. Please check later or contact support" body, logged at `error`. **Behavior change:** a throwing `.transform`/`.test`, or a schema with no matching driver, now yields a `500` (or whatever the registry maps it to) instead of a `400` that echoed the internal message, and an `HttpError` thrown inside a validator maps to its own status — consistent with how it behaves when thrown from a handler.
|
|
27
|
+
|
|
28
|
+
- **`UserOld` legacy auth is hardened, and its deprecation is now audible.** The deprecated `UserOld` model — kept until v6 for consumers who haven't migrated — received three surgical changes. Its constructor deprecation notice is now a `process.emitWarning` with code `ASF_DEP_USEROLD` and an explicit security note (its legacy auth is known-weak; migrate to the `User` model), where it was a bare `console.warn`. The recovery- and verification-token lookups now include `until: { $gt: new Date() }`, so an expired token is rejected — previously an admitted TODO left a stale token valid forever. And the unknown-email login path now performs the same KDF burn as the `User` model (`burnPasswordVerify`), closing an account-enumeration timing oracle that had returned before doing any hashing work on an unknown email. Session-token behavior is unchanged, and only a consumer who deliberately kept authentication on `UserOld` across the v5 migration is affected. **Behavior change (UserOld consumers):** a recovery or verification token past its expiry is now rejected instead of continuing to work indefinitely.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- **The development toolchain now uses stable TypeScript 7.0.2.** TypeScript 6 and the separate `@typescript/native-preview`/`tsgo` preview compiler have been replaced by the stable TypeScript 7 package, and all build and type-check scripts now use `tsc`. Codegen syntax tests now invoke the compiler CLI because TypeScript 7 no longer exposes the legacy `transpileModule`, `ModuleKind`, and `ScriptTarget` API from the package root. Runtime behavior and the framework's published API are unchanged.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **Route-type codegen now accepts middleware tuples wrapped in TypeScript-only expressions such as `as const`.** A route-level tuple like `middleware: [[RateLimiter, options] as const]` is represented by OXC as a `TSAsExpression` around the tuple, but the extractor inspected middleware entries only as direct identifiers or array expressions. It therefore misclassified the otherwise-static route as using unanalyzable middleware and skipped its generated `*.routes.gen.ts` file. Middleware extraction now unwraps `as`, `satisfies`, non-null, and parenthesized expressions around the complete list, each entry, and the binding at the head of a tuple. The same handling applies to tuples in a controller's static middleware `Map`; genuinely dynamic middleware such as `buildMiddleware()` remains rejected.
|
|
37
|
+
|
|
38
|
+
- **The CLI now exits non-zero when a command fails.** A command that threw (including a migration whose `up()` rejected) was caught and logged, but the process still exited `0` — so a CI/deploy step running `node cli.ts migration/migrate` treated a failed migration as success and shipped against an un-migrated schema. The failure was swallowed at three layers: `BaseCli.run` caught and returned `undefined`, `Cli.run` discarded the result and returned `true`, and the entry script exited `0` unconditionally. Now `BaseCli.run` returns `false` on a thrown command (the error is still logged with its stack), `Cli.run` returns that result, and the entry exits `process.exit(result ? 0 : 1)`. **Behavior change:** a CLI command that fails (throws, or returns a falsy result — every shipped command returns an explicit boolean) now exits `1`. If your project has its own CLI entry that calls `cli.run()` without using the result, mirror the framework's entry (`process.exit(result ? 0 : 1)`) to get failure exit codes. In a multi-instance deploy, a `migrate` invocation that skips because another instance already holds the advisory lock now counts as **success** and exits `0` — another instance is running the migrations, so the skip is expected and is logged as a warning.
|
|
39
|
+
|
|
40
|
+
- **Controller routes with a mixed-case path segment below the first level were unreachable, and method-scoped middleware on a case-mismatched key was silently dropped.** The controller route-tree builder keyed static child segments by their original case, while the router's matcher (and `RouteRegistry`) look them up lower-cased. A first-level segment was healed by an incidental re-keying, but a nested route like `get: { '/user/Profile': handler }` produced a tree node the matcher could never reach — a `404` for both `/user/Profile` and `/user/profile`. The same drift meant a `static middleware` map key differing only in case from its route (e.g. `'POST/Login'` vs a `/login` route) attached its middleware (Auth, RateLimiter) to a phantom node — silently not running it — at any depth. The builder now keys segments through the same shared `RouteRegistry.ensureChildBySegment` the matcher uses (single source of truth; the drifted duplicate is removed), so mixed-case routes match case-insensitively at any depth and method-scoped middleware always attaches. A middleware key that points at a non-existent route now logs a warning at boot instead of failing silently. Runtime routing, `req.params` extraction, and the `405`-over-param-backtracking behavior are unchanged.
|
|
41
|
+
|
|
42
|
+
- **A non-string body `token` no longer crashes the request with a `500`.** `GetUserByToken` read `req.body.token` and called `.replace()` on it with no type check, and body parsing preserves a JSON number and keeps a repeated form field as an array — so a request carrying `{"token": 123}`, or `token` sent twice as a form field, threw `token.replace is not a function` → `TypeError` → the generic `500` sink, instead of being treated as an unauthenticated request. A non-string token is now treated as **absent**: the middleware falls through to the `Authorization` header (and `postLogout`, which shares the same `GetUserByToken.resolveToken`, treats it as no token and returns `200`). A string token behaves exactly as before.
|
|
43
|
+
|
|
44
|
+
- **Route-type codegen now emits the correct import form for named-export middleware.** The AST resolver classifies each middleware import as `default` or `named` (carrying its original name for an alias), but the emitter discarded that and always rendered a default import (`import type Mw from '…'`). A middleware exported as a **named** export, or a middleware class exported from the controller's own file, therefore produced a `.routes.gen.ts` that either failed to typecheck (`TS2613`: the module has no default export) or silently bound the middleware type to the file's *default* export — a wrong type that surfaced later as a confusing `TS2339` in the handler. The `kind` and original name are now threaded through to emit (via a shared `MiddlewareImport` type), so named and aliased middleware render as `import type { Name } from '…'` / `import type { Orig as Local } from '…'`. Output for default-export middleware — every framework built-in — is byte-identical.
|
|
45
|
+
|
|
46
|
+
- **`Lock.waitForUnlock` no longer races the change stream into an eternal hang.** The change stream opens its server-side cursor lazily on the first `'change'` listener, and its logical start point is fixed only then — but the old code ran the `findOne` existence check *before* attaching the listener, so a `releaseLock` that committed in that window was never observed: the waiter hung forever (or, with `timeoutMs`, surfaced a spurious timeout while the lock was already gone). The `'change'` listener is now attached first, and the code waits for mongoose's forwarded `resumeTokenChanged` signal (which fires only once the stream's start point is fixed) before the authoritative `findOne` re-check — closing the window. The public API is unchanged and no default timeout was added. **Edge note:** on a standalone MongoDB (change streams unsupported — never a working topology for this API), `waitForUnlock` on an absent lock now rejects with the stream error rather than accidentally resolving.
|
|
47
|
+
|
|
48
|
+
- **OpenAPI `operationId`s are now unique and controller-namespaced.** The generator emitted the bare handler name (`getList`) as the `operationId` with no uniqueness guard, so two controllers that both define `getList` — or one handler wired to multiple verbs/paths — produced duplicate ids, which OpenAPI 3.1 forbids: validators (Redocly, Spectral, swagger-cli) reject the document and client generators emit colliding function names. Each `operationId` is now namespaced by its controller (`${controllerName}_${methodName}`, the same derivation already used for `tags`) and de-duplicated against a document-wide set — a residual collision (the same handler on multiple verbs/paths) gets a deterministic verb suffix, then a numeric one. **Behavior change (consumer-visible output):** every emitted `operationId` changes (e.g. `getList` → `Users_getList`); regenerate and re-pin any client SDK or tooling that referenced the old ids.
|
|
49
|
+
|
|
50
|
+
- **A concurrent duplicate registration now returns the same `400` as the sequential existence check, not a `500` for the loser.** `postRegister` (`src/controllers/Auth.ts`) checks for an existing email/nickname and then calls `User.create`, with nothing guarding the window between the check and the insert — so two registrations racing on the same email both passed the checks and the second `create` threw a `MongoServerError` E11000 duplicate-key error, which is neither an `HttpError` nor a Mongoose `ValidationError` and so fell through to the generic `500` sink. A narrow catch around `User.create` now maps E11000 on the `email` unique index to the same `400 email.registered`, and on the `name.nick` index to `400 auth.nicknameExists`, that the pre-insert checks return. A duplicate-key error on any other index is rethrown (an honest `500`); non-duplicate errors propagate unchanged.
|
|
51
|
+
|
|
52
|
+
- **A non-positive cache TTL now means "don't cache" on every driver, instead of being cached forever in memory.** `Cache.getSetValue` short-circuited only an exact `storeTime === 0`, and `MemoryDriver.set` stored the entry unconditionally while arming its expiry timer only when `ttlSeconds > 0` — so a computed **negative** TTL (e.g. `Math.floor((expiresAt - Date.now()) / 1000)` once the source is already expired) wrote a timer-less, never-expiring entry, and the default memory driver served that stale value forever while Redis (which rejects `EX <= 0`) degraded to no-cache. The short-circuit is now `storeTime <= 0` and `MemoryDriver.set` early-returns on `ttlSeconds <= 0`, so the two drivers agree: a non-positive TTL is not stored. This is strictly a fix — the old memory-driver behavior was never intended (the `=== 0` guard existed precisely so a `0` could not write a never-expiring entry, and a negative value slipped past it) — but the **semantics changed**: a computed non-positive TTL now recomputes every call instead of being served from a permanent in-memory entry.
|
|
53
|
+
|
|
54
|
+
- **A config that exists only as an env-specific file no longer crashes boot with a cryptic `Cannot find package 'undefined'`.** A config present only as `config/foo.production.ts` with no base `config/foo.ts` left its resolved `default` path undefined, so `loadConfig` built `paths = [undefined]` and `import(undefined)` rejected with `ERR_MODULE_NOT_FOUND` — even when `NODE_ENV` matched the env file. Now, when `NODE_ENV` matches, the env file loads as the config; when it doesn't match, the config behaves exactly like an unknown config name (`getConfig` → warn + `{}`); and boot logs a clear diagnostic naming the config, its env segments, and the missing base file. A config that has a base file is unchanged — an env file still overrides the base.
|
|
55
|
+
|
|
56
|
+
- **A project checked out under a path containing a space (or on Windows) no longer breaks boot.** `src/folderConfig.ts` and `app.frameworkFolder` (`src/server.ts`) derived a filesystem path from `new URL('.', import.meta.url).pathname`, which leaves percent-encoding in place (a space stays `%20`) and yields `/C:/…` on Windows — so `folderConfig` fed `%20` paths into `fs.readdir` and boot failed with a misleading foldersConfig error. Both now use `fileURLToPath`, like the rest of the codebase.
|
|
57
|
+
|
|
58
|
+
- **Migrations organized into subfolders now apply in the correct order, and a non-conforming filename refuses to run instead of silently mis-sorting.** The pending-migration sort keyed on `Number(file.split('_')[0])`, but discovery is recursive and yields folder-relative paths, so a subfolder migration like `2024/1699…_x.ts` produced `NaN` and the `NaN` comparator applied migrations in an arbitrary order (`3000_a` could run before `1000_b`). The sort now uses the validated numeric timestamp prefix of the **basename** (directory segments stripped), with ties broken deterministically by full path. A pending migration whose basename doesn't match `<digits>_…` makes `migration/migrate` log an error naming the offending file(s) and return `false` (CLI exit 1) **before** running anything. **Behavior change:** a non-conforming pending migration filename now refuses to run instead of being mis-sorted.
|
|
59
|
+
|
|
60
|
+
- **A middleware rejection that arrives after the chain already advanced is now logged instead of silently dropped.** `ExpressAdapter`'s one-shot `settle()` returns silently once the middleware chain has resolved, so a middleware that calls `next()` and then awaits a call that later rejects (`next(); await audit.log(req);`) had its rejection consumed with no `500`, no log, and no `unhandledRejection` — the error vanished without a trace. `settle()` now logs such a late rejection at `logger.error` with the middleware class name and its stack. Observability only — responses are unchanged, and a benign double-`next()` stays silent.
|
|
61
|
+
|
|
62
|
+
- **A handler on a schema-less route that reads `req.appInfo.request`/`.query` no longer crashes with a logged `500`.** Both fields are typed as non-optional `Record<string, unknown>`, but `PrepareAppInfo` seeded only `{ app }` and the real assignments were gated on schema presence — so on a route with no `request:`/`query:` schema, a handler reading `req.appInfo.query.page` type-checked cleanly yet threw `TypeError` at runtime, which the handler wrapper caught and logged as a `500` "Platform error". `PrepareAppInfo` now seeds both fields to `{}`; a route that declares a schema is unchanged (the validated values still overwrite the defaults). **Behavior change:** such a handler now runs — each absent key reads as `undefined` — instead of `500`ing.
|
|
63
|
+
|
|
64
|
+
- **Controller load order is now a contractual, consistent sort rather than a coincidence of V8's sort internals.** The index-first comparator returned `-1` when `a` was an index file and `0` otherwise — it never returned `1`, so `compare(index, nonIndex)` was `-1` while `compare(nonIndex, index)` was `0`, violating ECMA-262's antisymmetry requirement. Index-first registration (and root `index` before a nested `index`) therefore held only by sort luck, and a V8 sort-strategy change or a longer controller list could have loaded a nested controller before a root index one, shifting middleware accumulation at boot. A new `compareControllerLoadOrder` is antisymmetric and consistent — index files before others, a shallower index before a deeper one — and separator-agnostic (works with `\` paths). Registration order for existing apps is unchanged.
|
|
65
|
+
|
|
66
|
+
- **Route-type codegen no longer truncates non-identifier path-param names, and a literal `*/` in a route path no longer breaks the generated file.** (a) `parsePathParams` matched only `:([a-zA-Z_][a-zA-Z0-9_]*)`, while the runtime router takes the whole segment after `:` — so `'/order/:order-id'` emitted `params: { order: string }` even though the runtime populates `req.params['order-id']`, and `:1st` was dropped entirely; codegen now captures the full segment and quotes any key that isn't a valid identifier (`'order-id': string`). (b) A literal `*/` in a route path (a legal static segment — only a *leading* `*` is a splat) terminated the generated file's JSDoc comment and broke parsing; the path is now escaped where it's rendered into the comment. Output for normal routes is byte-identical.
|
|
67
|
+
|
|
68
|
+
- **The OpenAPI generator no longer emits duplicate query parameters.** `buildQueryParameters` concatenated the route's own query schema with every middleware's introspectable `relatedQueryParameters` and pushed one parameter per property with no dedup — so a route query key that overlapped a middleware-declared one (e.g. `limit` on both) produced two `{ name: 'limit', in: 'query' }` entries, which OpenAPI 3.1 forbids and validators (Redocly, Spectral, swagger-cli) reject. Parameters are now deduplicated by `(name, in)`, with the route's own schema taking precedence over middleware contributions. A document that had no collision is byte-identical.
|
|
69
|
+
|
|
70
|
+
- **A config or model name containing a quote or backslash no longer breaks the generated `genTypes.d.ts`.** Config names, model names, and model paths were interpolated into single-quoted TypeScript string literals with no escaping, while the `sq()` escaper lived only in `emit.ts` — so a name that is legal on disk but contains `'` or `\` (e.g. `config/user's.ts`) produced an unterminated string literal that broke the whole project's typecheck. Every interpolation site now escapes through the shared `sq()`; output for benign names is byte-identical.
|
|
71
|
+
|
|
72
|
+
## [5.1.2] - 2026-07-05
|
|
8
73
|
|
|
9
74
|
### Fixed
|
|
10
75
|
|
package/dist/Cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import mongoose from 'mongoose';
|
|
2
|
-
import BaseCli from
|
|
3
|
-
import Server from
|
|
2
|
+
import BaseCli from './modules/BaseCli.js';
|
|
3
|
+
import Server from './server.js';
|
|
4
4
|
class Cli extends BaseCli {
|
|
5
5
|
constructor(serverConfig) {
|
|
6
6
|
mongoose.set('autoIndex', false); // we do not need create indexes on CLI.
|
|
@@ -10,9 +10,9 @@ class Cli extends BaseCli {
|
|
|
10
10
|
async run() {
|
|
11
11
|
await this.server.init({ isSkipModelInit: true, isSkipModelLoading: true });
|
|
12
12
|
const command = process.argv[2]?.toLowerCase();
|
|
13
|
-
await super.run(command);
|
|
13
|
+
const result = await super.run(command);
|
|
14
14
|
this.app.events.emit('shutdown');
|
|
15
|
-
return
|
|
15
|
+
return result;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
export default Cli;
|
package/dist/Cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cli.js","sourceRoot":"","sources":["../src/Cli.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,GAAI,SAAQ,OAAO;IACvB,YAAY,YAA2B;QACrC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,C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;CACF;AAED,eAAe,GAAG,CAAC"}
|
package/dist/cluster.d.ts
CHANGED
package/dist/cluster.js
CHANGED
|
@@ -1,67 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
// An orchestrator sends SIGTERM/SIGINT to PID 1 (the primary). Forward it to
|
|
11
|
-
// every worker so each drains gracefully via its own signal handler (workers
|
|
12
|
-
// run index.ts → startServer); the primary exits once the last worker is gone.
|
|
13
|
-
let shuttingDown = false;
|
|
14
|
-
for (const signal of ['SIGTERM', 'SIGINT']) {
|
|
15
|
-
process.on(signal, () => {
|
|
16
|
-
shuttingDown = true;
|
|
17
|
-
for (const worker of Object.values(cluster.workers ?? {})) {
|
|
18
|
-
worker?.kill(signal);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
// Bound crash-loop restarts. A worker that keeps dying on boot (bad config,
|
|
23
|
-
// port in use, missing Mongo/AUTH_SALT, unhandled rejection) must NOT be
|
|
24
|
-
// re-forked in a tight loop — that pegs every core and floods logs. Track
|
|
25
|
-
// restarts in a rolling window; if they arrive too fast, stop forking and
|
|
26
|
-
// exit so the orchestrator surfaces the crash-loop instead of the primary
|
|
27
|
-
// masking it forever. Healthy single crashes still recover (after a short
|
|
28
|
-
// backoff).
|
|
29
|
-
const RESTART_WINDOW_MS = 60_000;
|
|
30
|
-
const MAX_RESTARTS_PER_WINDOW = numCPUs * 5;
|
|
31
|
-
const RESTART_BACKOFF_MS = 1_000;
|
|
32
|
-
let restartTimes = [];
|
|
33
|
-
cluster.on('exit', (worker, code, signal) => {
|
|
34
|
-
if (shuttingDown) {
|
|
35
|
-
// Tearing down: don't resurrect; exit when the last worker has gone.
|
|
36
|
-
if (Object.keys(cluster.workers ?? {}).length === 0) {
|
|
37
|
-
process.exit(0);
|
|
38
|
-
}
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
// Deliberate shutdown (clean exit, no kill signal) — do not resurrect,
|
|
42
|
-
// otherwise the primary fights a graceful shutdown forever.
|
|
43
|
-
if (code === 0 && !signal) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const now = Date.now();
|
|
47
|
-
restartTimes = restartTimes.filter((t) => now - t < RESTART_WINDOW_MS);
|
|
48
|
-
restartTimes.push(now);
|
|
49
|
-
if (restartTimes.length > MAX_RESTARTS_PER_WINDOW) {
|
|
50
|
-
console.error(`Too many worker crashes (${restartTimes.length} in ${RESTART_WINDOW_MS / 1000}s). Refusing to keep forking — check the boot error above (config, DB, port). Exiting.`);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
console.log(`Worker \x1B[45m ${worker.process.pid} \x1B[49m \x1B[41m †††† died †††† \x1B[49m. Code: ${signal || code}. Restarting in ${RESTART_BACKOFF_MS}ms...`);
|
|
54
|
-
setTimeout(() => {
|
|
55
|
-
if (!shuttingDown) {
|
|
56
|
-
cluster.fork();
|
|
57
|
-
}
|
|
58
|
-
}, RESTART_BACKOFF_MS).unref();
|
|
1
|
+
import { runCluster, } from './clusterRunner.js';
|
|
2
|
+
export { runCluster };
|
|
3
|
+
// Keep the framework's own production entry on the public implementation.
|
|
4
|
+
// Importing `@adaptivestone/framework/cluster.js` has no side effects; this runs
|
|
5
|
+
// only for `node src/cluster.ts` / `node dist/cluster.js`.
|
|
6
|
+
if (import.meta.main) {
|
|
7
|
+
await runCluster(async () => {
|
|
8
|
+
await import('./index.js');
|
|
59
9
|
});
|
|
60
10
|
}
|
|
61
|
-
else {
|
|
62
|
-
// index.ts is the entry that actually constructs the Server and starts
|
|
63
|
-
// listening. server.ts only DEFINES the class, so importing it here would
|
|
64
|
-
// let the worker's event loop drain and exit → infinite fork storm.
|
|
65
|
-
import("./index.js");
|
|
66
|
-
}
|
|
67
11
|
//# sourceMappingURL=cluster.js.map
|
package/dist/cluster.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../src/cluster.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../src/cluster.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,GACX,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,0EAA0E;AAC1E,iFAAiF;AACjF,2DAA2D;AAC3D,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,MAAM,UAAU,CAAC,KAAK,IAAI,EAAE;QAC1B,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ClusterWorkerCount = 'auto' | number;
|
|
2
|
+
export interface ClusterEvent {
|
|
3
|
+
type: 'primary:start' | 'worker:exit' | 'cluster:shutdown' | 'cluster:error';
|
|
4
|
+
level: 'info' | 'warn' | 'error';
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RunClusterOptions {
|
|
8
|
+
/** Number of workers, or the host's available parallelism. Default: `auto`. */
|
|
9
|
+
workers?: ClusterWorkerCount;
|
|
10
|
+
/** Maximum time workers get to stop after a shutdown signal. Default: 30 seconds. */
|
|
11
|
+
shutdownTimeoutMs?: number;
|
|
12
|
+
/** Receives early lifecycle events before the application logger exists. */
|
|
13
|
+
onEvent?(event: ClusterEvent): void;
|
|
14
|
+
}
|
|
15
|
+
/** Run `startWorker` only in Node cluster workers; the primary supervises them. */
|
|
16
|
+
export declare function runCluster(startWorker: () => void | Promise<void>, options?: RunClusterOptions): Promise<void>;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import cluster, {} from 'node:cluster';
|
|
2
|
+
import { availableParallelism } from 'node:os';
|
|
3
|
+
const RESTART_DELAY_MS = 1_000;
|
|
4
|
+
const RESTART_WINDOW_MS = 60_000;
|
|
5
|
+
const RESTARTS_PER_WORKER = 5;
|
|
6
|
+
const DEFAULT_SHUTDOWN_TIMEOUT_MS = 30_000;
|
|
7
|
+
function defaultEventHandler(event) {
|
|
8
|
+
const write = event.level === 'error'
|
|
9
|
+
? console.error
|
|
10
|
+
: event.level === 'warn'
|
|
11
|
+
? console.warn
|
|
12
|
+
: console.log;
|
|
13
|
+
write(event.message);
|
|
14
|
+
}
|
|
15
|
+
function createEmitter(handler = defaultEventHandler) {
|
|
16
|
+
return (event) => {
|
|
17
|
+
try {
|
|
18
|
+
handler(event);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error('Cluster onEvent callback failed:', error);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function resolveOptions(options) {
|
|
26
|
+
const workersOption = options.workers ?? 'auto';
|
|
27
|
+
const workers = workersOption === 'auto' ? availableParallelism() : workersOption;
|
|
28
|
+
if (!Number.isInteger(workers) || workers < 1) {
|
|
29
|
+
throw new RangeError('workers must be `auto` or a positive integer');
|
|
30
|
+
}
|
|
31
|
+
const shutdownTimeoutMs = options.shutdownTimeoutMs ?? DEFAULT_SHUTDOWN_TIMEOUT_MS;
|
|
32
|
+
if (!Number.isFinite(shutdownTimeoutMs) || shutdownTimeoutMs < 1) {
|
|
33
|
+
throw new RangeError('shutdownTimeoutMs must be a finite number >= 1');
|
|
34
|
+
}
|
|
35
|
+
return { workers, shutdownTimeoutMs };
|
|
36
|
+
}
|
|
37
|
+
/** Run `startWorker` only in Node cluster workers; the primary supervises them. */
|
|
38
|
+
export async function runCluster(startWorker, options = {}) {
|
|
39
|
+
const resolved = resolveOptions(options);
|
|
40
|
+
if (!cluster.isPrimary) {
|
|
41
|
+
await startWorker();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
await supervisePrimary(resolved.workers, resolved.shutdownTimeoutMs, createEmitter(options.onEvent));
|
|
45
|
+
}
|
|
46
|
+
function supervisePrimary(workerCount, shutdownTimeoutMs, emit) {
|
|
47
|
+
return new Promise((resolve) => {
|
|
48
|
+
const activeWorkers = new Map();
|
|
49
|
+
const restartTimers = new Set();
|
|
50
|
+
let restartTimes = [];
|
|
51
|
+
let shutdownTimer;
|
|
52
|
+
let shutdownSignal;
|
|
53
|
+
let shuttingDown = false;
|
|
54
|
+
let exitCode = 0;
|
|
55
|
+
let finished = false;
|
|
56
|
+
const onSigterm = () => beginShutdown('SIGTERM', 0);
|
|
57
|
+
const onSigint = () => beginShutdown('SIGINT', 0);
|
|
58
|
+
const report = (type, level, message) => emit({ type, level, message });
|
|
59
|
+
function finish() {
|
|
60
|
+
if (finished) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
finished = true;
|
|
64
|
+
cluster.off('exit', onWorkerExit);
|
|
65
|
+
process.off('SIGTERM', onSigterm);
|
|
66
|
+
process.off('SIGINT', onSigint);
|
|
67
|
+
if (shutdownTimer) {
|
|
68
|
+
clearTimeout(shutdownTimer);
|
|
69
|
+
}
|
|
70
|
+
for (const timer of restartTimers) {
|
|
71
|
+
clearTimeout(timer);
|
|
72
|
+
}
|
|
73
|
+
restartTimers.clear();
|
|
74
|
+
process.exitCode = exitCode;
|
|
75
|
+
resolve();
|
|
76
|
+
}
|
|
77
|
+
function finishIfIdle() {
|
|
78
|
+
if (activeWorkers.size === 0 && restartTimers.size === 0) {
|
|
79
|
+
finish();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function signalWorker(worker, signal) {
|
|
83
|
+
try {
|
|
84
|
+
worker.kill(signal);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
report('cluster:error', 'error', `Could not send ${signal} to worker ${worker.process.pid ?? worker.id}: ${error instanceof Error ? error.message : String(error)}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function beginShutdown(signal, code) {
|
|
91
|
+
exitCode = Math.max(exitCode, code);
|
|
92
|
+
if (shuttingDown) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
shuttingDown = true;
|
|
96
|
+
shutdownSignal = signal;
|
|
97
|
+
report('cluster:shutdown', code === 0 ? 'info' : 'error', `Cluster shutting down with ${signal}.`);
|
|
98
|
+
for (const timer of restartTimers) {
|
|
99
|
+
clearTimeout(timer);
|
|
100
|
+
}
|
|
101
|
+
restartTimers.clear();
|
|
102
|
+
if (activeWorkers.size === 0) {
|
|
103
|
+
finish();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
shutdownTimer = setTimeout(() => {
|
|
107
|
+
shutdownTimer = undefined;
|
|
108
|
+
if (activeWorkers.size === 0) {
|
|
109
|
+
finishIfIdle();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
exitCode = 1;
|
|
113
|
+
report('cluster:error', 'error', `Cluster shutdown timed out after ${shutdownTimeoutMs}ms; force-terminating ${activeWorkers.size} worker(s).`);
|
|
114
|
+
for (const worker of activeWorkers.values()) {
|
|
115
|
+
signalWorker(worker, 'SIGKILL');
|
|
116
|
+
}
|
|
117
|
+
}, shutdownTimeoutMs);
|
|
118
|
+
for (const worker of activeWorkers.values()) {
|
|
119
|
+
signalWorker(worker, signal);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function forkWorker() {
|
|
123
|
+
if (shuttingDown) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
const worker = cluster.fork();
|
|
128
|
+
activeWorkers.set(worker.id, worker);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
report('cluster:error', 'error', `Failed to fork cluster worker: ${error instanceof Error ? error.message : String(error)}`);
|
|
132
|
+
beginShutdown('SIGTERM', 1);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function scheduleRestart() {
|
|
136
|
+
const timer = setTimeout(() => {
|
|
137
|
+
restartTimers.delete(timer);
|
|
138
|
+
forkWorker();
|
|
139
|
+
finishIfIdle();
|
|
140
|
+
}, RESTART_DELAY_MS);
|
|
141
|
+
restartTimers.add(timer);
|
|
142
|
+
}
|
|
143
|
+
function onWorkerExit(worker, code, rawSignal) {
|
|
144
|
+
const signal = rawSignal;
|
|
145
|
+
activeWorkers.delete(worker.id);
|
|
146
|
+
if (shuttingDown) {
|
|
147
|
+
if (code !== 0 || (signal && signal !== shutdownSignal)) {
|
|
148
|
+
exitCode = 1;
|
|
149
|
+
}
|
|
150
|
+
finishIfIdle();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (code === 0 && !signal) {
|
|
154
|
+
report('worker:exit', 'info', `Worker ${worker.process.pid ?? worker.id} exited cleanly; it will not be restarted.`);
|
|
155
|
+
finishIfIdle();
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const now = Date.now();
|
|
159
|
+
restartTimes = restartTimes.filter((time) => now - time < RESTART_WINDOW_MS);
|
|
160
|
+
const restartLimit = workerCount * RESTARTS_PER_WORKER;
|
|
161
|
+
if (restartTimes.length >= restartLimit) {
|
|
162
|
+
report('cluster:error', 'error', `Cluster exceeded its restart limit (${restartLimit} in ${RESTART_WINDOW_MS}ms).`);
|
|
163
|
+
beginShutdown('SIGTERM', 1);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
restartTimes.push(now);
|
|
167
|
+
report('worker:exit', 'warn', `Worker ${worker.process.pid ?? worker.id} exited abnormally (${signal ?? `code ${code}`}); restarting in ${RESTART_DELAY_MS}ms.`);
|
|
168
|
+
scheduleRestart();
|
|
169
|
+
}
|
|
170
|
+
cluster.on('exit', onWorkerExit);
|
|
171
|
+
process.once('SIGTERM', onSigterm);
|
|
172
|
+
process.once('SIGINT', onSigint);
|
|
173
|
+
report('primary:start', 'info', `Cluster primary ${process.pid} starting ${workerCount} worker(s).`);
|
|
174
|
+
for (let index = 0; index < workerCount; index += 1) {
|
|
175
|
+
forkWorker();
|
|
176
|
+
}
|
|
177
|
+
finishIfIdle();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=clusterRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clusterRunner.js","sourceRoot":"","sources":["../src/clusterRunner.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAe,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAsB3C,SAAS,mBAAmB,CAAC,KAAmB;IAC9C,MAAM,KAAK,GACT,KAAK,CAAC,KAAK,KAAK,OAAO;QACrB,CAAC,CAAC,OAAO,CAAC,KAAK;QACf,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;YACtB,CAAC,CAAC,OAAO,CAAC,IAAI;YACd,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IACpB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,aAAa,CAAC,OAAO,GAAG,mBAAmB;IAClD,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,CAAC;YACH,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,OAA0B;IAIhD,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC;IAChD,MAAM,OAAO,GACX,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,SAA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BAAmB,OAAO,CAAC,GAAG,aAAa,WAAW,aAAa,CACpE,CAAC;QACF,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,WAAW,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;YACpD,UAAU,EAAE,CAAC;QACf,CAAC;QACD,YAAY,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/codegen/appTypes.js
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import fs from 'node:fs/promises';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
-
import { envShapeToType, extractConfigEnvShape, mergeEnvShapes, } from
|
|
10
|
-
import { isBaseModelSource } from
|
|
9
|
+
import { envShapeToType, extractConfigEnvShape, mergeEnvShapes, } from './astConfig.js';
|
|
10
|
+
import { isBaseModelSource } from './astModel.js';
|
|
11
|
+
import { sq } from './emit.js';
|
|
11
12
|
/** A `./`-rooted, forward-slash specifier from `dir` to `target` for the emitted
|
|
12
13
|
* `import('…')`. Throws if `target` is outside `dir` (can't be a relative import)
|
|
13
14
|
* — better a clear error than an accidental absolute path baked into the file. */
|
|
@@ -130,7 +131,7 @@ export async function getTemplate(configs, modelPaths, configPaths) {
|
|
|
130
131
|
}));
|
|
131
132
|
}
|
|
132
133
|
const configTypes = Array.from(configs)
|
|
133
|
-
.map(([name, value]) => ` getConfig(configName:
|
|
134
|
+
.map(([name, value]) => ` getConfig(configName: ${sq(name)}): ${valueToTypeString(value, envByConfig.get(name))};`)
|
|
134
135
|
.join('\n');
|
|
135
136
|
// Detect `BaseModel` subclasses by parsing each model's source (no runtime
|
|
136
137
|
// import — codegen never loads the model graph / Mongoose). Result drives both
|
|
@@ -144,8 +145,8 @@ export async function getTemplate(configs, modelPaths, configPaths) {
|
|
|
144
145
|
})));
|
|
145
146
|
const modelTypes = models
|
|
146
147
|
.map((m) => m.isBaseModel
|
|
147
|
-
? ` getModel(modelName:
|
|
148
|
-
: ` getModel(modelName:
|
|
148
|
+
? ` getModel(modelName: ${sq(m.file)}): GetModelTypeFromClass<typeof import(${sq(m.relPath)}).default>`
|
|
149
|
+
: ` getModel(modelName: ${sq(m.file)}): import(${sq(m.relPath)}).default['mongooseModel']`)
|
|
149
150
|
.join('\n');
|
|
150
151
|
// Bind `req.appInfo.user` to the project's `User` model (if it's a BaseModel),
|
|
151
152
|
// so it follows a replaced model exactly like `getModel('User')` does. The
|
|
@@ -157,7 +158,7 @@ export async function getTemplate(configs, modelPaths, configPaths) {
|
|
|
157
158
|
? `
|
|
158
159
|
declare module '@adaptivestone/framework/models/User.js' {
|
|
159
160
|
export interface AppModels {
|
|
160
|
-
User: InstanceType<GetModelTypeFromClass<typeof import(
|
|
161
|
+
User: InstanceType<GetModelTypeFromClass<typeof import(${sq(userModel.relPath)}).default>>;
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appTypes.js","sourceRoot":"","sources":["../../src/codegen/appTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAEL,cAAc,EACd,qBAAqB,EACrB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"appTypes.js","sourceRoot":"","sources":["../../src/codegen/appTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAEL,cAAc,EACd,qBAAqB,EACrB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE/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AE,CAAC,CAAC,CAAC,IAAI,CAAC,0CAA0C,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY;QAC1G,CAAC,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAChG;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,+EAA+E;IAC/E,2EAA2E;IAC3E,6EAA6E;IAC7E,2EAA2E;IAC3E,mCAAmC;IACnC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC;IACzE,MAAM,WAAW,GAAG,SAAS;QAC3B,CAAC,CAAC;;;6DAGuD,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;;CAGjF;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;;;;;QAMD,WAAW;QACX,UAAU;;;EAGhB,WAAW,EAAE,CAAC;AAChB,CAAC"}
|
package/dist/codegen/astEmit.js
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
import { existsSync, promises as fs } from 'node:fs';
|
|
15
15
|
import path from 'node:path';
|
|
16
16
|
import { fileURLToPath } from 'node:url';
|
|
17
|
-
import { buildSubtreeFromSpec, convertPathSyntax, } from
|
|
18
|
-
import { getFilesPathWithInheritance } from
|
|
19
|
-
import { RouteRegistry } from
|
|
20
|
-
import { specFromExtracted } from
|
|
21
|
-
import { renderGenFile } from
|
|
17
|
+
import { buildSubtreeFromSpec, convertPathSyntax, } from '../controllers/index.js';
|
|
18
|
+
import { getFilesPathWithInheritance } from '../helpers/files.js';
|
|
19
|
+
import { RouteRegistry } from '../services/http/routing/RouteRegistry.js';
|
|
20
|
+
import { specFromExtracted } from './astSpec.js';
|
|
21
|
+
import { renderGenFile } from './emit.js';
|
|
22
22
|
/**
|
|
23
23
|
* Analyze the project's controller sources (no import, no boot) and return the
|
|
24
24
|
* gen files to write — WITHOUT writing anything. Registers all controllers
|
|
@@ -168,7 +168,14 @@ function renderResolved(srcPath, resolved, flatByKey, urlPrefix) {
|
|
|
168
168
|
: {}),
|
|
169
169
|
}));
|
|
170
170
|
const ctrlDir = path.dirname(srcPath);
|
|
171
|
-
const importMap = new Map(resolved.imports.map((i) => [
|
|
171
|
+
const importMap = new Map(resolved.imports.map((i) => [
|
|
172
|
+
i.binding,
|
|
173
|
+
{
|
|
174
|
+
specifier: i.specifier,
|
|
175
|
+
kind: i.kind,
|
|
176
|
+
...(i.orig ? { orig: i.orig } : {}),
|
|
177
|
+
},
|
|
178
|
+
]));
|
|
172
179
|
// Drop any middleware whose `import type` wouldn't type-check: an untyped `.js`
|
|
173
180
|
// middleware with no sibling `.d.ts` would be a `TS7016` in a strict consumer
|
|
174
181
|
// build (no `allowJs`). Removing the binding here drops it from BOTH the
|
|
@@ -176,8 +183,8 @@ function renderResolved(srcPath, resolved, flatByKey, urlPrefix) {
|
|
|
176
183
|
// filter below), so it degrades to "provides nothing" rather than breaking the
|
|
177
184
|
// consumer's typecheck. Same rule as the controller self-import; framework
|
|
178
185
|
// middleware come in as bare specifiers (which ship `.d.ts`) and are kept.
|
|
179
|
-
for (const [binding,
|
|
180
|
-
if (!specifierTypeImportable(specifier, ctrlDir)) {
|
|
186
|
+
for (const [binding, info] of [...importMap]) {
|
|
187
|
+
if (!specifierTypeImportable(info.specifier, ctrlDir)) {
|
|
181
188
|
importMap.delete(binding);
|
|
182
189
|
}
|
|
183
190
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astEmit.js","sourceRoot":"","sources":["../../src/codegen/astEmit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAe,UAAU,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO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