From c4d787ad129db51661cd7d2733868b69d30219b2 Mon Sep 17 00:00:00 2001 From: Emma De Silva Date: Tue, 30 Sep 2025 11:08:33 +0200 Subject: [PATCH 1/2] Remove --run-prettier flag from build command The --run-prettier flag and its related code have been removed from the build command, documentation, and tests. This is a breaking change and is reflected in the release notes and user documentation. --- RELEASE_NOTES.md | 2 ++ docs/getting-started/console-commands.md | 13 ++++++------- .../src/Console/Commands/BuildSiteCommand.php | 9 --------- .../tests/Feature/StaticSiteServiceTest.php | 4 +--- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 522d4b6ec79..362c4f4fd0b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -74,6 +74,7 @@ This serves two purposes: - **Breaking:** Renamed the `hyde.enable_cache_busting` configuration option to `hyde.cache_busting` in [#1980](https://github.com/hydephp/develop/pull/1980) - **Breaking:** Renamed the `hyde.navigation.subdirectories` configuration option to `hyde.navigation.subdirectory_display` in [#1818](https://github.com/hydephp/develop/pull/1818) - **Breaking:** Replaced `--run-dev` and `--run-prod` build command flags with a single `--vite` flag that uses Vite to build assets in [#2013](https://github.com/hydephp/develop/pull/2013) +- **Breaking:** Removed `--run-prettier` build command flag in [#2312](https://github.com/hydephp/develop/pull/2312) - **Breaking:** The `Author::create()` method now returns an array instead of a `PostAuthor` instance in [#1798](https://github.com/hydephp/develop/pull/1798) For more information, see below. - **Breaking:** The `Author::get()` method now returns `null` if an author is not found, rather than creating a new instance in [#1798](https://github.com/hydephp/develop/pull/1798) For more information, see below. - **Breaking:** The `hyde.authors` config setting should now be keyed by the usernames in [#1782](https://github.com/hydephp/develop/pull/1782) For more information, see below. @@ -577,6 +578,7 @@ The new asset system is a complete rewrite of the HydeFront asset handling syste - Replaced Laravel Mix with Vite. ([#2010]) - You must now use `npm run build` to compile your assets, instead of `npm run prod`. - Removed `--run-dev` and `--run-prod` build command flags, replaced by `--vite`. ([#2013]) +- Removed `--run-prettier` build command flag. - Removed `DocumentationPage::getTableOfContents()` method. Table of contents are now generated using a Blade component. ([#2045]) - Removed `hyde.css` from HydeFront, requiring recompilation of assets if you were extending it. ([#2037]) - Changed how HydeFront is included in projects. Instead of separate `hyde.css` and `app.css`, all styles are now in `app.css`. ([#2024]) diff --git a/docs/getting-started/console-commands.md b/docs/getting-started/console-commands.md index 948c6781cd6..91b5acb3ae6 100644 --- a/docs/getting-started/console-commands.md +++ b/docs/getting-started/console-commands.md @@ -66,19 +66,18 @@ Here is a quick reference of all the available commands. You can also run `php h ```bash -php hyde build [--vite] [--run-prettier] [--pretty-urls] [--no-api] +php hyde build [--vite] [--pretty-urls] [--no-api] ``` Build the static site #### Options -| | | -|------------------|--------------------------------------------| -| `--vite` | Build frontend assets using Vite | -| `--run-prettier` | Format the output using NPM Prettier | -| `--pretty-urls` | Should links in output use pretty URLs? | -| `--no-api` | Disable API calls, for example, Torchlight | +| | | +|-----------------|--------------------------------------------| +| `--vite` | Build frontend assets using Vite | +| `--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 diff --git a/packages/framework/src/Console/Commands/BuildSiteCommand.php b/packages/framework/src/Console/Commands/BuildSiteCommand.php index e0434635aff..e809eff6ab8 100644 --- a/packages/framework/src/Console/Commands/BuildSiteCommand.php +++ b/packages/framework/src/Console/Commands/BuildSiteCommand.php @@ -27,7 +27,6 @@ class BuildSiteCommand extends Command /** @var string */ protected $signature = 'build {--vite : Build frontend assets using Vite} - {--run-prettier : Format the output using NPM Prettier} {--pretty-urls : Should links in output use pretty URLs?} {--no-api : Disable API calls, for example, Torchlight} {--run-dev : [Removed] Use --vite instead} @@ -98,14 +97,6 @@ protected function runPreBuildActions(): void public function runPostBuildActions(): void { $this->taskService->runPostBuildTasks(); - - if ($this->option('run-prettier')) { - $this->runNodeCommand( - 'npx prettier '.Hyde::pathToRelative(Hyde::sitePath()).'/**/*.html --write --bracket-same-line', - 'Prettifying code!', - 'prettify code' - ); - } } protected function printFinishMessage(float $timeStart): void diff --git a/packages/framework/tests/Feature/StaticSiteServiceTest.php b/packages/framework/tests/Feature/StaticSiteServiceTest.php index 8568b98930f..0010020cdd6 100644 --- a/packages/framework/tests/Feature/StaticSiteServiceTest.php +++ b/packages/framework/tests/Feature/StaticSiteServiceTest.php @@ -158,13 +158,11 @@ public function testNodeActionOutputs() { Process::fake(); - $this->artisan('build --run-prettier --vite') + $this->artisan('build --vite') ->expectsOutput('Building frontend assets for production! This may take a second.') - ->expectsOutput('Prettifying code! This may take a second.') ->assertExitCode(0); Process::assertRan(fn ($process) => $process->command === 'npm run build'); - Process::assertRan(fn ($process) => $process->command === 'npx prettier '.Hyde::pathToRelative(Hyde::sitePath()).'/**/*.html --write --bracket-same-line'); } public function testPrettyUrlsOptionOutput() From 240ab49270f033d8b39a289009db76e90c028b03 Mon Sep 17 00:00:00 2001 From: Emma De Silva Date: Tue, 30 Sep 2025 11:18:27 +0200 Subject: [PATCH 2/2] Remove Prettier dependency from project Prettier has been removed from both root and package dependencies, as well as from the build command flags. The release notes have been updated to reflect the removal of both the --run-prettier flag and the Prettier dependency. --- RELEASE_NOTES.md | 2 +- package-lock.json | 17 ----------------- package.json | 1 - packages/hyde/package-lock.json | 17 ----------------- packages/hyde/package.json | 1 - 5 files changed, 1 insertion(+), 37 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 362c4f4fd0b..a22850b3ecd 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -74,7 +74,7 @@ This serves two purposes: - **Breaking:** Renamed the `hyde.enable_cache_busting` configuration option to `hyde.cache_busting` in [#1980](https://github.com/hydephp/develop/pull/1980) - **Breaking:** Renamed the `hyde.navigation.subdirectories` configuration option to `hyde.navigation.subdirectory_display` in [#1818](https://github.com/hydephp/develop/pull/1818) - **Breaking:** Replaced `--run-dev` and `--run-prod` build command flags with a single `--vite` flag that uses Vite to build assets in [#2013](https://github.com/hydephp/develop/pull/2013) -- **Breaking:** Removed `--run-prettier` build command flag in [#2312](https://github.com/hydephp/develop/pull/2312) +- **Breaking:** Removed `--run-prettier` build command flag and Prettier dependency in [#2312](https://github.com/hydephp/develop/pull/2312) - **Breaking:** The `Author::create()` method now returns an array instead of a `PostAuthor` instance in [#1798](https://github.com/hydephp/develop/pull/1798) For more information, see below. - **Breaking:** The `Author::get()` method now returns `null` if an author is not found, rather than creating a new instance in [#1798](https://github.com/hydephp/develop/pull/1798) For more information, see below. - **Breaking:** The `hyde.authors` config setting should now be keyed by the usernames in [#1782](https://github.com/hydephp/develop/pull/1782) For more information, see below. diff --git a/package-lock.json b/package-lock.json index 01c754c40c5..29539cc1f29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,6 @@ "hyde-vite-plugin": "^1.0.0-RC.5", "hydefront": "^4.0.0-RC.1", "postcss": "^8.5.6", - "prettier": "3.6.2", "tailwindcss": "^4.1.13", "vite": "^7.1.7" } @@ -674,22 +673,6 @@ "dev": true, "license": "MIT" }, - "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/rollup": { "version": "4.52.3", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.3.tgz", diff --git a/package.json b/package.json index 020eed89b51..03d3f49c03e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "hyde-vite-plugin": "^1.0.0-RC.5", "hydefront": "^4.0.0-RC.1", "postcss": "^8.5.6", - "prettier": "3.6.2", "tailwindcss": "^4.1.13", "vite": "^7.1.7" } diff --git a/packages/hyde/package-lock.json b/packages/hyde/package-lock.json index 0d61847717e..f664c0ad6a2 100644 --- a/packages/hyde/package-lock.json +++ b/packages/hyde/package-lock.json @@ -11,7 +11,6 @@ "hyde-vite-plugin": "^1.0.0-RC.5", "hydefront": "^4.0.0-RC.1", "postcss": "^8.5.6", - "prettier": "3.6.2", "tailwindcss": "^4.1.13", "vite": "^7.1.7" } @@ -1793,22 +1792,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/rollup": { "version": "4.44.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.1.tgz", diff --git a/packages/hyde/package.json b/packages/hyde/package.json index 0e279734c9a..10f713c0556 100644 --- a/packages/hyde/package.json +++ b/packages/hyde/package.json @@ -12,7 +12,6 @@ "hyde-vite-plugin": "^1.0.0-RC.5", "hydefront": "^4.0.0-RC.1", "postcss": "^8.5.6", - "prettier": "3.6.2", "tailwindcss": "^4.1.13", "vite": "^7.1.7" }