From 7078fa338edf17e18b8699cc78be12b765fd2e89 Mon Sep 17 00:00:00 2001 From: Sergey Roytman Date: Wed, 28 Jun 2023 10:27:43 +0300 Subject: [PATCH] fix: icons, interactionsTests, testIds types exports (#1369) * Remove unrelevant comments * fix: in published-ts-components.js * Refactoring * Fix icons, interactionsTests, testIds types export via typesVersions --- package.json | 17 +++++++++++++++-- scripts/build-types.js | 2 -- scripts/build-utils.js | 4 ++-- webpack/published-ts-components.js | 2 -- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 986d13b9db..01c44c109a 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,27 @@ }, "./dist/": "./dist/", "./icons": "./dist/esm/src/components/Icon/Icons/icons.js", - "./tokens": "./dist/tokens/tokens.css", - "./storybookComponents": "./dist/storybook/index.js", "./interactionsTests": "./dist/esm/src/tests/interactionsTests.js", "./testIds": "./dist/esm/src/tests/testIds.js", + "./storybookComponents": "./dist/storybook/index.js", + "./tokens": "./dist/tokens/tokens.css", "./mockedClassNames": { "import": "./dist/mocked_classnames_esm/src/index.js" } }, + "typesVersions": { + "*": { + "icons": [ + "./dist/esm/components/Icon/Icons/index.d.ts" + ], + "interactionsTests": [ + "./dist/esm/tests/interactions-utils.d.ts" + ], + "testIds": [ + "./dist/esm/tests/test-ids-utils.d.ts" + ] + } + }, "scripts": { "test": "jest", "test:stories": "testing=storybook TEST_END_FILES=jest-story jest", diff --git a/scripts/build-types.js b/scripts/build-types.js index 95de1033db..eeae756541 100755 --- a/scripts/build-types.js +++ b/scripts/build-types.js @@ -3,6 +3,4 @@ const { createFoldersIfNotExist, buildComponentsTypesIndexFile } = require("./build-utils"); createFoldersIfNotExist(); -// we create new d.ts index file but still not give reference to it in our package.json file -// until we finish to migrate all the components to typescript buildComponentsTypesIndexFile(); diff --git a/scripts/build-utils.js b/scripts/build-utils.js index e2677b0d46..798316baf5 100644 --- a/scripts/build-utils.js +++ b/scripts/build-utils.js @@ -46,8 +46,8 @@ function buildComponentsTypesIndexFile() { buildComponentExport(name, `./types/${path}`) ); - const exportsWithJavasript = Object.keys(publishedJSComponents).map(name => buildExportToComponentWithoutType(name)); - convertExportsToFile(exportsWithTypescript.concat(exportsWithJavasript), "types.d.ts"); + const exportsWithJavascript = Object.keys(publishedJSComponents).map(name => buildExportToComponentWithoutType(name)); + convertExportsToFile(exportsWithTypescript.concat(exportsWithJavascript), "types.d.ts"); } function buildStorybookComponentsIndexFile() { diff --git a/webpack/published-ts-components.js b/webpack/published-ts-components.js index 80ca0d2ac0..692ef74a9f 100644 --- a/webpack/published-ts-components.js +++ b/webpack/published-ts-components.js @@ -104,8 +104,6 @@ const publishedTSComponents = { useActiveDescendantListFocus: "hooks/useActiveDescendantListFocus", useListenFocusTriggers: "hooks/useListenFocusTriggers", useSwitch: "hooks/useSwitch", - // Don't remove next line - // plop_marker:published-hooks useClickableProps: "hooks/useClickableProps/useClickableProps", useHover: "hooks/useHover/useHover" };