add path alias

This commit is contained in:
Samuel 2022-03-13 01:40:28 -03:00
parent 7f50654da4
commit 0e0c4e36ac
12 changed files with 32 additions and 27 deletions

View file

@ -3,7 +3,7 @@ import { useCallback, useEffect } from 'react'
import { useDropzone } from 'react-dropzone' import { useDropzone } from 'react-dropzone'
import styles from './drag-and-drop.module.css' import styles from './drag-and-drop.module.css'
import { Document } from '../' import { Document } from '../'
import generateUUID from '../../../lib/generate-uuid' import generateUUID from '@lib/generate-uuid'
import { XCircle } from '@geist-ui/icons' import { XCircle } from '@geist-ui/icons'
const allowedFileTypes = [ const allowedFileTypes = [
'application/json', 'application/json',

View file

@ -1,7 +1,7 @@
import { Button, ButtonDropdown, useToasts } from '@geist-ui/core' import { Button, ButtonDropdown, useToasts } from '@geist-ui/core'
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useCallback, useState } from 'react' import { useCallback, useState } from 'react'
import generateUUID from '../../lib/generate-uuid'; import generateUUID from '@lib/generate-uuid';
import Document from '../document'; import Document from '../document';
import FileDropzone from './drag-and-drop'; import FileDropzone from './drag-and-drop';
import styles from './post.module.css' import styles from './post.module.css'

View file

@ -1,6 +1,6 @@
import { Text, Input } from '@geist-ui/core' import { Text, Input } from '@geist-ui/core'
import { memo } from 'react' import { memo } from 'react'
import ShiftBy from '../../shift-by' import ShiftBy from '@components/shift-by'
import styles from '../post.module.css' import styles from '../post.module.css'
const titlePlaceholders = [ const titlePlaceholders = [

View file

@ -1,7 +1,7 @@
import { Card, Spacer, Grid, Divider, Link, Text, Input, Tooltip } from "@geist-ui/core" import { Card, Spacer, Grid, Divider, Link, Text, Input, Tooltip } from "@geist-ui/core"
import NextLink from "next/link" import NextLink from "next/link"
import { useEffect, useMemo, useState } from "react" import { useEffect, useMemo, useState } from "react"
import timeAgo from "../../lib/time-ago" import timeAgo from "@lib/time-ago"
import ShiftBy from "../shift-by" import ShiftBy from "../shift-by"
import VisibilityBadge from "../visibility-badge" import VisibilityBadge from "../visibility-badge"

View file

@ -6,7 +6,7 @@ import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import a11yEmoji from '@fec/remark-a11y-emoji'; import a11yEmoji from '@fec/remark-a11y-emoji';
import styles from './preview.module.css' import styles from './preview.module.css'
import { vscDarkPlus as dark, vs as light } from 'react-syntax-highlighter/dist/cjs/styles/prism' import { vscDarkPlus as dark, vs as light } from 'react-syntax-highlighter/dist/cjs/styles/prism'
import useSharedState from "../../lib/hooks/use-shared-state"; import useSharedState from "@lib/hooks/use-shared-state";
type Props = { type Props = {
content: string | undefined content: string | undefined

View file

@ -1,8 +1,8 @@
import '../styles/globals.css' import '@styles/globals.css'
import { GeistProvider, CssBaseline, useTheme } from '@geist-ui/core' import { GeistProvider, CssBaseline, useTheme } from '@geist-ui/core'
import { useEffect, useMemo, useState } from 'react' import { useEffect, useMemo, useState } from 'react'
import type { AppProps as NextAppProps } from "next/app"; import type { AppProps as NextAppProps } from "next/app";
import useSharedState from '../lib/hooks/use-shared-state'; import useSharedState from '@lib/hooks/use-shared-state';
import 'react-loading-skeleton/dist/skeleton.css' import 'react-loading-skeleton/dist/skeleton.css'
import { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonTheme } from 'react-loading-skeleton';

View file

@ -1,12 +1,12 @@
import styles from '../styles/Home.module.css' import styles from '@styles/Home.module.css'
import { Page, Spacer, Text } from '@geist-ui/core' import { Page, Spacer, Text } from '@geist-ui/core'
import Header from '../components/header' import Header from '@components/header'
import { ThemeProps } from './_app' import { ThemeProps } from './_app'
import Document from '../components/document' import Document from '@components/document'
import Image from 'next/image' import Image from 'next/image'
import ShiftBy from '../components/shift-by' import ShiftBy from '@components/shift-by'
import PageSeo from 'components/page-seo' import PageSeo from '@components/page-seo'
export function getStaticProps() { export function getStaticProps() {
const introDoc = process.env.WELCOME_CONTENT const introDoc = process.env.WELCOME_CONTENT

View file

@ -1,8 +1,8 @@
import styles from '../styles/Home.module.css' import styles from '@styles/Home.module.css'
import { Page } from '@geist-ui/core' import { Page } from '@geist-ui/core'
import Header from '../components/header' import Header from '@components/header'
import MyPosts from '../components/my-posts' import MyPosts from '@components/my-posts'
const Home = ({ theme, changeTheme }: { theme: "light" | "dark", changeTheme: () => void }) => { const Home = ({ theme, changeTheme }: { theme: "light" | "dark", changeTheme: () => void }) => {
return ( return (

View file

@ -1,11 +1,11 @@
import styles from '../styles/Home.module.css' import styles from '@styles/Home.module.css'
import NewPost from '../components/new-post' import NewPost from '@components/new-post'
import { Page } from '@geist-ui/core' import { Page } from '@geist-ui/core'
import useSignedIn from '../lib/hooks/use-signed-in' import useSignedIn from '@lib/hooks/use-signed-in'
import Header from '../components/header' import Header from '@components/header'
import { ThemeProps } from './_app' import { ThemeProps } from './_app'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import PageSeo from 'components/page-seo' import PageSeo from '@components/page-seo'
const Home = ({ theme, changeTheme }: ThemeProps) => { const Home = ({ theme, changeTheme }: ThemeProps) => {
const router = useRouter() const router = useRouter()

View file

@ -1,7 +1,7 @@
import { Page } from "@geist-ui/core"; import { Page } from "@geist-ui/core";
import PageSeo from "components/page-seo"; import PageSeo from "@components/page-seo";
import Auth from "../components/auth"; import Auth from "@components/auth";
import Header from "../components/header"; import Header from "@components/header";
import { ThemeProps } from "./_app"; import { ThemeProps } from "./_app";
const SignIn = ({ theme, changeTheme }: ThemeProps) => ( const SignIn = ({ theme, changeTheme }: ThemeProps) => (

View file

@ -1,7 +1,7 @@
import { Page } from "@geist-ui/core"; import { Page } from "@geist-ui/core";
import Auth from "components/auth"; import Auth from "@components/auth";
import Header from "components/header"; import Header from "@components/header";
import PageSeo from 'components/page-seo'; import PageSeo from '@components/page-seo';
import { ThemeProps } from "./_app"; import { ThemeProps } from "./_app";
const SignUp = ({ theme, changeTheme }: ThemeProps) => ( const SignUp = ({ theme, changeTheme }: ThemeProps) => (

View file

@ -14,7 +14,12 @@
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "preserve",
"incremental": true, "incremental": true,
"baseUrl": "./" "baseUrl": ".",
"paths": {
"@components/*": ["components/*"],
"@lib/*": ["lib/*"],
"@styles/*": ["styles/*"]
}
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"] "exclude": ["node_modules"]