uql-codemod 0.31.0 → 0.32.0

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/README.md CHANGED
@@ -39,6 +39,7 @@ It reports rather than guesses, and exits non-zero when anything is left for you
39
39
  - **`target: esnext`** is reported, not changed. Removing the line falls back to the compiler default (`es5` for `tsc`), and choosing a replacement means guessing which era the project targets. Any dated target works; `esnext` is the one where TypeScript emits decorator syntax untransformed.
40
40
  - **A value inherited through `extends`** cannot be edited here, so the base config is reported instead.
41
41
  - **`@Log()`, `@Serialized()`, `@Transactional()` and `@InjectQuerier()`** are reported and left in place. They no longer exist, and what to do instead is a judgement call - a `@Transactional()` method becomes a `pool.transaction(async (querier) => { ... })` around its body, and the codemod cannot know which pool.
42
+ - **An export that no longer exists** (`setQuerierPool`, `getQuerier`, `QueryWhereMap`, `augmentWhere`, ...) is reported with what replaces it. A `$where` given an id, a list of them or a bare `raw()` needs no report: it is a compile error on that value, fixed by naming the key (`{ id: [1, 2] }`) or wrapping the raw in `$and`.
42
43
  - **A key written under a computed name** (`@Id() [KEY]?: string`) is reported: the brand has to spell the name out, and only you know what that expression evaluates to.
43
44
  - **Options it cannot read** (`@Field(sharedOptions)`, a spread, or a `@Field` never called at all) are left exactly as written. Replacing an argument it cannot parse would silently drop the options.
44
45
  - **A property whose type it cannot map to a column** (a `Json<T>`, a vector, a union that disagrees with itself) is reported as `needs a decision`. Those always had to declare `type` by hand anyway, because `design:type` reported the useless `Object`/`Array` for them.
package/dist/transform.js CHANGED
@@ -16,12 +16,16 @@ const REMOVED_DECORATORS = new Map([
16
16
  ]);
17
17
  /**
18
18
  * Exports that no longer exist, mapped to what to do instead. Reported rather than rewritten, for the
19
- * same reason as the decorators: which pool belongs at a given call site is a judgement call.
19
+ * same reason as the decorators: what replaces each is decided at its call site.
20
20
  */
21
21
  const REMOVED_EXPORTS = new Map([
22
22
  ['setQuerierPool', 'pass the pool where it is used: `createFetchHandler({ pool })`, `querierMiddleware({ pool })`'],
23
23
  ['getQuerierPool', 'take the pool from the module that builds it, or from Nest DI'],
24
24
  ['getQuerier', 'use `pool.withQuerier(...)` / `pool.transaction(...)`, which release the connection'],
25
+ ['QueryWhereMap', 'it is `QueryWhere` now'],
26
+ ['QueryWhereFieldMap', 'use `QueryWhere`'],
27
+ ['augmentWhere', 'spread the two maps: `{ ...where, ...extra }`'],
28
+ ['buildQueryWhereAsMap', 'a `$where` is a map already; name the key for ids: `{ id: [1, 2] }`'],
25
29
  ]);
26
30
  /** A node's decorators, or none where it is a kind that cannot carry them. */
27
31
  function decoratorsOf(node) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uql-codemod",
3
3
  "description": "Upgrade uql-orm across versions that introduce breaking changes",
4
4
  "license": "MIT",
5
- "version": "0.31.0",
5
+ "version": "0.32.0",
6
6
  "type": "module",
7
7
  "engines": {
8
8
  "node": ">=24"