Skip to content

Split dev-trunk into ~dev.json for proper SVN revision locking#65

Merged
retlehs merged 10 commits intomainfrom
feature/split-dev-trunk-json
Mar 25, 2026
Merged

Split dev-trunk into ~dev.json for proper SVN revision locking#65
retlehs merged 10 commits intomainfrom
feature/split-dev-trunk-json

Conversation

@retlehs
Copy link
Copy Markdown
Member

@retlehs retlehs commented Mar 25, 2026

Summary

  • Split Composer metadata: tagged versions in p2/<name>.json, dev-trunk in p2/<name>~dev.json
  • Trunk-only packages get dev-trunk in both .json and ~dev.json to avoid breaking existing installs
  • Every active package gets a ~dev.json — the builder synthesizes dev-trunk from the package name (no DB changes needed)
  • Dev-trunk entries include both dist (unversioned trunk zip) and source (SVN)
  • Trunk-only package detail pages show composer require wp-plugin/<name>:dev-trunk as the main install command
  • Latest-not-tagged packages show an expandable "Install latest from trunk" option
  • Mutability warnings on both cases since trunk zips are mutable
  • Delete detection compares package names across builds (handles ~dev.json correctly)
  • Integrity checks updated to allow more p2 files than packages
  • Removed old inline JSON repository workaround from detail and untagged pages

Context

Ref #24, ref #15

Composer v2 looks for dev versions in ~dev.json alongside the main package JSON. Users can now install any package from trunk via composer require wp-plugin/<name>:dev-trunk.

First deploy will upload ~60k new ~dev.json files to R2. Subsequent deploys only sync changed files as usual.

🤖 Generated with Claude Code

retlehs and others added 2 commits March 25, 2026 14:50
Composer v2 looks for dev versions in ~dev.json alongside the main
package JSON. Tagged versions go to p2/<name>.json with dist + source,
dev-trunk goes to p2/<name>~dev.json with source only so Composer
checks out via SVN and locks the revision number.

This eliminates the need for inline JSON workarounds on trunk-only
packages — users can now `composer require wp-plugin/foo:dev-trunk`
directly. Updates the detail page accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Trunk-only packages now show "Copy install command" which copies
`composer require wp-plugin/<name>:dev-trunk`. Latest-not-tagged
packages still show the inline JSON workaround.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs self-assigned this Mar 25, 2026
retlehs and others added 8 commits March 25, 2026 15:01
Trunk-only packages show dev-trunk as the main install command.
Latest-not-tagged packages keep the tagged version as the main
command with an expandable "Install latest from trunk" option in
the warning. Remove the old JSON workaround from both cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Skip ~dev.json files in delete detection to avoid emitting invalid
package names like wp-plugin/foo~dev. Track changes from either
tagged or dev files without double-counting using a pkgChanged flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests verify that deleting a package with both .json and ~dev.json
produces a single delete event with the correct name, and that
changes to only the dev file are properly detected without duplication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collect unique package names from both .json and ~dev.json in the
previous build, then check if a package is completely absent (neither
file exists) in the new build. This fixes missed deletes for
trunk-only packages and false deletes for tagged→dev-only transitions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Every active plugin/theme has a trunk in SVN, so the builder now
generates a ~dev.json for all packages rather than only those with
dev-trunk in versions_json. This means dev-trunk doesn't need to
be stored in the DB — the builder synthesizes it from the package
name and type.

Also allows packages with empty versions_json through the build
so trunk-only packages still get a ~dev.json artifact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SVN + Composer doesn't support revision locking — the reference
stays as "trunk" in composer.lock regardless. Adding dist back
with the unversioned trunk zip URL so users can install dev-trunk
packages without needing SVN installed locally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SVN + Composer doesn't support revision locking, so dev-trunk
installs are mutable. Update the warnings to reflect this instead
of claiming Composer locks to an SVN revision.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…stalls

Trunk-only packages now get dev-trunk in both .json and ~dev.json.
This prevents breaking existing composer.lock files that reference
the main .json file for trunk-only packages like top-level-cats.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs merged commit 2b6297d into main Mar 25, 2026
5 checks passed
@retlehs retlehs deleted the feature/split-dev-trunk-json branch March 25, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant