From 00c0b29a4b69c881119695d6651f7738eb578989 Mon Sep 17 00:00:00 2001 From: emiljohansson Date: Sat, 18 Feb 2023 16:56:09 -0700 Subject: [PATCH] prettify all files --- .prettierignore | 3 + apps/code-not-found/next.config.js | 2 +- apps/code-not-found/package.json | 36 +- apps/code-not-found/pages/_app.tsx | 4 +- apps/code-not-found/pages/api/hello.ts | 9 +- apps/code-not-found/pages/index.tsx | 140 +-- apps/code-not-found/pages/page-a.tsx | 104 +- apps/code-not-found/styles/Home.module.css | 122 +-- apps/code-not-found/styles/globals.css | 14 +- apps/code-not-found/tsconfig.json | 56 +- apps/design/next.config.js | 14 +- apps/design/package.json | 50 +- apps/design/pages/_app.tsx | 27 +- apps/design/pages/_document.tsx | 23 +- apps/design/pages/api/hello.ts | 9 +- apps/design/pages/index.tsx | 373 +++---- apps/design/postcss.config.js | 8 +- apps/design/tailwind.config.js | 2 +- apps/design/tsconfig.json | 57 +- apps/games/README.md | 5 +- apps/games/components/Layout.tsx | 10 +- apps/games/lib/deck.ts | 20 +- apps/games/lib/game.ts | 54 +- apps/games/lib/hooks.ts | 22 +- apps/games/next.config.js | 10 +- apps/games/package.json | 48 +- apps/games/pages/_app.tsx | 12 +- apps/games/pages/api/hello.ts | 9 +- apps/games/pages/fps.tsx | 58 +- apps/games/pages/idiot.tsx | 316 +++--- apps/games/pages/index.tsx | 52 +- apps/games/pages/preload.tsx | 68 +- apps/games/pages/spider.tsx | 435 ++++---- apps/games/pages/wordle.tsx | 358 ++++--- apps/games/postcss.config.js | 8 +- apps/games/styles/globals.css | 16 +- apps/games/tailwind.config.js | 2 +- apps/games/tsconfig.json | 61 +- apps/games/types/card-games.ts | 12 +- apps/next/.vscode/settings.json | 6 +- apps/next/app/encryption/head.tsx | 16 +- apps/next/app/encryption/page.tsx | 122 ++- apps/next/app/head.tsx | 14 +- apps/next/app/page.tsx | 270 +++-- apps/next/components/ConfirmButton.tsx | 48 +- apps/next/components/Content.tsx | 2 +- apps/next/components/Layout.tsx | 2 +- apps/next/components/MineSweaper.tsx | 967 +++++++++--------- apps/next/components/ProgressBar.tsx | 78 +- apps/next/components/RandomString.tsx | 24 +- apps/next/components/Section.tsx | 27 +- apps/next/components/TwoWayAuthEnter.tsx | 155 +-- apps/next/components/TwoWayAuthGenerate.tsx | 94 +- .../next/components/rsc/ClientItem.client.tsx | 14 +- .../components/rsc/ClientItemChild.client.tsx | 6 +- .../next/components/rsc/ServerItem.server.tsx | 2 +- apps/next/next.config.js | 16 +- apps/next/package.json | 82 +- apps/next/pages/404.tsx | 18 +- apps/next/pages/_app.tsx | 27 +- apps/next/pages/_document.tsx | 50 +- apps/next/pages/api/calculate/index.ts | 14 +- apps/next/pages/api/index.ts | 22 +- apps/next/pages/api/random-words.ts | 32 +- apps/next/pages/api/two-factor/[fn].ts | 164 ++- apps/next/pages/calculate.tsx | 83 +- apps/next/pages/confirm-button.tsx | 38 +- apps/next/pages/current-time.tsx | 43 +- apps/next/pages/hooks.tsx | 201 ++-- apps/next/pages/index-old.tsx | 279 +++-- apps/next/pages/ms.tsx | 41 +- apps/next/pages/password-generator.tsx | 350 +++---- apps/next/pages/progress-bar.tsx | 26 +- apps/next/pages/random-string.tsx | 74 +- apps/next/pages/rsc.server.tsx | 36 +- apps/next/pages/slots.tsx | 22 +- apps/next/pages/two-way-auth-enter.tsx | 24 +- apps/next/pages/two-way-auth-generate.tsx | 24 +- apps/next/postcss.config.js | 8 +- apps/next/styles/globals.css | 2 +- apps/next/tailwind.config.js | 2 +- apps/next/tsconfig.json | 73 +- apps/next/types/time.ts | 6 +- apps/next/ui/DefaultTags.tsx | 40 +- apps/password-manager/@types/accounts.ts | 8 +- apps/password-manager/next.config.js | 10 +- apps/password-manager/package.json | 56 +- apps/password-manager/pages/_app.tsx | 16 +- apps/password-manager/pages/accounts.tsx | 144 +-- apps/password-manager/pages/add-account.tsx | 213 ++-- .../pages/api/auth/[...supabase].ts | 2 +- apps/password-manager/pages/api/plaintext.ts | 33 +- apps/password-manager/pages/index.tsx | 28 +- apps/password-manager/pages/login.tsx | 62 +- apps/password-manager/pages/sign-out.tsx | 18 +- apps/password-manager/postcss.config.js | 8 +- apps/password-manager/tailwind.config.js | 2 +- apps/password-manager/tsconfig.json | 59 +- cypress.config.ts | 46 +- cypress/.eslintrc.js | 18 +- cypress/e2e/calculate.cy.ts | 36 +- cypress/e2e/home.cy.ts | 40 +- cypress/e2e/progress-bar.cy.ts | 20 +- cypress/fixtures/example.json | 6 +- cypress/support/commands.ts | 12 +- cypress/support/component-index.html | 24 +- cypress/support/component.ts | 10 +- cypress/tsconfig.json | 19 +- package.json | 4 +- packages/lib/@types/index.ts | 8 +- packages/lib/hooks/useCurrentTime.ts | 48 +- packages/lib/hooks/useInterval.ts | 26 +- packages/lib/tests/classNames.spec.ts | 12 +- packages/lib/tests/math.spec.ts | 24 +- packages/lib/utils/array.ts | 30 +- packages/lib/utils/date.ts | 24 +- packages/lib/utils/math.ts | 16 +- packages/lib/utils/noop.ts | 4 +- packages/lib/utils/number.ts | 3 +- packages/lib/utils/string.ts | 46 +- packages/shared/Select/Select.tsx | 64 +- packages/shared/Select/SelectItem.tsx | 32 +- packages/shared/Select/SelectLabel.tsx | 2 +- packages/shared/Select/SelectSeparator.tsx | 4 +- packages/shared/Select/index.tsx | 8 +- packages/shared/globals.css | 181 ++-- packages/shared/package.json | 44 +- packages/shared/tsconfig.json | 2 +- turbo.json | 73 +- 129 files changed, 3811 insertions(+), 4007 deletions(-) diff --git a/.prettierignore b/.prettierignore index 87715a7..c43d892 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,6 +9,9 @@ dist .env.* !.env.example .git +.github +coverage +pnpm-* # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml diff --git a/apps/code-not-found/next.config.js b/apps/code-not-found/next.config.js index a843cbe..d139cfa 100644 --- a/apps/code-not-found/next.config.js +++ b/apps/code-not-found/next.config.js @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, + reactStrictMode: true, } module.exports = nextConfig diff --git a/apps/code-not-found/package.json b/apps/code-not-found/package.json index ae7d851..c0e6f0a 100644 --- a/apps/code-not-found/package.json +++ b/apps/code-not-found/package.json @@ -1,20 +1,20 @@ { - "name": "code-not-found", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "PORT=3004 next dev", - "build": "next build", - "start": "PORT=3004 next start", - "lint": "next lint" - }, - "dependencies": { - "next": "13.1.1", - "react": "18.2.0", - "react-dom": "18.2.0" - }, - "devDependencies": { - "config": "workspace:*", - "tsconfig": "workspace:*" - } + "name": "code-not-found", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "PORT=3004 next dev", + "build": "next build", + "start": "PORT=3004 next start", + "lint": "next lint" + }, + "dependencies": { + "next": "13.1.1", + "react": "18.2.0", + "react-dom": "18.2.0" + }, + "devDependencies": { + "config": "workspace:*", + "tsconfig": "workspace:*" + } } diff --git a/apps/code-not-found/pages/_app.tsx b/apps/code-not-found/pages/_app.tsx index a20e33f..2675529 100644 --- a/apps/code-not-found/pages/_app.tsx +++ b/apps/code-not-found/pages/_app.tsx @@ -1,8 +1,8 @@ import '../styles/globals.css' import type { AppProps } from 'next/app' -function MyApp ({ Component, pageProps }: AppProps) { - return +function MyApp({ Component, pageProps }: AppProps) { + return } export default MyApp diff --git a/apps/code-not-found/pages/api/hello.ts b/apps/code-not-found/pages/api/hello.ts index b38ee99..ce9023c 100644 --- a/apps/code-not-found/pages/api/hello.ts +++ b/apps/code-not-found/pages/api/hello.ts @@ -2,12 +2,9 @@ import type { NextApiRequest, NextApiResponse } from 'next' type Data = { - name: string + name: string } -export default function handler ( - req: NextApiRequest, - res: NextApiResponse, -) { - res.status(200).json({ name: 'John Doe' }) +export default function handler(req: NextApiRequest, res: NextApiResponse) { + res.status(200).json({ name: 'John Doe' }) } diff --git a/apps/code-not-found/pages/index.tsx b/apps/code-not-found/pages/index.tsx index 001a7af..b52ea0f 100644 --- a/apps/code-not-found/pages/index.tsx +++ b/apps/code-not-found/pages/index.tsx @@ -4,80 +4,88 @@ import Image from 'next/image' import styles from '../styles/Home.module.css' const HomePage: NextPage = () => { - return ( - <> - -
- - Create Next App - - - + return ( + <> + + + - -
- - ) + + + + ) } export default HomePage -export function getStaticProps () { - return { - props: { - initialData: { - name: 'John Doe', - age: 35, - }, - }, - } +export function getStaticProps() { + return { + props: { + initialData: { + name: 'John Doe', + age: 35, + }, + }, + } } diff --git a/apps/code-not-found/pages/page-a.tsx b/apps/code-not-found/pages/page-a.tsx index 81e869a..dba4053 100644 --- a/apps/code-not-found/pages/page-a.tsx +++ b/apps/code-not-found/pages/page-a.tsx @@ -4,69 +4,61 @@ import Image from 'next/image' import styles from '../styles/Home.module.css' const PageAPage: NextPage = () => { - return ( -
- - Create Next App - - - + return ( +
+ + Create Next App + + + -
-

- Welcome to Page A -

+
+

Welcome to Page A

-

- Get started by editing{' '} - pages/index.tsx -

+

+ Get started by editing pages/index.tsx +

-
+ +

Deploy →

+

Instantly deploy your Next.js site to a public URL with Vercel.

+
+
+ - -
- ) + + + ) } export default PageAPage diff --git a/apps/code-not-found/styles/Home.module.css b/apps/code-not-found/styles/Home.module.css index 32a57d5..e380026 100644 --- a/apps/code-not-found/styles/Home.module.css +++ b/apps/code-not-found/styles/Home.module.css @@ -1,116 +1,116 @@ .container { - padding: 0 2rem; + padding: 0 2rem; } .main { - min-height: 100vh; - padding: 4rem 0; - flex: 1; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; + min-height: 100vh; + padding: 4rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; } .footer { - display: flex; - flex: 1; - padding: 2rem 0; - border-top: 1px solid #eaeaea; - justify-content: center; - align-items: center; + display: flex; + flex: 1; + padding: 2rem 0; + border-top: 1px solid #eaeaea; + justify-content: center; + align-items: center; } .footer a { - display: flex; - justify-content: center; - align-items: center; - flex-grow: 1; + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; } .title a { - color: #0070f3; - text-decoration: none; + color: #0070f3; + text-decoration: none; } .title a:hover, .title a:focus, .title a:active { - text-decoration: underline; + text-decoration: underline; } .title { - margin: 0; - line-height: 1.15; - font-size: 4rem; + margin: 0; + line-height: 1.15; + font-size: 4rem; } .title, .description { - text-align: center; + text-align: center; } .description { - margin: 4rem 0; - line-height: 1.5; - font-size: 1.5rem; + margin: 4rem 0; + line-height: 1.5; + font-size: 1.5rem; } .code { - background: #fafafa; - border-radius: 5px; - padding: 0.75rem; - font-size: 1.1rem; - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; + background: #fafafa; + border-radius: 5px; + padding: 0.75rem; + font-size: 1.1rem; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; } .grid { - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - max-width: 800px; + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + max-width: 800px; } .card { - margin: 1rem; - padding: 1.5rem; - text-align: left; - color: inherit; - text-decoration: none; - border: 1px solid #eaeaea; - border-radius: 10px; - transition: color 0.15s ease, border-color 0.15s ease; - max-width: 300px; + margin: 1rem; + padding: 1.5rem; + text-align: left; + color: inherit; + text-decoration: none; + border: 1px solid #eaeaea; + border-radius: 10px; + transition: color 0.15s ease, border-color 0.15s ease; + max-width: 300px; } .card:hover, .card:focus, .card:active { - color: #0070f3; - border-color: #0070f3; + color: #0070f3; + border-color: #0070f3; } .card h2 { - margin: 0 0 1rem 0; - font-size: 1.5rem; + margin: 0 0 1rem 0; + font-size: 1.5rem; } .card p { - margin: 0; - font-size: 1.25rem; - line-height: 1.5; + margin: 0; + font-size: 1.25rem; + line-height: 1.5; } .logo { - height: 1em; - margin-left: 0.5rem; + height: 1em; + margin-left: 0.5rem; } @media (max-width: 600px) { - .grid { - width: 100%; - flex-direction: column; - } + .grid { + width: 100%; + flex-direction: column; + } } diff --git a/apps/code-not-found/styles/globals.css b/apps/code-not-found/styles/globals.css index e5e2dcc..67f28bb 100644 --- a/apps/code-not-found/styles/globals.css +++ b/apps/code-not-found/styles/globals.css @@ -1,16 +1,16 @@ html, body { - padding: 0; - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, + Fira Sans, Droid Sans, Helvetica Neue, sans-serif; } a { - color: inherit; - text-decoration: none; + color: inherit; + text-decoration: none; } * { - box-sizing: border-box; + box-sizing: border-box; } diff --git a/apps/code-not-found/tsconfig.json b/apps/code-not-found/tsconfig.json index 1775ffc..e9fe231 100644 --- a/apps/code-not-found/tsconfig.json +++ b/apps/code-not-found/tsconfig.json @@ -1,35 +1,25 @@ { - "extends": "tsconfig/nextjs.json", - "compilerOptions": { - "baseUrl": ".", - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "paths": { - "@/components/*": ["./components/*"] - } - }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "extends": "tsconfig/nextjs.json", + "compilerOptions": { + "baseUrl": ".", + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "paths": { + "@/components/*": ["./components/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] } diff --git a/apps/design/next.config.js b/apps/design/next.config.js index 1bd0dd2..5e09e13 100644 --- a/apps/design/next.config.js +++ b/apps/design/next.config.js @@ -1,13 +1,11 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, - swcMinify: true, - experimental: { - externalDir: true, - }, - basePath: process.env.NODE_ENV === 'production' - ? '/design' - : '', + reactStrictMode: true, + swcMinify: true, + experimental: { + externalDir: true, + }, + basePath: process.env.NODE_ENV === 'production' ? '/design' : '', } module.exports = nextConfig diff --git a/apps/design/package.json b/apps/design/package.json index ad43332..c0992dd 100644 --- a/apps/design/package.json +++ b/apps/design/package.json @@ -1,27 +1,27 @@ { - "name": "design-app", - "private": true, - "scripts": { - "dev": "PORT=3001 next dev", - "build": "next build", - "export": "next export", - "start": "PORT=3001 next start", - "lint": "next lint" - }, - "dependencies": { - "@radix-ui/react-icons": "1.1.1", - "@radix-ui/react-label": "1.0.0", - "@radix-ui/react-progress": "1.0.0", - "@radix-ui/react-radio-group": "latest", - "framer-motion": "6.2.3", - "lib": "workspace:*", - "next": "13.1.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "shared": "workspace:*" - }, - "devDependencies": { - "config": "workspace:*", - "tsconfig": "workspace:*" - } + "name": "design-app", + "private": true, + "scripts": { + "dev": "PORT=3001 next dev", + "build": "next build", + "export": "next export", + "start": "PORT=3001 next start", + "lint": "next lint" + }, + "dependencies": { + "@radix-ui/react-icons": "1.1.1", + "@radix-ui/react-label": "1.0.0", + "@radix-ui/react-progress": "1.0.0", + "@radix-ui/react-radio-group": "latest", + "framer-motion": "6.2.3", + "lib": "workspace:*", + "next": "13.1.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "shared": "workspace:*" + }, + "devDependencies": { + "config": "workspace:*", + "tsconfig": "workspace:*" + } } diff --git a/apps/design/pages/_app.tsx b/apps/design/pages/_app.tsx index a1f6af7..4af32ae 100644 --- a/apps/design/pages/_app.tsx +++ b/apps/design/pages/_app.tsx @@ -2,17 +2,18 @@ import type { AppProps } from 'next/app' import Head from 'next/head' import 'shared/globals.css' -export default function App ({ Component, pageProps }: AppProps) { - return ( - <> - -