Problem/Motivation

While setting up the Governor theme to be used as a starterkit, the command is throwing an error:

[ERROR] Paths were defined "no_edit" but no files found.

Steps to reproduce

1. Clone “The Governor” theme in the “web/themes/custom/” folder. (This step will be replaced by composer require in the future.)

2. Run the generate-theme command from the root the project:

php web/core/scripts/drupal generate-theme my_new_theme --name "My New Theme" --description "Custom theme generated from The Governor" --path "themes/custom" --starterkit=governor

CommentFileSizeAuthor
#4 after_patch.png28.85 KBshamir.vs
#4 before_patch.png30.62 KBshamir.vs

Issue fork governor-3480631

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

nikitaaswani created an issue. See original summary.

nikitaaswani’s picture

Assigned: nikitaaswani » Unassigned
Status: Active » Needs review
shamir.vs’s picture

Version: 1.0.0-alpha1 » 1.0.x-dev
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new30.62 KB
new28.85 KB

Thank you, @nikitaaswani, for the work. I have applied the patch, and the issue has been resolved. Attaching screenshots of the before and after results.

Before applying the patch
Before Patch

After applying the patch

After Patch

spicy.werewolf’s picture

Nice! One thing I'd like to do is to follow core starterkit and leave the keys in the starterkit.yml file:

no_edit: []
no_rename: []

While strictly speaking this issue is to resolve the missing file error, and the generate script seems to run with no overt errors, there are a couple of issues with the generated MY_NEW_THEME.info.yml file that surface in code testing that I want to document here. There is currently an open issue for PHPCS errors that are surfacing after the generate script is run: https://www.drupal.org/project/governor/issues/3401702
however these issues are starting to overlap each other.

drupal_sandbox > code-review:

     [echo] $> vendor/bin/phpcs
     [exec] ...............................W.. 34 / 34 (100%)
     [exec] 
     [exec] 
     [exec] 
     [exec] FILE: /var/www/html/docroot/themes/custom/gov_theme_test/gov_theme_test.info.yml
     [exec] -----------------------------------------------------------------------------------------------------------
     [exec] FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
     [exec] -----------------------------------------------------------------------------------------------------------
     [exec]  1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
     [exec]  1 | WARNING | "Description" should not be empty
     [exec] -----------------------------------------------------------------------------------------------------------
     [exec] 
     [exec] Time: 61ms; Memory: 6MB
     [exec] 

Adding a placeholder description is easy enough to do. We can just add it to the "info" in governor.starterkit.yml Something like:

info:
  hidden: null
  starterkit: null
  version: 1.0.0
  description: Generated by the Governor starterkit. Please update for your specific project.

For the "version" warning, it appears we may need to some additional configuration to remove the line from the info file.

name: gov_theme_test
description: 'Generated by the Governor starterkit. Please update for your specific project.'
type: theme
core_version_requirement: ^11
version: 1.0.0 <== Needed in governor.info.yml.  but Drupal check PHPCS will throw an error if it's not it removed from the generated file.)
...
generator: 'governor:1.0.0' <== Auto-generated when the script runs. This is what Drupal check wants to see. 
spicy.werewolf’s picture

Update: the "Version" warning appears to be a core bug. See: https://www.drupal.org/project/governor/issues/3401702#comment-16359121

spicy.werewolf’s picture

Status: Reviewed & tested by the community » 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.

Status: Fixed » Closed (fixed)

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