Download the PHP package symplify/monorepo-builder without Composer
On this page you can find all versions of the php package symplify/monorepo-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symplify/monorepo-builder
More information about symplify/monorepo-builder
Files in symplify/monorepo-builder
Package monorepo-builder
Short Description Not only Composer tools to build a Monorepo.
License MIT
Informations about the package monorepo-builder
Not only Composer tools to build a Monorepo
Do you maintain a monorepo with multiple packages?
This package has few useful tools, that will make that easier.
Install
Requirements:
- PHP 8.2 or higher (for version 12.x)
For older PHP versions:
- Use version 11.x (no longer maintained)
Usage
1. Are you New to Monorepo?
If you're new to monorepos, you can start with a basic setup using our initialization command:
This creates a basic monorepo structure with the necessary configuration files.
2. Merge local composer.json
to the Root One
Merges configured sections to the root composer.json
, so you can only edit composer.json
of particular packages and let script to synchronize it.
Sections that will be merged from packages to root:
require
- Dependencies needed by packagesrequire-dev
- Development dependenciesautoload
- PSR-4 autoloading configurationautoload-dev
- Development autoloading configurationrepositories
- Package repositoriesextra
- Extra configuration dataprovide
- Virtual packages providedauthors
- Package authors informationminimum-stability
- Minimum package stabilityprefer-stable
- Prefer stable packagesreplace
- Packages replaced by this one
To merge run:
3. Bump Package Inter-dependencies
Let's say you release symplify/symplify
4.0 and you need package to depend on version ^4.0
for each other:
4. Keep Synchronized Package Version
In synchronized monorepo, it's common to use same package version to prevent bugs and WTFs. So if one of your package uses symfony/console
3.4 and the other symfony/console
4.1, this will tell you:
5. Keep Package Alias Up-To-Date
You can see this even if there is already version 3.0 out:
Not good. Get rid of this manual work and add this command to your release workflow:
This will add alias 3.1-dev
to composer.json
in each package.
If you prefer 3.1.x-dev
over default 3.1-dev
, you can configure it:
6. Split Directories to Git Repositories
You can split packages from your monorepo into separate repositories using GitHub Actions. Use symplify/github-action-monorepo-split for this purpose.
For configuration examples, you can refer to the GitHub Action workflow documentation.
7. Release Flow
When a new version of your package is released, you have to do many manual steps:
- bump mutual dependencies,
- tag this version,
git push
with tag,- change
CHANGELOG.md
title Unreleased tov<version> - Y-m-d
format - bump alias and mutual dependencies to next version alias
But what if you forget one or do it in wrong order? Everything will crash!
The release
command will make you safe:
And add the following release workers to your monorepo-builder.php
:
These TagVersionReleaseWorker
and PushTagReleaseWorker
are enabled by default.
If you want to disable these default workers, you can use the following code.
You can also include your own workers. Just add services that implements ReleaseWorkerInterface
.
Are you afraid to tag and push? Use --dry-run
to see only descriptions:
Do you want to release next patch version, e.g. current v0.7.1
→ next v0.7.2
?
You can use minor
and major
too.
Available Commands
Here are all available commands you can use with monorepo-builder:
init
- Creates empty monorepo directory and composer.json structuremerge
- Merge "composer.json" from all found packages to root onebump-interdependency
- Bump dependency of split packages on each othervalidate
- Validates synchronized versions in "composer.json" in all found packagespackage-alias
- Updates branch alias in "composer.json" all found packagespropagate
- Propagate versions from root "composer.json" to all packages, the opposite of "merge" commandlocalize-composer-paths
- Set mutual package paths to local packages - use for pre-split package testingrelease
- Perform release process with set Release Workers
To see detailed help for any command, run:
All versions of monorepo-builder with dependencies
nette/utils Version ^4.0.5
phar-io/version Version ^3.2
sebastian/diff Version ^6.0 || ^7.0
symfony/config Version ^7.0
symfony/console Version ^7.0
symfony/dependency-injection Version ^7.0
symfony/filesystem Version ^7.0
symfony/finder Version ^7.0
symfony/http-kernel Version ^7.0
symfony/process Version ^7.0
webmozart/assert Version ^1.11