[wp-trac] [WordPress Trac] #51784: Build/Test Tools: Consider always running npm install with --no-optional
WordPress Trac
noreply at wordpress.org
Wed Jan 3 17:12:41 UTC 2024
#51784: Build/Test Tools: Consider always running npm install with --no-optional
-----------------------------------------+-----------------------------
Reporter: azaozz | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion has-patch close | Focuses:
-----------------------------------------+-----------------------------
Changes (by desrosj):
* keywords: 2nd-opinion has-patch => 2nd-opinion has-patch close
Comment:
Just noting that `--omit=optional` and `--include=optional` are now the
preferred flags for achieving what we're looking for here. The old form
ones listed above now produce warnings.
I'm going to mark this as a `close` candidate with a `maybelater`
resolution.
I am personally against adding a blanket option for skipping optional
dependencies because it's such a rabbit hole and there are likely going to
be unknown side effects that change every time package versions are
bumped. These edge cases will also end up being different for different
version branches over time, which sounds like a real headache. I prefer to
defer to npm for determining which packages are appropriate to install as
much as possible.
However, I would be in favor of adding some details to the README file
that explain the benefits of the `--omit=optional` option for any
contributors that would like to utilize it. If they want, they can define
this in their [https://docs.npmjs.com/cli/v7/configuring-npm/npmrc#per-
user-config-file per-user config file], or simply just include
`--omit=optional` when running the `npm install` command.
In general, I think we should be more mindful of the packages we're
utilizing, how they're being used, and what the broader impacts are for
contributors.
Leaving this open for feedback from other contributors with an interest,
but if there's no strong disagreement in 2-3 months, I'll circle back to
close this out.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51784#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list