Skip to content

Monorepo

This repository is the development monorepo of every opencolibri/starter-* package. Each package is split into its own read-only repository by the CI: issues and pull requests always go here.

src/
├── Core/ opencolibri/starter-core
│ ├── composer.json
│ ├── src/ OpenColibri\Starter\Core\
│ └── tests/
├── Plugins/ opencolibri/starter-plugins (+ resources/)
├── Themes/ opencolibri/starter-themes (+ resources/)
├── Menu/ opencolibri/starter-menu
├── Datasets/ opencolibri/starter-datasets (+ datasets/)
├── Import/ opencolibri/starter-import (+ resources/)
└── Upsun/ opencolibri/starter-upsun
tests/Integration/ cross-package tests
.castor/monorepo/ monorepo tooling (castor monorepo:*)

The composer.json of each package is the source of truth: the root composer.json (require, replace, autoload) is generated from them. Internal dependencies use self.version so all packages are always released together.

TaskWhat it does
castor monorepo:packages [--json]Lists the packages (--json is used to build the CI matrix)
castor monorepo:mergeRegenerates the root composer.json from the packages
castor monorepo:validateChecks package metadata, internal dependencies and the root composer.json
castor monorepo:split [<package>...]Splits packages with splitsh-lite (dry-run without --push)
Terminal window
castor monorepo:split # dry-run, prints the split SHA of every package
castor monorepo:split core themes --push # push the current branch of two packages
castor monorepo:split --ref=refs/tags/v0.1.0 --push

The remote of each package defaults to git@github.com:{repository}.git ({repository} = opencolibri/starter-core, {name} = opencolibri/starter-core, {short} = core); override it with --remote-pattern or the SPLIT_REMOTE_PATTERN environment variable.

  1. Create src/<Name>/ with composer.json (name opencolibri/starter-<name>, OpenColibri\Starter\<Name>\ PSR-4 autoload on src/, "opencolibri/starter-core": "self.version"), a README.md and a LICENSE.
  2. Register its tasks from an autoloaded src/functions.php with TaskProviderRegistry::register().
  3. Run castor monorepo:merge, then castor monorepo:validate and composer dump-autoload.