Skip to content

Commit

Permalink
Merge branch 'master' into 2.x-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 14, 2024
2 parents e17212b + 8343a6c commit acb375b
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 47 deletions.
28 changes: 14 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@
// Should the dashboard show tips?
'tips' => true,
],

],

/*
Expand Down
30 changes: 30 additions & 0 deletions docs/extensions/realtime-compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ This will start a local development server at `http://localhost:8080`

>warning Please note that the server is designed for local development, and should not be used on a public network.
### Options

- `--host=`: <comment>[default: "localhost"]</comment>
- `--port=`: <comment>[default: 8080]</comment>
- `--save-preview=`: Should the served page be saved to disk? (Overrides config setting)
- `--dashboard=`: Enable the realtime compiler dashboard. (Overrides config setting)
- `--pretty-urls=`: Enable pretty URLs. (Overrides config setting)
- `--play-cdn=`: Enable the Tailwind Play CDN. (Overrides config setting)
- `--open=false`: Open the site preview in the browser.

### Configuration

The server can be configured in the `config/hyde.php` file to change the port, host, and to customize its features.
Expand All @@ -29,9 +39,29 @@ The server can be configured in the `config/hyde.php` file to change the port, h
// filepath config/hyde.php

'server' => [
// The default port the preview is served on
'port' => env('SERVER_PORT', 8080),

// The default host the preview is served on
'host' => env('SERVER_HOST', 'localhost'),

// Should preview pages be saved to the output directory?
'save_preview' => env('SERVER_SAVE_PREVIEW', false),

// Should the live edit feature be enabled?
'live_edit' => env('SERVER_LIVE_EDIT', true),

// Configure the realtime compiler dashboard
'dashboard' => [
// Should the realtime compiler dashboard be enabled?
'enabled' => env('SERVER_DASHBOARD', true),

// Can the dashboard make edits to the project file system?
'interactive' => true,

// Should the dashboard show tips?
'tips' => true,
],
],
```

Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"autoprefixer": "^10.4.20",
"hydefront": "^3.4.0",
"laravel-mix": "^6.0.49",
"postcss": "^8.4.47",
"postcss": "^8.4.49",
"prettier": "3.3.3",
"tailwindcss": "^3.4.14"
}
Expand Down
1 change: 0 additions & 1 deletion packages/framework/config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@
// Should the dashboard show tips?
'tips' => true,
],

],

/*
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/src/Console/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function configureOutput(): void
protected function printStartMessage(): void
{
$this->useBasicOutput()
? $this->output->writeln('<info>Starting the HydeRC server...</info> Press Ctrl+C to stop')
? $this->output->writeln('<info>Starting the HydeRC server...</info> Use Ctrl+C to stop')
: $this->console->printStartMessage($this->getHostSelection(), $this->getPortSelection(), $this->getEnvironmentVariables());
}

Expand Down
24 changes: 12 additions & 12 deletions packages/framework/tests/Feature/Commands/ServeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function setUp(): void
public function testHydeServeCommand()
{
$this->artisan('serve --no-ansi')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S localhost:8080 {$this->binaryPath()}");
Expand All @@ -36,7 +36,7 @@ public function testHydeServeCommand()
public function testHydeServeCommandWithPortOption()
{
$this->artisan('serve --no-ansi --port=8081')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S localhost:8081 {$this->binaryPath()}");
Expand All @@ -45,7 +45,7 @@ public function testHydeServeCommandWithPortOption()
public function testHydeServeCommandWithHostOption()
{
$this->artisan('serve --no-ansi --host=foo')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S foo:8080 {$this->binaryPath()}");
Expand All @@ -54,7 +54,7 @@ public function testHydeServeCommandWithHostOption()
public function testHydeServeCommandWithPortAndHostOption()
{
$this->artisan('serve --no-ansi --port=8081 --host=foo')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S foo:8081 {$this->binaryPath()}");
Expand All @@ -65,7 +65,7 @@ public function testHydeServeCommandWithPortDefinedInConfig()
config(['hyde.server.port' => 8081]);

$this->artisan('serve --no-ansi')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S localhost:8081 {$this->binaryPath()}");
Expand All @@ -76,7 +76,7 @@ public function testHydeServeCommandWithPortDefinedInConfigAndPortOption()
config(['hyde.server.port' => 8081]);

$this->artisan('serve --no-ansi --port=8082')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S localhost:8082 {$this->binaryPath()}");
Expand All @@ -87,7 +87,7 @@ public function testHydeServeCommandWithPortMissingInConfigAndPortOption()
config(['hyde.server.port' => null]);

$this->artisan('serve --no-ansi --port=8081')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S localhost:8081 {$this->binaryPath()}");
Expand All @@ -98,7 +98,7 @@ public function testHydeServeCommandWithHostDefinedInConfig()
config(['hyde.server.host' => 'foo']);

$this->artisan('serve --no-ansi')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S foo:8080 {$this->binaryPath()}");
Expand All @@ -109,7 +109,7 @@ public function testHydeServeCommandWithHostDefinedInConfigAndHostOption()
config(['hyde.server.host' => 'foo']);

$this->artisan('serve --no-ansi --host=bar')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S bar:8080 {$this->binaryPath()}");
Expand All @@ -120,7 +120,7 @@ public function testHydeServeCommandWithHostMissingInConfigAndHostOption()
config(['hyde.server.host' => null]);

$this->artisan('serve --no-ansi --host=foo')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);

Process::assertRan("php -S foo:8080 {$this->binaryPath()}");
Expand All @@ -132,7 +132,7 @@ public function testHydeServeCommandWithInvalidConfigValue()
config(['hyde.server.port' => 'foo']);

$this->artisan('serve --no-ansi')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->assertExitCode(0);
}

Expand All @@ -158,7 +158,7 @@ public function testHydeServeCommandPassesThroughProcessOutput()
->andReturnSelf();

$this->artisan('serve --no-ansi')
->expectsOutput('Starting the HydeRC server... Press Ctrl+C to stop')
->expectsOutput('Starting the HydeRC server... Use Ctrl+C to stop')
->expectsOutput('foo')
->assertExitCode(0);
}
Expand Down
16 changes: 8 additions & 8 deletions packages/hydefront/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hydefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/hydephp/hydefront#readme",
"devDependencies": {
"sass": "1.80.6"
"sass": "1.80.7"
},
"main": "dist/hyde.css"
}
2 changes: 1 addition & 1 deletion packages/realtime-compiler/src/ConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function formatLineForOutput(string $line): ?string

protected function formatServerStartedLine(string $line): string
{
return $this->formatLine(sprintf('PHP %s Development Server started. <span class="text-yellow-500">Press Ctrl+C to stop.</span>', PHP_VERSION), $this->parseDate($line), 'green-500');
return $this->formatLine(sprintf('PHP %s Development Server started. <span class="text-yellow-500">Use Ctrl+C to stop.</span>', PHP_VERSION), $this->parseDate($line), 'green-500');
}

protected function formatRequestLine(string $line): string
Expand Down

0 comments on commit acb375b

Please sign in to comment.