Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/types-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@iqai/alert-logger": patch
---

Add typesVersions for TypeScript moduleResolution "node" subpath type resolution
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"nestjs": ["./dist/integrations/nestjs/index.d.ts"],
"nextjs": ["./dist/integrations/nextjs/index.d.ts"]
}
},
Comment on lines +47 to +52
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When using typesVersions for subpath mapping with a wildcard version range (*), TypeScript may ignore the top-level types field for the root entry point if it doesn't find a match within the mapping. To ensure the root types remain resolvable for all users, it is a best practice to include a catch-all mapping or an explicit entry for the root.

Consider adding a wildcard mapping to the end of the block:

  "typesVersions": {
    "*": {
      "nestjs": ["./dist/integrations/nestjs/index.d.ts"],
      "nextjs": ["./dist/integrations/nextjs/index.d.ts"],
      "*": ["./dist/index.d.ts"]
    }
  },

"files": [
"dist"
],
Expand Down
Loading