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
Copy file name to clipboardexpand all lines: README.md
+68-1
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,8 @@ If you look in ILSpy, you will also see all the information:
47
47
* You can also customize the information to be embedded. For example, by embedding the value of variables used in MSBuild, you can also embed detailed information at build time.
48
48
* Version embedding is fully integrated into MSBuild. This means that you can simply install the NuGet package and embed versions directly in the build process of IDEs such as Visual Studio, Rider, Visual Studio Code or in the build process of CI.
49
49
* RelaxVersioner does not contain any environment-dependent code, so it works in almost any .NET environment.
50
-
* A CLI interface also exists. You can embed version numbers in text documents and apply the same version notation to different project systems than .NET (e.g. NPM's `project.json`, `Makefile` and etc.).
50
+
* A CLI interface also exists. You can embed version numbers in text documents and apply the same version notation to different project systems than .NET (e.g. `Makefile` and etc.).
51
+
* CLI has a dedicated NPM (Node.js package manager) mode, which allows you to easily centralize NPM project and version operations.
51
52
52
53
## Sample output code
53
54
@@ -218,6 +219,69 @@ With this CLI, you can use a combination of RelaxVersioner for different targets
218
219
For example, in a CI/CD environment like GitHub Actions, you can apply versions to NPM package generation or embed versions in your text documentation.
219
220
220
221
222
+
----
223
+
224
+
## Using with Node.js projects
225
+
226
+
The CLI interface has special options for NPM (Node.js package manager).
227
+
Change to the directory where the `package.json` file is located and run the CLI as follows:
* Dependency checks are performed on the `dependencies`, `peerDependencies` and `devDependencies` keys.
275
+
* Please use a consistent package namespace to identify dependent packages.
276
+
* In practice, this is a simple prefix match, so any name that can be identified is fine.
277
+
* If you are targeting multiple namespaces, specify them separated by commas.
278
+
* The version of a dependent package is automatically prefixed with `^`.
279
+
280
+
This function is intended to be used with [NPM workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) and inside the CI process.
281
+
In that case, please follow the NPM workspaces handling, such as using `*` as the version number of the referenced package.
282
+
After updating the version of each package, run `npm install` in the workspace root directory to update the correct version numbers in `package-lock.json`.
283
+
284
+
221
285
----
222
286
223
287
## Hints and Tips
@@ -462,6 +526,9 @@ When you are using a nuspec file to generate a NuGet package, there are addition
462
526
463
527
## History
464
528
529
+
* 3.8.0:
530
+
* Added NPM mode, which automatically inserts the version of NPM `package.json`.
531
+
* Fixed version number print garbage in the build log when building NuGet packages.
0 commit comments