V5#21
Merged
Merged
Conversation
- 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.