Skip to content

Upgrade mobile app template and migrate to the grouped pa CLI - #437

Open
Ameya Apte (ameyaapte1) wants to merge 5 commits into
mainfrom
users/amapte/upgrade_pa_cli_syntax
Open

Upgrade mobile app template and migrate to the grouped pa CLI#437
Ameya Apte (ameyaapte1) wants to merge 5 commits into
mainfrom
users/amapte/upgrade_pa_cli_syntax

Conversation

@ameyaapte1

Copy link
Copy Markdown
Contributor

Summary

  • Upgrades the mobile template to the latest native host and offline packages.
  • Migrates all legacy npx power-apps commands to grouped npx pa syntax.
  • Adds --non-interactive to every concrete npx pa invocation to prevent blocked agent terminals.
  • Updates template configuration, runtime logging, offline-profile wiring, and migration guidance.

Key Changes

  • Upgrades:
    • @microsoft/power-apps-native-host from ^0.2.25 to ^0.3.0
    • @microsoft/power-apps-native-offline from ^0.1.3 to ^0.1.32
    • Node.js requirement from 22 LTS to 24 LTS
  • Moves native template version and telemetry configuration from .powerapps-native/version.json into app.json.
  • Adds Power Native Metro logging middleware.
  • Passes an optional offline-profile.json to PowerAppsProvider.
  • Stops ignoring wrap.config.json and ignores generated .powernative/ content.
  • Documents required delegated Power Platform API permissions.
  • Adds manual migration guidance for apps created from older templates.
  • Updates agents, skills, hooks, and documentation to use commands such as:
    • npx pa app init
    • npx pa app add data-source
    • npx pa connection create
    • npx pa app push
  • Retains --force for 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.

Copilot AI lite review requested due to automatic review settings August 18, 2026 08:27
@ameyaapte1
Ameya Apte (ameyaapte1) requested a review from a team as a code owner August 18, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 grouped npx 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 into PowerAppsProvider.

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.

Comment thread plugins/mobile-apps/template/app/_layout.tsx
Comment thread plugins/mobile-apps/template/README.md
Comment on lines +127 to +132
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.
Comment on lines 211 to 216
**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"
```
Copilot AI review requested due to automatic review settings August 18, 2026 09:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 stage power.config.json hasn’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>

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.

3 participants