You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatically exclude dev-tool transitive dependencies from license checks #74429
The bin/check-licenses.mjs script currently requires manually maintaining an ignore list for packages like @ampproject/remapping, webpack, bser, fb-watchman, and walker (Jest internals with Apache-2.0 license). Some of these packages appear in the license check because:
@wordpress/scripts has jest as a production dependency (because it's a tooling package that provides Jest to consumers)
The npm query .workspace:attr([wpScript],[wpScriptModuleExports]) :is(.prod) includes all transitive dependencies
Jest's internal packages have Apache-2.0 license which isn't GPL2-compatible
These packages are only used for testing and are not distributed with WordPress, so they shouldn't require GPL2 compatibility checks. Currently, we manually add them to the ignored array, but this approach doesn't scale well as new dev-tool dependencies are added.
What is your proposed solution?
Automatically filter out transitive dependencies that come exclusively from dev-only packages (like @wordpress/scripts).
Implementation approach:
Add a devOnlyPackages configuration listing packages whose transitive deps should be excluded:
constdevOnlyPackages=['@wordpress/scripts'];
Run two npm queries:
Get all prod deps of packages with wpScript/wpScriptModuleExports
Get all deps of dev-only packages
Filter out packages that are only reachable through dev-only packages:
Activity