Generated with the help of an LLM.

Problem/Motivation

Rivet's child-theme generator was implemented in 2023 while Drupal core's configurable starterkit API was still under development. See #3402867: Improve Drupal core starterkit integration for Rivet theme.

The finalized API was added in Drupal 10.3.0 by #3364885. It supports ignore, no_edit, no_rename, and info. The earlier delete key was removed before the API was committed.

Rivet still contains an obsolete placeholder:

delete: null

Rivet also performs overlapping work in rivet.starterkit.yml and src/StarterKit.php. Both alter the generated *.info.yml, while the PHP class maintains a deletion list based on the repository's 2023 layout.

The current behavior is not covered by an automated generation test. Code inspection also shows a potential problem: the post-processor deletes the generated src/ directory but retains the renamed *.theme file, which may refer to classes in the generated child namespace that no longer exist.

The README still documents core/scripts/drupal. Drupal 11.4 prefers vendor/bin/dr and deprecates the older entry point.

Steps to reproduce

  1. Install Rivet in a clean Drupal installation.
  2. Generate a child theme using the command appropriate for the installed Drupal version.

Drupal 11.4 or later:

vendor/bin/dr generate-theme \
  --name "Rivet Subtheme" \
  --path themes/custom \
  --starterkit rivet \
  rivet_subtheme

Earlier supported versions:

php core/scripts/drupal generate-theme \
  --name "Rivet Subtheme" \
  --path themes/custom \
  --starterkit rivet \
  rivet_subtheme
  1. Inspect the generated files and rivet_subtheme.info.yml.
  2. Check generated PHP for references to missing classes in the Drupal\rivet_subtheme namespace.
  3. Enable the generated theme, clear caches, and confirm that a page renders without errors.

Proposed resolution

  1. Decide whether Rivet can require Drupal 10.3 or later. If so, use:
    core_version_requirement: ^10.3 || ^11
    
  2. Replace the obsolete delete placeholder with a tested ignore configuration.
  3. Define the expected generated file set, including whether to retain the generated *.theme, configuration, logo, favicon, SCSS, and build files.
  4. Move the generated *.info.yml changes into the info section of rivet.starterkit.yml.
  5. Use no_edit to protect SUBTHEME.md from core's automatic name replacement.
  6. Reduce StarterKit::postProcess() to behavior that cannot be expressed in YAML, such as renaming and updating the generated README.
  7. Remove starterkit: true if support for Drupal versions before 10.3 is dropped.
  8. Add an automated test that generates, discovers, enables, and renders a page with a Rivet child theme.
  9. Update the documented commands for Drupal 11.4 and earlier supported releases.

The existing generator: starterkit_theme:10.1.2 value records the version from which Rivet itself was originally generated. Updating that baseline is outside the scope of this issue.

Remaining tasks

  • Decide the minimum supported Drupal version.
  • Define the expected generated file set.
  • Implement the supported rivet.starterkit.yml configuration.
  • Simplify the PHP post-processing.
  • Add automated generation and installation coverage.
  • Test against the minimum supported Drupal release and the current Drupal 11 release.
  • Update the README.
  • Review for Drupal coding standards.

User interface changes

Normalize multiword region labels to sentence case so Rivet and newly generated child themes use consistent administrator-facing names.

API changes

Rivet's developer-facing child-theme generation behavior will use Drupal core's supported starterkit configuration instead of the obsolete delete placeholder and duplicated PHP cleanup.

If the minimum supported version is raised, Rivet will require Drupal 10.3 or later.

The files included in newly generated child themes may change. Existing generated themes will not be modified.

Data model changes

None.

Issue fork rivet-3636630

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

jwilson3 created an issue. See original summary.

jwilson3’s picture

Assigned: Unassigned » jwilson3
jwilson3’s picture

Issue summary: View changes

  • jwilson3 committed a0b71f56 on 1.2.x
    Issue #3636630 by jwilson3: Modernize starterkit generation
    
jwilson3’s picture

Assigned: jwilson3 » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jwilson3’s picture

Released in 1.2.1

Status: Fixed » Closed (fixed)

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