Skip to content

V3#25

Closed
SerhiyGreench wants to merge 8 commits into
masterfrom
v3
Closed

V3#25
SerhiyGreench wants to merge 8 commits into
masterfrom
v3

Conversation

@SerhiyGreench

Copy link
Copy Markdown
Contributor

No description provided.

- typescript ^7.0.2 (tsgo), tsconfig es2024/nodenext/strict with
  experimentalDecorators + emitDecoratorMetadata (sequelize-typescript
  requires legacy decorators; tsgo emits design:type — verified)
- node:test suite replaces mocha/chai/sinon/nyc; oxlint/oxfmt replace
  eslint; devDependencies reduced to the family baseline
- dependencies purged: dropped unused dotenv, uuid, @imqueue/core (only
  transitive via rpc), @imqueue/js (5 helpers inlined in
  src/helpers/js.ts), bluebird + @types/bluebird (Promise shadowing
  removed — method signatures now truthfully return native promises),
  @types/validator (sequelize ships it as own dependency)
- reflect-metadata moved devDependencies -> dependencies (src imports it)
- fixed CREATE VIEW matcher: single-backslash \s in template strings
  dropped by JS, so CREATE TEMP/TEMPORARY VIEW never matched
- ten override modifiers, strict-mode typing fixes in the
  query-interface monkey-patches
- package.json: type=module, exports map, engines node>=22.12,
  @imqueue/rpc ^3.2.0
- explicit .js extensions on all relative imports; verbatimModuleSyntax
  with import type annotations throughout
- sql-formatter and chalk consumed via static imports; consumer model
  files loaded in database() through createRequire (sync API preserved;
  CJS model builds work today, require(esm) covers ESM ones)
- sequelize/types/* declaration-only imports made statement-level
  'import type' so no runtime import of type-only subpaths remains
- query.ts: package root imported lazily at the single call site and
  BaseModel imports made type-only, removing module cycles the sync
  require(esm) path cannot evaluate
- BaseModel: 'export * from sequelize-typescript' replaced by an
  explicit 139-name value re-export list + fully-erased
  'export type *' — a CommonJS star re-export anywhere in the graph
  breaks require(esm) binding (export names materialize with undefined
  values; import() works). Sequelize name excluded: this package ships
  its own extended Sequelize class

BREAKING CHANGE: package is ESM-only; CJS consumers require Node >=22.12
(require(esm)) and TypeScript >=5.8 to type-check

Verified: 7/7 tests on Node 24.16.0 and docker node:24 (24.18.0); CJS
require(esm) and ESM import() interop both smoke-tested
- @imqueue/rpc ^3.2.1: the whole dependency chain
  (sequelize -> rpc -> core) is now native ESM end to end
- license field aligned to GPL-3.0-only, matching the family

Verified: 7/7 tests and CJS require(esm) interop (BaseModel, database
and re-exported sequelize-typescript names all bind) on Node 24.16.0,
docker node:22 (22.23) and docker node:24 (24.18)
Brings the CreatedBy/UpdatedBy/DeletedBy audit-stamping decorators from
master (published there as 3.1.x) into the ESM branch. Resolution:

- package.json/package-lock.json keep the v3 (ESM, TS7, node:test,
  oxlint/oxfmt) shape; version set to 4.0.0 since master already
  released 3.1.x from the CJS line and the ESM switch is breaking
- decorator barrel re-exports use explicit .js extensions
- new decorators verified under ESM: hook registration lands in
  sequelize-typescript 'sequelize:hooks' metadata, currentMetadata()
  binding via @imqueue/rpc runWithRequest() works
- 15 behavioral specs added for the three decorators (stamp-if-empty,
  overwrite-on-update semantics, bulk fields injection, soft-delete
  sibling update, restore clearing, late this-binding, idempotent
  registration)
- unused generic type parameters, parameters kept for API shape and the
  unused catch binding are underscore-prefixed / dropped per lint rules
- unused Sequelize type import removed from helpers/query
The ESM branch had its version pre-set to 4.0.0 during the master merge,
which made the usual 'npm version major' release flow skip to 5.0.0.
Align back to the published 3.1.3 so the release flow itself produces
4.0.0 with its tag and commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant