diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..34af3774f --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +build/*.js +config/*.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..361cff5f2 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,27 @@ +module.exports = { + root: true, + parserOptions: { + parser: '@babel/eslint-parser', + sourceType: 'module' + }, + // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style + extends: [ + 'standard', + 'plugin:vue/recommended' + ], + // required to lint *.vue files + plugins: [ + 'vue' + ], + // add your custom rules here + rules: { + // allow paren-less arrow functions + 'arrow-parens': 0, + // allow async-await + 'generator-star-spacing': 0, + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'vue/require-prop-types': 0, + 'vue/multi-word-component-names': 0 + } +} diff --git a/.gitattributes b/.gitattributes index 1bea4dc8f..c5b9ea10e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -/build/commit_hash.js export-subst +/build/webpack.prod.conf.js export-subst diff --git a/.gitignore b/.gitignore index 01ffda9a8..0d5befd28 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,5 @@ test/e2e/reports selenium-debug.log .idea/ config/local.json -src/assets/emoji.json +static/emoji.json logs/ -__screenshots__/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99c85dd36..f4c5cf43a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ # This file is a template, and might need editing before it works on your project. # Official framework image. Look for the different tagged releases at: # https://hub.docker.com/r/library/node/tags/ -image: node:18 +image: node:16 stages: - check-changelog @@ -38,8 +38,8 @@ lint: stage: lint script: - yarn - - yarn lint - - yarn stylelint + - npm run lint + - npm run stylelint test: stage: test @@ -50,15 +50,10 @@ test: APT_CACHE_DIR: apt-cache script: - mkdir -pv $APT_CACHE_DIR && apt-get -qq update + - apt install firefox-esr -y --no-install-recommends + - firefox --version - yarn - - yarn playwright install firefox - - yarn playwright install-deps - - yarn unit-ci - artifacts: - # When the test fails, upload screenshots for better context on why it fails - paths: - - test/**/__screenshots__ - when: on_failure + - yarn unit build: stage: build @@ -67,7 +62,7 @@ build: - himem script: - yarn - - yarn build + - npm run build artifacts: paths: - dist/ diff --git a/.gitlab/merge_request_templates/Release.md b/.gitlab/merge_request_templates/Release.md deleted file mode 100644 index d02e14a73..000000000 --- a/.gitlab/merge_request_templates/Release.md +++ /dev/null @@ -1,8 +0,0 @@ -### Release checklist -* [ ] Bump version in `package.json` -* [ ] Compile a changelog with the `tools/collect-changelog` script -* [ ] Create an MR with an announcement to pleroma.social -#### post-merge -* [ ] Tag the release on the merge commit -* [ ] Make the tag into a Gitlab Release™ -* [ ] Merge `master` into `develop` (in case the fixes are already in develop, use `git merge -s ours --no-commit` and manually merge the changelogs) diff --git a/.node-version b/.node-version index 08b7109d0..5397c87fa 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18.20.8 +16.18.1 diff --git a/.stylelintrc.json b/.stylelintrc.json index afdfd5f5b..d6689cc01 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,5 +1,6 @@ { "extends": [ + "stylelint-rscss/config", "stylelint-config-standard", "stylelint-config-recommended-scss", "stylelint-config-html", @@ -7,13 +8,20 @@ ], "rules": { "declaration-no-important": true, + "rscss/no-descendant-combinator": false, + "rscss/class-format": [ + false, + { + "component": "pascal-case", + "variant": "^-[a-z]\\w+", + "element": "^[a-z]\\w+" + } + ], "selector-class-pattern": null, "import-notation": null, "custom-property-pattern": null, "keyframes-name-pattern": null, "scss/operator-no-newline-after": null, - "declaration-property-value-no-unknown": true, - "scss/declaration-property-value-no-unknown": true, "declaration-block-no-redundant-longhand-properties": [ true, { diff --git a/CHANGELOG.md b/CHANGELOG.md index 20c9c2693..9844319e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,114 +3,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## 2.9.3 -### Fixed -- Being unable to update profile - -## 2.9.2 -### Changed -- BREAKING: due to some internal technical changes logging into AdminFE through PleromaFE is no longer possible -- User card/profile got an overhaul -- Profile editing overhaul -- Visually combined subject and content fields in post form -- Moved post form's emoji button into input field -- Minor visual changes and fixes -- Clicking on fav/rt/emoji notifications' contents expands/collapses it -- Reduced time taken processing theme by half -- Splash screen only appears if loading takes more than 2 seconds - -### Added -- Mutes received an update, adding support for regex, muting based on username and expiration time. -- Mutes are now synchronized across sessions -- Support for expiring mutes and blocks (if available) -- Clicking on emoji shows bigger version of it alongside with its shortcode - - Admins also are able to copy it into a local pack -- Added support for Akkoma and IceShrimp.NET backends -- Compatibility with stricter CSP (Akkoma backend) -- Added a way to upload new packs from a URL or ZIP file via the Admin Dashboard -- Unify show/hide content buttons -- Add support for detachable scrollTop button -- Option to left-align user bio -- Cache assets and emojis with service worker -- Indicate currently active V3 theme as a body element class -- Add arithmetic blend ISS function - -### Fixed -- Display counter for status action buttons when they are in the menu -- Fix bookmark button alignment in the extra actions menu -- Instance favicons are no longer stretched -- A lot more scalable UI fixes - - Emoji picker now should work fine when emoji size is increased - -## 2.8.0 -### Changed -- BREAKING: static/img/nsfw.2958239.png is now static/img/nsfw.DepQPhG0.png, which may affect people who specify exactly this path as the cover image -- BREAKING: static/emoji.json is replaced with a properly hashed path under static/js in the production build, meaning server admins cannot provide their own set of unicode emojis by overriding this file (custom (image-based) emojis not affected) -- Speed up initial boot. -- Updated our build system to support browsers: - Safari >= 15 - Firefox >= 115 - Android > 4 - no Opera Mini support - no IE support - no "dead" (unmaintained) browsers support - -This does not guarantee that browsers will or will not work. - -- Use /api/v1/accounts/:id/follow for account subscriptions instead of the deprecated routes -- Modal layout for mobile has new layout to make it easy to use -- Better display of mute reason on posts -- Simplify the OAuth client_name to 'PleromaFE' -- Partially migrated from vuex to pinia -- Authenticate and subscribe to streaming after connection -- Tabs now have indentation for better visibility of which tab is currently active -- Upgraded Vue to version 3.5 - -### Added -- Support bookmark folders -- Some new default color schemes -- Added support for fetching /{resource}.custom.ext to allow adding instance-specific themes without altering sourcetree -- Post actions customization -- Support displaying time in absolute format -- Add draft management system -- Compress most kinds of images on upload. -- Added option to always convert images to JPEG format instead of using WebP when compressing images. -- Added configurable image compression option in general settings, allowing users to control whether images are compressed before upload. -- Inform users that Smithereen public polls are public -- Splash screen + loading indicator to make process of identifying initialization issues and load performance -- UI for making v3 themes and palettes, support for bundling v3 themes -- Make UserLink wrappable - -### Fixed -- Fixed occasional overflows in emoji picker and made header scrollable -- Updated shadow editor, hopefully fixed long-standing bugs, added ability to specify shadow's name. -- Checkbox vertical alignment -- Check for canvas extract permission when initializing favicon service -- Fix some of the color manipulation functions -- Fix draft saving when auto-save is off -- Switch from class hack to normalButton attribute for emoji count popover -- Fix emoji inconsistencies in notifications, -- Fix some emoji not scaling with interface -- Make sure hover style is also applied to :focus-visible -- Improved ToS and registration -- Fix small markup inconsistencies -- Fixed modals buttons overflow -- Fix whitespaces for multiple status mute reasons, display bot status reason -- Create an OAuth app only when needed -- Fix CSS compatibility issues in style_setter.js for older browsers like Palemoon -- Proper sticky header for conversations on user page -- Add text label for more actions button in post status form -- Reply-or-quote buttons now take less space -- Allow repeats of own posts with private scopes -- Bookmarks visible again on mobile -- Remove focusability on hidden popover in subject input -- Show only month and day instead of weird "day, hour" format. - -### Removed -- BREAKING: drop support for browsers that do not support ` +