Prompt users when adding new requirements with scaffolded assets

Created on 30 June 2019, almost 5 years ago
Updated 30 January 2023, over 1 year ago

Problem/Motivation

By default, the drupal/scaffold plugin will not scaffold files from a dependency unless it is whitelisted in the top-level composer.json file. This is done to avoid unexpected behavior or other problems with dependencies' behavior.

When a new dependency is added to a project (via composer require), and it contains assets that must be scaffolded, then a warning message is printed informing the user what must be done:

Package 'drupal/example-profile' has scaffold files. In order to function correctly, this project must be listed in the element 'extra.composer-scaffold.allowed-packages' in the root-level composer.json file.

The user must manually whitelist the dependency in order for it to be scaffolded.

Proposed resolution

The drupal/scaffold plugin could prompt the user and automatically add the dependency to the allowed packages.

Remaining tasks

1. At the moment, there are no projects that contain scaffold files. No action is needed here until some project (other than drupal/core) has files that need scaffolding.
2. Add patch to this issue implementing the prompt and automatic composer.json editing.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
ComposerΒ  β†’

Last updated about 21 hours ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States greg.1.anderson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot β†’ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide β†’ to find step-by-step guides for working with issues.

Production build 0.69.0 2024