Skip to content

Commit

Permalink
Implement the option to skip diffing
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 12, 2024
1 parent abaa764 commit 761cada
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 4 deletions.
87 changes: 87 additions & 0 deletions hyde.yml
Original file line number Diff line number Diff line change
@@ -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:
- '<meta name="generator" content="HydePHP v1.7.2">'
- '<meta property="og:site_name" content="HydePHP">'
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
11 changes: 7 additions & 4 deletions monorepo/DevTools/src/RefactorConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
Expand All @@ -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.");
Expand All @@ -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);
Expand Down

0 comments on commit 761cada

Please sign in to comment.