From 761cadaf02639529514aba92e861ea9a981c403e Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 12 Jul 2024 12:34:08 +0200 Subject: [PATCH] Implement the option to skip diffing --- hyde.yml | 87 +++++++++++++++++++ .../DevTools/src/RefactorConfigCommand.php | 11 ++- 2 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 hyde.yml diff --git a/hyde.yml b/hyde.yml new file mode 100644 index 00000000000..4a938412fa5 --- /dev/null +++ b/hyde.yml @@ -0,0 +1,87 @@ +name: HydePHP +url: 'http://localhost' +language: en +pretty_urls: false +generate_sitemap: true +rss: + enabled: true + filename: feed.xml + description: 'HydePHP RSS Feed' +source_root: '' +output_directory: _site +source_directories: + html-page: _pages + blade-page: _pages + markdown-page: _pages + markdown-post: _posts + documentation-page: _docs +output_directories: + html-page: '' + blade-page: '' + markdown-page: '' + markdown-post: posts + documentation-page: docs +media_directory: _media +meta: + - '' + - '' +head: '' +scripts: '' +features: + - html-pages + - markdown-posts + - blade-pages + - markdown-pages + - documentation-pages + - darkmode + - documentation-search + - torchlight +authors: + - + username: mr_hyde + name: 'Mr. Hyde' + website: 'https://hydephp.com' +footer: 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩' +navigation: + order: + index: 0 + posts: 10 + docs/index: 100 + labels: + index: Home + docs/index: Docs + exclude: + - '404' + custom: [] + subdirectories: hidden +enable_cache_busting: true +load_app_styles_from_cdn: false +use_play_cdn: false +default_color_scheme: light +server: + port: 8080 + host: localhost + save_preview: true + live_edit: true + dashboard: + enabled: true + interactive: true + tips: true +media_extensions: + - png + - svg + - jpg + - jpeg + - gif + - ico + - css + - js +safe_output_directories: + - _site + - docs + - build +generate_build_manifest: true +build_manifest_path: app/storage/framework/cache/build-manifest.json +hydefront_version: v3.4 +hydefront_cdn_url: 'https://cdn.jsdelivr.net/npm/hydefront@{{ $version }}/dist/{{ $file }}' +theme_toggle_buttons: true diff --git a/monorepo/DevTools/src/RefactorConfigCommand.php b/monorepo/DevTools/src/RefactorConfigCommand.php index 927b26d5a26..721bb8cd26e 100644 --- a/monorepo/DevTools/src/RefactorConfigCommand.php +++ b/monorepo/DevTools/src/RefactorConfigCommand.php @@ -34,7 +34,7 @@ class RefactorConfigCommand extends Command protected const SUPPORTED_FORMATS = ['yaml']; /** @var string */ - protected $signature = 'refactor:config {format : The new configuration format}'; + protected $signature = 'refactor:config {format : The new configuration format} {--skip-diff : Skip diffing and dump the entire config}'; /** @var string */ protected $description = 'Migrate the configuration to a different format.'; @@ -59,7 +59,11 @@ protected function migrateToYaml(): int { $this->ensureYamlConfigDoesNotExist(); - $config = $this->getConfigDiff(); + $config = config('hyde'); + + if (! $this->option('skip-diff')) { + $config = $this->getDiffedConfig($config); + } if (empty($config)) { $this->warn("You don't seem to have any configuration to migrate."); @@ -84,9 +88,8 @@ protected function ensureYamlConfigDoesNotExist(): void } } - protected function getConfigDiff(): array + protected function getDiffedConfig($config): array { - $config = config('hyde'); $default = require Hyde::vendorPath('config/hyde.php'); return $this->diffConfig($config, $default);