diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index bcd3b48..1937a6c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Validate composer.json and composer.lock run: composer validate --strict diff --git a/composer.json b/composer.json index 432e911..0b534c6 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "league/plates": "^3.5" }, "require-dev": { - "pestphp/pest": "^1.21", + "pestphp/pest": "^1.23", "laravel/pint": "^1.10" }, "scripts": { diff --git a/composer.lock b/composer.lock index f42fba5..568be89 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4d06f4cf700ffc72267226399e9f8ae6", + "content-hash": "c4718c95e0f447330dccaa5ce3a7353e", "packages": [ { "name": "league/plates", @@ -72,23 +72,24 @@ }, { "name": "minicli/command-help", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/minicli/command-help.git", - "reference": "5f95b71db9585cd21a8b24ce3e5425a4bdf7e0e6" + "reference": "d87601fff38467d563c129acb50e7c8c286c0fdc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minicli/command-help/zipball/5f95b71db9585cd21a8b24ce3e5425a4bdf7e0e6", - "reference": "5f95b71db9585cd21a8b24ce3e5425a4bdf7e0e6", + "url": "https://api.github.com/repos/minicli/command-help/zipball/d87601fff38467d563c129acb50e7c8c286c0fdc", + "reference": "d87601fff38467d563c129acb50e7c8c286c0fdc", "shasum": "" }, "require": { "minicli/minicli": "^4.0" }, "require-dev": { - "laravel/pint": "^1.10" + "laravel/pint": "^1.10", + "pestphp/pest": "^2.6" }, "type": "library", "autoload": { @@ -109,22 +110,22 @@ ], "support": { "issues": "https://github.com/minicli/command-help/issues", - "source": "https://github.com/minicli/command-help/tree/1.0.0" + "source": "https://github.com/minicli/command-help/tree/1.0.1" }, - "time": "2023-05-18T10:14:01+00:00" + "time": "2023-06-07T13:59:44+00:00" }, { "name": "minicli/minicli", - "version": "4.0.2", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/minicli/minicli.git", - "reference": "2922ad8a07b66616b28f28aa1a3a39b7c626408c" + "reference": "1f71a5d8ec76d5b07280816ffcc9b36499830f43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minicli/minicli/zipball/2922ad8a07b66616b28f28aa1a3a39b7c626408c", - "reference": "2922ad8a07b66616b28f28aa1a3a39b7c626408c", + "url": "https://api.github.com/repos/minicli/minicli/zipball/1f71a5d8ec76d5b07280816ffcc9b36499830f43", + "reference": "1f71a5d8ec76d5b07280816ffcc9b36499830f43", "shasum": "" }, "require": { @@ -132,13 +133,16 @@ "php": ">=8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.5", + "laravel/pint": "^1.10", "mockery/mockery": "^1.5", "pestphp/pest": "^2.5", "phpstan/phpstan": "^1.10" }, "type": "library", "autoload": { + "files": [ + "src/helpers.php" + ], "psr-4": { "Minicli\\": "src/" } @@ -155,7 +159,7 @@ ], "support": { "issues": "https://github.com/minicli/minicli/issues", - "source": "https://github.com/minicli/minicli/tree/4.0.2" + "source": "https://github.com/minicli/minicli/tree/4.0.5" }, "funding": [ { @@ -163,7 +167,7 @@ "type": "github" } ], - "time": "2023-05-18T09:57:29+00:00" + "time": "2023-06-07T18:49:30+00:00" }, { "name": "nunomaduro/termwind", @@ -306,23 +310,23 @@ }, { "name": "symfony/console", - "version": "v6.2.10", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f" + "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f", + "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", + "symfony/service-contracts": "^2.5|^3", "symfony/string": "^5.4|^6.0" }, "conflict": { @@ -344,12 +348,6 @@ "symfony/process": "^5.4|^6.0", "symfony/var-dumper": "^5.4|^6.0" }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, "type": "library", "autoload": { "psr-4": { @@ -382,7 +380,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.10" + "source": "https://github.com/symfony/console/tree/v6.3.0" }, "funding": [ { @@ -398,20 +396,20 @@ "type": "tidelift" } ], - "time": "2023-04-28T13:37:43+00:00" + "time": "2023-05-29T12:49:39+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { @@ -420,7 +418,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -449,7 +447,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { @@ -465,7 +463,7 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/polyfill-ctype", @@ -799,16 +797,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "shasum": "" }, "require": { @@ -818,13 +816,10 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -864,7 +859,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" }, "funding": [ { @@ -880,20 +875,20 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/string", - "version": "v6.2.8", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", + "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", "shasum": "" }, "require": { @@ -904,13 +899,13 @@ "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", + "symfony/translation-contracts": "^2.5|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -950,7 +945,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.8" + "source": "https://github.com/symfony/string/tree/v6.3.0" }, "funding": [ { @@ -966,7 +961,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2023-03-21T21:06:29+00:00" } ], "packages-dev": [ @@ -1113,16 +1108,16 @@ }, { "name": "laravel/pint", - "version": "v1.10.0", + "version": "v1.10.1", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "c7a01fa9bdd79819e7a2f1ba63ac1b02e6692dbc" + "reference": "d69f914aa347a448628b672ba90adf0b4ea0ce4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/c7a01fa9bdd79819e7a2f1ba63ac1b02e6692dbc", - "reference": "c7a01fa9bdd79819e7a2f1ba63ac1b02e6692dbc", + "url": "https://api.github.com/repos/laravel/pint/zipball/d69f914aa347a448628b672ba90adf0b4ea0ce4a", + "reference": "d69f914aa347a448628b672ba90adf0b4ea0ce4a", "shasum": "" }, "require": { @@ -1133,7 +1128,7 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.16.0", + "friendsofphp/php-cs-fixer": "^3.17.0", "illuminate/view": "^10.5.1", "laravel-zero/framework": "^10.0.2", "mockery/mockery": "^1.5.1", @@ -1175,7 +1170,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2023-04-25T14:52:30+00:00" + "time": "2023-06-03T15:01:17+00:00" }, { "name": "myclabs/deep-copy", @@ -1238,16 +1233,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.15.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", "shasum": "" }, "require": { @@ -1288,9 +1283,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-05-19T20:20:00+00:00" }, { "name": "nunomaduro/collision", diff --git a/config/app.php b/config/app.php new file mode 100644 index 0000000..e87fdc1 --- /dev/null +++ b/config/app.php @@ -0,0 +1,26 @@ + envconfig( + 'MINICLI_APP_NAME', + 'MiniTerm - MiniCLI Application Template powered with Termwind and Plates' + ), + + 'app_path' => [ + __DIR__.'/../app/Command', + '@minicli/command-help' + ], + + 'theme' => '', + + 'debug' => true, +]; diff --git a/minicli b/minicli index 439c462..e4e22e0 100755 --- a/minicli +++ b/minicli @@ -13,13 +13,7 @@ use App\Services\TermwindService; use Minicli\App; use Minicli\Exception\CommandNotFoundException; -$app = new App([ - 'app_path' => [ - __DIR__ . '/app/Command', - '@minicli/command-help' - ], - 'debug' => true -]); +$app = new App(); // Register Termwind Service $app->addService('termwind', new TermwindService()); diff --git a/tests/Helpers.php b/tests/Helpers.php index de51f52..75f2f64 100644 --- a/tests/Helpers.php +++ b/tests/Helpers.php @@ -6,38 +6,13 @@ use App\Services\PlatesService; use App\Services\TermwindService; use Minicli\App; -use Minicli\Command\CommandCall; use Symfony\Component\Console\Output\BufferedOutput; use function Termwind\renderUsing; -function getCommandsPath(): string -{ - return __DIR__.'/../app/Command'; -} - function getApp(): App { - $config = [ - 'app_path' => getCommandsPath() - ]; - - $app = new App($config); - $app->addService('termwind', new TermwindService()); - $app->addService('plates', new PlatesService()); - $app->setOutputHandler(new TermwindOutputHandler()); - - return $app; -} - -function getProdApp(): App -{ - $config = [ - 'app_path' => getCommandsPath(), - 'debug' => false - ]; - - $app = new App($config); + $app = new App(); $app->addService('termwind', new TermwindService()); $app->addService('plates', new PlatesService()); $app->setOutputHandler(new TermwindOutputHandler()); @@ -45,11 +20,6 @@ function getProdApp(): App return $app; } -function getCommandCall(array $parameters = null): CommandCall -{ - return new CommandCall(array_merge(['minicli'], $parameters)); -} - function getOutput(): BufferedOutput { $output = new BufferedOutput();