Skip to content

Add --fail-on-error to the host link command - #453

Open
huytdps13400 wants to merge 1 commit into
callstackincubator:nextfrom
huytdps13400:fix/269-link-fail-on-error
Open

Add --fail-on-error to the host link command#453
huytdps13400 wants to merge 1 commit into
callstackincubator:nextfrom
huytdps13400:fix/269-link-fail-on-error

Conversation

@huytdps13400

Copy link
Copy Markdown

Fixes #269

Summary

  • add --fail-on-error to the host link command
  • preserve the current default behavior, which warns and skips dependencies that cannot be resolved
  • route the opt-in mode through dependency discovery so Node's original resolution error is printed and the CLI exits unsuccessfully
  • document the option and add a minor changeset

The strict resolver is internal and separate from the existing tolerant wrapper. That keeps the default API/behavior intact and lets the diagnostic logging work in #451 land independently; I will rebase this PR if that resolver change merges first.

Tests

The CLI integration fixture declares broken-package with an exports target pointing to a missing file:

  • default link --android: exit 0 and emit the existing warning
  • link --android --fail-on-error: exit 1 and include broken-package plus missing.js, not an unknown-option error

TDD evidence: the strict-mode test initially failed because the CLI reported unknown option '--fail-on-error'; it passes after the implementation.

Validation

  • pnpm install --frozen-lockfile — Node 24.16.0 / pnpm 10.33.0
  • pnpm run build
  • focused CLI test — 4/4 passed
  • pnpm test — 109/109 passed across host, cmake-rn, and gyp-to-cmake
  • pnpm lint
  • pnpm prettier:check
  • pnpm depcheck
  • runtime react-native-node-api help link — option present
  • git diff --check

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.

Add --fail-on-error option to host link command

1 participant