Make bedrock a meta-package by extracting files into separate package

Open
#533 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php, wordpress
Domain
tooling, web-dev

Research direction

Review the existing config and web folders and how composer create-project, install, and update currently handle them. Compare the proposed bedrockfiles package approach with the repository's current dependency setup. Done means a newly created project can retrieve those files through dependencies without adding them to the project's version control.

Written by the indexing model from the issue text.

Description

Summary

By extracting the content of the config as well as the web folder into a separate package (i.e. bedrockfiles) that this package then requires, this package could be used to create a project but the files that currently then need to be added to version control of the newly created project could still then be handled as dependencies.

Motivation

Curently after calling composer create-project roots/bedrock I will have to add the files within the config-folder as well as the files within the web-folder to my version control. But those actually aren't files I need to or should edit. Usually those files are dependencies of my project that I don't want to (and probably shouldn't) edit. Why should I add them to my version-control then? Especially when one of the great advantages of bedrock is, that I don't need to add files to my version control that do not belong there.

But when I currently do exactly that (not adding them to VersionControl) I will not be able to retrieve a working installation using composer install as those few files are missing.

By extracting them to a separate package I would still have them installed on composer create-project but I would also get them installed on calling composer install. And a omposer update` would even update the files to the latest version.

Additional context

My main idea is to have a fully working WordPress with the least possible number of files. So for me the unique part of any WordPress installation usually is composer.json and composer.lock which contains all the plugins and WordPress as dependencies and then there is the theme folder. If the theme is a child theme, the parent theme is also a dependency within composer.json. Additionally there are some files for a docker-setup that usually are project specific (like the database-dump for dev and stage and such things). I'm currently thinking about moving them to a package as well.

This allows me to do the following to have a new (development) system up and running within seconds:

composer install
docker-compose up -d

OK: Perhaps in between one should copy the .env.dist to .env...

Dominant language
PHP
Stars
6.6k
Forks
1.2k
Avg merge
2h 15m
Merged PRs (30d)
1

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from roots/bedrock

All issues in roots/bedrock

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.