Problem/Motivation

There's no way currently to specify files that shouldn't be copied over to the new theme without a custom implementation in StarterKit::postProcess. We should simplify this process for starterkit theme authors.

Steps to reproduce

Generate a new theme from a starter kit. Notice that all files are copied over.

Proposed resolution

Add a new function to the StarterKitInterface that returns an array files that should not be copied over.

This function can be called either right before or right after $generator_classname::postProcess($tmp_dir, $destination_theme, $info['name']); to get a list of files to delete from the $tmp_dir before copying all those files over to the final destination path.

Comments

andy-blum created an issue. See original summary.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andy-blum’s picture

Status: Active » Closed (duplicate)

Closing this as duplicate because we're adding this as part of #3364885: Allow themes to use a starterkit.yml file so it is easier to use the theme generator