🔧(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:
@@ -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", () => {
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user