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 Apr 25, 2024
2 parents 4542ebf + f275fb8 commit 29bd2d2
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "composer" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
Expand Down
8 changes: 8 additions & 0 deletions .idea/develop.iml

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

53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,59 @@ HydePHP consists of two primary components, Hyde/Hyde and Hyde/Framework. Develo

<!-- CHANGELOG_START -->

## [1.6.0](https://github.com/hydephp/develop/releases/tag/1.6.0) - 2024-04-17
### Added
- Added a `@head` stack to the `head.blade.php` component in https://github.com/hydephp/develop/pull/1567
- Added a `Hyde::route()` helper to the `Hyde` facade in https://github.com/hydephp/develop/pull/1591
- Added new global helper functions (`asset()`, `route()`, `url()`) in https://github.com/hydephp/develop/pull/1592
- Added a new `Feature` enum to improve the `Features` facade in https://github.com/hydephp/develop/pull/1650
- Added a helper to `->skip()` build tasks in https://github.com/hydephp/develop/pull/1656

### Changed
- The `features` array in the `config/hyde.php` configuration file is now an array of `Feature` enums in https://github.com/hydephp/develop/pull/1650
- Sitemap generation will now be skipped if a base URL is not set, as Google now will not index sitemaps without a base URL in https://github.com/hydephp/develop/pull/1660
- Updated the debug command to print the binary path when running in a standalone Phar in https://github.com/hydephp/develop/pull/1667

### Deprecated
- Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 which will be removed in HydePHP v2.0
### Fixed
- Fixed a bug where the sitemap and RSS feed generator commands did not work when the `_site/` directory was not present in https://github.com/hydephp/develop/pull/1654
- Fixed extra newlines being written to console for failing build tasks in https://github.com/hydephp/develop/pull/1661
- Markdown formatting will now be stripped when generating an automatic blog post description when none is set in https://github.com/hydephp/develop/pull/1662 (fixes https://github.com/hydephp/develop/issues/1634)
- Realtime Compiler: Fixed responsive dashboard table issue in https://github.com/hydephp/develop/pull/1595
### Upgrade Path

In order to prepare your project for HydePHP v2.0, you should update your `config/hyde.php` configuration file to use the new `Feature` enum for the `features` array.

You can see the changes to make in your Hyde project by looking at the following pull request https://github.com/hydephp/hyde/pull/250/files

Your new config array should look like this:

```php
// Make sure to import the new Feature enum at the top of the file
use Hyde\Enums\Feature;

// Then replace your enabled features with the new Feature enum cases
'features' => [
// Page Modules
Feature::HtmlPages,
Feature::MarkdownPosts,
Feature::BladePages,
Feature::MarkdownPages,
Feature::DocumentationPages,

// Frontend Features
Feature::Darkmode,
Feature::DocumentationSearch,

// Integrations
Feature::Torchlight,
],
```

If you need more help, you can see detailed upgrade instructions with screenshots in the pull request https://github.com/hydephp/develop/pull/1650


## [1.5.0](https://github.com/hydephp/develop/releases/tag/1.5.0) - 2024-02-13

### Improved Patch Release Strategy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ No description provided.

```php
// torchlight! {"lineNumbers": false}
Hyde::hasFeature(string $feature): bool
Hyde::hasFeature(Hyde\Enums\Feature $feature): bool
```

#### `toArray()`
Expand Down
6 changes: 6 additions & 0 deletions packages/framework/src/Console/Commands/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
use Hyde\Hyde;
use Hyde\Facades\Config;
use Composer\InstalledVersions;
use Hyde\Foundation\PharSupport;
use LaravelZero\Framework\Commands\Command;

use function str_replace;
use function realpath;
use function app;
use function get_included_files;

/**
* Print debug information.
Expand Down Expand Up @@ -50,6 +52,10 @@ public function handle(): int
$this->printVerbosePathInformation();
} else {
$this->comment('Project directory: '.Hyde::path());

if (PharSupport::running()) {
$this->comment('Application binary path: '.get_included_files()[0]);
}
}
$this->newLine();

Expand Down
2 changes: 1 addition & 1 deletion packages/framework/src/Foundation/HydeKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class HydeKernel implements SerializableContract
use Serializable;
use Macroable;

final public const VERSION = '1.5.0';
final public const VERSION = '1.6.0';

protected static self $instance;

Expand Down
33 changes: 33 additions & 0 deletions packages/framework/tests/Feature/Commands/DebugCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

namespace Hyde\Framework\Testing\Feature\Commands;

use Mockery;
use Hyde\Testing\TestCase;
use Hyde\Foundation\PharSupport;
use Illuminate\Console\OutputStyle;
use Hyde\Console\Commands\DebugCommand;

/**
* @covers \Hyde\Console\Commands\DebugCommand
Expand Down Expand Up @@ -46,4 +50,33 @@ public function testItPrintsVerboseDebugInformation()
->expectsOutputToContain('(real)')
->assertExitCode(0);
}

public function testItPrintsPharDebugInformation()
{
PharSupport::mock('running', true);

$wasCalled = false;

$output = Mockery::mock(OutputStyle::class, [
'writeln' => null,
'newLine' => null,
'isVerbose' => false,
])->makePartial();

$output->shouldReceive('writeln')->withArgs(function ($message) use (&$wasCalled) {
if (str_contains($message, 'Application binary path:')) {
$wasCalled = true;
}

return true;
});

$command = new DebugCommand();
$command->setOutput($output);
$command->handle();

$this->assertTrue($wasCalled, 'Expected "Application binary path" to be called');

PharSupport::clearMocks();
}
}

0 comments on commit 29bd2d2

Please sign in to comment.