Problem/Motivation

To create a Composer-based site from a template, the Composer Project Template README advises:

composer -n create-project drupal/recommended-project:^8.8 my-project

This does not work today, because there is no stable release of Drupal 8.8. This command would work if the version constraint were changed to ^8.8@dev. A simpler version of the same command would also work with the addition of a minimum stability specification:

composer -n create-project -s dev drupal/recommended-project my-project

Once there is a stable release of Drupal 8.8.0, the above command will continue to create the 8.8.x-dev version of drupal/recommended-project. However, since that project includes a "prefer-source": "true" directive, the dev version of drupal/recommended-project will install a stable version of drupal/core. This might not be what the user expects, but it would be awkward to remove prefer-source from dev versions of drupal/recommended-project, since it is produced from a subtree split.

Proposed resolution

We should update the documentation to include -s dev, so that the create-project command will work.

As a follow-on task, we should add documentation on how to install a dev version of drupal/core by running composer require as a second step after composer create-project. There is no point in adding this documentation until there is a stable release of 8.8.0, as it offers no benefit and might cause confusion before then.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

n/a

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greg.1.anderson created an issue. See original summary.

greg.1.anderson’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
504 bytes

Update issue summary and add patch to fix command in documentation.

greg.1.anderson’s picture

Title: Temporarily change Composer Project Template documentation to use ^8.8@dev » Add '-s dev' to Composer Project Template documentation so instructions work w/out a stable release
Issue summary: View changes
hussainweb’s picture

@greg.1.anderson, how about adding a brief description which explains why this is needed and it can be removed later. Something like this:

The `-s dev` is required for now. Once Drupal 8.8 is released, the `-s dev` flag may be dropped.

greg.1.anderson’s picture

@hussainweb: I did consider that, but the information does not seem to be very important. It saves a few characters of typing, but we can just remove the description once there is a stable release (see follow-up issue). There isn't any real negative impact if folks keep using -s dev, because you'll still get a stable release of drupal/core (if available).

hussainweb’s picture

Status: Needs review » Reviewed & tested by the community

because you'll still get a stable release of drupal/core (if available)

Ah, that's right. In that case, this LGTM.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

I am a huge fan of working documentation! ;)

Confirmed:

$ composer -n create-project drupal/recommended-project:^8.8 my-project

                                                                        
  [InvalidArgumentException]                                            
  Could not find package drupal/recommended-project with version ^8.8.  
                                                                        

But when I do the new version:

$ composer -n -s dev create-project drupal/recommended-project my-project

                                                                  
  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "dev" is not defined.                                   
                                           

...whoops! ;)

greg.1.anderson’s picture

Argh I did this hundreds of times (yes, I exaggerate), and then I make a cut-copy-pasta error.

Here's a better version.

greg.1.anderson’s picture

Status: Needs work » Needs review
larowlan’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome! Confirmed the new instructions work great. SUCH EXCITEMENT to see the Composer stuff coming together!

Committed and pushed to 8.8.x. Thanks!

  • webchick committed d649730 on 8.8.x
    Issue #3085075 by greg.1.anderson: Add '-s dev' to Composer Project...
greg.1.anderson’s picture

Issue summary: View changes

Retroactively update issue summary to match what was committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.