@bymax-one/nest-cache 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +30 -7
package/CHANGELOG.md CHANGED
@@ -4,6 +4,57 @@ All notable changes to this project are documented in this file. The format is
4
4
  based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
5
5
  project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [1.0.2] - 2026-07-29
10
+
11
+ ### Fixed
12
+
13
+ - **The `./shared` subpath now resolves under `moduleResolution: node`.** A
14
+ `typesVersions` map points the subpath at its `.d.cts` declarations, which is
15
+ the only mechanism that resolution algorithm understands — it predates
16
+ `exports` and ignores it entirely. Without this, a consumer whose tsconfig
17
+ sets `module: commonjs` without an explicit `moduleResolution` (the default
18
+ the Nest CLI scaffolds, which falls back to `node`) got
19
+ `error TS2307: Cannot find module '@bymax-one/nest-cache/shared'` while the
20
+ root entrypoint resolved fine. Runtime was never affected: Node reads
21
+ `exports`, so `require('@bymax-one/nest-cache/shared')` always worked.
22
+
23
+ This supersedes the note under 1.0.1 claiming the subpath was "not fixable
24
+ without a directory shim" — that was wrong, `typesVersions` fixes it with no
25
+ extra files in the tarball.
26
+
27
+ ### Changed
28
+
29
+ - `check:exports` now runs the **strict** `attw` profile. The `--profile node16`
30
+ escape hatch existed only to ignore the failing `node10` row, which no longer
31
+ fails, so every entrypoint is now verified in every resolution mode.
32
+
33
+ ## [1.0.1] - 2026-07-29
34
+
35
+ ### Fixed
36
+
37
+ - **CommonJS consumers no longer receive ESM type declarations.** Both subpaths
38
+ now declare `types` per condition, so `require()` resolves to the `.d.cts`
39
+ declarations that match the `.cjs` runtime. Previously a single `types` entry
40
+ pointed at the `.d.ts` files, which — with `"type": "module"` — TypeScript
41
+ reads as ESM, so a project on `moduleResolution: node16` / `nodenext`
42
+ importing from CommonJS got declarations for the wrong module format.
43
+ - Added top-level `main`, `module` and `types` so the root entrypoint also
44
+ resolves under the legacy `moduleResolution: node` algorithm. The `./shared`
45
+ subpath remains unresolvable in that mode, which is inherent to subpath
46
+ exports and not fixable without a directory shim.
47
+ - Exposed `./package.json` through the `exports` map. Reading it previously
48
+ failed with `ERR_PACKAGE_PATH_NOT_EXPORTED`, which breaks tooling that
49
+ inspects an installed package's manifest.
50
+
51
+ ### Added
52
+
53
+ - `pnpm check:exports` (`@arethetypeswrong/cli`) — packs the tarball and
54
+ resolves every entrypoint the way each module resolution mode would. Wired
55
+ into CI and into the release-shape gates, since the type-level API tests
56
+ compile `src` and therefore cannot catch a broken `exports` map.
57
+
7
58
  ## [1.0.0] - 2026-07-29
8
59
 
9
60
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bymax-one/nest-cache",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Typed Redis cache for NestJS based on ioredis 5, with namespace strategy, Pub/Sub and Lua script management.",
5
5
  "author": "Bymax One <support@bymax.one>",
6
6
  "license": "MIT",
@@ -22,14 +22,35 @@
22
22
  ],
23
23
  "exports": {
24
24
  ".": {
25
- "types": "./dist/server/index.d.ts",
26
- "import": "./dist/server/index.mjs",
27
- "require": "./dist/server/index.cjs"
25
+ "import": {
26
+ "types": "./dist/server/index.d.ts",
27
+ "default": "./dist/server/index.mjs"
28
+ },
29
+ "require": {
30
+ "types": "./dist/server/index.d.cts",
31
+ "default": "./dist/server/index.cjs"
32
+ }
28
33
  },
29
34
  "./shared": {
30
- "types": "./dist/shared/index.d.ts",
31
- "import": "./dist/shared/index.mjs",
32
- "require": "./dist/shared/index.cjs"
35
+ "import": {
36
+ "types": "./dist/shared/index.d.ts",
37
+ "default": "./dist/shared/index.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./dist/shared/index.d.cts",
41
+ "default": "./dist/shared/index.cjs"
42
+ }
43
+ },
44
+ "./package.json": "./package.json"
45
+ },
46
+ "main": "./dist/server/index.cjs",
47
+ "module": "./dist/server/index.mjs",
48
+ "types": "./dist/server/index.d.cts",
49
+ "typesVersions": {
50
+ "*": {
51
+ "shared": [
52
+ "./dist/shared/index.d.cts"
53
+ ]
33
54
  }
34
55
  },
35
56
  "lint-staged": {
@@ -49,6 +70,7 @@
49
70
  "reflect-metadata": "^0.2.0"
50
71
  },
51
72
  "devDependencies": {
73
+ "@arethetypeswrong/cli": "^0.18.5",
52
74
  "@commitlint/cli": "^21.2.1",
53
75
  "@commitlint/config-conventional": "^21.2.0",
54
76
  "@eslint/js": "^9.39.4",
@@ -117,6 +139,7 @@
117
139
  "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.server.json",
118
140
  "test:types": "tsc --noEmit -p tsconfig.typetest.json",
119
141
  "size": "node scripts/check-size.mjs",
142
+ "check:exports": "attw --pack .",
120
143
  "clean": "rm -rf dist coverage",
121
144
  "release": "pnpm publish --provenance"
122
145
  }