@clicktap/ui 0.43.0 → 0.43.1

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.
@@ -1,6 +1,7 @@
1
1
  # `@clicktap/ui` resolves its deep subpaths under `moduleResolution: bundler` (CTAP-1060)
2
2
 
3
3
  **Date:** 2026-07-31
4
+ **Revised:** 2026-08-08 — the test-runner half (CTAP-1195): every runtime subpath entry gains a `default` condition, so CJS resolvers (Jest) stop falling through to the `.d.ts`. See "Test runners (Jest)" below; reported by noco.
4
5
  **Package:** `@clicktap/ui`
5
6
  **Breaking:** No — additive to the `exports` map. Existing `moduleResolution: node` / `node10`
6
7
  consumers are unaffected (that resolver ignores `exports`); this only *adds* working resolution under
@@ -43,8 +44,34 @@ emits only `.d.ts` for it).
43
44
  blocker — **nx 20.0.3 cannot build a project graph with TS 7 installed** (`Cannot read properties of
44
45
  undefined (reading 'readFile')`) — so TS 7 also needs an nx major.
45
46
 
47
+ ## Test runners (Jest) — the CJS half (CTAP-1195)
48
+
49
+ The original map declared only `types` + `import` conditions. That covers bundlers — but **Node CJS
50
+ resolution** (what Jest uses without ESM flags) matches neither, so it fell through to the `.d.ts`
51
+ and died on `export interface`. Any consumer whose Jest suite touches `useCooldown` (i.e. anyone
52
+ adopting the CTAP-1114 `useResendCode` pattern *with* its tests) hit this; noco worked around it with
53
+ a `moduleNameMapper` straight to the `.js` files.
54
+
55
+ Since this revision every runtime subpath entry carries a **`default` condition (last)** pointing at
56
+ the same ESM files as `import`, so CJS resolvers land on real JavaScript. Two consequences:
57
+
58
+ - **Drop any `moduleNameMapper` workaround** for `@clicktap/ui` paths after bumping — resolution now
59
+ works natively.
60
+ - **The transform allowance is still required**: the resolved files are ESM (`import`/`export`
61
+ syntax), which babel-jest must transpile. Keep `@clicktap/ui` out of `transformIgnorePatterns`,
62
+ e.g. under pnpm:
63
+
64
+ ```ts
65
+ transformIgnorePatterns: ['/node_modules/.pnpm/(?!(@clicktap\\+ui)@)'],
66
+ ```
67
+
68
+ A `default` condition cannot remove that half — only a real CJS build could, which is out of
69
+ proportion for an ESM-only `'use client'` package.
70
+
46
71
  ## Verified
47
72
 
48
73
  Resolution was tested against the built package in both modes: under `bundler` all deep subpaths (flat
49
74
  file, directory-index, and nested file) resolve **with types**; under `node` (node10) resolution is
50
- unchanged (no regression).
75
+ unchanged (no regression). For the CTAP-1195 revision: `require.resolve('@clicktap/ui/hooks/useCooldown')`
76
+ from a CJS context resolves to the `.js` (previously an `ERR_PACKAGE_PATH_NOT_EXPORTED`-adjacent fall-through
77
+ to types).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",
@@ -25,6 +25,10 @@
25
25
  "import": [
26
26
  "./components/*.js",
27
27
  "./components/*/index.js"
28
+ ],
29
+ "default": [
30
+ "./components/*.js",
31
+ "./components/*/index.js"
28
32
  ]
29
33
  },
30
34
  "./next": {
@@ -33,6 +37,9 @@
33
37
  ],
34
38
  "import": [
35
39
  "./next/index.js"
40
+ ],
41
+ "default": [
42
+ "./next/index.js"
36
43
  ]
37
44
  },
38
45
  "./next/*": {
@@ -43,6 +50,10 @@
43
50
  "import": [
44
51
  "./next/*.js",
45
52
  "./next/*/index.js"
53
+ ],
54
+ "default": [
55
+ "./next/*.js",
56
+ "./next/*/index.js"
46
57
  ]
47
58
  },
48
59
  "./hooks/*": {
@@ -53,6 +64,10 @@
53
64
  "import": [
54
65
  "./hooks/*.js",
55
66
  "./hooks/*/index.js"
67
+ ],
68
+ "default": [
69
+ "./hooks/*.js",
70
+ "./hooks/*/index.js"
56
71
  ]
57
72
  },
58
73
  "./utils/*": {
@@ -63,6 +78,10 @@
63
78
  "import": [
64
79
  "./utils/*.js",
65
80
  "./utils/*/index.js"
81
+ ],
82
+ "default": [
83
+ "./utils/*.js",
84
+ "./utils/*/index.js"
66
85
  ]
67
86
  },
68
87
  "./types/*": {