From defb8cbb7c34be534f477409da8eb74be975ab4f Mon Sep 17 00:00:00 2001 From: Patrick Tazo Kuete <117319444+tazokuetep24@users.noreply.github.com> Date: Thu, 22 Oct 2026 09:31:14 +0000 Subject: [PATCH] Clarify semantic versioning usage in package.json Updated the explanation of specifying acceptable version ranges for dependencies in the package.json file. --- .../about-semantic-versioning.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content/packages-and-modules/contributing-packages-to-the-registry/about-semantic-versioning.mdx b/content/packages-and-modules/contributing-packages-to-the-registry/about-semantic-versioning.mdx index 16d86fca3cd..e1a41af3da7 100644 --- a/content/packages-and-modules/contributing-packages-to-the-registry/about-semantic-versioning.mdx +++ b/content/packages-and-modules/contributing-packages-to-the-registry/about-semantic-versioning.mdx @@ -30,7 +30,15 @@ To help developers who rely on your code, we recommend starting your package ver You can specify which update types your package can accept from dependencies in your package's `package.json` file. -For example, to specify acceptable version ranges up to 1.0.4, use the following syntax: +For example, to specify which dependency updates npm may accept, use semantic version ranges. + +Assuming the minimum desired version is **1.0.4**: + +- **Patch releases:** `~1.0.4` Accept versions `>=1.0.4` and `<1.1.0`. +- **Minor releases:** `^1.0.4` Accept versions `>=1.0.4` and `<2.0.0`. +- **Major, minor, and patch updates:** `>=1.0.4` Accept version `1.0.4` and all newer versions. + +Alternatively, wildcard ranges or omitting the respective entry can be used when a specific minimum version is not required: - Patch releases: `1.0` or `1.0.x` or `~1.0.4` - Minor releases: `1` or `1.x` or `^1.0.4`