Problem/Motivation

Composer is fixed to docroot folder and should use web-root such as core composer to let use this project into custom folder.

Steps to reproduce

Having issues with custom composer build with Vardoc profile conflicting with changes over Vardoc Project template
When changed in projects, composer will face issues on builds and updates

Proposed resolution

1. Double-check what Drupal Recommended Project
https://github.com/drupal/recommended-project/blob/9.4.5/composer.json#L43
2. Check Acquia Drupal Recommended Project
https://github.com/acquia/drupal-recommended-project/blob/1.11.19/compos...

3. Use the right web-root in both Vardoc profile and Vardoc Project template

    "drupal-scaffold": {
      "allowed-packages": [
        "drupal/core",
        "vardot/varbase",
        "vardot/vardoc"
      ],
      "gitignore": true,
      "locations": {
        "web-root": "./docroot"
      },
      "file-mapping": {
        "[web-root]/sites/default/default.services.yml": {
          "mode": "replace",
          "overwrite": false,
          "path": "docroot/core/assets/scaffold/files/default.services.yml"
        },
        "[web-root]/sites/default/default.settings.php": {
          "mode": "replace",
          "overwrite": false,
          "path": "docroot/core/assets/scaffold/files/default.settings.php"
        },
        "[web-root]/robots.txt": {
          "append": "docroot/profiles/varbase/src/assets/varbase-robots-additions.txt"
        }
      }
    },

Projects could change "web-root": "docroot/" and docroot to web using change or a clone of the Vardoc Project Template
Have drupal-scaffold locations web-root for Vardoc Project template as docroot to fix composer web-root folder in projects #41

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Vardoc core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release vardoc-4.0.6, Vardoc 5.0.0-alpha6

Vardoc update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3301450 by vacho: Have drupal-scaffold locations web-root as docroot to fix composer web-root folder in projects

Issue fork vardoc-3301450

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

vacho created an issue. See original summary.

rajab natshah’s picture

    "drupal-scaffold": {
      "locations": {
        "web-root": "docroot/"
      }
    },

Should be added too

rajab natshah’s picture

Title: Composer is fixed to docroot folder » Have drupal-scaffold locations web-root as docroot to fix composer web-root folder in projects

  • Rajab Natshah committed 99e7447 on 5.0.x
    Issue #3301450: Have drupal-scaffold locations web-root as docroot  to...
rajab natshah’s picture

After double checking what Drupal Recommended Project is doing
https://github.com/drupal/recommended-project/blob/9.4.5/composer.json#L43

Reverting other changes
Only keeping the

        "drupal-scaffold": {
            "locations": {
                "web-root": "docroot/"
            }
        },

Projects could change "web-root": "docroot/" and docroot to web using change or a clone of the Vardoc Project Template

  • Rajab Natshah committed 7bd75cf on 5.0.x
    Issue #3301450: Have drupal-scaffold locations web-root as docroot  to...
rajab natshah’s picture

Title: Have drupal-scaffold locations web-root as docroot to fix composer web-root folder in projects » Have drupal-scaffold locations web-root for Vardoc as docroot to fix composer web-root folder in projects
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +vardoc-4.0.6, +vardoc-5.0.0-alpha6
rajab natshah’s picture

Issue summary: View changes

  • Rajab Natshah committed 263702d on 5.0.x
    Issue #3301450: Have drupal-scaffold locations web-root for Vardoc as...

  • Rajab Natshah committed 583a8be on 4.0.x
    Issue #3301450: Have drupal-scaffold locations web-root for Vardoc as...
rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem

Restricting the use of changing files only to Drupal core and Varbase Profile

    "drupal-scaffold": {
      "allowed-packages": [
        "drupal/core",
        "vardot/varbase",
        "vardot/vardoc"
      ],

Not to let any package or module use the Drupal Scaffold to do any changes to Drupal files.
If a package was selected to do any change to files it should be listed in the Allowed Packages list.

rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

rajab natshah’s picture

Issue summary: View changes

✅ Released vardoc-4.0.6

rajab natshah’s picture

Issue summary: View changes

✅ Released Vardoc 5.0.0-alpha6

rajab natshah’s picture

Status: Fixed » Closed (fixed)