From fd0d83e30f81d53e31cfb44189c9da8170343ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Tur=C4=8Di=C4=87?= Date: Thu, 15 Aug 2024 22:22:26 -0400 Subject: [PATCH] Maintenance: Upgraded all packages. (#630) * maintenance: upgraded all packages, many changes for ESLint 9 migration, and many imports that were remove * updated version of each step in CI * updated version of each step in CI * updated version of each step in CI * updated version of each step in CI * testing ci changes * testing ci changes * testing ci changes * testing ci changes * removed globals from vitest config * readded globals for tests --- .eslintrc.cjs | 99 - .github/workflows/ci.yml | 30 +- .github/workflows/code_quality.yml | 34 +- .github/workflows/update-api.yml | 36 +- .../LeaderboardInfo/Desktop/Desktop.test.ts | 1 - .../LeaderboardInfo/LeaderboardInfo.test.ts | 1 - .../LeaderboardInfo/Mobile/Mobile.test.ts | 1 - .../LanguageSelector/LanguageSelector.vue | 2 +- .../cards/BasicAlert/BasicAlert.test.ts | 2 +- .../ForgotPasswordCard/ForgotPasswordCard.vue | 3 +- .../blocks/cards/LogInCard/LogInCard.vue | 6 +- .../blocks/cards/SignUpCard/SignUpCard.vue | 6 +- composables/api/useChangePassword/index.ts | 1 + composables/api/useConfirmAccount/index.ts | 1 + composables/api/useGetUserDetail/index.ts | 2 +- .../api/useLogoutUser/useLogoutUser.test.ts | 4 +- composables/api/useRecoverAccount/index.ts | 1 + .../api/useResendAccountConfirmation/index.ts | 1 + .../api/useValidateRecoveryToken/index.ts | 3 +- composables/useApi/index.ts | 1 + composables/useApi/useApi.test.ts | 4 + eslint.config.js | 89 + nuxt.config.ts | 1 + package.json | 80 +- pnpm-lock.yaml | 6081 +++++++---------- tailwind.config.js | 1 - tsconfig.json | 10 +- 27 files changed, 2591 insertions(+), 3910 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index d32680c2..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,99 +0,0 @@ -/* eslint-disable vue/sort-keys */ -module.exports = exports = { - root: true, - env: { - browser: true, - es2021: true, - node: true, - }, - extends: [ - '@nuxtjs/eslint-config-typescript', - 'plugin:vue/vue3-recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:nuxt/recommended', - '@vue/eslint-config-typescript', - 'plugin:prettier/recommended', - 'plugin:vuejs-accessibility/recommended', - 'plugin:tailwindcss/recommended', - ], - ignorePatterns: [ - '.nuxt', - '.output', - '.github', - '.husky', - '.vscode', - 'coverage', - 'node_modules', - 'static', - 'testUtils.ts', - 'vite*.ts', - ], - plugins: [ - // put these in the same order as they appear in devDeps for my own sanity :) - '@typescript-eslint', - 'nuxt', - 'prettier', - 'tailwindcss', - 'vue', - 'vuejs-accessibility', - ], - // "parser": "vue-eslint-parser", - // Parser is defined by @nuxtjs eslint config - parserOptions: { - // "parser": "@typescript-eslint/parser", - sourceType: 'module', - ecmaVersion: 'latest', - }, - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn', - '@typescript-eslint/no-explicit-any': 'off', - 'arrow-parens': ['error', 'always'], - 'comma-dangle': 'off', - 'eol-last': ['error', 'always'], - 'import/order': [ - 'error', - { - groups: [ - 'builtin', - 'external', - ['internal', 'parent', 'sibling'], - 'index', - 'object', - 'type', - ], - }, - ], - semi: 'off', - 'space-before-function-paren': 'off', - 'tailwindcss/no-custom-classname': 'off', - 'vue/html-self-closing': 'off', - 'vue/multi-word-component-names': 'off', - 'vue/multiline-html-element-content-newline': 'off', - 'vue/singleline-html-element-content-newline': 'off', - 'vue/sort-keys': [ - 'error', - 'asc', - { - caseSensitive: true, - ignoreChildrenOf: ['model'], - ignoreGrandchildrenOf: [ - 'computed', - 'directives', - 'inject', - 'props', - 'watch', - ], - minKeys: 2, - natural: false, - }, - ], - // disabled since this is only relevant for IE support - // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/398#issuecomment-685442841 - 'vuejs-accessibility/no-onchange': 'off', - }, - settings: { - 'vue-i18n': { - localedir: '', - }, - }, -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7c4bfda..4cc8846e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Read package.json id: package @@ -33,19 +33,8 @@ jobs: with: path: ./package.json - # Ensures pnpm version is consistent and gets back the value to be used in pnpm setup action - - name: Get PNPM version - id: pnpm-version - uses: buffet-time/pnpm-versions-check-action@v1.2 - with: - # engines.pnpm - packageJson-engines-pnpm: '${{ fromJson(steps.package.outputs.content).engines.pnpm }}' - - # packageManager - packageJson-packageManager: '${{ fromJson(steps.package.outputs.content).packageManager }}' - - name: Cache PNPM modules - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-modules with: path: | @@ -54,11 +43,9 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}-node- - - uses: pnpm/action-setup@v2.4.1 - with: - version: '${{ steps.pnpm-version.outputs.version }}' + - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3.8.2 + - uses: actions/setup-node@v4 with: # use the version found in `.nvmrc` node-version-file: '.nvmrc' @@ -71,16 +58,7 @@ jobs: - name: Copy `.env.test` -> `.env` run: cp .env.test .env - - name: Cache build - uses: actions/cache@v3 - id: cache-build - with: - path: .nuxt/ - key: ${{ runner.os }}-build-${{ hashFiles('**/.nuxt') }} - restore-keys: ${{ runner.os }}-build- - - name: Build the `.nuxt` directory - if: steps.cache-build.outputs.cache-hit != 'true' run: pnpm build - name: Tests diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 801e4571..ad90c9b4 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -16,7 +16,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Read package.json id: package @@ -24,19 +24,8 @@ jobs: with: path: ./package.json - # Ensures pnpm version is consistent and gets back the value to be used in pnpm setup action - - name: Get PNPM version - id: pnpm-version - uses: buffet-time/pnpm-versions-check-action@v1.2 - with: - # engines.pnpm - packageJson-engines-pnpm: '${{ fromJson(steps.package.outputs.content).engines.pnpm }}' - - # packageManager - packageJson-packageManager: '${{ fromJson(steps.package.outputs.content).packageManager }}' - - name: Cache PNPM modules - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-modules with: path: | @@ -45,19 +34,13 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}-node- - - uses: pnpm/action-setup@v2.4.1 - with: - version: '${{ steps.pnpm-version.outputs.version }}' + - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3.8.2 + - uses: actions/setup-node@v4 with: # use the version found in `.nvmrc` node-version-file: '.nvmrc' - # shows current pnpm version - - name: check pnpm version - run: pnpm -v - - name: Install `node_modules` if: steps.cache-modules.outputs.cache-hit != 'true' run: pnpm install @@ -65,16 +48,7 @@ jobs: - name: Copy `.env.test` -> `.env` run: cp .env.test .env - - name: Cache build - uses: actions/cache@v3 - id: cache-build - with: - path: .nuxt/ - key: ${{ runner.os }}-build-${{ hashFiles('**/.nuxt') }} - restore-keys: ${{ runner.os }}-build- - - name: Build the `.nuxt` directory - if: steps.cache-build.outputs.cache-hit != 'true' run: pnpm build - name: Linting diff --git a/.github/workflows/update-api.yml b/.github/workflows/update-api.yml index ae1f030a..0a5dbfe4 100644 --- a/.github/workflows/update-api.yml +++ b/.github/workflows/update-api.yml @@ -16,7 +16,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Read package.json id: package @@ -24,19 +24,8 @@ jobs: with: path: ./package.json - # Ensures pnpm version is consistent and gets back the value to be used in pnpm setup action - - name: Get PNPM version - id: pnpm-version - uses: buffet-time/pnpm-versions-check-action@v1.2 - with: - # engines.pnpm - packageJson-engines-pnpm: '${{ fromJson(steps.package.outputs.content).engines.pnpm }}' - - # packageManager - packageJson-packageManager: '${{ fromJson(steps.package.outputs.content).packageManager }}' - - name: Cache PNPM modules - uses: actions/cache@v3.7.0 + uses: actions/cache@v4 id: cache-modules with: path: | @@ -45,20 +34,14 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}-node- - - uses: pnpm/action-setup@v2.4.1 - with: - version: '${{ steps.pnpm-version.outputs.version }}' + - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: # use the version found in `.nvmrc` node-version-file: '.nvmrc' cache: 'pnpm' - # shows current pnpm version - - name: check pnpm version - run: pnpm -v - - name: Install `node_modules` if: steps.cache-modules.outputs.cache-hit != 'true' run: pnpm install @@ -66,16 +49,7 @@ jobs: - name: Copy `.env.test` -> `.env` run: cp .env.test .env - - name: Cache build - uses: actions/cache@v3 - id: cache-build - with: - path: .nuxt/ - key: ${{ runner.os }}-build-${{ hashFiles('**/.nuxt') }} - restore-keys: ${{ runner.os }}-build- - - name: Build the `.nuxt` directory - if: steps.cache-build.outputs.cache-hit != 'true' run: pnpm build - name: Run the API generation @@ -100,7 +74,7 @@ jobs: git push origin ${{ steps.branch.outputs.BRANCH_NAME }} - name: Create PR - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }} script: | diff --git a/components/blocks/LeaderboardInfo/Desktop/Desktop.test.ts b/components/blocks/LeaderboardInfo/Desktop/Desktop.test.ts index a63c7442..5c841c62 100644 --- a/components/blocks/LeaderboardInfo/Desktop/Desktop.test.ts +++ b/components/blocks/LeaderboardInfo/Desktop/Desktop.test.ts @@ -1,4 +1,3 @@ -import { vi } from 'vitest' import { mountSuspended } from '@nuxt/test-utils/runtime' import { getByTestId } from 'root/testUtils' import Desktop from './Desktop.vue' diff --git a/components/blocks/LeaderboardInfo/LeaderboardInfo.test.ts b/components/blocks/LeaderboardInfo/LeaderboardInfo.test.ts index 1bedb817..897899e1 100644 --- a/components/blocks/LeaderboardInfo/LeaderboardInfo.test.ts +++ b/components/blocks/LeaderboardInfo/LeaderboardInfo.test.ts @@ -1,4 +1,3 @@ -import { vi } from 'vitest' import { mountSuspended } from '@nuxt/test-utils/runtime' import { getByTestId } from 'root/testUtils' import LeaderboardInfo from './LeaderboardInfo.vue' diff --git a/components/blocks/LeaderboardInfo/Mobile/Mobile.test.ts b/components/blocks/LeaderboardInfo/Mobile/Mobile.test.ts index 67039b52..fce62d74 100644 --- a/components/blocks/LeaderboardInfo/Mobile/Mobile.test.ts +++ b/components/blocks/LeaderboardInfo/Mobile/Mobile.test.ts @@ -1,4 +1,3 @@ -import { vi } from 'vitest' import { mountSuspended } from '@nuxt/test-utils/runtime' import { getByTestId } from 'root/testUtils' import Mobile from './Mobile.vue' diff --git a/components/blocks/SiteFooter/LanguageSelector/LanguageSelector.vue b/components/blocks/SiteFooter/LanguageSelector/LanguageSelector.vue index f9a4dc0a..23046140 100644 --- a/components/blocks/SiteFooter/LanguageSelector/LanguageSelector.vue +++ b/components/blocks/SiteFooter/LanguageSelector/LanguageSelector.vue @@ -1,5 +1,5 @@