Skip to content

Commit

Permalink
fix build compile
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMelior committed Jul 16, 2024
1 parent 864b25b commit 1365d54
Show file tree
Hide file tree
Showing 37 changed files with 53 additions and 152 deletions.
2 changes: 1 addition & 1 deletion app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClientProviders } from '@/app/providers/client-providers';
import '@/app/styles/index.scss';
import { i18n, Locale } from '@/shared/config';
import { i18n, Locale } from '@/shared/config/i18n';
import { FontDefault } from '@/shared/const/fonts';
import { Light, PageLoader } from '@/shared/ui';
import { Footer, Navbar, Sidebar } from '@/widgets';
Expand Down
2 changes: 1 addition & 1 deletion app/[lang]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getDictionary } from '@/shared/config';
import { getDictionary } from '@/shared/config/i18n';

export default async function NotFound() {
const dictionary = await getDictionary();
Expand Down
4 changes: 2 additions & 2 deletions app/[lang]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getLang, MDXRemote } from '@/shared/config';
import { getMdx } from '@/shared/lib';
import { getLang } from '@/shared/config/i18n';
import { getMdx, MDXRemote } from '@/shared/config/mdx';
import { StackButtons } from '@/shared/ui';
import { Header } from '@/widgets';
import path from 'path';
Expand Down
2 changes: 1 addition & 1 deletion app/[lang]/projects/[category]/[name]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getProject } from '@/entity/project';
import { MDXRemote } from '@/shared/config';
import { MDXRemote } from '@/shared/config/mdx';
import { Header } from '@/widgets';
import { MDXComponents } from 'mdx/types';
import { Metadata } from 'next';
Expand Down
3 changes: 2 additions & 1 deletion app/[lang]/projects/[category]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { getProjectsByCategory } from '@/entity/project';
import { getDictionary, Link } from '@/shared/config';
import { getDictionary } from '@/shared/config/i18n';
import { Header } from '@/widgets';
import { Metadata } from 'next';
import Link from 'next/link';

export type ProjectCategoryPageProps = {
params: { category: string };
Expand Down
25 changes: 0 additions & 25 deletions json-server/db.json

This file was deleted.

63 changes: 0 additions & 63 deletions json-server/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { i18n } from '@/shared/config';
import { i18n } from '@/shared/config/i18n';
import { NextRequest, NextResponse } from 'next/server';

export function middleware(request: NextRequest) {
Expand Down
2 changes: 1 addition & 1 deletion projects/best-practice/app-router-auth/examples/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LogoutButton } from '@/features';
import { getDictionary } from '@/shared/config';
import { getDictionary } from '@/shared/config/i18n';
import { CodeBlock } from '@/shared/ui';
import { Card } from '@nextui-org/react';
import { FiUserCheck } from 'react-icons/fi';
Expand Down
2 changes: 1 addition & 1 deletion src/entity/project/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getProject } from './model/services/get-project';
import { getProjects } from './model/services/get-projects';
import { getProjectsByCategory } from './model/services/get-projects-by-category';
import { ProjectResponse, ProjectsResponse } from './model/types/mdx.type';
import { ProjectResponse, ProjectsResponse } from './model/types/project.type';

export { getProject, getProjects, getProjectsByCategory };
export type { ProjectResponse, ProjectsResponse };
6 changes: 3 additions & 3 deletions src/entity/project/model/services/get-project.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use server';

import { getLang } from '@/shared/config';
import { CategoryMetadata, getMdx } from '@/shared/lib';
import { getLang } from '@/shared/config/i18n';
import { CategoryMetadata, getMdx } from '@/shared/config/mdx';
import path from 'path';
import { ProjectResponse } from '../types/mdx.type';
import { ProjectResponse } from '../types/project.type';

export async function getProject(
category: string,
Expand Down
4 changes: 2 additions & 2 deletions src/entity/project/model/services/get-projects-by-category.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';

import { getLang } from '@/shared/config';
import { CategoryMetadata, getMdx, ProjectMetadata } from '@/shared/lib';
import { getLang } from '@/shared/config/i18n';
import { CategoryMetadata, getMdx, ProjectMetadata } from '@/shared/config/mdx';
import fs from 'fs/promises';
import path from 'path';

Expand Down
6 changes: 3 additions & 3 deletions src/entity/project/model/services/get-projects.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use server';

import { getLang } from '@/shared/config';
import { CategoryMetadata, getMdx, ProjectMetadata } from '@/shared/lib';
import { getLang } from '@/shared/config/i18n';
import { CategoryMetadata, getMdx, ProjectMetadata } from '@/shared/config/mdx';
import fs from 'fs/promises';
import path from 'path';
import { ProjectsResponse } from '../types/mdx.type';
import { ProjectsResponse } from '../types/project.type';

export async function getProjects(): Promise<ProjectsResponse[]> {
const lang = await getLang();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CategoryMetadata, ProjectMetadata } from '@/shared/lib';
import { CategoryMetadata, ProjectMetadata } from '@/shared/config/mdx';

export interface ProjectResponse {
metadata: ProjectMetadata;
Expand Down
2 changes: 1 addition & 1 deletion src/features/auth/ui/logout-button/logout-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Dictionary } from '@/shared/config';
import { Dictionary } from '@/shared/config/i18n';
import { Button } from '@nextui-org/react';
import { RxExit } from 'react-icons/rx';
import { logout } from '../../services/logout';
Expand Down
2 changes: 1 addition & 1 deletion src/features/locale-switcher/locale-switcher.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Dictionary, i18n, Locale } from '@/shared/config';
import { Dictionary, i18n, Locale } from '@/shared/config/i18n';
import {
Button,
Dropdown,
Expand Down
9 changes: 9 additions & 0 deletions src/shared/config/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Dictionary, getDictionary } from './dictionaries';
import { getLang } from './get-lang';
import { i18n, Locale } from './i18n.config';
import { Link } from './link';
import { useDictionary } from './use-dictionary';
import { useLang } from './use-lang';

export { getDictionary, getLang, i18n, Link, useDictionary, useLang };
export type { Dictionary, Locale };
20 changes: 0 additions & 20 deletions src/shared/config/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import fs from 'fs/promises';
import matter from 'gray-matter';
import { ProjectMetadata } from './types/get-mdx.type';
import { ProjectMetadata } from '../../config/mdx/types/get-mdx.type';

interface MdxResponse<T> {
metadata: T;
Expand Down
7 changes: 7 additions & 0 deletions src/shared/config/mdx/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getMdx } from './get-mdx';
import { MDXComponentsData } from './mdx-components';
import { MDXRemote } from './mdx-remote';
import { CategoryMetadata, ProjectMetadata } from './types/get-mdx.type';

export { getMdx, MDXComponentsData, MDXRemote };
export type { CategoryMetadata, ProjectMetadata };
File renamed without changes.
2 changes: 1 addition & 1 deletion src/shared/hooks/useCopy/useCopy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useDictionary } from '@/shared/config';
import { useDictionary } from '@/shared/config/i18n';
import { useState } from 'react';
import { useMessage } from '../useMessage/useMessage';

Expand Down
2 changes: 1 addition & 1 deletion src/shared/lib/get-pathname/get-pathname.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use server';

import { i18n, Locale } from '@/shared/config';
import { i18n, Locale } from '@/shared/config/i18n';
import { headers } from 'next/headers';

interface GetPathnameProps {
Expand Down
8 changes: 0 additions & 8 deletions src/shared/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import { getMdx } from './get-mdx/get-mdx';
import {
CategoryMetadata,
ProjectMetadata,
} from './get-mdx/types/get-mdx.type';
import { getPathname } from './get-pathname/get-pathname';
import { gitHubRepoLink } from './github-repo-link/github-repo-link';
import { rehypeExtractCodeProps } from './rehype-extract-code-props/rehype-extract-code-props';
Expand All @@ -12,12 +7,9 @@ import { toLatin } from './to-latin/to-latin';

export {
cn,
getMdx,
getPathname,
gitHubRepoLink,
rehypeExtractCodeProps,
toKebabCase,
toLatin,
};

export type { CategoryMetadata, ProjectMetadata };
2 changes: 1 addition & 1 deletion src/shared/ui/code-block/code-block.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Dictionary } from '@/shared/config';
import { Dictionary } from '@/shared/config/i18n';
import { FontCode, FontDefault } from '@/shared/const/fonts';
import { cn, gitHubRepoLink } from '@/shared/lib';
import { GitHubPath } from '@/shared/types/github-path';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/code-block/code.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Dictionary } from '@/shared/config';
import { Dictionary } from '@/shared/config/i18n';
import { FontDefault } from '@/shared/const/fonts';
import { useCopy } from '@/shared/hooks';
import { cn } from '@/shared/lib';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/copy-button/copy-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Dictionary } from '@/shared/config';
import { Dictionary } from '@/shared/config/i18n';
import { useCopy } from '@/shared/hooks';
import { Button, Tooltip, TooltipProps } from '@nextui-org/react';
import { FC } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/download-cv-button/download-cv-button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dictionary, Link } from '@/shared/config';
import { Dictionary, Link } from '@/shared/config/i18n';
import { cn } from '@/shared/lib';
import { Button, ButtonProps } from '@nextui-org/react';
import { FC } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/page-loader/page-loader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logo } from '@/shared/assets/icon/Logo';
import { getDictionary } from '@/shared/config';
import { getDictionary } from '@/shared/config/i18n';
import cn from 'clsx';
import { FC } from 'react';
import cls from './page-loader.module.scss';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/sidebar-navigation/sidebar-navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { ProjectsResponse } from '@/entity/project';
import { Link } from '@/shared/config';
import { Link } from '@/shared/config/i18n';
import { SidebarLinks } from '@/shared/const/sidebar-links';
import { cn } from '@nextui-org/react';
import { usePathname } from 'next/navigation';
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ui/text/text.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from '@/shared/config';
import { Link } from '@/shared/config/i18n';
import { cn, toKebabCase, toLatin } from '@/shared/lib';
import { ComponentPropsWithoutRef } from 'react';
import { FiLink } from 'react-icons/fi';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/footer/footer-github-link.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Dictionary, i18n, Link, Locale } from '@/shared/config';
import { Dictionary, i18n, Link, Locale } from '@/shared/config/i18n';
import { usePathname } from 'next/navigation';
import { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/footer/footer-navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { ProjectsResponse } from '@/entity/project';
import { Dictionary, Link } from '@/shared/config';
import { Dictionary, Link } from '@/shared/config/i18n';
import { Button } from '@nextui-org/react';
import { usePathname } from 'next/navigation';
import { useEffect, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getProjects } from '@/entity/project';
import { getDictionary, getLang, Link } from '@/shared/config';
import { getDictionary, getLang, Link } from '@/shared/config/i18n';
import { FooterGithubLink } from './footer-github-link';
import { FooterNavigation } from './footer-navigation';
import cls from './footer.module.scss';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from '@/shared/config';
import { Link } from '@/shared/config/i18n';
import { StackButtons, StackVariants } from '@/shared/ui';
import { cn, Skeleton } from '@nextui-org/react';

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/navbar/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getProjects } from '@/entity/project';
import { Burger, LocaleSwitcher, ThemeSwitcher } from '@/features';
import { Logo } from '@/shared/assets/icon/Logo';
import { getDictionary, Link } from '@/shared/config';
import { getDictionary, Link } from '@/shared/config/i18n';
import { DownloadCvButton, GlowingLine, SidebarNavigation } from '@/shared/ui';
import { Button } from '@nextui-org/react';
import { BsGithub } from 'react-icons/bs';
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getProjects } from '@/entity/project';
import { getDictionary } from '@/shared/config';
import { getDictionary } from '@/shared/config/i18n';
import { cn } from '@/shared/lib';
import { DownloadCvButton, SidebarNavigation } from '@/shared/ui';
import cls from './sidebar.module.scss';
Expand Down

0 comments on commit 1365d54

Please sign in to comment.