From b29d348f60257ce7c22879b53398811560a47a08 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 18 Jul 2023 23:00:02 -0400 Subject: [PATCH 1/2] Update package-json.md - json to jsonc json to jsonc. for sections with comments. Minor change for github markdown to stop showing --- 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 219296f6186c7..13b42d72b931e 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -144,7 +144,7 @@ Then include a file named `` at the top level of the package. Some old packages used license objects or a "licenses" property containing an array of license objects: -```json +```jsonc // Not valid metadata { "license" : { @@ -985,7 +985,7 @@ this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a `$`. -```json +```jsonc { "dependencies": { "foo": "^1.0.0" From 779ad10d0d5d9444cdc4bd307cf8ee9cc06bc3e4 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 18 Jul 2023 23:38:20 -0400 Subject: [PATCH 2/2] Update package-json.md - monorepo react-dom Updated example for monorepo, react, react-dom Also, added tree folder structure --- docs/lib/content/configuring-npm/package-json.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/lib/content/configuring-npm/package-json.md b/docs/lib/content/configuring-npm/package-json.md index 13b42d72b931e..3f712d3633655 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -516,11 +516,9 @@ same shortcut syntax you use for `npm install`: } ``` -If the `package.json` for your package is not in the root directory (for -example if it is part of a monorepo), you can specify the directory in -which it lives: - -```json +If your `package.json` isn't in the root directory, common with monorepos like Facebook's React, you can specify its location. i.e. `react-dom`: +```jsonc +/* @/packages/react-dom/package.json */ { "repository": { "type": "git", @@ -529,6 +527,12 @@ which it lives: } } ``` +```txt +react.git/ +└── packages/ + └── react-dom/ + └── package.json +``` ### scripts