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 folder based starter kit modules #11104

Draft
wants to merge 18 commits into
base: 5.x
Choose a base branch
from

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Nov 11, 2024

This PR adds folder based starter kit modules.

For example, you can extract a whole module config to a folder...

modules:
  seo: '@import'  # import from modules/seo/module.yaml
  js:
    options:
      vue: '@import'  # import from modules/js/vue/module.yaml
      react: '@import'  # import from modules/js/react/module.yaml

Or control prompt flow config in your starter-kit.yaml, but import the rest from a module folder...

modules:
  seo:
    prompt: 'Would you like some awesome SEO with that!?'
    # implicitly imports from modules/seo/module.yaml
  js:
    prompt: 'Would you care for some JS?'
    skip_option: 'No, thank you!'
    options:
      vue:
        label: 'VueJS'
        # implicitly imports from modules/js/vue/module.yaml
      react:
        label: 'ReactJS'
        # implicitly imports from modules/js/react/module.yaml

The installer will implicitly attempt to import from a module.yaml config within your modules folder, again following the same hierarchy defined in your parent starter-kit.yaml config. These configs are merged when imported, with the parent config taking precedence.

I've also separated out module instantiation logic from the installer's prompt & filtering logic, for the purpose of some dev helper commands that @JohnathonKoster and I might be working on together 👀, to make flipping between modules during testing an easier thing 😎

Todo:

  • Separate out instantiation from prompting & filtering and provide flatten() & installableFiles() helpers
  • Add support for folder based modules
    • To installer
    • To exporter
  • Add test coverage
    • To installer
    • To exporter
  • Docs PR Starter kit modules updates docs#1541

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.

1 participant