CLI documentation update from CI

CI User committed Dec 3, 2021 at 02:27 UTC 2dc7ee1ef636c1cc64b4e3af3de1ab0253c7f87b
6 files changed +77 -6
cli/v8
+1 -1
@@ -1 +1 @@
1 -Subproject commit 940ba878019e7b35bda20a26baaa4c99bebc906b
1 +Subproject commit 4dbeb007d0d6350284c7b1edbf4d5b0030c67c66
content/cli/v8/using-npm/config.md
+3 -3
@@ -1022,8 +1022,8 @@ Ideal if all users are on npm version 7 and higher.
1022 * Type: "silent", "error", "warn", "notice", "http", "timing", "info",
1023 "verbose", or "silly"
1024
1025 -What level of logs to report. On failure, *all* logs are written to
1026 -`npm-debug.log` in the current working directory.
1025 +What level of logs to report. All logs are written to a debug log, with the
1026 +path to that file printed if the execution of a command fails.
1027
1028 Any logs of a higher level than the setting are shown. The default is
1029 "notice".
@@ -1395,7 +1395,7 @@ Save installed packages to a package.json file as `optionalDependencies`.
1395 * Default: false
1396 * Type: Boolean
1397
1398 -Save installed packages. to a package.json file as `peerDependencies`
1398 +Save installed packages to a package.json file as `peerDependencies`
1399
1400 <!-- automatically generated, do not edit manually -->
1401 <!-- see lib/utils/config/definitions.js -->
content/cli/v8/using-npm/logging.md new
+68
@@ -0,0 +1,68 @@
1 +---
2 +title: Logging
3 +section: 7
4 +description: Why, What & How we Log
5 +redirect_from:
6 + - /using-npm/logging
7 + - /using-npm/logging.html
8 + - /misc/logging
9 + - /misc/logging.html
10 +github_repo: npm/cli
11 +github_branch: latest
12 +github_path: docs/content/using-npm/logging.md
13 +---
14 +
15 +### Description
16 +
17 +The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.
18 +
19 +### Setting Log Levels
20 +
21 +#### `loglevel`
22 +
23 +`loglevel` is a global argument/config that can be set to determine the type of information to be displayed.
24 +
25 +The default value of `loglevel` is `"notice"` but there are several levels/types of logs available, including:
26 +
27 +- `"silent"`
28 +- `"error"`
29 +- `"warn"`
30 +- `"notice"`
31 +- `"http"`
32 +- `"timing"`
33 +- `"info"`
34 +- `"verbose"`
35 +- `"silly"`
36 +
37 +All logs pertaining to a level proceeding the current setting will be shown.
38 +
39 +All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
40 +
41 +##### Aliases
42 +
43 +The log levels listed above have various corresponding aliases, including:
44 +
45 +- `-d`: `--loglevel info`
46 +- `--dd`: `--loglevel verbose`
47 +- `--verbose`: `--loglevel verbose`
48 +- `--ddd`: `--loglevel silly`
49 +- `-q`: `--loglevel warn`
50 +- `--quiet`: `--loglevel warn`
51 +- `-s`: `--loglevel silent`
52 +- `--silent`: `--loglevel silent`
53 +
54 +#### `foreground-scripts`
55 +
56 +The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as of `v7`. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in `package.json`. If you'd like to change this behavior & log this output you can set `foreground-scripts` to `true`.
57 +
58 +### Registry Response Headers
59 +
60 +#### `npm-notice`
61 +
62 +The `npm` CLI reads from & logs any `npm-notice` headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.
63 +
64 +This header is not cached, and will not be logged if the request is served from the cache.
65 +
66 +### See also
67 +
68 +* [config](/cli/v8/using-npm/config)
content/cli/v8/using-npm/scripts.md
+1 -1
@@ -267,7 +267,7 @@ package.json file, then your package scripts would have the
267 in your code with `process.env.npm_package_name` and
268 `process.env.npm_package_version`, and so on for other fields.
269
270 -See [`package-json.md`](/cli/v8/configuring-npm/package-json) for more on package configs.
270 +See [`package.json`](/cli/v8/configuring-npm/package-json) for more on package configs.
271
272 #### current lifecycle event
273
content/cli/v8/using-npm/workspaces.md
+1 -1
@@ -16,7 +16,7 @@ github_path: docs/content/using-npm/workspaces.md
16
17 **Workspaces** is a generic term that refers to the set of features in the
18 npm cli that provides support to managing multiple packages from your local
19 -files system from within a singular top-level, root package.
19 +file system from within a singular top-level, root package.
20
21 This set of features makes up for a much more streamlined workflow handling
22 linked packages from the local file system. Automating the linking process
src/gatsby-theme-doctornpm/nav.yml
+3
@@ -1000,6 +1000,9 @@
1000 - title: Config
1001 url: /cli/v8/using-npm/config
1002 description: About npm configuration
1003 + - title: Logging
1004 + url: /cli/v8/using-npm/logging
1005 + description: Why, What & How we Log
1006 - title: Scope
1007 url: /cli/v8/using-npm/scope
1008 description: Scoped packages