Monorepo
This repository is the development monorepo of every sylius-starter/* package. Each package is split into its own
read-only repository by the CI: issues and pull requests always go here.
Layout
Section titled “Layout”src/├── Core/ sylius-starter/core│ ├── composer.json│ ├── src/ SyliusStarter\Core\│ └── tests/├── Plugins/ sylius-starter/plugins (+ resources/)├── Themes/ sylius-starter/themes (+ resources/)├── Menu/ sylius-starter/menu├── Datasets/ sylius-starter/datasets (+ datasets/)├── Import/ sylius-starter/import (+ resources/)└── Upsun/ sylius-starter/upsuntests/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.
Monorepo tasks
Section titled “Monorepo tasks”| Task | What it does |
|---|---|
castor monorepo:packages [--json] | Lists the packages (--json is used to build the CI matrix) |
castor monorepo:merge | Regenerates the root composer.json from the packages |
castor monorepo:validate | Checks package metadata, internal dependencies and the root composer.json |
castor monorepo:split [<package>...] | Splits packages with splitsh-lite (dry-run without --push) |
castor monorepo:split # dry-run, prints the split SHA of every packagecastor monorepo:split core themes --push # push the current branch of two packagescastor monorepo:split --ref=refs/tags/v0.1.0 --pushThe remote of each package defaults to git@github.com:{repository}.git ({repository} = FriendsOfSylius/sylius-starter-core,
{name} = sylius-starter/core, {short} = core); override it with --remote-pattern or the SPLIT_REMOTE_PATTERN environment variable.
Adding a package
Section titled “Adding a package”- Create
src/<Name>/withcomposer.json(namesylius-starter/<name>,SyliusStarter\<Name>\PSR-4 autoload onsrc/,"sylius-starter/core": "self.version"), aREADME.mdand aLICENSE. - Register its tasks from an autoloaded
src/functions.phpwithTaskProviderRegistry::register(). - Run
castor monorepo:merge, thencastor monorepo:validateandcomposer dump-autoload.