A library for use on Modern Tribe service projects.
- dev-master / 3.5.x-dev
This package is auto-updated.
Last update: 2022-01-05 14:59:23 UTC
Tribe Libs is a collection of libraries created by Modern Tribe for use with Square One-based WordPress projects. It is required by the Square One core plugin.
composer require moderntribe/tribe-libs
All usage documentation lives in the Square One repository.
Usage of Tribe Libs is not actively supported by Modern Tribe outside of client contracts. Pull requests and suggestions are welcome and will be addressed based on business need.
This library comprises a large collection of smaller libraries that can be included in whole or in part on Square One projects. These libraries are developed following the monorepo model. All changes are committed to this, the parent project. Maintenance of the individual packages is managed using the Monorepo Builder utility.
- Ensure that all code for the release is merged to
- Ensure that all updates for the release are logged in
- Run the release script, with the version number for the release (format:
./monorepo.sh release v3.0.0
- The script will handle several steps for you automatically:
- Set any package interdependencies to the new version
CHANGELOG.mdwith the appropriate version number
- Create the git tag and push it to GitHub
- Bump the
masterbranch version to the next minor version number
- When the tag is pushed to GitHub, an Action there will automatically split the monorepo and deploy the tag to all of the package repos. (Note: The GH Action will run as a bot user with appropriate permissions to write to all of the package repositories. Those repositories are read-only for normal usage.)
- Create a new directory for the package in
src. Create your code there, include an independent
composer.jsonfor the package (you can copy the sample), and commit it to tribe-libs.
- Create an empty public GitHub repository for the package (you probably need to be an org admin to
complete this step). Follow the naming convention
moderntribe/square1-*. Ensure that the user
tr1b0thas write access to the repo. Use the script
dev/monorepo/scripts/create-package-repo.shto create the repo and add the
- Add the directory and repo to the
- Run the script to merge the package
composer.jsonfiles to the root
- After the next release, Register the package on Packagist.
- Add the dependency to
composer.jsonin the package(s) that needs it.
- Run the
mergecommand to merge dependencies up to the root
You will rarely need to do this, but it is documented here just in case.
- Set the
masterbranch alias for all packages
./monorepo.sh set-alias 3.0
- Bump the interdependencies among the packages to the same version.
./monorepo.sh bump-interdependency "^3.0"
A release should be automatically deployed to all package repos by GitHub Actions whenever a tag is pushed to GitHub. That is really just running this command (but with appropriate permissions to push to all repos):
./monorepo.sh split --tag="v3.0.0"
Your GitHub user must have write access to all of the
square1-* repositories to complete this successfully (this is
why we have the GitHub Action).