From e88059c95fa8facd7bb237081117c752338761d7 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Fri, 26 Apr 2024 22:59:46 -0700 Subject: [PATCH 1/3] clarify npm warning only occurs on version 3-6 --- docs/lib/content/configuring-npm/package-json.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/lib/content/configuring-npm/package-json.md b/docs/lib/content/configuring-npm/package-json.md index 9727e7e77f909..a0c7e38015a2f 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -818,8 +818,8 @@ to express this. If you depend on features introduced in 1.5.2, use ### peerDependenciesMeta -When a user installs your package, npm will emit warnings if packages -specified in `peerDependencies` are not already installed. The +When a user installs your package, npm versions 3 through 6 will emit warnings +if packages specified in `peerDependencies` are not already installed. The `peerDependenciesMeta` field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional. From add243e588d62a1a4707c0b7ab9f51d0a5d6d79d Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Wed, 1 May 2024 00:14:30 -0700 Subject: [PATCH 2/3] Clarify language in peerDependency --- docs/lib/content/configuring-npm/package-json.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/lib/content/configuring-npm/package-json.md b/docs/lib/content/configuring-npm/package-json.md index a0c7e38015a2f..70129d3610a33 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -818,11 +818,12 @@ to express this. If you depend on features introduced in 1.5.2, use ### peerDependenciesMeta -When a user installs your package, npm versions 3 through 6 will emit warnings -if packages specified in `peerDependencies` are not already installed. The -`peerDependenciesMeta` field serves to provide npm more information on how +The `peerDependenciesMeta` field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer -dependencies to be marked as optional. +dependencies to be marked as optional. Npm would not automatically install +optional peer dependencies. This allows you to +integrate and interact with a variety of host packages without requiring +all of them to be installed. For example: @@ -842,11 +843,6 @@ For example: } ``` -Marking a peer dependency as optional ensures npm will not emit a warning -if the `soy-milk` package is not installed on the host. This allows you to -integrate and interact with a variety of host packages without requiring -all of them to be installed. - ### bundleDependencies This defines an array of package names that will be bundled when publishing From 91cfb90c6a6846669200994c9ad6b941d4f1d217 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 1 May 2024 12:25:19 -0700 Subject: [PATCH 3/3] fixup: Update docs/lib/content/configuring-npm/package-json.md --- docs/lib/content/configuring-npm/package-json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lib/content/configuring-npm/package-json.md b/docs/lib/content/configuring-npm/package-json.md index 70129d3610a33..2755b8008d014 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -820,7 +820,7 @@ to express this. If you depend on features introduced in 1.5.2, use The `peerDependenciesMeta` field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer -dependencies to be marked as optional. Npm would not automatically install +dependencies to be marked as optional. Npm will not automatically install optional peer dependencies. This allows you to integrate and interact with a variety of host packages without requiring all of them to be installed.