Skip to content

Commit

Permalink
Merge pull request #87 from hikka-io/next-v15.0
Browse files Browse the repository at this point in the history
Next v15
  • Loading branch information
olexh authored Nov 9, 2024
2 parents cafc21d + caf3a15 commit dc268e7
Show file tree
Hide file tree
Showing 87 changed files with 2,763 additions and 3,394 deletions.
5 changes: 4 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import Icons from 'unplugin-icons/webpack';
const nextConfig = {
output: 'standalone',
eslint: {
ignoreDuringBuilds: false,
ignoreDuringBuilds: true,
},
reactStrictMode: true,
productionBrowserSourceMaps: false,
pageExtensions: ['js', 'jsx', 'ts', 'tsx'],
experimental: {
reactCompiler: true,
},
images: {
unoptimized: true,
remotePatterns: [
Expand Down
137 changes: 70 additions & 67 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,42 @@
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@hookform/resolvers": "^3.3.4",
"@marsidev/react-turnstile": "^0.4.1",
"@hookform/resolvers": "^3.9.1",
"@marsidev/react-turnstile": "^1.0.2",
"@mobily/ts-belt": "^3.13.1",
"@next/bundle-analyzer": "^14.0.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-aspect-ratio": "^1.0.3",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-context-menu": "^2.1.5",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-hover-card": "^1.0.7",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slider": "^1.1.2",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toggle": "^1.0.3",
"@radix-ui/react-toggle-group": "^1.0.4",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"@react-email/components": "0.0.21",
"@react-hook/resize-observer": "^1.2.6",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^5.17.19",
"@tanstack/react-query-devtools": "^5.17.19",
"@types/node": "20.6.0",
"@types/react": "^18.2.79",
"@types/react-dom": "18.2.7",
"@next/bundle-analyzer": "15.0.3",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-aspect-ratio": "^1.1.0",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-context-menu": "^2.2.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-primitive": "^2.0.0",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slider": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-toolbar": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@react-email/components": "0.0.28",
"@react-hook/resize-observer": "^2.0.2",
"@tanstack/react-query": "^5.59.20",
"@tanstack/react-query-devtools": "^5.59.20",
"@types/node": "20.9.0",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"@udecode/plate-basic-marks": "^34.0.0",
"@udecode/plate-break": "^34.0.0",
"@udecode/plate-common": "^34.0.1",
Expand All @@ -58,63 +58,62 @@
"@udecode/plate-list": "^34.0.0",
"@udecode/plate-paragraph": "^34.0.0",
"@udecode/plate-reset-node": "^34.0.0",
"@vercel/analytics": "^1.1.1",
"@vercel/og": "^0.6.1",
"babel-plugin-react-compiler": "19.0.0-beta-8a03594-20241020",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"cmdk": "^1.0.0",
"date-fns": "^2.30.0",
"embla-carousel-react": "^8.0.0",
"i18next": "^23.11.2",
"lucide-react": "^0.309.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.4",
"date-fns": "^4.1.0",
"embla-carousel-react": "^8.3.1",
"i18next": "^23.16.5",
"lucide-react": "^0.456.0",
"marked": "^12.0.1",
"next": "14.2.4",
"next-nprogress-bar": "^2.3.9",
"next-plausible": "^3.12.0",
"next-themes": "^0.2.1",
"next": "15.0.3",
"next-nprogress-bar": "^2.3.14",
"next-plausible": "^3.12.4",
"next-themes": "^0.4.3",
"notistack": "^3.0.1",
"postcss": "8.4.38",
"react": "18.2.0",
"postcss": "8.4.47",
"react": "19.0.0-rc-66855b96-20241106",
"react-avatar-editor": "^13.0.2",
"react-dom": "18.2.0",
"react-dropzone": "^14.2.3",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-dropzone": "^14.3.5",
"react-email": "2.1.5",
"react-hook-form": "^7.49.3",
"react-intersection-observer": "^9.5.3",
"react-hook-form": "^7.53.2",
"react-intersection-observer": "^9.13.1",
"react-markdown": "^9.0.1",
"react-number-format": "^5.3.1",
"react-number-format": "^5.4.2",
"rehype-external-links": "^3.0.0",
"remark-directive": "^3.0.0",
"remark-directive-rehype": "^0.4.2",
"remark-mentions": "^1.1.0",
"remark-parse": "^11.0.0",
"sharp": "^0.32.5",
"sharp": "^0.33.5",
"slate": "^0.103.0",
"slate-history": "^0.100.0",
"slate-hyperscript": "^0.100.0",
"slate-react": "^0.105.0",
"tailwind-gradient-mask-image": "^1.1.0",
"tailwind-merge": "^2.2.0",
"tailwindcss": "3.4.1",
"tailwind-gradient-mask-image": "^1.2.0",
"tailwind-merge": "^2.5.4",
"tailwindcss": "3.4.14",
"tailwindcss-animate": "^1.0.7",
"unified": "^11.0.4",
"vaul": "^0.9.0",
"unified": "^11.0.5",
"vaul": "^1.1.1",
"xml-js": "^1.6.11",
"zod": "^3.23.4",
"zod": "^3.23.8",
"zod-i18n-map": "^2.27.0"
},
"devDependencies": {
"@iconify/json": "^2.2.142",
"@iconify/json": "^2.2.270",
"@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@tanstack/eslint-plugin-query": "^5.35.6",
"@tanstack/eslint-plugin-query": "^5.60.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react-avatar-editor": "^13.0.2",
"@types/react-avatar-editor": "^13.0.3",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"autoprefixer": "10.4.15",
"eslint": "^8.49.0",
"eslint-config-next": "13.4.19",
"eslint-config-next": "15.0.3",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-functional": "^6.0.0",
"eslint-plugin-tailwindcss": "^3.15.1",
Expand All @@ -123,7 +122,11 @@
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.9",
"typescript": "^5.2.2",
"unplugin-icons": "^0.18.5"
"unplugin-icons": "^0.20.1"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"resolutions": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}
}
13 changes: 8 additions & 5 deletions src/app/(api)/auth/activate/[token]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import activation from '@/services/api/auth/activation';

export const dynamic = 'force-dynamic';

export async function GET(
request: Request,
{ params: { token } }: { params: { token: string } },
) {
export async function GET(request: Request, props: { params: Promise<{ token: string }> }) {
const params = await props.params;

const {
token
} = params;

try {
const res = await activation({ params: { token } });
cookies().set('auth', res.secret);
(await cookies()).set('auth', res.secret);
} catch (e) {
if ('code' in (e as API.Error)) {
if ((e as API.Error).code === 'auth-modal:activation_expired') {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(api)/auth/google/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function GET(request: Request) {
},
});

cookies().set('auth', res.secret, {
(await cookies()).set('auth', res.secret, {
maxAge: 60 * 60 * 24 * 7,
});
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/(api)/auth/logout/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cookies } from 'next/headers';

export async function GET() {
cookies().delete('auth');
(await cookies()).delete('auth');

return Response.redirect(`${process.env.SITE_URL}`);
}
11 changes: 7 additions & 4 deletions src/app/(api)/auth/reset/[token]/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { redirect } from 'next/navigation';

export async function GET(
request: Request,
{ params: { token } }: { params: { token: string } },
) {
export async function GET(request: Request, props: { params: Promise<{ token: string }> }) {
const params = await props.params;

const {
token
} = params;

return redirect(
'/anime?page=1&iPage=1&modal=passwordConfirm&token=' + token,
);
Expand Down
3 changes: 2 additions & 1 deletion src/app/(pages)/(content)/anime/(anime-list)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ interface Props {
searchParams: { [key: string]: string | string[] | undefined };
}

const AnimeListPage: FC<Props> = async ({ searchParams }) => {
const AnimeListPage: FC<Props> = async props => {
const searchParams = await props.searchParams;
const page = searchParams.page;

if (!page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import Characters from '@/features/anime/anime-view/characters/characters.compon

import _generateMetadata from '@/utils/generate-metadata';

export async function generateMetadata(
{ params }: { params: { slug: string } },
parent: ResolvingMetadata,
): Promise<Metadata> {
export async function generateMetadata(props: { params: Promise<{ slug: string }> }, parent: ResolvingMetadata): Promise<Metadata> {
const params = await props.params;
const parentMetadata = await parent;

return _generateMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import Franchise from '@/features/franchise/franchise.component';

import _generateMetadata from '@/utils/generate-metadata';

export async function generateMetadata(
{ params }: { params: { slug: string } },
parent: ResolvingMetadata,
): Promise<Metadata> {
export async function generateMetadata(props: { params: Promise<{ slug: string }> }, parent: ResolvingMetadata): Promise<Metadata> {
const params = await props.params;
const parentMetadata = await parent;

return _generateMetadata({
Expand All @@ -18,11 +16,17 @@ export async function generateMetadata(
});
}

const AnimeFranchisePage = async ({
searchParams: { content_types },
}: {
searchParams: Record<string, any>;
}) => {
const AnimeFranchisePage = async (
props: {
searchParams: Promise<Record<string, any>>;
}
) => {
const searchParams = await props.searchParams;

const {
content_types
} = searchParams;

if (!content_types) {
return permanentRedirect(
'?content_types=anime&content_types=manga&content_types=novel',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import Media from '@/features/anime/anime-view/media/media.component';

import _generateMetadata from '@/utils/generate-metadata';

export async function generateMetadata(
{ params }: { params: { slug: string } },
parent: ResolvingMetadata,
): Promise<Metadata> {
export async function generateMetadata(props: { params: Promise<{ slug: string }> }, parent: ResolvingMetadata): Promise<Metadata> {
const params = await props.params;
const parentMetadata = await parent;

return _generateMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import Staff from '@/features/anime/anime-view/staff.component';

import _generateMetadata from '@/utils/generate-metadata';

export async function generateMetadata(
{ params }: { params: { slug: string } },
parent: ResolvingMetadata,
): Promise<Metadata> {
export async function generateMetadata(props: { params: Promise<{ slug: string }> }, parent: ResolvingMetadata): Promise<Metadata> {
const params = await props.params;
const parentMetadata = await parent;

return _generateMetadata({
Expand Down
13 changes: 11 additions & 2 deletions src/app/(pages)/(content)/anime/[slug]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@ interface Props extends PropsWithChildren {
export async function generateMetadata(
props: MetadataProps,
): Promise<Metadata> {
return await _generateMetadata(props);
const params = await props.params;
const searchParams = await props.searchParams;

return await _generateMetadata({ params, searchParams });
}

const AnimeLayout: FC<Props> = async ({ params: { slug }, children }) => {
const AnimeLayout: FC<Props> = async (props) => {
const params = await props.params;

const { slug } = params;

const { children } = props;

const queryClient = await getQueryClient();

await prefetchAnimeInfo({ slug });
Expand Down
8 changes: 7 additions & 1 deletion src/app/(pages)/(content)/anime/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ interface Props {
};
}

const AnimePage: FC<Props> = async ({ params: { slug } }) => {
const AnimePage: FC<Props> = async props => {
const params = await props.params;

const {
slug
} = params;

const queryClient = getQueryClient();

await prefetchAnimeInfo({ slug });
Expand Down
2 changes: 1 addition & 1 deletion src/app/(pages)/(content)/anime/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import toDate from 'date-fns/toDate';
import { toDate } from 'date-fns/toDate';
import { MetadataRoute } from 'next';

import getAnimeSitemap from '@/services/api/sitemap/getAnimeSitemap';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { Metadata, ResolvingMetadata } from 'next';

import Anime from '@/features/characters/character-view/anime.component';

export async function generateMetadata(
{ params }: { params: { slug: string } },
parent: ResolvingMetadata,
): Promise<Metadata> {
export async function generateMetadata(props: { params: Promise<{ slug: string }> }, parent: ResolvingMetadata): Promise<Metadata> {
const params = await props.params;
const parentMetadata = await parent;

return {
Expand Down
Loading

0 comments on commit dc268e7

Please sign in to comment.