diff --git a/app/Console/Commands/FroozeRepositories.php b/app/Console/Commands/FroozeRepositories.php index 7ce44ba..6ab30f5 100644 --- a/app/Console/Commands/FroozeRepositories.php +++ b/app/Console/Commands/FroozeRepositories.php @@ -22,20 +22,13 @@ class FroozeRepositories extends Command { */ protected $description = 'Load and frooze oldest and starred repositories'; - /** - * Execute the console command. - */ - public function handle() { - $client = new GithubApi(); - $repositories = $client->getOldestStarredRepositories(); - - FrozenRepository::truncate(); - + private function insertRepositories(array $list, bool $forRoad) { FrozenRepository::insert( array_map( - function ($rep) { + function ($rep) use ($forRoad) { return array( 'created_at' => Carbon::now(), + 'forRoad' => $forRoad, 'name' => $rep->name, 'githubId' => $rep->id, 'fullName' => $rep->fullName, @@ -54,7 +47,21 @@ function ($rep) { 'ownerAvatarUrl' => $rep->owner->avatarUrl, 'year' => $rep->createdAt->format('Y'), ); - }, $repositories) + }, $list) ); } + + /** + * Execute the console command. + */ + public function handle() { + $client = new GithubApi(); + $oldRepos = $client->getOldestStarredRepositories(); + $roadRepos = $client->getRoad(); + + FrozenRepository::truncate(); + + $this->insertRepositories($oldRepos, false); + $this->insertRepositories($roadRepos, true); + } } diff --git a/app/Console/Commands/ProLangAssets.php b/app/Console/Commands/ProLangAssets.php index 2d80161..cf7d7b1 100644 --- a/app/Console/Commands/ProLangAssets.php +++ b/app/Console/Commands/ProLangAssets.php @@ -398,8 +398,23 @@ private function updateLinks() { 'SPARK' => array( 'mainRepository' => 'https://github.com/AdaCore/spark2014?utm_source=chatgpt.com', ), - 'Turbo Pascal' => array(), - 'Turbo Pascal OOP' => array(), + 'Turbo Pascal' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/keskival/turbo-pascal-experiments/refs/heads/master/DISK/COOL.PAS', + ), + 'Turbo Pascal OOP' => array( + 'rawCode' => <<<'EOD' + type object-identifier = object + private + field1 : field-type; + field2 : field-type; + ... + public + procedure proc1; + function f1(): function-type; + end; + var objectvar : object-identifier; + EOD + ), 'Vala' => array( 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Vala/fibonacci-sequence-2.vala', ), @@ -518,14 +533,13 @@ function member y tl -> y repeat up EOD ), - // TODO update / check 'R' => array( 'mainRepository' => 'https://github.com/wch/r-source', - 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/r/R.R', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/R/fibonacci-sequence-1.r', ), 'Python' => array( 'mainRepository' => 'https://github.com/python/cpython', - 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/p/Python%203.py', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Python/fibonacci-sequence-15.py', ), 'C#' => array( 'mainRepository' => 'https://github.com/dotnet/roslyn', @@ -533,7 +547,7 @@ function member ), 'Erlang' => array( 'mainRepository' => 'https://github.com/erlang/otp', - 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Erlang/fibonacci-sequence-4.erl', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Erlang/fibonacci-sequence-1.erl', ), 'Nim' => array( 'mainRepository' => 'https://github.com/nim-lang/Nim', @@ -560,7 +574,7 @@ function member ), 'SNOBOL' => array( 'mainRepository' => 'https://github.com/seanpm2001/Learn-SNOBOL?tab=readme-ov-file#Version-history', - 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/s/SNOBOL', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/SNOBOL4/fibonacci-sequence-2.sno', ), 'FORTRAN' => array( 'mainRepository' => 'https://github.com/fortran-lang', @@ -580,7 +594,7 @@ function member ), 'Go' => array( 'mainRepository' => 'https://github.com/golang/go', - 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/g/Go.go', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Go/fibonacci-sequence-2.go', ), 'BCPL' => array( 'mainRepository' => 'https://github.com/8l/bcpl', @@ -616,7 +630,7 @@ function member ), 'Lua' => array( 'mainRepository' => 'https://github.com/lua/lua', - 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/l/Lua.lua', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Lua/fibonacci-sequence-2.lua', ), 'Racket' => array( 'mainRepository' => 'https://github.com/racket/racket', @@ -806,10 +820,11 @@ function member END EOD ), - // TODO empty 'BASIC FOUR' => array(), 'Boehm unnamed coding system' => array(), - 'CLIPPER' => array(), + 'CLIPPER' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/c/Clipper.prg', + ), 'CLU' => array(), 'COMAL' => array(), 'COMIT' => array(), @@ -820,11 +835,15 @@ function member 'CS-4' => array(), 'Claire' => array(), 'Bourne Shell' => array(), - 'Brainfuck' => array(), + 'Brainfuck' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/b/Brainfuck.bf', + ), 'C with classes' => array(), 'C++' => array(), 'Caml Light' => array(), - 'Clean' => array(), + 'Clean' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/c/Clean.icl', + ), 'Boo' => array(), 'Cobra' => array(), 'CoffeeScript' => array(), @@ -1026,7 +1045,9 @@ function member 'occam 2' => array(), 'EuLisp' => array(), 'Fortran 2018' => array(), - 'GDScript' => array(), + 'GDScript' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/g/GDScript.gd', + ), 'GPSS' => array(), 'Hamilton C shell' => array(), 'Io' => array(), @@ -1035,13 +1056,23 @@ function member 'KornShell' => array(), 'LabVIEW' => array(), 'Modula-3' => array(), - 'Nemerle' => array(), - 'Oberon' => array(), + 'Nemerle' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Nemerle/fibonacci-sequence-1.nemerle', + ), + 'Oberon' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Oberon/fibonacci-sequence.oberon', + ), 'Oberon-2' => array(), 'PL/M' => array(), - 'PowerBASIC' => array(), - 'Pure' => array(), - 'PureBasic' => array(), + 'PowerBASIC' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/PowerBASIC/fibonacci-sequence.basic', + ), + 'Pure' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Pure/fibonacci-sequence.pure', + ), + 'PureBasic' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/PureBasic/fibonacci-sequence-2.basic', + ), 'Q' => array(), 'QuickBASIC' => array(), 'REXX' => array(), @@ -1050,12 +1081,17 @@ function member 'Speakeasy' => array(), 'Speakeasy-IV' => array(), 'Subtext' => array(), - 'Turing' => array(), + 'Turing' => array( + 'mainRepository' => 'https://github.com/TuringLang', + 'rawCodeLink' => 'https://raw.githubusercontent.com/acmeism/RosettaCodeData/refs/heads/main/Task/Fibonacci-sequence/Turing/fibonacci-sequence.turing', + ), 'UnrealScript' => array(), 'Visual Basic' => array(), 'Xojo' => array(), 'Z Shell' => array(), - 'occam' => array(), + 'occam' => array( + 'rawCodeLink' => 'https://raw.githubusercontent.com/leachim6/hello-world/refs/heads/main/o/occam.occam', + ), 'Dart' => array(), 'Common Lisp' => array(), 'Windows PowerShell' => array(), diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 4a1dba3..6134c6d 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -144,10 +144,28 @@ public function langHistory() { } public function road() { - $road = $this->client->getRoad(); - Log::info('action=show_road'); - return Inertia::render('Road', $road); + return Inertia::render('Road', array( + 'beautifulCode' => FrozenRepository::whereIn('fullName', array( + 'biomejs/biome', 'laravel/pint', 'zed-industries/zed', + ))->get()->toArray(), + 'builtOn' => FrozenRepository::whereIn('fullName', array( + 'laravel/laravel', 'vuejs/core', 'sqlite/sqlite', 'inertiajs/inertia', 'nanostores/nanostores', + ))->get()->toArray(), + 'UiUx' => FrozenRepository::whereIn('fullName', array( + 'shoelace-style/webawesome', 'DerYeger/yeger', 'hackernoon/pixel-icon-library', + ))->get()->toArray(), + 'cleanRepo' => FrozenRepository::whereIn('fullName', array( + 'evilmartians/lefthook', + 'conventional-changelog/commitlint', + 'pestphp/pest', + ))->get()->toArray(), + 'surprises' => FrozenRepository::whereIn('fullName', array( + 'vwh/sqlite-online', + 'htzh/leanproved', + 'withastro/astro', + ))->get()->toArray(), + )); } } diff --git a/app/Models/GithubApi.php b/app/Models/GithubApi.php index f52ff36..f000ec5 100644 --- a/app/Models/GithubApi.php +++ b/app/Models/GithubApi.php @@ -123,7 +123,7 @@ private function getRepositories(array $tools) { ), $tools); } - public function getRoad() { + public function getRoad(): array { $builtOn = $this->getRepositories( array( 'laravel/laravel', 'vuejs/core', 'sqlite/sqlite', 'inertiajs/inertia', 'nanostores/nanostores', @@ -154,12 +154,13 @@ public function getRoad() { ) ); - return array( - 'builtOn' => $builtOn, - 'beautifulCode' => $beautifulCode, - 'UiUx' => $UiUx, - 'cleanRepo' => $cleanRepo, - 'surprises' => $surprises, + return array_merge( + array(), + $builtOn, + $beautifulCode, + $UiUx, + $cleanRepo, + $surprises, ); } } diff --git a/database/migrations/2026_01_06_221543_add_road_column_to_frozen_repositories_table.php b/database/migrations/2026_01_06_221543_add_road_column_to_frozen_repositories_table.php new file mode 100644 index 0000000..3b79061 --- /dev/null +++ b/database/migrations/2026_01_06_221543_add_road_column_to_frozen_repositories_table.php @@ -0,0 +1,25 @@ +boolean('forRoad')->default(false); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void { + Schema::table('frozen_repositories', function (Blueprint $table) { + $table->dropColumn('forRoad'); + }); + } +}; diff --git a/resources/js/components/prolang/LangCard.vue b/resources/js/components/prolang/LangCard.vue index aabae7c..2370a09 100644 --- a/resources/js/components/prolang/LangCard.vue +++ b/resources/js/components/prolang/LangCard.vue @@ -73,15 +73,21 @@ - - See details + + More details