Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit 21f8977

Browse files
authored
Version 2.0 (#66)
1 parent c8e2164 commit 21f8977

File tree

156 files changed

+27691
-43023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+27691
-43023
lines changed

.eslintrc.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
extends: [
3+
"eslint:recommended",
4+
"plugin:vue/vue3-recommended",
5+
"plugin:vue/vue3-essential",
6+
"plugin:vue/vue3-strongly-recommended"
7+
],
8+
rules: {
9+
"no-undef": 0,
10+
"vue/multi-word-component-names": 0,
11+
"vue/no-v-html": 0,
12+
"vue/require-default-prop": 0,
13+
"indent": ["error", 4],
14+
"quotes": ["error", "double"],
15+
}
16+
}
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "Coding Standards"
2+
on: [push]
3+
jobs:
4+
coding-standards:
5+
runs-on: ubuntu-latest
6+
7+
strategy:
8+
matrix:
9+
php-version:
10+
- "8.0"
11+
node-version:
12+
- 16
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
ref: ${{ github.head_ref }}
19+
20+
- name: "Install Node"
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: "${{ matrix.node-version }}"
24+
25+
- name: "Install PHP with extensions"
26+
uses: "shivammathur/setup-php@v2"
27+
with:
28+
coverage: "none"
29+
php-version: "${{ matrix.php-version }}"
30+
31+
- name: Cache node modules
32+
id: cache-npm
33+
uses: actions/cache@v3
34+
env:
35+
cache-name: cache-node-modules
36+
with:
37+
# npm cache files are stored in `~/.npm` on Linux/macOS
38+
path: ~/.npm
39+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-build-${{ env.cache-name }}-
42+
${{ runner.os }}-build-
43+
${{ runner.os }}-
44+
45+
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
46+
name: List the state of node modules
47+
continue-on-error: true
48+
run: npm list
49+
50+
- name: "Install locked dependencies with npm"
51+
run: "npm ci --ignore-scripts"
52+
53+
- name: "Cache dependencies installed with composer"
54+
uses: "actions/cache@v2"
55+
with:
56+
path: "~/.composer/cache"
57+
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}"
58+
restore-keys: "php-${{ matrix.php-version }}-composer-"
59+
60+
- name: "Install locked dependencies with composer"
61+
run: "composer install --no-interaction --no-progress --no-suggest"
62+
63+
- name: "Create cache directory for friendsofphp/php-cs-fixer"
64+
run: mkdir -p .build/php-cs-fixer
65+
66+
- name: "Cache cache directory for friendsofphp/php-cs-fixer"
67+
uses: "actions/cache@v2"
68+
with:
69+
path: "~/.build/php-cs-fixer"
70+
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
71+
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"
72+
73+
- name: "Run eslint"
74+
run: "npm run eslint"
75+
76+
- name: "Run friendsofphp/php-cs-fixer"
77+
run: "composer php-cs-fixer"
78+
79+
- name: Commit changes
80+
uses: stefanzweifel/git-auto-commit-action@v4
81+
with:
82+
commit_message: Fix styling

.github/workflows/js.yml

-30
This file was deleted.

.github/workflows/php.yml

+72-14
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,93 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [8.1, 8.0, 7.4]
12-
laravel: [9.*, 8.*]
11+
php: [8.1, 8.0]
12+
laravel: [9.*]
1313
dependency-version: [prefer-lowest, prefer-stable]
14-
exclude:
15-
- laravel: 9.*
16-
php: 7.4
17-
include:
18-
- laravel: 9.*
19-
testbench: 7.*
20-
- laravel: 8.*
21-
testbench: 6.*
2214

23-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
15+
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
2416

2517
steps:
2618
- name: Checkout code
2719
uses: actions/checkout@v2
2820

21+
- name: Cache node modules
22+
id: cache-npm
23+
uses: actions/cache@v3
24+
env:
25+
cache-name: cache-node-modules
26+
with:
27+
# npm cache files are stored in `~/.npm` on Linux/macOS
28+
path: ~/.npm
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-
32+
${{ runner.os }}-build-
33+
${{ runner.os }}-
34+
35+
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
36+
name: List the state of node modules
37+
continue-on-error: true
38+
run: npm list
39+
40+
- name: "Install locked dependencies with npm"
41+
run: |
42+
npm ci --ignore-scripts
43+
cd app
44+
npm ci --ignore-scripts
45+
46+
- name: Build package
47+
run: npm run build
48+
2949
- name: Setup PHP
3050
uses: shivammathur/setup-php@v2
3151
with:
3252
php-version: ${{ matrix.php }}
3353
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql
3454
coverage: none
3555

36-
- name: Install dependencies
56+
- name: Prepare demo app
3757
run: |
38-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
58+
cd app
59+
cp .env.example .env
3960
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
61+
npm run production
62+
touch database/database.sqlite
63+
php artisan migrate:fresh --seed
64+
php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1`
65+
66+
- name: Start Chrome Driver
67+
run: |
68+
cd app
69+
./vendor/laravel/dusk/bin/chromedriver-linux &
70+
71+
- name: Run Laravel Server
72+
run: |
73+
cd app
74+
php artisan serve &
4075
4176
- name: Execute tests
42-
run: vendor/bin/phpunit
77+
run: |
78+
cd app
79+
php artisan dusk
80+
81+
- name: Upload Screenshots
82+
if: failure()
83+
uses: actions/upload-artifact@v2
84+
with:
85+
name: screenshots
86+
path: app/tests/Browser/screenshots
87+
88+
- name: Upload Console Logs
89+
if: failure()
90+
uses: actions/upload-artifact@v2
91+
with:
92+
name: console
93+
path: app/tests/Browser/console
94+
95+
- name: Upload Logs
96+
if: failure()
97+
uses: actions/upload-artifact@v2
98+
with:
99+
name: logs
100+
path: app/storage/logs

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ composer.lock
2727
docs
2828
vendor
2929
coverage
30-
.phpunit.result.cache
30+
.phpunit.result.cache
31+
app/public/css/app.css
32+
app/public/js/app.js
33+
app/public/mix-manifest.json

.php-cs-fixer.php

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/php',
6+
__DIR__ . '/app/app',
7+
__DIR__ . '/app/config',
8+
__DIR__ . '/app/database',
9+
__DIR__ . '/app/lang',
10+
__DIR__ . '/app/routes',
11+
__DIR__ . '/app/tests',
12+
])
13+
->name('*.php')
14+
->ignoreDotFiles(true)
15+
->ignoreVCS(true);
16+
17+
return (new PhpCsFixer\Config())
18+
->setRules([
19+
'@PHP70Migration' => true,
20+
'@PHP71Migration' => true,
21+
'@PHP73Migration' => true,
22+
'@PHP74Migration' => true,
23+
'@PHP80Migration' => true,
24+
'@PSR2' => true,
25+
'array_indentation' => true,
26+
'binary_operator_spaces' => ['default' => 'align_single_space_minimal'],
27+
'blank_line_before_statement' => ['statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try']],
28+
'class_attributes_separation' => ['elements' => ['method' => 'one']],
29+
'concat_space' => ['spacing' => 'one'],
30+
'increment_style' => ['style' => 'post'],
31+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => true],
32+
'method_chaining_indentation' => true,
33+
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
34+
'no_extra_blank_lines' => true,
35+
'no_trailing_comma_in_singleline_array' => true,
36+
'no_unused_imports' => true,
37+
'no_whitespace_before_comma_in_array' => true,
38+
'not_operator_with_successor_space' => false,
39+
'ordered_imports' => true,
40+
'phpdoc_scalar' => true,
41+
'phpdoc_single_line_var_spacing' => true,
42+
'phpdoc_var_without_name' => true,
43+
'return_type_declaration' => ['space_before' => 'none'],
44+
'semicolon_after_instruction' => false,
45+
'simple_to_complex_string_variable' => true,
46+
'strict_comparison' => true,
47+
'ternary_operator_spaces' => true,
48+
'trailing_comma_in_multiline' => true,
49+
'trim_array_spaces' => true,
50+
'unary_operator_spaces' => true,
51+
'yoda_style' => false,
52+
])
53+
->setFinder($finder)
54+
->setRiskyAllowed(true)
55+
->setUsingCache(false);

0 commit comments

Comments
 (0)