diff --git a/packages/core/package.json b/packages/core/package.json index ce061c2a82..34958d7653 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,6 +22,7 @@ "declaration": true, "exports": { ".": { + "types": "./lib/index.d.ts", "require": "./dist/tolgee.cjs.js", "import": "./dist/tolgee.esm.mjs" }, diff --git a/packages/format-icu/package.json b/packages/format-icu/package.json index 7fd747e6e2..5e97fabbbf 100644 --- a/packages/format-icu/package.json +++ b/packages/format-icu/package.json @@ -26,6 +26,7 @@ }, "exports": { ".": { + "types": "./lib/index.d.ts", "require": "./dist/tolgee-format-icu.cjs.js", "import": "./dist/tolgee-format-icu.esm.mjs" }, diff --git a/packages/i18next/package.json b/packages/i18next/package.json index 1efa981a07..a6a5e8eccb 100644 --- a/packages/i18next/package.json +++ b/packages/i18next/package.json @@ -67,6 +67,7 @@ }, "exports": { ".": { + "types": "./lib/index.d.ts", "require": "./dist/tolgee-i18next.cjs.js", "import": "./dist/tolgee-i18next.esm.mjs" }, diff --git a/packages/react/package.json b/packages/react/package.json index 6e760c5b91..82eb46b0f3 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -70,6 +70,7 @@ }, "exports": { ".": { + "types": "./lib/index.d.ts", "require": "./dist/tolgee-react.cjs.js", "import": "./dist/tolgee-react.esm.mjs" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index 59d04eb38c..97f0849371 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -65,6 +65,7 @@ }, "exports": { ".": { + "types": "./lib/index.d.ts", "require": "./dist/tolgee-vue.cjs.js", "import": "./dist/tolgee-vue.esm.mjs" }, diff --git a/scripts/packages.test.ts b/scripts/packages.test.ts index bdd8ae06a1..4220a135be 100644 --- a/scripts/packages.test.ts +++ b/scripts/packages.test.ts @@ -75,6 +75,12 @@ const checkPackage = (filePath) => { f.exports?.['./package.json'] === './package.json', 'package.json in exports' ); + if (typeof f.exports?.['.'] === 'object') { + assertExpr( + f.exports?.['.']?.['types'] !== undefined, + "has type definitions for 'exports' field" + ); + } } assertFileExists(folder, f.main, 'main'); assertFileExists(folder, f.module, 'module');