Skip to content

Commit 17409bd

Browse files
chore: initial commit
0 parents  commit 17409bd

33 files changed

+3649
-0
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
max_line_length = 100
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
quote_type = single
14+
indent_style = tab
15+
indent_size = 4
16+
17+
[*.{json,yml,yaml}]
18+
indent_style = space
19+
indent_size = 2
20+
insert_final_newline = false

.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**/.gitattributes export-ignore
2+
**/.gitignore export-ignore
3+
**/.gitmodules export-ignore
4+
**/.github export-ignore
5+
**/.travis export-ignore
6+
**/.travis.yml export-ignore
7+
**/.editorconfig export-ignore
8+
**/.styleci.yml export-ignore
9+
10+
**/phpunit.xml export-ignore
11+
**/tests export-ignore
12+
13+
**/js/dist/**/* -diff
14+
**/js/dist/**/* linguist-generated
15+
**/js/dist-typings/**/* -diff
16+
**/js/dist-typings/**/* linguist-generated
17+
**/js/yarn.lock -diff
18+
**/js/package-lock.json -diff
19+
20+
* text=auto eol=lf

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Resolves**
2+
<!-- include a link to the issue -->
3+
4+
**Changes proposed in this pull request:**
5+
<!-- mention the pages and/or components which have been impacted -->
6+
7+
**Reviewers should focus on:**
8+
<!-- ask for feedback on specific changes you are unsure about -->
9+
10+
**Screenshot**
11+
<!-- include an image of the most relevant user-facing change, if any -->
12+
13+
**Necessity**
14+
15+
- [ ] Has the problem that is being solved here been clearly explained?
16+
- [ ] Do the changes introduced in this PR need to be in this extension, or could it be made reusable for other clients as well?
17+
- [ ] Are we willing to maintain this for years / potentially forever?
18+
19+
**Confirmed**
20+
21+
- [ ] Frontend changes: tested on a local Flarum installation.
22+
- [ ] Backend changes: tests are green (run `composer test` or check GitHub Workflows).
23+
- [ ] Tests have been added, or are not appropriate here.

.github/workflows/backend.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: GB Save Sorting Preferences PHP
2+
3+
on: [workflow_dispatch, push, pull_request]
4+
5+
jobs:
6+
run:
7+
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@1.x
8+
with:
9+
enable_backend_testing: true
10+
enable_phpstan: true
11+
php_versions: '["8.2", "8.3", "8.4"]'
12+
13+
backend_directory: .

.github/workflows/frontend.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: GB Save Sorting Preferences JS
2+
3+
on: [workflow_dispatch, push, pull_request]
4+
5+
jobs:
6+
run:
7+
uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@1.x
8+
with:
9+
enable_bundlewatch: true
10+
enable_prettier: true
11+
enable_typescript: true
12+
13+
frontend_directory: ./js
14+
backend_directory: .
15+
js_package_manager: yarn
16+
main_git_branch: 1.x
17+
18+
git_actor_name: ${{ vars.GIT_ACTOR_NAME }}
19+
git_actor_email: ${{ vars.GIT_ACTOR_EMAIL }}
20+
21+
secrets:
22+
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
23+
git_actor_token: ${{ secrets.GIT_ACTOR_TOKEN }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/vendor
2+
composer.lock
3+
composer.phar
4+
5+
.DS_Store
6+
Thumbs.db
7+
tests/.phpunit.result.cache
8+
/tests/integration/tmp
9+
.vagrant
10+
.idea/*
11+
.vscode
12+
js/coverage-ts

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) Glowing Blue AG
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# GB Save Sorting Preferences
2+
3+
![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/glowingblue/save-sorting-preferences.svg)](https://packagist.org/packages/glowingblue/save-sorting-preferences) [![Total Downloads](https://img.shields.io/packagist/dt/glowingblue/save-sorting-preferences.svg)](https://packagist.org/packages/glowingblue/save-sorting-preferences)
4+
5+
A [Flarum](https://flarum.org) extension. Allows users to persist their preferred sort order of discussions
6+
7+
## Installation
8+
9+
Install with composer:
10+
11+
```sh
12+
composer require glowingblue/save-sorting-preferences:"*"
13+
```
14+
15+
## Updating
16+
17+
```sh
18+
composer update glowingblue/save-sorting-preferences:"*"
19+
php flarum migrate
20+
php flarum cache:clear
21+
```
22+
23+
## Links
24+
25+
- [Packagist](https://packagist.org/packages/glowingblue/save-sorting-preferences)
26+
- [GitHub](https://github.com/glowingblue/flarum-ext-save-sorting-preferences)

composer.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "glowingblue/save-sorting-preferences",
3+
"description": "Allows users to persist their preferred sort order of discussions",
4+
"keywords": [
5+
"flarum"
6+
],
7+
"type": "flarum-extension",
8+
"license": "MIT",
9+
"require": {
10+
"flarum/core": "^1.2.0"
11+
},
12+
"authors": [
13+
{
14+
"name": "Team Blomstra",
15+
"email": "development@blomstra.net",
16+
"role": "Developer"
17+
},
18+
{
19+
"name": "Glowing Blue AG",
20+
"email": "dev@glowingblue.com",
21+
"role": "Developer"
22+
}
23+
],
24+
"support": {
25+
"issues": "https://github.com/glowingblue/flarum-ext-save-sorting-preferences/issues",
26+
"source": "https://github.com/glowingblue/flarum-ext-save-sorting-preferences"
27+
},
28+
"autoload": {
29+
"psr-4": {
30+
"GlowingBlue\\SaveSortingPreferences\\": "src/"
31+
}
32+
},
33+
"extra": {
34+
"flarum-extension": {
35+
"title": "GB Save Sorting Preferences",
36+
"category": "feature",
37+
"icon": {
38+
"name": "fas fa-sort-alpha-down",
39+
"backgroundColor": "#00a7e3",
40+
"color": "#fff"
41+
}
42+
},
43+
"flarum-cli": {
44+
"modules": {
45+
"admin": false,
46+
"forum": true,
47+
"js": true,
48+
"jsCommon": false,
49+
"css": false,
50+
"locale": true,
51+
"gitConf": true,
52+
"githubActions": true,
53+
"prettier": true,
54+
"typescript": true,
55+
"bundlewatch": true,
56+
"backendTesting": true,
57+
"editorConfig": true,
58+
"styleci": false
59+
}
60+
}
61+
},
62+
"minimum-stability": "dev",
63+
"prefer-stable": true,
64+
"autoload-dev": {
65+
"psr-4": {
66+
"GlowingBlue\\SaveSortingPreferences\\Tests\\": "tests/"
67+
}
68+
},
69+
"scripts": {
70+
"analyse:phpstan": "phpstan analyse",
71+
"clear-cache:phpstan": "phpstan clear-result-cache",
72+
"test": [
73+
"@test:unit",
74+
"@test:integration"
75+
],
76+
"test:unit": "phpunit -c tests/phpunit.unit.xml",
77+
"test:integration": "phpunit -c tests/phpunit.integration.xml",
78+
"test:setup": "@php tests/integration/setup.php"
79+
},
80+
"scripts-descriptions": {
81+
"analyse:phpstan": "Run static analysis",
82+
"test": "Runs all tests.",
83+
"test:unit": "Runs all unit tests.",
84+
"test:integration": "Runs all integration tests.",
85+
"test:setup": "Sets up a database for use with integration tests. Execute this only once."
86+
},
87+
"require-dev": {
88+
"flarum/phpstan": "^1.8",
89+
"flarum/testing": "^1.0.0"
90+
}
91+
}

extend.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of glowingblue/save-sorting-preferences.
5+
*
6+
* Copyright (c) Glowing Blue AG.
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace GlowingBlue\SaveSortingPreferences;
13+
14+
use Flarum\Extend;
15+
16+
return [
17+
(new Extend\Frontend('forum'))
18+
->js(__DIR__.'/js/dist/forum.js'),
19+
20+
new Extend\Locales(__DIR__.'/resources/locale'),
21+
];

0 commit comments

Comments
 (0)