🔧(react) fix types file broken imports

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.
This commit is contained in:
Nathan Vasse
2023-05-04 15:04:47 +02:00
committed by NathanVss
parent 7eac0bfca1
commit d4a574c30f
25 changed files with 75 additions and 60 deletions

View File

@@ -1,9 +1,9 @@
import { render, screen } from "@testing-library/react";
import React, { PropsWithChildren, useMemo, useState } from "react";
import userEvent from "@testing-library/user-event";
import { CunninghamProvider, useCunningham } from "components/Provider/index";
import * as enUS from "locales/en-US.json";
import { Button } from "components/Button";
import { CunninghamProvider, useCunningham } from ":/components/Provider/index";
import * as enUS from ":/locales/en-US.json";
import { Button } from ":/components/Button";
describe("<CunninghamProvider />", () => {
it("should render", () => {

View File

@@ -4,10 +4,10 @@ import React, {
useContext,
useMemo,
} from "react";
import * as enUS from "locales/en-US.json";
import * as frFR from "locales/fr-FR.json";
import { PartialNested } from "types";
import { Locales } from "components/Provider/Locales";
import * as enUS from ":/locales/en-US.json";
import * as frFR from ":/locales/fr-FR.json";
import { PartialNested } from ":/types";
import { Locales } from ":/components/Provider/Locales";
type TranslationSet = PartialNested<typeof enUS>;