From f66a5160aa3c445f5ee767b91c9f0d8574b83959 Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Mon, 29 Jan 2024 19:12:03 +0100 Subject: [PATCH] Add typesVersion for resolving all types using legacy moduleResolution When TS is set up to not use a `moduleResolution` of `node16` or `bundler` yet (like legacy `node`/`node10`), then TS would not look into `exports`. There is `types`, but that only works when resolving the main index module, like `import from 'ember-cli-page-object'`, but all other submodules like `ember-cli-page-object/adapter` would fail to resolve to `types.d.ts`. This is removing `types` in favor of `typesVersions`, supporting the same wildcard-matching that `exports` does. --- addon/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addon/package.json b/addon/package.json index a060a1a3..37702bcb 100644 --- a/addon/package.json +++ b/addon/package.json @@ -41,7 +41,11 @@ "types": "./types.d.ts" } }, - "types": "types.d.ts", + "typesVersions": { + "*": { + "*": ["./types.d.ts"] + } + }, "files": [ "addon-main.js", "dist",