Skip to content

Commit

Permalink
chore: apply organizeImports by VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Jun 14, 2024
1 parent 203c8cf commit 9087b42
Show file tree
Hide file tree
Showing 34 changed files with 98 additions and 93 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
16 changes: 8 additions & 8 deletions src/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
"use server";

import { cache } from "react";
import { headers } from "next/headers";
import { Metadata } from "next";
import { headers } from "next/headers";
import { permanentRedirect } from "next/navigation";
import { cache } from "react";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import {
ContentResponse,
Content,
ContentResponse,
ContentResponseWithFetchResponse
} from "../../models/models";
import { fetchFromApi } from "../../api/request";
import { asInsight } from "../../utils/insight";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { buildUrl, sluggize } from "../../utils/url";
import { requestContextFrom } from "../../utils/requestContext";
import { buildUrl, sluggize } from "../../utils/url";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { generateForArticleOrPage } from "../metadata";
import { api } from "../../../config";
import { Renderer } from "./renderer";

// TODO: move somewhere if possible
const cachedFindByPath = cache(async (path: string) => {
Expand Down
4 changes: 2 additions & 2 deletions src/app/[...slug]/renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { externalResources as externalResourcesConfig } from "../../../config";
import {
ContentComponent,
CoverComponent,
InjectScriptComponent
} from "../../components/components";
import { Content, Insight, InjectScript } from "../../models/models";
import { Content, InjectScript, Insight } from "../../models/models";
import { getScripts } from "../../utils/injectScript";
import { externalResources as externalResourcesConfig } from "../../../config";

export const Renderer: React.FunctionComponent<{
content: Content;
Expand Down
2 changes: 1 addition & 1 deletion src/app/archives/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { fetchFromApi } from "../../api/request";
import { Archive, ArchiveResponse } from "../../models/models";
import { requestContextFrom } from "../../utils/requestContext";
import { buildUrl } from "../../utils/url";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
18 changes: 9 additions & 9 deletions src/app/articles/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
"use server";

import { cache } from "react";
import { headers } from "next/headers";
import { Metadata } from "next";
import { headers } from "next/headers";
import { notFound } from "next/navigation";
import { cache } from "react";
import { api } from "../../../../config";
import { fetchFromApi } from "../../../api/request";
import {
ContentResponse,
Content,
ContentResponse,
ContentResponseWithFetchResponse
} from "../../../models/models";
import { isMatch } from "../../../utils/match";
import { fetchFromApi } from "../../../api/request";
import { asInsight } from "../../../utils/insight";
import { Renderer } from "./renderer";
import { isMatch } from "../../../utils/match";
import { requestContextFrom } from "../../../utils/requestContext";
import { buildUrl, sluggize } from "../../../utils/url";
import { runWithHandleErrorIf, throwIfError } from "../../handler";
import { generateForArticleOrPage } from "../../metadata";
import { buildUrl, sluggize } from "../../../utils/url";
import { requestContextFrom } from "../../../utils/requestContext";
import { api } from "../../../../config";
import { Renderer } from "./renderer";

const PREFIX_URL = "articles";

Expand Down
4 changes: 2 additions & 2 deletions src/app/articles/[...slug]/renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { externalResources as externalResourcesConfig } from "../../../../config";
import {
ContentComponent,
CoverComponent,
InjectScriptComponent
} from "../../../components/components";
import { Content, Insight, InjectScript } from "../../../models/models";
import { Content, InjectScript, Insight } from "../../../models/models";
import { getScripts } from "../../../utils/injectScript";
import { externalResources as externalResourcesConfig } from "../../../../config";

export const Renderer: React.FunctionComponent<{
content: Content;
Expand Down
4 changes: 2 additions & 2 deletions src/app/articles/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use server";

import { headers } from "next/headers";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import { Article, ArticleResponseWithCount } from "../../models/models";
import { requestContextFrom } from "../../utils/requestContext";
import { buildQueryParams, buildUrl } from "../../utils/url";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { api } from "../../../config";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
6 changes: 3 additions & 3 deletions src/app/clientLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use client";

import "../styles/globals.scss";
import React, { useEffect } from "react";
import { getTheme } from "../services/theme";
import { copyrights, footerItems, headerItems } from "../../config";
import {
BackToTopComponent,
FooterComponent,
HeaderComponent
} from "../components/components";
import { headerItems, footerItems, copyrights } from "../../config";
import { getTheme } from "../services/theme";
import "../styles/globals.scss";

export default function ClientLayout({
children
Expand Down
4 changes: 2 additions & 2 deletions src/app/feeds/index.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { headers } from "next/headers";
import { Feed } from "../../../models/models";
import { api, mainAuthor, siteName, url } from "../../../../config";
import { fetchFromApi } from "../../../api/request";
import { Feed } from "../../../models/models";
import { generateFeedsString } from "../../../services/feeds";
import { api, url, siteName, mainAuthor } from "../../../../config";
import { requestContextFrom } from "../../../utils/requestContext";
import { buildUrl, sluggize } from "../../../utils/url";

Expand Down
18 changes: 9 additions & 9 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from "react";
import { Metadata } from "next";
import ClientLayout from "./clientLayout";
import { getTheme } from "../services/theme";
import React from "react";
import {
siteName,
mainAuthor,
lang,
url,
locale,
defaultImage,
favicon,
injectMetas
injectMetas,
lang,
locale,
mainAuthor,
siteName,
url
} from "../../config";
import { HeadMetaComponent } from "../components/components";
import { getTheme } from "../services/theme";
import { fullUrl } from "../utils/url";
import ClientLayout from "./clientLayout";

export const metadata: Metadata = {
title: siteName,
Expand Down
2 changes: 1 addition & 1 deletion src/app/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Metadata } from "next";
import { Content } from "../models/content";
import {
defaultImage,
defaultRobotsMeta,
locale,
siteName
} from "../../config";
import { Content } from "../models/content";
import { toISODateSrting } from "../utils/time";
import { fullUrl } from "../utils/url";

Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use server";

import { headers } from "next/headers";
import { api } from "../../config";
import { fetchFromApi } from "../api/request";
import { Article, ArticleResponseWithCount } from "../models/models";
import { requestContextFrom } from "../utils/requestContext";
import { buildQueryParams, buildUrl } from "../utils/url";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "./handler";
import { api } from "../../config";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
4 changes: 2 additions & 2 deletions src/app/renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Article } from "../models/models";
import {
CoverComponent,
RecentArticlesComponent
} from "../components/components";
import styles from "../styles/home.module.scss";
import { Article } from "../models/models";
import containerStyles from "../styles/components/container.module.scss";
import styles from "../styles/home.module.scss";

export const Renderer: React.FunctionComponent<{
articles: Array<Article>;
Expand Down
8 changes: 4 additions & 4 deletions src/app/search/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use server";

import { headers } from "next/headers";
import { requestContextFrom } from "../../utils/requestContext";
import { SearchResponse, SearchResponseWithCount } from "../../models/models";
import { fetchFromApi } from "../../api/request";
import { Renderer } from "./renderer";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import { SearchResponse, SearchResponseWithCount } from "../../models/models";
import { requestContextFrom } from "../../utils/requestContext";
import { buildQueryParams, buildUrl, sluggize } from "../../utils/url";
import { Renderer } from "./renderer";

const emptyResult = {
count: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/app/search/renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import React, { useState, useEffect } from "react";
import { useRouter } from "next/navigation";
import React, { useEffect, useState } from "react";
import {
CoverComponent,
SearchResultComponent
Expand Down
10 changes: 5 additions & 5 deletions src/app/series/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"use server";

import { headers } from "next/headers";
import { api } from "../../../../config";
import { fetchFromApi } from "../../../api/request";
import {
Article,
SeriresWithArticlesResponse,
SeriresWithArticles
SeriresWithArticles,
SeriresWithArticlesResponse
} from "../../../models/models";
import { requestContextFrom } from "../../../utils/requestContext";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../../handler";
import { api } from "../../../../config";
import { buildUrl, sluggize } from "../../../utils/url";
import { runWithHandleErrorIf, throwIfError } from "../../handler";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
6 changes: 3 additions & 3 deletions src/app/series/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use server";

import { headers } from "next/headers";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import { Series, SeriesResponse } from "../../models/models";
import { requestContextFrom } from "../../utils/requestContext";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { api } from "../../../config";
import { buildUrl, sluggize } from "../../utils/url";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
2 changes: 1 addition & 1 deletion src/app/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import React, { useState } from "react";
import { useState } from "react";
import { CoverComponent, DropdownComponent } from "../../components/components";
import { getTheme } from "../../services/theme";
import containerStyles from "../../styles/components/container.module.scss";
Expand Down
4 changes: 2 additions & 2 deletions src/app/sitemap.xml/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { headers } from "next/headers";
import { Sitemap } from "../../models/models";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import { Sitemap } from "../../models/models";
import { generateSitemapString } from "../../services/sitemap";
import { requestContextFrom } from "../../utils/requestContext";
import { api } from "../../../config";
import { buildUrl, sluggize } from "../../utils/url";

export async function GET() {
Expand Down
4 changes: 2 additions & 2 deletions src/app/status/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use server";

import { headers } from "next/headers";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import { requestContextFrom } from "../../utils/requestContext";
import { Renderer } from "./renderer";
import { api } from "../../../config";
import { buildUrl, sluggize } from "../../utils/url";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
const { props } = await handler(req);
Expand Down
6 changes: 3 additions & 3 deletions src/app/tags/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use server";

import { headers } from "next/headers";
import { api } from "../../../../config";
import { fetchFromApi } from "../../../api/request";
import { Article, ArticleResponseWithCount } from "../../../models/models";
import { requestContextFrom } from "../../../utils/requestContext";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../../handler";
import { api } from "../../../../config";
import { buildQueryParams, buildUrl, sluggize } from "../../../utils/url";
import { runWithHandleErrorIf, throwIfError } from "../../handler";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
8 changes: 4 additions & 4 deletions src/app/tags/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use server";

import { headers } from "next/headers";
import { Tag } from "../../models/models";
import { api } from "../../../config";
import { fetchFromApi } from "../../api/request";
import { Tag } from "../../models/models";
import { requestContextFrom } from "../../utils/requestContext";
import { Renderer } from "./renderer";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { api } from "../../../config";
import { buildUrl, sluggize } from "../../utils/url";
import { runWithHandleErrorIf, throwIfError } from "../handler";
import { Renderer } from "./renderer";

export default async function Page(req: any) {
return runWithHandleErrorIf(await run(req));
Expand Down
2 changes: 1 addition & 1 deletion src/app/tags/renderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { Tag } from "../../models/models";
import { CoverComponent, TagsComponent } from "../../components/components";
import { Tag } from "../../models/models";

export const Renderer: React.FunctionComponent<{
tags: Array<Tag>;
Expand Down
8 changes: 4 additions & 4 deletions src/components/archives.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client";

import React, { useState, useEffect } from "react";
import React, { useEffect, useState } from "react";
import { archivesPage } from "../../config";
import { Archive, ArchiveFormatedDate } from "../models/models";
import { splittedBy } from "../utils/time";
import styles from "../styles/archives.module.scss";
import containerStyles from "../styles/components/container.module.scss";
import { archivesPage } from "../../config";
import { DropdownComponent } from "./components";
import { sequentialPadPosNum } from "../utils/nums";
import { splittedBy } from "../utils/time";
import { DropdownComponent } from "./components";

export const ArchivesComponent: React.FunctionComponent<{
archives: Array<Archive>;
Expand Down
6 changes: 3 additions & 3 deletions src/components/articles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import Link from "next/link";
import { Article } from "../models/models";
import styles from "../styles/articles.module.scss";
import articlesInSection from "../styles/articlesInSection.module.scss";
import homeStyles from "../styles/home.module.scss";
import flexStyles from "../styles/components/flex.module.scss";
import containerStyles from "../styles/components/container.module.scss";
import buttonStyles from "../styles/components/button.module.scss";
import containerStyles from "../styles/components/container.module.scss";
import flexStyles from "../styles/components/flex.module.scss";
import homeStyles from "../styles/home.module.scss";
import { splittedBy } from "../utils/time";

export const ArticlesComponent: React.FunctionComponent<{
Expand Down
Loading

0 comments on commit 9087b42

Please sign in to comment.