Skip to content

Commit

Permalink
Remove aliases to improve generated types
Browse files Browse the repository at this point in the history
  • Loading branch information
sp-pau-tena committed Sep 29, 2023
1 parent 72e1737 commit e5c3385
Show file tree
Hide file tree
Showing 161 changed files with 358 additions and 394 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pautena/react-design-system",
"version": "0.14.2",
"version": "0.14.3",
"description": "My custom design system on top of MUI",
"main": "dist/cjs/index.js",
"module": "dist/index.js",
Expand Down Expand Up @@ -58,7 +58,6 @@
"@date-io/date-fns": "^2.16.0",
"@faker-js/faker": "^8.0.2",
"@mui/x-data-grid-generator": "^6.9.0",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"@storybook/addon-actions": "^7.0.24",
Expand Down Expand Up @@ -94,7 +93,6 @@
"ramda": "^0.29.0",
"react-test-renderer": "^18.2.0",
"rollup": "^2.79.1",
"rollup-plugin-dts": "^6.0.2",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-terser": "^7.0.2",
Expand Down
9 changes: 0 additions & 9 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import alias from "@rollup/plugin-alias";
import path from "path";
import { terser } from "rollup-plugin-terser";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
Expand All @@ -21,14 +20,6 @@ const plugins = [
useTsconfigDeclarationDir: true,
}),
terser(),
alias({
entries: [
{
find: "~",
replacement: path.resolve(projectRootDir, "src"),
},
],
}),
];

const subfolderPlugins = (folderName) => [
Expand Down
2 changes: 1 addition & 1 deletion src/action/action.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from "@storybook/react";
import { Action } from "./action";
import { loremIpsum } from "lorem-ipsum";
import { withContainer } from "~/storybook";
import { withContainer } from "../storybook";
import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";

Expand Down
2 changes: 1 addition & 1 deletion src/action/action.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render, screen, fireEvent } from "~/tests/testing-library";
import { render, screen, fireEvent } from "../tests/testing-library";
import { Action } from "./action";
import { vi } from "vitest";

Expand Down
4 changes: 2 additions & 2 deletions src/action/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import DialogContentText from "@mui/material/DialogContentText";
import { Variant } from "@mui/material/styles/createTypography";
import { ReactElement } from "react";
import { ActionHeader } from "./action-header";
import { ConfirmDialog } from "~/confirm-dialog";
import { useDialog } from "~/dialog";
import { ConfirmDialog } from "../confirm-dialog";
import { useDialog } from "../dialog";

export type ActionVariant = "primary" | "error" | "warning" | "success";

Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/autocomplete.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, StoryObj } from "@storybook/react";
import { withContainer } from "~/storybook";
import { withContainer } from "../storybook";
import { Autocomplete } from "./autocomplete";
import { faker } from "@faker-js/faker";
import Box from "@mui/material/Box";
Expand Down
6 changes: 3 additions & 3 deletions src/autocomplete/autocomplete.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import { Autocomplete } from "./autocomplete";
import { faker } from "@faker-js/faker";
import { selectOption } from "~/tests/actions";
import { selectOption } from "../tests/actions";
import userEvents from "@testing-library/user-event";
import { expectProgressIndicator } from "~/tests/assertions";
import { expectProgressIndicator } from "../tests/assertions";
import { vi } from "vitest";

const options: string[] = [...faker.definitions.vehicle.model];
Expand Down
4 changes: 2 additions & 2 deletions src/board/board.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from "@storybook/react";
import { withContainer } from "~/storybook";
import { withContainer } from "../storybook";
import { Board } from "./board";
import demoMarkdownContent from "~/tests/mocks/markdown.mock.md";
import demoMarkdownContent from "../tests/mocks/markdown.mock.md";
import Typography from "@mui/material/Typography";

export default {
Expand Down
4 changes: 2 additions & 2 deletions src/board/board.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import { Board } from "./board";
import { mockMarkdownContent } from "~/tests/mocks/markdown.mock";
import { mockMarkdownContent } from "../tests/mocks/markdown.mock";
import userEvent from "@testing-library/user-event";
import { vi } from "vitest";
import Typography from "@mui/material/Typography";
Expand Down
2 changes: 1 addition & 1 deletion src/board/board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Typography from "@mui/material/Typography";
import { useTheme, SxProps, Theme } from "@mui/material/styles";
import { blueGrey } from "@mui/material/colors";
import { PropsWithChildren, ReactNode } from "react";
import { Markdown } from "~/markdown";
import { Markdown } from "../markdown";
import ContentCopyIcon from "@mui/icons-material/ContentCopy";

export type BoardProps = PropsWithChildren<{
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap-dialog/bootstrap-dialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Meta, StoryObj } from "@storybook/react";
import { action } from "@storybook/addon-actions";
import { BootstrapDialog } from "./bootstrap-dialog";
import { loremIpsum } from "lorem-ipsum";
import { StoryDialogManager } from "~/storybook";
import { StoryDialogManager } from "../storybook";

const onClickAction = action("On click dialog action");

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap-dialog/bootstrap-dialog.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import DialogContentText from "@mui/material/DialogContentText";
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import { BootstrapDialog } from "./bootstrap-dialog";
import userEvent from "@testing-library/user-event";
import { DialogAction } from "~/dialog/dialog.types";
import { DialogAction } from "../dialog/dialog.types";
import { vi } from "vitest";

interface DialogRenderArgs {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap-dialog/bootstrap-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import LoadingButton from "@mui/lab/LoadingButton";
import CloseIcon from "@mui/icons-material/Close";
import { BootstrapDialogDialogProps } from "~/dialog/dialog.types";
import { BootstrapDialogDialogProps } from "../dialog/dialog.types";

export const BootstrapDialog = ({
open,
Expand Down
2 changes: 1 addition & 1 deletion src/bullet/bullet.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Bullet, BulletVariant } from "./bullet";
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";

describe("Bullet", () => {
const renderComponent = (variant: BulletVariant | undefined = undefined) => {
Expand Down
4 changes: 2 additions & 2 deletions src/center-container/center-container.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from "@storybook/react";
import { CenterContainer } from "./center-container";
import { Label } from "~/label";
import { withContainer } from "~/storybook";
import { Label } from "../label";
import { withContainer } from "../storybook";

export default {
title: "Components/Containers/CenterContainer",
Expand Down
2 changes: 1 addition & 1 deletion src/center-container/center-container.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Typography from "@mui/material/Typography";
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import { CenterContainer } from "./center-container";

describe("CenterContainer", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/confirm-dialog/confirm-dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DialogContentText from "@mui/material/DialogContentText";
import { Meta, StoryObj } from "@storybook/react";
import { loremIpsum } from "lorem-ipsum";
import { StoryDialogManager } from "~/storybook";
import { StoryDialogManager } from "../storybook";
import { ConfirmDialog } from "./confirm-dialog";

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/confirm-dialog/confirm-dialog.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DialogContentText from "@mui/material/DialogContentText";
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import { ConfirmDialog } from "./confirm-dialog";
import userEvent from "@testing-library/user-event";
import { vi } from "vitest";
Expand Down
4 changes: 2 additions & 2 deletions src/confirm-dialog/confirm-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import { BootstrapDialog } from "~/bootstrap-dialog";
import { BootstrapDialogDialogProps } from "~/dialog/dialog.types";
import { BootstrapDialog } from "../bootstrap-dialog";
import { BootstrapDialogDialogProps } from "../dialog/dialog.types";
import TextField from "@mui/material/TextField";

type OmitBaseDialogProps =
Expand Down
2 changes: 1 addition & 1 deletion src/content-placeholder/content-placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Container from "@mui/material/Container";
import { PropsWithChildren } from "react";
import { SkeletonGrid } from "~/skeleton-grid";
import { SkeletonGrid } from "../skeleton-grid";

export type ContentPlaceholderProps = PropsWithChildren<{
size?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/content/content.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react";
import { Content } from "./content";
import { SkeletonGrid } from "~/skeleton-grid";
import { SkeletonGrid } from "../skeleton-grid";

export default {
title: "Components/Containers/Content",
Expand Down
2 changes: 1 addition & 1 deletion src/content/content.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Content } from "./content";
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import Typography from "@mui/material/Typography";

describe("Content", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/date-range-calendar/date-range-calendar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, StoryObj } from "@storybook/react";
import { withLocalizationProvider } from "~/storybook";
import { withLocalizationProvider } from "../storybook";
import { DateRangeCalendar } from "./date-range-calendar";

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/date-range-calendar/date-range-calendar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fireEvent, render, screen } from "~/tests/testing-library";
import { fireEvent, render, screen } from "../tests/testing-library";
import { DateRangeCalendar } from "./date-range-calendar";
import { vi } from "vitest";
import { differenceInCalendarDays, format, addDays, subDays } from "date-fns";
Expand Down
2 changes: 1 addition & 1 deletion src/date-range-picker/date-range-picker.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta, StoryObj } from "@storybook/react";
import { withContainer, withLocalizationProvider } from "~/storybook";
import { withContainer, withLocalizationProvider } from "../storybook";
import { DateRangePicker } from "./date-range-picker";

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/date-range-picker/date-range-picker.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fireEvent, render, screen } from "~/tests/testing-library";
import { fireEvent, render, screen } from "../tests/testing-library";
import { DateRangePicker } from "./date-range-picker";
import { vi } from "vitest";

Expand Down
2 changes: 1 addition & 1 deletion src/date-range-picker/date-range-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import InputAdornment from "@mui/material/InputAdornment";
import TextField from "@mui/material/TextField";
import Paper from "@mui/material/Paper";
import EventIcon from "@mui/icons-material/Event";
import { DateRangeCalendar } from "~/date-range-calendar";
import { DateRangeCalendar } from "../date-range-calendar";

type DateRange = [Date, Date | undefined];
export interface DateRangePickerProps {
Expand Down
2 changes: 1 addition & 1 deletion src/drawer-app-bar/drawer-app-bar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from "@storybook/react";
import { DrawerAppBar } from "./drawer-app-bar";
import { DrawerProvider } from "~/drawer-provider";
import { DrawerProvider } from "../drawer-provider";

export default {
title: "Components/Drawers/DrawerAppBar",
Expand Down
6 changes: 3 additions & 3 deletions src/drawer-app-bar/drawer-app-bar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import { DrawerAppBar } from "./drawer-app-bar";
import { DrawerProvider, useDrawer } from "~/drawer-provider";
import { DrawerState, DrawerVariant } from "~/drawer/drawer.types";
import { DrawerProvider, useDrawer } from "../drawer-provider";
import { DrawerState, DrawerVariant } from "../drawer/drawer.types";
import Typography from "@mui/material/Typography";
import userEvent from "@testing-library/user-event";

Expand Down
4 changes: 2 additions & 2 deletions src/drawer-app-bar/drawer-app-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import IconButton from "@mui/material/IconButton";
import Typography from "@mui/material/Typography";
import { useTheme, Theme } from "@mui/material/styles";
import MenuIcon from "@mui/icons-material/Menu";
import { useDrawer } from "~/drawer-provider";
import { useDrawer } from "../drawer-provider";
import { AppBarProps as MuiAppBarProps } from "@mui/material";
import { DrawerState, DrawerVariant } from "~/drawer";
import { DrawerState, DrawerVariant } from "../drawer";

const moveWithDrawer: Record<DrawerVariant, boolean> = {
temporary: false,
Expand Down
8 changes: 4 additions & 4 deletions src/drawer-content/drawer-content.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Meta, StoryObj } from "@storybook/react";
import { DrawerContent } from "./drawer-content";
import { mockDrawerNavigation } from "~/drawer/drawer.mock";
import { withMemoryRouter } from "~/storybook";
import { DrawerProvider } from "~/drawer-provider";
import { DrawerContentProps, DrawerState } from "~/drawer";
import { mockDrawerNavigation } from "../drawer/drawer.mock";
import { withMemoryRouter } from "../storybook";
import { DrawerProvider } from "../drawer-provider";
import { DrawerContentProps, DrawerState } from "../drawer";

type DrawerContentArgs = DrawerContentProps & {
initialState?: DrawerState;
Expand Down
6 changes: 3 additions & 3 deletions src/drawer-content/drawer-content.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, screen } from "~/tests/testing-library";
import { render, screen } from "../tests/testing-library";
import userEvent from "@testing-library/user-event";
import { mockDrawerNavigation } from "~/drawer/drawer.mock";
import { mockDrawerNavigation } from "../drawer/drawer.mock";
import { DrawerContent } from "./drawer-content";
import { DrawerProvider } from "~/drawer-provider";
import { DrawerProvider } from "../drawer-provider";

describe("DrawerContent", () => {
const renderComponent = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/drawer-content/drawer-content.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DrawerSection } from "~/drawer-section";
import { DrawerContentComponent, DrawerContentProps } from "~/drawer";
import { DrawerSection } from "../drawer-section";
import { DrawerContentComponent, DrawerContentProps } from "../drawer";

/**
* Content to be shown inside a navigation
Expand Down
10 changes: 5 additions & 5 deletions src/drawer-item/drawer-item-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import ListItemButton from "@mui/material/ListItemButton";
import ListItemIcon from "@mui/material/ListItemIcon";
import ListItemText from "@mui/material/ListItemText";
import { SxProps, Theme, styled, useTheme } from "@mui/material/styles";
import { Bullet } from "~/bullet";
import { Label } from "~/label";
import { Bullet } from "../bullet";
import { Label } from "../label";
import {
DrawerItemAvatar,
DrawerItemBullet,
DrawerItemLabel,
DrawerSize,
getDrawerItemColors,
} from "~/drawer/drawer.types";
import { Link } from "~/link";
import { useDrawer } from "~/drawer-provider";
} from "../drawer/drawer.types";
import { Link } from "../link";
import { useDrawer } from "../drawer-provider";

export interface DrawerItemLinkProps {
/**
Expand Down
8 changes: 4 additions & 4 deletions src/drawer-item/drawer-item.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Meta, StoryObj } from "@storybook/react";
import { withMemoryRouter } from "~/storybook";
import { withMemoryRouter } from "../storybook";
import { DrawerItem, DrawerItemProps } from "./drawer-item";
import DiamondIcon from "@mui/icons-material/Diamond";
import {
mockMenuDrawerNavigationItem,
mockLinkNoIconDrawerNavigationItem,
} from "~/drawer/drawer.mock";
import { DrawerProvider } from "~/drawer-provider";
import { DrawerState } from "~/drawer";
} from "../drawer/drawer.mock";
import { DrawerProvider } from "../drawer-provider";
import { DrawerState } from "../drawer";

type DrawerItemStoryArgs = DrawerItemProps & {
initialState?: DrawerState;
Expand Down
8 changes: 4 additions & 4 deletions src/drawer-item/drawer-item.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
mockLinkLabelDrawerNavigationItem,
mockLinkNoIconDrawerNavigationItem,
mockMenuInsideMenuDrawerNavigationItem,
} from "~/drawer/drawer.mock";
import { DrawerNavigationItem, DrawerState } from "~/drawer";
import { render, screen, within } from "~/tests/testing-library";
} from "../drawer/drawer.mock";
import { DrawerNavigationItem, DrawerState } from "../drawer";
import { render, screen, within } from "../tests/testing-library";
import { DrawerItem } from "./drawer-item";
import { DrawerProvider } from "~/drawer-provider";
import { DrawerProvider } from "../drawer-provider";

describe("DrawerItem", () => {
const renderComponent = ({
Expand Down
4 changes: 2 additions & 2 deletions src/drawer-item/drawer-item.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DrawerMenuItem } from "./drawer-menu-item";
import { DrawerNavigationItem, DrawerSize } from "~/drawer/drawer.types";
import { DrawerNavigationItem, DrawerSize } from "../drawer/drawer.types";
import { DrawerItemLink } from "./drawer-item-link";
import { useDrawer } from "~/drawer-provider";
import { useDrawer } from "../drawer-provider";

export interface DrawerItemProps {
/**
Expand Down
Loading

0 comments on commit e5c3385

Please sign in to comment.