🔧(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,7 +1,7 @@
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import React from "react";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { Checkbox, CheckboxGroup } from "components/Forms/Checkbox/index";
|
||||
import { Checkbox, CheckboxGroup } from ":/components/Forms/Checkbox/index";
|
||||
|
||||
describe("<Checkbox/>", () => {
|
||||
it("renders and can be checked", async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import React from "react";
|
||||
import { Checkbox, CheckboxGroup } from "components/Forms/Checkbox/index";
|
||||
import { Checkbox, CheckboxGroup } from ":/components/Forms/Checkbox/index";
|
||||
|
||||
export default {
|
||||
title: "Components/Forms/Checkbox",
|
||||
|
||||
@@ -6,7 +6,7 @@ import React, {
|
||||
useState,
|
||||
} from "react";
|
||||
import classNames from "classnames";
|
||||
import { Field, FieldProps } from "components/Forms/Field";
|
||||
import { Field, FieldProps } from ":/components/Forms/Field";
|
||||
|
||||
type Props = InputHTMLAttributes<HTMLInputElement> &
|
||||
FieldProps & {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import React from "react";
|
||||
import { Field } from "components/Forms/Field/index";
|
||||
import { Field } from ":/components/Forms/Field/index";
|
||||
|
||||
export default {
|
||||
title: "Components/Forms/Field",
|
||||
|
||||
@@ -2,8 +2,8 @@ import { render, screen } from "@testing-library/react";
|
||||
import React, { useRef } from "react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { expect } from "vitest";
|
||||
import { Input, InputRefType } from "components/Forms/Input/index";
|
||||
import { Button } from "components/Button";
|
||||
import { Input, InputRefType } from ":/components/Forms/Input/index";
|
||||
import { Button } from ":/components/Button";
|
||||
|
||||
describe("<Input/>", () => {
|
||||
it("renders and can type", async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import React, { useRef } from "react";
|
||||
import { Input, InputRefType } from "components/Forms/Input/index";
|
||||
import { Button } from "components/Button";
|
||||
import { Input, InputRefType } from ":/components/Forms/Input/index";
|
||||
import { Button } from ":/components/Button";
|
||||
|
||||
export default {
|
||||
title: "Components/Forms/Input",
|
||||
|
||||
@@ -8,8 +8,8 @@ import React, {
|
||||
useState,
|
||||
} from "react";
|
||||
import classNames from "classnames";
|
||||
import { randomString } from "utils";
|
||||
import { Field, FieldProps } from "components/Forms/Field";
|
||||
import { randomString } from ":/utils";
|
||||
import { Field, FieldProps } from ":/components/Forms/Field";
|
||||
|
||||
export interface InputRefType {
|
||||
input: HTMLInputElement | null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import React from "react";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { Radio, RadioGroup } from "components/Forms/Radio/index";
|
||||
import { Radio, RadioGroup } from ":/components/Forms/Radio/index";
|
||||
|
||||
describe("<Radio/>", () => {
|
||||
it("should render", async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import React from "react";
|
||||
import { Radio, RadioGroup } from "components/Forms/Radio/index";
|
||||
import { Radio, RadioGroup } from ":/components/Forms/Radio/index";
|
||||
|
||||
export default {
|
||||
title: "Components/Forms/Radio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { InputHTMLAttributes, PropsWithChildren } from "react";
|
||||
import classNames from "classnames";
|
||||
import { Field, FieldProps } from "components/Forms/Field";
|
||||
import { Field, FieldProps } from ":/components/Forms/Field";
|
||||
|
||||
type Props = InputHTMLAttributes<HTMLInputElement> &
|
||||
FieldProps & {
|
||||
|
||||
Reference in New Issue
Block a user