From e9a4cc2627369f5a21e0dbdcbb3e3274e2b0b2c6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 17 Apr 2024 13:27:26 +0200 Subject: [PATCH 1/6] Add test sources --- .idea/develop.iml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.idea/develop.iml b/.idea/develop.iml index 8e317382cd6..b5e53b44ef0 100644 --- a/.idea/develop.iml +++ b/.idea/develop.iml @@ -7,6 +7,7 @@ + @@ -15,6 +16,13 @@ + + + + + + + From c18f45a04c4f05c159cb0f2f288eaf834041fcb9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 17 Apr 2024 13:00:13 +0200 Subject: [PATCH 2/6] Update debug command to print the binary path when running in Phar --- RELEASE_NOTES.md | 1 + .../src/Console/Commands/DebugCommand.php | 6 ++++ .../Feature/Commands/DebugCommandTest.php | 33 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3529f658206..e48fab3905a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -19,6 +19,7 @@ This serves two purposes: ### Changed - The `features` array in the `config/hyde.php` configuration file is now an array of `Feature` enums in https://github.com/hydephp/develop/pull/1650 - Sitemap generation will now be skipped if a base URL is not set, as Google now will not index sitemaps without a base URL in https://github.com/hydephp/develop/pull/1660 +- Updated the debug command to print the binary path when running in a standalone Phar in https://github.com/hydephp/develop/pull/1667 ### Deprecated - Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 and will be removed in HydePHP v2.0 diff --git a/packages/framework/src/Console/Commands/DebugCommand.php b/packages/framework/src/Console/Commands/DebugCommand.php index b722fb70bcb..cd87f65c5d4 100644 --- a/packages/framework/src/Console/Commands/DebugCommand.php +++ b/packages/framework/src/Console/Commands/DebugCommand.php @@ -7,11 +7,13 @@ use Hyde\Hyde; use Hyde\Facades\Config; use Composer\InstalledVersions; +use Hyde\Foundation\PharSupport; use LaravelZero\Framework\Commands\Command; use function str_replace; use function realpath; use function app; +use function get_included_files; /** * Print debug information. @@ -50,6 +52,10 @@ public function handle(): int $this->printVerbosePathInformation(); } else { $this->comment('Project directory: '.Hyde::path()); + + if (PharSupport::running()) { + $this->comment('Application binary path: '.get_included_files()[0]); + } } $this->newLine(); diff --git a/packages/framework/tests/Feature/Commands/DebugCommandTest.php b/packages/framework/tests/Feature/Commands/DebugCommandTest.php index 5cd341b0dc7..9d0c72dce8d 100644 --- a/packages/framework/tests/Feature/Commands/DebugCommandTest.php +++ b/packages/framework/tests/Feature/Commands/DebugCommandTest.php @@ -4,7 +4,11 @@ namespace Hyde\Framework\Testing\Feature\Commands; +use Mockery; use Hyde\Testing\TestCase; +use Hyde\Foundation\PharSupport; +use Illuminate\Console\OutputStyle; +use Hyde\Console\Commands\DebugCommand; /** * @covers \Hyde\Console\Commands\DebugCommand @@ -46,4 +50,33 @@ public function testItPrintsVerboseDebugInformation() ->expectsOutputToContain('(real)') ->assertExitCode(0); } + + public function testItPrintsPharDebugInformation() + { + PharSupport::mock('running', true); + + $wasCalled = false; + + $output = Mockery::mock(OutputStyle::class, [ + 'writeln' => null, + 'newLine' => null, + 'isVerbose' => false, + ])->makePartial(); + + $output->shouldReceive('writeln')->withArgs(function ($message) use (&$wasCalled) { + if (str_contains($message, 'Application binary path:')) { + $wasCalled = true; + } + + return true; + }); + + $command = new DebugCommand(); + $command->setOutput($output); + $command->handle(); + + $this->assertTrue($wasCalled, 'Expected "Application binary path" to be called'); + + PharSupport::clearMocks(); + } } From f54332c27ca53c9282deaa6b349e63dea87b5763 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 17 Apr 2024 14:45:03 +0200 Subject: [PATCH 3/6] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e48fab3905a..48efc46fd5f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,7 +22,7 @@ This serves two purposes: - Updated the debug command to print the binary path when running in a standalone Phar in https://github.com/hydephp/develop/pull/1667 ### Deprecated -- Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 and will be removed in HydePHP v2.0 +- Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 which will be removed in HydePHP v2.0 ### Removed - for now removed features. From 56a0b6f0c3c46dbec142ae62e46ef72a1573f1f1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 17 Apr 2024 14:45:37 +0200 Subject: [PATCH 4/6] HydePHP v1.6.0 - 2024-04-17 --- CHANGELOG.md | 53 +++++++++++++++++++ RELEASE_NOTES.md | 49 ++--------------- .../framework/src/Foundation/HydeKernel.php | 2 +- 3 files changed, 58 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e5eebe17d..955793af171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,59 @@ HydePHP consists of two primary components, Hyde/Hyde and Hyde/Framework. Develo +## [1.6.0](https://github.com/hydephp/develop/releases/tag/1.6.0) - 2024-04-17 +### Added +- Added a `@head` stack to the `head.blade.php` component in https://github.com/hydephp/develop/pull/1567 +- Added a `Hyde::route()` helper to the `Hyde` facade in https://github.com/hydephp/develop/pull/1591 +- Added new global helper functions (`asset()`, `route()`, `url()`) in https://github.com/hydephp/develop/pull/1592 +- Added a new `Feature` enum to improve the `Features` facade in https://github.com/hydephp/develop/pull/1650 +- Added a helper to `->skip()` build tasks in https://github.com/hydephp/develop/pull/1656 + +### Changed +- The `features` array in the `config/hyde.php` configuration file is now an array of `Feature` enums in https://github.com/hydephp/develop/pull/1650 +- Sitemap generation will now be skipped if a base URL is not set, as Google now will not index sitemaps without a base URL in https://github.com/hydephp/develop/pull/1660 +- Updated the debug command to print the binary path when running in a standalone Phar in https://github.com/hydephp/develop/pull/1667 + +### Deprecated +- Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 which will be removed in HydePHP v2.0 +### Fixed +- Fixed a bug where the sitemap and RSS feed generator commands did not work when the `_site/` directory was not present in https://github.com/hydephp/develop/pull/1654 +- Fixed extra newlines being written to console for failing build tasks in https://github.com/hydephp/develop/pull/1661 +- Markdown formatting will now be stripped when generating an automatic blog post description when none is set in https://github.com/hydephp/develop/pull/1662 (fixes https://github.com/hydephp/develop/issues/1634) +- Realtime Compiler: Fixed responsive dashboard table issue in https://github.com/hydephp/develop/pull/1595 +### Upgrade Path + +In order to prepare your project for HydePHP v2.0, you should update your `config/hyde.php` configuration file to use the new `Feature` enum for the `features` array. + +You can see the changes to make in your Hyde project by looking at the following pull request https://github.com/hydephp/hyde/pull/250/files + +Your new config array should look like this: + +```php + // Make sure to import the new Feature enum at the top of the file + use Hyde\Enums\Feature; + + // Then replace your enabled features with the new Feature enum cases + 'features' => [ + // Page Modules + Feature::HtmlPages, + Feature::MarkdownPosts, + Feature::BladePages, + Feature::MarkdownPages, + Feature::DocumentationPages, + + // Frontend Features + Feature::Darkmode, + Feature::DocumentationSearch, + + // Integrations + Feature::Torchlight, + ], +``` + +If you need more help, you can see detailed upgrade instructions with screenshots in the pull request https://github.com/hydephp/develop/pull/1650 + + ## [1.5.0](https://github.com/hydephp/develop/releases/tag/1.5.0) - 2024-02-13 ### Improved Patch Release Strategy diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 48efc46fd5f..e3d1b60364c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -10,60 +10,19 @@ This serves two purposes: 2. At release time, you can move the Unreleased section changes into a new release version section. ### Added -- Added a `@head` stack to the `head.blade.php` component in https://github.com/hydephp/develop/pull/1567 -- Added a `Hyde::route()` helper to the `Hyde` facade in https://github.com/hydephp/develop/pull/1591 -- Added new global helper functions (`asset()`, `route()`, `url()`) in https://github.com/hydephp/develop/pull/1592 -- Added a new `Feature` enum to improve the `Features` facade in https://github.com/hydephp/develop/pull/1650 -- Added a helper to `->skip()` build tasks in https://github.com/hydephp/develop/pull/1656 +- for new features. ### Changed -- The `features` array in the `config/hyde.php` configuration file is now an array of `Feature` enums in https://github.com/hydephp/develop/pull/1650 -- Sitemap generation will now be skipped if a base URL is not set, as Google now will not index sitemaps without a base URL in https://github.com/hydephp/develop/pull/1660 -- Updated the debug command to print the binary path when running in a standalone Phar in https://github.com/hydephp/develop/pull/1667 +- for changes in existing functionality. ### Deprecated -- Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 which will be removed in HydePHP v2.0 +- for soon-to-be removed features. ### Removed - for now removed features. ### Fixed -- Fixed a bug where the sitemap and RSS feed generator commands did not work when the `_site/` directory was not present in https://github.com/hydephp/develop/pull/1654 -- Fixed extra newlines being written to console for failing build tasks in https://github.com/hydephp/develop/pull/1661 -- Markdown formatting will now be stripped when generating an automatic blog post description when none is set in https://github.com/hydephp/develop/pull/1662 (fixes https://github.com/hydephp/develop/issues/1634) -- Realtime Compiler: Fixed responsive dashboard table issue in https://github.com/hydephp/develop/pull/1595 +- for any bug fixes. ### Security - in case of vulnerabilities. - -### Upgrade Path - -In order to prepare your project for HydePHP v2.0, you should update your `config/hyde.php` configuration file to use the new `Feature` enum for the `features` array. - -You can see the changes to make in your Hyde project by looking at the following pull request https://github.com/hydephp/hyde/pull/250/files - -Your new config array should look like this: - -```php - // Make sure to import the new Feature enum at the top of the file - use Hyde\Enums\Feature; - - // Then replace your enabled features with the new Feature enum cases - 'features' => [ - // Page Modules - Feature::HtmlPages, - Feature::MarkdownPosts, - Feature::BladePages, - Feature::MarkdownPages, - Feature::DocumentationPages, - - // Frontend Features - Feature::Darkmode, - Feature::DocumentationSearch, - - // Integrations - Feature::Torchlight, - ], -``` - -If you need more help, you can see detailed upgrade instructions with screenshots in the pull request https://github.com/hydephp/develop/pull/1650 diff --git a/packages/framework/src/Foundation/HydeKernel.php b/packages/framework/src/Foundation/HydeKernel.php index 1aa1ac0a43a..f95c12ca6f0 100644 --- a/packages/framework/src/Foundation/HydeKernel.php +++ b/packages/framework/src/Foundation/HydeKernel.php @@ -58,7 +58,7 @@ class HydeKernel implements SerializableContract use Serializable; use Macroable; - final public const VERSION = '1.5.0'; + final public const VERSION = '1.6.0'; protected static self $instance; From 9b7e3db04be7ff727bfe91b99cac9d8bb64abb8f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 17 Apr 2024 16:54:59 +0200 Subject: [PATCH 5/6] Update documented kernel method type --- docs/_data/partials/hyde-pages-api/hyde-kernel-base-methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_data/partials/hyde-pages-api/hyde-kernel-base-methods.md b/docs/_data/partials/hyde-pages-api/hyde-kernel-base-methods.md index 7751a0d35ce..ef2d6c09e2a 100644 --- a/docs/_data/partials/hyde-pages-api/hyde-kernel-base-methods.md +++ b/docs/_data/partials/hyde-pages-api/hyde-kernel-base-methods.md @@ -36,7 +36,7 @@ No description provided. ```php // torchlight! {"lineNumbers": false} -Hyde::hasFeature(string $feature): bool +Hyde::hasFeature(Hyde\Enums\Feature $feature): bool ``` #### `toArray()` From a172730c4f03b7677ac2659b3cb43a252d65dbcd Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 25 Apr 2024 15:33:35 +0200 Subject: [PATCH 6/6] Update Dependabot configuration to update GitHub Actions --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c59038a8629..1a518a62e26 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,11 @@ version: 2 updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "composer" # See documentation for possible values directory: "/" # Location of package manifests schedule: