From a28d42d700058d182830cbba9c10fda4cdb6f5bd Mon Sep 17 00:00:00 2001 From: Stuart Hendren Date: Tue, 11 Oct 2022 14:38:45 +0000 Subject: [PATCH] fix: improves the packaging uses esbuild-node-externals to standardize the package - moved the test utils so they can be excluded from the build --- .devcontainer/devcontainer.json | 3 +- .npmignore | 21 +- build.js => build.mjs | 8 +- generators/Component.test.hbs | 19 +- package-lock.json | 756 ++++++++++++++++-- package.json | 10 +- src/components/Accordion/Accordion.test.tsx | 2 +- src/components/Alert/Alert.test.tsx | 2 +- src/components/AppBar/AppBar.test.tsx | 2 +- .../AspectRatio/AspectRatio.test.tsx | 2 +- src/components/Avatar/Avatar.stories.tsx | 2 +- src/components/Avatar/Avatar.test.tsx | 2 +- src/components/Backdrop/Backdrop.test.tsx | 2 +- src/components/Badge/Badge.test.tsx | 2 +- src/components/Box/Box.test.tsx | 2 +- src/components/Button/Button.test.tsx | 2 +- src/components/Card/Card.test.tsx | 2 +- src/components/Checkbox/Checkbox.test.tsx | 2 +- src/components/Chip/Chip.test.tsx | 2 +- .../ComponentsProvider.test.tsx | 2 +- .../ConfirmDialog/ConfirmDialog.test.tsx | 2 +- src/components/Container/Container.test.tsx | 2 +- .../ContextMenu/ContextMenu.test.tsx | 2 +- src/components/Dialog/Dialog.test.tsx | 2 +- src/components/Divider/Divider.test.tsx | 2 +- src/components/Drawer/Drawer.test.tsx | 2 +- src/components/Flex/Flex.test.tsx | 2 +- src/components/Form/Form.test.tsx | 2 +- .../FormControl/FormControl.test.tsx | 2 +- src/components/Grid/Grid.stories.tsx | 2 +- src/components/Grid/Grid.test.tsx | 2 +- src/components/Heading/Heading.test.tsx | 2 +- src/components/Hidden/Hidden.test.tsx | 2 +- src/components/HoverCard/HoverCard.test.tsx | 2 +- src/components/IconButton/IconButton.test.tsx | 2 +- src/components/Image/Image.test.tsx | 2 +- src/components/Inline/Inline.stories.tsx | 2 +- src/components/Inline/Inline.test.tsx | 2 +- src/components/Input/Input.test.tsx | 2 +- src/components/Label/Label.test.tsx | 2 +- src/components/Link/Link.test.tsx | 2 +- src/components/List/List.test.tsx | 2 +- src/components/Logo/Logo.test.tsx | 2 +- src/components/Menu/Menu.test.tsx | 2 +- .../NavigationMenu/NavigationMenu.test.tsx | 2 +- src/components/Overlay/Overlay.test.tsx | 2 +- src/components/Pagination/Pagination.test.tsx | 2 +- src/components/Paper/Paper.test.tsx | 2 +- src/components/Popover/Popover.test.tsx | 2 +- src/components/Progress/Progress.test.tsx | 2 +- src/components/RadioGroup/RadioGroup.test.tsx | 2 +- src/components/Select/Select.test.tsx | 2 +- src/components/Skeleton/Skeleton.test.tsx | 2 +- src/components/Slider/Slider.test.tsx | 2 +- src/components/Spinner/Spinner.test.tsx | 2 +- src/components/Stack/Stack.stories.tsx | 2 +- src/components/Stack/Stack.test.tsx | 2 +- src/components/Subheading/Subheading.test.tsx | 2 +- src/components/Svg/Svg.test.tsx | 2 +- src/components/Switch/Switch.test.tsx | 2 +- src/components/Table/Table.test.tsx | 2 +- src/components/Tabs/Tabs.test.tsx | 2 +- src/components/Text/Text.test.tsx | 2 +- src/components/TextArea/TextArea.test.tsx | 2 +- .../ThemeProvider/ThemeProvider.test.tsx | 2 +- .../ThemeSwitch/ThemeSwitch.test.tsx | 2 +- src/components/Toast/Toast.test.tsx | 2 +- src/components/Toggle/Toogle.test.tsx | 2 +- .../ToggleGroup/ToogleGroup.test.tsx | 2 +- src/components/Tooltip/Tooltip.test.tsx | 2 +- src/docs/util/randomColor.ts | 8 +- src/{utils => docs/util}/story-utils.tsx | 13 +- src/{utils => test}/domrect-polyfill.ts | 0 src/test/index.ts | 1 + src/{utils => test}/test-utils.tsx | 0 src/utils/index.ts | 8 - tsconfig.build.json | 5 +- 77 files changed, 798 insertions(+), 182 deletions(-) rename build.js => build.mjs (66%) rename src/{utils => docs/util}/story-utils.tsx (70%) rename src/{utils => test}/domrect-polyfill.ts (100%) create mode 100644 src/test/index.ts rename src/{utils => test}/test-utils.tsx (100%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a3eb1678..a20678f5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -61,8 +61,7 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "yarn install", + "postCreateCommand": "npm ci", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "node", diff --git a/.npmignore b/.npmignore index 1f5aea07..175a5ff7 100644 --- a/.npmignore +++ b/.npmignore @@ -2,10 +2,19 @@ **/tsconfig.json **/webpack.config.js node_modules -src -stories example -lib -lib-esm -_bundles -tsdx.config.js +generators +public +src +build.mjs +coverage +dangerfile.lite.ts +dangerfile.ts +jest.config.js +jest.patch-cssom.js +sonar-project.properties +spellcheck.json +test-report.xml +tsconfig.build.json +tsconfig.json +tsconfig.storybook.json \ No newline at end of file diff --git a/build.js b/build.mjs similarity index 66% rename from build.js rename to build.mjs index 32f9a6ce..ab2549dd 100644 --- a/build.js +++ b/build.mjs @@ -1,5 +1,5 @@ -const { build } = require('esbuild') -const { peerDependencies } = require('./package.json') +import { build } from 'esbuild' +import { nodeExternalsPlugin } from 'esbuild-node-externals' const entryFile = 'src/index.ts' const outFolder = 'dist' @@ -7,11 +7,11 @@ const outFolder = 'dist' const shared = { bundle: true, entryPoints: [entryFile], - external: Object.keys(peerDependencies), logLevel: 'info', minify: true, sourcemap: true, - target: ['esnext', 'node12.22.0'], + target: ['esnext'], + plugins: [nodeExternalsPlugin()], } build({ diff --git a/generators/Component.test.hbs b/generators/Component.test.hbs index 4d0d998a..d7de6c8a 100644 --- a/generators/Component.test.hbs +++ b/generators/Component.test.hbs @@ -1,13 +1,6 @@ -import React from 'react' -import { renderLight, renderDark } from 'test-utils' -import { Default } from './{{ name }}.stories' - -it('renders light without error', () => { - const { asFragment } = renderLight() - expect(asFragment()).toBeDefined() -}) - -it('renders dark without error', () => { - const { asFragment } = renderDark() - expect(asFragment()).toBeDefined() -}) +import React from 'react' import { renderLight, renderDark } from '../../test' +import { Default } from './{{name}}.stories' it('renders light without error', +() => { const { asFragment } = renderLight() +expect(asFragment()).toBeDefined() }) it('renders dark without error', () => { +const { asFragment } = renderDark() +expect(asFragment()).toBeDefined() }) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3738b0f0..2e4b1b5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@faker-js/faker": "^6.1.2", "@fontsource/dosis": "^4.5.7", "@fontsource/inter": "^4.5.7", - "@size-limit/preset-small-lib": "^7.0.8", + "@size-limit/preset-small-lib": "^8.1.0", "@storybook/addon-docs": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/react": "^6.5.12", @@ -66,6 +66,7 @@ "danger": "^11.0.2", "danger-plugin-spellcheck": "^2.1.0", "esbuild": "^0.14.36", + "esbuild-node-externals": "^1.5.0", "eslint": "^7.29.0", "eslint-config-prettier": "^8.1.0", "eslint-import-resolver-typescript": "^2.4.0", @@ -93,7 +94,7 @@ "react-virtual": "^2.10.4", "resize-observer-polyfill": "^1.5.1", "semantic-release": "^19.0.3", - "size-limit": "^7.0.8", + "size-limit": "^8.1.0", "story-description-loader": "^1.0.0", "storybook-dark-mode": "^1.1.2", "ts-jest": "^27.1.4", @@ -2893,6 +2894,38 @@ "node": ">=10.0.0" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.10.tgz", + "integrity": "sha512-FNONeQPy/ox+5NBkcSbYJxoXj9GWu8gVGJTVmUyoOCKQFDTrHVKgNSzChdNt0I8Aj/iKcsDf2r9BFwv+FSNUXg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.10.tgz", + "integrity": "sha512-w0Ou3Z83LOYEkwaui2M8VwIp+nLi/NA60lBLMvaJ+vXVMcsARYdEzLNE7RSm4+lSg4zq4d7fAVuzk7PNQ5JFgg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -6110,40 +6143,397 @@ } }, "node_modules/@size-limit/esbuild": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-7.0.8.tgz", - "integrity": "sha512-AzCrxJJThDvHrBNoolebYVgXu46c6HuS3fOxoXr3V0YWNM0qz81z5F3j7RruzboZnls8ZgME4WrH6GM5rB9gtA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-8.1.0.tgz", + "integrity": "sha512-Lq+vJAUO13RXbiNF4bZOB07LmzMURkbV8Z6dhAkhTdAVWYLUn0zjfIe3O6IMwhj9dqJ0WtadhKHJvNQKG+po3w==", "dev": true, "dependencies": { - "esbuild": "^0.14.18", - "nanoid": "^3.2.0" + "esbuild": "^0.15.7", + "nanoid": "^3.3.4" }, "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": "^14.0.0 || ^16.0.0 || >=18.0.0" }, "peerDependencies": { - "size-limit": "7.0.8" + "size-limit": "8.1.0" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.10.tgz", + "integrity": "sha512-N7wBhfJ/E5fzn/SpNgX+oW2RLRjwaL8Y0ezqNqhjD6w0H2p0rDuEz2FKZqpqLnO8DCaWumKe8dsC/ljvVSSxng==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.10", + "@esbuild/linux-loong64": "0.15.10", + "esbuild-android-64": "0.15.10", + "esbuild-android-arm64": "0.15.10", + "esbuild-darwin-64": "0.15.10", + "esbuild-darwin-arm64": "0.15.10", + "esbuild-freebsd-64": "0.15.10", + "esbuild-freebsd-arm64": "0.15.10", + "esbuild-linux-32": "0.15.10", + "esbuild-linux-64": "0.15.10", + "esbuild-linux-arm": "0.15.10", + "esbuild-linux-arm64": "0.15.10", + "esbuild-linux-mips64le": "0.15.10", + "esbuild-linux-ppc64le": "0.15.10", + "esbuild-linux-riscv64": "0.15.10", + "esbuild-linux-s390x": "0.15.10", + "esbuild-netbsd-64": "0.15.10", + "esbuild-openbsd-64": "0.15.10", + "esbuild-sunos-64": "0.15.10", + "esbuild-windows-32": "0.15.10", + "esbuild-windows-64": "0.15.10", + "esbuild-windows-arm64": "0.15.10" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-android-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.10.tgz", + "integrity": "sha512-UI7krF8OYO1N7JYTgLT9ML5j4+45ra3amLZKx7LO3lmLt1Ibn8t3aZbX5Pu4BjWiqDuJ3m/hsvhPhK/5Y/YpnA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-android-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.10.tgz", + "integrity": "sha512-EOt55D6xBk5O05AK8brXUbZmoFj4chM8u3riGflLa6ziEoVvNjRdD7Cnp82NHQGfSHgYR06XsPI8/sMuA/cUwg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-darwin-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.10.tgz", + "integrity": "sha512-hbDJugTicqIm+WKZgp208d7FcXcaK8j2c0l+fqSJ3d2AzQAfjEYDRM3Z2oMeqSJ9uFxyj/muSACLdix7oTstRA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-darwin-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.10.tgz", + "integrity": "sha512-M1t5+Kj4IgSbYmunf2BB6EKLkWUq+XlqaFRiGOk8bmBapu9bCDrxjf4kUnWn59Dka3I27EiuHBKd1rSO4osLFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-freebsd-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.10.tgz", + "integrity": "sha512-KMBFMa7C8oc97nqDdoZwtDBX7gfpolkk6Bcmj6YFMrtCMVgoU/x2DI1p74DmYl7CSS6Ppa3xgemrLrr5IjIn0w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-freebsd-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.10.tgz", + "integrity": "sha512-m2KNbuCX13yQqLlbSojFMHpewbn8wW5uDS6DxRpmaZKzyq8Dbsku6hHvh2U+BcLwWY4mpgXzFUoENEf7IcioGg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-32": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.10.tgz", + "integrity": "sha512-guXrwSYFAvNkuQ39FNeV4sNkNms1bLlA5vF1H0cazZBOLdLFIny6BhT+TUbK/hdByMQhtWQ5jI9VAmPKbVPu1w==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.10.tgz", + "integrity": "sha512-jd8XfaSJeucMpD63YNMO1JCrdJhckHWcMv6O233bL4l6ogQKQOxBYSRP/XLWP+6kVTu0obXovuckJDcA0DKtQA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-arm": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.10.tgz", + "integrity": "sha512-6N8vThLL/Lysy9y4Ex8XoLQAlbZKUyExCWyayGi2KgTBelKpPgj6RZnUaKri0dHNPGgReJriKVU6+KDGQwn10A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.10.tgz", + "integrity": "sha512-GByBi4fgkvZFTHFDYNftu1DQ1GzR23jws0oWyCfhnI7eMOe+wgwWrc78dbNk709Ivdr/evefm2PJiUBMiusS1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-mips64le": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.10.tgz", + "integrity": "sha512-BxP+LbaGVGIdQNJUNF7qpYjEGWb0YyHVSKqYKrn+pTwH/SiHUxFyJYSP3pqkku61olQiSBnSmWZ+YUpj78Tw7Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-ppc64le": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.10.tgz", + "integrity": "sha512-LoSQCd6498PmninNgqd/BR7z3Bsk/mabImBWuQ4wQgmQEeanzWd5BQU2aNi9mBURCLgyheuZS6Xhrw5luw3OkQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-riscv64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.10.tgz", + "integrity": "sha512-Lrl9Cr2YROvPV4wmZ1/g48httE8z/5SCiXIyebiB5N8VT7pX3t6meI7TQVHw/wQpqP/AF4SksDuFImPTM7Z32Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-linux-s390x": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.10.tgz", + "integrity": "sha512-ReP+6q3eLVVP2lpRrvl5EodKX7EZ1bS1/z5j6hsluAlZP5aHhk6ghT6Cq3IANvvDdscMMCB4QEbI+AjtvoOFpA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-netbsd-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.10.tgz", + "integrity": "sha512-iGDYtJCMCqldMskQ4eIV+QSS/CuT7xyy9i2/FjpKvxAuCzrESZXiA1L64YNj6/afuzfBe9i8m/uDkFHy257hTw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-openbsd-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.10.tgz", + "integrity": "sha512-ftMMIwHWrnrYnvuJQRJs/Smlcb28F9ICGde/P3FUTCgDDM0N7WA0o9uOR38f5Xe2/OhNCgkjNeb7QeaE3cyWkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-sunos-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.10.tgz", + "integrity": "sha512-mf7hBL9Uo2gcy2r3rUFMjVpTaGpFJJE5QTDDqUFf1632FxteYANffDZmKbqX0PfeQ2XjUDE604IcE7OJeoHiyg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-windows-32": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.10.tgz", + "integrity": "sha512-ttFVo+Cg8b5+qHmZHbEc8Vl17kCleHhLzgT8X04y8zudEApo0PxPg9Mz8Z2cKH1bCYlve1XL8LkyXGFjtUYeGg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-windows-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.10.tgz", + "integrity": "sha512-2H0gdsyHi5x+8lbng3hLbxDWR7mKHWh5BXZGKVG830KUmXOOWFE2YKJ4tHRkejRduOGDrBvHBriYsGtmTv3ntA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@size-limit/esbuild/node_modules/esbuild-windows-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.10.tgz", + "integrity": "sha512-S+th4F+F8VLsHLR0zrUcG+Et4hx0RKgK1eyHc08kztmLOES8BWwMiaGdoW9hiXuzznXQ0I/Fg904MNbr11Nktw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, "node_modules/@size-limit/file": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-7.0.8.tgz", - "integrity": "sha512-1KeFQuMXIXAH/iELqIX7x+YNYDFvzIvmxcp9PrdwEoSNL0dXdaDIo9WE/yz8xvOmUcKaLfqbWkL75DM0k91WHQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-8.1.0.tgz", + "integrity": "sha512-Ur+NgJSRHBnbQBrD8X2doxXYdBcVJsMxe2KfWrUmnZ6wYz09YKhQ1iYLqNztjf2yf/JEp00zp1vyhmimUQfUHQ==", "dev": true, "dependencies": { - "semver": "7.3.5" + "semver": "7.3.7" }, "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": "^14.0.0 || ^16.0.0 || >=18.0.0" }, "peerDependencies": { - "size-limit": "7.0.8" + "size-limit": "8.1.0" } }, "node_modules/@size-limit/file/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6156,16 +6546,16 @@ } }, "node_modules/@size-limit/preset-small-lib": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-7.0.8.tgz", - "integrity": "sha512-CT8nIYA/c2CSD+X4rAUgwqYccQMahJ6rBnaZxvi3YKFdkXIbuGNXHNjHsYaFksgwG9P4UjG/unyO5L73f3zQBw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-8.1.0.tgz", + "integrity": "sha512-fs0XD0+rN4SVKGUwae7VMX1uDqK+oUYNGlPe7E0oKhwAH6ek08iH8qiEm0q9IKDrsCfZ9/d/pqNpg9di3p1SVw==", "dev": true, "dependencies": { - "@size-limit/esbuild": "7.0.8", - "@size-limit/file": "7.0.8" + "@size-limit/esbuild": "8.1.0", + "@size-limit/file": "8.1.0" }, "peerDependencies": { - "size-limit": "7.0.8" + "size-limit": "8.1.0" } }, "node_modules/@stitches/react": { @@ -16326,6 +16716,19 @@ "node": ">=12" } }, + "node_modules/esbuild-node-externals": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esbuild-node-externals/-/esbuild-node-externals-1.5.0.tgz", + "integrity": "sha512-9394Ne2t2Z243BWeNBRkXEYVMOVbQuzp7XSkASZTOQs0GSXDuno5aH5OmzEXc6GMuln5zJjpkZpgwUPW0uRKgw==", + "dev": true, + "dependencies": { + "find-up": "5.0.0", + "tslib": "2.3.1" + }, + "peerDependencies": { + "esbuild": "0.12 - 0.15" + } + }, "node_modules/esbuild-openbsd-64": { "version": "0.14.36", "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.36.tgz", @@ -27246,9 +27649,9 @@ "optional": true }, "node_modules/nanoid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", - "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -27305,9 +27708,9 @@ } }, "node_modules/nanospinner": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.0.0.tgz", - "integrity": "sha512-14c2r2QQ9xfTmdbqdF51FKCNvww+0ZON9GeEHur+pBdOufoFvxD4CZQRaYWmFrGH3Nuv7PZ/9Q+wsV+hFSp32g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.1.0.tgz", + "integrity": "sha512-yFvNYMig4AthKYfHFl1sLj7B2nkHL4lzdig4osvl9/LdGbXwrdFRoqBS98gsEsOakr0yH+r5NZ/1Y9gdVB8trA==", "dev": true, "dependencies": { "picocolors": "^1.0.0" @@ -34776,25 +35179,34 @@ "dev": true }, "node_modules/size-limit": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-7.0.8.tgz", - "integrity": "sha512-3h76c9E0e/nNhYLSR7IBI/bSoXICeo7EYkYjlyVqNIsu7KvN/PQmMbIXeyd2QKIF8iZKhaiZQoXLkGWbyPDtvQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-8.1.0.tgz", + "integrity": "sha512-bUL+Uyyt/G+a1XzKlI2WKHVDepmXtqMDhF65pdtjccheiQTNjExWW4nFefgbRL2QgNTzRfK6ayFKjO3o4ER4gg==", "dev": true, "dependencies": { "bytes-iec": "^3.1.1", "chokidar": "^3.5.3", "ci-job-number": "^1.2.2", "globby": "^11.1.0", - "lilconfig": "^2.0.4", + "lilconfig": "^2.0.6", "mkdirp": "^1.0.4", - "nanospinner": "^1.0.0", + "nanospinner": "^1.1.0", "picocolors": "^1.0.0" }, "bin": { "size-limit": "bin.js" }, "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + "node": "^14.0.0 || ^16.0.0 || >=18.0.0" + } + }, + "node_modules/size-limit/node_modules/lilconfig": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz", + "integrity": "sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==", + "dev": true, + "engines": { + "node": ">=10" } }, "node_modules/slash": { @@ -37039,9 +37451,9 @@ } }, "node_modules/tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -41554,6 +41966,20 @@ "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true }, + "@esbuild/android-arm": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.10.tgz", + "integrity": "sha512-FNONeQPy/ox+5NBkcSbYJxoXj9GWu8gVGJTVmUyoOCKQFDTrHVKgNSzChdNt0I8Aj/iKcsDf2r9BFwv+FSNUXg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.10.tgz", + "integrity": "sha512-w0Ou3Z83LOYEkwaui2M8VwIp+nLi/NA60lBLMvaJ+vXVMcsARYdEzLNE7RSm4+lSg4zq4d7fAVuzk7PNQ5JFgg==", + "dev": true, + "optional": true + }, "@eslint/eslintrc": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", @@ -44080,28 +44506,200 @@ } }, "@size-limit/esbuild": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-7.0.8.tgz", - "integrity": "sha512-AzCrxJJThDvHrBNoolebYVgXu46c6HuS3fOxoXr3V0YWNM0qz81z5F3j7RruzboZnls8ZgME4WrH6GM5rB9gtA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-8.1.0.tgz", + "integrity": "sha512-Lq+vJAUO13RXbiNF4bZOB07LmzMURkbV8Z6dhAkhTdAVWYLUn0zjfIe3O6IMwhj9dqJ0WtadhKHJvNQKG+po3w==", "dev": true, "requires": { - "esbuild": "^0.14.18", - "nanoid": "^3.2.0" + "esbuild": "^0.15.7", + "nanoid": "^3.3.4" + }, + "dependencies": { + "esbuild": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.10.tgz", + "integrity": "sha512-N7wBhfJ/E5fzn/SpNgX+oW2RLRjwaL8Y0ezqNqhjD6w0H2p0rDuEz2FKZqpqLnO8DCaWumKe8dsC/ljvVSSxng==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.15.10", + "@esbuild/linux-loong64": "0.15.10", + "esbuild-android-64": "0.15.10", + "esbuild-android-arm64": "0.15.10", + "esbuild-darwin-64": "0.15.10", + "esbuild-darwin-arm64": "0.15.10", + "esbuild-freebsd-64": "0.15.10", + "esbuild-freebsd-arm64": "0.15.10", + "esbuild-linux-32": "0.15.10", + "esbuild-linux-64": "0.15.10", + "esbuild-linux-arm": "0.15.10", + "esbuild-linux-arm64": "0.15.10", + "esbuild-linux-mips64le": "0.15.10", + "esbuild-linux-ppc64le": "0.15.10", + "esbuild-linux-riscv64": "0.15.10", + "esbuild-linux-s390x": "0.15.10", + "esbuild-netbsd-64": "0.15.10", + "esbuild-openbsd-64": "0.15.10", + "esbuild-sunos-64": "0.15.10", + "esbuild-windows-32": "0.15.10", + "esbuild-windows-64": "0.15.10", + "esbuild-windows-arm64": "0.15.10" + } + }, + "esbuild-android-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.10.tgz", + "integrity": "sha512-UI7krF8OYO1N7JYTgLT9ML5j4+45ra3amLZKx7LO3lmLt1Ibn8t3aZbX5Pu4BjWiqDuJ3m/hsvhPhK/5Y/YpnA==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.10.tgz", + "integrity": "sha512-EOt55D6xBk5O05AK8brXUbZmoFj4chM8u3riGflLa6ziEoVvNjRdD7Cnp82NHQGfSHgYR06XsPI8/sMuA/cUwg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.10.tgz", + "integrity": "sha512-hbDJugTicqIm+WKZgp208d7FcXcaK8j2c0l+fqSJ3d2AzQAfjEYDRM3Z2oMeqSJ9uFxyj/muSACLdix7oTstRA==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.10.tgz", + "integrity": "sha512-M1t5+Kj4IgSbYmunf2BB6EKLkWUq+XlqaFRiGOk8bmBapu9bCDrxjf4kUnWn59Dka3I27EiuHBKd1rSO4osLFQ==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.10.tgz", + "integrity": "sha512-KMBFMa7C8oc97nqDdoZwtDBX7gfpolkk6Bcmj6YFMrtCMVgoU/x2DI1p74DmYl7CSS6Ppa3xgemrLrr5IjIn0w==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.10.tgz", + "integrity": "sha512-m2KNbuCX13yQqLlbSojFMHpewbn8wW5uDS6DxRpmaZKzyq8Dbsku6hHvh2U+BcLwWY4mpgXzFUoENEf7IcioGg==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.10.tgz", + "integrity": "sha512-guXrwSYFAvNkuQ39FNeV4sNkNms1bLlA5vF1H0cazZBOLdLFIny6BhT+TUbK/hdByMQhtWQ5jI9VAmPKbVPu1w==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.10.tgz", + "integrity": "sha512-jd8XfaSJeucMpD63YNMO1JCrdJhckHWcMv6O233bL4l6ogQKQOxBYSRP/XLWP+6kVTu0obXovuckJDcA0DKtQA==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.10.tgz", + "integrity": "sha512-6N8vThLL/Lysy9y4Ex8XoLQAlbZKUyExCWyayGi2KgTBelKpPgj6RZnUaKri0dHNPGgReJriKVU6+KDGQwn10A==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.10.tgz", + "integrity": "sha512-GByBi4fgkvZFTHFDYNftu1DQ1GzR23jws0oWyCfhnI7eMOe+wgwWrc78dbNk709Ivdr/evefm2PJiUBMiusS1A==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.10.tgz", + "integrity": "sha512-BxP+LbaGVGIdQNJUNF7qpYjEGWb0YyHVSKqYKrn+pTwH/SiHUxFyJYSP3pqkku61olQiSBnSmWZ+YUpj78Tw7Q==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.10.tgz", + "integrity": "sha512-LoSQCd6498PmninNgqd/BR7z3Bsk/mabImBWuQ4wQgmQEeanzWd5BQU2aNi9mBURCLgyheuZS6Xhrw5luw3OkQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.10.tgz", + "integrity": "sha512-Lrl9Cr2YROvPV4wmZ1/g48httE8z/5SCiXIyebiB5N8VT7pX3t6meI7TQVHw/wQpqP/AF4SksDuFImPTM7Z32Q==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.10.tgz", + "integrity": "sha512-ReP+6q3eLVVP2lpRrvl5EodKX7EZ1bS1/z5j6hsluAlZP5aHhk6ghT6Cq3IANvvDdscMMCB4QEbI+AjtvoOFpA==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.10.tgz", + "integrity": "sha512-iGDYtJCMCqldMskQ4eIV+QSS/CuT7xyy9i2/FjpKvxAuCzrESZXiA1L64YNj6/afuzfBe9i8m/uDkFHy257hTw==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.10.tgz", + "integrity": "sha512-ftMMIwHWrnrYnvuJQRJs/Smlcb28F9ICGde/P3FUTCgDDM0N7WA0o9uOR38f5Xe2/OhNCgkjNeb7QeaE3cyWkQ==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.10.tgz", + "integrity": "sha512-mf7hBL9Uo2gcy2r3rUFMjVpTaGpFJJE5QTDDqUFf1632FxteYANffDZmKbqX0PfeQ2XjUDE604IcE7OJeoHiyg==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.10.tgz", + "integrity": "sha512-ttFVo+Cg8b5+qHmZHbEc8Vl17kCleHhLzgT8X04y8zudEApo0PxPg9Mz8Z2cKH1bCYlve1XL8LkyXGFjtUYeGg==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.10.tgz", + "integrity": "sha512-2H0gdsyHi5x+8lbng3hLbxDWR7mKHWh5BXZGKVG830KUmXOOWFE2YKJ4tHRkejRduOGDrBvHBriYsGtmTv3ntA==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.15.10", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.10.tgz", + "integrity": "sha512-S+th4F+F8VLsHLR0zrUcG+Et4hx0RKgK1eyHc08kztmLOES8BWwMiaGdoW9hiXuzznXQ0I/Fg904MNbr11Nktw==", + "dev": true, + "optional": true + } } }, "@size-limit/file": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-7.0.8.tgz", - "integrity": "sha512-1KeFQuMXIXAH/iELqIX7x+YNYDFvzIvmxcp9PrdwEoSNL0dXdaDIo9WE/yz8xvOmUcKaLfqbWkL75DM0k91WHQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-8.1.0.tgz", + "integrity": "sha512-Ur+NgJSRHBnbQBrD8X2doxXYdBcVJsMxe2KfWrUmnZ6wYz09YKhQ1iYLqNztjf2yf/JEp00zp1vyhmimUQfUHQ==", "dev": true, "requires": { - "semver": "7.3.5" + "semver": "7.3.7" }, "dependencies": { "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -44110,13 +44708,13 @@ } }, "@size-limit/preset-small-lib": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-7.0.8.tgz", - "integrity": "sha512-CT8nIYA/c2CSD+X4rAUgwqYccQMahJ6rBnaZxvi3YKFdkXIbuGNXHNjHsYaFksgwG9P4UjG/unyO5L73f3zQBw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-8.1.0.tgz", + "integrity": "sha512-fs0XD0+rN4SVKGUwae7VMX1uDqK+oUYNGlPe7E0oKhwAH6ek08iH8qiEm0q9IKDrsCfZ9/d/pqNpg9di3p1SVw==", "dev": true, "requires": { - "@size-limit/esbuild": "7.0.8", - "@size-limit/file": "7.0.8" + "@size-limit/esbuild": "8.1.0", + "@size-limit/file": "8.1.0" } }, "@stitches/react": { @@ -52017,6 +52615,16 @@ "dev": true, "optional": true }, + "esbuild-node-externals": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esbuild-node-externals/-/esbuild-node-externals-1.5.0.tgz", + "integrity": "sha512-9394Ne2t2Z243BWeNBRkXEYVMOVbQuzp7XSkASZTOQs0GSXDuno5aH5OmzEXc6GMuln5zJjpkZpgwUPW0uRKgw==", + "dev": true, + "requires": { + "find-up": "5.0.0", + "tslib": "2.3.1" + } + }, "esbuild-openbsd-64": { "version": "0.14.36", "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.36.tgz", @@ -60491,9 +61099,9 @@ "optional": true }, "nanoid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", - "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", "dev": true }, "nanomatch": { @@ -60537,9 +61145,9 @@ } }, "nanospinner": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.0.0.tgz", - "integrity": "sha512-14c2r2QQ9xfTmdbqdF51FKCNvww+0ZON9GeEHur+pBdOufoFvxD4CZQRaYWmFrGH3Nuv7PZ/9Q+wsV+hFSp32g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.1.0.tgz", + "integrity": "sha512-yFvNYMig4AthKYfHFl1sLj7B2nkHL4lzdig4osvl9/LdGbXwrdFRoqBS98gsEsOakr0yH+r5NZ/1Y9gdVB8trA==", "dev": true, "requires": { "picocolors": "^1.0.0" @@ -66183,19 +66791,27 @@ "dev": true }, "size-limit": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-7.0.8.tgz", - "integrity": "sha512-3h76c9E0e/nNhYLSR7IBI/bSoXICeo7EYkYjlyVqNIsu7KvN/PQmMbIXeyd2QKIF8iZKhaiZQoXLkGWbyPDtvQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-8.1.0.tgz", + "integrity": "sha512-bUL+Uyyt/G+a1XzKlI2WKHVDepmXtqMDhF65pdtjccheiQTNjExWW4nFefgbRL2QgNTzRfK6ayFKjO3o4ER4gg==", "dev": true, "requires": { "bytes-iec": "^3.1.1", "chokidar": "^3.5.3", "ci-job-number": "^1.2.2", "globby": "^11.1.0", - "lilconfig": "^2.0.4", + "lilconfig": "^2.0.6", "mkdirp": "^1.0.4", - "nanospinner": "^1.0.0", + "nanospinner": "^1.1.0", "picocolors": "^1.0.0" + }, + "dependencies": { + "lilconfig": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.6.tgz", + "integrity": "sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==", + "dev": true + } } }, "slash": { @@ -67964,9 +68580,9 @@ } }, "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "tsutils": { "version": "3.21.0", diff --git a/package.json b/package.json index 29184487..d2aff117 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,12 @@ }, "scripts": { "clean": "rimraf dist", - "build": "npm run clean && node build.js && tsc --project tsconfig.build.json", + "build": "npm run clean && node build.mjs && tsc --project tsconfig.build.json", "lint": "tsc --noEmit && eslint './src/**/*.{ts,tsx}'", "test": "jest", "coverage": "npx live-server coverage/lcov-report", "commit": "cz", "size": "size-limit", - "analyze": "size-limit --why", "generate": "plop --plopfile ./generators/plopfile.js", "storybook": "start-storybook -p 6006 -h 0.0.0.0", "build-storybook": "build-storybook", @@ -50,7 +49,7 @@ "size-limit": [ { "path": "dist/index.cjs.js", - "limit": "90 KB" + "limit": "900 KB" }, { "path": "dist/index.esm.js", @@ -89,7 +88,7 @@ "@faker-js/faker": "^6.1.2", "@fontsource/dosis": "^4.5.7", "@fontsource/inter": "^4.5.7", - "@size-limit/preset-small-lib": "^7.0.8", + "@size-limit/preset-small-lib": "^8.1.0", "@storybook/addon-docs": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/react": "^6.5.12", @@ -110,6 +109,7 @@ "danger": "^11.0.2", "danger-plugin-spellcheck": "^2.1.0", "esbuild": "^0.14.36", + "esbuild-node-externals": "^1.5.0", "eslint": "^7.29.0", "eslint-config-prettier": "^8.1.0", "eslint-import-resolver-typescript": "^2.4.0", @@ -137,7 +137,7 @@ "react-virtual": "^2.10.4", "resize-observer-polyfill": "^1.5.1", "semantic-release": "^19.0.3", - "size-limit": "^7.0.8", + "size-limit": "^8.1.0", "story-description-loader": "^1.0.0", "storybook-dark-mode": "^1.1.2", "ts-jest": "^27.1.4", diff --git a/src/components/Accordion/Accordion.test.tsx b/src/components/Accordion/Accordion.test.tsx index 31bbdcfa..28995466 100644 --- a/src/components/Accordion/Accordion.test.tsx +++ b/src/components/Accordion/Accordion.test.tsx @@ -1,7 +1,7 @@ import { composeStories } from '@storybook/testing-react' import userEvent from '@testing-library/user-event' import React from 'react' -import { renderDark, renderLight, screen, waitFor } from 'test-utils' +import { renderDark, renderLight, screen, waitFor } from '../../test' import * as stories from './Accordion.stories' const { Default, Multiple, OneOpen } = composeStories(stories) diff --git a/src/components/Alert/Alert.test.tsx b/src/components/Alert/Alert.test.tsx index ff7c0bad..37db3ad7 100644 --- a/src/components/Alert/Alert.test.tsx +++ b/src/components/Alert/Alert.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Alert.stories' it('renders light without error', () => { diff --git a/src/components/AppBar/AppBar.test.tsx b/src/components/AppBar/AppBar.test.tsx index f36c5424..d051897c 100644 --- a/src/components/AppBar/AppBar.test.tsx +++ b/src/components/AppBar/AppBar.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './AppBar.stories' it('renders light without error', () => { diff --git a/src/components/AspectRatio/AspectRatio.test.tsx b/src/components/AspectRatio/AspectRatio.test.tsx index 3cd005d3..8cd930ef 100644 --- a/src/components/AspectRatio/AspectRatio.test.tsx +++ b/src/components/AspectRatio/AspectRatio.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './AspectRatio.stories' it('renders light without error', () => { diff --git a/src/components/Avatar/Avatar.stories.tsx b/src/components/Avatar/Avatar.stories.tsx index 2df7b17e..6b009a26 100644 --- a/src/components/Avatar/Avatar.stories.tsx +++ b/src/components/Avatar/Avatar.stories.tsx @@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react' import React from 'react' import { Avatar } from '.' import { Flex } from '../' -import { randomColor } from '../../utils' +import { randomColor } from '../../docs/util' export default { title: 'Components/Avatar', diff --git a/src/components/Avatar/Avatar.test.tsx b/src/components/Avatar/Avatar.test.tsx index b7b337b1..d889555c 100644 --- a/src/components/Avatar/Avatar.test.tsx +++ b/src/components/Avatar/Avatar.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Avatar.stories' it('renders light without error', () => { diff --git a/src/components/Backdrop/Backdrop.test.tsx b/src/components/Backdrop/Backdrop.test.tsx index c05369ea..019fc868 100644 --- a/src/components/Backdrop/Backdrop.test.tsx +++ b/src/components/Backdrop/Backdrop.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Backdrop.stories' it('renders light without error', () => { diff --git a/src/components/Badge/Badge.test.tsx b/src/components/Badge/Badge.test.tsx index e29ffefb..4842a11a 100644 --- a/src/components/Badge/Badge.test.tsx +++ b/src/components/Badge/Badge.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Badge.stories' it('renders light without error', () => { diff --git a/src/components/Box/Box.test.tsx b/src/components/Box/Box.test.tsx index ea9ae7de..45d59b6a 100644 --- a/src/components/Box/Box.test.tsx +++ b/src/components/Box/Box.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Primary } from './Box.stories' it('renders light without error', () => { diff --git a/src/components/Button/Button.test.tsx b/src/components/Button/Button.test.tsx index 080b8c0c..45f047f7 100644 --- a/src/components/Button/Button.test.tsx +++ b/src/components/Button/Button.test.tsx @@ -1,6 +1,6 @@ import { composeStories } from '@storybook/testing-react' import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' +import { renderDark, renderLight, screen, userEvent } from '../../test' import * as stories from './Button.stories' const { Default, Disabled, All } = composeStories(stories) diff --git a/src/components/Card/Card.test.tsx b/src/components/Card/Card.test.tsx index d1df7e64..b542520d 100644 --- a/src/components/Card/Card.test.tsx +++ b/src/components/Card/Card.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Actions, Default } from './Card.stories' it('renders light without error', () => { diff --git a/src/components/Checkbox/Checkbox.test.tsx b/src/components/Checkbox/Checkbox.test.tsx index cf63ff0a..98f711a1 100644 --- a/src/components/Checkbox/Checkbox.test.tsx +++ b/src/components/Checkbox/Checkbox.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Checkbox.stories' it('renders light without error', () => { diff --git a/src/components/Chip/Chip.test.tsx b/src/components/Chip/Chip.test.tsx index 8af66e98..d0579312 100644 --- a/src/components/Chip/Chip.test.tsx +++ b/src/components/Chip/Chip.test.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' import { Chip } from '.' +import { renderDark, renderLight, screen, userEvent } from '../../test' import { All, Default } from './Chip.stories' it('renders light without error', () => { diff --git a/src/components/ComponentsProvider/ComponentsProvider.test.tsx b/src/components/ComponentsProvider/ComponentsProvider.test.tsx index 1dfd1984..6e0e963f 100644 --- a/src/components/ComponentsProvider/ComponentsProvider.test.tsx +++ b/src/components/ComponentsProvider/ComponentsProvider.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './ComponentsProvider.stories' it('renders light without error', () => { diff --git a/src/components/ConfirmDialog/ConfirmDialog.test.tsx b/src/components/ConfirmDialog/ConfirmDialog.test.tsx index 67d02538..5056d8f9 100644 --- a/src/components/ConfirmDialog/ConfirmDialog.test.tsx +++ b/src/components/ConfirmDialog/ConfirmDialog.test.tsx @@ -1,11 +1,11 @@ import React from 'react' -import { act, renderDark, renderLight, screen, userEvent } from 'test-utils' import { ConfirmDialog, ConfirmDialogActions, ConfirmDialogContent, ConfirmDialogTrigger, } from '.' +import { act, renderDark, renderLight, screen, userEvent } from '../../test' import { Button } from '../Button' import { Default } from './ConfirmDialog.stories' diff --git a/src/components/Container/Container.test.tsx b/src/components/Container/Container.test.tsx index 3a283871..929ad2af 100644 --- a/src/components/Container/Container.test.tsx +++ b/src/components/Container/Container.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Container.stories' it('renders light without error', () => { diff --git a/src/components/ContextMenu/ContextMenu.test.tsx b/src/components/ContextMenu/ContextMenu.test.tsx index f5432037..cbd5f661 100644 --- a/src/components/ContextMenu/ContextMenu.test.tsx +++ b/src/components/ContextMenu/ContextMenu.test.tsx @@ -8,7 +8,7 @@ import { renderLight, screen, userEvent, -} from 'test-utils' +} from '../../test' import * as stories from './ContextMenu.stories' const { Default, Nested, Destructive } = composeStories(stories) diff --git a/src/components/Dialog/Dialog.test.tsx b/src/components/Dialog/Dialog.test.tsx index 60c93485..15985789 100644 --- a/src/components/Dialog/Dialog.test.tsx +++ b/src/components/Dialog/Dialog.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Dialog.stories' it('renders light without error', () => { diff --git a/src/components/Divider/Divider.test.tsx b/src/components/Divider/Divider.test.tsx index 0943dc46..488e3c87 100644 --- a/src/components/Divider/Divider.test.tsx +++ b/src/components/Divider/Divider.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight, screen } from 'test-utils' +import { renderDark, renderLight, screen } from '../../test' import { AsHr, Decorative, Default } from './Divider.stories' it('renders light without error', () => { diff --git a/src/components/Drawer/Drawer.test.tsx b/src/components/Drawer/Drawer.test.tsx index 1ae7b09f..4192dc8e 100644 --- a/src/components/Drawer/Drawer.test.tsx +++ b/src/components/Drawer/Drawer.test.tsx @@ -6,7 +6,7 @@ import { screen, userEvent, waitForElementToBeRemoved, -} from 'test-utils' +} from '../../test' import { Controllable, Default } from './Drawer.stories' const defaultDrawerText = 'This is a Drawer' diff --git a/src/components/Flex/Flex.test.tsx b/src/components/Flex/Flex.test.tsx index 08b95934..315414fb 100644 --- a/src/components/Flex/Flex.test.tsx +++ b/src/components/Flex/Flex.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Flex.stories' it('renders light without error', () => { diff --git a/src/components/Form/Form.test.tsx b/src/components/Form/Form.test.tsx index cdf3872a..cb60e646 100644 --- a/src/components/Form/Form.test.tsx +++ b/src/components/Form/Form.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Form.stories' it('renders light without error', () => { diff --git a/src/components/FormControl/FormControl.test.tsx b/src/components/FormControl/FormControl.test.tsx index 9af4b7a7..40267dcf 100644 --- a/src/components/FormControl/FormControl.test.tsx +++ b/src/components/FormControl/FormControl.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './FormControl.stories' it('renders light without error', () => { diff --git a/src/components/Grid/Grid.stories.tsx b/src/components/Grid/Grid.stories.tsx index dedfcb7b..a9eb0410 100644 --- a/src/components/Grid/Grid.stories.tsx +++ b/src/components/Grid/Grid.stories.tsx @@ -1,8 +1,8 @@ import { Meta, Story } from '@storybook/react' import React from 'react' import { Grid } from '.' +import { GridBox } from '../../docs/util/story-utils' import type { CSS } from '../../stitches.config' -import { GridBox } from '../../utils/story-utils' import { Inline } from '../Inline' export default { diff --git a/src/components/Grid/Grid.test.tsx b/src/components/Grid/Grid.test.tsx index e5387e5e..c6f4c2d3 100644 --- a/src/components/Grid/Grid.test.tsx +++ b/src/components/Grid/Grid.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Grid.stories' it('renders light without error', () => { diff --git a/src/components/Heading/Heading.test.tsx b/src/components/Heading/Heading.test.tsx index 7aa77e88..82bda66d 100644 --- a/src/components/Heading/Heading.test.tsx +++ b/src/components/Heading/Heading.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default, Variants } from './Heading.stories' it('renders light without error', () => { diff --git a/src/components/Hidden/Hidden.test.tsx b/src/components/Hidden/Hidden.test.tsx index d4d62159..8ee267bd 100644 --- a/src/components/Hidden/Hidden.test.tsx +++ b/src/components/Hidden/Hidden.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Hidden.stories' it('renders light without error', () => { diff --git a/src/components/HoverCard/HoverCard.test.tsx b/src/components/HoverCard/HoverCard.test.tsx index c0d288a8..7d49b97c 100644 --- a/src/components/HoverCard/HoverCard.test.tsx +++ b/src/components/HoverCard/HoverCard.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Card, CardBody, CardHeading, CardLeadIn } from '../Card' import { Link } from '../Link' import { Text } from '../Text' diff --git a/src/components/IconButton/IconButton.test.tsx b/src/components/IconButton/IconButton.test.tsx index 10a1c2b5..d986df80 100644 --- a/src/components/IconButton/IconButton.test.tsx +++ b/src/components/IconButton/IconButton.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './IconButton.stories' it('renders light without error', () => { diff --git a/src/components/Image/Image.test.tsx b/src/components/Image/Image.test.tsx index 5c39959f..96204283 100644 --- a/src/components/Image/Image.test.tsx +++ b/src/components/Image/Image.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Image.stories' it('renders light without error', () => { diff --git a/src/components/Inline/Inline.stories.tsx b/src/components/Inline/Inline.stories.tsx index faa6338a..b1fb2200 100644 --- a/src/components/Inline/Inline.stories.tsx +++ b/src/components/Inline/Inline.stories.tsx @@ -1,8 +1,8 @@ import { Meta, Story } from '@storybook/react' import React, { ComponentProps } from 'react' import { Inline } from '.' +import { ExampleComponent } from '../../docs/util/story-utils' import { CSS } from '../../stitches.config' -import { ExampleComponent } from '../../utils/story-utils' export default { title: 'Components/Inline', diff --git a/src/components/Inline/Inline.test.tsx b/src/components/Inline/Inline.test.tsx index f528f078..fd99da70 100644 --- a/src/components/Inline/Inline.test.tsx +++ b/src/components/Inline/Inline.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Inline.stories' it('renders light without error', () => { diff --git a/src/components/Input/Input.test.tsx b/src/components/Input/Input.test.tsx index dfaecd7e..5806f1b6 100644 --- a/src/components/Input/Input.test.tsx +++ b/src/components/Input/Input.test.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' import { Input } from '.' +import { renderDark, renderLight, screen, userEvent } from '../../test' import { Default } from './Input.stories' it('renders light without error', () => { diff --git a/src/components/Label/Label.test.tsx b/src/components/Label/Label.test.tsx index 7811c907..d89ba1be 100644 --- a/src/components/Label/Label.test.tsx +++ b/src/components/Label/Label.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Label.stories' it('renders light without error', () => { diff --git a/src/components/Link/Link.test.tsx b/src/components/Link/Link.test.tsx index 2d8b2bf2..32c98059 100644 --- a/src/components/Link/Link.test.tsx +++ b/src/components/Link/Link.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Link.stories' it('renders light without error', () => { diff --git a/src/components/List/List.test.tsx b/src/components/List/List.test.tsx index b9f02fc4..9a5384ea 100644 --- a/src/components/List/List.test.tsx +++ b/src/components/List/List.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './List.stories' it('renders light without error', () => { diff --git a/src/components/Logo/Logo.test.tsx b/src/components/Logo/Logo.test.tsx index b6f84122..0b85d2d0 100644 --- a/src/components/Logo/Logo.test.tsx +++ b/src/components/Logo/Logo.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Logo.stories' it('renders light without error', () => { diff --git a/src/components/Menu/Menu.test.tsx b/src/components/Menu/Menu.test.tsx index 75fb4c8b..7c4c34c0 100644 --- a/src/components/Menu/Menu.test.tsx +++ b/src/components/Menu/Menu.test.tsx @@ -1,6 +1,6 @@ import { composeStories } from '@storybook/testing-react' import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' +import { renderDark, renderLight, screen, userEvent } from '../../test' import * as stories from './Menu.stories' const { Default, Nested, Destructive } = composeStories(stories) diff --git a/src/components/NavigationMenu/NavigationMenu.test.tsx b/src/components/NavigationMenu/NavigationMenu.test.tsx index 64ed3450..584dfbc0 100644 --- a/src/components/NavigationMenu/NavigationMenu.test.tsx +++ b/src/components/NavigationMenu/NavigationMenu.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { AlternativeContent, Default, Wrapped } from './NavigationMenu.stories' it('renders light without error', () => { diff --git a/src/components/Overlay/Overlay.test.tsx b/src/components/Overlay/Overlay.test.tsx index c02ebb67..6324de98 100644 --- a/src/components/Overlay/Overlay.test.tsx +++ b/src/components/Overlay/Overlay.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Overlay.stories' it('renders light without error', () => { diff --git a/src/components/Pagination/Pagination.test.tsx b/src/components/Pagination/Pagination.test.tsx index 13b5cd9a..4ba044b5 100644 --- a/src/components/Pagination/Pagination.test.tsx +++ b/src/components/Pagination/Pagination.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Pagination.stories' it('renders light without error', () => { diff --git a/src/components/Paper/Paper.test.tsx b/src/components/Paper/Paper.test.tsx index b26233c7..7141d0d9 100644 --- a/src/components/Paper/Paper.test.tsx +++ b/src/components/Paper/Paper.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Paper.stories' it('renders light without error', () => { diff --git a/src/components/Popover/Popover.test.tsx b/src/components/Popover/Popover.test.tsx index b5928bd1..3f9ed76b 100644 --- a/src/components/Popover/Popover.test.tsx +++ b/src/components/Popover/Popover.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Popover.stories' it('renders light without error', () => { diff --git a/src/components/Progress/Progress.test.tsx b/src/components/Progress/Progress.test.tsx index a10a58e9..ccc1cc2c 100644 --- a/src/components/Progress/Progress.test.tsx +++ b/src/components/Progress/Progress.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Progress.stories' it('renders light without error', () => { diff --git a/src/components/RadioGroup/RadioGroup.test.tsx b/src/components/RadioGroup/RadioGroup.test.tsx index e5c4ed96..d9bd19e8 100644 --- a/src/components/RadioGroup/RadioGroup.test.tsx +++ b/src/components/RadioGroup/RadioGroup.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './RadioGroup.stories' it('renders light without error', () => { diff --git a/src/components/Select/Select.test.tsx b/src/components/Select/Select.test.tsx index 3c2aae14..e9f789ee 100644 --- a/src/components/Select/Select.test.tsx +++ b/src/components/Select/Select.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Select.stories' it('renders light without error', () => { diff --git a/src/components/Skeleton/Skeleton.test.tsx b/src/components/Skeleton/Skeleton.test.tsx index d8aed4c2..a695bb3c 100644 --- a/src/components/Skeleton/Skeleton.test.tsx +++ b/src/components/Skeleton/Skeleton.test.tsx @@ -1,6 +1,6 @@ import { composeStories } from '@storybook/testing-react' import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import * as stories from './Skeleton.stories' const { Primary, Avatar, Buttons } = composeStories(stories) diff --git a/src/components/Slider/Slider.test.tsx b/src/components/Slider/Slider.test.tsx index f2a734ad..360bcfa4 100644 --- a/src/components/Slider/Slider.test.tsx +++ b/src/components/Slider/Slider.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Slider.stories' it('renders light without error', () => { diff --git a/src/components/Spinner/Spinner.test.tsx b/src/components/Spinner/Spinner.test.tsx index d63f65a8..573fd53c 100644 --- a/src/components/Spinner/Spinner.test.tsx +++ b/src/components/Spinner/Spinner.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Spinner.stories' it('renders light without error', () => { diff --git a/src/components/Stack/Stack.stories.tsx b/src/components/Stack/Stack.stories.tsx index 80187298..ab3b7792 100644 --- a/src/components/Stack/Stack.stories.tsx +++ b/src/components/Stack/Stack.stories.tsx @@ -1,8 +1,8 @@ import { Meta, Story } from '@storybook/react' import React, { ComponentProps } from 'react' import { Stack } from '.' +import { ExampleComponent } from '../../docs/util/story-utils' import { CSS } from '../../stitches.config' -import { ExampleComponent } from '../../utils/story-utils' export default { title: 'Components/Stack', diff --git a/src/components/Stack/Stack.test.tsx b/src/components/Stack/Stack.test.tsx index fc5ccd3f..05b10757 100644 --- a/src/components/Stack/Stack.test.tsx +++ b/src/components/Stack/Stack.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Stack.stories' it('renders light without error', () => { diff --git a/src/components/Subheading/Subheading.test.tsx b/src/components/Subheading/Subheading.test.tsx index 99f0bd14..0e0b92c1 100644 --- a/src/components/Subheading/Subheading.test.tsx +++ b/src/components/Subheading/Subheading.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default, Variants } from './Subheading.stories' it('renders light without error', () => { diff --git a/src/components/Svg/Svg.test.tsx b/src/components/Svg/Svg.test.tsx index 76c99cc0..f3faf635 100644 --- a/src/components/Svg/Svg.test.tsx +++ b/src/components/Svg/Svg.test.tsx @@ -1,5 +1,5 @@ import { Args, ReactFramework, StoryContext } from '@storybook/react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Svg.stories' it('renders light without error', () => { diff --git a/src/components/Switch/Switch.test.tsx b/src/components/Switch/Switch.test.tsx index 3000154c..5cd42bff 100644 --- a/src/components/Switch/Switch.test.tsx +++ b/src/components/Switch/Switch.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' +import { renderDark, renderLight, screen, userEvent } from '../../test' import { Default as Switch, States } from './Switch.stories' it('renders light without error', () => { diff --git a/src/components/Table/Table.test.tsx b/src/components/Table/Table.test.tsx index b4b2d358..5b63936a 100644 --- a/src/components/Table/Table.test.tsx +++ b/src/components/Table/Table.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default, Sticky, Striped, UtilityClasses } from './Table.stories' it('renders light without error', () => { diff --git a/src/components/Tabs/Tabs.test.tsx b/src/components/Tabs/Tabs.test.tsx index 0698793d..1a8ea4ce 100644 --- a/src/components/Tabs/Tabs.test.tsx +++ b/src/components/Tabs/Tabs.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' +import { renderDark, renderLight, screen, userEvent } from '../../test' import { Default } from './Tabs.stories' it('renders light without error', () => { diff --git a/src/components/Text/Text.test.tsx b/src/components/Text/Text.test.tsx index 58f021aa..3bf1a87a 100644 --- a/src/components/Text/Text.test.tsx +++ b/src/components/Text/Text.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Caption, Monospace, Span, Strike } from './' import { Default } from './Text.stories' diff --git a/src/components/TextArea/TextArea.test.tsx b/src/components/TextArea/TextArea.test.tsx index 4db9dda8..9e14d7a8 100644 --- a/src/components/TextArea/TextArea.test.tsx +++ b/src/components/TextArea/TextArea.test.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { renderDark, renderLight, screen, userEvent } from 'test-utils' import { TextArea } from '.' +import { renderDark, renderLight, screen, userEvent } from '../../test' import { Default } from './TextArea.stories' it('renders light without error', () => { diff --git a/src/components/ThemeProvider/ThemeProvider.test.tsx b/src/components/ThemeProvider/ThemeProvider.test.tsx index cd098d9e..449db20c 100644 --- a/src/components/ThemeProvider/ThemeProvider.test.tsx +++ b/src/components/ThemeProvider/ThemeProvider.test.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { act, renderDark, renderLight, renderPlain, screen } from 'test-utils' import { ThemeProvider } from '.' +import { act, renderDark, renderLight, renderPlain, screen } from '../../test' import { UtilityUseThemeController, UtilityUseThemeResolve, diff --git a/src/components/ThemeSwitch/ThemeSwitch.test.tsx b/src/components/ThemeSwitch/ThemeSwitch.test.tsx index 2da25c7a..ef068807 100644 --- a/src/components/ThemeSwitch/ThemeSwitch.test.tsx +++ b/src/components/ThemeSwitch/ThemeSwitch.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './ThemeSwitch.stories' it('renders light without error', () => { diff --git a/src/components/Toast/Toast.test.tsx b/src/components/Toast/Toast.test.tsx index c64c9081..a5a9d728 100644 --- a/src/components/Toast/Toast.test.tsx +++ b/src/components/Toast/Toast.test.tsx @@ -6,7 +6,7 @@ import { screen, userEvent, waitForElementToBeRemoved, -} from 'test-utils' +} from '../../test' import * as stories from './Toast.stories' const { Default, WithClose, WithAction } = composeStories(stories) diff --git a/src/components/Toggle/Toogle.test.tsx b/src/components/Toggle/Toogle.test.tsx index a71422ff..3036936b 100644 --- a/src/components/Toggle/Toogle.test.tsx +++ b/src/components/Toggle/Toogle.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Toggle.stories' it('renders light without error', () => { diff --git a/src/components/ToggleGroup/ToogleGroup.test.tsx b/src/components/ToggleGroup/ToogleGroup.test.tsx index 8902afae..c8c273f0 100644 --- a/src/components/ToggleGroup/ToogleGroup.test.tsx +++ b/src/components/ToggleGroup/ToogleGroup.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { MultipleSelections } from './ToggleGroup.stories' it('renders light without error', () => { diff --git a/src/components/Tooltip/Tooltip.test.tsx b/src/components/Tooltip/Tooltip.test.tsx index bc90a834..99a300d6 100644 --- a/src/components/Tooltip/Tooltip.test.tsx +++ b/src/components/Tooltip/Tooltip.test.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { renderDark, renderLight } from 'test-utils' +import { renderDark, renderLight } from '../../test' import { Default } from './Tooltip.stories' it('renders light without error', () => { diff --git a/src/docs/util/randomColor.ts b/src/docs/util/randomColor.ts index 3b7bbc21..1b4555c1 100644 --- a/src/docs/util/randomColor.ts +++ b/src/docs/util/randomColor.ts @@ -1,8 +1,8 @@ import { CSS } from '../../' -const keys = ['primary', 'info', 'success', 'error', 'warning'] - -export const randomColor = (): CSS['backgroundColor'] => { +const keys = ['brandYellow', 'brandGrey', 'info', 'success', 'error', 'warning'] +type Depth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 +export const randomColor = (depth: Depth = 5): CSS['color'] => { const color = keys[Math.floor(Math.random() * keys.length)] - return `$${color}6` + return `$${color}${depth}` } diff --git a/src/utils/story-utils.tsx b/src/docs/util/story-utils.tsx similarity index 70% rename from src/utils/story-utils.tsx rename to src/docs/util/story-utils.tsx index 975d85c5..b291f958 100644 --- a/src/utils/story-utils.tsx +++ b/src/docs/util/story-utils.tsx @@ -1,10 +1,17 @@ import React from 'react' -import { Box } from '../components/Box' -import { CSS } from '../stitches.config' -import { randomColor } from './' +import { Box } from '../../components/Box' +import { CSS } from '../../stitches.config' const border = '1px solid $grey3' +const keys = ['brandYellow', 'brandGrey', 'info', 'success', 'error', 'warning'] +type Depth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 + +export const randomColor = (depth: Depth = 5): CSS['color'] => { + const color = keys[Math.floor(Math.random() * keys.length)] + return `$${color}${depth}` +} + type BoxProps = React.ComponentProps type ExampleComponentProps = Omit & { css?: CSS diff --git a/src/utils/domrect-polyfill.ts b/src/test/domrect-polyfill.ts similarity index 100% rename from src/utils/domrect-polyfill.ts rename to src/test/domrect-polyfill.ts diff --git a/src/test/index.ts b/src/test/index.ts new file mode 100644 index 00000000..1bb4f15d --- /dev/null +++ b/src/test/index.ts @@ -0,0 +1 @@ +export * from './test-utils' diff --git a/src/utils/test-utils.tsx b/src/test/test-utils.tsx similarity index 100% rename from src/utils/test-utils.tsx rename to src/test/test-utils.tsx diff --git a/src/utils/index.ts b/src/utils/index.ts index 3b093172..adb6113e 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,9 +1 @@ export * from './ConditionalWrapper' -import type { CSS } from '../stitches.config' - -const keys = ['brandYellow', 'brandGrey', 'info', 'success', 'error', 'warning'] -type Depth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 -export const randomColor = (depth: Depth = 5): CSS['color'] => { - const color = keys[Math.floor(Math.random() * keys.length)] - return `$${color}${depth}` -} diff --git a/tsconfig.build.json b/tsconfig.build.json index d7512c9f..5ff5e610 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -7,8 +7,7 @@ "exclude": [ "**/*.test.tsx", "**/*.stories.tsx", - "**/docs/**/*.ts", - "**/docs/**/*.tsx", - "**/test-utils.tsx" + "src/docs/**/*", + "src/test/**/*" ] }