This pull request's diff hasn't been prepared yet. Log in with GitHub to have us prepare it for review.

Fix nightly library scaffold version selection #16490

Merged
vmoroz opened 8:45am on October 18, 2026 wanted to merge 628 Δ into microsoft/react-native-windows main from
PR/fix-rn-latest-failure

Pull Request Overview

  • Opened on October 18, 2026
  • Status Merged
  • Commit count 4 with first commit October 18, 2026

Total Delta

628 Total Diff Delta

Open Days

Open 15 weekdays

Test Delta

708 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.0 days Authoring 1 commit before pull request opened for review
 
0.0 days Awaiting first review
Set up deploy tracking to begin tracking full PR start-to-deploy times

Total time for pull request 0.0 business days from first commit authored to merge
Deploy tracking has not been set up

Author avatar

Fix nightly library scaffold version selection

Description

Type of Change


  • Bug fix (non-breaking change which fixes an issue)

  • This change requires a documentation update

Why

Nightly library initialization fails before project generation because its
bootstrap selects either the literal latest or an RN dist-tag without a matching
template. This also blocks the feed warmer's main-library closure.

Related: microsoft/react-native-windows#16489;
the failure predates that trigger-only change.

What



  • Checked bootstrap. Both callers share cRNL 0.63.0's supported RN 0.85.0
    bootstrap and check the exact RN/template pair through the configured registry,
    so dist-tags cannot select an incompatible scaffold.


  • Preserved targets. Stable versions stay unchanged. Nightly library and
    example dependencies still return to the requested RN/CLI versions before
    resolution; a failed branch does not discard healthy closures.


  • Regression coverage. Command-level tests and policy documentation cover
    shared selection, checkout paths, and explicit failures, so generator upgrades cannot
    silently reuse an unreviewed bootstrap.

Screenshots

Not applicable; no UI changes.

Testing



  • yarn test --scope @rnw-scripts/warm-feed - passed, 105 tests with inherited uppercase npm settings.


  • yarn workspace @rnw-scripts/warm-feed lint - passed; changed-file formatting was also checked explicitly.


  • yarn workspace @rnw-scripts/warm-feed build - passed.

Real Windows scaffolding with an empty npm cache and anonymous feed access
passed, including both nightly manifest rewrites, actual warmer collection, and
both dependency-graph resolutions. Full clean-agent/native CI validation is pending.

Changelog

Should this change be included in the release notes: yes

Use a compatible bootstrap when creating Windows libraries against nightly React Native.

Microsoft Reviewers: Open in CodeFlow

Comments Threads Pending Resolution

ljharb reviewed on October 18, 2026
ljharb left a comment

### 🟢 Approval recommended

The focused changes preserve stable behavior, cover relevant failure paths, and have no identified blocking issues.

**No open issues** 🎉

Review effort: Balanced

ljharb reviewed on October 18, 2026
ljharb left a comment

### 🟢 Approval recommended

No unresolved blocking issues remain, and targeted regressions cover selection, path handling, dependency preservation, and failure isolation.

**No open issues** 🎉

1 resolved since last review

- High severity [Fix script path resolution when --repo-root is relative](https://github.com/microsoft/react-native-windows/pull/16490#discussion_r4307859777)

Review effort: Balanced

ljharb reviewed on October 18, 2026
ljharb left a comment

### 🟡 Changes recommended

Relative repository paths break nightly feed warming when launching the shared resolver.

1 open issue

- High severity [Fix script path resolution when --repo-root is relative](https://github.com/microsoft/react-native-windows/pull/16490#discussion_r4307859777) · New

What changed in this PR

Replaces nightly library scaffolding’s `latest` selection with a checked, generator-compatible bootstrap shared by the CLI and feed warmer.

**Changes:**
- Pins and validates matching React Native/template versions.
- Preserves stable versions and nightly dependency rewrites.
- Adds regression coverage and bootstrap documentation.

| File | Description |
| ---- | ----------- |
| vnext/​Scripts/​GetReactNativeLibraryScaffoldVersion.js | Adds shared bootstrap validation. |
| vnext/​Scripts/​creaternwlib.cmd | Uses the shared resolver for nightlies. |
| packages/​@rnw-scripts/​warm-feed/​src/​test/​reactNativeLibraryScaffold.test.ts | Tests resolver and Windows CLI behavior. |
| packages/​@rnw-scripts/​warm-feed/​src/​test/​createReactNativeLibrary.test.ts | Tests warmer integration and failure handling. |
| packages/​@rnw-scripts/​warm-feed/​src/​specialModules/​createReactNativeLibrary.ts | Integrates shared scaffold selection. |
| packages/​@rnw-scripts/​warm-feed/​README.md | Documents bootstrap selection and maintenance. |
| change/​react-native-windows-6312f66b-0df9-4df7-b9d1-897bb9053c9a.json | Records the prerelease change. |

Review effort: Balanced

Resolved Comment Threads

ljharb reviewed on October 18, 2026
ljharb left a comment

### 🟡 Changes recommended

Relative repository paths break nightly feed warming when launching the shared resolver.

1 open issue

- High severity [Fix script path resolution when --repo-root is relative](https://github.com/microsoft/react-native-windows/pull/16490#discussion_r4307859777) · New

What changed in this PR

Replaces nightly library scaffolding’s `latest` selection with a checked, generator-compatible bootstrap shared by the CLI and feed warmer.

**Changes:**
- Pins and validates matching React Native/template versions.
- Preserves stable versions and nightly dependency rewrites.
- Adds regression coverage and bootstrap documentation.

| File | Description |
| ---- | ----------- |
| vnext/​Scripts/​GetReactNativeLibraryScaffoldVersion.js | Adds shared bootstrap validation. |
| vnext/​Scripts/​creaternwlib.cmd | Uses the shared resolver for nightlies. |
| packages/​@rnw-scripts/​warm-feed/​src/​test/​reactNativeLibraryScaffold.test.ts | Tests resolver and Windows CLI behavior. |
| packages/​@rnw-scripts/​warm-feed/​src/​test/​createReactNativeLibrary.test.ts | Tests warmer integration and failure handling. |
| packages/​@rnw-scripts/​warm-feed/​src/​specialModules/​createReactNativeLibrary.ts | Integrates shared scaffold selection. |
| packages/​@rnw-scripts/​warm-feed/​README.md | Documents bootstrap selection and maintenance. |
| change/​react-native-windows-6312f66b-0df9-4df7-b9d1-897bb9053c9a.json | Records the prerelease change. |

Review effort: Balanced

packages/@rnw-scripts/warm-feed/src/specialModules/createReactNativeLibrary.ts
Outdated