Skip to content

Base the install command on package-tools' InstallCommand - #54

Merged
imanimanyara merged 1 commit into
mainfrom
install-command-package-tools-base
Oct 5, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
install-command-package-tools-base

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Owner decision 6 ("traits"), following laranail/captcha#24.

laranail::authkit-preset.install now extends laranail/package-tools' InstallCommand and keeps laranail/console's display API and run lifecycle by using its InteractsWithConsoleServices and InteractsWithConsoleWriter traits. No new dependency direction: both packages were already required.

  • Signature and description moved to SIGNATURE / DESCRIPTION constants; the constructor takes the Package, passes hidden: false (the command was listed before and still is), restores the description, and boots console support eagerly.
  • The provider binds the command in packageRegistered(), since the container cannot autowire Package; it stays registered by class name.
  • The private helpers publish() and publishMigrations() are renamed publishTag() and publishMigrationOnce(), because the new base declares public fluent methods with those names. They are private, so nothing outside the class could call them.
  • The class stays non-final, as it was.

tests/Feature/InstallCommandContractTest.php was written first and run against the old base: the behaviour assertions (name, no aliases, description, listed, all 11 options and their value modes, no arguments, exit 1 with its message for an unsupported stack and for an unknown --model, container resolution) passed, and the inheritance assertion failed. All of them pass now. Full suite: 85 passed locally.

Owner decision 6: subclass laranail/package-tools' InstallCommand and keep laranail/console's display API through its two traits, so neither package depends on the other. A contract test pins the name, options, description, visibility, output and exit codes against the old base. The private publish helpers are renamed because the new base declares public methods of the same names.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@imanimanyara
imanimanyara merged commit e179c78 into main Oct 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants