Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvp/working #1

Merged
merged 50 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
56da615
wip - not working due to issue (https://github.com/NativePHP/laravel/…
gwleuverink Apr 2, 2024
ac99018
Merge branch 'main' into install-nativephp
gwleuverink Apr 5, 2024
97734b2
boyscouting
gwleuverink Apr 5, 2024
1776e37
boyscouting
gwleuverink Apr 5, 2024
10020e4
boyscouting
gwleuverink Apr 5, 2024
fe6a7ff
run server via polling
gwleuverink Apr 5, 2024
fd81a45
boyscouting
gwleuverink Apr 10, 2024
e5bc2fd
use cached attribute for parsed email
gwleuverink Apr 10, 2024
f2e5265
boyscouting
gwleuverink Apr 10, 2024
2c5b008
rework supervisor & broadcasting scaffold
gwleuverink Apr 12, 2024
2054b3e
reduce preview reloading flicker
gwleuverink Apr 12, 2024
286e5a0
add script to kill stray processes listening to port 2525
gwleuverink Apr 12, 2024
792ebe7
add pail
gwleuverink Apr 12, 2024
0f3fbd8
boysouting
gwleuverink Apr 12, 2024
098219d
supervisor timing
gwleuverink Apr 12, 2024
46f2c94
integrate duster
gwleuverink Apr 12, 2024
e1b1ce0
add tlint
gwleuverink Apr 12, 2024
44bf7da
run duster
gwleuverink Apr 12, 2024
3af926a
wip
gwleuverink Apr 12, 2024
f166d67
fix ci
gwleuverink Apr 12, 2024
075f708
wip
gwleuverink Apr 12, 2024
3099afc
wip
gwleuverink Apr 12, 2024
8e7f5ed
wip
gwleuverink Apr 12, 2024
b600c6d
wip
gwleuverink Apr 12, 2024
b9b5950
wip
gwleuverink Apr 12, 2024
93e32cc
wip
gwleuverink Apr 12, 2024
777588e
wip
gwleuverink Apr 16, 2024
022d92c
Dusting
gwleuverink Apr 16, 2024
c5d5b00
Ignore Dusting commit in git blame
gwleuverink Apr 16, 2024
2a0144c
wip
gwleuverink Apr 16, 2024
8120227
Merge branch 'mvp/working' of https://github.com/gwleuverink/phost in…
gwleuverink Apr 16, 2024
7bec276
wip
gwleuverink Apr 16, 2024
63f8c01
Dusting
gwleuverink Apr 16, 2024
41746d7
Ignore Dusting commit in git blame
gwleuverink Apr 16, 2024
c89dd1f
update gitignore
gwleuverink Apr 16, 2024
b896551
update supervisor
gwleuverink Apr 16, 2024
92c88b4
boyscouting
gwleuverink Apr 17, 2024
e0fadb5
update deps
gwleuverink Apr 18, 2024
a862364
improve error reporting
gwleuverink Apr 18, 2024
01b65ea
fix static analysis
gwleuverink Apr 18, 2024
9033fa5
add smtp server testing mock
gwleuverink Apr 18, 2024
968ab82
fix test
gwleuverink Apr 18, 2024
c065039
fix test
gwleuverink Apr 18, 2024
f099a49
fix test
gwleuverink Apr 18, 2024
4be716c
wip
gwleuverink Apr 25, 2024
f79a18f
improve ui & add settings dialog
gwleuverink Apr 25, 2024
120d74e
boyscouting
gwleuverink Apr 25, 2024
fa15ad1
make settings configurable
gwleuverink Apr 25, 2024
d7e0b95
Dusting
gwleuverink Apr 25, 2024
40d99ff
Ignore Dusting commit in git blame
gwleuverink Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
APP_NAME=Laravel
APP_NAME=Phost
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost
APP_URL=http://phost.test

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
Expand Down
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
022d92c18a4a5a38658ee14dc4af958b26e597cf
63f8c01938730a01258d0e6b8a1325b82d43ce09
d7e0b956a369047666dfe25eaf29c15f2a74fb92
119 changes: 119 additions & 0 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: codestyle

# Commits made in here will not trigger any workflows
# Checkout Duster's documentation for a workaround

on:
pull_request:
branches: [development, dev, acceptance, staging, main, master]

jobs:
skip-duplicates:
continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest

# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
cancel_others: "true"
concurrent_skipping: "same_content"
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md", "**/docs/**"]'

duster-fix:
needs: skip-duplicates
if: needs.skip-duplicates.outputs.should_skip != 'true'

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci

- uses: shivammathur/setup-php@v2
with:
php-version: "8.2"

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v6
with:
php_version: "8.2"
php_extensions: pcntl
version: 2.x

- name: Run fixers
run: composer fix

- uses: stefanzweifel/git-auto-commit-action@v4
id: auto_commit_action
with:
commit_message: Dusting
commit_user_name: GitHub Action
commit_user_email: actions@github.com

- name: Ignore Duster commit in git blame
if: steps.auto_commit_action.outputs.changes_detected == 'true'
run: echo ${{ steps.auto_commit_action.outputs.commit_hash }} >> .git-blame-ignore-revs

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Ignore Dusting commit in git blame
commit_user_name: GitHub Action
commit_user_email: actions@github.com

duster-lint:
needs: skip-duplicates
if: needs.skip-duplicates.outputs.should_skip != 'true'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci

- uses: shivammathur/setup-php@v2
with:
php-version: "8.2"

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v6
with:
php_version: "8.2"
php_extensions: pcntl
version: 2.x

- name: Run linters & static analysis
run: composer lint
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: tests

on:
pull_request:
branches: [development, dev, acceptance, staging, main, master]

jobs:
skip-duplicates:
continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest

# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
cancel_others: "true"
concurrent_skipping: "same_content"
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md", "**/docs/**"]'

laravel-tests:
needs: skip-duplicates
if: needs.skip-duplicates.outputs.should_skip != 'true'

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: "8.2"

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v6
with:
php_version: "8.2"
php_extensions: pcntl
version: 2.x

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: Generate key
run: php artisan key:generate

# - name: Directory Permissions
# run: chmod -R 777 storage bootstrap/cache

- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite

- name: Execute tests
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan test
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
**/.DS_Store
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
.env
.env.backup
Expand All @@ -17,3 +19,11 @@ yarn-error.log
/.fleet
/.idea
/.vscode

output.log
docker_tag
DOCKER_ENV
Dockerfile-php-build

_ide_helper.php
.phpstorm.meta.php
30 changes: 30 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

// @codeCoverageIgnoreStart

// Prefer adding customizations to pint.json unless adding custom fixers

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->in([
__DIR__ . '/app',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/resources',
__DIR__ . '/routes',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new Config)
->setFinder($finder)
->setRules([])
->setRiskyAllowed(true)
->setUsingCache(false);

// @codeCoverageIgnoreEnd
88 changes: 88 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0"?>
<ruleset name="Gedachtegoed">
<description>Gedachtegoed PHP CS rules for Laravel</description>

<file>app</file>
<file>config</file>
<file>database</file>
<file>public</file>
<file>resources</file>
<file>routes</file>
<file>tests</file>

<description>Gedachtegoed PHP CS rules for Laravel</description>

<!-- Ignore normal Laravel files and folders -->
<exclude-pattern>*/cache/*</exclude-pattern>
<exclude-pattern>*/*.js</exclude-pattern>
<exclude-pattern>*/*.css</exclude-pattern>
<exclude-pattern>*/*.xml</exclude-pattern>
<exclude-pattern>*/*.blade.php</exclude-pattern>
<exclude-pattern>*/autoload.php</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/docs/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/migrations/*</exclude-pattern>

<!-- Hard-code command-line parameters -->
<arg name="colors"/>
<arg value="p"/>

<!-- PSR1 2.3 Side Effects -->
<rule ref="PSR1.Files.SideEffects">
<!-- Disable side effects for index file -->
<exclude-pattern>/public/index.php</exclude-pattern>
<!-- Disable side effects for tests (Pest) -->
<exclude-pattern>/tests</exclude-pattern>
</rule>

<!-- PSR1 3 Namespaces and classes MUST follow PSR-0. -->
<rule ref="PSR1.Classes.ClassDeclaration"/>

<!-- Disable missing namespace rule for tests and database files -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/database/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>

<!-- PSR1 3 Class names MUST be declared in StudlyCaps. -->
<rule ref="Squiz.Classes.ValidClassName"/>

<!-- PSR1 4.1 Class constants MUST be declared in all upper case with underscore separators. -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>

<!-- PSR1 4.3 Method names MUST be declared in camelCase(). -->
<rule ref="PSR1.Methods.CamelCapsMethodName"/>

<!-- Disable camel caps rule for tests -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>

<!-- No compact() and no 'dumps' -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="compact" value="null"/>
<element key="dd" value="null"/>
<element key="dump" value="null"/>
<element key="var_dump" value="null"/>
<element key="ray" value="null"/>
<element key="env" value="null"/>
</property>
</properties>
</rule>

<rule ref="Generic.PHP.ForbiddenFunctions">
<exclude-pattern>/config/*</exclude-pattern>
<properties>
<property name="forbiddenFunctions" type="array">
<element key="env" value="null"/>
</property>
</properties>
</rule>

<!-- Class name should match the file name -->
<rule ref="Squiz.Classes.ClassFileName"/>

</ruleset>
23 changes: 23 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"plugins": [
"@shufo/prettier-plugin-blade"
],
"overrides": [
{
"files": [
"*.blade.php"
],
"options": {
"parser": "blade",
"tabWidth": 4
}
}
],

"htmlWhitespaceSensitivity": "css",
"sortTailwindcssClasses": true,
"singleAttributePerLine": true,
"bracketSameLine": false,
"printWidth": 600,
"tabWidth": 4
}
Loading