Commit dd11c49
fix: add typesVersions so testing module resolves under classic TypeScript moduleResolution
The exports map in package.json correctly declares the ./testing subpath,
but TypeScript's moduleResolution: "node" (the default in most projects) does
not read the exports field. This caused `getTestServer` and `getFunction` to
appear not found when users imported @google-cloud/functions-framework/testing.
Adding typesVersions instructs TypeScript to resolve the testing subpath to
./build/src/testing.d.ts regardless of moduleResolution setting, unblocking
users on TypeScript <4.7 or projects that have not yet adopted node16/bundler
module resolution.
Fixes #594
Co-authored-by: 64JohnLee <64lamei@gmail.com>1 parent 5f58e79 commit dd11c49
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
0 commit comments