发布

  • feat(core): revert array-shape targetDefaults support pending redesign and reapplication (#36005)

    frostbyte_neo 发布于 2026-06-15 19:57:11 +00:00

    Current Behavior

    nx.json targetDefaults accepts the new filtered array shape
    (entries matched by target/executor and narrowed by
    projects/plugin), alongside the legacy record shape. This was
    introduced and refined across:

    • #35340 — feat: support filtered array-shape targetDefaults with
      projects and source
    • #35711 — fix: do not drop target defaults in the 23.0.0 array
      migration
    • #35752 — docs: document the convert-target-defaults-to-array
      migration
    • #35991 — docs: rewrite the targetDefaults reference and guide for the
      array shape

    Expected Behavior

    This PR reverts the array-shape targetDefaults feature pending a
    redesign
    , with the intent that it be reapplied once the design is
    finalized. targetDefaults returns to the record-shape-only form
    (Record<string, Partial<TargetConfiguration>>).

    To keep reapplication easy, the revert is split into focused commits
    that mirror the original PRs — the feature can be brought back later by
    reverting these reverts.

    Changes:

    • Restore the TargetDefaults type; remove TargetDefaultEntry,
      TargetDefaultsRecord, and NormalizedTargetDefaults
    • Restore the core target-defaults matcher and project-configuration
      utils to the record-shape logic
    • Remove the convert-target-defaults-to-array migration (and its
      registration/docs)
    • Remove the devkit upsertTargetDefault/findTargetDefault helpers
      and the normalize-target-defaults utility; restore generators across
      all plugins (angular, cypress, react, jest, eslint, vite, etc.) to write
      the record shape
    • Restore the nx.json schema targetDefaults definition and revert
      the array-shape documentation

    Unrelated changes that landed in the same files after the feature are
    preserved (the CreateNodesV2CreateNodes rename, the
    findMatchingConfigFiles optimization, the nx migrate config,
    .gitignore entries, migration-doc packaging globs, and the maven
    createNodesV2 migration).

    Related Issue(s)

    Reverts #35340, #35711, #35752, #35991 (to be reapplied after redesign).


    Co-authored-by: Claude noreply@anthropic.com
    Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>

    下载附件