Skip to content

Commit

Permalink
Merge branch 'master' into separate-internal-application-files-from-p…
Browse files Browse the repository at this point in the history
…roject-structure-
  • Loading branch information
caendesilva authored Feb 9, 2023
2 parents 7ff0fa5 + 86764a5 commit 6b32a15
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ public function initialize(): void

public function register(): void
{
//
$this->mergeConfigFrom(__DIR__.'/../../../config/hyde.php', 'hyde');
$this->mergeConfigFrom(__DIR__.'/../../../config/docs.php', 'docs');
$this->mergeConfigFrom(__DIR__.'/../../../config/site.php', 'site');
$this->mergeConfigFrom(__DIR__.'/../../../config/markdown.php', 'markdown');
}

public function boot(): void
{
//
$this->publishes([
__DIR__.'/../../../config' => config_path(),
], 'configs');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

namespace Hyde\Foundation\Providers;

use Hyde\Framework\Views\Components\LinkComponent;
use Hyde\Hyde;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

class ViewServiceProvider extends ServiceProvider
{
public function register(): void
{
//
}

public function boot(): void
{
$this->loadViewsFrom(__DIR__.'/../../../resources/views', 'hyde');

$this->publishes([
__DIR__.'/../../../resources/views/layouts' => resource_path('views/vendor/hyde/layouts'),
], 'hyde-layouts');

$this->publishes([
__DIR__.'/../../../resources/views/components' => resource_path('views/vendor/hyde/components'),
], 'hyde-components');

$this->publishes([
Hyde::vendorPath('resources/views/pages/404.blade.php') => Hyde::path('_pages/404.blade.php'),
], 'hyde-page-404');

$this->publishes([
Hyde::vendorPath('resources/views/homepages/welcome.blade.php') => Hyde::path('_pages/index.blade.php'),
], 'hyde-welcome-page');

$this->publishes([
Hyde::vendorPath('resources/views/homepages/post-feed.blade.php') => Hyde::path('_pages/index.blade.php'),
], 'hyde-posts-page');

$this->publishes([
Hyde::vendorPath('resources/views/homepages/blank.blade.php') => Hyde::path('_pages/index.blade.php'),
], 'hyde-blank-page');

Blade::component('link', LinkComponent::class);
}
}
36 changes: 2 additions & 34 deletions packages/framework/src/Framework/HydeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
use Hyde\Facades\Features;
use Hyde\Foundation\HydeKernel;
use Hyde\Foundation\Providers\ConfigurationServiceProvider;
use Hyde\Foundation\Providers\ViewServiceProvider;
use Hyde\Framework\Concerns\RegistersFileLocations;
use Hyde\Framework\Services\AssetService;
use Hyde\Framework\Views\Components\LinkComponent;
use Hyde\Hyde;
use Hyde\Markdown\MarkdownConverter;
use Hyde\Pages\BladePage;
use Hyde\Pages\DocumentationPage;
use Hyde\Pages\HtmlPage;
use Hyde\Pages\MarkdownPage;
use Hyde\Pages\MarkdownPost;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

/**
Expand Down Expand Up @@ -75,38 +74,6 @@ public function register(): void
*/
public function boot(): void
{
$this->loadViewsFrom(__DIR__.'/../../resources/views', 'hyde');

$this->publishes([
__DIR__.'/../../config' => config_path(),
], 'configs');

$this->publishes([
__DIR__.'/../../resources/views/layouts' => resource_path('views/vendor/hyde/layouts'),
], 'hyde-layouts');

$this->publishes([
__DIR__.'/../../resources/views/components' => resource_path('views/vendor/hyde/components'),
], 'hyde-components');

$this->publishes([
Hyde::vendorPath('resources/views/pages/404.blade.php') => Hyde::path('_pages/404.blade.php'),
], 'hyde-page-404');

$this->publishes([
Hyde::vendorPath('resources/views/homepages/welcome.blade.php') => Hyde::path('_pages/index.blade.php'),
], 'hyde-welcome-page');

$this->publishes([
Hyde::vendorPath('resources/views/homepages/post-feed.blade.php') => Hyde::path('_pages/index.blade.php'),
], 'hyde-posts-page');

$this->publishes([
Hyde::vendorPath('resources/views/homepages/blank.blade.php') => Hyde::path('_pages/index.blade.php'),
], 'hyde-blank-page');

Blade::component('link', LinkComponent::class);

HydeKernel::getInstance()->readyToBoot();
}

Expand Down Expand Up @@ -149,5 +116,6 @@ protected function registerPageModels(): void
protected function registerModuleServiceProviders(): void
{
$this->app->register(HydeConsoleServiceProvider::class);
$this->app->register(ViewServiceProvider::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @covers \Hyde\Framework\HydeServiceProvider
* @covers \Hyde\Framework\Concerns\RegistersFileLocations
* @covers \Hyde\Foundation\Providers\ConfigurationServiceProvider
* @covers \Hyde\Foundation\Providers\ViewServiceProvider
*/
class HydeServiceProviderTest extends TestCase
{
Expand Down

0 comments on commit 6b32a15

Please sign in to comment.