From dc2ff3133e4d6076b8e74656034339967435d6bc Mon Sep 17 00:00:00 2001 From: Arne Bahlo Date: Mon, 26 Jun 2023 14:31:02 +0200 Subject: [PATCH] Add types to package.json exports 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 https://github.com/microsoft/TypeScript/issues/46334 --- packages/js/package.json | 3 ++- packages/pino/package.json | 3 ++- packages/winston/package.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/js/package.json b/packages/js/package.json index 832fc4bb..66bce721 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -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" } } diff --git a/packages/pino/package.json b/packages/pino/package.json index ae569113..96dfaa8c 100644 --- a/packages/pino/package.json +++ b/packages/pino/package.json @@ -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:*", diff --git a/packages/winston/package.json b/packages/winston/package.json index dc4e0782..35557f8c 100644 --- a/packages/winston/package.json +++ b/packages/winston/package.json @@ -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" } }