Skip to content
Merged

v2 #5

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
87efb85
add phpstan
Jackardios Feb 8, 2024
52a852d
refactor
Jackardios Feb 8, 2024
d0e37e0
update stubs
Jackardios Feb 8, 2024
d614fc7
fix phpdoc
Jackardios Feb 8, 2024
d3cb5f3
wip
Jackardios Feb 10, 2024
9336731
update stubs
Jackardios Feb 10, 2024
e93b60d
update config
Jackardios Feb 14, 2024
d29d21d
add php-cs-fixer config
Jackardios Feb 14, 2024
22c01aa
add phpstan config
Jackardios Feb 14, 2024
fffc905
update phpunit config
Jackardios Feb 14, 2024
57b6f2d
update .gitignore
Jackardios Feb 14, 2024
97abcab
update packages
Jackardios Feb 14, 2024
5247a08
wip
Jackardios Feb 14, 2024
0c6856f
update tests
Jackardios Feb 14, 2024
2f03f41
fix setAppModules, setVendorModules and pruneModulesPaths
Jackardios Feb 14, 2024
f1c6e26
update tests
Jackardios Feb 14, 2024
07186f0
fix ListCommand
Jackardios Feb 14, 2024
e0d206b
add BaseCommandTest
Jackardios Feb 15, 2024
b991f03
add app/foo stub module
Jackardios Feb 15, 2024
dcb8d92
fix `ModuleCommandHelpersTrait`
Jackardios Feb 15, 2024
b2f469f
fix commands
Jackardios Feb 15, 2024
2167f01
add `ModuleDeleteCommandTest`
Jackardios Feb 15, 2024
248383f
add `Module::subNamespace()` method
Jackardios Feb 19, 2024
5598f60
update composer.json
Jackardios Feb 19, 2024
60adb09
add `getOptionOrAsk()` and `getOptionOrChoice()` methods
Jackardios Feb 19, 2024
c241398
fix
Jackardios Feb 19, 2024
6342abd
refactor
Jackardios Feb 19, 2024
dfdba3d
refactor
Jackardios Feb 19, 2024
b6a9e5f
use `/stubs/modules` as default custom stubs path
Jackardios Feb 20, 2024
3267dbd
add module type filter for `ModulesRepository` methods
Jackardios Feb 20, 2024
59d036b
add `module:stub:publish` command
Jackardios Feb 20, 2024
3601fa1
refactor
Jackardios Feb 21, 2024
0dd4737
update `ModuleCommandHelpersTrait`
Jackardios Feb 21, 2024
7ea48bf
add `ModuleComponentTypeEnum`
Jackardios Feb 21, 2024
e09d2e4
add some helpers to `BaseComponentGeneratorCommand`
Jackardios Feb 22, 2024
96872d2
add suggested packages to composer.json
Jackardios Feb 22, 2024
2a4f1d8
fix
Jackardios Feb 22, 2024
557ca97
add methods to modify module assets and providers
Jackardios Feb 22, 2024
f1731e4
refactor
Jackardios Feb 22, 2024
26b49bb
refactor Traits -> Concerns
Jackardios Feb 23, 2024
7ef0424
update phpstan config
Jackardios Feb 23, 2024
6add066
refactor
Jackardios Feb 23, 2024
b596d80
fix removeRelationColumn in `SchemaParser`
Jackardios Feb 23, 2024
bedd2eb
update commands
Jackardios Feb 23, 2024
25f6a78
update tests (wip)
Jackardios Feb 23, 2024
757c335
remove readme.stub
Jackardios Feb 23, 2024
09a36e1
fix code style
Jackardios Feb 24, 2024
80f38f6
refactor
Jackardios Feb 24, 2024
52bc118
fix `BaseComponentGeneratorCommand`
Jackardios Feb 24, 2024
7187584
add `BaseComponentGeneratorCommandTest`
Jackardios Feb 24, 2024
9c39978
refactor
Jackardios Feb 26, 2024
944e991
update tests
Jackardios Feb 26, 2024
afa248e
refactor
Jackardios Feb 27, 2024
6dd86fa
fix
Jackardios Feb 27, 2024
287666b
fix tests
Jackardios Feb 27, 2024
7e5f479
fix `buildModulesManifest()`
Jackardios Feb 27, 2024
03a1c5f
fix `ProviderMakeCommand`
Jackardios Feb 27, 2024
91b4567
fix `ModuleMakeCommand`
Jackardios Feb 27, 2024
b558952
fix composer.json.stub
Jackardios Feb 27, 2024
0ca9d45
update tests
Jackardios Feb 27, 2024
74c009e
freeze time in tests
Jackardios Feb 27, 2024
59c6eca
fix notifications config
Jackardios Feb 27, 2024
c33d6fc
update tests
Jackardios Feb 27, 2024
c2488f0
fix code style
Jackardios Feb 27, 2024
eb57cf8
fix database/factories path, autoload database factories and seeders
Jackardios Feb 27, 2024
db984c0
move `Concerns` and `Facades` to `Support`
Jackardios Feb 28, 2024
880922b
fix composer.json.stub
Jackardios Feb 28, 2024
8b6bdde
update module provider stub
Jackardios Feb 28, 2024
dcae4dd
update stubs
Jackardios Feb 28, 2024
612444a
update module provider stub
Jackardios Feb 28, 2024
42949e9
update module provider stub
Jackardios Feb 28, 2024
76a7bfd
cleanup
Jackardios Feb 28, 2024
8152eb0
fix code style
Jackardios Feb 28, 2024
d8827c4
add missing `version` attribute to composer.json
Jackardios Feb 28, 2024
22a93ea
fix command output style
Jackardios Feb 28, 2024
285e93d
fix wrong relative path
Jackardios Feb 28, 2024
cedef85
update ModuleMakeCommandTest
Jackardios Feb 28, 2024
a7450a4
fix queued notification stub
Jackardios Feb 29, 2024
6da0dd0
fix stubs
Jackardios Feb 29, 2024
454f399
fix stub
Jackardios Feb 29, 2024
06db14a
update module provider stub
Jackardios Feb 29, 2024
79a27e0
set modulesManifestPath only if cache config enabled
Jackardios Mar 7, 2024
685e966
fix `loadCommandsFrom`
Jackardios Mar 7, 2024
4819e61
fix module provider stub
Jackardios Mar 7, 2024
4023ba2
fix `loadCommandsFrom`
Jackardios Mar 7, 2024
d3c9bfc
fix module provider stub
Jackardios Mar 7, 2024
c28cb0d
fix test stubs
Jackardios Mar 20, 2024
0e89852
update stubs
Jackardios Dec 8, 2025
d0897ba
refactor
Jackardios Dec 9, 2025
62f68a4
ignore unused traits errors
Jackardios Dec 9, 2025
ae86d3d
add github actions
Jackardios Dec 9, 2025
591bea3
update README.md
Jackardios Dec 9, 2025
0f05f4b
update composer.json to support laravel 10-12
Jackardios Dec 9, 2025
c7e05ab
fix base path
Jackardios Dec 9, 2025
51cd581
fix test
Jackardios Dec 9, 2025
4fa1537
update README.md
Jackardios Dec 9, 2025
0f622d5
fix tests
Jackardios Dec 9, 2025
3bf85c0
fix tests
Jackardios Dec 9, 2025
93b8947
fix code style
Jackardios Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
87 changes: 87 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3, 8.4]
laravel: [10.*, 11.*, 12.*]
exclude:
- php: 8.1
laravel: 11.*
- php: 8.1
laravel: 12.*

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, json
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction

- name: Run tests
run: composer test

static-analysis:
runs-on: ubuntu-latest

name: Static Analysis

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, json
coverage: none

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Run PHPStan
run: composer analyse

code-style:
runs-on: ubuntu-latest

name: Code Style

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, json
coverage: none

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Check code style
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build
coverage
.env
.env.backup
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
.phpunit.cache
.phpstorm.meta.php
Expand Down
39 changes: 39 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->exclude([
'__snapshots__',
'.pest',
])
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
874 changes: 866 additions & 8 deletions README.md

Large diffs are not rendered by default.

54 changes: 29 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "laraneat/modules",
"description": "Laraneat modules.",
"homepage": "https://github.com/laraneat/core/",
"homepage": "https://github.com/laraneat/modules/",
"support": {
"issues": "https://github.com/laraneat/core/issues",
"source": "https://github.com/laraneat/core"
"issues": "https://github.com/laraneat/modules/issues",
"source": "https://github.com/laraneat/modules"
},
"authors": [
{
Expand All @@ -24,59 +24,63 @@
],
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-json": "*",
"laravel/framework": "^10.0"
"composer/composer": "^2.1",
"laravel/framework": "^10.0 || ^11.0 || ^12.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.48",
"mockery/mockery": "~1.0",
"orchestra/testbench": "^8.2",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"larastan/larastan": "^2.0 || ^3.0",
"mockery/mockery": "^1.0",
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
"pestphp/pest": "^2.31 || ^3.0",
"pestphp/pest-plugin-laravel": "^2.0 || ^3.0",
"phpstan/phpstan": "^1.10.58 || ^2.0",
"roave/security-advisories": "dev-latest",
"spatie/phpunit-snapshot-assertions": "^5.1"
"spatie/pest-plugin-snapshots": "^2.1"
},
"autoload": {
"psr-4": {
"Laraneat\\Modules\\": "src"
},
"files": [
"src/helpers.php"
]
}
},
"autoload-dev": {
"psr-4": {
"Laraneat\\Modules\\Tests\\": "tests",
"App\\": "tests/laravel/app",
"App\\Modules\\Article\\": "tests/fixtures/stubs/valid/Article"
"App\\": "tests/fixtures/laravel/app",
"Modules\\": "tests/fixtures/laravel/modules"
}
},
"suggest": {
"wikimedia/composer-merge-plugin": "Allows the ability to create and merge composer.json files for your individual modules for module-specific dependency management."
"lorisleiva/laravel-actions": "Laravel components that take care of one specific task",
"jackardios/laravel-query-wizard": "Easily build Eloquent queries from API requests",
"spatie/laravel-data": "Powerful data objects for Laravel"
},
"extra": {
"laravel": {
"providers": [
"Laraneat\\Modules\\ModulesServiceProvider"
"Laraneat\\Modules\\Providers\\ComposerServiceProvider",
"Laraneat\\Modules\\Providers\\ConsoleServiceProvider",
"Laraneat\\Modules\\Providers\\ModulesRepositoryServiceProvider",
"Laraneat\\Modules\\Providers\\ModulesServiceProvider"
],
"aliases": {
"Modules": "Laraneat\\Modules\\Facades\\Modules"
}
}
},
"scripts": {
"update-snapshots": "./vendor/bin/phpunit --no-coverage -d --update-snapshots",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --debug --coverage-html coverage",
"pcf": "vendor/bin/php-cs-fixer fix --verbose",
"analyse" : "./vendor/bin/phpstan analyse --memory-limit=256M",
"test" : "./vendor/bin/pest --no-coverage",
"test-coverage" : "./vendor/bin/pest --coverage-html coverage",
"update-snapshots": "./vendor/bin/pest --no-coverage --update-snapshots",
"format": "./vendor/bin/php-cs-fixer fix --allow-risky=yes",
"post-autoload-dump": [
"@php ./vendor/bin/testbench package:discover --ansi"
]
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"config" : {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
Expand Down
Loading