Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Conversation

titouanmathis
Copy link
Collaborator

@titouanmathis titouanmathis commented Jun 15, 2022

This PR drops usage of SAO to scaffold a new project and replace it with support for the composer create-project studiometa/wordpress/project <project-name> command.

Benefits:

  • Auto-update of Composer and NPM dependencies with Depfu
  • More tasks are automated, creating a project is faster
  • Easier to update existing projects

This feature can be tested locally by creating a packages.json file:

{
    "packages": {
        "studiometa/create-wordpress-project": {
            "dev-master": {
                "name": "studiometa/create-wordpress-project",
                "version": "0.0.0",
                "dist": {
                    "url": "https://github.com/studiometa/create-wordpress-project/archive/refs/heads/feature/composer-create-project.zip",
                    "type": "zip"
                }
            }
        }
    }
}

And then running the following command:

composer create-project --repository=packages.json studiometa/create-wordpress-project <project-name>

The global PHP version must be set to PHP 7.3 for this command to work, you can also specify a custom PHP version:

php73 $(which composer) create-project --repository=packages.json studiometa/create-wordpress-project <project-name>

Once the project created, you only have to go in the created directory and start ddev:

cd <project-name>
ddev start

Changelog

Added

  • Add a default ddev configuration

Removed

  • Remove prompt to customize the project's configuration
    The default values should be considered as sane defaults ; the project's name is the name of the folder in which the project is create

Changed

To do

  • Complete the changelog
  • Add more explanation on how this work

@titouanmathis titouanmathis force-pushed the feature/composer-create-project branch from c52e59a to 065b529 Compare June 15, 2022 15:31
@titouanmathis titouanmathis self-assigned this Jun 15, 2022
Copy link
Contributor

@perruche perruche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀


## Installation


Cloner le dépôt :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improvement add the new way to kickstart the project composer create-project ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that this README.md file will be the one used for the project, it should not contain instructions on how to create a project. Or maybe they could be removed on creation to avoid any confusion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another idea would be to migrate the new structure to the studiometa/wordpress-project repository and to keep this repository as documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of replacing the README after install. Kind of what we do with .env.example or wp-config-sample ?

);

runCommands(
'Initialize Git repository',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: I don't think it's the role of this package to initialize git. Maybe we would like to create a project without git (only to test a feature locally). Moreover, it really depends on user access on repository.

suggestion: Maybe this script should be run in a manually separated script based on arguments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: I don't think it's the role of this package to initialize git. Maybe we would like to create a project without git (only to test a feature locally). Moreover, it really depends on user access on repository.

I think that initializing Git is not out of scope for this repository. We can still create test projects locally with Git, it should not have an impact on a test.

I can remove adding the origin as it is the action that could change between projects.

suggestion: Maybe this script should be run in a manually separated script based on arguments.

We might as well just do a git init command 😉

@titouanmathis titouanmathis force-pushed the feature/composer-create-project branch from 0591504 to 8c418a0 Compare September 21, 2022 12:51
titouanmathis added a commit to studiometa/wordpress-project that referenced this pull request Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants