Skip to content

Commit b0c06ab

Browse files
committed
fix: bug where vite and tailwind are not installed during install
1 parent d8657e2 commit b0c06ab

File tree

1 file changed

+46
-47
lines changed

1 file changed

+46
-47
lines changed

src/Commands/Cyclone.php

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -429,96 +429,83 @@ private function wrapText(string $text, float $fontSize, string $fontPath, int $
429429
public function __invoke(): void
430430
{
431431
$this->console->info('Starting Cyclone CMS installation...');
432-
433-
// Step 1: Install Tempest framework
432+
433+
// Step - Install Tempest framework
434434
$this->console->info('➡️ Starting TempestPHP installation...');
435-
$this->runCommand('./vendor/bin/tempest install framework --no-interaction', '❌ Error installing Tempest framework.');
435+
$this->runCommand('./vendor/bin/tempest install framework -f --no-interaction', '❌ Error installing Tempest framework.');
436436
$this->console->info('✅ TempestPHP installed!');
437437
$this->console->info('-----------------------------------------');
438-
439-
// Step 2: Create .gitignore file
438+
439+
// Step - Create .gitignore file
440440
$this->console->info('➡️ Creating .gitignore file ...');
441441
$this->runCommand('touch .gitignore', '❌ Error creating .gitignore file.');
442442
$this->console->info('✅ .gitignore created!');
443443
$this->console->info('-----------------------------------------');
444-
445-
// Step 3: Create package.json skeleton
444+
445+
// Step - Create package.json skeleton
446446
$this->console->info('➡️ Creating package.json...');
447447
$this->runCommand('npm init --yes', '❌ Error creating package.json.');
448448
$this->console->info('✅ package.json created!');
449449
$this->console->info('-----------------------------------------');
450-
451-
// Step 4: Install Vite with Tailwind and npm
452-
$this->console->info('➡️ Starting installing vite & tailwind...');
453-
$this->runCommand('php tempest install vite --tailwind --no-interaction', '❌ Error installing Vite with Tailwind.');
454-
$this->console->info('✅ vite & tailwind installed!');
455-
$this->console->info('-----------------------------------------');
456-
457-
// Step 5: Install authentication module
450+
451+
// Step - Install authentication module
458452
$this->console->info('➡️ Starting installing Auth package...');
459453
$this->runCommand('php tempest install auth --no-interaction', '❌ Error installing authentication module.');
460454
$this->console->info('✅ Auth package installed!');
461455
$this->console->info('-----------------------------------------');
462-
463-
// Step 6: Run migrations
456+
457+
// Step - Run migrations
464458
$this->console->info('➡️ Starting database migration...');
465459
$this->runCommand('php tempest migrate:up', '❌ Error running migrations.');
466460
$this->console->info('✅ Database migrated!');
467461
$this->console->info('-----------------------------------------');
468-
469-
// Step 7: Add a default user
462+
463+
// Step - Add a default user
470464
$this->console->info('➡️ Starting adding default user...');
471465
$this->runCommand('php tempest cyclone:add-default-user', '❌ Error adding default user.');
472466
$this->console->info('✅ Default user added!');
473467
$this->console->info('-----------------------------------------');
474-
475-
// Step 8: Add a blog post
468+
469+
// Step - Add a blog post
476470
$this->console->info('➡️ Starting adding blog content...');
477471
$this->runCommand('php tempest cyclone:add-blog-post', '❌ Error adding blog post.');
478472
$this->console->info('✅ Blog content added!');
479473
$this->console->info('-----------------------------------------');
480-
481-
// Step 9: Copy assets
474+
475+
// Step - Copy assets
482476
$this->console->info('➡️ Starting copying assets...');
483477
$this->runCommand('php tempest cyclone:assets', '❌ Error copying assets.');
484478
$this->console->info('✅ Assets copied!');
485479
$this->console->info('-----------------------------------------');
486-
487-
// Step 10: Sync posts
480+
481+
// Step - Sync posts
488482
$this->console->info('➡️ Starting posts synchronisation...');
489483
$this->runCommand('php tempest cyclone:sync-posts', '❌ Error syncing posts.');
490484
$this->console->info('✅ Posts synchonized!');
491485
$this->console->info('-----------------------------------------');
492-
493-
// Step 11: Install Tailwind Typography dependencies
486+
487+
// Step - Install Tailwind Typography dependencies
494488
$this->console->info('➡️ Starting installing Tailwind Typography...');
495489
$this->runCommand('npm install -D @tailwindcss/typography', '❌ Error installing @tailwindcss/typography.');
496490
$this->console->info('✅ Tailwind Typography installed!');
497491
$this->console->info('-----------------------------------------');
498-
499-
// Step 11: Install Tailwind Typography dependencies
492+
493+
// Step - InstallMilkdown editor
500494
$this->console->info('➡️ Starting installing Milkdown...');
501495
$this->runCommand('npm install @milkdown/crepe', '❌ Error installing @milkdown/crepe.');
502496
$this->console->info('✅ Milkdown installed!');
503497
$this->console->info('-----------------------------------------');
504-
505-
// Step 12: Install npm dependencies
506-
// $this->console->info('Starting TempestPHP installation...');
507-
// $this->runCommand('npm install', '❌ Error installing npm dependencies.');
508-
// $this->console->info('✅ Milkdown installed!');
509-
// $this->console->info('-----------------------------------------');
510-
511-
// Step 13: Install npm dependencies
498+
499+
// Step - Install npm dependencies
512500
$this->console->info('➡️ Starting npm update...');
513501
$this->runCommand('npm update', '❌ Error installing npm dependencies.');
514502
$this->console->info('✅ npm updated!');
515503
$this->console->info('-----------------------------------------');
516-
517-
// Step 13: Run dev mode
504+
505+
// Step - Run dev mode
518506
// $this->runCommand('npm run dev -- --no-open', '❌ Error running npm run dev.');
519-
520-
// todo cp .env.example to .env with correct url
521-
// Step 14: Copy .env.example to .env
507+
508+
// Step - Copy .env.example to .env & set BASE_URI
522509
$this->console->info('➡️ Starting customizing .env...');
523510
$envexamplePath = root_path() . '/.env.example';
524511
$envPath = root_path() . '/.env';
@@ -531,16 +518,16 @@ public function __invoke(): void
531518
} else {
532519
$this->console->error(".env.example file does not exist. Please create it manually.");
533520
exit(1);
534-
}
535-
521+
}
522+
536523
// Find BASE_URI=localhost and replace 'localhost' with the current URL
537524
$currentUrl = $this->console->ask('What will be the current URL of your site? (e.g., https://cyclone.test)', default: 'https://cyclone.test');
538525
$currentUrl = rtrim($currentUrl, '/'); // Remove trailing slash
539526
$envContent = file_get_contents($envPath);
540527
if ($envContent === false) {
541528
$this->console->error("❌ Error reading .env file");
542529
exit(1);
543-
}
530+
}
544531
$envContent = preg_replace('/^BASE_URI=.*$/m', 'BASE_URI=' . $currentUrl, $envContent);
545532
if (file_put_contents($envPath, $envContent) === false) {
546533
$this->console->error("❌ Error writing to .env file");
@@ -549,8 +536,20 @@ public function __invoke(): void
549536
$this->console->info("BASE_URI set to $currentUrl in .env file");
550537
$this->console->info('✅ .env updated!');
551538
$this->console->info('-----------------------------------------');
552-
553-
539+
540+
541+
// Step - Launch discovery process
542+
$this->console->info('➡️ Launch discovery process...');
543+
$this->runCommand('php tempest discovery:generate', '❌ Error during discovery process.');
544+
$this->console->info('✅ Discovery process finished!');
545+
$this->console->info('-----------------------------------------');
546+
547+
// Step - Install Vite with Tailwind and npm
548+
$this->console->info('➡️ Starting installing vite & tailwind...');
549+
$this->runCommand('php tempest install vite --tailwind --no-interaction', '❌ Error installing Vite with Tailwind.');
550+
$this->console->info('✅ vite & tailwind installed!');
551+
$this->console->info('-----------------------------------------');
552+
554553
$this->success('✅ Cyclone CMS installed successfully!');
555554

556555
$this->info('Now you have to create the first user by launching the command: php tempest cyclone:add-user');

0 commit comments

Comments
 (0)