Skip to content

Commit

Permalink
Add types to package.json exports
Browse files Browse the repository at this point in the history
Otherwise projects might complain, here's Vue:

> src/App.vue:5:23 - error TS7016: Could not find a declaration file for module '@axiomhq/js'. '/Users/arne/Developer/axiomhq/axiom_ts_issue/node_modules/@axiomhq/js/dist/esm/index.js' implicitly has an 'any' type.
>   There are types at '/Users/arne/Developer/axiomhq/axiom_ts_issue/node_modules/@axiomhq/js/dist/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@axiomhq/js' library may need to update its package.json or typings.

See also microsoft/TypeScript#46334
  • Loading branch information
bahlo committed Jun 26, 2023
1 parent 6c0b4a5 commit dc2ff31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
}
}
3 changes: 2 additions & 1 deletion packages/pino/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
},
"dependencies": {
"@axiomhq/js": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/winston/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/cjs/index.js"
"default": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
}
}

0 comments on commit dc2ff31

Please sign in to comment.