Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion config/docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
|
| Example: https://github.com/hydephp/docs/blob/master
| Do not specify the filename or extension, Hyde will do that for you.
| Setting the setting to null will disable the feature.
| Setting this to null will disable the feature.
|
*/

Expand Down
6 changes: 3 additions & 3 deletions config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
| Site Output Directory
|--------------------------------------------------------------------------
|
| This setting specifies the output path for your site, useful to for
| This setting specifies the output path for your site, useful to, for
| example, store the site in the docs/ directory for GitHub Pages.
| The path is relative to the root of your project.
|
Expand Down Expand Up @@ -308,7 +308,7 @@
|
| Here you can customize the footer Markdown text for your site.
|
| If you don't want to write Markdown here, you use a Markdown include.
| If you don't want to write Markdown here, you can use a Markdown include.
| You can also customize the Blade view if you want a more complex footer.
| You can disable it completely by changing the setting to `false`.
|
Expand Down Expand Up @@ -428,7 +428,7 @@
|
| Here you can configure settings for the built-in realtime compiler server.
| The server also includes a magic dashboard feature that supercharges
| your local development! This feature can alo be customised here.
| your local development! This feature can also be customised here.
|
*/

Expand Down
2 changes: 1 addition & 1 deletion config/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
|
| This feature allows you to use basic Laravel Blade in Markdown files.
|
| It's disabled by default since can be a security risk as it allows
| It's disabled by default since it can be a security risk as it allows
| arbitrary PHP to run. But if your Markdown is trusted, try it out!
|
| To see the syntax and usage, see the documentation:
Expand Down
21 changes: 6 additions & 15 deletions src/Console/Commands/BuildSiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ class BuildSiteCommand extends Command
{
/** @var string */
protected $signature = 'build
{--run-vite : Build frontend assets using Vite}
{--run-prettier : Format the output using NPM Prettier}
{--vite : Build frontend assets using Vite}
{--pretty-urls : Should links in output use pretty URLs?}
{--no-api : Disable API calls, for example, Torchlight}
{--run-dev : [Removed] Use --run-vite instead}
{--run-prod : [Removed] Use --run-vite instead}';
{--run-dev : [Removed] Use --vite instead}
{--run-prod : [Removed] Use --vite instead}';

/** @var string */
protected $description = 'Build the static site';
Expand Down Expand Up @@ -88,7 +87,7 @@ protected function runPreBuildActions(): void
Config::set(['hyde.pretty_urls' => true]);
}

if ($this->option('run-vite')) {
if ($this->option('vite')) {
$this->runNodeCommand('npm run build', 'Building frontend assets for production!');
}

Expand All @@ -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
Expand Down Expand Up @@ -161,7 +152,7 @@ protected function getExitCode(): int
/**
* This method is called when the removed --run-dev or --run-prod options are used.
*
* @deprecated Use --run-vite instead
* @deprecated Use --vite instead
* @since v2.0 - This will be removed after 2-3 minor releases depending on the timeframe between them. (~v2.3)
*
* @codeCoverageIgnore
Expand All @@ -170,7 +161,7 @@ protected function checkForDeprecatedRunMixCommandUsage(): void
{
if ($this->option('run-dev') || $this->option('run-prod')) {
$this->error('The --run-dev and --run-prod options have been removed in HydePHP v2.0.');
$this->info('Please use --run-vite instead to build assets for production with Vite.');
$this->info('Please use --vite instead to build assets for production with Vite.');
$this->line('See https://github.com/hydephp/develop/pull/2013 for more information.');

exit(Command::INVALID);
Expand Down
232 changes: 0 additions & 232 deletions src/Console/Commands/ServeCommand.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Console/ConsoleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function register(): void

Commands\RouteListCommand::class,
Commands\ValidateCommand::class,
Commands\ServeCommand::class,
Commands\DebugCommand::class,

Commands\ChangeSourceDirectoryCommand::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Helpers/InteractivePublishCommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getBaseDirectory(): string
public function publishFiles(): void
{
foreach ($this->publishableFilesMap as $source => $target) {
Filesystem::ensureDirectoryExists(dirname($target));
Filesystem::ensureParentDirectoryExists($target);
Filesystem::copy($source, $target);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Facades/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function getFloat(string $key, ?float $default = null): float
return (float) self::validated(static::get($key, $default), 'float', $key);
}

/** @experimental Could possibly be merged by allowing null returns if default is null? Preferably with generics so the type is matched by IDE support. */
/** @experimental */
public static function getNullableString(string $key, ?string $default = null): ?string
{
/** @var array|string|int|bool|float|null $value */
Expand Down
13 changes: 13 additions & 0 deletions src/Facades/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ public static function unlinkIfExists(string $path): bool
return self::kernel()->filesystem()->unlinkIfExists($path);
}

/**
* Ensure that the parent directory of the given file path exists.
*
* @param string $path
* @param int $mode
* @param bool $recursive
* @return void
*/
public static function ensureParentDirectoryExists(string $path, int $mode = 0755, bool $recursive = true): void
{
self::ensureDirectoryExists(self::dirname($path), $mode, $recursive);
}

/**
* Get the contents of a file.
*
Expand Down
6 changes: 5 additions & 1 deletion src/Foundation/Concerns/ImplementsStringHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ public static function makeSlug(string $value): string
// Transliterate international characters to ASCII
$value = Str::transliterate($value);

// Todo: In v2.0 we will use the following dictionary: ['@' => 'at', '&' => 'and']
// Normalize a couple of common symbols before slugging (since v2)
$value = strtr($value, [
'@' => ' at ',
'&' => ' and ',
]);

return Str::slug($value);
}
Expand Down
Loading