Skip to content

fix(cli): resolve Nx hooks from package directories - #8566

Open
fzlzjerry wants to merge 1 commit into
ionic-team:mainfrom
fzlzjerry:fix/8538-nx-hook-resolution
Open

fix(cli): resolve Nx hooks from package directories#8566
fzlzjerry wants to merge 1 commit into
ionic-team:mainfrom
fzlzjerry:fix/8538-nx-hook-resolution

Conversation

@fzlzjerry

Copy link
Copy Markdown

What does this PR do?

Fixes #8538.

Hook lookup now checks the package at the directory passed to runPlatformHook before considering the Nx workspace root. This lets an app and each plugin run the hook declared in their own package.json and with their own working directory.

The Nx-root behavior is retained as a fallback for integrated workspaces where the app has no local package or hook. Plugin lookups explicitly disable that fallback so a workspace-root hook is not run once for every installed plugin.

Regression tests cover:

  • app and plugin hooks taking precedence over the Nx-root hook;
  • the Nx-root fallback for an app without a local package; and
  • plugins without a hook not inheriting the Nx-root hook.

Testing

  • npm test --workspace @capacitor/cli (13 suites, 87 tests)
  • npm run build --workspace @capacitor/cli
  • npm run eslint (0 errors; 7 warnings in unchanged tests)
  • npm run prettier -- --check

Copilot AI lite review requested due to automatic review settings August 11, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

[Bug]: plugin hooks not running in Nx app

2 participants