From d4a574c30f01585cc9268fc221ca2980aacb7b48 Mon Sep 17 00:00:00 2001 From: Nathan Vasse Date: Thu, 4 May 2023 15:04:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(react)=20fix=20types=20file=20brok?= =?UTF-8?q?en=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generated types for the react package were broken because they were still using absolute imports which cannot work in standalone .d.ts files because they cannot rely on the local baseUrl compiler option. Thus, we introduced an alias that we are able to reliably replace during type generation. --- packages/react/src/components/Button/index.spec.tsx | 4 ++-- .../src/components/DataGrid/SimpleDataGrid.spec.tsx | 10 +++++----- .../react/src/components/DataGrid/SimpleDataGrid.tsx | 9 +++++++-- .../react/src/components/DataGrid/index.spec.tsx | 12 ++++++------ .../react/src/components/DataGrid/index.stories.tsx | 10 +++++----- packages/react/src/components/DataGrid/index.tsx | 11 +++++------ packages/react/src/components/DataGrid/utils.tsx | 8 ++++---- .../src/components/Forms/Checkbox/index.spec.tsx | 2 +- .../src/components/Forms/Checkbox/index.stories.tsx | 2 +- .../react/src/components/Forms/Checkbox/index.tsx | 2 +- .../src/components/Forms/Field/index.stories.tsx | 2 +- .../react/src/components/Forms/Input/index.spec.tsx | 4 ++-- .../src/components/Forms/Input/index.stories.tsx | 4 ++-- packages/react/src/components/Forms/Input/index.tsx | 4 ++-- .../react/src/components/Forms/Radio/index.spec.tsx | 2 +- .../src/components/Forms/Radio/index.stories.tsx | 2 +- packages/react/src/components/Forms/Radio/index.tsx | 2 +- .../react/src/components/Loader/index.stories.tsx | 2 +- .../react/src/components/Pagination/index.spec.tsx | 6 +++--- .../src/components/Pagination/index.stories.tsx | 4 ++-- packages/react/src/components/Pagination/index.tsx | 6 +++--- .../react/src/components/Provider/index.spec.tsx | 6 +++--- packages/react/src/components/Provider/index.tsx | 8 ++++---- packages/react/tsconfig.json | 4 +++- packages/react/vite.config.ts | 9 +++++++++ 25 files changed, 75 insertions(+), 60 deletions(-) diff --git a/packages/react/src/components/Button/index.spec.tsx b/packages/react/src/components/Button/index.spec.tsx index a64e7ab..7b07d0f 100644 --- a/packages/react/src/components/Button/index.spec.tsx +++ b/packages/react/src/components/Button/index.spec.tsx @@ -1,8 +1,8 @@ import { act, render, screen, waitFor } from "@testing-library/react"; import React from "react"; import userEvent from "@testing-library/user-event"; -import { buildTheme, loadTokens } from "tests/Theme"; -import { Button } from "./index"; +import { buildTheme, loadTokens } from ":/tests/Theme"; +import { Button } from ":/components/Button"; describe("