Problem/Motivation

During the Q&A of the recipes presentation at DrupalCon Prague 2022, @mandclu pointed out the inconsistent syntax between the declaration of modules in the recipes.yml and how they are defined in a module's .info.yml file. Full syntax has become the norm, and recipes should follow suit.

There are further implications of this kind of disambiguation, especially as we move modules out of core for Drupal 10. Modules like CKEditor and forum will have both. Did you mean contrib's forum (forum:forum) or core's forum for Drupal 9.4 (drupal:forum)?

https://www.drupal.org/project/project_composer/issues/3309838

https://www.drupal.org/project/project_composer/issues/3304661

Proposed resolution

In the `install` key of the recipe.yml, module dependencies should be declared as `drupal:text` instead of just `text` and `easy_breadcrumb:easy_breadcrumb` instead of just `easy_breadcrumb`

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chrisfromredfin created an issue. See original summary.

_pratik_’s picture

Assigned: Unassigned » _pratik_
_pratik_’s picture

Assigned: _pratik_ » Unassigned

immaculatexavier made their first commit to this issue’s fork.

immaculatexavier’s picture

Status: Active » Needs review

Committed Commit1 , Commit2 in accordance to the proposed resolution

chrisfromredfin’s picture

There is much more work in this request than just adjusting the example recipe; that should be more clear. The recipe parser must of course also parse this format in the correct way. Also, of course we'd also need to update 'text' in the example recipe.

chrisfromredfin’s picture

Status: Needs review » Needs work

Marios Anagnostopoulos made their first commit to this issue’s fork.

alexpott made their first commit to this issue’s fork.

  • alexpott committed aa5af47 on 10.0.x
    Issue #3311111 by immaculatexavier, alexpott, Marios Anagnostopoulos,...
  • alexpott committed d7b3255 on 10.0.x
    Revert "Issue #3311111 by alexpott: Support modern syntax for defining...
alexpott’s picture

Status: Needs work » Fixed

This looks great. Thanks for fixing this.

nedjo’s picture

Version: 10.0.x-dev » 1.0.x-dev
Status: Fixed » Active

Needs to be fixed as well in the 1.0.x branch, in docs/recipe.md and docs/recipe_author_guide.md.

nedjo’s picture

And presumably we should also be using the "modern syntax" here?

config:
  import:
    field: *
    node: *
    taxonomy: *
alexpott’s picture

In the config section it’s machine names so it doesn’t really matter - but sure we should support it.

@nedjo good spots let’s do this in another issue. I’m not sure the modern syntax is really that modern or useful in this case but I do think we should support it for consistency.

alexpott’s picture

Status: Active » Fixed

Going to open follow-ups for #14 and #15 - let's leave this at fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.