Repository navigation
Filter plugins by NativePHP Mobile 3.x or 4.x and show version pills - #537
Merged
Merged
Conversation
The version filter matched the raw composer constraint (e.g. "^3.0 || ^4.0") with LIKE '4.%', so 4.x found nothing. Plugins now store the lowest release they allow in each major, worked out from their composer.json, and the filter, cards and plugin headers use that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 marketplace's version filter found nothing for "4.x and up" in production. Plugins store the raw
nativephp/mobileconstraint from their composer.json inmobile_min_version(^3.0 || ^4.0,^4.0,*), and the filter searched it withLIKE '4.%', which none of those values match.Plugins now have a
mobile_versionsJSON column with the lowest release they allow in each major version, e.g.{"3": "3.2.1", "4": "4.0"}. It's worked out from the stored composer.json by a small parser inApp\Support\ComposerConstraint. The sync fills it in, andphp artisan plugins:backfill-mobile-versionsfills it for existing plugins from the composer.json we already have, without calling GitHub.The filter now offers All NativePHP Versions, NativePHP 4.x and NativePHP 3.x, and a plugin shows under every major it supports. "Version Unspecified" and the 2.x and 1.x options are gone. Old links with those values show every plugin.
Plugin cards and plugin page headers show a pill per major with the lowest version, e.g. (3.0) (4.5.2). The pills use the phone icon from the nav's Mobile menu, so desktop plugins can get the Desktop icon later.
Things to watch:
*and>=3.0count as both 3.x and 4.x and get 3.0 and 4.0 pills. nativephp/mobile-firebase requires*.^,~, wildcards, comparisons, hyphen ranges and|/||, and skips branch names likedev-main. Swapping composer/semver in would be easy if we'd rather add the dependency.config('plugins.mobile_major_versions')are checked, now[4, 3]since plugins arrived in v3. When 5.x ships, add it there and run the backfill again.After deploying: run the migration, then
php artisan plugins:backfill-mobile-versions --dry-run, check the table, then run it without--dry-run.Testing: new tests cover the parser (including the constraint styles real plugins use on GitHub and Packagist), the sync, the backfill command, the filter, and the pills on cards and plugin pages. The plugin-related tests pass locally. I haven't run the full suite. I tried the filter and plugin page in the local preview, but only checked the card pills and the phone icon in the rendered HTML.
🤖 Generated with Claude Code