Skip to content

Policy conditions

This PR is to add resolve conditions to policies. This helps to align the use policies as a configuration of the capabilities of the default resolver. There is some minor refactoring to match naming a bit better across the code base. I did not see a clean place to actually traverse conditions and maybe we should make one? Additionally, this fixes policy dependency redirects to be working with ESM.

Tests not yet done as we may have minor alterations needed due to my less experience with "exports"/"imports" and actual condition resolution.

CC: @nodejs/modules-active-members due to the inconsistency with node: vs nodejs: prefix for builtin resolution vs policies. I think moving to nodejs: is fine, but would prefer node: personally. The only important bit is that they match.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading