diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml new file mode 100644 index 00000000..2435a082 --- /dev/null +++ b/.github/workflows/backend.yml @@ -0,0 +1,12 @@ +name: FoF Polls PHP + +on: [workflow_dispatch, push, pull_request] + +jobs: + run: + uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main + with: + enable_backend_testing: false + enable_phpstan: true + + backend_directory: . diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a438188d..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build JavaScript assets - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: flarum/action-build@v3 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 00000000..1b67573c --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,19 @@ +name: FoF Polls JS + +on: [workflow_dispatch, push, pull_request] + +jobs: + run: + uses: flarum/framework/.github/workflows/REUSABLE_frontend.yml@main + with: + enable_bundlewatch: false + enable_prettier: true + enable_typescript: true + + frontend_directory: ./js + backend_directory: . + js_package_manager: npm + main_git_branch: master + + secrets: + bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} diff --git a/composer.json b/composer.json index 74cf0452..88f48a2d 100755 --- a/composer.json +++ b/composer.json @@ -1,54 +1,69 @@ { - "name": "fof/polls", - "description": " A Flarum extension that adds polls to your discussions", - "keywords": [ - "flarum" - ], - "type": "flarum-extension", - "license": "MIT", - "support": { - "issues": "https://github.com/FriendsOfFlarum/polls/issues", - "source": "https://github.com/FriendsOfFlarum/polls", - "forum": "https://discuss.flarum.org/d/20586" - }, - "homepage": "https://friendsofflarum.org", - "funding": [ - { - "type": "website", - "url": "https://opencollective.com/fof/donate" - } - ], - "require": { - "flarum/core": "^1.3.0" - }, - "conflict": { - "reflar/polls": "*" - }, - "authors": [ - { - "name": "David Sevilla Martin", - "email": "david.s@redevs.org", - "role": "Developer" - } - ], - "autoload": { - "psr-4": { - "FoF\\Polls\\": "src/", - "FoF\\Polls\\Migrations\\": "migrations/" - } - }, - "extra": { - "flarum-extension": { - "title": "FoF Polls", - "category": "discussion", - "icon": { - "name": "fas fa-signal", - "backgroundColor": "#e74c3c", - "color": "#fff" - } + "name": "fof/polls", + "description": " A Flarum extension that adds polls to your discussions", + "keywords": [ + "flarum" + ], + "type": "flarum-extension", + "license": "MIT", + "support": { + "issues": "https://github.com/FriendsOfFlarum/polls/issues", + "source": "https://github.com/FriendsOfFlarum/polls", + "forum": "https://discuss.flarum.org/d/20586" + }, + "homepage": "https://friendsofflarum.org", + "funding": [ + { + "type": "website", + "url": "https://opencollective.com/fof/donate" + } + ], + "require": { + "flarum/core": "^1.3.0" + }, + "conflict": { + "reflar/polls": "*" + }, + "authors": [ + { + "name": "David Sevilla Martin", + "email": "david.s@redevs.org", + "role": "Developer" + } + ], + "autoload": { + "psr-4": { + "FoF\\Polls\\": "src/", + "FoF\\Polls\\Migrations\\": "migrations/" + } + }, + "extra": { + "flarum-extension": { + "title": "FoF Polls", + "category": "discussion", + "icon": { + "name": "fas fa-signal", + "backgroundColor": "#e74c3c", + "color": "#fff" + } + }, + "flagrow": { + "discuss": "https://discuss.flarum.org/d/20586" + }, + "flarum-cli": { + "modules": { + "githubActions": true + } + } + }, + "require-dev": { + "flarum/phpstan": "*" + }, + "scripts": { + "analyse:phpstan": "phpstan analyse", + "clear-cache:phpstan": "phpstan clear-result-cache" }, - "flagrow": { - "discuss": "https://discuss.flarum.org/d/20586" + "scripts-descriptions": { + "analyse:phpstan": "Run static analysis" } - } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..03cf2619 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,13 @@ +includes: + - vendor/flarum/phpstan/extension.neon + +parameters: + # The level will be increased in Flarum 2.0 + level: 5 + paths: + - extend.php + - src + excludePaths: + - *.blade.php + checkMissingIterableValueType: false + databaseMigrationsPath: ['migrations']