moderntribe/tribe-libs
Composer 安装命令:
composer require moderntribe/tribe-libs
包简介
A library for use on Modern Tribe service projects.
README 文档
README
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.
Versions
| Tribe Libs Version | PHP Constraints | Notes |
|---|---|---|
| 3.x | 7.2-7.4 | Master branch. No longer maintained. |
| 4.x | 7.4+ | For use in legacy Square One PHP 7.4 projects where the host is upgrading to PHP 8.0. |
| 5.x+ | 8.0+ | For use in new Square One projects. |
Installation
composer require moderntribe/tribe-libs
Usage
All usage documentation lives in the Square One repository.
Support
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.
Release Process
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.
Releasing a new version
IMPORTANT: branches must already exist in the sub-repos, use the Create Sub-Repo Branch GitHub Workflow to create them if they don't already exist.
- Ensure that all code for the release is merged to the branch that matches the release number, e.g. if you're planning to release an update
4.1.0, that code should live in the4.xbranch. A release such as5.2.6should live in the5.xbranch. - Ensure that all updates for the release are logged in
CHANGELOG.mdunder## Unreleased. - Run the release script, with the version number for the release (format:
<major>.<minor>.<patch>): Dry run example for a4.xrelease:git checkout 4.x && git pull && ./monorepo.sh release 4.1.0 --dry-run
Real release example for a4.xrelease:git checkout 4.x && git pull && ./monorepo.sh release 4.1.0
- The script will handle several steps for you automatically:
- Set any package interdependencies to the new version.
- Update
CHANGELOG.mdwith the appropriate version number. - Create the git tag and push it to GitHub, tagged to the branch you have checked out.
- Bump the current branch you have checked out version's to the next 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.)
Adding Packages
- Create a new directory for the package in
src. Create your code there, include an independentcomposer.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 usertr1b0thas write access to the repo. Use the scriptdev/monorepo/scripts/create-package-repo.shto create the repo and add thetr1b0tuser automatically../dev/monorepo/scripts/create-package-repo.sh square1-my-new-repo
- Add a single commit (a blank readme is fine) and push it up.
- Run the Create Sub-Repo Branch GitHub Workflow to create any missing version branches, e.g.
master,4.x,5.xetc... - Run the script to merge the package
composer.jsonfiles to the rootcomposer.jsonfile:./monorepo.sh merge
- After the next release, Register the package on Packagist.
Adding Composer Dependencies
- Add the dependency to
composer.jsonin the sub-package(s) that needs it. - Run the
mergecommand to merge dependencies up to the rootcomposer.json./monorepo.sh merge
Update the development version
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 5.0
- Bump the interdependencies among the packages to the same version.
./monorepo.sh bump-interdependency "^5.0"
moderntribe/tribe-libs 适用场景与选型建议
moderntribe/tribe-libs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 49.75k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2019 年 08 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 moderntribe/tribe-libs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 moderntribe/tribe-libs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 49.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 6
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2019-08-12