mobile-app /deploy: produce and verify the native wrap package - #438
mobile-app /deploy: produce and verify the native wrap package#438Vivek Ghosh (vivekghosh3) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the mobile-apps /deploy skill workflow to include a new “Native package” step intended to generate and validate native-wrap artifacts (Hermes bytecode bundles + customer asset packages) in addition to the existing web dist/ output.
Changes:
- Inserts Step 2.4 “Native package” into the deploy workflow sequence.
- Adds Node version gating guidance and a pre-push verification checklist for expected native artifacts.
- Documents expected artifact locations and how they’re consumed by the wrap pipeline.
Suppressed comments (2)
plugins/mobile-apps/skills/deploy/SKILL.md:84
- Step 2.4 still references
package:*in the stop condition and the commands to run, but those npm scripts don't exist in the template (it usesbundle:*). This will block/deployfor template-based projects.
If it prints below **v20.19.4**, STOP and tell the user to switch (`nvm use 20.19.4`, or install Node ≥ 20.19.4) and rerun. Do **not** run the `package:*` commands on older Node.
The web build above produces `dist/index.html` (the hosted Code App). Native **wrapped** apps additionally need a precompiled Hermes bundle **and** the customer's images/fonts as hash-addressed asset files, so the wrap pipeline never compiles or downloads JavaScript. Produce both platforms:
```bash
npm run package:android
npm run package:ios
**plugins/mobile-apps/skills/deploy/SKILL.md:107**
* This line still refers to `package:*`, but earlier in the step the commands should be `bundle:android` / `bundle:ios` (matching the template scripts). Keeping the old name here is confusing and suggests the wrong troubleshooting target.
If a package:* step fails, surface the error and STOP. If the app renders bundled images/fonts, also confirm each manifest.json assets array is non-empty (an empty array means the app doesn't require() any static asset yet).
</details>
---
💡 <a href="/microsoft/power-platform-skills/new/main?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a `code-review` agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/en/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>
| **Print before starting:** | ||
| > "→ Compiling the native Hermes bundle and hash-addressed asset package for iOS and Android via `npm run package:android` + `npm run package:ios`. No JavaScript is compiled inside the wrap pipeline — it only consumes these prebuilt files. ~1–3 minutes." | ||
|
|
||
| **Node version gate (required).** The native `expo export` crashes on **Node < 20.19.4** — it hits `util.styleText(['yellow','inverse','bold'], …)`, which older Node rejects, failing the Metro bundle with a cryptic `ERR_INVALID_ARG_VALUE`. Check first: | ||
|
|
There was a problem hiding this comment.
Looks like a valid comment
| # Hermes magic bytes on both bundles (expect c61fbc03) | ||
| for f in dist/index.android.bundle.hbc dist/main.jsbundle.hbc; do | ||
| test -f "$f" || { echo "MISSING $f"; exit 1; } | ||
| test "$(xxd -p -l4 "$f")" = "c61fbc03" || { echo "$f is not Hermes bytecode"; exit 1; } | ||
| done |
There was a problem hiding this comment.
Also seems valid
| npm run package:ios | ||
| ``` | ||
|
|
||
| Each command runs `expo export` for that platform and writes, next to `dist/index.html`: |
|
Vivek Ghosh (@vivekghosh3) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
mobile-app
/deploy: produce and verify the native wrap packageWork item: 39295492
Why
Deploying an Expo/CodeGen mobile app only produced the web bundle. The native artifacts the wrap pipeline needs — the prebuilt Hermes bundle and the customer asset package — were never generated, so wrapped apps launched without customer images/fonts or failed to wrap at all. Customers had no signal that anything was missing.
What changed
Added Step 2.4 "Native package" to the
/deployflow, between build and the offline-profile gate:npm run package:androidandnpm run package:ios, emitting the Hermes.hbcpluspowerapps-customer-assets-<platform>/for each platform.c61fbc03) on both bundles and the presence of each platform's assetmanifest.json. A silent/partial build now fails loudly instead of producing a broken wrap.nvm use 20.19.4), since older Node crashes the native export.Applied consistently to both the source skill and the installed-plugin copy so behaviour matches what the tool actually loads.
Impact
/deploynow yields a wrap-ready app in one step, with deterministic verification. This is the customer-facing half of the CodeGen wrap fix: the wrap pipeline consumes these prebuilt artifacts and never compiles customer JavaScript, so bundle production stays entirely on the customer's machine at deploy time.Notes