Skip to content

Commit

Permalink
feat(migrator): Command aliases (lara-asp-migrator:sql-migration as…
Browse files Browse the repository at this point in the history
… `make:sql-migration`, `lara-asp-migrator:sql-seeder` as `make:sql-seeder`). Also, minimum version of Laravel set to `11.0.8`.
  • Loading branch information
LastDragon-ru committed Nov 28, 2024
1 parent 782b061 commit cefc189
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 73 deletions.
36 changes: 18 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@
"doctrine/sql-formatter": "^1.1",
"guzzlehttp/psr7": "^2.4.5",
"http-interop/http-factory-guzzle": "^1.0.0",
"illuminate/collections": "^11.0.0",
"illuminate/conditionable": "^11.0.0",
"illuminate/console": "^11.0.0",
"illuminate/container": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/filesystem": "^11.0.0",
"illuminate/http": "^11.0.0",
"illuminate/macroable": "^11.0.0",
"illuminate/pagination": "^11.0.0",
"illuminate/process": "^11.0.0",
"illuminate/routing": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/testing": "^11.0.0",
"illuminate/translation": "^11.0.0",
"illuminate/validation": "^11.0.0",
"illuminate/collections": "^11.0.8",
"illuminate/conditionable": "^11.0.8",
"illuminate/console": "^11.0.8",
"illuminate/container": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/filesystem": "^11.0.8",
"illuminate/http": "^11.0.8",
"illuminate/macroable": "^11.0.8",
"illuminate/pagination": "^11.0.8",
"illuminate/process": "^11.0.8",
"illuminate/routing": "^11.0.8",
"illuminate/support": "^11.0.8",
"illuminate/testing": "^11.0.8",
"illuminate/translation": "^11.0.8",
"illuminate/validation": "^11.0.8",
"larastan/larastan": "^2.8.1",
"league/commonmark": "^2.5.1",
"league/config": "^1.1.1",
Expand Down Expand Up @@ -96,8 +96,8 @@
"bamarni/composer-bin-plugin": "^1.8",
"composer/class-map-generator": "^1.0",
"fakerphp/faker": "^1.21.0",
"illuminate/cache": "^11.0.0",
"illuminate/config": "^11.0.0",
"illuminate/cache": "^11.0.8",
"illuminate/config": "^11.0.8",
"laravel/scout": "^10.8.0",
"orchestra/testbench": "^9.0.0",
"phpstan/phpstan": "1.12.11",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
},
"require": {
"php": "^8.2|^8.3",
"illuminate/console": "^11.0.0",
"illuminate/container": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/console": "^11.0.8",
"illuminate/container": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/support": "^11.0.8",
"symfony/deprecation-contracts": "^3.0.0",
"symfony/filesystem": "^7.0.0",
"symfony/polyfill-php83": "^1.28"
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"require": {
"php": "^8.2|^8.3",
"illuminate/contracts": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/contracts": "^11.0.8",
"illuminate/support": "^11.0.8",
"larastan/larastan": "^2.8.1",
"lastdragon-ru/lara-asp-core": "self.version",
"lastdragon-ru/lara-asp-documentator": "self.version",
Expand Down
8 changes: 4 additions & 4 deletions packages/documentator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"ext-intl": "*",
"ext-mbstring": "*",
"composer/semver": "^3.2",
"illuminate/contracts": "^11.0.0",
"illuminate/console": "^11.0.0",
"illuminate/process": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/contracts": "^11.0.8",
"illuminate/console": "^11.0.8",
"illuminate/process": "^11.0.8",
"illuminate/support": "^11.0.8",
"league/commonmark": "^2.5.1",
"league/config": "^1.1.1",
"nikic/php-parser": "^5.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/eloquent/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
},
"require": {
"php": "^8.2|^8.3",
"illuminate/collections": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/collections": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/support": "^11.0.8",
"lastdragon-ru/lara-asp-core": "self.version",
"symfony/polyfill-php83": "^1.28"
},
"require-dev": {
"ext-pdo_sqlite": "*",
"illuminate/contracts": "^11.0.0",
"illuminate/contracts": "^11.0.8",
"lastdragon-ru/lara-asp-testing": "self.version",
"mockery/mockery": "^1.6.5",
"orchestra/testbench": "^9.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/formatter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"ext-bcmath": "*",
"ext-intl": "*",
"ext-mbstring": "*",
"illuminate/macroable": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/macroable": "^11.0.8",
"illuminate/support": "^11.0.8",
"lastdragon-ru/lara-asp-core": "self.version",
"symfony/polyfill-php83": "^1.28"
},
"require-dev": {
"illuminate/contracts": "^11.0.0",
"illuminate/contracts": "^11.0.8",
"lastdragon-ru/lara-asp-testing": "self.version",
"orchestra/testbench": "^9.0.0",
"phpunit/phpunit": "^10.5.0|^11.0.0"
Expand Down
10 changes: 5 additions & 5 deletions packages/graphql/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"ext-filter": "*",
"ext-mbstring": "*",
"composer/semver": "^3.2",
"illuminate/collections": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/collections": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/support": "^11.0.8",
"nuwave/lighthouse": "^6.36.0",
"lastdragon-ru/lara-asp-core": "self.version",
"lastdragon-ru/lara-asp-eloquent": "self.version",
Expand All @@ -37,7 +37,7 @@
},
"require-dev": {
"ext-pdo_sqlite": "*",
"illuminate/cache": "^11.0.0",
"illuminate/cache": "^11.0.8",
"laravel/scout": "^10.8.0",
"mockery/mockery": "^1.6.5",
"phpunit/phpunit": "^10.5.0|^11.0.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/migrator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
"php": "^8.2|^8.3",
"ext-json": "*",
"ext-mbstring": "*",
"illuminate/conditionable": "^11.0.0",
"illuminate/console": "^11.0.0",
"illuminate/container": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/filesystem": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/conditionable": "^11.0.8",
"illuminate/console": "^11.0.8",
"illuminate/container": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/filesystem": "^11.0.8",
"illuminate/support": "^11.0.8",
"lastdragon-ru/lara-asp-core": "self.version",
"symfony/console": "^7.0.0",
"symfony/finder": "^7.0.0",
"symfony/polyfill-php83": "^1.28"
},
"require-dev": {
"ext-pdo_sqlite": "*",
"illuminate/config": "^11.0.0",
"illuminate/config": "^11.0.8",
"lastdragon-ru/lara-asp-testing": "self.version",
"mockery/mockery": "^1.6.5",
"orchestra/testbench": "^9.0.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/migrator/src/Commands/SqlMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#[AsCommand(
name : Package::Name.':sql-migration',
description: 'Create a new SQL Migration file.',
aliases : [
'make:sql-migration',
],
)]
class SqlMigration extends BaseCommand {
#[Override]
Expand Down
23 changes: 20 additions & 3 deletions packages/migrator/src/Commands/SqlMigrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use LastDragon_ru\LaraASP\Migrator\Package;
use LastDragon_ru\LaraASP\Migrator\Testing\Package\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Finder\Finder;

use function array_slice;
Expand All @@ -16,16 +17,18 @@
*/
#[CoversClass(SqlMigration::class)]
final class SqlMigrationTest extends TestCase {
public function testHandle(): void {
// <editor-fold desc="Tests">
// =========================================================================
#[DataProvider('dataProviderHandle')]
public function testHandle(string $command): void {
// Pre test
$pkg = Package::Name;
$path = self::getTempDirectory();
$finder = Finder::create()->in($path);

self::assertCount(0, $finder->files());

// Call
$this->artisan("{$pkg}:sql-migration", [
$this->artisan($command, [
'name' => 'SqlMigration',
'--path' => $path,
]);
Expand All @@ -44,4 +47,18 @@ public function testHandle(): void {

self::assertEquals($expected, $actual);
}
// </editor-fold>

// <editor-fold desc="DataProviders">
// =========================================================================
/**
* @return array<string, array{string}>
*/
public static function dataProviderHandle(): array {
return [
'name' => [Package::Name.':sql-migration'],
'alias' => ['make:sql-migration'],
];
}
// </editor-fold>
}
3 changes: 3 additions & 0 deletions packages/migrator/src/Commands/SqlSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#[AsCommand(
name : Package::Name.':sql-seeder',
description: 'Create a new SQL Seeder class',
aliases : [
'make:sql-seeder',
],
)]
class SqlSeeder extends GeneratorCommand {
/**
Expand Down
23 changes: 20 additions & 3 deletions packages/migrator/src/Commands/SqlSeederTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
use LastDragon_ru\LaraASP\Migrator\Package;
use LastDragon_ru\LaraASP\Migrator\Testing\Package\TestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Finder\Finder;

/**
* @internal
*/
#[CoversClass(SqlSeeder::class)]
final class SqlSeederTest extends TestCase {
public function testHandle(): void {
// <editor-fold desc="Tests">
// =========================================================================
#[DataProvider('dataProviderHandle')]
public function testHandle(string $command): void {
// Pre test
$pkg = Package::Name;
$path = self::getTempDirectory();
$finder = Finder::create()->in($path);

Expand All @@ -26,7 +29,7 @@ public function testHandle(): void {
$this->app->useDatabasePath($path);

// Call
$this->artisan("{$pkg}:sql-seeder", [
$this->artisan($command, [
'name' => 'SqlSeeder',
]);

Expand All @@ -43,4 +46,18 @@ public function testHandle(): void {

self::assertEquals($expected, $actual);
}
// </editor-fold>

// <editor-fold desc="DataProviders">
// =========================================================================
/**
* @return array<string, array{string}>
*/
public static function dataProviderHandle(): array {
return [
'name' => [Package::Name.':sql-seeder'],
'alias' => ['make:sql-seeder'],
];
}
// </editor-fold>
}
8 changes: 4 additions & 4 deletions packages/serializer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
},
"require": {
"php": "^8.2|^8.3",
"illuminate/container": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/container": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/support": "^11.0.8",
"lastdragon-ru/lara-asp-core": "self.version",
"phpdocumentor/type-resolver": "^1.7",
"phpstan/phpdoc-parser": "^1.25",
Expand Down
16 changes: 8 additions & 8 deletions packages/spa/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"require": {
"php": "^8.2|^8.3",
"ext-mbstring": "*",
"illuminate/collections": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/http": "^11.0.0",
"illuminate/pagination": "^11.0.0",
"illuminate/routing": "^11.0.0",
"illuminate/support": "^11.0.0",
"illuminate/validation": "^11.0.0",
"illuminate/collections": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/http": "^11.0.8",
"illuminate/pagination": "^11.0.8",
"illuminate/routing": "^11.0.8",
"illuminate/support": "^11.0.8",
"illuminate/validation": "^11.0.8",
"guzzlehttp/psr7": "^2.4.5",
"lastdragon-ru/lara-asp-core": "self.version",
"symfony/deprecation-contracts": "^3.0.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/testing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"composer/semver": "^3.2",
"doctrine/sql-formatter": "^1.1",
"http-interop/http-factory-guzzle": "^1.0.0",
"illuminate/collections": "^11.0.0",
"illuminate/console": "^11.0.0",
"illuminate/contracts": "^11.0.0",
"illuminate/database": "^11.0.0",
"illuminate/testing": "^11.0.0",
"illuminate/translation": "^11.0.0",
"illuminate/collections": "^11.0.8",
"illuminate/console": "^11.0.8",
"illuminate/contracts": "^11.0.8",
"illuminate/database": "^11.0.8",
"illuminate/testing": "^11.0.8",
"illuminate/translation": "^11.0.8",
"mockery/mockery": "^1.6.5",
"opis/json-schema": "^2.3.0",
"phpunit/phpunit": "^10.5.0|^11.0.0",
Expand All @@ -50,7 +50,7 @@
"require-dev": {
"fakerphp/faker": "^1.21.0",
"guzzlehttp/psr7": "^2.4.5",
"illuminate/http": "^11.0.0",
"illuminate/http": "^11.0.8",
"laravel/scout": "^10.8.0",
"orchestra/testbench": "^9.0.0",
"symfony/console": "^7.0.0",
Expand Down

0 comments on commit cefc189

Please sign in to comment.