From 6cab483260fc9e0b2e434c943e189ca4126eb2bb Mon Sep 17 00:00:00 2001 From: Emma De Silva Date: Fri, 3 Jul 2026 19:25:15 +0000 Subject: [PATCH 1/3] Deprecate the rebuild command It has no remaining internal consumers now that the realtime compiler renders pages in-memory, and single-page builds can silently leave aggregate outputs (sitemap, RSS, search index, navigation) stale. The command still works as before, but now prints a deprecation warning pointing to StaticPageBuilder::handle() for programmatic single-page builds. It will be removed in v3.0. Co-Authored-By: Claude Sonnet 5 https://github.com/hydephp/develop/commit/2212d67672a50d3933e50323c5ea291b614ec790 --- src/Console/Commands/RebuildPageCommand.php | 17 ++++++++++++++++- .../Feature/Commands/RebuildPageCommandTest.php | 12 ++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Console/Commands/RebuildPageCommand.php b/src/Console/Commands/RebuildPageCommand.php index dba3e103..25dfcfed 100644 --- a/src/Console/Commands/RebuildPageCommand.php +++ b/src/Console/Commands/RebuildPageCommand.php @@ -25,6 +25,8 @@ /** * Build a single static site file. + * + * @deprecated This command is deprecated and will be removed in HydePHP v3.0. Use \Hyde\Framework\Actions\StaticPageBuilder::handle() instead. */ class RebuildPageCommand extends Command { @@ -32,10 +34,12 @@ class RebuildPageCommand extends Command protected $signature = 'rebuild {path : The relative file path (example: _posts/hello-world.md)}'; /** @var string */ - protected $description = 'Run the static site builder for a single file'; + protected $description = 'Run the static site builder for a single file [Deprecated, will be removed in v3.0]'; public function handle(): int { + $this->printDeprecationWarning(); + if ($this->argument('path') === Hyde::getMediaDirectory()) { return (new TransferMediaAssets())->run($this->output); @@ -47,6 +51,17 @@ public function handle(): int return $this->makeBuildTask($this->output, $this->getNormalizedPathString())->run(); } + /** + * @deprecated The `rebuild` command is deprecated and will be removed in HydePHP v3.0. + * @since v2.x + */ + protected function printDeprecationWarning(): void + { + $this->warn('The `rebuild` command is deprecated and will be removed in HydePHP v3.0.'); + $this->line('If you need to build a single page programmatically, use Hyde\Framework\Actions\StaticPageBuilder::handle() instead.'); + $this->newLine(); + } + protected function getNormalizedPathString(): string { return str_replace('\\', '/', unslash($this->argument('path'))); diff --git a/tests/Feature/Commands/RebuildPageCommandTest.php b/tests/Feature/Commands/RebuildPageCommandTest.php index fbe8a839..df3e6aca 100644 --- a/tests/Feature/Commands/RebuildPageCommandTest.php +++ b/tests/Feature/Commands/RebuildPageCommandTest.php @@ -23,6 +23,18 @@ public function testHandleIsSuccessfulWithValidPath() $this->resetSite(); } + public function testCommandOutputsDeprecationWarning() + { + $this->file('_pages/test-page.md', 'foo'); + + $this->artisan('rebuild _pages/test-page.md') + ->expectsOutput('The `rebuild` command is deprecated and will be removed in HydePHP v3.0.') + ->expectsOutput('If you need to build a single page programmatically, use Hyde\Framework\Actions\StaticPageBuilder::handle() instead.') + ->assertExitCode(0); + + $this->resetSite(); + } + public function testMediaFilesCanBeTransferred() { $this->directory(Hyde::path('_site/media')); From f9118d4941df3bf986520cfee2bd23175d160b03 Mon Sep 17 00:00:00 2001 From: Emma De Silva Date: Fri, 3 Jul 2026 19:29:29 +0000 Subject: [PATCH 2/3] Revert "Deprecate the rebuild command" (direct push) This reverts commit 2212d67672a50d3933e50323c5ea291b614ec790 as my remote tracking branch pointed to master despite on being on a local branch. Will repush through a PR. https://github.com/hydephp/develop/commit/2506810504c7d94b57077df9f02317e27deb6c1a --- src/Console/Commands/RebuildPageCommand.php | 17 +---------------- .../Feature/Commands/RebuildPageCommandTest.php | 12 ------------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/Console/Commands/RebuildPageCommand.php b/src/Console/Commands/RebuildPageCommand.php index 25dfcfed..dba3e103 100644 --- a/src/Console/Commands/RebuildPageCommand.php +++ b/src/Console/Commands/RebuildPageCommand.php @@ -25,8 +25,6 @@ /** * Build a single static site file. - * - * @deprecated This command is deprecated and will be removed in HydePHP v3.0. Use \Hyde\Framework\Actions\StaticPageBuilder::handle() instead. */ class RebuildPageCommand extends Command { @@ -34,12 +32,10 @@ class RebuildPageCommand extends Command protected $signature = 'rebuild {path : The relative file path (example: _posts/hello-world.md)}'; /** @var string */ - protected $description = 'Run the static site builder for a single file [Deprecated, will be removed in v3.0]'; + protected $description = 'Run the static site builder for a single file'; public function handle(): int { - $this->printDeprecationWarning(); - if ($this->argument('path') === Hyde::getMediaDirectory()) { return (new TransferMediaAssets())->run($this->output); @@ -51,17 +47,6 @@ public function handle(): int return $this->makeBuildTask($this->output, $this->getNormalizedPathString())->run(); } - /** - * @deprecated The `rebuild` command is deprecated and will be removed in HydePHP v3.0. - * @since v2.x - */ - protected function printDeprecationWarning(): void - { - $this->warn('The `rebuild` command is deprecated and will be removed in HydePHP v3.0.'); - $this->line('If you need to build a single page programmatically, use Hyde\Framework\Actions\StaticPageBuilder::handle() instead.'); - $this->newLine(); - } - protected function getNormalizedPathString(): string { return str_replace('\\', '/', unslash($this->argument('path'))); diff --git a/tests/Feature/Commands/RebuildPageCommandTest.php b/tests/Feature/Commands/RebuildPageCommandTest.php index df3e6aca..fbe8a839 100644 --- a/tests/Feature/Commands/RebuildPageCommandTest.php +++ b/tests/Feature/Commands/RebuildPageCommandTest.php @@ -23,18 +23,6 @@ public function testHandleIsSuccessfulWithValidPath() $this->resetSite(); } - public function testCommandOutputsDeprecationWarning() - { - $this->file('_pages/test-page.md', 'foo'); - - $this->artisan('rebuild _pages/test-page.md') - ->expectsOutput('The `rebuild` command is deprecated and will be removed in HydePHP v3.0.') - ->expectsOutput('If you need to build a single page programmatically, use Hyde\Framework\Actions\StaticPageBuilder::handle() instead.') - ->assertExitCode(0); - - $this->resetSite(); - } - public function testMediaFilesCanBeTransferred() { $this->directory(Hyde::path('_site/media')); From 12e5c9c5fb16c810c75d003b16df22efbc0e76fe Mon Sep 17 00:00:00 2001 From: Emma De Silva Date: Fri, 3 Jul 2026 19:45:49 +0000 Subject: [PATCH 3/3] Merge pull request #2491 from hydephp/v2/deprecate-rebuild-command [2.x] Deprecate the rebuild command https://github.com/hydephp/develop/commit/e4c6d403f05ab66d548dd41e3c4afc99a37a67e6 --- src/Console/Commands/RebuildPageCommand.php | 16 +++++++++++++++- .../Feature/Commands/RebuildPageCommandTest.php | 12 ++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Console/Commands/RebuildPageCommand.php b/src/Console/Commands/RebuildPageCommand.php index dba3e103..f6cdb201 100644 --- a/src/Console/Commands/RebuildPageCommand.php +++ b/src/Console/Commands/RebuildPageCommand.php @@ -25,6 +25,8 @@ /** * Build a single static site file. + * + * @deprecated This command is deprecated and will be removed in HydePHP v3.0. Use \Hyde\Framework\Actions\StaticPageBuilder::handle() instead. */ class RebuildPageCommand extends Command { @@ -32,10 +34,12 @@ class RebuildPageCommand extends Command protected $signature = 'rebuild {path : The relative file path (example: _posts/hello-world.md)}'; /** @var string */ - protected $description = 'Run the static site builder for a single file'; + protected $description = 'Run the static site builder for a single file [Deprecated, will be removed in v3.0]'; public function handle(): int { + $this->printDeprecationWarning(); + if ($this->argument('path') === Hyde::getMediaDirectory()) { return (new TransferMediaAssets())->run($this->output); @@ -47,6 +51,16 @@ public function handle(): int return $this->makeBuildTask($this->output, $this->getNormalizedPathString())->run(); } + /** + * @deprecated The `rebuild` command is deprecated and will be removed in HydePHP v3.0. + */ + protected function printDeprecationWarning(): void + { + $this->warn('The `rebuild` command is deprecated and will be removed in HydePHP v3.0.'); + $this->line('If you need to build a single page programmatically, use Hyde\Framework\Actions\StaticPageBuilder::handle() instead.'); + $this->newLine(); + } + protected function getNormalizedPathString(): string { return str_replace('\\', '/', unslash($this->argument('path'))); diff --git a/tests/Feature/Commands/RebuildPageCommandTest.php b/tests/Feature/Commands/RebuildPageCommandTest.php index fbe8a839..df3e6aca 100644 --- a/tests/Feature/Commands/RebuildPageCommandTest.php +++ b/tests/Feature/Commands/RebuildPageCommandTest.php @@ -23,6 +23,18 @@ public function testHandleIsSuccessfulWithValidPath() $this->resetSite(); } + public function testCommandOutputsDeprecationWarning() + { + $this->file('_pages/test-page.md', 'foo'); + + $this->artisan('rebuild _pages/test-page.md') + ->expectsOutput('The `rebuild` command is deprecated and will be removed in HydePHP v3.0.') + ->expectsOutput('If you need to build a single page programmatically, use Hyde\Framework\Actions\StaticPageBuilder::handle() instead.') + ->assertExitCode(0); + + $this->resetSite(); + } + public function testMediaFilesCanBeTransferred() { $this->directory(Hyde::path('_site/media'));