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
Giant refactor:
- adds case insensitivity to attribute selectors
- fixes --include-workspace-root
- fixes -w results
- docs updates
- consolidating state into the `results` object and passing that to
the functions that the ast walker functions use.
- optimizing and refactoring other loops
- code consolidation and consistency between two different attribute
selectors
- Un-asyncify functions that don't do async operators. We leave the
exported fn async so we can add some in the future.
- lots of other minor tweaks/cleanups
Copy file name to clipboardexpand all lines: docs/content/using-npm/dependency-selectors.md
+19-6
Original file line number
Diff line number
Diff line change
@@ -20,16 +20,29 @@ The `npm query` commmand exposes a new dependency selector syntax (informed by &
20
20
- there is no "type" or "tag" selectors (ex. `div, h1, a`) as a dependency/target is the only type of `Node` that can be queried
21
21
- the term "dependencies" is in reference to any `Node` found in a `tree` returned by `Arborist`
22
22
23
+
#### Combinators
24
+
25
+
-`>` direct descendant/child
26
+
-`` any descendant/child
27
+
-`~` sibling
28
+
23
29
#### Selectors
24
30
25
31
-`*` universal selector
26
32
-`#<name>` dependency selector (equivalent to `[name="..."]`)
27
33
-`#<name>@<version>` (equivalent to `[name=<name>]:semver(<version>)`)
28
34
-`,` selector list delimiter
29
-
-`.` class selector
30
-
-`:` pseudo class selector
31
-
-`>` direct decendent/child selector
32
-
-`~` sibling selector
35
+
-`.` dependency type selector
36
+
-`:` pseudo selector
37
+
38
+
#### Dependency Type Selectors
39
+
40
+
-`.prod` dependency found in the `dependencies` section of `package.json`, or is a child of said dependency
41
+
-`.dev` dependency found in the `devDependencies` section of `package.json`, or is a child of said dependency
42
+
-`.optional` dependency found in the `optionalDependencies` section of `package.json`, or has `"optional": true` set in its entry in the `peerDependenciesMeta` section of `package.json`, or a child of said dependency
43
+
-`.peer` dependency found in the `peerDependencies` section of `package.json`
44
+
-`.workspace` dependency found in the `workspaces` section of `package.json`
45
+
-`.bundled` dependency found in the `bundleDependencies` section of `package.json`, or is a child of said dependency
0 commit comments