Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Add default config for select starter kit modules #11045

Merged
merged 9 commits into from
Nov 26, 2024

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Nov 2, 2024

This PR adds a default config, to help with module installation flow when spamming the enter key, or when running non-interactively. More specifically...

For standard confirmation-style modules (where user selects yes/no):

  • default: true will ensure it gets installed when spamming enter or running non-interactively
  • prompt: false will skip the confirmation prompt altogether, forcing the module to be installed

For select-style modules with options (where user selects A or B or C):

  • default: antlers will ensure the antlers modules gets installed when spamming enter or running non-interactively
  • skip_option: false will disable the option to skip the prompt altogether
    • if runing interactively, this forces the user to select an option
    • if running non-interactively, the default option will be installed

Examples...

modules:
  seo:
    default: true  # this still allows user to opt out, but defaults 'yes' when spamming enter or running non-interactively
    dependencies:
      - statamic/seo-pro
  js:
    default: mootools  # this will ensure the mootools module option gets installed if run non-interactively
    skip_option: false  # you can specify string for skip option label, or `false` to force user to select an option
    options:
      vue:
        label: 'VueJS'
        export_paths:
          - resources/js/vue.js
      react:
        label: 'ReactJS'
        export_paths:
          - resources/js/react.js
      mootools:
        label: 'MooTools (will never die!)'
        export_paths:
          - resources/js/mootools.js

TODO:

@jesseleite jesseleite marked this pull request as draft November 2, 2024 22:30
@jesseleite jesseleite changed the title Add default config for select starter kit modules [5.x] Add default config for select starter kit modules Nov 2, 2024
@jesseleite jesseleite marked this pull request as ready for review November 11, 2024 15:29
Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

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

I tried this with a test starter kit and it seems that on a standard module step, default: true doesn't work. It still defaults to no.

CleanShot 2024-11-25 at 17 22 33

The default value does seem to work on a multiple choice prompt, though.

@jasonvarga jasonvarga merged commit a29ea36 into 5.x Nov 26, 2024
17 checks passed
@jasonvarga jasonvarga deleted the starter-kits-select-module-default-option branch November 26, 2024 20:01
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