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 .vortex/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ When updating template files (settings, configs, Dockerfiles, etc.):

When the installer prompt flow changes (any change under
`.vortex/installer/src/Prompts/` - new or removed handler, reordered or reworded
prompt, `TOTAL_RESPONSES` bump), also run `ahoy update-videos installer` to
prompt), also run `ahoy update-videos installer` to
Comment thread
coderabbitai[bot] marked this conversation as resolved.
re-record the demo, since the video records the live prompt flow.
`update-snapshots` commits automatically; `update-videos` does not - stage and
commit its output manually. Run both after the code change is committed.
Expand Down
436 changes: 224 additions & 212 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.
16 changes: 14 additions & 2 deletions .vortex/installer/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ permission before running.
Triggers that require re-recording:
- New `Handlers/*.php` class or handler removal.
- Wording change to `label()` or `hint()` of any existing handler.
- Reordering prompts inside `PromptManager::runPrompts()`.
- Change to `TOTAL_RESPONSES` constant.
- Adding, removing or reordering prompts inside `PromptManager::runPrompts()`,
which also moves the progress denominator.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## Conditional Token System

Expand Down Expand Up @@ -130,6 +130,18 @@ Content removed if feature not selected

## Handler Development

### Ordering

`PromptManager::runPrompts()` is the catalogue of prompts: the `form()` chain
lists every prompt, in order, under its section heading. Add a new prompt
there, and the progress denominator follows automatically.

Processing runs in a different order, so each handler declares its own
`processWeight()` - lowest first, broadly the reverse of the prompt order so
that string replacements process more specific values before more generic
ones. It is declared on `HandlerInterface` with no default, so a new handler
does not compile until it states where it processes.

### Key Pattern

Handlers **queue** operations, PromptManager **executes**:
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/AiCodeInstructions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

class AiCodeInstructions extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 30;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/AssignAuthorPr.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

class AssignAuthorPr extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 60;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/CiProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ class CiProvider extends AbstractHandler {

const CIRCLECI = 'circleci';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 110;
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ class CodeCoverageProvider extends AbstractHandler {

const CODECOV = 'codecov';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 70;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/CodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ class CodeProvider extends AbstractHandler {

const OTHER = 'other';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 250;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/CustomModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ class CustomModules extends AbstractHandler {

const SEARCH = 'search';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 320;
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class DatabaseFetchSource extends AbstractHandler {

const NONE = 'none';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 160;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/DatabaseImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

class DatabaseImage extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 150;
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ class DependencyUpdatesProvider extends AbstractHandler {

const RENOVATEBOT_APP = 'renovatebot_app';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 80;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/DeployTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class DeployTypes extends AbstractHandler {

const WEBHOOK = 'webhook';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 190;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

class Domain extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 300;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

class Dotenv extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 10;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/FrontendBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
*/
class FrontendBuild extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 340;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/Gitleaks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
*/
class Gitleaks extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 90;
}

/**
* {@inheritdoc}
*/
Expand Down
12 changes: 12 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/HandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ public static function id(): string;
*/
public static function envName(): string;

/**
* Get the position of this handler in the processing chain.
*
* Handlers are processed from the lowest weight up, broadly in reverse of
* the order they are prompted in, so that string replacements process more
* specific values before more generic ones.
*
* @return int
* The weight.
*/
public static function processWeight(): int;

/**
* Get the prompt type for this handler.
*
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/HostingProjectName.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

class HostingProjectName extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 310;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/HostingProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class HostingProvider extends AbstractHandler {

const OTHER = 'other';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 200;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/Internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

class Internal extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 410;
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

class LabelMergeConflictsPr extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 50;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/MachineName.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

class MachineName extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 380;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

class Migration extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 140;
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class MigrationFetchSource extends AbstractHandler {

const S3 = 's3';

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 130;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/MigrationImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

class MigrationImage extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 120;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/ModulePrefix.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

class ModulePrefix extends AbstractHandler {

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 330;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 7 additions & 0 deletions .vortex/installer/src/Prompts/Handlers/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ class Modules extends AbstractHandler {
*/
protected const DEV_MODULES = ['devel', 'sdc_devel', 'generated_content', 'testmode', 'reroute_email'];

/**
* {@inheritdoc}
*/
public static function processWeight(): int {
return 260;
}

/**
* {@inheritdoc}
*/
Expand Down
Loading