Composer
PHP Composer workspace support and Packagist tagging.
The Composer plugin discovers PHP packages from composer.json, bumps versions, updates workspace constraints, and publishes through git tags that Packagist reads.
npm install @tegami/composerimport { tegami } from "tegami";
import { git } from "tegami/plugins/git";
import { composer } from "@tegami/composer";
const paper = tegami({
plugins: [git(), composer()],
});Discovery
Tegami reads the root composer.json and collects members from:
repositoriesentries with"type": "path"- the
packagesoption, for layouts that do not use path repositories
The root itself is included when it declares a name. Each package needs a name in vendor/package form.
How Composer versioning works
Composer packages usually have no version field. Packagist derives versions from git tags, and Tegami follows that:
- Current version comes from existing git tags (
v1.0.0at the root,packages/api/v1.0.0for a subdirectory package). An explicitversionincomposer.jsonis used as a fallback when present. - Next version is stored in the publish lock during
tegami version. - Publishing creates git tags through the git plugin.
Dependency bumping
| Dependency field | Default dependent bump |
|---|---|
require | patch |
require-dev | none |
When a released version no longer satisfies a dependent's constraint, Tegami rewrites it while keeping the same operator style (~1.2 becomes ~2.0).
Configuration
composer({
tagPrefix: "v",
updateLockFile: false,
bumpDep: ({ field }) => (field === "require" ? "patch" : false),
});Prop
Type
Set updateLockFile: true to run composer update --lock after versioning (requires PHP and Composer).
Publishing
Publishing creates a git tag per package ({tagPrefix}{version} at the repo root, {relativeDir}/{tagPrefix}{version} for subdirectory packages).
Monorepos and Packagist
Public Packagist indexes one package per repository. A monorepo package will not appear on packagist.org from a shared repo. Use repository splitting or a private registry such as Private Packagist or Satis. Tegami still manages versions, constraints, and tags either way.
Registry verification is off by default (verifyRegistry: false) because monorepo packages may never appear on the public registry. Publish status then relies on the git plugin's tag check.