diff --git a/examples/github-app/src/App.tsx b/examples/github-app/src/App.tsx index dcf6ba4abbd6..01ec13ebdc39 100644 --- a/examples/github-app/src/App.tsx +++ b/examples/github-app/src/App.tsx @@ -1,10 +1,12 @@ -import { memo } from 'react'; import { MatchedRoute } from '@anansi/router'; import { Layout } from 'antd'; -import Boundary from 'Boundary'; +import { memo } from 'react'; + +import Boundary from '@/Boundary'; +import NavBar from '@/navigation/NavBar'; + import 'antd/dist/reset.css'; import 'style/main.css'; -import NavBar from 'navigation/NavBar'; const { Content } = Layout; diff --git a/examples/github-app/src/RootProvider.tsx b/examples/github-app/src/RootProvider.tsx index 8b614b6d09a2..f160924fe433 100644 --- a/examples/github-app/src/RootProvider.tsx +++ b/examples/github-app/src/RootProvider.tsx @@ -5,11 +5,12 @@ import { getDefaultManagers, ProviderProps, } from '@data-client/react'; -import { AuthdProvider } from 'navigation/authdContext'; import type { ReactNode } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import type { FallbackProps } from 'react-error-boundary'; -import { unAuth } from 'resources/Auth'; + +import { AuthdProvider } from '@/navigation/authdContext'; +import { unAuth } from '@/resources/Auth'; import Boundary from './Boundary'; import { Router } from './routing'; diff --git a/examples/github-app/src/components/Labels.tsx b/examples/github-app/src/components/Labels.tsx index c5dc11202b0f..212ff9a211df 100644 --- a/examples/github-app/src/components/Labels.tsx +++ b/examples/github-app/src/components/Labels.tsx @@ -1,6 +1,7 @@ import { Tag, Space } from 'antd'; import { memo } from 'react'; -import type { Label } from 'resources/Label'; + +import type { Label } from '@/resources/Label'; function Labels({ labels }: { labels: Label[] }) { return ( diff --git a/examples/github-app/src/navigation/NavBar.tsx b/examples/github-app/src/navigation/NavBar.tsx index 2c33896b4a71..90cfcad6cb24 100644 --- a/examples/github-app/src/navigation/NavBar.tsx +++ b/examples/github-app/src/navigation/NavBar.tsx @@ -3,7 +3,8 @@ import { AsyncBoundary, useCache, useSuspense } from '@data-client/react'; import { Layout, Menu, Spin, Affix, MenuProps } from 'antd'; import { Avatar } from 'antd'; import { memo, useContext, useMemo, useState } from 'react'; -import UserResource from 'resources/User'; + +import UserResource from '@/resources/User'; import { authdContext } from './authdContext'; import LoginModal from './LoginModal'; diff --git a/examples/github-app/src/navigation/authdContext.tsx b/examples/github-app/src/navigation/authdContext.tsx index a4f0604b4f95..701fa09f14cd 100644 --- a/examples/github-app/src/navigation/authdContext.tsx +++ b/examples/github-app/src/navigation/authdContext.tsx @@ -1,7 +1,8 @@ import { useController } from '@data-client/react'; import React, { createContext, useCallback, useMemo } from 'react'; -import { setAuth, unAuth } from 'resources/Auth'; -import UserResource from 'resources/User'; + +import { setAuth, unAuth } from '@/resources/Auth'; +import UserResource from '@/resources/User'; export const authdContext = createContext({ login(data: { login: string; token: string }): void { diff --git a/examples/github-app/src/pages/IssueDetail/CommentInline.tsx b/examples/github-app/src/pages/IssueDetail/CommentInline.tsx index 4bfa2eb87ae7..0ca93b07627f 100644 --- a/examples/github-app/src/pages/IssueDetail/CommentInline.tsx +++ b/examples/github-app/src/pages/IssueDetail/CommentInline.tsx @@ -4,14 +4,15 @@ import { useCache, useController } from '@data-client/react'; import { Intl } from '@js-temporal/polyfill'; import { css } from '@linaria/core'; import { Card, Avatar, Button, Tag, Popover } from 'antd'; -import FlexRow from 'components/FlexRow'; import React, { memo, useCallback, useState } from 'react'; import Markdown from 'react-markdown'; import rehypeHighlight from 'rehype-highlight'; import remarkGfm from 'remark-gfm'; import remarkRemoveComments from 'remark-remove-comments'; -import { CommentResource, Comment } from 'resources/Comment'; -import { UserResource } from 'resources/User'; + +import FlexRow from '@/components/FlexRow'; +import { CommentResource, Comment } from '@/resources/Comment'; +import { UserResource } from '@/resources/User'; import CommentForm from './CommentForm'; diff --git a/examples/github-app/src/pages/IssueDetail/CommentsList.tsx b/examples/github-app/src/pages/IssueDetail/CommentsList.tsx index 5847f4ea4ae3..0ce810630595 100644 --- a/examples/github-app/src/pages/IssueDetail/CommentsList.tsx +++ b/examples/github-app/src/pages/IssueDetail/CommentsList.tsx @@ -1,6 +1,7 @@ import { useSuspense } from '@data-client/react'; import { Card } from 'antd'; -import { CommentResource } from 'resources/Comment'; + +import { CommentResource } from '@/resources/Comment'; import CommentInline from './CommentInline'; diff --git a/examples/github-app/src/pages/IssueDetail/CreateComment.tsx b/examples/github-app/src/pages/IssueDetail/CreateComment.tsx index 413340840dc8..aebc6f7213d3 100644 --- a/examples/github-app/src/pages/IssueDetail/CreateComment.tsx +++ b/examples/github-app/src/pages/IssueDetail/CreateComment.tsx @@ -3,9 +3,10 @@ import { useCache, useController } from '@data-client/react'; import { css } from '@linaria/core'; import { Card, Avatar } from 'antd'; import { memo, useCallback } from 'react'; -import { CommentResource } from 'resources/Comment'; -import { Issue } from 'resources/Issue'; -import UserResource from 'resources/User'; + +import { CommentResource } from '@/resources/Comment'; +import { Issue } from '@/resources/Issue'; +import UserResource from '@/resources/User'; import CommentForm from './CommentForm'; diff --git a/examples/github-app/src/pages/IssueDetail/CreateReaction.tsx b/examples/github-app/src/pages/IssueDetail/CreateReaction.tsx index 01f496606871..e0387d6e37a0 100644 --- a/examples/github-app/src/pages/IssueDetail/CreateReaction.tsx +++ b/examples/github-app/src/pages/IssueDetail/CreateReaction.tsx @@ -1,10 +1,15 @@ import { useController, useCache } from '@data-client/react'; import { Tag } from 'antd'; -import { Issue } from 'resources/Issue'; -import { Reaction, ReactionResource, contentToIcon } from 'resources/Reaction'; -import { UserResource } from 'resources/User'; import { v4 as uuid } from 'uuid'; +import { Issue } from '@/resources/Issue'; +import { + Reaction, + ReactionResource, + contentToIcon, +} from '@/resources/Reaction'; +import { UserResource } from '@/resources/User'; + const { CheckableTag } = Tag; export function CreateReaction({ content, reactions = [], issue }: Props) { diff --git a/examples/github-app/src/pages/IssueDetail/ReactionSpan.tsx b/examples/github-app/src/pages/IssueDetail/ReactionSpan.tsx index 90947b6ff4bb..a3dfb1a9a704 100644 --- a/examples/github-app/src/pages/IssueDetail/ReactionSpan.tsx +++ b/examples/github-app/src/pages/IssueDetail/ReactionSpan.tsx @@ -1,11 +1,12 @@ import { useController, useCache } from '@data-client/react'; import { Tag } from 'antd'; import React, { useCallback } from 'react'; -import { Issue } from 'resources/Issue'; -import { Reaction, ReactionResource } from 'resources/Reaction'; -import { UserResource } from 'resources/User'; import { v4 as uuid } from 'uuid'; +import { Issue } from '@/resources/Issue'; +import { Reaction, ReactionResource } from '@/resources/Reaction'; +import { UserResource } from '@/resources/User'; + const { CheckableTag } = Tag; export function ReactionSpan({ diff --git a/examples/github-app/src/pages/IssueDetail/index.tsx b/examples/github-app/src/pages/IssueDetail/index.tsx index 8aefe9539f86..79342652d5f1 100644 --- a/examples/github-app/src/pages/IssueDetail/index.tsx +++ b/examples/github-app/src/pages/IssueDetail/index.tsx @@ -2,17 +2,18 @@ import { Link } from '@anansi/router'; import { useSuspense, useCache, useDLE } from '@data-client/react'; import { Card, Avatar } from 'antd'; import { Tag } from 'antd'; -import Boundary from 'Boundary'; -import FlexRow from 'components/FlexRow'; import React, { useMemo, memo } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import Markdown from 'react-markdown'; import rehypeHighlight from 'rehype-highlight'; import remarkGfm from 'remark-gfm'; import remarkRemoveComments from 'remark-remove-comments'; -import { IssueResource } from 'resources/Issue'; -import { ReactionResource } from 'resources/Reaction'; -import UserResource from 'resources/User'; + +import Boundary from '@/Boundary'; +import FlexRow from '@/components/FlexRow'; +import { IssueResource } from '@/resources/Issue'; +import { ReactionResource } from '@/resources/Reaction'; +import UserResource from '@/resources/User'; import CommentsList, { CardLoading } from './CommentsList'; import CreateComment from './CreateComment'; diff --git a/examples/github-app/src/pages/IssueDetail/issueActions.tsx b/examples/github-app/src/pages/IssueDetail/issueActions.tsx index 952de39cdd15..c703b20fc2da 100644 --- a/examples/github-app/src/pages/IssueDetail/issueActions.tsx +++ b/examples/github-app/src/pages/IssueDetail/issueActions.tsx @@ -1,9 +1,10 @@ import { Popover } from 'antd'; -import Labels from 'components/Labels'; import { groupBy } from 'lodash'; import React from 'react'; -import { type Issue } from 'resources/Issue'; -import { contentToIcon, type Reaction } from 'resources/Reaction'; + +import Labels from '@/components/Labels'; +import { type Issue } from '@/resources/Issue'; +import { contentToIcon, type Reaction } from '@/resources/Reaction'; import { CreateReaction } from './CreateReaction'; import { ReactionSpan } from './ReactionSpan'; diff --git a/examples/github-app/src/pages/IssueList.tsx b/examples/github-app/src/pages/IssueList.tsx index ba7c5dffe7d9..abd2386c3045 100644 --- a/examples/github-app/src/pages/IssueList.tsx +++ b/examples/github-app/src/pages/IssueList.tsx @@ -2,7 +2,8 @@ import { useSuspense } from '@data-client/react'; import { List } from 'antd'; import parseLink from 'parse-link-header'; import { memo } from 'react'; -import { Issue, IssueResource } from 'resources/Issue'; + +import { Issue, IssueResource } from '@/resources/Issue'; import IssueListItem from './IssueListItem'; import NextPage from './NextPage'; diff --git a/examples/github-app/src/pages/IssueListItem.tsx b/examples/github-app/src/pages/IssueListItem.tsx index 9f4cba1c5c99..ad115ca1bb85 100644 --- a/examples/github-app/src/pages/IssueListItem.tsx +++ b/examples/github-app/src/pages/IssueListItem.tsx @@ -1,9 +1,10 @@ import { Link } from '@anansi/router'; import { List, Avatar, Skeleton } from 'antd'; -import { humanTime } from 'components/human'; -import Labels from 'components/Labels'; import { memo } from 'react'; -import { Issue } from 'resources/Issue'; + +import { humanTime } from '@/components/human'; +import Labels from '@/components/Labels'; +import { Issue } from '@/resources/Issue'; function IssueListItem({ issue }: { issue: Issue }) { const actions = []; diff --git a/examples/github-app/src/pages/IssuesPage.tsx b/examples/github-app/src/pages/IssuesPage.tsx index e1ce95e19ae4..325e5baad659 100644 --- a/examples/github-app/src/pages/IssuesPage.tsx +++ b/examples/github-app/src/pages/IssuesPage.tsx @@ -1,7 +1,8 @@ import { Link, useLocationSearch } from '@anansi/router'; import { HomeOutlined } from '@ant-design/icons'; import { Breadcrumb } from 'antd'; -import { Issue } from 'resources/Issue'; + +import { Issue } from '@/resources/Issue'; import IssueList from './IssueList'; diff --git a/examples/github-app/src/pages/NextPage.tsx b/examples/github-app/src/pages/NextPage.tsx index ad15fb828dca..62fb533732cf 100644 --- a/examples/github-app/src/pages/NextPage.tsx +++ b/examples/github-app/src/pages/NextPage.tsx @@ -1,6 +1,7 @@ import { useController, useLoading } from '@data-client/react'; import { Button } from 'antd'; -import { IssueResource } from 'resources/Issue'; + +import { IssueResource } from '@/resources/Issue'; export default function NextPage({ q, page }: Props) { const ctrl = useController(); diff --git a/examples/github-app/src/pages/ProfileDetail/UserEvents.tsx b/examples/github-app/src/pages/ProfileDetail/UserEvents.tsx index e1a24748b27f..196f20a47e89 100644 --- a/examples/github-app/src/pages/ProfileDetail/UserEvents.tsx +++ b/examples/github-app/src/pages/ProfileDetail/UserEvents.tsx @@ -5,6 +5,7 @@ import { Intl } from '@js-temporal/polyfill'; import { Timeline, Typography, Divider } from 'antd'; import { groupBy } from 'lodash'; import { useMemo } from 'react'; + import { EventResource, typeToIcon, @@ -13,8 +14,8 @@ import { IssuesEvent, PushEvent, PullRequestReviewEvent, -} from 'resources/Event'; -import { User } from 'resources/User'; +} from '@/resources/Event'; +import { User } from '@/resources/User'; import FlexRow from '../../components/FlexRow'; diff --git a/examples/github-app/src/pages/ProfileDetail/UserRepos.tsx b/examples/github-app/src/pages/ProfileDetail/UserRepos.tsx index c1a7c1925070..ec4fdd1fde53 100644 --- a/examples/github-app/src/pages/ProfileDetail/UserRepos.tsx +++ b/examples/github-app/src/pages/ProfileDetail/UserRepos.tsx @@ -3,8 +3,9 @@ import { ForkOutlined, StarOutlined } from '@ant-design/icons'; import { useCache, useSuspense } from '@data-client/react'; import { List, Space, Typography } from 'antd'; import React from 'react'; -import RepositoryResource, { Repository } from 'resources/Repository'; -import { UserResource, User } from 'resources/User'; + +import RepositoryResource, { Repository } from '@/resources/Repository'; +import { UserResource, User } from '@/resources/User'; const { Title } = Typography; diff --git a/examples/github-app/src/pages/ProfileDetail/index.tsx b/examples/github-app/src/pages/ProfileDetail/index.tsx index b26be5ea45e6..bf6e09f1e7a7 100644 --- a/examples/github-app/src/pages/ProfileDetail/index.tsx +++ b/examples/github-app/src/pages/ProfileDetail/index.tsx @@ -2,7 +2,8 @@ import { useSuspense } from '@data-client/react'; import { Intl } from '@js-temporal/polyfill'; import { Card, List, Layout, Typography } from 'antd'; import Markdown from 'react-markdown'; -import { UserResource } from 'resources/User'; + +import { UserResource } from '@/resources/User'; import UserEvents from './UserEvents'; import UserRepositories from './UserRepos'; diff --git a/examples/github-app/src/pages/PullsPage.tsx b/examples/github-app/src/pages/PullsPage.tsx index baffcff42ad9..cea2feab7af1 100644 --- a/examples/github-app/src/pages/PullsPage.tsx +++ b/examples/github-app/src/pages/PullsPage.tsx @@ -1,5 +1,6 @@ import { useLocationSearch } from '@anansi/router'; -import { Issue } from 'resources/Issue'; + +import { Issue } from '@/resources/Issue'; import IssueList from './IssueList'; diff --git a/examples/github-app/src/routing/routes.tsx b/examples/github-app/src/routing/routes.tsx index 2d86faae90ec..500daa79623f 100644 --- a/examples/github-app/src/routing/routes.tsx +++ b/examples/github-app/src/routing/routes.tsx @@ -1,11 +1,12 @@ import { getImage } from '@data-client/img'; import { Controller } from '@data-client/react'; -import CommentResource from 'resources/Comment'; -import { EventResource } from 'resources/Event'; -import IssueResource from 'resources/Issue'; -import ReactionResource from 'resources/Reaction'; -import RepositoryResource from 'resources/Repository'; -import UserResource from 'resources/User'; + +import CommentResource from '@/resources/Comment'; +import { EventResource } from '@/resources/Event'; +import IssueResource from '@/resources/Issue'; +import ReactionResource from '@/resources/Reaction'; +import RepositoryResource from '@/resources/Repository'; +import UserResource from '@/resources/User'; import { lazyPage } from './lazyPage'; diff --git a/examples/github-app/tsconfig.json b/examples/github-app/tsconfig.json index 8e15cf130ab3..80def36e93cc 100644 --- a/examples/github-app/tsconfig.json +++ b/examples/github-app/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", + "baseUrl": "./", "target": "esnext", "module": "esnext", "lib": ["dom", "esnext"], @@ -17,7 +17,8 @@ "types": ["@anansi/webpack-config/types","./src/types/remark-remove-comments"], "paths": { - "resources/*": ["resources/*"] + "@/*": ["./src/*"], + "@/resources/*": ["./src/resources/*"] }, "noEmit": true },