Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/vortex-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Test PHAR
run: |
./build/installer.phar --version
./build/installer.phar --no-interaction --no-cleanup test || exit 1
./build/installer.phar --no-interaction --no-cleanup --destination=test || exit 1
working-directory: .vortex/installer

- name: Upload artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vortex-test-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
working-directory: .vortex/installer

- name: Test PHAR
run: ./build/installer.phar --no-interaction example || exit 1
run: ./build/installer.phar --no-interaction --destination=example || exit 1
working-directory: .vortex/installer
env:
GITHUB_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
26 changes: 21 additions & 5 deletions .vortex/docs/.utils/update-installer-video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ proc wait_and_enter {} {
#######################
# Start the installer #
#######################
spawn php installer.php star_wars
set env(VORTEX_INSTALLER_PROMPT_BUILD_NOW) 0
spawn php installer.php --destination=star_wars

# Wait for the welcome screen and let it proceed
expect {
Expand Down Expand Up @@ -235,13 +236,13 @@ while {1} {
after 2000
safe_send "\r"
}
"─┘" {
wait_and_enter
}
"Finished installing Vortex" {
# Installation completed, break out of loop
break
}
"─┘" {
wait_and_enter
}
timeout {
puts "Timeout during installation"
break
Expand All @@ -251,7 +252,22 @@ while {1} {
break
}
}
# sleep 1
}

# Handle the final "Run the site build now?" prompt separately
# Default is "No" via VORTEX_INSTALLER_PROMPT_BUILD_NOW=0 env var
expect {
"Run the site build now?" {
after 2000
# Just press Enter to accept the default (No)
safe_send "\r"
}
timeout {
puts "Timeout waiting for build prompt"
}
eof {
puts "End of file before build prompt"
}
}

expect eof
Expand Down
356 changes: 186 additions & 170 deletions .vortex/docs/static/img/installer.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .vortex/docs/static/img/installer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions .vortex/installer/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@

declare(strict_types=1);

use DrevOps\VortexInstaller\Command\BuildCommand;
use DrevOps\VortexInstaller\Command\CheckRequirementsCommand;
use DrevOps\VortexInstaller\Command\InstallCommand;
use Symfony\Component\Console\Application;

require_once $GLOBALS['_composer_autoload_path'] ?? __DIR__ . '/vendor/autoload.php';

$application = new Application('Vortex Installer', '@vortex-installer-version@');

$command = new InstallCommand();
$application->add($command);
$application->setDefaultCommand($command->getName(), TRUE);
$application->add(new InstallCommand());
$application->add(new CheckRequirementsCommand());
$application->add(new BuildCommand());

$application->setDefaultCommand('install');

$application->run();
2 changes: 2 additions & 0 deletions .vortex/installer/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ parameters:
excludePaths:
- vendor/*

treatPhpDocTypesAsCertain: false

ignoreErrors:
-
# Since tests and data providers do not have to have parameter docblocks,
Expand Down
2 changes: 1 addition & 1 deletion .vortex/installer/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.4/phpunit.xsd"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.4/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
Expand Down
196 changes: 196 additions & 0 deletions .vortex/installer/playground/task-streaming.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
#!/usr/bin/env php
<?php

/**
* @file
* Playground script to test Task streaming mode with dimmed output.
*
* Run: php playground/task-streaming.php
*/

declare(strict_types=1);

require_once __DIR__ . '/../vendor/autoload.php';

use DrevOps\VortexInstaller\Task\Task;
use DrevOps\VortexInstaller\Utils\Tui;
use Symfony\Component\Console\Output\ConsoleOutput;

$output = new ConsoleOutput();
Tui::init($output);

echo PHP_EOL;
echo "=== Task Streaming Mode Demo ===" . PHP_EOL;
echo PHP_EOL;

// Streaming mode with echo - output should be dimmed.
echo "--- Streaming mode: output via echo ---" . PHP_EOL;
Task::action(
label: 'Streaming task using echo',
action: function () {
echo "Line 1 via echo...\n";
usleep(500000);
echo "Line 2 via echo...\n";
usleep(500000);
echo "Line 3 via echo...\n";
usleep(500000);
return true;
},
success: 'Echo streaming completed',
streaming: true,
);
echo PHP_EOL;

// Streaming mode with Tui::output() - output should be dimmed.
echo "--- Streaming mode: output via Tui::output() ---" . PHP_EOL;
Task::action(
label: 'Streaming task using Tui::output()',
action: function () {
Tui::output()->writeln("Line 1 via Tui::output()...");
usleep(500000);
Tui::output()->writeln("Line 2 via Tui::output()...");
usleep(500000);
Tui::output()->writeln("Line 3 via Tui::output()...");
usleep(500000);
return true;
},
success: 'Tui::output() streaming completed',
streaming: true,
);
echo PHP_EOL;

// Streaming mode with mixed output.
echo "--- Streaming mode: mixed echo and Tui::output() ---" . PHP_EOL;
Task::action(
label: 'Streaming task with mixed output',
action: function () {
echo "Line 1 via echo...\n";
usleep(400000);
Tui::output()->writeln("Line 2 via Tui::output()...");
usleep(400000);
echo "Line 3 via echo...\n";
usleep(400000);
Tui::output()->writeln("Line 4 via Tui::output()...");
usleep(400000);
return true;
},
success: 'Mixed streaming completed',
streaming: true,
);
echo PHP_EOL;

// Streaming mode with failure.
echo "--- Streaming mode: failure case ---" . PHP_EOL;
Task::action(
label: 'Streaming task that fails',
action: function () {
echo "Starting process...\n";
usleep(500000);
echo "Error encountered!\n";
usleep(500000);
return false;
},
failure: 'Streaming task failed',
streaming: true,
);
echo PHP_EOL;

// Task after failure - verify output is restored.
echo "--- Task after failure: verify output restoration ---" . PHP_EOL;
Task::action(
label: 'Task after failed streaming',
action: function () {
echo "This echo should be dimmed\n";
usleep(500000);
Tui::output()->writeln("This Tui::output() should also be dimmed");
usleep(500000);
return true;
},
success: 'Output restoration verified',
streaming: true,
);
echo PHP_EOL;

// Streaming mode without success message (default "OK").
echo "--- Streaming mode: no success message (default OK) ---" . PHP_EOL;
Task::action(
label: 'Streaming task without success message',
action: function () {
echo "Some output...\n";
usleep(500000);
return true;
},
streaming: true,
);
echo PHP_EOL;

// Streaming mode with nested spinner (simulates build command with requirements check).
echo "--- Streaming mode: nested spinner (cursor control) ---" . PHP_EOL;
Task::action(
label: 'Streaming task with nested spinner',
action: function () {
// The nested command uses spin() which outputs cursor control sequences.
\Laravel\Prompts\spin(
function () {
usleep(300000);
usleep(300000);
usleep(300000);
},
'Nested spinner task...'
);

echo "AFTER SPINNER 1\n";
\Laravel\Prompts\spin(
function () {
usleep(1000000);
usleep(1000000);
},
'Another nested spinner task...'
);

echo "AFTER SPINNER 2\n";

return true;
},
streaming: true,
);
echo PHP_EOL;

// Streaming mode with colors and styles.
echo "--- Streaming mode: colors and styles ---" . PHP_EOL;
Task::action(
label: 'Streaming task with styled output',
action: function () {
Tui::output()->writeln(Tui::green("Green text"));
usleep(300000);
Tui::output()->writeln(Tui::blue("Blue text"));
usleep(300000);
Tui::output()->writeln(Tui::yellow("Yellow text"));
usleep(300000);
Tui::output()->writeln(Tui::underscore("Underscored text"));
usleep(300000);
Tui::output()->writeln(Tui::bold("Bold text"));
usleep(300000);
Tui::output()->writeln("Mixed: " . Tui::green("green") . " and " . Tui::blue("blue") . " and " . Tui::underscore("underscored"));
usleep(300000);
return true;
},
success: 'Styled streaming completed',
streaming: true,
);
echo PHP_EOL;

// Non-streaming task after streaming tasks.
echo "--- Non-streaming task (spinner) after streaming ---" . PHP_EOL;
Task::action(
label: 'Spinner task after streaming',
action: function () {
usleep(1000000);
return true;
},
success: 'Spinner works after streaming',
);
echo PHP_EOL;

echo "=== Demo Complete ===" . PHP_EOL;
echo PHP_EOL;
Loading