fix: Correct package metadata and bring tooling to parity with the other SDKs - #459
Open
razor-x wants to merge 7 commits into
Open
fix: Correct package metadata and bring tooling to parity with the other SDKs#459razor-x wants to merge 7 commits into
razor-x wants to merge 7 commits into
Conversation
Add the description, license, homepage, keywords, support links and PHP version constraint that were missing from composer.json, and point the authors entry at Seam Labs rather than a personal address. Move the Tests\ PSR-4 mapping from autoload to autoload-dev so the test namespace is no longer registered in consumer projects, and add an archive exclude list so a built package ships only the runtime files. package.json is deliberately kept in the archive because Seam\Utils\PackageVersion reads it at runtime. Define the primary development tasks as Composer scripts (build, test, lint) and configure PHPUnit in phpunit.xml.dist so the suite is declared rather than passed by path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
renovate.json used the deprecated config:base preset and only enabled updates for @seamapi/types, which Dependabot already covers, so it was doing nothing that the npm ecosystem in dependabot.yml does not. Composer dependencies stay under manual control. Set CODEOWNERS to the sdk team to match the other SDK repositories. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
Replace the bespoke test workflow with a Check workflow modelled on the Ruby and Python SDKs. It runs on pushes to main as well as pull requests, has test, lint, build and install jobs, sets job timeouts and drops the SEAM_API_KEY secret the suite no longer needs, so checks now run on forks. Add a real PHP setup composite action that installs PHP, validates the lockfile and installs Composer dependencies from a cache. The existing action only set up Node.js, so rename it to setup-node and repoint the generate and version workflows at it. Add a reusable build workflow that packages the library with composer build and uploads the archive, an install job that requires that archive from a path repository and constructs a SeamClient, and wire the archive into the Publish workflow, which previously created a release with no files. Add a Format workflow so pushes are formatted with Prettier and committed, and widen Semantic Release to all branches so the prerelease branches declared in .releaserc.json can actually release. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
The top-level parser option forced the PHP parser onto every file in the repository. Non-PHP files were parsed as inline HTML and written back unchanged, so Prettier silently did nothing for TypeScript, JSON, YAML and Markdown, and the overrides block only ever adjusted options that the PHP parser ignored. Move the PHP parser into an override on **/*.php with the plugin defaults it was already producing, and let Prettier infer the parser for everything else, which restores the shared options used by the Ruby and Python SDKs. Disable embedded formatting in Markdown so the PHP examples in the README keep the style of the generated source. The codegen changes are the result of running the formatter over TypeScript for the first time. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
Replace the development setup section, which referenced yarn and invoked PHPUnit by path, with the Composer script tasks, the supported PHP versions and how a release is cut. Record why the package version lives in package.json: Composer has no canonical place for it, Packagist derives it from the git tag, and Seam\Utils\PackageVersion reads the field at runtime. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
Run the check matrix on PHP 8.0 and 8.5 rather than the latest two releases, so continuous integration covers both ends of the range the package declares support for. Default the setup action and the build workflow to 8.5, matching the top of the matrix as the Ruby and Python SDKs do. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
Seam\Utils\PackageVersion read package.json from the package root at runtime to set the seam-sdk-version header, which forced a development manifest into every published package. Replace it with a VERSION constant, and inject that constant from package.json in the version lifecycle script, which npm runs after the bump but before the commit, so the value is part of the tagged commit. Packagist publishes the tag with no build step in between, so unlike the JavaScript SDK, which injects at pack time, the version has to be committed before the tag, as the Ruby SDK does with lib/seam/version.rb. Add export-ignore rules to .gitattributes so development files are kept out of the archives Composer downloads as dist, which composer.json's archive exclude list does not govern, and exclude package.json from composer archive as well. Cover the constant with tests asserting it matches package.json and is what SeamClient sends, so a hand edit or a missed injection fails. Removes Seam\Utils\PackageVersionException, which only signalled an unreadable package.json and has no remaining purpose. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
razor-x
force-pushed
the
claude/php-tooling-parity-rzbrw1
branch
from
July 29, 2026 20:37
5963ea9 to
ec1e185
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Ruby and Python SDKs share a common project, packaging and CI layer that
this repository never received. The codegen half was already at parity, so
this brings the language-side tooling up with it.
Packaging
Add the description, license, homepage, keywords, support links and
"php": "^8.0"constraint missing fromcomposer.json, and pointauthorsat Seam Labs rather than a personal address.
Move the
Tests\PSR-4 mapping fromautoloadtoautoload-dev, so thetest namespace is no longer registered in consumer projects.
Add
archive.excludeso a built package ships only runtime files.package.jsonis deliberately kept, becauseSeam\Utils\PackageVersionreads it at runtime to set the
seam-sdk-versionheader.Add
LICENSE.txt(MIT, matching the other SDKs) andphpunit.xml.dist.Define the primary development tasks as Composer scripts:
composer testcomposer lintnpm run formatcomposer buildContinuous integration
test.ymlwithcheck.yml, modelled on the other SDKs:test/lint/build/installjobs, running on pushes tomainaswell as pull requests, with job timeouts.
The previous workflow pinned 8.0 only, and
composer.jsondeclared noconstraint at all.
SEAM_API_KEYsecret, which the suite does not need, so checks nowrun on forks. The previous
skip ciguard readgithub.event.head_commit,which is always null on
pull_requestevents, so it never fired.setupcomposite action (setup-php, lockfile validation,cached
composer install). The existing action only set up Node.js, so it isrenamed
setup-nodeand the generate and version workflows point at it._build.yml, which packages the library withcomposer buildanduploads the archive, and an
installjob that requires that archive from apath repository and constructs a
SeamClient. This also guards thepackage.jsonruntime dependency described above.publish.yml, which previously created a release withfiles: ''.format.yml, so pushes are formatted with Prettier and committed. Untilnow formatting only ran as a
postgeneratestep, so hand-written commitswere never formatted by CI.
next/beta/alphaprerelease branches declared in
.releaserc.jsoncan actually release.renovate.json, which used the deprecatedconfig:basepreset andonly enabled
@seamapi/types, already covered by Dependabot. Composerdependencies stay under manual control.
CODEOWNERSto@seamapi/sdk.Prettier was a no-op on every non-PHP file
.prettierrc.jsonset"parser": "php"at the top level, which forces thatparser on all files rather than setting a default. Non-PHP files were
parsed as inline HTML and written back byte-identical, so Prettier silently did
nothing for TypeScript, JSON, YAML and Markdown, and
prettier --checkpassedvacuously. The
overridesblock only adjusted options the PHP parser ignores.The PHP parser now lives in an override on
**/*.phpwith the plugin defaultsit was already producing, and Prettier infers the parser for everything else.
Embedded formatting is disabled for Markdown so the README examples keep the
style of the generated source. The
codegen/libchanges in this PR are theresult of running the formatter over TypeScript for the first time;
src/isunchanged.
Verification
Run locally:
composer lint,composer validate --strict,npm run lintandnpm run typecheckall pass. The full build to install round trip wasexercised exactly as
check.ymldoes it (archive, path repository,composer install, construct aSeamClient). All workflow YAML parses andevery action and reusable-workflow reference resolves.
src/was checked for post-8.0 syntax (readonly, enums,never,first-class callables, intersection types) and is clean, and the tightest
floor in
composer.lockissymfony/deprecation-contractsatphp >=8.0.2,which the latest 8.0.x satisfies.
Notes for review
corrected package metadata and the
autoload-devchange are consumervisible. Retitle to
chore:before merging if you would rather not release.^8.0constraint. Raising the floor is a one-line change but breaks existing
consumers.
^9.5, a 2022 release, andphpunit.xml.distsetsfailOnWarning="true". If PHP 8.5 surfaces deprecations through its errorhandler, that leg will go red and the fix is a manual PHPUnit bump.
Deferred to a follow-up: wiring
@seamapi/fake-seam-connectinto the testharness and growing the suite beyond its single file, PHPStan and an enforced
phpcsruleset, a devcontainer,.php-version, and a README rebuild withbadges and a table of contents.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RFK47311nWtbd3gHmjdknR
Generated by Claude Code