statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.09k stars 534 forks source link

[5.x] Add folder based starter kit modules #11104

Open jesseleite opened 1 week ago

jesseleite commented 1 week ago

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!?'
    import: '@config'  # import from modules/seo/module.yaml
  js:
    prompt: 'Would you care for some JS?'
    skip_option: 'No, thank you!'
    options:
      vue:
        label: 'VueJS'
        import: '@config'  # import from modules/js/vue/module.yaml
      react:
        label: 'ReactJS'
        import: '@config'  # import from modules/js/react/module.yaml

Ultimately, 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: