Skip to content

Commit

Permalink
feat(skeleton): use simpler path mapping for resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Mar 6, 2024
1 parent bb85dc7 commit 936b17f
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 47 deletions.
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm exec biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index -->
run: pnpm exec biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again

commit-msg:
commands:
Expand Down
2 changes: 1 addition & 1 deletion skeleton/base/lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm exec biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index -->
run: pnpm exec biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again

commit-msg:
commands:
Expand Down
2 changes: 1 addition & 1 deletion skeleton/base/src/pages/ArticlesPage/ArticleFormDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RenderDialogProps } from "@components/DialogController/index.ts";
import type { RenderDialogProps } from "@/components/DialogController/index.ts";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack } from "@mui/material";
import { RhfTextField } from "mui-rhf-integration";
Expand Down
10 changes: 5 additions & 5 deletions skeleton/base/src/pages/ArticlesPage/ArticleListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import ConfirmDialog from "@components/ConfirmDialog/index.ts";
import DialogController from "@components/DialogController/index.ts";
import ConfirmDialog from "@/components/ConfirmDialog/index.ts";
import DialogController from "@/components/DialogController/index.ts";
import { useDeleteArticleMutation } from "@/mutations/article.ts";
import EditArticleFormDialog from "@/pages/ArticlesPage/EditArticleFormDialog.tsx";
import type { ListArticle } from "@/queries/article.ts";
import MoreVertIcon from "@mui/icons-material/MoreVert";
import { IconButton, ListItem, ListItemText, Menu, MenuItem } from "@mui/material";
import { useDeleteArticleMutation } from "@mutations/article.ts";
import EditArticleFormDialog from "@pages/ArticlesPage/EditArticleFormDialog.tsx";
import type { ListArticle } from "@queries/article.ts";
import { bindMenu, bindTrigger, usePopupState } from "material-ui-popup-state/hooks";
import { useSnackbar } from "notistack";
import type { ReactNode } from "react";
Expand Down
4 changes: 2 additions & 2 deletions skeleton/base/src/pages/ArticlesPage/ArticlesPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DialogController from "@components/DialogController/index.ts";
import DialogController from "@/components/DialogController/index.ts";
import { useArticlesQuery } from "@/queries/article.ts";
import { Button, ButtonGroup, Container, LinearProgress, List, Typography } from "@mui/material";
import { useArticlesQuery } from "@queries/article.ts";
import type { PageParams } from "jsonapi-zod-query";
import type { ReactNode } from "react";
import { useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RenderDialogProps } from "@components/DialogController/index.ts";
import { useCreateWorldMutation } from "@mutations/article.ts";
import type { RenderDialogProps } from "@/components/DialogController/index.ts";
import { useCreateWorldMutation } from "@/mutations/article.ts";
import { useSnackbar } from "notistack";
import type { ReactNode } from "react";
import ArticleFormDialog, { type ArticleFormValues } from "./ArticleFormDialog.tsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RenderDialogProps } from "@components/DialogController/index.ts";
import type { RenderDialogProps } from "@/components/DialogController/index.ts";
import { useUpdateArticleMutation } from "@/mutations/article.ts";
import { useArticleQuery } from "@/queries/article.ts";
import { Backdrop, CircularProgress } from "@mui/material";
import { useUpdateArticleMutation } from "@mutations/article.ts";
import { useArticleQuery } from "@queries/article.ts";
import { useSnackbar } from "notistack";
import { useEffect } from "react";
import type { ReactNode } from "react";
Expand Down
6 changes: 3 additions & 3 deletions skeleton/base/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Layout from "@components/Layout/index.ts";
import RootErrorBoundary from "@components/RootErrorBoundary/index.ts";
import HomePage from "@pages/HomePage/index.ts";
import Layout from "@/components/Layout/index.ts";
import RootErrorBoundary from "@/components/RootErrorBoundary/index.ts";
import HomePage from "@/pages/HomePage/index.ts";
import { Outlet, type RouteObject, createBrowserRouter } from "react-router-dom";

const pathRoutes: RouteObject[] = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FullPageSpinner from "@/components/FullPageSpinner/index.ts";
import { useAuth0 } from "@auth0/auth0-react";
import FullPageSpinner from "@components/FullPageSpinner/index.ts";
import { useEffect } from "react";
import type { ReactNode } from "react";
import AuthError from "./AuthError.tsx";
Expand Down
6 changes: 3 additions & 3 deletions skeleton/templates/src/main.tsx.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Auth0Provider } from "@auth0/auth0-react";
import AuthGuard from "@components/AuthGuard/index.ts";
import FullPageSpinner from "@components/FullPageSpinner/index.ts";
import MultiProvider from "@components/MultiProvider/index.ts";
import AuthGuard from "@/components/AuthGuard/index.ts";
import FullPageSpinner from "@/components/FullPageSpinner/index.ts";
import MultiProvider from "@/components/MultiProvider/index.ts";
import "@fontsource/roboto/300.css";
import "@fontsource/roboto/400.css";
import "@fontsource/roboto/500.css";
Expand Down
6 changes: 3 additions & 3 deletions skeleton/templates/src/mutations/article.ts.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useAuthenticatedFetch from "@hooks/useAuthenticatedFetch.ts";
import type { articleAttributesSchema } from "@queries/article.ts";
import useAuthenticatedFetch from "@/hooks/useAuthenticatedFetch.ts";
import type { articleAttributesSchema } from "@/queries/article.ts";
import { type UseMutationResult, useMutation, useQueryClient } from "@tanstack/react-query";
import { apiUrl } from "@utils/api.ts";
import { apiUrl } from "@/utils/api.ts";
import { handleJsonApiError } from "jsonapi-zod-query";
import type { z } from "zod";

Expand Down
4 changes: 2 additions & 2 deletions skeleton/templates/src/queries/article.ts.mustache
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import useAuthenticatedFetch from "@hooks/useAuthenticatedFetch.ts";
import useAuthenticatedFetch from "@/hooks/useAuthenticatedFetch.ts";
import { type UseQueryResult, keepPreviousData, useQuery } from "@tanstack/react-query";
import { apiUrl } from "@utils/api.ts";
import { apiUrl } from "@/utils/api.ts";
import {
type PageParams,
createDataSelector,
Expand Down
22 changes: 2 additions & 20 deletions skeleton/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,8 @@
"strict": true,
"noImplicitAny": true,
"paths": {
"@assets/*": [
"./src/assets/*"
],
"@components/*": [
"./src/components/*"
],
"@hooks/*": [
"./src/hooks/*"
],
"@mutations/*": [
"./src/mutations/*"
],
"@pages/*": [
"./src/pages/*"
],
"@queries/*": [
"./src/queries/*"
],
"@utils/*": [
"./src/utils/*"
"@/*": [
"./src/*"
]
}
},
Expand Down

0 comments on commit 936b17f

Please sign in to comment.