From bcfa156cc73f8797286aa5aa26ff41aab53ec57f Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sun, 8 Oct 2023 14:06:24 +0300 Subject: [PATCH] add make Editor Command --- composer.lock | 266 +++++++++++++------------- docs/getting-started/configuration.md | 27 --- docs/getting-started/editor.md | 46 +++++ src/Concerns/CanManipulateFiles.php | 57 ++++++ src/Console/ZeusEditorCommand.php | 43 +++++ src/SkyServiceProvider.php | 2 + stubs/ZeusEditor.stub | 32 ++++ 7 files changed, 313 insertions(+), 160 deletions(-) create mode 100644 docs/getting-started/editor.md create mode 100644 src/Concerns/CanManipulateFiles.php create mode 100644 src/Console/ZeusEditorCommand.php create mode 100644 stubs/ZeusEditor.stub diff --git a/composer.lock b/composer.lock index 2742efa..9732385 100644 --- a/composer.lock +++ b/composer.lock @@ -1206,16 +1206,16 @@ }, { "name": "egulias/email-validator", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff" + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/3a85486b709bc384dae8eb78fb2eec649bdb64ff", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", "shasum": "" }, "require": { @@ -1224,8 +1224,8 @@ "symfony/polyfill-intl-idn": "^1.26" }, "require-dev": { - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^4.30" + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -1261,7 +1261,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/4.0.1" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" }, "funding": [ { @@ -1269,20 +1269,20 @@ "type": "github" } ], - "time": "2023-01-14T14:17:03+00:00" + "time": "2023-10-06T06:47:41+00:00" }, { "name": "filament/actions", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "97359ba89a106be3a6b52f3a115b1ae39405f522" + "reference": "1f9f945d78833eca82728fd22edfc04e3c0939aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/97359ba89a106be3a6b52f3a115b1ae39405f522", - "reference": "97359ba89a106be3a6b52f3a115b1ae39405f522", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/1f9f945d78833eca82728fd22edfc04e3c0939aa", + "reference": "1f9f945d78833eca82728fd22edfc04e3c0939aa", "shasum": "" }, "require": { @@ -1319,20 +1319,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T18:16:36+00:00" + "time": "2023-10-05T15:18:18+00:00" }, { "name": "filament/filament", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "e79851f80b3a77bddc9ae6bf12c1d5791912fded" + "reference": "2b117b084052bfe81b23aadf090ddeba684ddcf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/e79851f80b3a77bddc9ae6bf12c1d5791912fded", - "reference": "e79851f80b3a77bddc9ae6bf12c1d5791912fded", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/2b117b084052bfe81b23aadf090ddeba684ddcf5", + "reference": "2b117b084052bfe81b23aadf090ddeba684ddcf5", "shasum": "" }, "require": { @@ -1384,20 +1384,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T19:14:42+00:00" + "time": "2023-10-06T15:56:56+00:00" }, { "name": "filament/forms", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "240d67b1209cff088ae3f61a2a0feacce1bd723c" + "reference": "81ee2d2ef6322f53442fd27c8e40d925e1594ce2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/240d67b1209cff088ae3f61a2a0feacce1bd723c", - "reference": "240d67b1209cff088ae3f61a2a0feacce1bd723c", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/81ee2d2ef6322f53442fd27c8e40d925e1594ce2", + "reference": "81ee2d2ef6322f53442fd27c8e40d925e1594ce2", "shasum": "" }, "require": { @@ -1440,20 +1440,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T18:49:57+00:00" + "time": "2023-10-06T15:56:53+00:00" }, { "name": "filament/infolists", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "fce869f93bbfbcd927222a5cca468c9d943dadbc" + "reference": "76bd92dff0c7798e09bcd7b6905e76ecaef193d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/fce869f93bbfbcd927222a5cca468c9d943dadbc", - "reference": "fce869f93bbfbcd927222a5cca468c9d943dadbc", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/76bd92dff0c7798e09bcd7b6905e76ecaef193d5", + "reference": "76bd92dff0c7798e09bcd7b6905e76ecaef193d5", "shasum": "" }, "require": { @@ -1491,20 +1491,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-09-25T19:23:47+00:00" + "time": "2023-10-06T15:56:51+00:00" }, { "name": "filament/notifications", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "489d3caff1e5b2dae46bd1cb926e2fe7567d1e8b" + "reference": "4fe60598157c53b712c46944614fb6a57fb93c04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/489d3caff1e5b2dae46bd1cb926e2fe7567d1e8b", - "reference": "489d3caff1e5b2dae46bd1cb926e2fe7567d1e8b", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/4fe60598157c53b712c46944614fb6a57fb93c04", + "reference": "4fe60598157c53b712c46944614fb6a57fb93c04", "shasum": "" }, "require": { @@ -1543,11 +1543,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T18:16:40+00:00" + "time": "2023-10-05T15:18:17+00:00" }, { "name": "filament/spatie-laravel-media-library-plugin", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-media-library-plugin.git", @@ -1584,7 +1584,7 @@ }, { "name": "filament/spatie-laravel-tags-plugin", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-tags-plugin.git", @@ -1621,16 +1621,16 @@ }, { "name": "filament/spatie-laravel-translatable-plugin", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-translatable-plugin.git", - "reference": "b7d7fe99be7f540351abfc60cf3e3d56173106b1" + "reference": "99e9615c77418650d8b8d769a0c5eaaadb3d4d84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/spatie-laravel-translatable-plugin/zipball/b7d7fe99be7f540351abfc60cf3e3d56173106b1", - "reference": "b7d7fe99be7f540351abfc60cf3e3d56173106b1", + "url": "https://api.github.com/repos/filamentphp/spatie-laravel-translatable-plugin/zipball/99e9615c77418650d8b8d769a0c5eaaadb3d4d84", + "reference": "99e9615c77418650d8b8d769a0c5eaaadb3d4d84", "shasum": "" }, "require": { @@ -1662,20 +1662,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-09-21T09:44:55+00:00" + "time": "2023-10-05T15:18:17+00:00" }, { "name": "filament/support", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "f619cef19853da30ce36688d96b014ca7d966579" + "reference": "6c4358cf11b8f09effcaaa995b4e553e7c1a94c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/f619cef19853da30ce36688d96b014ca7d966579", - "reference": "f619cef19853da30ce36688d96b014ca7d966579", + "url": "https://api.github.com/repos/filamentphp/support/zipball/6c4358cf11b8f09effcaaa995b4e553e7c1a94c8", + "reference": "6c4358cf11b8f09effcaaa995b4e553e7c1a94c8", "shasum": "" }, "require": { @@ -1719,20 +1719,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T18:16:49+00:00" + "time": "2023-10-06T15:56:48+00:00" }, { "name": "filament/tables", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "f8a27a8278e5c165cc352ab776f46fab0f04e974" + "reference": "f661731442a1af2819f3581b05cca38c91db54d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/f8a27a8278e5c165cc352ab776f46fab0f04e974", - "reference": "f8a27a8278e5c165cc352ab776f46fab0f04e974", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/f661731442a1af2819f3581b05cca38c91db54d0", + "reference": "f661731442a1af2819f3581b05cca38c91db54d0", "shasum": "" }, "require": { @@ -1772,20 +1772,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T18:50:12+00:00" + "time": "2023-10-06T15:57:10+00:00" }, { "name": "filament/widgets", - "version": "v3.0.67", + "version": "v3.0.69", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "39ecca54898f10491330e239b5e56571d09eae99" + "reference": "017b070da641e3bde6940656475d81aeb1042f40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/39ecca54898f10491330e239b5e56571d09eae99", - "reference": "39ecca54898f10491330e239b5e56571d09eae99", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/017b070da641e3bde6940656475d81aeb1042f40", + "reference": "017b070da641e3bde6940656475d81aeb1042f40", "shasum": "" }, "require": { @@ -1816,7 +1816,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-10-03T18:16:53+00:00" + "time": "2023-10-06T15:57:09+00:00" }, { "name": "fruitcake/php-cors", @@ -2295,16 +2295,16 @@ }, { "name": "lara-zeus/core", - "version": "v3.0.6", + "version": "v3.0.7", "source": { "type": "git", "url": "https://github.com/lara-zeus/core.git", - "reference": "f0a692404c20059bf177d94a801103c868e0a25d" + "reference": "7558235bc4182fc7d6d9ad06ddbea6bfbde7f4fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lara-zeus/core/zipball/f0a692404c20059bf177d94a801103c868e0a25d", - "reference": "f0a692404c20059bf177d94a801103c868e0a25d", + "url": "https://api.github.com/repos/lara-zeus/core/zipball/7558235bc4182fc7d6d9ad06ddbea6bfbde7f4fc", + "reference": "7558235bc4182fc7d6d9ad06ddbea6bfbde7f4fc", "shasum": "" }, "require": { @@ -2377,7 +2377,7 @@ "type": "github" } ], - "time": "2023-09-24T15:09:17+00:00" + "time": "2023-10-06T19:49:24+00:00" }, { "name": "laravel/framework", @@ -2886,16 +2886,16 @@ }, { "name": "league/flysystem", - "version": "3.16.0", + "version": "3.17.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729" + "reference": "bd4c9b26849d82364119c68429541f1631fba94b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fdf372ca6b63c6e281b1c01a624349ccb757729", - "reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bd4c9b26849d82364119c68429541f1631fba94b", + "reference": "bd4c9b26849d82364119c68429541f1631fba94b", "shasum": "" }, "require": { @@ -2913,8 +2913,8 @@ "symfony/http-client": "<5.2" }, "require-dev": { - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.1", + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", "aws/aws-sdk-php": "^3.220.0", "composer/semver": "^3.0", "ext-fileinfo": "*", @@ -2960,7 +2960,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.16.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.17.0" }, "funding": [ { @@ -2972,7 +2972,7 @@ "type": "github" } ], - "time": "2023-09-07T19:22:17+00:00" + "time": "2023-10-05T20:15:05+00:00" }, { "name": "league/flysystem-local", @@ -3760,16 +3760,16 @@ }, { "name": "nette/schema", - "version": "v1.2.4", + "version": "v1.2.5", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab" + "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab", - "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab", + "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a", + "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a", "shasum": "" }, "require": { @@ -3816,9 +3816,9 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.4" + "source": "https://github.com/nette/schema/tree/v1.2.5" }, - "time": "2023-08-05T18:56:25+00:00" + "time": "2023-10-05T20:37:59+00:00" }, { "name": "nette/utils", @@ -8214,16 +8214,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.2.8", + "version": "v7.2.9", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "882b02d197328138686bb06ce7d8cbb98fc0a16c" + "reference": "1f9e41c0779be4540654d92a9314016713f5e62c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/882b02d197328138686bb06ce7d8cbb98fc0a16c", - "reference": "882b02d197328138686bb06ce7d8cbb98fc0a16c", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/1f9e41c0779be4540654d92a9314016713f5e62c", + "reference": "1f9e41c0779be4540654d92a9314016713f5e62c", "shasum": "" }, "require": { @@ -8231,13 +8231,13 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", + "fidry/cpu-core-counter": "^0.5.1", "jean85/pretty-package-versions": "^2.0.5", "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "phpunit/php-code-coverage": "^10.1.3", - "phpunit/php-file-iterator": "^4.0.2", + "phpunit/php-code-coverage": "^10.1.7", + "phpunit/php-file-iterator": "^4.1.0", "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.3.2", + "phpunit/phpunit": "^10.4.0", "sebastian/environment": "^6.0.1", "symfony/console": "^6.3.4", "symfony/process": "^6.3.4" @@ -8246,8 +8246,8 @@ "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.27.0", - "phpstan/phpstan": "^1.10.32", + "infection/infection": "^0.27.3", + "phpstan/phpstan": "^1.10.37", "phpstan/phpstan-deprecation-rules": "^1.1.4", "phpstan/phpstan-phpunit": "^1.3.14", "phpstan/phpstan-strict-rules": "^1.5.1", @@ -8293,7 +8293,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.2.8" + "source": "https://github.com/paratestphp/paratest/tree/v7.2.9" }, "funding": [ { @@ -8305,7 +8305,7 @@ "type": "paypal" } ], - "time": "2023-10-04T13:38:04+00:00" + "time": "2023-10-06T07:53:04+00:00" }, { "name": "cmgmyr/phploc", @@ -10003,16 +10003,16 @@ }, { "name": "orchestra/testbench", - "version": "v8.12.2", + "version": "v8.12.3", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "1f1bba4effb8199b712cc07fe0073d4f5727c119" + "reference": "95052cafa48efc73d6c2ee3a6dd4797aecc46d82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/1f1bba4effb8199b712cc07fe0073d4f5727c119", - "reference": "1f1bba4effb8199b712cc07fe0073d4f5727c119", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/95052cafa48efc73d6c2ee3a6dd4797aecc46d82", + "reference": "95052cafa48efc73d6c2ee3a6dd4797aecc46d82", "shasum": "" }, "require": { @@ -10021,7 +10021,7 @@ "laravel/framework": ">=10.23.1 <10.27.0", "mockery/mockery": "^1.5.1", "orchestra/testbench-core": ">=8.12.0 <8.13.0", - "orchestra/workbench": "^0.4.0", + "orchestra/workbench": "^0.4.0 || ^0.5.0", "php": "^8.1", "phpunit/phpunit": "^9.6 || ^10.1", "spatie/laravel-ray": "^1.32.4", @@ -10053,9 +10053,9 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v8.12.2" + "source": "https://github.com/orchestral/testbench/tree/v8.12.3" }, - "time": "2023-10-03T04:16:40+00:00" + "time": "2023-10-08T10:02:38+00:00" }, { "name": "orchestra/testbench-core", @@ -10140,16 +10140,16 @@ }, { "name": "orchestra/workbench", - "version": "v0.4.1", + "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/orchestral/workbench.git", - "reference": "21acf1015ac48e36cb468bffd161115689958782" + "reference": "01175d82fd80a6589ffaa9a861100a64c500b259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/workbench/zipball/21acf1015ac48e36cb468bffd161115689958782", - "reference": "21acf1015ac48e36cb468bffd161115689958782", + "url": "https://api.github.com/repos/orchestral/workbench/zipball/01175d82fd80a6589ffaa9a861100a64c500b259", + "reference": "01175d82fd80a6589ffaa9a861100a64c500b259", "shasum": "" }, "require": { @@ -10174,7 +10174,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.4.x-dev" + "dev-master": "0.5.x-dev" } }, "autoload": { @@ -10201,41 +10201,41 @@ ], "support": { "issues": "https://github.com/orchestral/workbench/issues", - "source": "https://github.com/orchestral/workbench/tree/v0.4.1" + "source": "https://github.com/orchestral/workbench/tree/v0.5.0" }, - "time": "2023-09-26T13:04:34+00:00" + "time": "2023-10-06T12:50:40+00:00" }, { "name": "pestphp/pest", - "version": "v2.20.0", + "version": "v2.21.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "a8b785f69e44ae3f902cbf08fe6b79359ba46945" + "reference": "2ffafd445d42c8b7b7e1874bde1c29945767a49d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/a8b785f69e44ae3f902cbf08fe6b79359ba46945", - "reference": "a8b785f69e44ae3f902cbf08fe6b79359ba46945", + "url": "https://api.github.com/repos/pestphp/pest/zipball/2ffafd445d42c8b7b7e1874bde1c29945767a49d", + "reference": "2ffafd445d42c8b7b7e1874bde1c29945767a49d", "shasum": "" }, "require": { - "brianium/paratest": "^7.2.7", + "brianium/paratest": "^7.2.9", "nunomaduro/collision": "^7.9.0", "nunomaduro/termwind": "^1.15.1", "pestphp/pest-plugin": "^2.1.1", "pestphp/pest-plugin-arch": "^2.3.3", "php": "^8.1.0", - "phpunit/phpunit": "^10.3.5" + "phpunit/phpunit": "^10.4.0" }, "conflict": { - "phpunit/phpunit": ">10.3.5", + "phpunit/phpunit": ">10.4.0", "sebastian/exporter": "<5.1.0", "webmozart/assert": "<1.11.0" }, "require-dev": { "pestphp/pest-dev-tools": "^2.16.0", - "pestphp/pest-plugin-type-coverage": "^2.2.0", + "pestphp/pest-plugin-type-coverage": "^2.4.0", "symfony/process": "^6.3.4" }, "bin": [ @@ -10294,7 +10294,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.20.0" + "source": "https://github.com/pestphp/pest/tree/v2.21.0" }, "funding": [ { @@ -10306,7 +10306,7 @@ "type": "github" } ], - "time": "2023-09-29T18:05:52+00:00" + "time": "2023-10-06T12:33:39+00:00" }, { "name": "pestphp/pest-plugin", @@ -11093,16 +11093,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.37", + "version": "1.10.38", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e" + "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/058ba07e92f744d4dcf6061ae75283d0c6456f2e", - "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5302bb402c57f00fb3c2c015bac86e0827e4b691", + "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691", "shasum": "" }, "require": { @@ -11151,7 +11151,7 @@ "type": "tidelift" } ], - "time": "2023-10-02T16:18:37+00:00" + "time": "2023-10-06T14:19:14+00:00" }, { "name": "phpunit/php-code-coverage", @@ -11476,16 +11476,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.3.5", + "version": "10.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503" + "reference": "9784e877e3700de37475545bdbdce8383ff53d25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/747c3b2038f1139e3dcd9886a3f5a948648b7503", - "reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9784e877e3700de37475545bdbdce8383ff53d25", + "reference": "9784e877e3700de37475545bdbdce8383ff53d25", "shasum": "" }, "require": { @@ -11525,7 +11525,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.3-dev" + "dev-main": "10.4-dev" } }, "autoload": { @@ -11557,7 +11557,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.0" }, "funding": [ { @@ -11573,7 +11573,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:42:37+00:00" + "time": "2023-10-06T03:41:22+00:00" }, { "name": "pimple/pimple", @@ -12625,32 +12625,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.13.4", + "version": "8.14.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322" + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/4b2af2fb17773656d02fbfb5d18024ebd19fe322", - "reference": "4b2af2fb17773656d02fbfb5d18024ebd19fe322", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.0", + "phpstan/phpdoc-parser": "^1.23.1", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.26", - "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.3.13", + "phpstan/phpstan": "1.10.37", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.14", "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.6" + "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" }, "type": "phpcodesniffer-standard", "extra": { @@ -12674,7 +12674,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.13.4" + "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" }, "funding": [ { @@ -12686,7 +12686,7 @@ "type": "tidelift" } ], - "time": "2023-07-25T10:28:55+00:00" + "time": "2023-10-08T07:28:08+00:00" }, { "name": "spatie/backtrace", diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index 9e573fc..81c8b71 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -128,30 +128,3 @@ return [ 'editor' => \LaraZeus\Sky\Editors\RichEditor::class, ]; ``` - -## Content Editor - -the default editor is: `MarkdownEditor`. and included: - -* RichEditor -* [Tiptap Editor](https://filamentphp.com/plugins/tiptap) -* [Tiny Editor](https://filamentphp.com/plugins/mohamedsabil83-tinyeditor) - -to use them you only need to install the package, and set the `editor` in `zeus-sky` -```php -/** - * the default editor for pages and posts, Available: - * \LaraZeus\Sky\Editors\TipTapEditor::class, - * \LaraZeus\Sky\Editors\TinyEditor::class, - * \LaraZeus\Sky\Editors\MarkdownEditor::class, - * \LaraZeus\Sky\Editors\RichEditor::class, - */ -'editor' => \LaraZeus\Sky\Editors\RichEditor::class, -``` - -### adding new editor - -you can add any editor available in [filament plugin directory](https://filamentphp.com/plugins) - -* first install the plugin that you want to use. -* implement the `\LaraZeus\Sky\Editors\ContentEditor` interface, and set it in the config `editor` diff --git a/docs/getting-started/editor.md b/docs/getting-started/editor.md new file mode 100644 index 0000000..4d9b66d --- /dev/null +++ b/docs/getting-started/editor.md @@ -0,0 +1,46 @@ +--- +title: Custom Editor +weight: 3 +--- + +## Content Editor + +the default editor is: `MarkdownEditor`. and also included: + +* [RichEditor](https://filamentphp.com/docs/3.x/forms/fields/rich-editor) +* [MarkdownEditor](https://filamentphp.com/docs/3.x/forms/fields/markdown-editor) +* [Tiptap Editor](https://filamentphp.com/plugins/tiptap) +* [Tiny Editor](https://filamentphp.com/plugins/mohamedsabil83-tinyeditor) + +to use them you only need to install the package, and set the `editor` in `zeus-sky` + +```php +/** + * the default editor for pages and posts, Available: + * \LaraZeus\Sky\Editors\TipTapEditor::class, + * \LaraZeus\Sky\Editors\TinyEditor::class, + * \LaraZeus\Sky\Editors\MarkdownEditor::class, + * \LaraZeus\Sky\Editors\RichEditor::class, + */ +'editor' => \LaraZeus\Sky\Editors\RichEditor::class, +``` + +### Customize the editor + +in some cases you may want to use some options with the editor, like uploading to S3 or adding or removing toolbar buttons. +to do so, you need to copy the class to your app or create a new editor. +this way you will have the editor class available to you to add any more options: + +```php +MarkdownEditor::make('content') + ->fileAttachmentsDisk('s3') + ->fileAttachmentsDirectory('attachments') + ->fileAttachmentsVisibility('private') +``` + +### adding new editor + +you can add any editor available in [filament plugin directory](https://filamentphp.com/plugins) + +* first install the plugin that you want to use. +* implement the `\LaraZeus\Sky\Editors\ContentEditor` interface, and set it in the config file `zeus-sky.php` in the `editor` option diff --git a/src/Concerns/CanManipulateFiles.php b/src/Concerns/CanManipulateFiles.php new file mode 100644 index 0000000..97cad05 --- /dev/null +++ b/src/Concerns/CanManipulateFiles.php @@ -0,0 +1,57 @@ +fileExists($stubPath = base_path("stubs/zeus-sky/{$stub}.stub"))) { + $stubPath = $this->getDefaultStubPath() . "/{$stub}.stub"; + } + + $stub = Str::of($filesystem->get($stubPath)); + + foreach ($replacements as $key => $replacement) { + $stub = $stub->replace("{{ {$key} }}", $replacement); + } + + $stub = (string) $stub; + + $this->writeFile($targetPath, $stub); + } + + protected function fileExists(string $path): bool + { + $filesystem = app(Filesystem::class); + + return $filesystem->exists($path); + } + + protected function writeFile(string $path, string $contents): void + { + $filesystem = app(Filesystem::class); + + $filesystem->ensureDirectoryExists( + (string) Str::of($path) + ->beforeLast('/'), + ); + + $filesystem->put($path, $contents); + } + + protected function getDefaultStubPath(): string + { + $reflectionClass = new ReflectionClass($this); + + return (string) Str::of($reflectionClass->getFileName()) + ->beforeLast('Console') + ->append('../stubs'); + } +} diff --git a/src/Console/ZeusEditorCommand.php b/src/Console/ZeusEditorCommand.php new file mode 100644 index 0000000..9715eed --- /dev/null +++ b/src/Console/ZeusEditorCommand.php @@ -0,0 +1,43 @@ +argument('plugin'); + $fieldClassName = str($filamentPluginFullNamespace)->explode('\\')->last(); + + $this->copyStubToApp('ZeusEditor', 'app/Zeus/Editor/' . $fieldClassName . '.php', [ + 'namespace' => 'App\\Zeus\\Editor', + 'plugin' => $filamentPluginFullNamespace, + 'class' => $fieldClassName, + ]); + + $this->info('zeus editor created successfully!'); + } +} diff --git a/src/SkyServiceProvider.php b/src/SkyServiceProvider.php index 0daf73b..ca7b6f8 100644 --- a/src/SkyServiceProvider.php +++ b/src/SkyServiceProvider.php @@ -8,6 +8,7 @@ use LaraZeus\Sky\Console\InstallCommand; use LaraZeus\Sky\Console\migrateCommand; use LaraZeus\Sky\Console\PublishCommand; +use LaraZeus\Sky\Console\ZeusEditorCommand; use RyanChandler\FilamentNavigation\Filament\Resources\NavigationResource; use RyanChandler\FilamentNavigation\FilamentNavigation; use Spatie\LaravelPackageTools\Package; @@ -44,6 +45,7 @@ protected function getCommands(): array migrateCommand::class, PublishCommand::class, InstallCommand::class, + ZeusEditorCommand::class, ]; } diff --git a/stubs/ZeusEditor.stub b/stubs/ZeusEditor.stub new file mode 100644 index 0000000..e6d327e --- /dev/null +++ b/stubs/ZeusEditor.stub @@ -0,0 +1,32 @@ +required(); + } + + return Textarea::make('content')->required(); + } + + public static function render(string $content): string + { + if (class_exists({{ class }}Alias::class)) { + return $content; + } + + return $content; + } +} +