-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(query): Add command alongside package selector syntax #463
Comments
npm query
command (alongside a package selector syntax)
High-level issues/investigation areas
|
"Adding an i (or I) before the closing bracket causes the value to be compared case-insensitively (for characters within the ASCII range)." |
@ljharb I've quoted them for clarity but as per @wraithgar's comment I do not believe they need to be in quoted based on what I've read (update: I've tested this & quotes aren't required). |
yes, indeed, i deleted my comment - i wasn't aware of that "suffix" feature. |
I think I fixed the |
@ruyadorno This code has been a treat to refactor. Every improvement I've made has either been a bugfix (which is inevitable in a codebase this big) or something that was high level and thus would have been inappropriate to even try to do on a first pass PR. |
Summary
Introduce a much needed top-level command & net-new capabilities for dependency selection/discovery.
Exit Criteria
npm query
command which parses a dependency selector & returns a NodeList.querySelectorAll()
method toArborist
'sNode
classSelector Breakdown
Universal Selectors
*
universal selector#<name>
dependency selector (equivalent to[name="..."]
)#<name>@<version>
(equivalent to[name=<name>]:semver(<version>)
),
selector list delimiter.
class selector:
pseudo class selector>
direct decendent/child selector~
sibling selectorAttribute Selectors
[]
attribute selector (ie. existence of attribute)[attribute=value]
attribute value is equivalant...[attribute~=value]
attribute value contains word...[attribute*=value]
attribute value contains string...[attribute|=value]
attribute value is equal to or starts with...[attribute^=value]
attribute value begins with...[attribute$=value]
attribute value ends with...Pseudo Selectors
:not(<selector>)
:has(<selector>)
:is(<selector list>)
:root
matches the root node/dependency:scope
matches node/dependency it was queried against:empty
when a dependency has no dependencies:private
when a dependency is private:link
when a dependency is linked:extraneous
when a dependency exists but is not defined as a dependency of any node:invalid
when a dependency version is out of its ancestors specified range:missing
when a dependency is not found on disk:semver(<spec>)
matching a validnode-semver
spec:deduped
when a dependency has been deduped:path(<path>)
glob matching based on dependencies path relative to the project:type(<type>)
based on currently recognized types:attr(<key>, <attribute selector>)
see belowArray
&Object
Attribute SelectorsObject
Selection:Array
Attribute Selections:Array
match value Selection:Array
ofObject
s Selection:Classes/Groups
.prod
.dev
.optional
.peer
.bundled
.workspace
Links & References
npm query
rfcs#564estree
abstract-syntax-tree
postcss-selector-parser
/ APICSS
, Selectors & Pseudo Class SpecificationsStretch Goals
@npmcli/queryparser
(or similar name) to manage syntactical nuances to the spec (ex. hashed package name & semver range de-sugaring):outdated()
when a dependency has available updates (options for specifying the range, defaults to parent's dependent range):vulnerable
when a dependency has aCVE
:override
when a dependency is an overrideArborist.loadActul()
needs to be improved forovrrides
The text was updated successfully, but these errors were encountered: