diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 48f99d6ca..000000000 --- a/.babelrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "presets": ["@babel/preset-env"], - "plugins": ["@babel/plugin-transform-runtime", "@vue/babel-plugin-jsx"], - "comments": true -} diff --git a/.woodpecker/build-package.yaml b/.woodpecker/build-package.yaml index 63aa80e0f..b3516c948 100644 --- a/.woodpecker/build-package.yaml +++ b/.woodpecker/build-package.yaml @@ -14,7 +14,7 @@ labels: steps: build: - image: docker.io/node:26-alpine + image: docker.io/node:24-alpine commands: - apk add --no-cache zip git - yarn --frozen-lockfile diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index 70fb8df75..a11bdd8bc 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -11,7 +11,7 @@ labels: steps: build: - image: docker.io/node:26-alpine + image: docker.io/node:24-alpine commands: - yarn --frozen-lockfile - yarn build diff --git a/.woodpecker/lint.yaml b/.woodpecker/lint.yaml index 4433e1be8..334f41aea 100644 --- a/.woodpecker/lint.yaml +++ b/.woodpecker/lint.yaml @@ -9,16 +9,10 @@ when: steps: install-depends: image: &node-image - docker.io/node:26-alpine + docker.io/node:24-alpine commands: - yarn --frozen-lockfile - eslint: - image: *node-image - depends_on: install-depends - commands: - - yarn ci-eslint - biome: image: *node-image depends_on: install-depends diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index c3f2c3793..5927cec52 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -36,6 +36,7 @@ steps: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" entrypoint: *script_file_entrypoint commands: + - npm install --global yarn - | if [ "${CI_PIPELINE_EVENT}" != "pull_request" ]; then mkdir -pv $APT_CACHE_DIR && apt-get -qq update diff --git a/biome.json b/biome.json index 5ef6f79ee..a03cd02b5 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.11/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.11/schema.json", "vcs": { "enabled": true, "clientKind": "git", @@ -18,7 +18,7 @@ "vue": "recommended" }, "rules": { - "recommended": false, + "preset": "none", "complexity": { "noAdjacentSpacesInRegex": "error", "noExtraBooleanCast": "error", @@ -80,6 +80,9 @@ "noUselessRegexBackrefs": "error", "noWith": "error", "useGetterReturn": "error" + }, + "style": { + "useVueMultiWordComponentNames": "off" } } }, diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 4335b36d5..000000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig, globalIgnores } from 'eslint/config' -import vue from 'eslint-plugin-vue' - -export default defineConfig([ - ...vue.configs['flat/recommended'], - globalIgnores(['**/*.js', 'build/', 'dist/', 'config/']), - { - files: ['src/**/*.vue'], - languageOptions: { - parserOptions: { - parser: '@babel/eslint-parser', - }, - }, - - rules: { - 'vue/require-prop-types': 0, - 'vue/multi-word-component-names': 0, - }, - }, -]) diff --git a/package.json b/package.json index 3ba4c6c24..b4c20ca8c 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,11 @@ "e2e": "sh ./tools/e2e/run.sh", "test": "yarn run unit && yarn run e2e", "ci-biome": "yarn exec biome check", - "ci-eslint": "yarn exec eslint", "ci-stylelint": "yarn exec stylelint '**/*.scss' '**/*.vue'", - "lint": "yarn ci-biome; yarn ci-eslint; yarn ci-stylelint", - "lint-fix": "yarn exec eslint -- --fix; yarn exec stylelint '**/*.scss' '**/*.vue' --fix; biome check --write" + "lint": "yarn ci-biome; yarn ci-stylelint", + "lint-fix": "yarn exec stylelint '**/*.scss' '**/*.vue' --fix; biome check --write" }, "dependencies": { - "@babel/runtime": "^8.0.0", "@chenfengyuan/vue-qrcode": "2.0.0", "@fortawesome/fontawesome-svg-core": "7.1.0", "@fortawesome/free-regular-svg-icons": "7.1.0", @@ -56,11 +54,6 @@ "vue-virtual-scroller": "^3.0.5" }, "devDependencies": { - "@babel/core": "^8.0.0", - "@babel/eslint-parser": "^8.0.0", - "@babel/plugin-transform-runtime": "^8.0.0", - "@babel/preset-env": "^8.0.0", - "@babel/register": "^8.0.0", "@biomejs/biome": "2.5.11", "@pinia/testing": "1.0.3", "@ungap/event-target": "0.2.4", @@ -71,24 +64,19 @@ "@vitest/browser-playwright": "^4.1.11", "@vitest/coverage-v8": "^4.1.11", "@vitest/ui": "^4.1.11", - "@vue/babel-plugin-jsx": "3.0.0", "@vue/compiler-sfc": "3.5.22", "@vue/devtools-api": "^8.1.5", "@vue/test-utils": "2.5.0", "autoprefixer": "10.4.21", "chalk": "5.6.2", "cross-spawn": "7.0.6", - "eslint": "9.39.2", - "eslint-plugin-vue": "10.6.2", "iso-639-1": "3.1.5", "msw": "2.14.6", - "nightwatch": "3.12.2", "playwright": "1.61.0", "postcss": "8.5.6", "postcss-html": "^1.5.0", "postcss-scss": "^4.0.6", "sass-embedded": "^1.100.0", - "selenium-server": "3.141.59", "serve-static": "2.2.0", "stylelint": "16.25.0", "stylelint-config-html": "^1.1.0", @@ -97,15 +85,14 @@ "stylelint-config-recommended-vue": "^1.6.0", "stylelint-config-standard": "38.0.0", "vite": "^8.0.0", - "vite-plugin-eslint2": "^5.1.0", + "vite-plugin-biome": "^1.2.0", "vite-plugin-stylelint": "^6.1.0", "vite-plugin-vue-devtools": "^8.2.1", - "vitest": "^4.1.11", - "vue-eslint-parser": "10.2.0" + "vitest": "^4.1.11" }, "type": "module", "engines": { - "node": ">= 26.0.0" + "node": ">= 24.0.0" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/App.js b/src/App.js index ed3d43e4a..ae38204b6 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,4 @@ -import { throttle } from 'lodash' +import { throttle } from 'lodash-es' import { mapState } from 'pinia' import { defineAsyncComponent } from 'vue' @@ -49,6 +49,12 @@ export default { MobilePostStatusButton, MobileNav, DesktopNav, + FollowRequestConfirm: defineAsyncComponent( + () => + import( + 'src/components/follow_request_confirm/follow_request_confirm.vue' + ), + ), SettingsModal: defineAsyncComponent( () => import('src/components/settings_modal/settings_modal.vue'), ), diff --git a/src/App.vue b/src/App.vue index bd19c5c10..cad329a78 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,6 +75,7 @@ + diff --git a/src/api/helpers.js b/src/api/helpers.js index f23960ed9..6afd20468 100644 --- a/src/api/helpers.js +++ b/src/api/helpers.js @@ -1,4 +1,4 @@ -import { snakeCase } from 'lodash' +import { snakeCase } from 'lodash-es' import { StatusCodeError } from 'src/services/errors/errors' diff --git a/src/api/user.js b/src/api/user.js index d3a2a4a70..2f356ebbc 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,4 +1,4 @@ -import { last } from 'lodash' +import { last } from 'lodash-es' import { paramsString, promisedRequest } from './helpers.js' import { fetchFriends, MASTODON_STATUS_URL } from './public.js' @@ -43,9 +43,10 @@ export const MASTODON_FOLLOW_URL = (id) => `/api/v1/accounts/${id}/follow` export const MASTODON_UNFOLLOW_URL = (id) => `/api/v1/accounts/${id}/unfollow` const MASTODON_FOLLOW_REQUESTS_URL = '/api/v1/follow_requests' -const MASTODON_APPROVE_USER_URL = (id) => +export const MASTODON_APPROVE_USER_URL = (id) => `/api/v1/follow_requests/${id}/authorize` -const MASTODON_DENY_USER_URL = (id) => `/api/v1/follow_requests/${id}/reject` +export const MASTODON_DENY_USER_URL = (id) => + `/api/v1/follow_requests/${id}/reject` const MASTODON_USER_RELATIONSHIPS_URL = ({ id, withSuspended }) => `/api/v1/accounts/relationships/${paramsString({ id, withSuspended })}` export const MASTODON_USER_IN_LISTS = (id) => `/api/v1/accounts/${id}/lists` diff --git a/src/components/chat_message_list/chat_message_list.js b/src/components/chat_message_list/chat_message_list.js index a51e6a0e4..6aef4336b 100644 --- a/src/components/chat_message_list/chat_message_list.js +++ b/src/components/chat_message_list/chat_message_list.js @@ -1,4 +1,4 @@ -import { orderBy, uniqueId } from 'lodash' +import { orderBy, uniqueId } from 'lodash-es' import ChatMessage from 'src/components/chat_message/chat_message.vue' diff --git a/src/components/chat_view/chat_view.js b/src/components/chat_view/chat_view.js index a0abcb5fe..7d80459bb 100644 --- a/src/components/chat_view/chat_view.js +++ b/src/components/chat_view/chat_view.js @@ -1,4 +1,4 @@ -import { get, maxBy, minBy, sortBy, throttle } from 'lodash' +import { get, maxBy, minBy, sortBy, throttle } from 'lodash-es' import { mapState } from 'pinia' import { nextTick } from 'vue' diff --git a/src/components/color_input/color_input.vue b/src/components/color_input/color_input.vue index 53396f532..821a1be0e 100644 --- a/src/components/color_input/color_input.vue +++ b/src/components/color_input/color_input.vue @@ -64,7 +64,7 @@ diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js index c244a8cb3..f6c79ac76 100644 --- a/src/components/gallery/gallery.js +++ b/src/components/gallery/gallery.js @@ -1,4 +1,4 @@ -import { set, sumBy } from 'lodash' +import { set, sumBy } from 'lodash-es' import Attachment from 'src/components/attachment/attachment.vue' diff --git a/src/components/list/list.js b/src/components/list/list.js index 8abf02fd6..2283f5260 100644 --- a/src/components/list/list.js +++ b/src/components/list/list.js @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash' +import { isEmpty } from 'lodash-es' import Checkbox from 'src/components/checkbox/checkbox.vue' diff --git a/src/components/lists_user_search/lists_user_search.js b/src/components/lists_user_search/lists_user_search.js index 22568135a..4dde2f589 100644 --- a/src/components/lists_user_search/lists_user_search.js +++ b/src/components/lists_user_search/lists_user_search.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash' +import { debounce } from 'lodash-es' import Checkbox from 'src/components/checkbox/checkbox.vue' diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js index 0ffab6f78..3fbd9b77b 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.js +++ b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -1,4 +1,4 @@ -import { debounce } from 'lodash' +import { debounce } from 'lodash-es' import { mapState } from 'pinia' import { useMergedConfigStore } from 'src/stores/merged_config.js' diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js index 9b948e306..73bf6e515 100644 --- a/src/components/moderation_tools/moderation_tools.js +++ b/src/components/moderation_tools/moderation_tools.js @@ -1,4 +1,4 @@ -import { last } from 'lodash' +import { last } from 'lodash-es' import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue' import Popover from 'src/components/popover/popover.vue' diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js index 7f2a16186..c3530975e 100644 --- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js +++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js @@ -1,4 +1,4 @@ -import { get } from 'lodash' +import { get } from 'lodash-es' import { mapState } from 'pinia' import { useInstanceStore } from 'src/stores/instance.js' diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 51b60fb29..cff7f655f 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -1,5 +1,4 @@ -import { mapState } from 'pinia' -import { defineAsyncComponent } from 'vue' +import { mapActions, mapState } from 'pinia' import Report from 'src/components/report/report.vue' import StatusContent from 'src/components/status_content/status_content.vue' @@ -16,13 +15,10 @@ import { import { useFollowRequestsStore } from 'src/stores/follow_requests.js' import { useInstanceStore } from 'src/stores/instance.js' import { useMergedConfigStore } from 'src/stores/merged_config.js' -import { useNotificationsStore } from 'src/stores/notifications.js' -import { useOAuthStore } from 'src/stores/oauth.js' import { useStatusesStore } from 'src/stores/statuses.js' import { useUserHighlightStore } from 'src/stores/user_highlight.js' import { useUsersStore } from 'src/stores/users.js' -import { approveUser, denyUser } from 'src/api/user.js' import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' import { library } from '@fortawesome/fontawesome-svg-core' @@ -58,8 +54,6 @@ const Notification = { selecting: false, statusExpanded: false, unmuted: false, - showingApproveConfirmDialog: false, - showingDenyConfirmDialog: false, } }, props: ['notification'], @@ -73,9 +67,6 @@ const Notification = { UserPopover, UserLink, - ConfirmModal: defineAsyncComponent( - () => import('src/components/confirm_modal/confirm_modal.vue'), - ), }, mounted() { document.addEventListener('selectionchange', this.onContentSelect) @@ -125,51 +116,7 @@ const Notification = { toggleMute() { this.unmuted = !this.unmuted }, - showApproveConfirmDialog() { - this.showingApproveConfirmDialog = true - }, - hideApproveConfirmDialog() { - this.showingApproveConfirmDialog = false - }, - showDenyConfirmDialog() { - this.showingDenyConfirmDialog = true - }, - hideDenyConfirmDialog() { - this.showingDenyConfirmDialog = false - }, - approveUser() { - if (this.shouldConfirmApprove) { - this.showApproveConfirmDialog() - } else { - this.doApprove() - } - }, - doApprove() { - approveUser({ - id: this.user.id, - credentials: useOAuthStore().token, - }) - useFollowRequestsStore().remove(this.user.id) - useNotificationsStore().markSingleNotificationAsSeen(this.notification.id) - this.hideApproveConfirmDialog() - }, - denyUser() { - if (this.shouldConfirmDeny) { - this.showDenyConfirmDialog() - } else { - this.doDeny() - } - }, - doDeny() { - denyUser({ - id: this.user.id, - credentials: useOAuthStore().token, - }).then(() => { - useNotificationsStore().dismissNotificationLocal(this.notification.id) - useFollowRequestsStore().remove(this.user.id) - }) - this.hideDenyConfirmDialog() - }, + ...mapActions(useFollowRequestsStore, ['approve', 'deny']), }, computed: { status() { @@ -220,12 +167,6 @@ const Notification = { scaleMfm() { return this.mergedConfig.scaleMfm }, - shouldConfirmApprove() { - return this.mergedConfig.modalOnApproveFollow - }, - shouldConfirmDeny() { - return this.mergedConfig.modalOnDenyFollow - }, ...mapState(useUsersStore, ['currentUser']), }, } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 601e574db..156c9ac11 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -226,7 +226,7 @@