diff --git a/packages/orbit-components/config/build/consts.mts b/packages/orbit-components/config/build/consts.mts index 6313680ed4..9e0a053ae6 100644 --- a/packages/orbit-components/config/build/consts.mts +++ b/packages/orbit-components/config/build/consts.mts @@ -15,6 +15,4 @@ export const COMPILE_IGNORE_PATTERNS = [ "**/*.test.*", "**/__tests__/**/*", "**/__typetests__/**/*", - "**/__examples__/*.*", - "**/examples.*", ]; diff --git a/packages/orbit-components/config/build/generateDeclarations.mts b/packages/orbit-components/config/build/generateDeclarations.mts index 6d355ee8e3..e91dc06d68 100644 --- a/packages/orbit-components/config/build/generateDeclarations.mts +++ b/packages/orbit-components/config/build/generateDeclarations.mts @@ -15,8 +15,8 @@ export default async function generateTypeDeclarations() { await $`cpy "**/types.d.ts" ../es --cwd src --parents`; await $`del tsconfig.tsbuildinfo`; // reset potential incremental compilation information - await $`tsc`; - await $`tsc --rootDir src --outDir es --declaration --emitDeclarationOnly --moduleResolution node`; + await $`tsc --p tsconfig-build.json `; + await $`tsc --p tsconfig-build.json --rootDir src --outDir es --declaration --emitDeclarationOnly --moduleResolution node`; console.log(chalk.greenBright.bold("Generating flow declarations...")); const tsDeclarations = await globby("{lib,es}/*.d.ts"); diff --git a/packages/orbit-components/config/jestSetupFramework.ts b/packages/orbit-components/config/jestSetupFramework.ts index bc1eec7899..25b285fd1d 100644 --- a/packages/orbit-components/config/jestSetupFramework.ts +++ b/packages/orbit-components/config/jestSetupFramework.ts @@ -1,6 +1,6 @@ import { configure } from "@testing-library/react"; import "jest-styled-components"; -import "@testing-library/jest-dom"; +import "@testing-library/jest-dom/extend-expect"; configure({ testIdAttribute: "data-test", diff --git a/packages/orbit-components/css-prop.d.ts b/packages/orbit-components/css-prop.d.ts deleted file mode 100644 index 5f2b2170ba..0000000000 --- a/packages/orbit-components/css-prop.d.ts +++ /dev/null @@ -1 +0,0 @@ -import type {} from "styled-components/cssprop"; diff --git a/packages/orbit-components/package.json b/packages/orbit-components/package.json index 428d54b3d0..d7989a2428 100644 --- a/packages/orbit-components/package.json +++ b/packages/orbit-components/package.json @@ -17,7 +17,7 @@ "size:why": "size-limit --why", "fetch:icons": "ts-node --esm config/fetchIcons.mts", "check:icons": "ts-node --esm config/checkIconsCli.mts", - "check:types": "tsc --noEmit --emitDeclarationOnly false", + "check:types": "tsc --p tsconfig.json", "flow:ci": "flow check", "build:iconsPng": "ts-node --esm config/generatePngIcons.mts", "build:storybook": "ts-node --esm config/build/buildIcons.mts && build-storybook -c .storybook -o .out", @@ -81,6 +81,7 @@ "dependencies": { "@kiwicom/orbit-design-tokens": "^3.2.0", "@popperjs/core": "^2.9.2", + "@types/testing-library__jest-dom": "^5.14.5", "react-hot-toast": "^2.2.0", "react-popper": "^2.2.5", "react-uid": "^2.3.2" diff --git a/packages/orbit-components/tsconfig-build.json b/packages/orbit-components/tsconfig-build.json new file mode 100644 index 0000000000..69053eb8df --- /dev/null +++ b/packages/orbit-components/tsconfig-build.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "declaration": true, + "moduleResolution": "node", + "importsNotUsedAsValues": "error", + "emitDeclarationOnly": true + }, + "include": ["src/**/*", "css-prop.d.ts"], + "exclude": ["**/*.test.*", "**/__tests__/**/*", "**/__typetests__/**/*", "**/*.stories.*"] +} diff --git a/packages/orbit-components/tsconfig.json b/packages/orbit-components/tsconfig.json index 0425d75527..5674a9f4ab 100644 --- a/packages/orbit-components/tsconfig.json +++ b/packages/orbit-components/tsconfig.json @@ -3,17 +3,10 @@ "compilerOptions": { "rootDir": "src", "outDir": "lib", - "declaration": true, + "noEmit": true, + "types": ["node", "jest", "@testing-library/jest-dom"], "moduleResolution": "node", - "importsNotUsedAsValues": "error", - "emitDeclarationOnly": true + "importsNotUsedAsValues": "error" }, - "include": ["src/**/*", "css-prop.d.ts"], - "exclude": [ - "**/*.test.*", - "**/__tests__/**/*", - "**/__typetests__/**/*", - "**/__examples__/*.*", - "**/examples.*" - ] + "include": ["src/**/*", "css-prop.d.ts", "typings/**/*.d.ts"] } diff --git a/yarn.lock b/yarn.lock index 433138ea6e..54a9f2a221 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4375,16 +4375,6 @@ resolved "https://registry.yarnpkg.com/@kiwicom/babel-plugin-orbit-components/-/babel-plugin-orbit-components-3.6.6.tgz#bc1531d8ca687e258b9c1e7e691dac6e40164f58" integrity sha512-t278JTrEmwVoutWHBNpAjebmRAkvZuDx6Yq857lL68KU/tc3w91VgDhY+FY8yM1X1FURCcyyhdun0YOIkQPUgQ== -"@kiwicom/browserslist-config@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@kiwicom/browserslist-config/-/browserslist-config-2.1.0.tgz#87590935ca268f9ede19fd792c8e1270685c2912" - integrity sha512-uj2Ix8OdvdEJvhHV/KZ9YEmpH6aYxcKek4V1zNDdsQrjxmGhxyJZVF93XqlHrd8P+PtsgrisOQU7eMQcykging== - -"@kiwicom/browserslist-config@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@kiwicom/browserslist-config/-/browserslist-config-3.0.0.tgz#5710f4c94c4165ad9b9e7c0f43feee3dfb0d989b" - integrity sha512-g0TZoOEEiFmtQncFDiabku44p/AFRP3ZeRjhl+z15Cx+1OcNFqI0O84Alj7YKfcjF7SFwWuDkZJ7ERt+rlE1Hg== - "@kiwicom/browserslist-config@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@kiwicom/browserslist-config/-/browserslist-config-4.0.0.tgz#9eef54b36ee8bfc4e28496d77e28ad9e91e943e1" @@ -9480,6 +9470,13 @@ resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310" integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ== +"@types/testing-library__jest-dom@^5.14.5": + version "5.14.5" + resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.5.tgz#d113709c90b3c75fdb127ec338dad7d5f86c974f" + integrity sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ== + dependencies: + "@types/jest" "*" + "@types/testing-library__jest-dom@^5.9.1": version "5.9.5" resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.9.5.tgz#5bf25c91ad2d7b38f264b12275e5c92a66d849b0"