Composer Updates
bd-viget opened this issue · 2 comments
Summary
There are a few things that need to be addressed to optimize the composer create-project
command.
Items to Address
- Is there a way to require directory specification when running
composer create-project
? (i.e.composer create-project viget/wordpress-site-starter .
) - Fix Post Install Error: Insufficient permission to create directory '/Users/briandichiara/Sites/_projects/sample-project/'. "Failed to run
wp core download
". (confirmddev
is running this command, use Container relative path) - Maybe check to be sure
ddev
is installed. - Add postCreateProject code to remove
composer/composer
dependency fromrequire-dev
- Add postCreateProject code to remove
symfony/console
dependency fromrequire-dev
- Delete the
bin/composer-scripts/ProjectEvents/PostCreateProjectScript.php
file. - Delete the
bin/composer-scripts/ProjectEvents/PreInstallScript.php
file. - Delete the
"post-create-project-cmd"
object from"scripts"
incomposer.json
- Delete the
"pre-install-cmd"
object from"scripts"
incomposer.json
- Update the Repo README to document using
composer create-project
- Maybe add a 2nd Project README for new projects and replace the
wordpress-site-starter
README duringPostCreateProject
. - Maybe add a "repositories/vcs" entry to
composer.json
for testingcreate-project
locally. - Also, don't forget to delete this onPostCreateProject
Is there a way to require directory specification when running composer create-project? (i.e. composer create-project viget/wordpress-site-starter .)
It is possible... I'm actually doing that as part of my starter script so it puts it in the root of your current directory.
Maybe add a "repositories/vcs" entry to composer.json for testing create-project locally. - Also, don't forget to delete this on PostCreateProject
Not sure if this is what you mean... but you can call composer-create from a git repo (without publishing on Packagist).
I've used that to try things out without tagging a release.
You can tack this on the end.
composer create-project viget/wordpress-site-starter --repository="{\"url\": \"https://github.com/joshuapease/craft-starter-2\", \"type\": \"vcs\"}" --stability=dev --remove-vcs
@joshuapease Thanks for the tips!
It is possible... I'm actually doing that as part of my starter script so it puts it in the root of your current directory.
This is what I was planning on adding in the Github repo, I was just wondering if there was some way to force it so you couldn't call composer create-project viget/wordpress-site-starter
without specifying a directory (like it hits some kind of validation error). I guess it's no big deal if they create a project and it goes into a folder called wordpress-site-starter
, but because we're running all the scripts to set up ddev
and such, it might be a bit of a hassle to move the project or rename the folder once it's created.