Roots theme Child

I know that roots isn’t supposed to be used as a parent theme, but I want to include it in composer.

Should I just avoid adding it to my composer.json file all together, and just keep manually adding it and controlling it via git?

If you are going to use it as a parent theme, then it would be better to manage it through Composer. We don’t include a composer.json file in Roots because we don’t want to encourage its use as a parent theme, so you’ll just have to define your own repository for it.

I worded that incorrectly. I’m not going to include it as a parent theme, just as a normal theme that I mod to my client’s needs.

The main reason I wanted it in my composer.json file was to just be able to create project then get going without having to cd into web/app/themes && git clone roots && cd roots && git init.

I may be missing something still, but why not just include the theme as part of your project repo?

It looks like you’re using Bedrock and we suggest always including the theme with the main project repo. That’s why web/app/themes isn’t Git ignored while plugins are.

This is my thought behind including it in the main repo.

Say roots right now is at version 1.0 ( I know it’s not, just bare with me.)

I include it my composer.json, I run create-project - roots is included in my web/app/themes – great.

Later on, I include a new plugin, run composer update, but roots was updated to version 2.0.

Here is where my theme gets overwritten, or does it not?

Edit:/// I just manually declare the version don’t I? And this solves that worry I had.

By default in Bedrock, the themes directory is completely independent of Composer. Anything in there should be included in your project’s repo and not managed by Composer (unless you actually wanted a parent theme that you were never going to modify locally).

Adding any plugins through Composer and running composer install or composer update won’t touch the themes directory.

And regarding Roots’ versions, whatever version you download and put into your themes dir will be whatever it stays at forever unless you manually apply updates since it’s not a Git sub repo or a Composer package.

Okay, making sense now. My main question was there a way to make Composer install my theme, and be able to modify it without it updating.

But I’ll continue doing it the way I’ve been doing it, thank you.