Skip to content

Record a version number in composer.json when Drupal is installed #113

@phenaproxima

Description

@phenaproxima

We're done with the Electron side of auto-updates! 🎉

This is not a 1.0.0 blocker, but I'd really love if we also had a way to make updates to the Drupal project itself; there are cases where we make changes in Drupal CMS that have to be done by the site owner at the command line. The target audience for the launcher (and more broadly, Drupal CMS itself) is people who don't know how to use a command line. So the launcher needs a way to make those sorts of changes on their behalf.

I outlined a design for how to do this in #97. Let's implement the first step: after installation, we need to record a version number in composer.json.

The easiest way to do this is to run composer config extra.drupal-launcher --merge --json '{"version": 1}' --working-dir=PROJECT_ROOT

So let's implement that in installer.ts, after all the other installation tasks are done. You can follow the existing pattern of how runComposer() is called. It'll look something like await runComposer(['config', 'extra.drupal-launcher', ...]);

How to tell it works: if you run yarn run start and let it set up Drupal anew (be sure to delete ~/Documents/drupal first), and look at composer.json, you should see this in there somewhere:

"extra": {
  "drupal-launcher": {
    "version": 1
  }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions