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