Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for composer create-project #160

Open
AlexSkrypnyk opened this issue May 9, 2024 · 0 comments
Open

Add support for composer create-project #160

AlexSkrypnyk opened this issue May 9, 2024 · 0 comments
Assignees
Milestone

Comments

@AlexSkrypnyk
Copy link
Owner

AlexSkrypnyk commented May 9, 2024

We have implemented the shell installer script. But once starting to use it, it appeared that it is not that convenient as using a composer-way to use composer create-project.

We need to remove init.sh in favour of composer plugin.

The inspiration comes from https://github.com/g1a/starter/blob/main/customize/Customizer.php

What needs to be done:

  1. Update composer.json to be able to submit it to Packagist

       "name": "alexskrypnyk/drupal_extension_scaffold",
       "description": "Drupal extension scaffold.",
       "type": "project",
       "license": "GPL-2.0-or-later",
       "authors": [
           {
               "name": "Alex Skrypnyk",
               "email": "alex@drevops.com",
               "homepage": "https://github.com/AlexSkrypnyk",
               "role": "Maintainer"
           }
       ],
       "homepage": "https://github.com/AlexSkrypnyk/drupal_extension_scaffold",
       "support": {
           "issues": "https://github.com/AlexSkrypnyk/drupal_extension_scaffold/issues",
           "source": "https://github.com/AlexSkrypnyk/drupal_extension_scaffold"
       },
    

    Note that the original config will still be needed.

  2. Create Customizer.php class in .scaffold/Customizer.php as s copy from https://github.com/g1a/starter/blob/main/customize/Customizer.php and adjust as needed - update the namespace and add autoload.
    a. The class should be asking the same questions as init.sh (except for the last question about removal of the script - that should always happen without questions)
    b. The class should be updating the same files as init.sh
    c. The class should be removing itself and any autoload records about itself from composer.json.
    d. Class should be updating the fields in p1 above to their customized values.

  3. Remove init.sh and BATs from the project completely.

  4. Take test harness (test helpers etc and tests) from https://github.com/drevops/sandbox-multipackage/blob/main/scaffold/tests/ and adjust accordingly. Place it under .scaffold/tests/phpunit - it is super important to separate scaffold's code with the customizer's code and tests.

  5. Copy test https://github.com/drevops/sandbox-multipackage/blob/main/scaffold/tests/phpunit/Functional/ScaffoldCreateProjectTest.php and adjust accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants