Skip to content

Executors should resolve options from the invoked target #93

Backlog

Description

@NathanWalker

Follow-up to #91.

Current behavior

The executors resolve a run's options from the target named after the command, for example debug for the debug executor, rather than from the target that was actually invoked (context.targetName). #91 makes CLI flags win by treating a value as CLI-provided when it differs from what that target and its configuration would produce. Two edge cases remain:

  1. The target name differs from the command. Take a workspace with an ios target that uses @nativescript/nx:debug, next to a debug target. Running nx run app:ios resolves options from debug, so a schema default can win over options set on the debug target, and options on the invoked ios target are compared against the wrong baseline.
  2. The configuration is chosen at the interactive prompt. A value that only exists in the configuration picked at the prompt still beats a CLI flag with the same value as the schema default, because the executor can't tell that flag apart from a default.

Proposal

  • Resolve options from the invoked target (context.targetName) and its configuration.
  • Apply the configuration chosen at the prompt before CLI flags, keeping the precedence CLI > configuration > target options > defaults.

This changes behavior for workspaces whose target names don't match the executor command, so it should be called out in the release notes.

The NativeScript monorepo isn't affected: every @nativescript/nx target there is named after its command.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions