Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Why
The CI linting pipeline uses the external
unbrokennpm package (v1.0.27) tocheck for broken links in markdown files. The package is no longer actively
maintained, and it fails on transient HTTP errors (e.g. 502) without retrying,
causing spurious CI failures when GitHub is temporarily flaky. It also pulls in
several external dependencies (axios, chalk, command-line-args, command-line-usage,
micromatch) that increase the supply chain risk surface.
What
Forked the
unbrokenpackage into the monorepo as@rnw-scripts/unbroken,following the same conventions as other
@rnw-scriptspackages(e.g.
prepare-release).Key changes from the original:
retries with exponential backoff (up to 5 attempts), instead of failing
immediately. Previously only HTTP 429 (rate limiting) was retried.
axioswith Node.js built-infetch: Removes the external HTTPclient dependency entirely. The
fetchAPI is available globally sinceNode 18, and the package targets Node >= 22.
command-line-args/command-line-usagewithparseArgsfromnode:util: Uses the Node.js built-in CLI argument parser, matching thepattern established in
@rnw-scripts/prepare-release.micromatchwithpath.matchesGlob(): Uses the Node.js 22.5+built-in glob matcher for exclusion pattern matching.
chalkwith ANSI escape codes: Simple helper functions(
yellowBold,redBold) for colored output, no external dependency needed.source-map-supportwithprocess.setSourceMapsEnabled(true):Uses the Node.js built-in source map support.
fswith@react-native-windows/fs: Follows the repo conventionenforced by ESLint.
docs/react-native-windows-init.md: Updatedhttp://mustache links tohttps://.The result is a package with zero external runtime dependencies (only
@react-native-windows/fsfrom the monorepo).Original copyright and license (MIT, Alexander Sklar) are preserved in both
the LICENSE file and source file headers. The original project URL
(https://github.com/asklar/unbroken) is referenced in the help output.
The root
package.jsonnow depends on@rnw-scripts/unbrokeninstead ofunbroken. No pipeline YAML changes are needed since the binary name(
unbroken) is preserved via the package'sbinfield.Screenshots
N/A
Testing
npx unbroken -q --local-only --allow-local-line-sectionssuccessfully(0 errors, 1 warning — same as before).
npx unbroken --helpto verify CLI argument parsing works correctly.yarn buildandrnw-scripts lint:fixon the new package with no errors.Changelog
Should this change be included in the release notes: no
Microsoft Reviewers: Open in CodeFlow