Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ This serves two purposes:
- for changes in existing functionality.

### Deprecated
- Deprecated 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. It will be removed in v3.0; use `Hyde\Framework\Actions\StaticPageBuilder::handle()` instead if you need to build a single page programmatically.
- for changes that will be removed in upcoming releases.

### Removed
- for now removed features.
- Removed the `rebuild` command. It had 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. Use `Hyde\Framework\Actions\StaticPageBuilder::handle()` instead if you need to build a single page programmatically.

### Fixed
- Improved documentation page detection in MarkdownService so it works for child classes in https://github.com/hydephp/develop/pull/2332
Expand Down
4 changes: 4 additions & 0 deletions HYDEPHP_V3_PLANNING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Having this document in code lets us know the devlopment state at any given poin

### Breaking Changes

- Removed the `rebuild` command (`RebuildPageCommand`). It was originally added to build a single file to disk before the realtime compiler existed, and later used internally by the RC to build-and-serve a path, but the RC now renders everything in-memory, leaving `rebuild` with no remaining consumer. It also had no safe user-facing use case: a single-page build only produces a correct `_site` when the page is self-contained, while a page change routinely invalidates aggregate outputs (sitemap, RSS, search index, post listings, navigation), so single-path building could silently leave a stale output directory that looked complete. The underlying single-page build capability remains available internally via the `StaticPageBuilder` action. ([#2490](https://github.com/hydephp/develop/pull/2490))
Comment thread
emmadesilva marked this conversation as resolved.

### Upgrade guide

Please fill in UPGRADE.md as you make changes.

- The `rebuild` command has been removed. If you need to build a single page programmatically, use `Hyde\Framework\Actions\StaticPageBuilder::handle()` instead.
24 changes: 23 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,33 @@ git commit -m "Pre-upgrade backup before HydePHP v3.0"

//

## Step 2: Replace the Removed `rebuild` Command

The `rebuild` command has been removed in v3.0. It had no remaining internal consumers now that the realtime compiler renders pages entirely in-memory, and building a single page could silently leave aggregate outputs (sitemap, RSS, search index, navigation) stale while looking like a complete build.

**Before:**
```bash
php hyde rebuild _posts/hello-world.md
```

**After:**

If you need to build a single page programmatically, use `StaticPageBuilder::handle()` directly:

```php
use Hyde\Foundation\Facades\Pages;
use Hyde\Framework\Actions\StaticPageBuilder;

StaticPageBuilder::handle(Pages::getPage('_posts/hello-world.md'));
```

Note that this only produces a correct `_site` when the page is self-contained. For anything that touches aggregate outputs, run `php hyde build` to rebuild the whole site instead.

## Migration Checklist

Use this checklist to track your upgrade progress:

- [ ] Example item
- [ ] Replaced any `php hyde rebuild <path>` usage with `StaticPageBuilder::handle()` or a full `php hyde build`

## Troubleshooting

Expand Down
11 changes: 2 additions & 9 deletions docs/creating-content/compile-and-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ Now that you have some amazing content, you'll want to compile your site into st
php hyde build
```

**You can also compile a single file, though this is deprecated and will be removed in v3.0 (use `Hyde\Framework\Actions\StaticPageBuilder::handle()` instead if you need this programmatically):**

```bash
php hyde rebuild <filepath>
```

**And, you can even start a development server to compile your site on the fly:**

```bash
Expand All @@ -34,9 +28,8 @@ php hyde serve

#### Learn more about these commands in the [console commands](console-commands) documentation:

- [Build command](console-commands#build-the-static-site)
- [Rebuild command (Deprecated)](console-commands#rebuild)
- [Serve command](console-commands#start-the-realtime-compiler)
- [Build command](console-commands#build)
- [Serve command](console-commands#serve)

---

Expand Down
19 changes: 0 additions & 19 deletions docs/getting-started/console-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Here is a quick reference of all the available commands. You can also run `php h
|-----------------------------------------|---------------------------------------------------------------------------------------------|
| [`build`](#build) | Build the static site |
| [`serve`](#serve) | Start the realtime compiler server |
| [`rebuild`](#rebuild) | Run the static site builder for a single file (Deprecated, will be removed in v3.0) |
| [`build:rss`](#build-rss) | Generate the RSS feed |
| [`build:search`](#build-search) | Generate the `docs/search.json` file |
| [`build:sitemap`](#build-sitemap) | Generate the `sitemap.xml` file |
Expand Down Expand Up @@ -79,24 +78,6 @@ Build the static site
| `--pretty-urls` | Should links in output use pretty URLs? |
| `--no-api` | Disable API calls, for example, Torchlight |

## Run the static site builder for a single file

<a name="rebuild" style="display: inline-block; position: absolute; margin-top: -5rem;"></a>

>warning **Deprecated:** The `rebuild` command is deprecated and will be removed in HydePHP v3.0. It has no remaining internal consumers now that the realtime compiler renders pages in-memory, and building a single page can silently leave aggregate outputs (sitemap, RSS, search index, navigation) stale. If you need to build a single page programmatically, use `Hyde\Framework\Actions\StaticPageBuilder::handle()` instead.

```bash
php hyde rebuild <path>
```

Run the static site builder for a single file

#### Arguments

| | |
|--------|--------------------------------------------------------------------------------|
| `path` | The relative file path (example: \_posts/hello-world.md) \n - Is required: yes |

## Start the Realtime Compiler Server

<a name="serve" style="display: inline-block; position: absolute; margin-top: -5rem;"></a>
Expand Down
119 changes: 0 additions & 119 deletions packages/framework/src/Console/Commands/RebuildPageCommand.php

This file was deleted.

1 change: 0 additions & 1 deletion packages/framework/src/Console/ConsoleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function register(): void
Commands\BuildSearchCommand::class,
Commands\BuildSiteCommand::class,
Commands\BuildSitemapCommand::class,
Commands\RebuildPageCommand::class,

Commands\MakePageCommand::class,
Commands\MakePostCommand::class,
Expand Down

This file was deleted.

14 changes: 8 additions & 6 deletions packages/framework/tests/Feature/PostsAuthorIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

use Hyde\Facades\Author;
use Hyde\Pages\MarkdownPost;
use Hyde\Foundation\Facades\Pages;
use Hyde\Framework\Actions\CreatesNewMarkdownPostFile;
use Hyde\Framework\Actions\StaticPageBuilder;
use Hyde\Hyde;
use Hyde\Testing\TestCase;
use Illuminate\Support\Facades\Config;
Expand Down Expand Up @@ -34,7 +36,7 @@ public function testCreatePostWithUndefinedAuthor()
{
$this->createPostFile('post-with-undefined-author', 'test_undefined_author');

$this->artisan('rebuild _posts/post-with-undefined-author.md')->assertExitCode(0);
StaticPageBuilder::handle(Pages::getPage('_posts/post-with-undefined-author.md'));
$this->assertFileExists(Hyde::path('_site/posts/post-with-undefined-author.html'));

// Check that the author is rendered as is in the DOM
Expand All @@ -55,7 +57,7 @@ public function testCreatePostWithDefinedAuthorWithName()
'named_author' => Author::create('Test Author', null),
]);

$this->artisan('rebuild _posts/post-with-defined-author-with-name.md')->assertExitCode(0);
StaticPageBuilder::handle(Pages::getPage('_posts/post-with-defined-author-with-name.md'));
$this->assertFileExists(Hyde::path('_site/posts/post-with-defined-author-with-name.html'));

// Check that the author is contains the set name in the DOM
Expand All @@ -76,7 +78,7 @@ public function testCreatePostWithDefinedAuthorWithWebsite()
'test_author_with_website' => Author::create('Test Author', 'https://example.org'),
]);

$this->artisan('rebuild _posts/post-with-defined-author-with-name.md')->assertExitCode(0);
StaticPageBuilder::handle(Pages::getPage('_posts/post-with-defined-author-with-name.md'));
$this->assertFileExists(Hyde::path('_site/posts/post-with-defined-author-with-name.html'));

// Check that the author is contains the set name in the DOM
Expand Down Expand Up @@ -111,7 +113,7 @@ public function testAllPostAuthorFieldsCanBeSetInFrontMatter()
MD
);

$this->artisan('rebuild _posts/post-with-all-author-fields.md')->assertExitCode(0);
StaticPageBuilder::handle(Pages::getPage('_posts/post-with-all-author-fields.md'));
$this->cleanUpWhenDone('_site/posts/post-with-all-author-fields.html');
$this->assertFileExists(Hyde::path('_site/posts/post-with-all-author-fields.html'));

Expand Down Expand Up @@ -167,8 +169,8 @@ public function testConfiguredPostAuthorFieldsCanBeOverriddenInFrontMatter()
MD
);

$this->artisan('rebuild _posts/literal.md')->assertExitCode(0);
$this->artisan('rebuild _posts/changed.md')->assertExitCode(0);
StaticPageBuilder::handle(Pages::getPage('_posts/literal.md'));
StaticPageBuilder::handle(Pages::getPage('_posts/changed.md'));
$this->assertFileExists(Hyde::path('_site/posts/literal.html'));
$this->assertFileExists(Hyde::path('_site/posts/changed.html'));
$this->cleanUpWhenDone('_site/posts/literal.html');
Expand Down
Loading
Loading