This is essentially a front-end subset of the functionality provided by #3067154: Add property to platforms "composer_install_command" to allow each platform to decide what composer install options to use., to determine whether or not users want to include development modules in their platform.

By default, we get this:

composer install --no-interaction --no-progress --no-dev

However, on Dev environments, the following would be more helpful:

composer install --no-interaction --no-progress

This would allow (for example) the Devel module to be included in the platform, which you would want on Dev, but not on Prod (the default).

So let's add a checkbox on the Create Platform form that allows for this option on the front-end:

  • Include development modules?

Help text can be something like,

If you're using Composer to build sites, and you'd like to include the development modules listed in the require-dev section of composer.json (e.g. Devel), check this box. This will have no effect on non-Composer-based sites.

Comments

colan created an issue. See original summary.

philosurfer’s picture

++

philosurfer’s picture

I think from a holistic product approach, we should have a "Development" flag for platforms.

That dev flag would have global options for "dev" platforms.

Options would/could be:
- install composer dev dependencies
- run dev specific pre and post hooks for platform and site installs.
- force sanitization on migrations to a dev platform
- force .htaccess logins to prevent crawlers from indexing sites.

colan’s picture

Those are great ideas. I like where this is going so maybe the IS is a good place to start.

For the sanitization, there's already an issue for that at #2961506: Add option to sanitize DB after import.

Jon Pugh’s picture

If the "Composer install command" property is added with an editable field, then adding an additional checkbox just for "--dev/--no-dev" would make it a difficult user experience and hard to code up: What would you do to the "composer install command" if the box is checked? Just append "--no-dev" to it? Would not checking the box remove any mentions of "--no-dev" in the composer install command field?

colan’s picture

It would change the default command to not include `--no-dev`. We wouldn't make the command editable; that would lead to too many security (and other) issues.

colan’s picture