Skip to content

Commit

Permalink
chore: split ts config on build and regular
Browse files Browse the repository at this point in the history
chore: add @types/testing-library__jest-dom

chore: remove redundant css-prop.d.ts

chore: update tsconfig.json
  • Loading branch information
mainframev committed Mar 29, 2023
1 parent c982e6c commit 09b085c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 28 deletions.
2 changes: 0 additions & 2 deletions packages/orbit-components/config/build/consts.mts
Expand Up @@ -15,6 +15,4 @@ export const COMPILE_IGNORE_PATTERNS = [
"**/*.test.*",
"**/__tests__/**/*",
"**/__typetests__/**/*",
"**/__examples__/*.*",
"**/examples.*",
];
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion 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",
Expand Down
1 change: 0 additions & 1 deletion packages/orbit-components/css-prop.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/orbit-components/package.json
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions 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.*"]
}
15 changes: 4 additions & 11 deletions packages/orbit-components/tsconfig.json
Expand Up @@ -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"]
}
17 changes: 7 additions & 10 deletions yarn.lock
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 09b085c

Please sign in to comment.