Upgrade mobile app template and migrate to the grouped pa CLI - #437
Upgrade mobile app template and migrate to the grouped pa CLI#437Ameya Apte (ameyaapte1) wants to merge 5 commits into
pa CLI#437Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the mobile-apps plugin’s bundled Expo template and supporting skill/agent documentation to align with the newer native host/offline packages and the grouped npx pa CLI, while also adjusting template runtime/config wiring.
Changes:
- Upgrade the template’s native host/offline dependencies and bump documented Node requirement to Node.js 24 LTS.
- Migrate documented CLI usage from legacy
npx power-apps ...to groupednpx pa ...(including--non-interactive) across skills/agents/shared docs. - Move template version/telemetry config into
app.json, add Metro logging middleware, and wire an optional offline profile intoPowerAppsProvider.
Reviewed changes
Copilot reviewed 40 out of 41 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/mobile-apps/template/README.md | Updates template guidance (Node 24, permissions, template version location, migration steps, npx pa usage). |
| plugins/mobile-apps/template/package.json | Upgrades @microsoft/power-apps-native-host and @microsoft/power-apps-native-offline. |
| plugins/mobile-apps/template/metro.config.js | Wraps Metro middleware with Power Native logging. |
| plugins/mobile-apps/template/CUSTOMIZATION.md | Updates guidance to reference expo.extra.powerappsNative in app.json. |
| plugins/mobile-apps/template/app/_layout.tsx | Passes offlineProfile into PowerAppsProvider (but currently risks bundling failure when missing). |
| plugins/mobile-apps/template/app.json | Adds expo.extra configuration (telemetry/appInsights + template version metadata). |
| plugins/mobile-apps/template/.powerapps-native/version.json | Removes legacy template-version file. |
| plugins/mobile-apps/template/.gitignore | Stops ignoring some prior files and adds .powernative/ ignore. |
| plugins/mobile-apps/skills/setup-offline-profile/SKILL.md | Updates CLI references to npx pa ... while preserving “don’t touch power.config.json” rule. |
| plugins/mobile-apps/skills/setup-datamodel/SKILL.md | Updates /add-dataverse CLI command examples to npx pa .... |
| plugins/mobile-apps/skills/preview-offline-scope/SKILL.md | Updates ownership reference to npx pa app init --non-interactive. |
| plugins/mobile-apps/skills/list-connections/SKILL.md | Migrates connection commands to npx pa connection ... syntax. |
| plugins/mobile-apps/skills/edit-offline-profile/SKILL.md | Updates power.config ownership reference to npx pa .... |
| plugins/mobile-apps/skills/design-system/SKILL.md | Updates scaffold step reference to npx pa app init --non-interactive. |
| plugins/mobile-apps/skills/deploy/SKILL.md | Migrates deploy guidance to npx pa app push --non-interactive. |
| plugins/mobile-apps/skills/debug-app/SKILL.md | Updates debugging guidance to reference npx pa ... add data-source. |
| plugins/mobile-apps/skills/create-mobile-app/SKILL.md | Migrates major orchestrator documentation to grouped pa commands (includes an env-scoping concern for preflight app list). |
| plugins/mobile-apps/skills/assign-offline-profile/SKILL.md | Updates power.config ownership reference to npx pa .... |
| plugins/mobile-apps/skills/add-sharepoint/SKILL.md | Migrates SharePoint connection/dataset/table steps to grouped pa commands. |
| plugins/mobile-apps/skills/add-sharepoint/references/sharepoint-reference.md | Updates troubleshooting and generation notes to new npx pa ... commands. |
| plugins/mobile-apps/skills/add-dataverse/SKILL.md | Migrates Dataverse data-source generation steps to npx pa app add data-source .... |
| plugins/mobile-apps/skills/add-datasource/SKILL.md | Updates routing guidance for flows and dataverse API discovery commands. |
| plugins/mobile-apps/skills/add-connector/SKILL.md | Migrates connector/flow add/remove and dataset/table discovery commands to grouped pa. |
| plugins/mobile-apps/shared/version-check.md | Updates deploy/tooling references to npx pa .... |
| plugins/mobile-apps/shared/shared-instructions.md | Updates global CLI invocation rules and auth triage flow for grouped pa commands. |
| plugins/mobile-apps/shared/references/offline-profile-schema.md | Updates rationale text to reference npx pa app init --non-interactive. |
| plugins/mobile-apps/shared/references/offline-profile-reconciliation.md | Updates deploy gate reference to npx pa app push --non-interactive. |
| plugins/mobile-apps/shared/references/connector-planning.md | Updates orchestrator/connector responsibility wording for grouped pa. |
| plugins/mobile-apps/shared/preferred-environment.md | Migrates environment rebinding guidance to npx pa app init .... |
| plugins/mobile-apps/shared/connector-reference.md | Migrates connection + add-data-source reference commands to grouped pa. |
| plugins/mobile-apps/README.md | Updates plugin docs (Node 24, permissions, migration section, npx pa commands). |
| plugins/mobile-apps/hooks/validate-protected-paths.js | Updates protected-path reason strings for grouped pa commands. |
| plugins/mobile-apps/hooks/validate-dataverse-payload.js | Updates generated-layer ownership comment to npx pa. |
| plugins/mobile-apps/hooks/validate-connector-first.js | Updates “connector-first” violation messaging to grouped pa commands. |
| plugins/mobile-apps/agents/screen-planner.md | Updates agent guidance to reference npx pa CLI failure refresh and scaffold pipeline. |
| plugins/mobile-apps/agents/screen-builder.md | Updates “don’t sign out via CLI” guidance to grouped pa syntax. |
| plugins/mobile-apps/agents/offline-profile-architect.md | Updates “read-only” hard rule to reference grouped pa commands. |
| plugins/mobile-apps/agents/native-app-planner.md | Updates planner hard rules and next-step references to grouped pa. |
| plugins/mobile-apps/agents/data-model-architect.md | Updates hard rules to grouped pa CLI references. |
| plugins/mobile-apps/AGENTS.md | Updates plugin overview and template prep conventions to grouped pa CLI. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| 3. Copy app-owned assets and settings such as `assets/`, `auth.config.json`, | ||
| `power.config.json`, and `offline-profile.json` as needed. Review each file | ||
| before replacing the version supplied by the new template. | ||
| 4. Keep the new template's `package.json`, root configuration files, | ||
| `android/`, and `ios/`. Reapply old customizations selectively rather than | ||
| copying these files wholesale. |
| **App-name collision pre-flight.** Once `<displayName>` is fixed, check the chosen env for a name collision: | ||
|
|
||
| ```bash | ||
| npx power-apps list-codeapps --environment-id "$ACTIVE_ENV_ID" --json 2>/dev/null | grep -F "<displayName>" >/dev/null && \ | ||
| npx pa app list --non-interactive 2>/dev/null | grep -F "<displayName>" >/dev/null && \ | ||
| echo "COLLISION" || echo "OK" | ||
| ``` |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 33 changed files in this pull request and generated no new comments.
Suppressed comments (3)
plugins/mobile-apps/skills/create-mobile-app/SKILL.md:216
- This pre-flight claims to check the chosen environment for an app-name collision, but the command shown doesn’t reference
$ACTIVE_ENV_ID(and at this stagepower.config.jsonhasn’t been created yet). As written, it’s unclear which environment is being checked, so the collision gate can give false OK/COLLISION results relative to<ACTIVE_ENV_NAME>.
**App-name collision pre-flight.** Once `<displayName>` is fixed, check the chosen env for a name collision:
```bash
npx pa app list --non-interactive 2>/dev/null | grep -F "<displayName>" >/dev/null && \
echo "COLLISION" || echo "OK"
**plugins/mobile-apps/skills/add-dataverse/SKILL.md:640**
* Step 6 says to “pass the environment URL resolved earlier”, but the grouped `npx pa app add data-source` invocation shown no longer accepts/uses an env URL argument (it relies on `power.config.json`). This reads like a leftover from the legacy `--org-url <envUrl>` flow and is misleading for anyone following the skill steps.
For each table the app will use (regardless of reuse/extend/create), generate the TS layer from the app root. The CLI reads the environment ID from power.config.json; pass the environment URL resolved earlier in the skill:
**plugins/mobile-apps/skills/debug-app/SKILL.md:231**
* This row suggests re-running `app add data-source`, but elsewhere in the doc all CLI invocations are fully qualified as `npx pa ...` and include `--non-interactive`. Leaving it as `app add data-source` is inconsistent and may be confusing to follow.
| [TRACE service-response] shows error string | Service threw — read the error; 401/403 = auth; 404 = wrong resource | Fix auth config or re-run app add data-source |
</details>
Summary
npx power-appscommands to groupednpx pasyntax.--non-interactiveto every concretenpx painvocation to prevent blocked agent terminals.Key Changes
@microsoft/power-apps-native-hostfrom^0.2.25to^0.3.0@microsoft/power-apps-native-offlinefrom^0.1.3to^0.1.32.powerapps-native/version.jsonintoapp.json.offline-profile.jsontoPowerAppsProvider.wrap.config.jsonand ignores generated.powernative/content.npx pa app initnpx pa app add data-sourcenpx pa connection createnpx pa app push--forcefor removal commands alongside the non-interactive policy.Breaking Changes
Existing apps should migrate into a fresh copy of the latest template rather than replacing its root configuration or native projects.