Create-project with bedrock fork that has roots theme included

I was hoping to use bedrock and composer’s create-project to get a new Wordpress instance created with the roots theme already included. The process seems to work smoothly, but the theme isn’t included when I run create-project. Here’s what I have done.

  • Created fork of roots/bedrock
  • Modified the roots theme for my needs
  • Included it in my fork, then checked it in (Verified the theme is included in the repo)
  • Used satis to create a local packagist instance
  • Ran composer create-project (completed successfully using my local packagist instance)

This is my satis.json used to create my local repo

{
    "name": "My Private Repo",
    "homepage": "http://packagist.local",
    "repositories": [
        { "type": "vcs", "url": "https://github.com/rankhammer/bedrock"}
    ],
    "require": {
        "rankhammer/bedrock": "*"
    }
}

And I ran this

php composer.phar create-project rankhammer/bedrock rankhammer --repository-url=http://packagist.local

Essentially, web/app/themes/roots is missing after I run the above command, even though it’s in the above git repo. What am I missing? Do I have to install the theme separately? If so, what do I need to do to make the roots theme be included automatically when running create-project on my fork?

For instance, I created a composer.json here

Then I updated my satis and generated a new local repo

{
	"name": "My Private Repo",
	"homepage": "http://packagist.local",
    "repositories": [
        { "type": "vcs", "url": "https://github.com/rankhammer/bedrock"},
		{ "type": "vcs", "url": "https://github.com/rankhammer/roots"}
    ],
    "require-all": true
}

The I added my local repo to the bedrock composer, and had it require the forked roots theme.

When I run composer create-project rankhammer/bedrock, Everything works fine, except it doesn’t even try to install the rankhammer/roots. Does everything else though.

Apparently I over complicated it, and I can just add the repository like this to the bedrock fork:

{
      "type": "vcs",
      "url": "git://github.com/rankhammer/roots.git"
    }

But it installed it in themes/rankhammer/roots. I will figure out how I messed that config up. Anyways, I’m still curious on why my original try didn’t work.

I was pretty sure what the problem was but tested this out myself to confirm.

The problem is that you were just running the create-project command for rankhammer/bedrock WITHOUT specifying a version. By default Composer will use the latest tagged version which is 1.3.2.

But since you’re using a fork, your commits including Roots are just on master.

So run:

php composer.phar create-project rankhammer/bedrock rankhammer dev-master --repository-url=http://packagist.local

dev-master is the keyword here and it will all be good :slight_smile:

1 Like

Thank you! I’ll try this out tomorrow. Just to confirm, the process was working, and was creating a new project, but just wasn’t including my theme that I had bundled with bedrock. I realized that’s not a good idea so I put my forked roots theme in a separate repo.

There’s nothing wrong with “bundling” a theme with Bedrock. That’s the entire point of Bedrock basically. It’s just meant as a starting point for a project which usually includes a theme right in the repo.

What you were doing is fine, and great that you got your own Satis repo up and running, the only issue was you were basically using a commit before the Roots theme was included.

Gotcha. All makes sense now. Appreciate the help.