1
0
mirror of https://github.com/flarum/core.git synced 2025-08-13 11:54:32 +02:00

Compare commits

..

94 Commits

Author SHA1 Message Date
Sami Mazouz
1caff3e6fc fix(sticky): filter mutator union takes order by out of its clause caung trouble
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-07 14:20:25 +01:00
Sami Mazouz
e21a1e09fd test(sticky): list discussions works as expected with stickies
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-07 14:16:01 +01:00
Sami Mazouz
03178bb460 fix: sort field in search queries conflicts between multiple tables
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-07 13:14:47 +01:00
Sami Mazouz
5753edac79 test: list posts with mentions filter and createdAt sort
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
2022-07-07 13:11:23 +01:00
Daniël Klabbers
2e3d6dfa2c chore: upstream changes to dependencies 2022-07-05 21:19:01 +02:00
David Wheatley
7cd28710bc fix: composer title positioning incorrect with custom header height (#3502) 2022-07-04 14:28:44 +01:00
Clark Winkelmann
bc1d6f9e91 fix: assertAdmin sending wrong ability name to gate (#3501) 2022-07-04 14:18:18 +01:00
Sami Mazouz
bf4c543692 fix: restricted sibling tags appearing for unauthorized members on the sidebar (#3419)
* test: user should only be able to see related tags when allowed

* fix: restricted sibling tags appearing for unauthorized members on the sidebar

* fix: apply logic on tags with parents
2022-07-04 12:19:03 +01:00
David Sevilla Martin
709c5566bb fix: overflow notifications group header text with ellipses (#3500)
Fixes #3408
2022-07-04 12:16:59 +01:00
David Wheatley
9a62c32c28 fix: remove return type 2022-07-04 10:52:10 +01:00
flarum-bot
bbf90e42ff Bundled output for commit 0859bb13a5
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-21 15:36:15 +00:00
Daniël Klabbers
0859bb13a5 feature: adds advanced link handling in core (#3455)
* feature: adds advanced link handling in core

This PR adds rel and target to textformatter so that these can be easily extended and rendered into the source.

Without using the Extender the default values `ngc nofollow` are provided as a backward compatible way.

The new extender allows conditional overrides, a proof of concept extension is available at https://github.com/luceos/flarum-ext-dofollow; I will probably migrate this into the Blomstra namespace soon.

* Apply fixes from StyleCI

* fix typehints

* fix: mixed typehint is php 8+

Co-authored-by: StyleCI Bot <bot@styleci.io>
2022-06-21 17:32:23 +02:00
flarum-bot
62be3e01be Bundled output for commit 613523c9b4
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-20 15:57:13 +00:00
Sami Mazouz
613523c9b4 fix(tags): tag selection modal shown when no tags can be selected (#3448) 2022-06-20 16:53:11 +01:00
flarum-bot
3e56bd3dc6 Bundled output for commit 293e8ab8b6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-20 12:06:42 +00:00
David Wheatley
293e8ab8b6 feat: support custom reusable setting components for buildSettingComponent (#3494) 2022-06-20 13:01:29 +01:00
David Wheatley
824fb2feff chore: enable and set up prettier for flarum/tags (#3496) 2022-06-20 13:00:01 +01:00
flarum-bot
4923253fbf Bundled output for commit 36c296d787
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-20 03:17:23 +00:00
David Wheatley
36c296d787 fix(a11y: DiscussionListItem): controls dropdown not visible when tabbed into (#3450) 2022-06-20 03:52:54 +01:00
David Wheatley
9fc2e5e2c0 fix(extension typings): remove some accessibility modifiers from Component (#3437) 2022-06-20 03:52:25 +01:00
David Wheatley
cb47a9c92e feat(translator): add locale getter (#3451) 2022-06-20 03:51:26 +01:00
Martin Hasoň
5dedec12f9 feat: return error code for failed CLI-based installs (#3452) 2022-06-20 03:50:38 +01:00
flarum-bot
5e81592e18 Bundled output for commit 74bcab866c
Includes transpiled JS/TS.

[skip ci]
2022-06-19 22:54:28 +00:00
Sami Mazouz
74bcab866c fix(suspend): suspension modal shows after suspension is over (#3449) 2022-06-19 23:51:29 +01:00
David Wheatley
1d949a3170 feat: split frontend asset generation into separate steps for more extensibility (#3446) 2022-06-19 22:58:05 +01:00
flarum-bot
79e0f44324 Bundled output for commit 976a03c9e5
Includes transpiled JS/TS.

[skip ci]
2022-06-19 21:30:47 +00:00
Sami Mazouz
976a03c9e5 fix: post mention notification errors with _no content_ subjects (#3493)
Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-06-19 22:27:39 +01:00
SychO9
49ab6630d4 chore: run yarn-audit-fix 2022-06-19 20:16:55 +01:00
Sami Mazouz
27fb011bf5 chore: with yarn workspaces we only need a single yarn.lock (#3464)
* chore: yarn workspaces means we only need a single `yarn.lock`
* fix: add a `cache_dependency_path` workflow input
* fix: re-introduce `env.cache_dependency_path`
2022-06-19 19:01:21 +01:00
Sami Mazouz
6466427061 chore: move reusable workflows to monorepo (#3490) 2022-06-19 11:14:21 +01:00
flawedworld
818035f385 feat: split preloaded JSON payload and frontend boot into separate <script> tags (#3461) 2022-06-13 16:11:00 +01:00
flarum-bot
4748f31d93 Bundled output for commit e049e9d7ae
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-09 09:14:05 +00:00
Ian Morland
e049e9d7ae chore: add priorities to AdminNav (#3453) 2022-06-09 10:07:50 +01:00
Rafael Horvat
776f9bf132 feat: add automatic created/updated timestamps for various tables (#3435)
Adds timestamps for various tables:

- groups
- group_user
- group_permission
- tags
- discussion_tag
- post_mentions_post
- post_mentions_user
2022-06-07 20:35:27 +01:00
Daniël Klabbers
f882ff9bb5 update constant for 1.3.1 2022-06-07 14:34:51 +02:00
Daniël Klabbers
535052e3dc v1.3.1 release changelog 2022-06-07 10:53:23 +02:00
Sami Mazouz
c2ba3bb7d5 fix(subscriptions): reply notifications not working (#3445)
* chore: subscriptions backend test infrastructure

* test: reply notification

* fix: fix reply notifications not working
2022-06-03 21:06:30 +02:00
flarum-bot
b7332895db Bundled output for commit 0a3f449f9e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-02 12:44:15 +00:00
Sami Mazouz
0a3f449f9e fix: post mentions with deleted author not rendering (#3432) 2022-06-02 13:38:24 +01:00
naxvog
df1bdd2ad8 chore: point Font Awesome icons link to v5 (#3447)
Update Font Awesome link to represent to currently used major version in order to avoid confusion when choosing icons
2022-06-02 13:34:42 +01:00
flarum-bot
8e2a99c1eb Bundled output for commit e45547c649
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-06-02 01:47:22 +00:00
David Wheatley
e45547c649 docs: ItemList set methods throw errors when keys are not present 2022-06-02 02:43:15 +01:00
Sami Mazouz
29362ed924 fix: empty suspension message uses email template expecting one (#3433) 2022-05-26 18:52:19 +01:00
Sami Mazouz
eb4bac3b8f fix: settings extender working only with first instances (#3439)
* test: settings extender works not only with first extender instance
* fix: settings extender working only with first instances
2022-05-24 17:55:05 +01:00
flarum-bot
584884a3c9 Bundled output for commit 96ead2a4df
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-05-20 19:36:54 +00:00
Ian Morland
96ead2a4df Add priorities to UserCard (#3436) 2022-05-20 20:32:25 +01:00
flarum-bot
556f10ddd8 Bundled output for commit a79e2c20fe
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-05-20 19:06:33 +00:00
Sami Mazouz
a79e2c20fe fix: dropdown show results search button hidden while loading results (#3431) 2022-05-20 20:02:04 +01:00
Sami Mazouz
89b194034b fix: nickname regex validation not working (#3430)
* test: regex validation for nickname on registration
* fix: nickname regex validation not working
* test: regex validation works with valid inputs
2022-05-20 14:04:14 +01:00
flarum-bot
01c54b13c8 Bundled output for commit 24c8c65aa5
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-05-19 23:53:18 +00:00
David Wheatley
24c8c65aa5 fix(typings): treat ColorPreview settings component type as specific string, not generic 2022-05-20 00:48:44 +01:00
David Wheatley
17de76f326 docs: add 1.2.1 to changelog and fix 1.3.0 diff link 2022-05-16 19:44:17 +01:00
Ngô Quốc Đạt
d3008d1e62 docs: correct links to documentation (#3426) 2022-05-16 18:49:59 +01:00
Daniël Klabbers
471947dfa7 chore: prefix markdown change with extension name 2022-05-16 10:34:28 +02:00
flarum-bot
2f506f1b24 Bundled output for commit 81cf6047f9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-05-13 21:15:00 +00:00
David Wheatley
81cf6047f9 fix: call abstract Notification methods with fallback
Only call Notification methods if they are defined, falling back to `undefined` if not through the use of the optional chaining operator.
2022-05-13 23:08:29 +02:00
Daniël Klabbers
57d3c9a99a chore: simplify container binding
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-05-13 21:22:22 +02:00
Daniël Klabbers
999b345db1 chore: simplify container resolving of settings
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-05-13 21:22:22 +02:00
Daniël Klabbers
5e2f952fe6 fix: update test to reflect changes to slug transliteration 2022-05-13 21:22:22 +02:00
Daniël Klabbers
899b931b89 chore: add tests 2022-05-13 21:22:22 +02:00
StyleCI Bot
0431f15ac0 Apply fixes from StyleCI 2022-05-13 21:22:22 +02:00
Daniël Klabbers
6c57470b13 fix: slug generation uses actor locale instead of forum default 2022-05-13 21:22:22 +02:00
flarum-bot
6ca2ebc437 Bundled output for commit dd915c126c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-05-12 20:14:55 +00:00
Sami Mazouz
dd915c126c fix(regression): PostStreamState loadCount static member (#3420) 2022-05-12 21:11:13 +01:00
Daniël Klabbers
62ffe5ffdf chore: add missing contribution for markdown menu support in admin area 2022-05-12 13:23:04 +02:00
Daniël Klabbers
592039c483 update constraint to v1.3 2022-05-10 16:28:35 +02:00
Daniël Klabbers
2f64f023b2 chore: fix version constant for v1.3 2022-05-10 16:09:48 +02:00
Daniël Klabbers
316a2067b6 fix link, tnx @bartvb 2022-05-10 12:30:19 +02:00
Alexander Skvortsov
de8d0d1d37 chore: use proper repo for core 2022-05-10 00:42:16 -04:00
Alexander Skvortsov
aea1a4cf63 chore: use proper branches for monorepo remotes 2022-05-09 14:26:00 -04:00
flarum-bot
7f5593021d Bundled output for commit f9ae7cd67f
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-05-09 16:01:25 +00:00
David Wheatley
f9ae7cd67f fix: incorrect tooltip docs for tooltipVisible attr (#3411) 2022-05-09 11:56:56 -04:00
Daniël Klabbers
843a613cda fix changelog for the framework 2022-05-09 16:14:57 +02:00
SychO9
da83e0c1a0 fix(a11y): Tag selection modal input visibility 2022-05-09 10:07:24 +02:00
SychO9
903026a7e4 fix: Composer discussion title not visible with certain colors 2022-05-09 10:06:52 +02:00
Sami Mazouz
1954d0383e fix: first posts having NULL as value for number column (#3414)
* fix: first posts having `NULL` as value for `number` column
* chore: add note about raw db function `IFNULL`
2022-05-08 23:21:11 +01:00
Daniël Klabbers
2e89ba3c94 chore: Allow installing monorepo through composer for dev purposes
This is as close as we're gonna get to a good solution for now.
2022-04-30 20:00:27 +01:00
Sami Mazouz
b14c0780d2 chore: fix package manager tests (#3407) 2022-04-25 13:31:16 +01:00
Sami Mazouz
d465fd27bc chore: reflect our issue tracking protocol in issue templates. (#3401) 2022-04-24 16:31:09 -04:00
Alexander Skvortsov
ffc9f9f5a4 fix(core): don't pass null to functions where that's deprecated (#3405)
Should fix remaining PHP 8.1 deprecation warnings/
2022-04-24 16:26:18 -04:00
flarum-bot
290bc19922 Bundled output for commit 863a8ddfff
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-04-23 14:26:23 +00:00
Alexander Skvortsov
863a8ddfff fix: don't duplicate path in URL to post on subdirectory installs. (#3354)
`baseUrl` includes the path portion of the url, as does `basePath`, which is included in `app.route.x` function outputs. The `baseOrigin` (with no path component at all) should be used instead.
2022-04-23 10:23:03 -04:00
flarum-bot
b8df3863d1 Bundled output for commit 4cb15501a2
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-04-21 22:20:19 +00:00
Alexander Skvortsov
4cb15501a2 fix(tags): TagDiscussionModal don't go to null tag (#3404)
If the tag we are trying to select/highlight is undefined, we should not run the scroll animation.
2022-04-21 18:03:41 -04:00
flarum-bot
42602a099f Bundled output for commit be2da3e12f
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-04-19 20:19:26 +00:00
Sami Mazouz
be2da3e12f fix: PHP 8.1 deprecation warnings (#3384) 2022-04-19 21:14:52 +01:00
flarum-bot
09bed537b3 Bundled output for commit fb717db57c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-04-16 10:34:07 +00:00
Sami Mazouz
fb717db57c fix: slug transliteration assuming the language is always en (#3387)
* fix: transliteration assuming the language is always `en`
* test: transliteration works with forum locale
2022-04-16 11:31:23 +01:00
flarum-bot
cca97f32c6 Bundled output for commit c658eb10f4
Includes transpiled JS/TS.

[skip ci]
2022-04-14 15:21:36 +00:00
David Sevilla Martin
c658eb10f4 feat(emoji): support emoji 14 & unicode 14 (#3378) 2022-04-14 10:49:47 -04:00
flarum-bot
f667faa1bd Bundled output for commit 542cc42538
Includes transpiled JS/TS.

[skip ci]
2022-04-13 15:33:52 +00:00
Ian Morland
542cc42538 feat: export utils/isSafariMobile (#3389) 2022-04-13 16:31:05 +01:00
flarum-bot
518b39610e Bundled output for commit 6de1ea0194
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-04-09 22:06:48 +00:00
Sami Mazouz
6de1ea0194 fix: languages with combining characters cannot be searched (#3385)
* test: searching other types of languages
* fix: languages with combining characters cannot be searched
* test: can search in discussion titles
2022-04-09 23:04:15 +01:00
262 changed files with 2834 additions and 62682 deletions

View File

@@ -1,26 +1,7 @@
---
name: "🚀 Feature Request"
about: "I have a suggestion (and may want to implement it!)"
about: "If you have a suggestion please head over to our forum!"
---
<!--
IMPORTANT: Feature requests on this GitHub issue tracker are only accepted in case they have been approved by a core developer or contain extensive argumentation and directions for implementation. For all other feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/feedback.
-->
## Feature Request
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. eg. I have an issue when [...]
**Describe the solution you'd like**
A detailed description of your proposed solution. Include:
- How the feature would work/behave
- Any potential drawbacks
- Maybe a screenshot, design, or example code
**Justify why this feature belongs in Flarum's core, rather than in a third-party extension**
Consider who this change will be useful to  most Flarum forums, or just a few?
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future. For feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/proposals. Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.

View File

@@ -4,7 +4,7 @@ about: "If you have a question, please check out our forum or Discord!"
---
We primarily use GitHub as an issue tracker; for usage and support questions, please check out these resources below. Thanks!
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
* Flarum Community: https://discuss.flarum.org/
* Discord Chat: https://flarum.org/discord/

112
.github/workflows/REUSABLE_backend.yml vendored Normal file
View File

@@ -0,0 +1,112 @@
name: Flarum Backend Jobs
on:
workflow_call:
inputs:
enable_backend_testing:
description: "Enable Backend Testing?"
type: boolean
default: true
required: false
backend_directory:
description: The directory of the project where backend code is located. This should contain a `composer.json` file, and is generally the root directory of the repo.
type: string
required: false
default: '.'
php_versions:
description: Versions of PHP to test with. Should be array of strings encoded as JSON array
type: string
required: false
default: '["7.4", "8.0", "8.1"]'
db_versions:
description: Versions of databases to test with. Should be array of strings encoded as JSON array
type: string
required: false
default: '["mysql:5.7", "mariadb"]'
php_ini_values:
description: PHP ini values
type: string
required: false
default: error_reporting=E_ALL
env:
COMPOSER_ROOT_VERSION: dev-main
FLARUM_TEST_TMP_DIR_LOCAL: tests/integration/tmp
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: ${{ fromJSON(inputs.php_versions) }}
service: ${{ fromJSON(inputs.db_versions) }}
prefix: ['', flarum_]
include:
- service: 'mysql:5.7'
db: MySQL
- service: mariadb
db: MariaDB
- prefix: flarum_
prefixStr: (prefix)
exclude:
- php: 8.0
service: 'mysql:5.7'
prefix: flarum_
- php: 8.0
service: mariadb
prefix: flarum_
services:
mysql:
image: ${{ matrix.service }}
ports:
- 13306:3306
name: 'PHP ${{ matrix.php }} / ${{ matrix.db }} ${{ matrix.prefixStr }}'
if: inputs.enable_backend_testing
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
extensions: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
tools: phpunit, composer:v2
ini-values: ${{ inputs.php_ini_values }}
# The authentication alter is necessary because newer mysql versions use the `caching_sha2_password` driver,
# which isn't supported prior to PHP7.4
# When we drop support for PHP7.3, we should remove this from the setup.
- name: Create MySQL Database
run: |
sudo systemctl start mysql
mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 13306
mysql -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';" --port 13306
- name: Install Composer dependencies
run: composer install
working-directory: ${{ inputs.backend_directory }}
- name: Setup Composer tests
run: composer test:setup
working-directory: ${{ inputs.backend_directory }}
env:
DB_PORT: 13306
DB_PASSWORD: root
DB_PREFIX: ${{ matrix.prefix }}
- name: Run Composer tests
run: composer test
working-directory: ${{ inputs.backend_directory }}
env:
COMPOSER_PROCESS_TIMEOUT: 600

220
.github/workflows/REUSABLE_frontend.yml vendored Normal file
View File

@@ -0,0 +1,220 @@
name: Flarum Frontend Jobs
on:
workflow_call:
inputs:
enable_bundlewatch:
description: "Enable Bundlewatch?"
type: boolean
default: false
required: false
enable_prettier:
description: "Enable Prettier?"
type: boolean
default: true
required: false
enable_typescript:
description: "Enable TypeScript?"
type: boolean
default: true
required: false
backend_directory:
description: The directory of the project where backend code is located. This should contain a `composer.json` file, and is generally the root directory of the repo.
type: string
required: false
default: '.'
frontend_directory:
description: The directory of the project where frontend code is located. This should contain a `package.json` file.
type: string
required: false
default: './js'
main_git_branch:
description: The main git branch to use for the workflow.
type: string
required: false
default: main
node_version:
description: The node version to use for the workflow.
type: number
required: false
default: 16
js_package_manager:
description: "Enable TypeScript?"
type: string
default: yarn
required: false
cache_dependency_path:
description: "The path to the cache dependency file."
type: string
required: false
secrets:
bundlewatch_github_token:
description: The GitHub token to use for Bundlewatch.
required: false
env:
COMPOSER_ROOT_VERSION: dev-main
ci_script: ${{ inputs.js_package_manager == 'yarn' && 'yarn install --immutable' || 'npm ci' }}
cache_dependency_path: ${{ inputs.cache_dependency_path || format(inputs.js_package_manager == 'yarn' && '{0}/yarn.lock' || '{0}/package-lock.json', inputs.frontend_directory) }}
jobs:
bundlewatch:
name: Bundlewatch
runs-on: ubuntu-latest
if: inputs.enable_bundlewatch
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Build production assets
uses: flarum/action-build@2
with:
github_token: ${{ secrets.github_token }}
build_script: build
package_manager: ${{ inputs.js_package_manager }}
js_path: ${{ inputs.frontend_directory }}
do_not_commit: true
- name: Check bundle size change
run: node_modules/.bin/bundlewatch --config .bundlewatch.config.json
working-directory: ${{ inputs.frontend_directory }}
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.bundlewatch_github_token }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
prettier:
name: Prettier
runs-on: ubuntu-latest
if: inputs.enable_prettier
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Install JS dependencies
run: ${{ env.ci_script }}
working-directory: ${{ inputs.frontend_directory }}
- name: Check JS formatting
run: ${{ inputs.js_package_manager }} run format-check
working-directory: ${{ inputs.frontend_directory }}
typecheck:
name: Typecheck
runs-on: ubuntu-latest
if: inputs.enable_typescript
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: curl, dom, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
tools: composer:v2
# Needed since tsconfig draws typings from vendor folder.
- name: Install Composer dependencies
run: composer install
working-directory: ${{ inputs.backend_directory }}
- name: Install JS dependencies
run: ${{ env.ci_script }}
working-directory: ${{ inputs.frontend_directory }}
- name: Typecheck
run: ${{ inputs.js_package_manager }} run check-typings
working-directory: ${{ inputs.frontend_directory }}
type-coverage:
name: Type Coverage
runs-on: ubuntu-latest
if: inputs.enable_typescript
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
- name: Install JS dependencies
run: ${{ env.ci_script }}
working-directory: ${{ inputs.frontend_directory }}
- name: Check type coverage
run: ${{ inputs.js_package_manager }} run check-typings-coverage
working-directory: ${{ inputs.frontend_directory }}
build:
name: Build
runs-on: ubuntu-latest
if: "always() && !contains(needs.*.result, 'failed') && !contains(needs.*.result, 'cancelled')"
needs: [bundlewatch, prettier, typecheck, type-coverage]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.js_package_manager }}
cache-dependency-path: ${{ env.cache_dependency_path }}
# Our action will install npm/yarn, cd into `${{ inputs.frontend_directory }}`, build dist JS and typings,
# then commit and upload any changes iff we are on the main branch and have just pushed.
- name: Build production JS
if: inputs.enable_typescript
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: ${{ inputs.js_package_manager }}
typings_script: build-typings
js_path: ${{ inputs.frontend_directory }}
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}
# Our action will install npm/yarn, cd into `${{ inputs.frontend_directory }}`, build dist JS and typings,
# then commit and upload any changes iff we are on the main branch and have just pushed.
- name: Build production JS
if: "! inputs.enable_typescript"
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: ${{ inputs.js_package_manager }}
js_path: ${{ inputs.frontend_directory }}
do_not_commit: ${{ github.ref != format('refs/heads/{0}', inputs.main_git_branch) || github.event_name != 'push' }}

View File

@@ -2,13 +2,9 @@ name: Akismet PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,13 +2,9 @@ name: Akismet JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/akismet/js
backend_directory: ./extensions/akismet
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Approval PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Approval JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/approval/js
backend_directory: ./extensions/approval
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Core PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,13 +2,9 @@ name: Core JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: true
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./framework/core/js
backend_directory: ./framework/core
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Embed PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Embed JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/embed/js
backend_directory: ./extensions/embed
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Emoji PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Emoji JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/emoji/js
backend_directory: ./extensions/emoji
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Flags PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,13 +2,9 @@ name: Flags JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/flags/js
backend_directory: ./extensions/flags
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Likes PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Likes JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/likes/js
backend_directory: ./extensions/likes
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Lock PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Lock JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/lock/js
backend_directory: ./extensions/lock
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Markdown PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Markdown JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/markdown/js
backend_directory: ./extensions/markdown
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Mentions PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,13 +2,9 @@ name: Mentions JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/mentions/js
backend_directory: ./extensions/mentions
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Nicknames PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,13 +2,9 @@ name: Nicknames JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/nicknames/js
backend_directory: ./extensions/nicknames
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -0,0 +1,11 @@
name: Package Manager PHP
on: [workflow_dispatch, push, pull_request]
jobs:
run:
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true
backend_directory: ./extensions/package-manager

View File

@@ -2,13 +2,9 @@ name: Package Manager JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/package-manager/js
backend_directory: ./extensions/package-manager
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Pusher PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Pusher JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/pusher/js
backend_directory: ./extensions/pusher
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Statistics PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,13 +2,9 @@ name: Statistics JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/statistics/js
backend_directory: ./extensions/statistics
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,14 +2,10 @@ name: Sticky PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false
enable_backend_testing: true
backend_directory: ./extensions/sticky

View File

@@ -2,13 +2,9 @@ name: Sticky JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/sticky/js
backend_directory: ./extensions/sticky
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Subscriptions PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Subscriptions JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/subscriptions/js
backend_directory: ./extensions/subscriptions
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Suspend PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: false

View File

@@ -2,13 +2,9 @@ name: Suspend JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: true
@@ -17,6 +13,7 @@ jobs:
frontend_directory: ./extensions/suspend/js
backend_directory: ./extensions/suspend
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:

View File

@@ -2,13 +2,9 @@ name: Tags PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
uses: ./.github/workflows/REUSABLE_backend.yml
with:
enable_backend_testing: true

View File

@@ -2,21 +2,18 @@ name: Tags JS
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
uses: ./.github/workflows/REUSABLE_frontend.yml
with:
enable_bundlewatch: false
enable_prettier: false
enable_prettier: true
enable_typescript: true
frontend_directory: ./extensions/tags/js
backend_directory: ./extensions/tags
js_package_manager: yarn
cache_dependency_path: ./yarn.lock
main_git_branch: main
secrets:
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}

4
.gitignore vendored
View File

@@ -1 +1,3 @@
node_modules
node_modules
vendor
composer.lock

View File

@@ -1,6 +1,57 @@
# Changelog
## [1.2.0](https://github.com/flarum/flarum-core/compare/v1.1.1...v1.2.0)
## [1.3.1](https://github.com/flarum/framework/compare/v1.3.0...v1.3.1)
### Changed
- UserCard now has ItemList for easier extending (https://github.com/flarum/framework/pull/3436)
### Fixed
- Button to go directly to all results page is hidden while API request for search hasn't completed (https://github.com/flarum/framework/pull/3431)
- Setting extender does not register modifications beyond first fluent call (https://github.com/flarum/framework/pull/3439)
- Link to font awesome icons list no longer works (https://github.com/flarum/framework/commit/df1bdd2ad84e992414c0e1e7be576558b4b0fe29)
- Mentions: mentions with deleted authors not showing (https://github.com/flarum/framework/pull/3432)
- Nicknames: regex validation isn't functional (https://github.com/flarum/framework/pull/3430)
- Subscriptions: reply notifications not working (https://github.com/flarum/framework/pull/3445)
- Suspend: not providing suspension reason breaks mail (https://github.com/flarum/framework/pull/3433)
<!-- One-time commit-based diff due to monorepo rework. Diffing against the 1.2.1 tag doesn't work due to unrelated histories. -->
## [1.3.0](https://github.com/flarum/framework/compare/33d939cb012716ed6309ea02236737ad4f25a75b...v1.3.0)
From v1.2.1 on all bundled Flarum extensions and `flarum/core` are merged into one monorepo. As a result of this, the full code diff linked above
looks rather complex and messy compared to the full list of changes made for this release.
### Added
- [A11Y] Added role feed to DiscussionList (https://github.com/flarum/framework/pull/3359)
- Support multiple confirmation dialogs when closing a tab/window (https://github.com/flarum/framework/pull/3372)
- Markdown: markdown toolbar support for admin frontend (https://github.com/flarum/framework/commit/16d5cc11e3aee5c94aeed877987cdb199a2a0d2c)
### Changed
- Post number calculation is now executed inside the database layer, preventing integrity constraints (https://github.com/flarum/framework/pull/3358)
- Errors from within extensions no longer make Flarum crash but trigger a visible warning (https://github.com/flarum/framework/pull/3349)
- Sorting options for discussion index is now extensible (https://github.com/flarum/framework/pull/3377)
- Event listeners from the framework now are added before those of extensions (https://github.com/flarum/framework/pull/3373)
### Fixed
- Typings and missing typescript components (https://github.com/flarum/framework/pull/3348)
- `Post--by-start-user` CSS class is not added to post html (https://github.com/flarum/framework/pull/3356)
- Timestamps for notifications are incorrect on servers that have a timezone different than UTC (https://github.com/flarum/framework/pull/3379)
- Extensions with dependencies that are enabled do not cause dependencies to be enforced (https://github.com/flarum/framework/pull/3352)
- Search using non-words doesn't work (https://github.com/flarum/framework/pull/3385)
- Slugs are not working for other languages than English (https://github.com/flarum/framework/pull/3387)
- Deprecations are triggered on PHP 8.1 (https://github.com/flarum/framework/pull/3384)
- Post permalink for subdirectory installs have duplicate paths segments (https://github.com/flarum/framework/pull/3354)
- Composer discussion title is not always clearly visible (https://github.com/flarum/framework/pull/3413)
- Mentions: extensions re-using mentions can cause errors due to missing context (https://github.com/flarum/framework/pull/3382)
- Tags: tag selection modal errors on new discussions when pressing down (https://github.com/flarum/framework/issues/3403)
- [A11Y] Tags: focus to input and layout of tag selection modal are off (https://github.com/flarum/framework/pull/3412)
- Subscriptions: searching inside the following page will search in all discussions (https://github.com/flarum/framework/pull/3376)
## [1.2.1](https://github.com/flarum/framework/compare/v1.2.0...v1.2.1)
### Fixed
- Don't escape single quotes in discussion title meta tags (60600f4d2b8f0c5dac94c329041427a0a08fad42)
## [1.2.0](https://github.com/flarum/framework/compare/v1.1.1...v1.2.0)
### Added
- View `README` documentation in extension pages (https://github.com/flarum/framework/pull/3094).
@@ -106,12 +157,12 @@
### Deprecated
- Unused `evented` utility (https://github.com/flarum/framework/pull/3125).
## [1.1.1](https://github.com/flarum/flarum-core/compare/v1.1.0...v1.1.1)
## [1.1.1](https://github.com/flarum/framework/compare/v1.1.0...v1.1.1)
### Fixed
- Performance issue with very large communities.
## [1.1.0](https://github.com/flarum/flarum-core/compare/v1.0.4...v1.1.0)
## [1.1.0](https://github.com/flarum/framework/compare/v1.0.4...v1.1.0)
### Added
- Info command now displays MySQL version, queue driver, mail driver (https://github.com/flarum/framework/pull/2991)
@@ -165,13 +216,13 @@
###### Issue Reporters
@uamv, @dannyuk1982, @BurnNoticeSpy, @haarp, @peopleinside, @matteocontrini
## [1.0.4](https://github.com/flarum/flarum-core/compare/v1.0.3...v1.0.4)
## [1.0.4](https://github.com/flarum/framework/compare/v1.0.3...v1.0.4)
### Fixed
- Upgrade to v1.0 resets the "view" permission on all tags (https://github.com/flarum/framework/pull/2941)
## [1.0.3](https://github.com/flarum/flarum-core/compare/v1.0.2...v1.0.3)
## [1.0.3](https://github.com/flarum/framework/compare/v1.0.2...v1.0.3)
### Changed
@@ -185,17 +236,17 @@
- Avatar in notifications list are incorrectly aligned (https://github.com/flarum/framework/pull/2906)
- FilesystemManager is not compatible with upstream Laravel implementation (https://github.com/flarum/framework/pull/2936)
## [1.0.2](https://github.com/flarum/flarum-core/compare/v1.0.1...v1.0.2)
## [1.0.2](https://github.com/flarum/framework/compare/v1.0.1...v1.0.2)
### Fixed
- Critical XSS vulnerability
## [1.0.1](https://github.com/flarum/flarum-core/compare/v1.0.0...v1.0.1)
## [1.0.1](https://github.com/flarum/framework/compare/v1.0.0...v1.0.1)
### Fixed
- Installation fails on environments without proc_* functions enabled or mysql client binary (https://github.com/flarum/framework/issues/2890)
## [1.0.0](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.16...v1.0.0)
## [1.0.0](https://github.com/flarum/framework/compare/v0.1.0-beta.16...v1.0.0)
### Added
- Task scheduling
@@ -261,7 +312,7 @@
- The session is no longer available from the User class (https://github.com/flarum/framework/pull/2790)
- The `mail` key is removed from the laravel related config (https://github.com/flarum/framework/pull/2796)
## [0.1.0-beta.16](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.15...v0.1.0-beta.16)
## [0.1.0-beta.16](https://github.com/flarum/framework/compare/v0.1.0-beta.15...v0.1.0-beta.16)
### Added
- Allow event subscribers (https://github.com/flarum/framework/pull/2535)
@@ -352,7 +403,7 @@
- `UserFilter` ([91e8b56](https://github.com/flarum/framework/commit/91e8b569618957c86757ef89bac666e9102db5ae))
## [0.1.0-beta.15](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.14.1...v0.1.0-beta.15)
## [0.1.0-beta.15](https://github.com/flarum/framework/compare/v0.1.0-beta.14.1...v0.1.0-beta.15)
### Added
@@ -410,7 +461,7 @@
- `CheckingForFlooding` (https://github.com/flarum/framework/commit/8e25bcb68f86cc992c46dfa70368419fe9f936ac).
## [0.1.0-beta.14.1](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.14...v0.1.0-beta.14.1)
## [0.1.0-beta.14.1](https://github.com/flarum/framework/compare/v0.1.0-beta.14...v0.1.0-beta.14.1)
### Fixed
@@ -420,7 +471,7 @@
- Sub path installations have no page title.
- Losing focus of Composer area when coming from fullscreen.
## [0.1.0-beta.14](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.13...v0.1.0-beta.14)
## [0.1.0-beta.14](https://github.com/flarum/framework/compare/v0.1.0-beta.13...v0.1.0-beta.14)
### Added
@@ -517,7 +568,7 @@
- Global path helpers, `Flarum\Foundation\Application` path methods (https://github.com/flarum/framework/pull/2155)
- `Flarum\User\AssertPermissionTrait` (https://github.com/flarum/framework/pull/2044)
## [0.1.0-beta.13](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.12...v0.1.0-beta.13)
## [0.1.0-beta.13](https://github.com/flarum/framework/compare/v0.1.0-beta.12...v0.1.0-beta.13)
### Added
- Console extender (#2057)
@@ -570,7 +621,7 @@
- `Flarum\Event\ConfigureForumRoutes` event class
- `Flarum\Event\ConfigureLocales` event class
## [0.1.0-beta.12](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.11.1...v0.1.0-beta.12)
## [0.1.0-beta.12](https://github.com/flarum/framework/compare/v0.1.0-beta.11.1...v0.1.0-beta.12)
### Added
- Full support for PHP 7.4 (#1980)
@@ -595,12 +646,12 @@
- Translation fallback was ignored for client-rendered pages (#1774, #1961)
- The success alert when posting replies was invisible (#1976)
## [0.1.0-beta.11.1](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.11...v0.1.0-beta.11.1)
## [0.1.0-beta.11.1](https://github.com/flarum/framework/compare/v0.1.0-beta.11...v0.1.0-beta.11.1)
### Fixed
- Saving custom css in admin failed (#1946)
## [0.1.0-beta.11](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.10...v0.1.0-beta.11)
## [0.1.0-beta.11](https://github.com/flarum/framework/compare/v0.1.0-beta.10...v0.1.0-beta.11)
### Added
- Comments have an additional class `Post--by-actor` when posted by the user (#1927)
@@ -627,7 +678,7 @@
- Debug button no longer visible (#1687)
- Modals on smaller screens use the whole width of the page
## [0.1.0-beta.10](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.9...v0.1.0-beta.10)
## [0.1.0-beta.10](https://github.com/flarum/framework/compare/v0.1.0-beta.9...v0.1.0-beta.10)
### Added
- Initial queue support: Infrastructure for offloading long-running tasks (e.g. email sending) to background workers (#1773)
@@ -653,7 +704,7 @@
- API requests authenticated using access tokens needed to provide a CSRF token (#1828)
- Accessibility: Screenreaders did not read the "Back to discussion list" link (#1835)
## [0.1.0-beta.9](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.8.2...v0.1.0-beta.9)
## [0.1.0-beta.9](https://github.com/flarum/framework/compare/v0.1.0-beta.8.2...v0.1.0-beta.9)
### Added
- New `hasPermission()` helper method for `Group` objects ([9684fbc](https://github.com/flarum/framework/commit/9684fbc4da07d32aa322d9228302a23418412cb9))
@@ -700,7 +751,7 @@
- `php flarum install --defaults` - this was meant to be used in our old development VM ([44c9109](https://github.com/flarum/framework/commit/44c91099cd77138bb5fc29f14fb1e81a9781272d))
- Obsolete `id` attributes in JSON-API responses ([ecc3b5e](https://github.com/flarum/framework/commit/ecc3b5e2271f8d9b38d52cd54476d86995dbe32e) and [7a44086](https://github.com/flarum/framework/commit/7a44086bf3a0e3ba907dceb13d07ac695eca05ea))
## [0.1.0-beta.8.1](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)
## [0.1.0-beta.8.1](https://github.com/flarum/framework/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)
### Fixed
- Fix live output in `migrate:reset` command ([f591585](https://github.com/flarum/framework/commit/f591585d02f8c4ff0211c5bf4413dd6baa724c05))

View File

@@ -1,11 +1,11 @@
<p align="center"><img src="https://flarum.org/assets/img/logo.png"></p>
<p align="center">
<a href="https://github.com/flarum/framework/actions?query=workflow%3ATests"><img src="https://github.com/flarum/framework/workflows/Tests/badge.svg" alt="PHP Tests"></a>
<a href="https://github.com/flarum/core/actions?query=workflow%3ATests"><img src="https://github.com/flarum/core/workflows/Tests/badge.svg" alt="PHP Tests"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/dt/flarum/core" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/github/v/release/flarum/framework?sort=semver" alt="Latest Version"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/github/v/release/flarum/core?sort=semver" alt="Latest Version"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/l/flarum/core" alt="License"></a>
<a href="https://huntr.dev/bounties/disclose/?target=https://github.com/flarum/framework"><img src="https://cdn.huntr.dev/huntr_security_badge_mono.svg" alt="huntr"></a>
<a href="https://huntr.dev/bounties/disclose/?target=https://github.com/flarum/core"><img src="https://cdn.huntr.dev/huntr_security_badge_mono.svg" alt="huntr"></a>
<a href="https://github.styleci.io/repos/28257573"><img src="https://github.styleci.io/repos/28257573/shield?style=flat" alt="StyleCI"></a>
</p>
@@ -31,7 +31,7 @@ Thank you for considering contributing to Flarum! Please read the **[Contributin
## Security Vulnerabilities
If you discover a security vulnerability within Flarum, please send an e-mail to [security@flarum.org](mailto:security@flarum.org). All security vulnerabilities will be promptly addressed. More details can be found in our [security policy](https://github.com/flarum/framework/security/policy).
If you discover a security vulnerability within Flarum, please send an e-mail to [security@flarum.org](mailto:security@flarum.org). All security vulnerabilities will be promptly addressed. More details can be found in our [security policy](https://github.com/flarum/core/security/policy).
## License

182
composer.json Normal file
View File

@@ -0,0 +1,182 @@
{
"name": "flarum/framework",
"description": "Delightfully simple forum software.",
"keywords": [
"forum",
"discussion"
],
"homepage": "https://flarum.org/",
"license": "MIT",
"authors": [
{
"name": "Flarum",
"email": "info@flarum.org",
"homepage": "https://flarum.org/team"
}
],
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/flarum"
},
{
"type": "github",
"url": "https://github.com/sponsors/flarum"
},
{
"type": "other",
"url": "https://flarum.org/donate"
}
],
"support": {
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/core",
"docs": "https://docs.flarum.org",
"forum": "https://discuss.flarum.org",
"chat": "https://flarum.org/chat"
},
"autoload": {
"psr-4": {
"Flarum\\": "framework/core/src",
"Flarum\\Akismet\\": "extensions/akismet/src",
"Flarum\\Approval\\": "extensions/approval/src",
"Flarum\\Flags\\": "extensions/flags/src",
"Flarum\\Likes\\": "extensions/likes/src",
"Flarum\\Lock\\": "extensions/lock/src",
"Flarum\\Mentions\\": "extensions/mentions/src",
"Flarum\\Nicknames\\": "extensions/nicknames/src",
"Flarum\\PackageManager\\": "extensions/package-manager/src",
"Flarum\\Pusher\\": "extensions/pusher/src",
"Flarum\\Statistics\\": "extensions/statistics/src",
"Flarum\\Sticky\\": "extensions/sticky/src",
"Flarum\\Subscriptions\\": "extensions/subscriptions/src",
"Flarum\\Suspend\\": "extensions/suspend/src",
"Flarum\\Tags\\": "extensions/tags/src",
"Flarum\\PHPStan\\": "php-packages/phpstan/src",
"Flarum\\Testing\\": "php-packages/testing/src"
},
"files": [
"framework/core/src/helpers.php"
]
},
"replace": {
"flarum/core": "self.version",
"flarum/akismet": "self.version",
"flarum/approval": "self.version",
"flarum/bbcode": "self.version",
"flarum/embed": "self.version",
"flarum/emoji": "self.version",
"flarum/flags": "self.version",
"flarum/lang-english": "self.version",
"flarum/likes": "self.version",
"flarum/lock": "self.version",
"flarum/markdown": "self.version",
"flarum/mentions": "self.version",
"flarum/nicknames": "self.version",
"flarum/package-manager": "self.version",
"flarum/pusher": "self.version",
"flarum/statistics": "self.version",
"flarum/sticky": "self.version",
"flarum/subscriptions": "self.version",
"flarum/suspend": "self.version",
"flarum/tags": "self.version",
"flarum/phpstan": "self.version",
"flarum/testing": "self.version"
},
"require": {
"ext-json": "*",
"php": ">=7.3",
"components/font-awesome": "^5.14.0",
"composer/composer": "^2.0",
"dflydev/fig-cookies": "^3.0.0",
"doctrine/dbal": "^2.7",
"dragonmantank/cron-expression": "^3.1.0",
"franzl/whoops-middleware": "^2.0.0",
"guzzlehttp/guzzle": "^7.4",
"illuminate/bus": "^8.0",
"illuminate/cache": "^8.0",
"illuminate/config": "^8.0",
"illuminate/console": "^8.0",
"illuminate/container": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/database": "^8.0",
"illuminate/events": "^8.0",
"illuminate/filesystem": "^8.0",
"illuminate/hashing": "^8.0",
"illuminate/mail": "^8.0",
"illuminate/queue": "^8.0",
"illuminate/session": "^8.0",
"illuminate/support": "^8.0",
"illuminate/validation": "^8.0",
"illuminate/view": "^8.0",
"intervention/image": "2.5.* || ^2.6.1",
"laminas/laminas-diactoros": "^2.4.1",
"laminas/laminas-httphandlerrunner": "^1.2.0",
"laminas/laminas-stratigility": "^3.2.2",
"league/flysystem": "^1.0.11",
"matthiasmullie/minify": "^1.3",
"middlewares/base-path": "^2.0.1",
"middlewares/base-path-router": "^2.0.1",
"middlewares/request-handler": "^2.0.1",
"monolog/monolog": "^1.16.0",
"nesbot/carbon": "^2.0",
"nikic/fast-route": "^0.6",
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"pusher/pusher-php-server": "^2.2",
"s9e/text-formatter": "^2.3.6",
"sycho/json-api": "^0.5.0",
"sycho/sourcemap": "^2.0.0",
"symfony/config": "^5.2.2",
"symfony/console": "^5.2.2",
"symfony/event-dispatcher": "^5.2.2",
"symfony/mime": "^5.2.0",
"symfony/polyfill-intl-messageformatter": "^1.22.0",
"symfony/translation": "^5.1.5",
"symfony/yaml": "^5.2.2",
"wikimedia/less.php": "^3.0"
},
"require-dev": {
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.0",
"phpstan/phpstan-php-parser": "^1.0",
"phpstan/phpstan": "^1.2"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"flarum-subextensions": [
"extensions/akismet",
"extensions/approval",
"extensions/bbcode",
"extensions/embed",
"extensions/emoji",
"extensions/flags",
"extensions/lang-english",
"extensions/likes",
"extensions/lock",
"extensions/markdown",
"extensions/mentions",
"extensions/nicknames",
"extensions/package-manager",
"extensions/pusher",
"extensions/statistics",
"extensions/sticky",
"extensions/subscriptions",
"extensions/suspend",
"extensions/tags"
],
"branch-alias": {
"dev-main": "1.x-dev"
},
"phpstan": {
"includes": [
"extension.neon"
]
}
}
}

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/akismet",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2",
"flarum/core": "^1.3",
"flarum/approval": "^1.2",
"guzzlehttp/guzzle": "^7.4"
},

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/approval",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2",
"flarum/core": "^1.3",
"flarum/flags": "^1.2"
},
"autoload": {

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/bbcode",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"extra": {
"branch-alias": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/embed",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/emoji",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"extra": {
"branch-alias": {

2
extensions/emoji/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -4,18 +4,18 @@
"version": "0.0.0",
"prettier": "@flarum/prettier-config",
"dependencies": {
"simple-emoji-map": "^0.4.1",
"twemoji": "^13.1.0"
"simple-emoji-map": "^0.5.1",
"twemoji": "^14.0.2"
},
"devDependencies": {
"prettier": "^2.5.1",
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1",
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"flarum-webpack-config": "^2.0.0",
"prettier": "^2.5.1",
"typescript": "^4.5.4",
"typescript-coverage-report": "^0.6.1"
"typescript-coverage-report": "^0.6.1",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
},
"scripts": {
"dev": "webpack --mode development --watch",

View File

@@ -39,7 +39,7 @@ export default function renderEmoji() {
// wrap it in a node. In our `parseHTML` implementation, we wrap it in a `<body>`
// element. This gets stripped below.
//
// See https://github.com/flarum/framework/issues/2958
// See https://github.com/flarum/core/issues/2958
const emojifiedDom = twemoji.parse(parseHTML(contentHtml), options);
// Steal the HTML string inside the emojified DOM `<body>` tag.

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/flags",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because it is too large Load Diff

View File

@@ -66,8 +66,8 @@ No changes.
## [0.1.0-beta.13](https://github.com/flarum/lang-english/compare/v0.1.0-beta.12...v0.1.0-beta.13)
### Added
- Keys for hidden permission groups (#153, flarum/framework#2129, flarum/framework#845)
- Keys for post deletion confirmation (#162, flarum/framework#2135)
- Keys for hidden permission groups (#153, flarum/core#2129, flarum/core#845)
- Keys for post deletion confirmation (#162, flarum/core#2135)
- Keys for HTML meta data (#154, flarum/tags#72)
### Changed

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"extra": {
"branch-alias": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/likes",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/lock",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/markdown",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"extra": {
"branch-alias": {

File diff suppressed because it is too large Load Diff

View File

@@ -33,8 +33,8 @@ No changes.
### Fixed
- Unrecognised user/post mentions (https://github.com/flarum/mentions/pulls/71)
- Reduced bugginess in mentions username search (https://github.com/flarum/framework/issues/3095)
- Fixed missing space after mentions inserted via post reply (https://github.com/flarum/framework/issues/3096)
- Reduced bugginess in mentions username search (https://github.com/flarum/core/issues/3095)
- Fixed missing space after mentions inserted via post reply (https://github.com/flarum/core/issues/3096)
## [1.0.0](https://github.com/flarum/mentions/compare/v0.1.0-beta.16...v1.0.0)

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/mentions",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -23,6 +23,6 @@ export default class PostMentionedNotification extends Notification {
}
excerpt() {
return truncate(this.attrs.notification.subject().contentPlain(), 200);
return truncate(this.attrs.notification.subject().contentPlain() || '', 200);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->table('post_mentions_post', function (Blueprint $table) {
$table->timestamp('created_at')->nullable();
});
// do this manually because dbal doesn't recognize timestamp columns
$connection = $schema->getConnection();
$prefix = $connection->getTablePrefix();
$connection->statement("ALTER TABLE `${prefix}post_mentions_post` MODIFY created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP");
},
'down' => function (Builder $schema) {
$schema->table('post_mentions_post', function (Blueprint $table) {
$table->dropColumn('created_at');
});
}
];

View File

@@ -0,0 +1,30 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->table('post_mentions_user', function (Blueprint $table) {
$table->timestamp('created_at')->nullable();
});
// do this manually because dbal doesn't recognize timestamp columns
$connection = $schema->getConnection();
$prefix = $connection->getTablePrefix();
$connection->statement("ALTER TABLE `${prefix}post_mentions_user` MODIFY created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP");
},
'down' => function (Builder $schema) {
$schema->table('post_mentions_user', function (Blueprint $table) {
$table->dropColumn('created_at');
});
}
];

View File

@@ -125,10 +125,13 @@ class ConfigureMentions
{
$post = CommentPost::find($tag->getAttribute('id'));
if ($post && $post->user) {
if ($post) {
$tag->setAttribute('discussionid', (int) $post->discussion_id);
$tag->setAttribute('number', (int) $post->number);
$tag->setAttribute('displayname', $post->user->display_name);
if ($post->user) {
$tag->setAttribute('displayname', $post->user->display_name);
}
return true;
}

View File

@@ -14,7 +14,7 @@ use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
class ListTest extends TestCase
class ListPostsTest extends TestCase
{
use RetrievesAuthorizedUsers;
@@ -85,4 +85,26 @@ class ListTest extends TestCase
$ids = Arr::pluck($data, 'id');
$this->assertEqualsCanonicalizing(['4'], $ids, 'IDs do not match');
}
/**
* @test
*/
public function mentioned_filter_works_with_sort()
{
$response = $this->send(
$this->request('GET', '/api/posts')
->withQueryParams([
'filter' => ['mentioned' => 1],
'sort' => '-createdAt'
])
);
$data = json_decode($response->getBody()->getContents(), true)['data'];
$this->assertEquals(200, $response->getStatusCode());
// Order-independent comparison
$ids = Arr::pluck($data, 'id');
$this->assertEqualsCanonicalizing(['2', '3'], $ids, 'IDs do not match');
}
}

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/nicknames",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,7 @@ class AddNicknameValidation
function ($attribute, $value, $fail) {
$regex = $this->settings->get('flarum-nicknames.regex');
if ($regex && ! preg_match_all("/$regex/", $value)) {
$this->translator->trans('flarum-nicknames.api.invalid_nickname_message');
$fail($this->translator->trans('flarum-nicknames.api.invalid_nickname_message'));
}
},
'min:'.$this->settings->get('flarum-nicknames.min'),

View File

@@ -74,4 +74,48 @@ class RegisterTest extends TestCase
$this->assertEquals(403, $response->getStatusCode());
}
/**
* @test
*/
public function cant_register_with_nickname_if_invalid_regex()
{
$this->setting('flarum-nicknames.set_on_registration', true);
$this->setting('flarum-nicknames.regex', '^[A-z]+$');
$response = $this->send(
$this->request('POST', '/register', [
'json' => [
'nickname' => '007',
'username' => 'test',
'password' => 'too-obscure',
'email' => 'test@machine.local',
]
])
);
$this->assertEquals(422, $response->getStatusCode());
}
/**
* @test
*/
public function can_register_with_nickname_if_valid_regex()
{
$this->setting('flarum-nicknames.set_on_registration', true);
$this->setting('flarum-nicknames.regex', '^[A-z]+$');
$response = $this->send(
$this->request('POST', '/register', [
'json' => [
'nickname' => 'Acme',
'username' => 'test',
'password' => 'too-obscure',
'email' => 'test@machine.local',
]
])
);
$this->assertEquals(201, $response->getStatusCode());
}
}

View File

@@ -23,7 +23,7 @@
},
"require": {
"flarum/core": "^1.0.0",
"composer/composer": "^2.0"
"composer/composer": "^2.3"
},
"require-dev": {
"flarum/testing": "^1.0.0",
@@ -86,7 +86,7 @@
"test:integration": "phpunit -c tests/phpunit.integration.xml",
"test:setup": [
"@php tests/integration/setup.php",
"cd $FLARUM_TEST_TMP_DIR_LOCAL && composer install"
"cd ${FLARUM_TEST_TMP_DIR_LOCAL:-${FLARUM_TEST_TMP_DIR:-./tests/integration/tmp}} && composer install"
]
},
"scripts-descriptions": {

View File

@@ -1,4 +1,3 @@
/// <reference path="../../../vendor/flarum/core/js/src/common/translator-icu-rich.d.ts" />
import Mithril from 'mithril';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
export interface WhyNotModalAttrs extends IInternalModalAttrs {
@@ -8,7 +7,7 @@ export default class WhyNotModal<Attrs extends WhyNotModalAttrs = WhyNotModalAtt
loading: boolean;
whyNot: string | null;
className(): string;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
title(): any;
oncreate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
content(): JSX.Element;
requestWhyNot(): void;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -58,7 +58,7 @@ class CheckForUpdatesHandler
$actor->assertAdmin();
$firstOutput = $this->runComposerCommand(false);
$firstOutput = json_decode($firstOutput, true);
$firstOutput = json_decode($this->cleanJson($firstOutput), true);
$majorUpdates = false;
@@ -71,7 +71,7 @@ class CheckForUpdatesHandler
if ($majorUpdates) {
$secondOutput = $this->runComposerCommand(true);
$secondOutput = json_decode($secondOutput, true);
$secondOutput = json_decode($this->cleanJson($secondOutput), true);
}
if (! isset($secondOutput)) {
@@ -101,6 +101,15 @@ class CheckForUpdatesHandler
->save();
}
/**
* Composer can sometimes return text above the JSON.
* This method tries to remove such occurences.
*/
protected function cleanJson(string $composerOutput): string
{
return preg_replace('/^[^{]+\n({.*)/ms', '$1', $composerOutput);
}
/**
* @throws ComposerCommandFailedException
*/

View File

@@ -15,27 +15,11 @@ class SetupComposer
{
use UsesTmpDir;
private $config = [
'require' => [
'flarum/core' => '1.0.0',
'flarum/tags' => '1.0.3',
'flarum/lang-english' => '*',
],
'config' => [
'preferred-install' => 'dist',
'sort-packages' => true,
],
'repositories' => [
[
'type' => 'path',
'url' => __DIR__.'/tmp/packages/*',
]
]
];
private $config;
public function __construct(array $config = null)
{
$this->config = array_merge($this->config, $config ?? []);
$this->config = $config;
}
public function run()
@@ -44,7 +28,7 @@ class SetupComposer
$composerLock = $this->tmpDir().'/composer.lock';
$packages = $this->tmpDir().'/packages';
file_put_contents($composerJson, json_encode($this->config, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents($composerJson, json_encode($this->getConfig(), JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
if (! file_exists($packages)) {
mkdir($packages);
@@ -53,5 +37,28 @@ class SetupComposer
if (file_exists($composerLock)) {
unlink($composerLock);
}
echo 'composer.json created with testing packages directory.';
}
private function getConfig(): array
{
return array_merge([
'require' => [
'flarum/core' => '1.0.0',
'flarum/tags' => '1.0.3',
'flarum/lang-english' => '*',
],
'config' => [
'preferred-install' => 'dist',
'sort-packages' => true,
],
'repositories' => [
[
'type' => 'path',
'url' => realpath($this->tmpDir()).'/packages/*',
]
]
], $this->config ?? []);
}
}

View File

@@ -19,10 +19,7 @@
<testsuites>
<testsuite name="Flarum Integration Tests">
<directory suffix="Test.php">./integration</directory>
<exclude>./integration/tmp</exclude>
<exclude>./integration/tmp</exclude>
</testsuite>
</testsuites>
<php>
<env name="FLARUM_TEST_TMP_DIR_LOCAL" value="tests/integration/tmp" force="true" />
</php>
</phpunit>

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/pusher",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2",
"flarum/core": "^1.3",
"pusher/pusher-php-server": "^2.2"
},
"require-dev": {

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/statistics",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/framework/issues",
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/sticky",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2"
"flarum/core": "^1.3"
},
"autoload": {
"psr-4": {
@@ -51,7 +51,7 @@
"prettier": true,
"typescript": false,
"bundlewatch": false,
"backendTesting": false,
"backendTesting": true,
"editorConfig": true,
"styleci": true
}
@@ -64,5 +64,28 @@
}
],
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"autoload-dev": {
"psr-4": {
"Flarum\\Sticky\\Tests\\": "tests/"
}
},
"scripts": {
"test": [
"@test:unit",
"@test:integration"
],
"test:unit": "phpunit -c tests/phpunit.unit.xml",
"test:integration": "phpunit -c tests/phpunit.integration.xml",
"test:setup": "@php tests/integration/setup.php"
},
"scripts-descriptions": {
"test": "Runs all tests.",
"test:unit": "Runs all unit tests.",
"test:integration": "Runs all integration tests.",
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
},
"require-dev": {
"flarum/testing": "^1.0.0"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,6 @@ class PinStickiedDiscussionsToTop
$query->orderByRaw('is_sticky and not exists ('.$read->toSql().') and last_posted_at > ? desc')
->addBinding(array_merge($read->getBindings(), [$filterState->getActor()->read_time ?: 0]), 'union');
$query->unionOrders = array_merge($query->unionOrders, $query->orders);
$query->unionLimit = $query->limit;
$query->unionOffset = $query->offset;

View File

View File

@@ -0,0 +1,90 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Sticky\tests\integration\api;
use Carbon\Carbon;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Flarum\Testing\integration\TestCase;
use Illuminate\Support\Arr;
class ListDiscussionsTest extends TestCase
{
use RetrievesAuthorizedUsers;
protected function setUp(): void
{
parent::setUp();
$this->extension('flarum-sticky');
$this->prepareDatabase([
'users' => [
['id' => 1, 'username' => 'Muralf', 'email' => 'muralf@machine.local', 'is_email_confirmed' => 1],
$this->normalUser()
],
'discussions' => [
['id' => 1, 'title' => __CLASS__, 'created_at' => Carbon::now(), 'last_posted_at' => Carbon::now(), 'user_id' => 1, 'first_post_id' => 1, 'comment_count' => 1, 'is_sticky' => true],
['id' => 2, 'title' => __CLASS__, 'created_at' => Carbon::now()->addMinute(), 'last_posted_at' => Carbon::now(), 'user_id' => 1, 'first_post_id' => 1, 'comment_count' => 1, 'is_sticky' => false],
['id' => 3, 'title' => __CLASS__, 'created_at' => Carbon::now()->addMinutes(2), 'last_posted_at' => Carbon::now(), 'user_id' => 1, 'first_post_id' => 1, 'comment_count' => 1, 'is_sticky' => true],
['id' => 4, 'title' => __CLASS__, 'created_at' => Carbon::now()->addMinutes(3), 'last_posted_at' => Carbon::now(), 'user_id' => 1, 'first_post_id' => 1, 'comment_count' => 1, 'is_sticky' => false],
],
'discussion_user' => [
['discussion_id' => 1, 'user_id' => 1, 'last_read_post_number' => 1],
['discussion_id' => 3, 'user_id' => 1, 'last_read_post_number' => 1],
]
]);
}
/** @test */
public function list_discussions_shows_sticky_first_as_guest()
{
$response = $this->send(
$this->request('GET', '/api/discussions')
);
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);
$this->assertEqualsCanonicalizing([1, 3, 2, 4], Arr::pluck($data['data'], 'id'));
}
/** @test */
public function list_discussions_shows_sticky_unread_first_as_user()
{
$response = $this->send(
$this->request('GET', '/api/discussions', [
'authenticatedAs' => 2
])
);
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);
$this->assertEqualsCanonicalizing([1, 3, 2, 4], Arr::pluck($data['data'], 'id'));
}
/** @test */
public function list_discussions_shows_normal_order_when_all_read_as_user()
{
$response = $this->send(
$this->request('GET', '/api/discussions', [
'authenticatedAs' => 1
])
);
$this->assertEquals(200, $response->getStatusCode());
$data = json_decode($response->getBody()->getContents(), true);
$this->assertEqualsCanonicalizing([1, 2, 3, 4], Arr::pluck($data['data'], 'id'));
}
}

Some files were not shown because too many files have changed in this diff Show More