From 9e118ddf0458e1de847600ef0ea09e745982d6d0 Mon Sep 17 00:00:00 2001 From: berkaltiok <17373485+berkaltiok@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:21:10 +0300 Subject: [PATCH] chore: run formatter --- .editorconfig | 13 ++ .github/workflows/deploy.yml | 2 +- .prettierignore | 102 ++++++++++++++ .prettierrc | 8 ++ babel.config.js | 4 +- blog/2021-08-01-mdx-blog-post.mdx | 4 +- docs/tutorial-basics/create-a-document.md | 18 +-- docs/tutorial-basics/create-a-page.md | 6 +- docs/tutorial-basics/markdown-features.mdx | 21 +-- docs/tutorial-extras/manage-docs-versions.md | 12 +- docs/tutorial-extras/translate-your-site.md | 20 +-- docusaurus.config.js | 136 +++++++++---------- package.json | 4 +- sidebars.js | 6 +- src/components/HomepageFeatures/index.js | 48 +++---- src/css/custom.css | 2 +- src/pages/index.js | 32 ++--- yarn.lock | 5 + 18 files changed, 280 insertions(+), 163 deletions(-) create mode 100644 .editorconfig create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5d12634 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index da440fa..5d1c39b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy to GitHub Pages +name: Deploy on: push: diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..d8fb808 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,102 @@ +### +# Place your Prettier ignore content here + +### +# .gitignore content is duplicated here due to https://github.com/prettier/prettier/issues/8506 + +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +/logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# Nuxt generate +dist + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + +# IDE / Editor +.idea + +# Service worker +sw.* + +# macOS +.DS_Store + +# Vim swap files +*.swp + +static + +.output + +pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..3dc0ef9 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "semi": false, + "singleQuote": false, + "tabWidth": 2, + "htmlWhitespaceSensitivity": "ignore", + "printWidth": 120, + "trailingComma": "none" +} diff --git a/babel.config.js b/babel.config.js index e00595d..26b014a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], -}; + presets: [require.resolve("@docusaurus/core/lib/babel/preset")] +} diff --git a/blog/2021-08-01-mdx-blog-post.mdx b/blog/2021-08-01-mdx-blog-post.mdx index c04ebe3..ad3490f 100644 --- a/blog/2021-08-01-mdx-blog-post.mdx +++ b/blog/2021-08-01-mdx-blog-post.mdx @@ -12,9 +12,9 @@ Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/mar Use the power of React to create interactive blog posts. ```js - + ``` - + ::: diff --git a/docs/tutorial-basics/create-a-document.md b/docs/tutorial-basics/create-a-document.md index c22fe29..93e5c20 100644 --- a/docs/tutorial-basics/create-a-document.md +++ b/docs/tutorial-basics/create-a-document.md @@ -30,7 +30,7 @@ Add metadata to customize the sidebar label and position: ```md title="docs/hello.md" {1-4} --- -sidebar_label: 'Hi!' +sidebar_label: "Hi!" sidebar_position: 3 --- @@ -44,14 +44,14 @@ It is also possible to create your sidebar explicitly in `sidebars.js`: ```js title="sidebars.js" export default { tutorialSidebar: [ - 'intro', + "intro", // highlight-next-line - 'hello', + "hello", { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], - }, - ], -}; + type: "category", + label: "Tutorial", + items: ["tutorial-basics/create-a-document"] + } + ] +} ``` diff --git a/docs/tutorial-basics/create-a-page.md b/docs/tutorial-basics/create-a-page.md index 20e2ac3..e786c4b 100644 --- a/docs/tutorial-basics/create-a-page.md +++ b/docs/tutorial-basics/create-a-page.md @@ -15,8 +15,8 @@ Add **Markdown or React** files to `src/pages` to create a **standalone page**: Create a file at `src/pages/my-react-page.js`: ```jsx title="src/pages/my-react-page.js" -import React from 'react'; -import Layout from '@theme/Layout'; +import React from "react" +import Layout from "@theme/Layout" export default function MyReactPage() { return ( @@ -24,7 +24,7 @@ export default function MyReactPage() {

My React page

This is a React page

- ); + ) } ``` diff --git a/docs/tutorial-basics/markdown-features.mdx b/docs/tutorial-basics/markdown-features.mdx index 35e0082..0d1a023 100644 --- a/docs/tutorial-basics/markdown-features.mdx +++ b/docs/tutorial-basics/markdown-features.mdx @@ -64,14 +64,14 @@ Markdown code blocks are supported with Syntax highlighting. ````md ```jsx title="src/components/HelloDocusaurus.js" function HelloDocusaurus() { - return

Hello, Docusaurus!

; + return

Hello, Docusaurus!

} ``` ```` ```jsx title="src/components/HelloDocusaurus.js" function HelloDocusaurus() { - return

Hello, Docusaurus!

; + return

Hello, Docusaurus!

} ``` @@ -131,21 +131,22 @@ This is Docusaurus green ! This is Facebook blue ! ``` -export const Highlight = ({children, color}) => ( +export const Highlight = ({ children, color }) => ( { - alert(`You clicked the color ${color} with label ${children}`); - }}> + alert(`You clicked the color ${color} with label ${children}`) + }} + > {children} -); +) This is Docusaurus green ! diff --git a/docs/tutorial-extras/manage-docs-versions.md b/docs/tutorial-extras/manage-docs-versions.md index ccda0b9..bee2337 100644 --- a/docs/tutorial-extras/manage-docs-versions.md +++ b/docs/tutorial-extras/manage-docs-versions.md @@ -34,13 +34,13 @@ export default { items: [ // highlight-start { - type: 'docsVersionDropdown', - }, + type: "docsVersionDropdown" + } // highlight-end - ], - }, - }, -}; + ] + } + } +} ``` The docs version dropdown appears in your navbar: diff --git a/docs/tutorial-extras/translate-your-site.md b/docs/tutorial-extras/translate-your-site.md index b5a644a..37865b5 100644 --- a/docs/tutorial-extras/translate-your-site.md +++ b/docs/tutorial-extras/translate-your-site.md @@ -13,10 +13,10 @@ Modify `docusaurus.config.js` to add support for the `fr` locale: ```js title="docusaurus.config.js" export default { i18n: { - defaultLocale: 'en', - locales: ['en', 'fr'], - }, -}; + defaultLocale: "en", + locales: ["en", "fr"] + } +} ``` ## Translate a doc @@ -60,13 +60,13 @@ export default { items: [ // highlight-start { - type: 'localeDropdown', - }, + type: "localeDropdown" + } // highlight-end - ], - }, - }, -}; + ] + } + } +} ``` The locale dropdown now appears in your navbar: diff --git a/docusaurus.config.js b/docusaurus.config.js index e8ee4dc..83090d9 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -4,138 +4,128 @@ // There are various equivalent ways to declare your Docusaurus config. // See: https://docusaurus.io/docs/api/docusaurus-config -import {themes as prismThemes} from 'prism-react-renderer'; +import { themes as prismThemes } from "prism-react-renderer" /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'Parsek', - tagline: 'Dinosaurs are cool', - favicon: 'img/favicon.ico', + title: "Parsek", + tagline: "Open-source modular back-end written in Kotlin", + favicon: "img/favicon.ico", - // Set the production url of your site here - url: 'https://your-docusaurus-site.example.com', - // Set the // pathname under which your site is served - // For GitHub pages deployment, it is often '//' - baseUrl: '/', + url: "https://parsek.dev", + baseUrl: "/", - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. - organizationName: 'facebook', // Usually your GitHub org/user name. - projectName: 'docusaurus', // Usually your repo name. + organizationName: "StatuParsek", + projectName: "parsek", - onBrokenLinks: 'throw', - onBrokenMarkdownLinks: 'warn', + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", - // Even if you don't use internationalization, you can use this field to set - // useful metadata like html lang. For example, if your site is Chinese, you - // may want to replace "en" with "zh-Hans". i18n: { - defaultLocale: 'en', - locales: ['en'], + defaultLocale: "en", + locales: ["en", "tr"] }, presets: [ [ - 'classic', + "classic", /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { - sidebarPath: './sidebars.js', + sidebarPath: "./sidebars.js", // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', + editUrl: "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/" }, blog: { showReadingTime: true, // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', + editUrl: "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/" }, theme: { - customCss: './src/css/custom.css', - }, - }), - ], + customCss: "./src/css/custom.css" + } + }) + ] ], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ // Replace with your project's social card - image: 'img/docusaurus-social-card.jpg', + image: "img/docusaurus-social-card.jpg", navbar: { - title: 'My Site', + title: "Parsek", logo: { - alt: 'My Site Logo', - src: 'img/logo.svg', + alt: "Parsek Logo", + src: "img/logo.svg" }, items: [ { - type: 'docSidebar', - sidebarId: 'tutorialSidebar', - position: 'left', - label: 'Tutorial', + type: "docSidebar", + sidebarId: "tutorialSidebar", + position: "left", + label: "Tutorial" }, - {to: '/blog', label: 'Blog', position: 'left'}, + { to: "/blog", label: "Blog", position: "left" }, { - href: 'https://github.com/facebook/docusaurus', - label: 'GitHub', - position: 'right', - }, - ], + href: "https://github.com/facebook/docusaurus", + label: "GitHub", + position: "right" + } + ] }, footer: { - style: 'dark', + style: "dark", links: [ { - title: 'Docs', + title: "Docs", items: [ { - label: 'Tutorial', - to: '/docs/intro', - }, - ], + label: "Tutorial", + to: "/docs/intro" + } + ] }, { - title: 'Community', + title: "Community", items: [ { - label: 'Stack Overflow', - href: 'https://stackoverflow.com/questions/tagged/docusaurus', + label: "Stack Overflow", + href: "https://stackoverflow.com/questions/tagged/docusaurus" }, { - label: 'Discord', - href: 'https://discordapp.com/invite/docusaurus', + label: "Discord", + href: "https://discordapp.com/invite/docusaurus" }, { - label: 'Twitter', - href: 'https://twitter.com/docusaurus', - }, - ], + label: "Twitter", + href: "https://twitter.com/docusaurus" + } + ] }, { - title: 'More', + title: "More", items: [ { - label: 'Blog', - to: '/blog', + label: "Blog", + to: "/blog" }, { - label: 'GitHub', - href: 'https://github.com/facebook/docusaurus', - }, - ], - }, + label: "GitHub", + href: "https://github.com/facebook/docusaurus" + } + ] + } ], - copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, + copyright: `Copyright © ${new Date().getFullYear()} Parsek` }, prism: { theme: prismThemes.github, - darkTheme: prismThemes.dracula, - }, - }), -}; + darkTheme: prismThemes.dracula + } + }) +} -export default config; +export default config diff --git a/package.json b/package.json index 317f59e..d24b300 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,15 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" + "write-heading-ids": "docusaurus write-heading-ids", + "format": "prettier --write --list-different ." }, "dependencies": { "@docusaurus/core": "3.2.1", "@docusaurus/preset-classic": "3.2.1", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", + "prettier": "^3.2.5", "prism-react-renderer": "^2.3.0", "react": "^18.0.0", "react-dom": "^18.0.0" diff --git a/sidebars.js b/sidebars.js index 3327580..21c5227 100644 --- a/sidebars.js +++ b/sidebars.js @@ -14,7 +14,7 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + tutorialSidebar: [{ type: "autogenerated", dirName: "." }] // But you can create a sidebar manually /* @@ -28,6 +28,6 @@ const sidebars = { }, ], */ -}; +} -export default sidebars; +export default sidebars diff --git a/src/components/HomepageFeatures/index.js b/src/components/HomepageFeatures/index.js index acc7621..b21dcd3 100644 --- a/src/components/HomepageFeatures/index.js +++ b/src/components/HomepageFeatures/index.js @@ -1,43 +1,43 @@ -import clsx from 'clsx'; -import Heading from '@theme/Heading'; -import styles from './styles.module.css'; +import clsx from "clsx" +import Heading from "@theme/Heading" +import styles from "./styles.module.css" const FeatureList = [ { - title: 'Easy to Use', - Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, + title: "Easy to Use", + Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default, description: ( <> - Docusaurus was designed from the ground up to be easily installed and - used to get your website up and running quickly. + Docusaurus was designed from the ground up to be easily installed and used to get your website up and running + quickly. - ), + ) }, { - title: 'Focus on What Matters', - Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, + title: "Focus on What Matters", + Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default, description: ( <> - Docusaurus lets you focus on your docs, and we'll do the chores. Go - ahead and move your docs into the docs directory. + Docusaurus lets you focus on your docs, and we'll do the chores. Go ahead and move your docs into the{" "} + docs directory. - ), + ) }, { - title: 'Powered by React', - Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, + title: "Powered by React", + Svg: require("@site/static/img/undraw_docusaurus_react.svg").default, description: ( <> - Extend or customize your website layout by reusing React. Docusaurus can - be extended while reusing the same header and footer. + Extend or customize your website layout by reusing React. Docusaurus can be extended while reusing the same + header and footer. - ), - }, -]; + ) + } +] -function Feature({Svg, title, description}) { +function Feature({ Svg, title, description }) { return ( -
+
@@ -46,7 +46,7 @@ function Feature({Svg, title, description}) {

{description}

- ); + ) } export default function HomepageFeatures() { @@ -60,5 +60,5 @@ export default function HomepageFeatures() { - ); + ) } diff --git a/src/css/custom.css b/src/css/custom.css index 2bc6a4c..3859140 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -18,7 +18,7 @@ } /* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { +[data-theme="dark"] { --ifm-color-primary: #25c2a0; --ifm-color-primary-dark: #21af90; --ifm-color-primary-darker: #1fa588; diff --git a/src/pages/index.js b/src/pages/index.js index a8c61f2..7c404c6 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,43 +1,39 @@ -import clsx from 'clsx'; -import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; -import HomepageFeatures from '@site/src/components/HomepageFeatures'; +import clsx from "clsx" +import Link from "@docusaurus/Link" +import useDocusaurusContext from "@docusaurus/useDocusaurusContext" +import Layout from "@theme/Layout" +import HomepageFeatures from "@site/src/components/HomepageFeatures" -import Heading from '@theme/Heading'; -import styles from './index.module.css'; +import Heading from "@theme/Heading" +import styles from "./index.module.css" function HomepageHeader() { - const {siteConfig} = useDocusaurusContext(); + const { siteConfig } = useDocusaurusContext() return ( -
+
{siteConfig.title}

{siteConfig.tagline}

- + Docusaurus Tutorial - 5min ⏱️
- ); + ) } export default function Home() { - const {siteConfig} = useDocusaurusContext(); + const { siteConfig } = useDocusaurusContext() return ( - +
- ); + ) } diff --git a/yarn.lock b/yarn.lock index d54c0a1..6d2cfe0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6693,6 +6693,11 @@ postcss@^8.4.17, postcss@^8.4.21, postcss@^8.4.26, postcss@^8.4.33: picocolors "^1.0.0" source-map-js "^1.2.0" +prettier@^3.2.5: + version "3.2.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== + pretty-error@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6"