From 74b314ab0f5ab30977e56c175b339ff46bb3307e Mon Sep 17 00:00:00 2001 From: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com> Date: Tue, 20 Jan 2026 18:38:20 +0100 Subject: [PATCH] refactor: setup prettier as formatter for the whole monorepo (#26) --- .github/workflows/basic-build.yml | 31 - .github/workflows/ci.yml | 61 + .gitignore | 18 + .husky/pre-commit | 1 + .prettierignore | 5 + .prettierrc.json | 9 + .vscode/extensions.json | 8 + .vscode/settings.json | 8 + apps/backend/.devcontainer/devcontainer.json | 54 +- .../.github/workflows/empty-issues-closer.yml | 6 +- .../.github/workflows/update-langs.yml | 3 +- apps/backend/.nvmrc | 1 - apps/backend/.prettierignore | 5 - apps/backend/.prettierrc.json | 6 - apps/backend/.vercelignore | 4 - apps/backend/.vscode/extensions.json | 9 - apps/backend/.vscode/settings.json | 8 - .../functions/api.prerender-config.json | 2 +- .../functions/api/gist.prerender-config.json | 2 +- .../functions/api/pin.prerender-config.json | 2 +- .../api/top-langs.prerender-config.json | 2 +- .../api/wakatime.prerender-config.json | 2 +- apps/backend/api-renamed/downgrade.js | 13 +- apps/backend/api-renamed/index.js | 29 +- apps/backend/api-renamed/user-access.js | 2 +- apps/backend/package.json | 2 - apps/backend/src/cards/gist.js | 1 - apps/backend/src/cards/wakatime.js | 3 +- apps/backend/src/common/color.js | 3 +- apps/backend/src/common/database.js | 4 +- apps/backend/src/common/languageColors.json | 1300 ++++++++--------- apps/backend/src/fetchers/stats.js | 10 +- apps/backend/src/fetchers/top-languages.js | 5 +- apps/backend/vercel.json | 3 +- apps/frontend/.eslintrc.js | 32 +- apps/frontend/.gitignore | 23 - apps/frontend/.prettierrc.js | 7 - apps/frontend/craco.config.js | 39 +- apps/frontend/public/index.html | 7 +- apps/frontend/src/api/index.js | 2 +- apps/frontend/src/api/user.js | 8 +- apps/frontend/src/axios-override.js | 76 +- apps/frontend/src/components/Card/Card.js | 24 +- apps/frontend/src/components/Card/SVG.js | 34 +- apps/frontend/src/components/Card/index.js | 4 +- .../frontend/src/components/Generic/Button.js | 10 +- .../src/components/Generic/Checkbox.js | 6 +- apps/frontend/src/components/Generic/Input.js | 18 +- apps/frontend/src/components/Generic/index.js | 6 +- .../src/components/Home/CheckboxSection.js | 8 +- .../components/Home/LanguagesLayoutSection.js | 26 +- .../src/components/Home/NumericSection.js | 8 +- apps/frontend/src/components/Home/Progress.js | 34 +- apps/frontend/src/components/Home/Section.js | 8 +- .../src/components/Home/StatsRankSection.js | 18 +- .../src/components/Home/TextSection.js | 14 +- .../components/Home/WakatimeLayoutSection.js | 18 +- apps/frontend/src/components/Home/index.js | 4 +- .../src/components/Preview/Preview.js | 14 +- apps/frontend/src/components/Preview/index.js | 2 +- apps/frontend/src/components/index.js | 8 +- apps/frontend/src/constants.js | 16 +- apps/frontend/src/index.css | 2 +- apps/frontend/src/index.js | 16 +- apps/frontend/src/mock-http.js | 6 +- .../src/mockData/commented_issues.json | 4 +- apps/frontend/src/mockData/commented_prs.json | 8 +- apps/frontend/src/mockData/repository.json | 4 +- apps/frontend/src/mockData/reviewed_prs.json | 8 +- apps/frontend/src/pages/App/AppTrends.js | 32 +- apps/frontend/src/pages/App/Header.js | 30 +- apps/frontend/src/pages/App/index.js | 2 +- apps/frontend/src/pages/Home/Home.js | 90 +- apps/frontend/src/pages/Home/index.js | 2 +- .../src/pages/Home/stages/Customize.js | 66 +- .../frontend/src/pages/Home/stages/Display.js | 40 +- apps/frontend/src/pages/Home/stages/Login.js | 36 +- .../src/pages/Home/stages/SelectCard.js | 32 +- apps/frontend/src/pages/Home/stages/Theme.js | 24 +- apps/frontend/src/pages/Home/stages/index.js | 10 +- .../frontend/src/redux/actions/userActions.js | 6 +- apps/frontend/src/redux/reducers/index.js | 4 +- apps/frontend/src/redux/reducers/user.js | 12 +- .../src/redux/selectors/userSelectors.js | 2 +- apps/frontend/src/redux/store.js | 8 +- apps/frontend/src/utils.js | 12 +- apps/frontend/src/wakatime-override.js | 6 +- apps/frontend/tailwind.config.js | 18 +- apps/frontend/vercel.json | 3 +- package.json | 6 +- pnpm-lock.yaml | 5 +- 91 files changed, 1301 insertions(+), 1289 deletions(-) delete mode 100644 .github/workflows/basic-build.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json delete mode 100644 apps/backend/.nvmrc delete mode 100644 apps/backend/.prettierignore delete mode 100644 apps/backend/.prettierrc.json delete mode 100644 apps/backend/.vscode/extensions.json delete mode 100644 apps/backend/.vscode/settings.json delete mode 100644 apps/frontend/.gitignore delete mode 100644 apps/frontend/.prettierrc.js diff --git a/.github/workflows/basic-build.yml b/.github/workflows/basic-build.yml deleted file mode 100644 index 3314149b..00000000 --- a/.github/workflows/basic-build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Basic Build - -on: - workflow_dispatch: # Allows you to run this manually from the Actions tab - push: - pull_request: - -jobs: - build-and-test: - name: Build and test on ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - - - name: Run vercel-preparation.sh - run: | - chmod +x ./vercel-preparation.sh - ./vercel-preparation.sh - - - name: Build frontend - run: pnpm --filter frontend run build-trends diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7f01d2e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,61 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + - monorepo # to be removed once we complete monorepo tasks + +permissions: {} + +jobs: + build-and-test: + name: Build and test ${{ matrix.node }} on ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node: [24] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Dependencies + uses: ./.github/actions/install-dependencies + with: + node-version: ${{ matrix.node }} + + - name: Run vercel-preparation.sh + run: | + chmod +x ./vercel-preparation.sh + ./vercel-preparation.sh + + - name: Build frontend + run: pnpm --filter frontend run build-trends + + code-checks: + name: Code checks + + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install Dependencies + uses: ./.github/actions/install-dependencies + + - name: Format + run: pnpm run format:check diff --git a/.gitignore b/.gitignore index 2bdaded6..5ae9ed25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,21 @@ node_modules +.env.local +.env.development.local +.env.test.local +.env.production.local + +# OS +.DS_Store + +# Logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Project +coverage + apps/backend/.vercel apps/backend/.env apps/backend/node_modules @@ -8,8 +24,10 @@ apps/backend/coverage apps/backend/benchmarks apps/backend/vercel_token apps/backend-copy + apps/frontend/.env apps/frontend/src/backend +apps/frontend/build # IDE .idea/ diff --git a/.husky/pre-commit b/.husky/pre-commit index 8c3fddc5..2aa3d3a1 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,4 @@ +pnpm run format:check # TODO enable # npm test # npm run lint diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..2acdeb17 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +pnpm-lock.yaml + +# https://github.com/stats-organization/github-stats-extended/pull/26#discussion_r2709033732 +# Avoid prettier format on md files to simplify merge on upstream repo +*.md \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..d3ddf47e --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "useTabs": false, + "semi": true, + "trailingComma": "all", + "singleQuote": false, + "printWidth": 80, + "tabWidth": 2 +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..b01e17dd --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "yzhang.markdown-all-in-one", + "prettier.prettier-vscode", + "dbaeumer.vscode-eslint", + "github.vscode-github-actions" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..f8c22a76 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "markdown.extension.toc.levels": "1..3", + "editor.formatOnSave": true, + "editor.defaultFormatter": "prettier.prettier-vscode", + "[javascript]": { + "editor.tabSize": 2 + } +} diff --git a/apps/backend/.devcontainer/devcontainer.json b/apps/backend/.devcontainer/devcontainer.json index 310e627f..cbeb9162 100644 --- a/apps/backend/.devcontainer/devcontainer.json +++ b/apps/backend/.devcontainer/devcontainer.json @@ -1,33 +1,33 @@ { - "name": "GitHub Readme Stats Dev", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/devcontainers/features/node:1": { "version": "22" } - }, - "forwardPorts": [3000], - "portsAttributes": { - "3000": { "label": "HTTP" } - }, - "appPort": [], + "name": "GitHub Readme Stats Dev", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers/features/node:1": { "version": "22" } + }, + "forwardPorts": [3000], + "portsAttributes": { + "3000": { "label": "HTTP" } + }, + "appPort": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "npm install -g vercel", + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "npm install -g vercel", - // Use 'postStartCommand' to run commands after the container is started. - "postStartCommand": "hostname dev && npm install", + // Use 'postStartCommand' to run commands after the container is started. + "postStartCommand": "hostname dev && npm install", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "yzhang.markdown-all-in-one", - "esbenp.prettier-vscode", - "dbaeumer.vscode-eslint", - "github.vscode-github-actions" - ] - } - }, + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "yzhang.markdown-all-in-one", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "github.vscode-github-actions" + ] + } + }, - "remoteUser": "root", - "privileged": true + "remoteUser": "root", + "privileged": true } diff --git a/apps/backend/.github/workflows/empty-issues-closer.yml b/apps/backend/.github/workflows/empty-issues-closer.yml index 7fe82766..ccf4717e 100644 --- a/apps/backend/.github/workflows/empty-issues-closer.yml +++ b/apps/backend/.github/workflows/empty-issues-closer.yml @@ -37,11 +37,9 @@ jobs: close_comment: Closing this issue because it appears to be empty. Please update the issue for it to be reopened. - open_comment: - Reopening this issue because the author provided more information. + open_comment: Reopening this issue because the author provided more information. check_templates: true template_close_comment: Closing this issue since the issue template was not filled in. Please provide us with more information to have this issue reopened. - template_open_comment: - Reopening this issue because the author provided more information. + template_open_comment: Reopening this issue because the author provided more information. diff --git a/apps/backend/.github/workflows/update-langs.yml b/apps/backend/.github/workflows/update-langs.yml index c7a64ba2..ac75ad40 100644 --- a/apps/backend/.github/workflows/update-langs.yml +++ b/apps/backend/.github/workflows/update-langs.yml @@ -59,8 +59,7 @@ jobs: branch: "update_langs/patch" delete-branch: true title: Update languages JSON - body: - "The + body: "The [update-langs](https://github.com/anuraghazra/github-readme-stats/actions/workflows/update-langs.yaml) action found new/updated languages in the [upstream languages JSON file](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml)." diff --git a/apps/backend/.nvmrc b/apps/backend/.nvmrc deleted file mode 100644 index 8fdd954d..00000000 --- a/apps/backend/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -22 \ No newline at end of file diff --git a/apps/backend/.prettierignore b/apps/backend/.prettierignore deleted file mode 100644 index c97d464f..00000000 --- a/apps/backend/.prettierignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -*.json -*.md -coverage -.vercel diff --git a/apps/backend/.prettierrc.json b/apps/backend/.prettierrc.json deleted file mode 100644 index 8cd2ef70..00000000 --- a/apps/backend/.prettierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trailingComma": "all", - "useTabs": false, - "endOfLine": "auto", - "proseWrap": "always" -} \ No newline at end of file diff --git a/apps/backend/.vercelignore b/apps/backend/.vercelignore index 7dc1e951..cdf6243d 100644 --- a/apps/backend/.vercelignore +++ b/apps/backend/.vercelignore @@ -1,7 +1,5 @@ -.devcontainer .github .husky -.vscode benchmarks coverage scripts @@ -10,6 +8,4 @@ tests **/*.md **/*.svg .eslintrc.json -.prettierignore -.pretterrc.json codecov.yml diff --git a/apps/backend/.vscode/extensions.json b/apps/backend/.vscode/extensions.json deleted file mode 100644 index e9b20fd7..00000000 --- a/apps/backend/.vscode/extensions.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "recommendations": [ - "yzhang.markdown-all-in-one", - "esbenp.prettier-vscode", - "dbaeumer.vscode-eslint", - "ms-azuretools.vscode-containers", - "github.vscode-github-actions" - ] -} diff --git a/apps/backend/.vscode/settings.json b/apps/backend/.vscode/settings.json deleted file mode 100644 index 9e141946..00000000 --- a/apps/backend/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "markdown.extension.toc.levels": "1..3", - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "[javascript]": { - "editor.tabSize": 2 - } -} diff --git a/apps/backend/_dot_vercel_copy/output/functions/api.prerender-config.json b/apps/backend/_dot_vercel_copy/output/functions/api.prerender-config.json index d7747ff4..f848b3a0 100644 --- a/apps/backend/_dot_vercel_copy/output/functions/api.prerender-config.json +++ b/apps/backend/_dot_vercel_copy/output/functions/api.prerender-config.json @@ -2,4 +2,4 @@ "expiration": 39600, "bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n", "passQuery": true -} \ No newline at end of file +} diff --git a/apps/backend/_dot_vercel_copy/output/functions/api/gist.prerender-config.json b/apps/backend/_dot_vercel_copy/output/functions/api/gist.prerender-config.json index d7747ff4..f848b3a0 100644 --- a/apps/backend/_dot_vercel_copy/output/functions/api/gist.prerender-config.json +++ b/apps/backend/_dot_vercel_copy/output/functions/api/gist.prerender-config.json @@ -2,4 +2,4 @@ "expiration": 39600, "bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n", "passQuery": true -} \ No newline at end of file +} diff --git a/apps/backend/_dot_vercel_copy/output/functions/api/pin.prerender-config.json b/apps/backend/_dot_vercel_copy/output/functions/api/pin.prerender-config.json index d7747ff4..f848b3a0 100644 --- a/apps/backend/_dot_vercel_copy/output/functions/api/pin.prerender-config.json +++ b/apps/backend/_dot_vercel_copy/output/functions/api/pin.prerender-config.json @@ -2,4 +2,4 @@ "expiration": 39600, "bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n", "passQuery": true -} \ No newline at end of file +} diff --git a/apps/backend/_dot_vercel_copy/output/functions/api/top-langs.prerender-config.json b/apps/backend/_dot_vercel_copy/output/functions/api/top-langs.prerender-config.json index d7747ff4..f848b3a0 100644 --- a/apps/backend/_dot_vercel_copy/output/functions/api/top-langs.prerender-config.json +++ b/apps/backend/_dot_vercel_copy/output/functions/api/top-langs.prerender-config.json @@ -2,4 +2,4 @@ "expiration": 39600, "bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n", "passQuery": true -} \ No newline at end of file +} diff --git a/apps/backend/_dot_vercel_copy/output/functions/api/wakatime.prerender-config.json b/apps/backend/_dot_vercel_copy/output/functions/api/wakatime.prerender-config.json index d7747ff4..f848b3a0 100644 --- a/apps/backend/_dot_vercel_copy/output/functions/api/wakatime.prerender-config.json +++ b/apps/backend/_dot_vercel_copy/output/functions/api/wakatime.prerender-config.json @@ -2,4 +2,4 @@ "expiration": 39600, "bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n", "passQuery": true -} \ No newline at end of file +} diff --git a/apps/backend/api-renamed/downgrade.js b/apps/backend/api-renamed/downgrade.js index 39b69db6..c4714a37 100644 --- a/apps/backend/api-renamed/downgrade.js +++ b/apps/backend/api-renamed/downgrade.js @@ -53,10 +53,10 @@ export default async (req, res) => { }, ); } catch (err) { - logger.error(err); - res.statusCode = 500; - res.send("Failed to delete GitHub authorization with private access"); - return; + logger.error(err); + res.statusCode = 500; + res.send("Failed to delete GitHub authorization with private access"); + return; } await deleteUser(user_key); @@ -68,6 +68,9 @@ export default async (req, res) => { }).toString(); res.statusCode = 302; - res.setHeader("Location", `https://github.com/login/oauth/authorize?${params}`); + res.setHeader( + "Location", + `https://github.com/login/oauth/authorize?${params}`, + ); res.end(); }; diff --git a/apps/backend/api-renamed/index.js b/apps/backend/api-renamed/index.js index 196ac69a..47857c20 100644 --- a/apps/backend/api-renamed/index.js +++ b/apps/backend/api-renamed/index.js @@ -94,19 +94,18 @@ export default async (req, res) => { (owner && !safePattern.test(owner)) ) { return res.send( - renderError( - { - message: "Something went wrong", - secondaryMessage: "Username, repository or owner contains unsafe characters", - renderOptions: { - title_color, - text_color, - bg_color, - border_color, - theme, - }, + renderError({ + message: "Something went wrong", + secondaryMessage: + "Username, repository or owner contains unsafe characters", + renderOptions: { + title_color, + text_color, + bg_color, + border_color, + theme, }, - ), + }), ); } @@ -124,7 +123,7 @@ export default async (req, res) => { parseBoolean(include_all_commits), parseArray(exclude_repo), showStats.includes("prs_merged") || - showStats.includes("prs_merged_percentage"), + showStats.includes("prs_merged_percentage"), showStats.includes("discussions_started"), showStats.includes("discussions_answered"), parseInt(commits_year, 10), @@ -147,7 +146,9 @@ export default async (req, res) => { setCacheHeaders(res, cacheSeconds); return res.send( - renderStatsCard(stats, { + renderStatsCard( + stats, + { hide: parseArray(hide), show_icons: parseBoolean(show_icons), hide_title: parseBoolean(hide_title), diff --git a/apps/backend/api-renamed/user-access.js b/apps/backend/api-renamed/user-access.js index a41af4cf..4fde6aa0 100644 --- a/apps/backend/api-renamed/user-access.js +++ b/apps/backend/api-renamed/user-access.js @@ -18,7 +18,7 @@ export default async (req, res) => { res.send({ privateAccess: result.privateAccess, - token: result.token + token: result.token, }); } catch (err) { logger.error(err); diff --git a/apps/backend/package.json b/apps/backend/package.json index 3e99d0b1..cd803209 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -27,8 +27,6 @@ "preview-theme": "node scripts/preview-theme", "close-stale-theme-prs": "node scripts/close-stale-theme-prs", "generate-langs-json": "node scripts/generate-langs-json", - "format": "prettier --write .", - "format:check": "prettier --check .", "lint": "npx eslint --max-warnings 0 \"./src/**/*.js\" \"./scripts/**/*.js\" \"./tests/**/*.js\" \"./api-renamed/**/*.js\" \"./themes/**/*.js\"", "bench": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.bench.config.js" }, diff --git a/apps/backend/src/cards/gist.js b/apps/backend/src/cards/gist.js index da822e0e..5d1ccb50 100644 --- a/apps/backend/src/cards/gist.js +++ b/apps/backend/src/cards/gist.js @@ -14,7 +14,6 @@ import { icons } from "../common/icons.js"; import languageColors from "../common/languageColors.json" with { type: "json" }; import { parseEmojis } from "../common/ops.js"; - const ICON_SIZE = 16; const CARD_DEFAULT_WIDTH = 400; const HEADER_MAX_LENGTH = 35; diff --git a/apps/backend/src/cards/wakatime.js b/apps/backend/src/cards/wakatime.js index 3df11fd0..235c25a1 100644 --- a/apps/backend/src/cards/wakatime.js +++ b/apps/backend/src/cards/wakatime.js @@ -378,7 +378,8 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { // @ts-ignore progressBarColor: titleColor, // @ts-ignore - progressBarBackgroundColor: textColor === titleColor ? bgColor : textColor, + progressBarBackgroundColor: + textColor === titleColor ? bgColor : textColor, hideProgress: hide_progress, progressBarWidth: normalizedWidth - TOTAL_TEXT_WIDTH, }); diff --git a/apps/backend/src/common/color.js b/apps/backend/src/common/color.js index 61704170..4b26dc80 100644 --- a/apps/backend/src/common/color.js +++ b/apps/backend/src/common/color.js @@ -83,7 +83,8 @@ const getCardColors = ({ theme, }) => { const defaultTheme = themes["default"]; - const isThemeProvided = theme !== null && theme !== undefined && theme in themes; + const isThemeProvided = + theme !== null && theme !== undefined && theme in themes; // @ts-ignore const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme; diff --git a/apps/backend/src/common/database.js b/apps/backend/src/common/database.js index 5c5e4950..e62988cc 100644 --- a/apps/backend/src/common/database.js +++ b/apps/backend/src/common/database.js @@ -215,7 +215,7 @@ export async function getUserAccessByKey(userKey) { } return { token: rows[0].access_token, - privateAccess: rows[0].private_access + privateAccess: rows[0].private_access, }; } catch (err) { if (err.code === "42P01") { @@ -250,7 +250,7 @@ export async function getUserAccessByName(userName) { } return { token: rows[0].access_token, - privateAccess: rows[0].private_access + privateAccess: rows[0].private_access, }; } catch (err) { if (err.code === "42P01") { diff --git a/apps/backend/src/common/languageColors.json b/apps/backend/src/common/languageColors.json index 9d6b0fa2..591a3780 100644 --- a/apps/backend/src/common/languageColors.json +++ b/apps/backend/src/common/languageColors.json @@ -1,651 +1,651 @@ { - "1C Enterprise": "#814CCC", - "2-Dimensional Array": "#38761D", - "4D": "#004289", - "ABAP": "#E8274B", - "ABAP CDS": "#555e25", - "AGS Script": "#B9D9FF", - "AIDL": "#34EB6B", - "AL": "#3AA2B5", - "AMPL": "#E6EFBB", - "ANTLR": "#9DC3FF", - "API Blueprint": "#2ACCA8", - "APL": "#5A8164", - "ASP.NET": "#9400ff", - "ATS": "#1ac620", - "ActionScript": "#882B0F", - "Ada": "#02f88c", - "Adblock Filter List": "#800000", - "Adobe Font Metrics": "#fa0f00", - "Agda": "#315665", - "Aiken": "#640ff8", - "Alloy": "#64C800", - "Alpine Abuild": "#0D597F", - "Altium Designer": "#A89663", - "AngelScript": "#C7D7DC", - "Answer Set Programming": "#A9CC29", - "Ant Build System": "#A9157E", - "Antlers": "#ff269e", - "ApacheConf": "#d12127", - "Apex": "#1797c0", - "Apollo Guidance Computer": "#0B3D91", - "AppleScript": "#101F1F", - "Arc": "#aa2afe", - "ArkTS": "#0080ff", - "AsciiDoc": "#73a0c5", - "AspectJ": "#a957b0", - "Assembly": "#6E4C13", - "Astro": "#ff5a03", - "Asymptote": "#ff0000", - "Augeas": "#9CC134", - "AutoHotkey": "#6594b9", - "AutoIt": "#1C3552", - "Avro IDL": "#0040FF", - "Awk": "#c30e9b", - "B4X": "#00e4ff", - "BASIC": "#ff0000", - "BQN": "#2b7067", - "Ballerina": "#FF5000", - "Batchfile": "#C1F12E", - "Beef": "#a52f4e", - "Berry": "#15A13C", - "BibTeX": "#778899", - "Bicep": "#519aba", - "Bikeshed": "#5562ac", - "Bison": "#6A463F", - "BitBake": "#00bce4", - "Blade": "#f7523f", - "BlitzBasic": "#00FFAE", - "BlitzMax": "#cd6400", - "Bluespec": "#12223c", - "Bluespec BH": "#12223c", - "Boo": "#d4bec1", - "Boogie": "#c80fa0", - "Brainfuck": "#2F2530", - "BrighterScript": "#66AABB", - "Brightscript": "#662D91", - "Browserslist": "#ffd539", - "Bru": "#F4AA41", - "BuildStream": "#006bff", - "C": "#555555", - "C#": "#178600", - "C++": "#f34b7d", - "C3": "#2563eb", - "CAP CDS": "#0092d1", - "CLIPS": "#00A300", - "CMake": "#DA3434", - "COLLADA": "#F1A42B", - "CSON": "#244776", - "CSS": "#663399", - "CSV": "#237346", - "CUE": "#5886E1", - "CWeb": "#00007a", - "Cabal Config": "#483465", - "Caddyfile": "#22b638", - "Cadence": "#00ef8b", - "Cairo": "#ff4a48", - "Cairo Zero": "#ff4a48", - "CameLIGO": "#3be133", - "Cangjie": "#00868B", - "Cap'n Proto": "#c42727", - "Carbon": "#222222", - "Ceylon": "#dfa535", - "Chapel": "#8dc63f", - "ChucK": "#3f8000", - "Circom": "#707575", - "Cirru": "#ccccff", - "Clarion": "#db901e", - "Clarity": "#5546ff", - "Classic ASP": "#6a40fd", - "Clean": "#3F85AF", - "Click": "#E4E6F3", - "Clojure": "#db5855", - "Closure Templates": "#0d948f", - "Cloud Firestore Security Rules": "#FFA000", - "Clue": "#0009b5", - "CodeQL": "#140f46", - "CoffeeScript": "#244776", - "ColdFusion": "#ed2cd6", - "ColdFusion CFC": "#ed2cd6", - "Common Lisp": "#3fb68b", - "Common Workflow Language": "#B5314C", - "Component Pascal": "#B0CE4E", - "Cooklang": "#E15A29", - "Crystal": "#000100", - "Csound": "#1a1a1a", - "Csound Document": "#1a1a1a", - "Csound Score": "#1a1a1a", - "Cuda": "#3A4E3A", - "Curry": "#531242", - "Cylc": "#00b3fd", - "Cypher": "#34c0eb", - "Cython": "#fedf5b", - "D": "#ba595e", - "D2": "#526ee8", - "DM": "#447265", - "Dafny": "#FFEC25", - "Darcs Patch": "#8eff23", - "Dart": "#00B4AB", - "Daslang": "#d3d3d3", - "DataWeave": "#003a52", - "Debian Package Control File": "#D70751", - "DenizenScript": "#FBEE96", - "Dhall": "#dfafff", - "DirectX 3D File": "#aace60", - "Dockerfile": "#384d54", - "Dogescript": "#cca760", - "Dotenv": "#e5d559", - "Dune": "#89421e", - "Dylan": "#6c616e", - "E": "#ccce35", - "ECL": "#8a1267", - "ECLiPSe": "#001d9d", - "EJS": "#a91e50", - "EQ": "#a78649", - "Earthly": "#2af0ff", - "Easybuild": "#069406", - "Ecere Projects": "#913960", - "Ecmarkup": "#eb8131", - "Edge": "#0dffe0", - "EdgeQL": "#31A7FF", - "EditorConfig": "#fff1f2", - "Eiffel": "#4d6977", - "Elixir": "#6e4a7e", - "Elm": "#60B5CC", - "Elvish": "#55BB55", - "Elvish Transcript": "#55BB55", - "Emacs Lisp": "#c065db", - "EmberScript": "#FFF4F3", - "Erlang": "#B83998", - "Euphoria": "#FF790B", - "F#": "#b845fc", - "F*": "#572e30", - "FIGlet Font": "#FFDDBB", - "FIRRTL": "#2f632f", - "FLUX": "#88ccff", - "Factor": "#636746", - "Fancy": "#7b9db4", - "Fantom": "#14253c", - "Faust": "#c37240", - "Fennel": "#fff3d7", - "Filebench WML": "#F6B900", - "Flix": "#d44a45", - "Fluent": "#ffcc33", - "Forth": "#341708", - "Fortran": "#4d41b1", - "Fortran Free Form": "#4d41b1", - "FreeBASIC": "#141AC9", - "FreeMarker": "#0050b2", - "Frege": "#00cafe", - "Futhark": "#5f021f", - "G-code": "#D08CF2", - "GAML": "#FFC766", - "GAMS": "#f49a22", - "GAP": "#0000cc", - "GCC Machine Description": "#FFCFAB", - "GDScript": "#355570", - "GDShader": "#478CBF", - "GEDCOM": "#003058", - "GLSL": "#5686a5", - "GSC": "#FF6800", - "Game Maker Language": "#71b417", - "Gemfile.lock": "#701516", - "Gemini": "#ff6900", - "Genero 4gl": "#63408e", - "Genero per": "#d8df39", - "Genie": "#fb855d", - "Genshi": "#951531", - "Gentoo Ebuild": "#9400ff", - "Gentoo Eclass": "#9400ff", - "Gerber Image": "#d20b00", - "Gherkin": "#5B2063", - "Git Attributes": "#F44D27", - "Git Commit": "#F44D27", - "Git Config": "#F44D27", - "Git Revision List": "#F44D27", - "Gleam": "#ffaff3", - "Glimmer JS": "#F5835F", - "Glimmer TS": "#3178c6", - "Glyph": "#c1ac7f", - "Gnuplot": "#f0a9f0", - "Go": "#00ADD8", - "Go Checksums": "#00ADD8", - "Go Module": "#00ADD8", - "Go Workspace": "#00ADD8", - "Godot Resource": "#355570", - "Golo": "#88562A", - "Gosu": "#82937f", - "Grace": "#615f8b", - "Gradle": "#02303a", - "Gradle Kotlin DSL": "#02303a", - "Grammatical Framework": "#ff0000", - "GraphQL": "#e10098", - "Graphviz (DOT)": "#2596be", - "Groovy": "#4298b8", - "Groovy Server Pages": "#4298b8", - "HAProxy": "#106da9", - "HCL": "#844FBA", - "HIP": "#4F3A4F", - "HLSL": "#aace60", - "HOCON": "#9ff8ee", - "HTML": "#e34c26", - "HTML+ECR": "#2e1052", - "HTML+EEX": "#6e4a7e", - "HTML+ERB": "#701516", - "HTML+PHP": "#4f5d95", - "HTML+Razor": "#512be4", - "HTTP": "#005C9C", - "HXML": "#f68712", - "Hack": "#878787", - "Haml": "#ece2a9", - "Handlebars": "#f7931e", - "Harbour": "#0e60e3", - "Hare": "#9d7424", - "Haskell": "#5e5086", - "Haxe": "#df7900", - "HiveQL": "#dce200", - "HolyC": "#ffefaf", - "Hosts File": "#308888", - "Hurl": "#FF0288", - "Hy": "#7790B2", - "IDL": "#a3522f", - "IGOR Pro": "#0000cc", - "INI": "#d1dbe0", - "ISPC": "#2D68B1", - "Idris": "#b30000", - "Ignore List": "#000000", - "ImageJ Macro": "#99AAFF", - "Imba": "#16cec6", - "Inno Setup": "#264b99", - "Io": "#a9188d", - "Ioke": "#078193", - "Isabelle": "#FEFE00", - "Isabelle ROOT": "#FEFE00", - "J": "#9EEDFF", - "JAR Manifest": "#b07219", - "JCL": "#d90e09", - "JFlex": "#DBCA00", - "JSON": "#292929", - "JSON with Comments": "#292929", - "JSON5": "#267CB9", - "JSONLD": "#0c479c", - "JSONiq": "#40d47e", - "Jai": "#ab8b4b", - "Janet": "#0886a5", - "Jasmin": "#d03600", - "Java": "#b07219", - "Java Properties": "#2A6277", - "Java Server Pages": "#2A6277", - "Java Template Engine": "#2A6277", - "JavaScript": "#f1e05a", - "JavaScript+ERB": "#f1e05a", - "Jest Snapshot": "#15c213", - "JetBrains MPS": "#21D789", - "Jinja": "#a52a22", - "Jison": "#56b3cb", - "Jison Lex": "#56b3cb", - "Jolie": "#843179", - "Jsonnet": "#0064bd", - "Julia": "#a270ba", - "Julia REPL": "#a270ba", - "Jupyter Notebook": "#DA5B0B", - "Just": "#384d54", - "KDL": "#ffb3b3", - "KRL": "#28430A", - "Kaitai Struct": "#773b37", - "KakouneScript": "#6f8042", - "KerboScript": "#41adf0", - "KiCad Layout": "#2f4aab", - "KiCad Legacy Layout": "#2f4aab", - "KiCad Schematic": "#2f4aab", - "KoLmafia ASH": "#B9D9B9", - "Koka": "#215166", - "Kotlin": "#A97BFF", - "LFE": "#4C3023", - "LLVM": "#185619", - "LOLCODE": "#cc9900", - "LSL": "#3d9970", - "LabVIEW": "#fede06", - "Lark": "#2980B9", - "Lasso": "#999999", - "Latte": "#f2a542", - "Leo": "#C4FFC2", - "Less": "#1d365d", - "Lex": "#DBCA00", - "LigoLANG": "#0e74ff", - "LilyPond": "#9ccc7c", - "Liquid": "#67b8de", - "Literate Agda": "#315665", - "Literate CoffeeScript": "#244776", - "Literate Haskell": "#5e5086", - "LiveCode Script": "#0c5ba5", - "LiveScript": "#499886", - "Logtalk": "#295b9a", - "LookML": "#652B81", - "Lua": "#000080", - "Luau": "#00A2FF", - "M3U": "#179C7D", - "MATLAB": "#e16737", - "MAXScript": "#00a6a6", - "MDX": "#fcb32c", - "MLIR": "#5EC8DB", - "MQL4": "#62A8D6", - "MQL5": "#4A76B8", - "MTML": "#b7e1f4", - "Macaulay2": "#d8ffff", - "Makefile": "#427819", - "Mako": "#7e858d", - "Markdown": "#083fa1", - "Marko": "#42bff2", - "Mask": "#f97732", - "Max": "#c4a79c", - "Mercury": "#ff2b2b", - "Mermaid": "#ff3670", - "Meson": "#007800", - "Metal": "#8f14e9", - "MiniYAML": "#ff1111", - "MiniZinc": "#06a9e6", - "Mint": "#02b046", - "Mirah": "#c7a938", - "Modelica": "#de1d31", - "Modula-2": "#10253f", - "Modula-3": "#223388", - "Mojo": "#ff4c1f", - "Monkey C": "#8D6747", - "MoonBit": "#b92381", - "MoonScript": "#ff4585", - "Motoko": "#fbb03b", - "Motorola 68K Assembly": "#005daa", - "Move": "#4a137a", - "Mustache": "#724b3b", - "NCL": "#28431f", - "NMODL": "#00356B", - "NPM Config": "#cb3837", - "NWScript": "#111522", - "Nasal": "#1d2c4e", - "Nearley": "#990000", - "Nemerle": "#3d3c6e", - "NetLinx": "#0aa0ff", - "NetLinx+ERB": "#747faa", - "NetLogo": "#ff6375", - "NewLisp": "#87AED7", - "Nextflow": "#3ac486", - "Nginx": "#009639", - "Nickel": "#E0C3FC", - "Nim": "#ffc200", - "Nit": "#009917", - "Nix": "#7e7eff", - "Noir": "#2f1f49", - "Nu": "#c9df40", - "NumPy": "#9C8AF9", - "Nunjucks": "#3d8137", - "Nushell": "#4E9906", - "OASv2-json": "#85ea2d", - "OASv2-yaml": "#85ea2d", - "OASv3-json": "#85ea2d", - "OASv3-yaml": "#85ea2d", - "OCaml": "#ef7a08", - "OMNeT++ MSG": "#a0e0a0", - "OMNeT++ NED": "#08607c", - "ObjectScript": "#424893", - "Objective-C": "#438eff", - "Objective-C++": "#6866fb", - "Objective-J": "#ff0c5a", - "Odin": "#60AFFE", - "Omgrofl": "#cabbff", - "Opal": "#f7ede0", - "Open Policy Agent": "#7d9199", - "OpenAPI Specification v2": "#85ea2d", - "OpenAPI Specification v3": "#85ea2d", - "OpenCL": "#ed2e2d", - "OpenEdge ABL": "#5ce600", - "OpenQASM": "#AA70FF", - "OpenSCAD": "#e5cd45", - "Option List": "#476732", - "Org": "#77aa99", - "OverpassQL": "#cce2aa", - "Oxygene": "#cdd0e3", - "Oz": "#fab738", - "P4": "#7055b5", - "PDDL": "#0d00ff", - "PEG.js": "#234d6b", - "PHP": "#4F5D95", - "PLSQL": "#dad8d8", - "PLpgSQL": "#336790", - "POV-Ray SDL": "#6bac65", - "Pact": "#F7A8B8", - "Pan": "#cc0000", - "Papyrus": "#6600cc", - "Parrot": "#f3ca0a", - "Pascal": "#E3F171", - "Pawn": "#dbb284", - "Pep8": "#C76F5B", - "Perl": "#0298c3", - "PicoLisp": "#6067af", - "PigLatin": "#fcd7de", - "Pike": "#005390", - "Pip Requirements": "#FFD343", - "Pkl": "#6b9543", - "PlantUML": "#fbbd16", - "PogoScript": "#d80074", - "Polar": "#ae81ff", - "Portugol": "#f8bd00", - "PostCSS": "#dc3a0c", - "PostScript": "#da291c", - "PowerBuilder": "#8f0f8d", - "PowerShell": "#012456", - "Praat": "#c8506d", - "Prisma": "#0c344b", - "Processing": "#0096D8", - "Procfile": "#3B2F63", - "Prolog": "#74283c", - "Promela": "#de0000", - "Propeller Spin": "#7fa2a7", - "Pug": "#a86454", - "Puppet": "#302B6D", - "PureBasic": "#5a6986", - "PureScript": "#1D222D", - "Pyret": "#ee1e10", - "Python": "#3572A5", - "Python console": "#3572A5", - "Python traceback": "#3572A5", - "Q#": "#fed659", - "QML": "#44a51c", - "Qt Script": "#00b841", - "Quake": "#882233", - "QuakeC": "#975777", - "QuickBASIC": "#008080", - "R": "#198CE7", - "RAML": "#77d9fb", - "RBS": "#701516", - "RDoc": "#701516", - "REXX": "#d90e09", - "RMarkdown": "#198ce7", - "RON": "#a62c00", - "ROS Interface": "#22314e", - "RPGLE": "#2BDE21", - "RUNOFF": "#665a4e", - "Racket": "#3c5caa", - "Ragel": "#9d5200", - "Raku": "#0000fb", - "Rascal": "#fffaa0", - "ReScript": "#ed5051", - "Reason": "#ff5847", - "ReasonLIGO": "#ff5847", - "Rebol": "#358a5b", - "Record Jar": "#0673ba", - "Red": "#f50000", - "Regular Expression": "#009a00", - "Ren'Py": "#ff7f7f", - "Rez": "#FFDAB3", - "Ring": "#2D54CB", - "Riot": "#A71E49", - "RobotFramework": "#00c0b5", - "Roc": "#7c38f5", - "Rocq Prover": "#d0b68c", - "Roff": "#ecdebe", - "Roff Manpage": "#ecdebe", - "Rouge": "#cc0088", - "RouterOS Script": "#DE3941", - "Ruby": "#701516", - "Rust": "#dea584", - "SAS": "#B34936", - "SCSS": "#c6538c", - "SPARQL": "#0C4597", - "SQF": "#3F3F3F", - "SQL": "#e38c00", - "SQLPL": "#e38c00", - "SRecode Template": "#348a34", - "STL": "#373b5e", - "SVG": "#ff9900", - "Sail": "#259dd5", - "SaltStack": "#646464", - "Sass": "#a53b70", - "Scala": "#c22d40", - "Scaml": "#bd181a", - "Scenic": "#fdc700", - "Scheme": "#1e4aec", - "Scilab": "#ca0f21", - "Self": "#0579aa", - "ShaderLab": "#222c37", - "Shell": "#89e051", - "ShellCheck Config": "#cecfcb", - "Shen": "#120F14", - "Simple File Verification": "#C9BFED", - "Singularity": "#64E6AD", - "Slang": "#1fbec9", - "Slash": "#007eff", - "Slice": "#003fa2", - "Slim": "#2b2b2b", - "Slint": "#2379F4", - "SmPL": "#c94949", - "Smalltalk": "#596706", - "Smarty": "#f0c040", - "Smithy": "#c44536", - "Snakemake": "#419179", - "Solidity": "#AA6746", - "SourcePawn": "#f69e1d", - "Squirrel": "#800000", - "Stan": "#b2011d", - "Standard ML": "#dc566d", - "Starlark": "#76d275", - "Stata": "#1a5f91", - "StringTemplate": "#3fb34f", - "Stylus": "#ff6347", - "SubRip Text": "#9e0101", - "SugarSS": "#2fcc9f", - "SuperCollider": "#46390b", - "Survex data": "#ffcc99", - "Svelte": "#ff3e00", - "Sway": "#00F58C", - "Sweave": "#198ce7", - "Swift": "#F05138", - "SystemVerilog": "#DAE1C2", - "TI Program": "#A0AA87", - "TL-Verilog": "#C40023", - "TLA": "#4b0079", - "TOML": "#9c4221", - "TSQL": "#e38c00", - "TSV": "#237346", - "TSX": "#3178c6", - "TXL": "#0178b8", - "Tact": "#48b5ff", - "Talon": "#333333", - "Tcl": "#e4cc98", - "TeX": "#3D6117", - "Teal": "#00B1BC", - "Terra": "#00004c", - "Terraform Template": "#7b42bb", - "TextGrid": "#c8506d", - "TextMate Properties": "#df66e4", - "Textile": "#ffe7ac", - "Thrift": "#D12127", - "Toit": "#c2c9fb", - "Tor Config": "#59316b", - "Tree-sitter Query": "#8ea64c", - "Turing": "#cf142b", - "Twig": "#c1d026", - "TypeScript": "#3178c6", - "TypeSpec": "#4A3665", - "Typst": "#239dad", - "Unified Parallel C": "#4e3617", - "Unity3D Asset": "#222c37", - "Uno": "#9933cc", - "UnrealScript": "#a54c4d", - "Untyped Plutus Core": "#36adbd", - "UrWeb": "#ccccee", - "V": "#4f87c4", - "VBA": "#867db1", - "VBScript": "#15dcdc", - "VCL": "#148AA8", - "VHDL": "#adb2cb", - "Vala": "#a56de2", - "Valve Data Format": "#f26025", - "Velocity Template Language": "#507cff", - "Vento": "#ff0080", - "Verilog": "#b2b7f8", - "Vim Help File": "#199f4b", - "Vim Script": "#199f4b", - "Vim Snippet": "#199f4b", - "Visual Basic .NET": "#945db7", - "Visual Basic 6.0": "#2c6353", - "Volt": "#1F1F1F", - "Vue": "#41b883", - "Vyper": "#9F4CF2", - "WDL": "#42f1f4", - "WGSL": "#1a5e9a", - "Web Ontology Language": "#5b70bd", - "WebAssembly": "#04133b", - "WebAssembly Interface Type": "#6250e7", - "Whiley": "#d5c397", - "Wikitext": "#fc5757", - "Windows Registry Entries": "#52d5ff", - "Witcher Script": "#ff0000", - "Wolfram Language": "#dd1100", - "Wollok": "#a23738", - "World of Warcraft Addon Data": "#f7e43f", - "Wren": "#383838", - "X10": "#4B6BEF", - "XC": "#99DA07", - "XML": "#0060ac", - "XML Property List": "#0060ac", - "XQuery": "#5232e7", - "XSLT": "#EB8CEB", - "Xmake": "#22a079", - "Xojo": "#81bd41", - "Xonsh": "#285EEF", - "Xtend": "#24255d", - "YAML": "#cb171e", - "YARA": "#220000", - "YASnippet": "#32AB90", - "Yacc": "#4B6C4B", - "Yul": "#794932", - "ZAP": "#0d665e", - "ZIL": "#dc75e5", - "ZenScript": "#00BCD1", - "Zephir": "#118f9e", - "Zig": "#ec915c", - "Zimpl": "#d67711", - "Zmodel": "#ff7100", - "crontab": "#ead7ac", - "eC": "#913960", - "fish": "#4aae47", - "hoon": "#00b171", - "iCalendar": "#ec564c", - "jq": "#c7254e", - "kvlang": "#1da6e0", - "mIRC Script": "#3d57c3", - "mcfunction": "#E22837", - "mdsvex": "#5f9ea0", - "mupad": "#244963", - "nanorc": "#2d004d", - "nesC": "#94B0C7", - "ooc": "#b0b77e", - "q": "#0040cd", - "reStructuredText": "#141414", - "sed": "#64b970", - "templ": "#66D0DD", - "vCard": "#ee2647", - "wisp": "#7582D1", - "xBase": "#403a40" -} \ No newline at end of file + "1C Enterprise": "#814CCC", + "2-Dimensional Array": "#38761D", + "4D": "#004289", + "ABAP": "#E8274B", + "ABAP CDS": "#555e25", + "AGS Script": "#B9D9FF", + "AIDL": "#34EB6B", + "AL": "#3AA2B5", + "AMPL": "#E6EFBB", + "ANTLR": "#9DC3FF", + "API Blueprint": "#2ACCA8", + "APL": "#5A8164", + "ASP.NET": "#9400ff", + "ATS": "#1ac620", + "ActionScript": "#882B0F", + "Ada": "#02f88c", + "Adblock Filter List": "#800000", + "Adobe Font Metrics": "#fa0f00", + "Agda": "#315665", + "Aiken": "#640ff8", + "Alloy": "#64C800", + "Alpine Abuild": "#0D597F", + "Altium Designer": "#A89663", + "AngelScript": "#C7D7DC", + "Answer Set Programming": "#A9CC29", + "Ant Build System": "#A9157E", + "Antlers": "#ff269e", + "ApacheConf": "#d12127", + "Apex": "#1797c0", + "Apollo Guidance Computer": "#0B3D91", + "AppleScript": "#101F1F", + "Arc": "#aa2afe", + "ArkTS": "#0080ff", + "AsciiDoc": "#73a0c5", + "AspectJ": "#a957b0", + "Assembly": "#6E4C13", + "Astro": "#ff5a03", + "Asymptote": "#ff0000", + "Augeas": "#9CC134", + "AutoHotkey": "#6594b9", + "AutoIt": "#1C3552", + "Avro IDL": "#0040FF", + "Awk": "#c30e9b", + "B4X": "#00e4ff", + "BASIC": "#ff0000", + "BQN": "#2b7067", + "Ballerina": "#FF5000", + "Batchfile": "#C1F12E", + "Beef": "#a52f4e", + "Berry": "#15A13C", + "BibTeX": "#778899", + "Bicep": "#519aba", + "Bikeshed": "#5562ac", + "Bison": "#6A463F", + "BitBake": "#00bce4", + "Blade": "#f7523f", + "BlitzBasic": "#00FFAE", + "BlitzMax": "#cd6400", + "Bluespec": "#12223c", + "Bluespec BH": "#12223c", + "Boo": "#d4bec1", + "Boogie": "#c80fa0", + "Brainfuck": "#2F2530", + "BrighterScript": "#66AABB", + "Brightscript": "#662D91", + "Browserslist": "#ffd539", + "Bru": "#F4AA41", + "BuildStream": "#006bff", + "C": "#555555", + "C#": "#178600", + "C++": "#f34b7d", + "C3": "#2563eb", + "CAP CDS": "#0092d1", + "CLIPS": "#00A300", + "CMake": "#DA3434", + "COLLADA": "#F1A42B", + "CSON": "#244776", + "CSS": "#663399", + "CSV": "#237346", + "CUE": "#5886E1", + "CWeb": "#00007a", + "Cabal Config": "#483465", + "Caddyfile": "#22b638", + "Cadence": "#00ef8b", + "Cairo": "#ff4a48", + "Cairo Zero": "#ff4a48", + "CameLIGO": "#3be133", + "Cangjie": "#00868B", + "Cap'n Proto": "#c42727", + "Carbon": "#222222", + "Ceylon": "#dfa535", + "Chapel": "#8dc63f", + "ChucK": "#3f8000", + "Circom": "#707575", + "Cirru": "#ccccff", + "Clarion": "#db901e", + "Clarity": "#5546ff", + "Classic ASP": "#6a40fd", + "Clean": "#3F85AF", + "Click": "#E4E6F3", + "Clojure": "#db5855", + "Closure Templates": "#0d948f", + "Cloud Firestore Security Rules": "#FFA000", + "Clue": "#0009b5", + "CodeQL": "#140f46", + "CoffeeScript": "#244776", + "ColdFusion": "#ed2cd6", + "ColdFusion CFC": "#ed2cd6", + "Common Lisp": "#3fb68b", + "Common Workflow Language": "#B5314C", + "Component Pascal": "#B0CE4E", + "Cooklang": "#E15A29", + "Crystal": "#000100", + "Csound": "#1a1a1a", + "Csound Document": "#1a1a1a", + "Csound Score": "#1a1a1a", + "Cuda": "#3A4E3A", + "Curry": "#531242", + "Cylc": "#00b3fd", + "Cypher": "#34c0eb", + "Cython": "#fedf5b", + "D": "#ba595e", + "D2": "#526ee8", + "DM": "#447265", + "Dafny": "#FFEC25", + "Darcs Patch": "#8eff23", + "Dart": "#00B4AB", + "Daslang": "#d3d3d3", + "DataWeave": "#003a52", + "Debian Package Control File": "#D70751", + "DenizenScript": "#FBEE96", + "Dhall": "#dfafff", + "DirectX 3D File": "#aace60", + "Dockerfile": "#384d54", + "Dogescript": "#cca760", + "Dotenv": "#e5d559", + "Dune": "#89421e", + "Dylan": "#6c616e", + "E": "#ccce35", + "ECL": "#8a1267", + "ECLiPSe": "#001d9d", + "EJS": "#a91e50", + "EQ": "#a78649", + "Earthly": "#2af0ff", + "Easybuild": "#069406", + "Ecere Projects": "#913960", + "Ecmarkup": "#eb8131", + "Edge": "#0dffe0", + "EdgeQL": "#31A7FF", + "EditorConfig": "#fff1f2", + "Eiffel": "#4d6977", + "Elixir": "#6e4a7e", + "Elm": "#60B5CC", + "Elvish": "#55BB55", + "Elvish Transcript": "#55BB55", + "Emacs Lisp": "#c065db", + "EmberScript": "#FFF4F3", + "Erlang": "#B83998", + "Euphoria": "#FF790B", + "F#": "#b845fc", + "F*": "#572e30", + "FIGlet Font": "#FFDDBB", + "FIRRTL": "#2f632f", + "FLUX": "#88ccff", + "Factor": "#636746", + "Fancy": "#7b9db4", + "Fantom": "#14253c", + "Faust": "#c37240", + "Fennel": "#fff3d7", + "Filebench WML": "#F6B900", + "Flix": "#d44a45", + "Fluent": "#ffcc33", + "Forth": "#341708", + "Fortran": "#4d41b1", + "Fortran Free Form": "#4d41b1", + "FreeBASIC": "#141AC9", + "FreeMarker": "#0050b2", + "Frege": "#00cafe", + "Futhark": "#5f021f", + "G-code": "#D08CF2", + "GAML": "#FFC766", + "GAMS": "#f49a22", + "GAP": "#0000cc", + "GCC Machine Description": "#FFCFAB", + "GDScript": "#355570", + "GDShader": "#478CBF", + "GEDCOM": "#003058", + "GLSL": "#5686a5", + "GSC": "#FF6800", + "Game Maker Language": "#71b417", + "Gemfile.lock": "#701516", + "Gemini": "#ff6900", + "Genero 4gl": "#63408e", + "Genero per": "#d8df39", + "Genie": "#fb855d", + "Genshi": "#951531", + "Gentoo Ebuild": "#9400ff", + "Gentoo Eclass": "#9400ff", + "Gerber Image": "#d20b00", + "Gherkin": "#5B2063", + "Git Attributes": "#F44D27", + "Git Commit": "#F44D27", + "Git Config": "#F44D27", + "Git Revision List": "#F44D27", + "Gleam": "#ffaff3", + "Glimmer JS": "#F5835F", + "Glimmer TS": "#3178c6", + "Glyph": "#c1ac7f", + "Gnuplot": "#f0a9f0", + "Go": "#00ADD8", + "Go Checksums": "#00ADD8", + "Go Module": "#00ADD8", + "Go Workspace": "#00ADD8", + "Godot Resource": "#355570", + "Golo": "#88562A", + "Gosu": "#82937f", + "Grace": "#615f8b", + "Gradle": "#02303a", + "Gradle Kotlin DSL": "#02303a", + "Grammatical Framework": "#ff0000", + "GraphQL": "#e10098", + "Graphviz (DOT)": "#2596be", + "Groovy": "#4298b8", + "Groovy Server Pages": "#4298b8", + "HAProxy": "#106da9", + "HCL": "#844FBA", + "HIP": "#4F3A4F", + "HLSL": "#aace60", + "HOCON": "#9ff8ee", + "HTML": "#e34c26", + "HTML+ECR": "#2e1052", + "HTML+EEX": "#6e4a7e", + "HTML+ERB": "#701516", + "HTML+PHP": "#4f5d95", + "HTML+Razor": "#512be4", + "HTTP": "#005C9C", + "HXML": "#f68712", + "Hack": "#878787", + "Haml": "#ece2a9", + "Handlebars": "#f7931e", + "Harbour": "#0e60e3", + "Hare": "#9d7424", + "Haskell": "#5e5086", + "Haxe": "#df7900", + "HiveQL": "#dce200", + "HolyC": "#ffefaf", + "Hosts File": "#308888", + "Hurl": "#FF0288", + "Hy": "#7790B2", + "IDL": "#a3522f", + "IGOR Pro": "#0000cc", + "INI": "#d1dbe0", + "ISPC": "#2D68B1", + "Idris": "#b30000", + "Ignore List": "#000000", + "ImageJ Macro": "#99AAFF", + "Imba": "#16cec6", + "Inno Setup": "#264b99", + "Io": "#a9188d", + "Ioke": "#078193", + "Isabelle": "#FEFE00", + "Isabelle ROOT": "#FEFE00", + "J": "#9EEDFF", + "JAR Manifest": "#b07219", + "JCL": "#d90e09", + "JFlex": "#DBCA00", + "JSON": "#292929", + "JSON with Comments": "#292929", + "JSON5": "#267CB9", + "JSONLD": "#0c479c", + "JSONiq": "#40d47e", + "Jai": "#ab8b4b", + "Janet": "#0886a5", + "Jasmin": "#d03600", + "Java": "#b07219", + "Java Properties": "#2A6277", + "Java Server Pages": "#2A6277", + "Java Template Engine": "#2A6277", + "JavaScript": "#f1e05a", + "JavaScript+ERB": "#f1e05a", + "Jest Snapshot": "#15c213", + "JetBrains MPS": "#21D789", + "Jinja": "#a52a22", + "Jison": "#56b3cb", + "Jison Lex": "#56b3cb", + "Jolie": "#843179", + "Jsonnet": "#0064bd", + "Julia": "#a270ba", + "Julia REPL": "#a270ba", + "Jupyter Notebook": "#DA5B0B", + "Just": "#384d54", + "KDL": "#ffb3b3", + "KRL": "#28430A", + "Kaitai Struct": "#773b37", + "KakouneScript": "#6f8042", + "KerboScript": "#41adf0", + "KiCad Layout": "#2f4aab", + "KiCad Legacy Layout": "#2f4aab", + "KiCad Schematic": "#2f4aab", + "KoLmafia ASH": "#B9D9B9", + "Koka": "#215166", + "Kotlin": "#A97BFF", + "LFE": "#4C3023", + "LLVM": "#185619", + "LOLCODE": "#cc9900", + "LSL": "#3d9970", + "LabVIEW": "#fede06", + "Lark": "#2980B9", + "Lasso": "#999999", + "Latte": "#f2a542", + "Leo": "#C4FFC2", + "Less": "#1d365d", + "Lex": "#DBCA00", + "LigoLANG": "#0e74ff", + "LilyPond": "#9ccc7c", + "Liquid": "#67b8de", + "Literate Agda": "#315665", + "Literate CoffeeScript": "#244776", + "Literate Haskell": "#5e5086", + "LiveCode Script": "#0c5ba5", + "LiveScript": "#499886", + "Logtalk": "#295b9a", + "LookML": "#652B81", + "Lua": "#000080", + "Luau": "#00A2FF", + "M3U": "#179C7D", + "MATLAB": "#e16737", + "MAXScript": "#00a6a6", + "MDX": "#fcb32c", + "MLIR": "#5EC8DB", + "MQL4": "#62A8D6", + "MQL5": "#4A76B8", + "MTML": "#b7e1f4", + "Macaulay2": "#d8ffff", + "Makefile": "#427819", + "Mako": "#7e858d", + "Markdown": "#083fa1", + "Marko": "#42bff2", + "Mask": "#f97732", + "Max": "#c4a79c", + "Mercury": "#ff2b2b", + "Mermaid": "#ff3670", + "Meson": "#007800", + "Metal": "#8f14e9", + "MiniYAML": "#ff1111", + "MiniZinc": "#06a9e6", + "Mint": "#02b046", + "Mirah": "#c7a938", + "Modelica": "#de1d31", + "Modula-2": "#10253f", + "Modula-3": "#223388", + "Mojo": "#ff4c1f", + "Monkey C": "#8D6747", + "MoonBit": "#b92381", + "MoonScript": "#ff4585", + "Motoko": "#fbb03b", + "Motorola 68K Assembly": "#005daa", + "Move": "#4a137a", + "Mustache": "#724b3b", + "NCL": "#28431f", + "NMODL": "#00356B", + "NPM Config": "#cb3837", + "NWScript": "#111522", + "Nasal": "#1d2c4e", + "Nearley": "#990000", + "Nemerle": "#3d3c6e", + "NetLinx": "#0aa0ff", + "NetLinx+ERB": "#747faa", + "NetLogo": "#ff6375", + "NewLisp": "#87AED7", + "Nextflow": "#3ac486", + "Nginx": "#009639", + "Nickel": "#E0C3FC", + "Nim": "#ffc200", + "Nit": "#009917", + "Nix": "#7e7eff", + "Noir": "#2f1f49", + "Nu": "#c9df40", + "NumPy": "#9C8AF9", + "Nunjucks": "#3d8137", + "Nushell": "#4E9906", + "OASv2-json": "#85ea2d", + "OASv2-yaml": "#85ea2d", + "OASv3-json": "#85ea2d", + "OASv3-yaml": "#85ea2d", + "OCaml": "#ef7a08", + "OMNeT++ MSG": "#a0e0a0", + "OMNeT++ NED": "#08607c", + "ObjectScript": "#424893", + "Objective-C": "#438eff", + "Objective-C++": "#6866fb", + "Objective-J": "#ff0c5a", + "Odin": "#60AFFE", + "Omgrofl": "#cabbff", + "Opal": "#f7ede0", + "Open Policy Agent": "#7d9199", + "OpenAPI Specification v2": "#85ea2d", + "OpenAPI Specification v3": "#85ea2d", + "OpenCL": "#ed2e2d", + "OpenEdge ABL": "#5ce600", + "OpenQASM": "#AA70FF", + "OpenSCAD": "#e5cd45", + "Option List": "#476732", + "Org": "#77aa99", + "OverpassQL": "#cce2aa", + "Oxygene": "#cdd0e3", + "Oz": "#fab738", + "P4": "#7055b5", + "PDDL": "#0d00ff", + "PEG.js": "#234d6b", + "PHP": "#4F5D95", + "PLSQL": "#dad8d8", + "PLpgSQL": "#336790", + "POV-Ray SDL": "#6bac65", + "Pact": "#F7A8B8", + "Pan": "#cc0000", + "Papyrus": "#6600cc", + "Parrot": "#f3ca0a", + "Pascal": "#E3F171", + "Pawn": "#dbb284", + "Pep8": "#C76F5B", + "Perl": "#0298c3", + "PicoLisp": "#6067af", + "PigLatin": "#fcd7de", + "Pike": "#005390", + "Pip Requirements": "#FFD343", + "Pkl": "#6b9543", + "PlantUML": "#fbbd16", + "PogoScript": "#d80074", + "Polar": "#ae81ff", + "Portugol": "#f8bd00", + "PostCSS": "#dc3a0c", + "PostScript": "#da291c", + "PowerBuilder": "#8f0f8d", + "PowerShell": "#012456", + "Praat": "#c8506d", + "Prisma": "#0c344b", + "Processing": "#0096D8", + "Procfile": "#3B2F63", + "Prolog": "#74283c", + "Promela": "#de0000", + "Propeller Spin": "#7fa2a7", + "Pug": "#a86454", + "Puppet": "#302B6D", + "PureBasic": "#5a6986", + "PureScript": "#1D222D", + "Pyret": "#ee1e10", + "Python": "#3572A5", + "Python console": "#3572A5", + "Python traceback": "#3572A5", + "Q#": "#fed659", + "QML": "#44a51c", + "Qt Script": "#00b841", + "Quake": "#882233", + "QuakeC": "#975777", + "QuickBASIC": "#008080", + "R": "#198CE7", + "RAML": "#77d9fb", + "RBS": "#701516", + "RDoc": "#701516", + "REXX": "#d90e09", + "RMarkdown": "#198ce7", + "RON": "#a62c00", + "ROS Interface": "#22314e", + "RPGLE": "#2BDE21", + "RUNOFF": "#665a4e", + "Racket": "#3c5caa", + "Ragel": "#9d5200", + "Raku": "#0000fb", + "Rascal": "#fffaa0", + "ReScript": "#ed5051", + "Reason": "#ff5847", + "ReasonLIGO": "#ff5847", + "Rebol": "#358a5b", + "Record Jar": "#0673ba", + "Red": "#f50000", + "Regular Expression": "#009a00", + "Ren'Py": "#ff7f7f", + "Rez": "#FFDAB3", + "Ring": "#2D54CB", + "Riot": "#A71E49", + "RobotFramework": "#00c0b5", + "Roc": "#7c38f5", + "Rocq Prover": "#d0b68c", + "Roff": "#ecdebe", + "Roff Manpage": "#ecdebe", + "Rouge": "#cc0088", + "RouterOS Script": "#DE3941", + "Ruby": "#701516", + "Rust": "#dea584", + "SAS": "#B34936", + "SCSS": "#c6538c", + "SPARQL": "#0C4597", + "SQF": "#3F3F3F", + "SQL": "#e38c00", + "SQLPL": "#e38c00", + "SRecode Template": "#348a34", + "STL": "#373b5e", + "SVG": "#ff9900", + "Sail": "#259dd5", + "SaltStack": "#646464", + "Sass": "#a53b70", + "Scala": "#c22d40", + "Scaml": "#bd181a", + "Scenic": "#fdc700", + "Scheme": "#1e4aec", + "Scilab": "#ca0f21", + "Self": "#0579aa", + "ShaderLab": "#222c37", + "Shell": "#89e051", + "ShellCheck Config": "#cecfcb", + "Shen": "#120F14", + "Simple File Verification": "#C9BFED", + "Singularity": "#64E6AD", + "Slang": "#1fbec9", + "Slash": "#007eff", + "Slice": "#003fa2", + "Slim": "#2b2b2b", + "Slint": "#2379F4", + "SmPL": "#c94949", + "Smalltalk": "#596706", + "Smarty": "#f0c040", + "Smithy": "#c44536", + "Snakemake": "#419179", + "Solidity": "#AA6746", + "SourcePawn": "#f69e1d", + "Squirrel": "#800000", + "Stan": "#b2011d", + "Standard ML": "#dc566d", + "Starlark": "#76d275", + "Stata": "#1a5f91", + "StringTemplate": "#3fb34f", + "Stylus": "#ff6347", + "SubRip Text": "#9e0101", + "SugarSS": "#2fcc9f", + "SuperCollider": "#46390b", + "Survex data": "#ffcc99", + "Svelte": "#ff3e00", + "Sway": "#00F58C", + "Sweave": "#198ce7", + "Swift": "#F05138", + "SystemVerilog": "#DAE1C2", + "TI Program": "#A0AA87", + "TL-Verilog": "#C40023", + "TLA": "#4b0079", + "TOML": "#9c4221", + "TSQL": "#e38c00", + "TSV": "#237346", + "TSX": "#3178c6", + "TXL": "#0178b8", + "Tact": "#48b5ff", + "Talon": "#333333", + "Tcl": "#e4cc98", + "TeX": "#3D6117", + "Teal": "#00B1BC", + "Terra": "#00004c", + "Terraform Template": "#7b42bb", + "TextGrid": "#c8506d", + "TextMate Properties": "#df66e4", + "Textile": "#ffe7ac", + "Thrift": "#D12127", + "Toit": "#c2c9fb", + "Tor Config": "#59316b", + "Tree-sitter Query": "#8ea64c", + "Turing": "#cf142b", + "Twig": "#c1d026", + "TypeScript": "#3178c6", + "TypeSpec": "#4A3665", + "Typst": "#239dad", + "Unified Parallel C": "#4e3617", + "Unity3D Asset": "#222c37", + "Uno": "#9933cc", + "UnrealScript": "#a54c4d", + "Untyped Plutus Core": "#36adbd", + "UrWeb": "#ccccee", + "V": "#4f87c4", + "VBA": "#867db1", + "VBScript": "#15dcdc", + "VCL": "#148AA8", + "VHDL": "#adb2cb", + "Vala": "#a56de2", + "Valve Data Format": "#f26025", + "Velocity Template Language": "#507cff", + "Vento": "#ff0080", + "Verilog": "#b2b7f8", + "Vim Help File": "#199f4b", + "Vim Script": "#199f4b", + "Vim Snippet": "#199f4b", + "Visual Basic .NET": "#945db7", + "Visual Basic 6.0": "#2c6353", + "Volt": "#1F1F1F", + "Vue": "#41b883", + "Vyper": "#9F4CF2", + "WDL": "#42f1f4", + "WGSL": "#1a5e9a", + "Web Ontology Language": "#5b70bd", + "WebAssembly": "#04133b", + "WebAssembly Interface Type": "#6250e7", + "Whiley": "#d5c397", + "Wikitext": "#fc5757", + "Windows Registry Entries": "#52d5ff", + "Witcher Script": "#ff0000", + "Wolfram Language": "#dd1100", + "Wollok": "#a23738", + "World of Warcraft Addon Data": "#f7e43f", + "Wren": "#383838", + "X10": "#4B6BEF", + "XC": "#99DA07", + "XML": "#0060ac", + "XML Property List": "#0060ac", + "XQuery": "#5232e7", + "XSLT": "#EB8CEB", + "Xmake": "#22a079", + "Xojo": "#81bd41", + "Xonsh": "#285EEF", + "Xtend": "#24255d", + "YAML": "#cb171e", + "YARA": "#220000", + "YASnippet": "#32AB90", + "Yacc": "#4B6C4B", + "Yul": "#794932", + "ZAP": "#0d665e", + "ZIL": "#dc75e5", + "ZenScript": "#00BCD1", + "Zephir": "#118f9e", + "Zig": "#ec915c", + "Zimpl": "#d67711", + "Zmodel": "#ff7100", + "crontab": "#ead7ac", + "eC": "#913960", + "fish": "#4aae47", + "hoon": "#00b171", + "iCalendar": "#ec564c", + "jq": "#c7254e", + "kvlang": "#1da6e0", + "mIRC Script": "#3d57c3", + "mcfunction": "#E22837", + "mdsvex": "#5f9ea0", + "mupad": "#244963", + "nanorc": "#2d004d", + "nesC": "#94B0C7", + "ooc": "#b0b77e", + "q": "#0040cd", + "reStructuredText": "#141414", + "sed": "#64b970", + "templ": "#66D0DD", + "vCard": "#ee2647", + "wisp": "#7582D1", + "xBase": "#403a40" +} diff --git a/apps/backend/src/fetchers/stats.js b/apps/backend/src/fetchers/stats.js index 7daab0a5..e3634457 100644 --- a/apps/backend/src/fetchers/stats.js +++ b/apps/backend/src/fetchers/stats.js @@ -5,10 +5,7 @@ import * as dotenv from "dotenv"; import githubUsernameRegex from "github-username-regex"; import { calculateRank } from "../calculateRank.js"; import { retryer } from "../common/retryer.js"; -import { - buildSearchFilter, - parseOwnerAffiliations, -} from "../common/ops.js"; +import { buildSearchFilter, parseOwnerAffiliations } from "../common/ops.js"; import { logger } from "../common/log.js"; import { excludeRepositories } from "../common/envs.js"; import { CustomError, MissingParamError } from "../common/error.js"; @@ -191,10 +188,7 @@ const fetchTotalItems = (variables, token) => { `https://api.github.com/search/` + variables.type + `?per_page=1&q=` + - buildSearchFilter(variables.repo, variables.owner).replaceAll( - " ", - "+", - ) + + buildSearchFilter(variables.repo, variables.owner).replaceAll(" ", "+") + variables.filter, headers: { "Content-Type": "application/json", diff --git a/apps/backend/src/fetchers/top-languages.js b/apps/backend/src/fetchers/top-languages.js index e49319f1..2345bcc8 100644 --- a/apps/backend/src/fetchers/top-languages.js +++ b/apps/backend/src/fetchers/top-languages.js @@ -73,7 +73,10 @@ const fetchTopLanguages = async ( } ownerAffiliations = parseOwnerAffiliations(ownerAffiliations); - const res = await retryer(fetcher, username, { login: username, ownerAffiliations }); + const res = await retryer(fetcher, username, { + login: username, + ownerAffiliations, + }); if (res.data.errors) { logger.error(res.data.errors); diff --git a/apps/backend/vercel.json b/apps/backend/vercel.json index 8b0c705f..eea5ca26 100644 --- a/apps/backend/vercel.json +++ b/apps/backend/vercel.json @@ -1,4 +1,5 @@ { + "$schema": "https://openapi.vercel.sh/vercel.json", "buildCommand": "pnpm install && ../../vercel-preparation.sh", "redirects": [ { @@ -12,4 +13,4 @@ "destination": "https://gse-frontend-preview.vercel.app/:match*" } ] -} \ No newline at end of file +} diff --git a/apps/frontend/.eslintrc.js b/apps/frontend/.eslintrc.js index 14f034df..2d7bb796 100644 --- a/apps/frontend/.eslintrc.js +++ b/apps/frontend/.eslintrc.js @@ -3,36 +3,36 @@ module.exports = { browser: true, es6: true, }, - extends: ['plugin:prettier/recommended'], + extends: ["plugin:prettier/recommended"], parserOptions: { ecmaFeatures: { jsx: true, }, ecmaVersion: 2020, - sourceType: 'module', + sourceType: "module", }, - plugins: ['prettier'], + plugins: ["prettier"], rules: { - 'react/jsx-filename-extension': 'off', - 'react/forbid-prop-types': 'off', - 'react/destructuring-assignment': 'off', - 'import/prefer-default-export': 'off', - 'react/function-component-definition': 'off', - 'react/no-unstable-nested-components': 'off', - 'no-console': 'off', - radix: 'off', - 'prettier/prettier': [ - 'error', + "react/jsx-filename-extension": "off", + "react/forbid-prop-types": "off", + "react/destructuring-assignment": "off", + "import/prefer-default-export": "off", + "react/function-component-definition": "off", + "react/no-unstable-nested-components": "off", + "no-console": "off", + radix: "off", + "prettier/prettier": [ + "error", { - endOfLine: 'auto', + endOfLine: "auto", }, ], }, overrides: [ { - files: ['./src/backend/**/*'], + files: ["./src/backend/**/*"], rules: { - 'prettier/prettier': 'off', + "prettier/prettier": "off", }, }, ], diff --git a/apps/frontend/.gitignore b/apps/frontend/.gitignore deleted file mode 100644 index 4d29575d..00000000 --- a/apps/frontend/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/apps/frontend/.prettierrc.js b/apps/frontend/.prettierrc.js deleted file mode 100644 index a4db989c..00000000 --- a/apps/frontend/.prettierrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - semi: true, - trailingComma: 'all', - singleQuote: true, - printWidth: 80, - tabWidth: 2, -}; diff --git a/apps/frontend/craco.config.js b/apps/frontend/craco.config.js index 997197f1..031b0cd6 100644 --- a/apps/frontend/craco.config.js +++ b/apps/frontend/craco.config.js @@ -1,38 +1,39 @@ -const path = require('path'); -const webpack = require('webpack'); +const path = require("path"); +const webpack = require("webpack"); module.exports = { webpack: { alias: { - dotenv: path.resolve(__dirname, 'src/dotenv-browser-stub.js'), - '../src/fetchers/wakatime.js': path.resolve(__dirname, 'src/wakatime-override.js'), + dotenv: path.resolve(__dirname, "src/dotenv-browser-stub.js"), + "../src/fetchers/wakatime.js": path.resolve( + __dirname, + "src/wakatime-override.js", + ), }, configure: (webpackConfig) => { webpackConfig.resolve.fallback = { ...webpackConfig.resolve.fallback, pg: false, - path: require.resolve('path-browserify'), - querystring: require.resolve('querystring-es3'), - url: require.resolve('url/'), - http: require.resolve('stream-http'), - util: require.resolve('util/'), - stream: require.resolve('stream-browserify'), - buffer: require.resolve('buffer/'), + path: require.resolve("path-browserify"), + querystring: require.resolve("querystring-es3"), + url: require.resolve("url/"), + http: require.resolve("stream-http"), + util: require.resolve("util/"), + stream: require.resolve("stream-browserify"), + buffer: require.resolve("buffer/"), fs: false, net: false, }; // remove the DefinePlugin, which (only) replaces process.env in code - webpackConfig.plugins = webpackConfig.plugins.filter( - function (plugin) { - let isDefinePlugin = plugin instanceof webpack.DefinePlugin; - if (isDefinePlugin) { - console.log("filtered plugin:", plugin); - } - return !isDefinePlugin; + webpackConfig.plugins = webpackConfig.plugins.filter(function (plugin) { + let isDefinePlugin = plugin instanceof webpack.DefinePlugin; + if (isDefinePlugin) { + console.log("filtered plugin:", plugin); } - ); + return !isDefinePlugin; + }); return webpackConfig; }, diff --git a/apps/frontend/public/index.html b/apps/frontend/public/index.html index 17ebf4a2..eb2797fc 100644 --- a/apps/frontend/public/index.html +++ b/apps/frontend/public/index.html @@ -1,4 +1,4 @@ - +
@@ -13,7 +13,10 @@ /> - + { try { @@ -16,7 +16,7 @@ const authenticate = async (code, privateAccess, userKey) => { return userId; } catch (error) { console.error(error); - return ''; + return ""; } }; @@ -38,7 +38,7 @@ const deleteAccount = async (userId, userKey) => { return result.data; // no decorator } catch (error) { console.error(error); - return ''; + return ""; } }; diff --git a/apps/frontend/src/axios-override.js b/apps/frontend/src/axios-override.js index 931fbd2d..cd01fe9a 100644 --- a/apps/frontend/src/axios-override.js +++ b/apps/frontend/src/axios-override.js @@ -1,27 +1,27 @@ -import axios, { getAdapter } from 'axios'; -import { setupCache } from 'axios-cache-interceptor'; -import { HOST } from './constants'; +import axios, { getAdapter } from "axios"; +import { setupCache } from "axios-cache-interceptor"; +import { HOST } from "./constants"; -import additionalUserStars from './mockData/additional_user_stars.json' with { type: 'json' }; -import commentedIssues from './mockData/commented_issues.json' with { type: 'json' }; -import commentedPrs from './mockData/commented_prs.json' with { type: 'json' }; -import commits from './mockData/commits.json' with { type: 'json' }; -import gist_graphql from './mockData/gist-graphql.json' with { type: 'json' }; -import gist_rest from './mockData/gist-rest.json' with { type: 'json' }; -import repository from './mockData/repository.json' with { type: 'json' }; -import reviewedPrs from './mockData/reviewed_prs.json' with { type: 'json' }; -import topLanguages from './mockData/top_languages.json' with { type: 'json' }; -import userStats from './mockData/user_stats.json' with { type: 'json' }; -import wakatimeProxy from './mockData/wakatime_proxy.json' with { type: 'json' }; +import additionalUserStars from "./mockData/additional_user_stars.json" with { type: "json" }; +import commentedIssues from "./mockData/commented_issues.json" with { type: "json" }; +import commentedPrs from "./mockData/commented_prs.json" with { type: "json" }; +import commits from "./mockData/commits.json" with { type: "json" }; +import gist_graphql from "./mockData/gist-graphql.json" with { type: "json" }; +import gist_rest from "./mockData/gist-rest.json" with { type: "json" }; +import repository from "./mockData/repository.json" with { type: "json" }; +import reviewedPrs from "./mockData/reviewed_prs.json" with { type: "json" }; +import topLanguages from "./mockData/top_languages.json" with { type: "json" }; +import userStats from "./mockData/user_stats.json" with { type: "json" }; +import wakatimeProxy from "./mockData/wakatime_proxy.json" with { type: "json" }; const cachedAxios = setupCache(axios, { // Cache for 30 minutes ttl: 30 * 60 * 1000, interpretHeader: false, cacheTakeover: false, - methods: ['get', 'post'], + methods: ["get", "post"], cachePredicate: { - allowUrls: ['api.github.com', HOST], + allowUrls: ["api.github.com", HOST], }, }); @@ -36,7 +36,7 @@ function createMockResponse(data, config) { return Promise.resolve({ data, status: 200, - statusText: 'OK', + statusText: "OK", headers: {}, request: {}, config, @@ -61,62 +61,62 @@ axios.defaults.adapter = async (config) => { const params = config.data ? JSON.parse(config.data) : {}; if ( - config.url === 'https://api.github.com/graphql' && + config.url === "https://api.github.com/graphql" && params.query?.includes( - 'query userInfo($login: String!, $after: String, $includeMergedPullRequests:', + "query userInfo($login: String!, $after: String, $includeMergedPullRequests:", ) && - params.variables?.login === 'anuraghazra' + params.variables?.login === "anuraghazra" ) { return createMockResponse(userStats, config); } if ( - config.url === 'https://api.github.com/graphql' && + config.url === "https://api.github.com/graphql" && params.query?.includes( - 'query userInfo($login: String!, $after: String, $ownerAffiliations:', + "query userInfo($login: String!, $after: String, $ownerAffiliations:", ) && - params.variables?.login === 'anuraghazra' + params.variables?.login === "anuraghazra" ) { return createMockResponse(additionalUserStars, config); } if ( - config.url === 'https://api.github.com/graphql' && + config.url === "https://api.github.com/graphql" && params.query?.includes( - 'query userInfo($login: String!, $ownerAffiliations:', + "query userInfo($login: String!, $ownerAffiliations:", ) && - params.variables?.login === 'anuraghazra' + params.variables?.login === "anuraghazra" ) { return createMockResponse(topLanguages, config); } if ( - config.url === 'https://api.github.com/graphql' && - params.query?.includes('fragment RepoInfo on Repository {') && - params.variables?.login === 'anuraghazra' && - params.variables?.repo === 'github-readme-stats' + config.url === "https://api.github.com/graphql" && + params.query?.includes("fragment RepoInfo on Repository {") && + params.variables?.login === "anuraghazra" && + params.variables?.repo === "github-readme-stats" ) { return createMockResponse(repository, config); } if ( - config.url === 'https://api.github.com/graphql' && - params.query?.includes('query gistInfo(') && - params.variables?.gistName === 'bbfce31e0217a3689c8d961a356cb10d' + config.url === "https://api.github.com/graphql" && + params.query?.includes("query gistInfo(") && + params.variables?.gistName === "bbfce31e0217a3689c8d961a356cb10d" ) { return createMockResponse(gist_graphql, config); } switch (config.url) { - case 'https://api.github.com/gists/bbfce31e0217a3689c8d961a356cb10d': + case "https://api.github.com/gists/bbfce31e0217a3689c8d961a356cb10d": return createMockResponse(gist_rest, config); - case 'https://api.github.com/search/commits?per_page=1&q=author:anuraghazra': + case "https://api.github.com/search/commits?per_page=1&q=author:anuraghazra": return createMockResponse(commits, config); - case 'https://api.github.com/search/issues?per_page=1&q=commenter:anuraghazra+-author:anuraghazra+type:pr': + case "https://api.github.com/search/issues?per_page=1&q=commenter:anuraghazra+-author:anuraghazra+type:pr": return createMockResponse(commentedPrs, config); - case 'https://api.github.com/search/issues?per_page=1&q=reviewed-by:anuraghazra+-author:anuraghazra+type:pr': + case "https://api.github.com/search/issues?per_page=1&q=reviewed-by:anuraghazra+-author:anuraghazra+type:pr": return createMockResponse(reviewedPrs, config); - case 'https://api.github.com/search/issues?per_page=1&q=commenter:anuraghazra+-author:anuraghazra+type:issue': + case "https://api.github.com/search/issues?per_page=1&q=commenter:anuraghazra+-author:anuraghazra+type:issue": return createMockResponse(commentedIssues, config); case `https://${HOST}/api/wakatime-proxy?username=ffflabs`: return createMockResponse(wakatimeProxy, config); diff --git a/apps/frontend/src/components/Card/Card.js b/apps/frontend/src/components/Card/Card.js index 495f3f86..9e1f0d52 100644 --- a/apps/frontend/src/components/Card/Card.js +++ b/apps/frontend/src/components/Card/Card.js @@ -1,11 +1,11 @@ -import React from 'react'; -import PropTypes from 'prop-types'; +import React from "react"; +import PropTypes from "prop-types"; -import SVG from './SVG'; -import { classnames } from '../../utils'; -import { HOST } from '../../constants'; +import SVG from "./SVG"; +import { classnames } from "../../utils"; +import { HOST } from "../../constants"; -export const Image = ({ imageSrc, stage, compact, extraClasses = '' }) => { +export const Image = ({ imageSrc, stage, compact, extraClasses = "" }) => { const fullImageSrc = `https://${HOST}/api${imageSrc}&client=wizard`; return ( @@ -29,7 +29,7 @@ Image.propTypes = { Image.defaultProps = { compact: false, - extraClasses: '', + extraClasses: "", }; export const Card = ({ @@ -44,11 +44,11 @@ export const Card = ({ return (