Skip to content

Add mobile packages to manifest - #12

Draft
cehan-Chloe wants to merge 1 commit into
mainfrom
mobile-manifest-enhancement
Draft

Add mobile packages to manifest#12
cehan-Chloe wants to merge 1 commit into
mainfrom
mobile-manifest-enhancement

Conversation

@cehan-Chloe

Copy link
Copy Markdown
Contributor

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

Extends xlr compile's manifest with packages.ios/packages.android — the package info (name + version) that provides a plugin's capabilities on each mobile platform — alongside the packages.react field already shipped in this branch including both bazel and npm cases.

Bazel

getPackages() reads XLR_IOS_PACKAGE_NAME/XLR_ANDROID_PACKAGE_NAME env vars, the same pattern XLR_PACKAGE_NAME already uses for react. All three platforms share the one Bazel stamp (STABLE_VERSION) — there's no separate per-platform version to plumb through.

Need to work together with player-ui/rules_player#121

Non-Bazel

There's no build graph to read a mobile identity from outside Bazel — ios/android publish from separate repos on their own release cadence. So they come from a new, optional config.xlr.platformPackages map in the project config, keyed by npm package name:

{
  "xlr": {
    "platformPackages": {
      "@my-org/my-plugin": {
        "ios": { "name": "MyPlugin", "version": "2.1.0" },
        "android": { "name": "com.my-org:my-plugin", "version": "1.9.3" }
      }
    }
  }
}

A plugin absent from the map just gets react only (not an error — not every plugin has a mobile counterpart). An entry present but missing name or version for a platform is dropped, with a warning naming the exact field and platform (e.g. No "version" for "ios" of "@my-org/my-plugin" in config.xlr.platformPackages).

Test result

Verified end-to-end against the nppm repo

  1. bazel
Verified end-to-end against a real --stamp build of player's reference-assets/react target 
{
    "pluginName": "reference-assets-web-plugin",
    "capabilities": {
        "Assets": [
            "Assets.InputAsset",
            "Assets.TextAsset",
            "Assets.ActionAsset",
            "Assets.CollectionAsset",
            "Assets.ChoiceAsset"
        ],
        "Views": [
            "Views.InfoAsset"
        ]
    },
    "customPrimitives": [
        "Expression",
        "Asset",
        "Binding",
        "AssetWrapper",
        "Schema.DataType",
        "ExpressionHandler",
        "FormatType",
        "ValidatorFunction"
    ],
    "packages": {
        "react": {
            "name": "@player-ui/reference-assets-plugin-react",
            "version": "1.2.0-next.7"
        },
        "ios": {
            "name": "PlayerUIReferenceAssets",
            "version": "1.2.0-next.7"
        },
        "android": {
            "name": "com.intuit.playerui.plugins:reference-assets",
            "version": "1.2.0-next.7"
        }
    }
}
  1. non-bazel
{
    "pluginName": "'MyPlugin'",
    "capabilities": {
       ...
        ],
        "Formatters": [
            "Formatters.ssn",
            "Formatters.ein",
            "Formatters.tin",
            "Formatters.usAmountType",
            "Formatters.storeNegative"
        ],
        "Validators": [
            "Validators.formattedNumber",
            "Validators.ssn",
            "Validators.ein",
            "Validators.tin",
            "Validators.routingNumber",
            "Validators.monthYear"
        ]
    },
    "customPrimitives": [
        "Expression",
        "Asset",
        "Binding",
        "AssetWrapper",
        "Schema.DataType",
        "ExpressionHandler",
        "FormatType",
        "ValidatorFunction"
    ],
    "packages": {
        "react": {
            "name": "@test-plugin",
            "version": "5.8.43"
        },
        "ios": {
            "name": "@test-plugin",
            "version": "5.4.23"
        },
        "android": {
            "name": "com.plugins:@test-plugin",
            "version": "4.5.23"
        }
    }
}

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.05941% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.88%. Comparing base (8f6ec43) to head (c598deb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cli/src/utils/xlr/packages.ts 93.75% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
+ Coverage   33.61%   35.88%   +2.27%     
==========================================
  Files          27       27              
  Lines        1889     1956      +67     
  Branches      140      159      +19     
==========================================
+ Hits          635      702      +67     
  Misses       1252     1252              
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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