Skip to content

V5#21

Merged
SerhiyGreench merged 7 commits into
masterfrom
v5
Jul 10, 2026
Merged

V5#21
SerhiyGreench merged 7 commits into
masterfrom
v5

Conversation

@SerhiyGreench

Copy link
Copy Markdown
Contributor

No description provided.

- native ES modules: type=module, exports map, explicit .js import
  extensions, engines node >=22.12.0
- @imqueue deps updated to ESM majors: core ^3.2.1, rpc ^3.2.1,
  pg-pubsub ^3.0.0, tag-cache ^3.0.0; NOTE: package-lock.json is
  intentionally not committed — regenerate with npm install once
  pg-pubsub@3 and tag-cache@3 are published to the registry
- signature() is now a local helper (deterministic sorted-key serializer
  + sha256/64-bit key, replicating rpc's internal implementation): rpc 3.x
  intentionally stopped exporting it from the package entry point
- PG_CACHE_DEBUG env var now parsed via envBool() accepting
  1/true/yes/on (the old !!+value idiom treated 'true' as false)
- TypeScript 7 (tsgo) with es2024 target, nodenext resolution,
  verbatimModuleSyntax, experimental decorators kept for
  sequelize-typescript compatibility
- test suite added (previous test file was an empty stub): env helpers,
  decorator factories and full signature() behavior specs
- lint/format switched from eslint to oxlint + oxfmt; devDeps reduced
- version bumped to 5.0.0
- version aligned to the published 4.0.3: the migration commit had
  pre-set 5.0.0, which would make npm version major skip to 6.0.0
- npm package no longer ships dev tooling (scripts/, oxlint/oxfmt
  configs excluded)
- test-coverage-html script added (genhtml over the stripped lcov),
  matching the rest of the family
- removed the unused @types/validator devDependency (nothing references
  validator; reflect-metadata kept as the decorator-metadata companion)
- dependency bumps: pg ^8.22.0, @types/pg ^8.20.0, @types/node ^24.13.3,
  oxlint 1.73.0, oxfmt 0.58.0
pg-cache only used @imqueue/core for the ILogger type. Define a local,
structurally-compatible ILogger in env.ts (and export it) so the direct
@imqueue/core dependency can be removed; the rpc/tag-cache/pg-pubsub deps
still bring core in transitively. Type-only change - emitted output is
unchanged.
@PgCache, @cacheWith and @cacheby previously worked only as legacy
(experimentalDecorators) decorators. They now detect the calling
convention and work in both modes, matching @imqueue/rpc and
@imqueue/core - so a consuming service can compile with standard
(stage-3) decorators while still using these.

- method decorators (@cacheWith/@cacheby): standard invocations register
  their channel metadata via context.addInitializer on the declaring
  prototype (the class is not known at decoration time) and return the
  wrapped method; legacy invocations keep mutating descriptor.value and
  register at decoration time. Channel registration is deduped so the
  per-construction initializer runs once
- class decorator (@PgCache): accepts (value, context) as well as
  (constructor); the body augments the prototype in place and start()
  already reads channel metadata at runtime, so both modes converge
- package tsconfig drops experimentalDecorators/emitDecoratorMetadata to
  compile as standard decorators, like rpc/core
- ClassDecorator/MethodDecorator types widened to the dual signature;
  shared helpers (isStandardDecorator, declaringPrototype,
  registerChannelsOnce) added to env.ts
- new decorators.spec.ts exercises both conventions end-to-end for all
  three decorators (caching behaviour + channel registration)
@SerhiyGreench SerhiyGreench merged commit a11a0fc into master Jul 10, 2026
9 checks passed
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