-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Upgraded laravel; Corrections for SSR; Various improvements
- Added Enraiged TableBuilder::{column,columExists}() methods - Added ability to define model for table action security assertions - Added ability to configure tables to order by sortable count - Added ability to define a horizontal rule before a form field - Added ability to define field disabledIf,disabledUnless conditions - Added ability to define field hiddenIf,hiddenUnless conditions - Add definition to the json template to process client-side - Or, add method call server-side to process in the form builder - Added 'daterange' type table filter - Added patch for correcting primevue import lines for ssr use - Added patch for issue with primevue datatables rowgroup colspan - primefaces/primevue#3685 - Added 'enraiged:fix-ssr' command to enable ssr with primevue - Corrected 419 error issue handling logout requests - Corrected issue handling field disabled attribute when provided - Corrected issue searching table columns with compound sources - Corrected various issues with the user password validation - Ensure table export options not displayed unless permitted - Improved table global actions processing - Removed neccessity of errors object in the js form system - Updated to the Laravel 10 framework - https://laravel.com/docs/10.x/releases
- Loading branch information
Todd Cytra
committed
Jul 11, 2023
1 parent
df0756a
commit 81bf4fa
Showing
120 changed files
with
8,488 additions
and
2,592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?php | ||
|
||
namespace App\Console\Enraiged; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Process; | ||
use Illuminate\Support\Facades\Storage; | ||
|
||
class FixSSR extends Command | ||
{ | ||
/** @var string The name and signature of the console command. */ | ||
protected $signature = 'enraiged:fix-ssr {--revert}'; | ||
|
||
/** @var string The console command description. */ | ||
protected $description = 'Fix the Primevue packages for SSR usage.'; | ||
|
||
/** @var bool An argument to execute a reversal. */ | ||
protected $revert = false; | ||
|
||
/** | ||
* Cycle through the package names and executes a find/sed replace to ensure ssr compatibility. | ||
* | ||
* @return void | ||
*/ | ||
public function handle(): void | ||
{ | ||
$this->basepath = base_path('node_modules/primevue'); | ||
$this->revert = $this->option('revert'); | ||
|
||
(object) $this | ||
->addPackageJsonType() | ||
->applyIconsImportsFix() | ||
->applyPackageImportsFix(); | ||
|
||
$this->info('Done.'); | ||
|
||
if (!$this->revert) { | ||
$this->info('Execute php artisan enraiged:fix-ssr --revert to reverse these changes.'); | ||
} | ||
} | ||
|
||
/** | ||
* This executes a sed to add the type: module line to the package.json files. | ||
* | ||
* @return self | ||
*/ | ||
private function addPackageJsonType(): self | ||
{ | ||
$this->line('Applying package.json fix...'); | ||
|
||
$progress = $this->output->createProgressBar(1); | ||
$progress->start(1); | ||
|
||
$command = $this->revert | ||
? "sed -i '/\"type\": \"module\",/d' {$this->basepath}/{icons/*,*}/package.json" | ||
: "find {$this->basepath}/*/ -type f -name 'package.json' -exec sed -i '1 a\ \"type\": \"module\",' {} \;"; | ||
|
||
Process::run($command); | ||
|
||
$progress->advance(); | ||
$progress->finish(); | ||
$this->newLine(); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* This executes a sed to expand the include call to the full *.esm.js package filename. | ||
* | ||
* @return self | ||
*/ | ||
private function applyIconsImportsFix(): self | ||
{ | ||
$this->line('Applying icons imports fix...'); | ||
|
||
$directories = collect(Storage::disk('node')->directories('primevue/icons')); | ||
|
||
$progress = $this->output->createProgressBar($directories->count()); | ||
|
||
$directories->each(function ($package) use ($progress) { | ||
$command = $this->revert | ||
? "find {$this->basepath}/ -type f -name '*.esm.js' -exec sed -i \"s|'{$package}/index.esm.js'|'{$package}'|\" {} \;" | ||
: "find {$this->basepath}/ -type f -name '*.esm.js' -exec sed -i \"s|'{$package}'|'{$package}/index.esm.js'|\" {} \;"; | ||
Process::run($command); | ||
|
||
$progress->advance(); | ||
}); | ||
|
||
$progress->finish(); | ||
$this->newLine(); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* This executes a sed to expand the include call to the full *.esm.js package filename. | ||
* | ||
* @return $this | ||
*/ | ||
private function applyPackageImportsFix(): self | ||
{ | ||
$this->line('Applying package imports fix...'); | ||
|
||
$directories = collect(Storage::disk('node')->directories('primevue')) | ||
->filter(fn ($directory) => Storage::disk('node')->exists("{$directory}/package.json")); | ||
|
||
$progress = $this->output->createProgressBar($directories->count()); | ||
|
||
$directories->each(function ($package) use ($progress) { | ||
$filename = substr($package, strrpos($package, '/') +1); | ||
$command = $this->revert | ||
? "find {$this->basepath}/ -type f -name '*.esm.js' -exec sed -i \"s|'{$package}/{$filename}.esm.js'|'{$package}'|\" {} \;" | ||
: "find {$this->basepath}/ -type f -name '*.esm.js' -exec sed -i \"s|'{$package}'|'{$package}/{$filename}.esm.js'|\" {} \;"; | ||
Process::run($command); | ||
|
||
$progress->advance(); | ||
}); | ||
|
||
$progress->finish(); | ||
$this->newLine(); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.