Skip to content

Commit 3d8c3ed

Browse files
authored
docs(release): add recipe for preVersionCommand (#27782)
Adds a recipe for using `release.preVersionCommand` to ensure packages are built before they are versioned.
1 parent d0293b2 commit 3d8c3ed

File tree

6 files changed

+86
-0
lines changed

6 files changed

+86
-0
lines changed

docs/generated/manifests/menus.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,14 @@
20332033
"isExternal": false,
20342034
"children": [],
20352035
"disableCollapsible": false
2036+
},
2037+
{
2038+
"name": "Build Before Versioning",
2039+
"path": "/recipes/nx-release/build-before-versioning",
2040+
"id": "build-before-versioning",
2041+
"isExternal": false,
2042+
"children": [],
2043+
"disableCollapsible": false
20362044
}
20372045
],
20382046
"disableCollapsible": false
@@ -3776,6 +3784,14 @@
37763784
"isExternal": false,
37773785
"children": [],
37783786
"disableCollapsible": false
3787+
},
3788+
{
3789+
"name": "Build Before Versioning",
3790+
"path": "/recipes/nx-release/build-before-versioning",
3791+
"id": "build-before-versioning",
3792+
"isExternal": false,
3793+
"children": [],
3794+
"disableCollapsible": false
37793795
}
37803796
],
37813797
"disableCollapsible": false
@@ -3876,6 +3892,14 @@
38763892
"children": [],
38773893
"disableCollapsible": false
38783894
},
3895+
{
3896+
"name": "Build Before Versioning",
3897+
"path": "/recipes/nx-release/build-before-versioning",
3898+
"id": "build-before-versioning",
3899+
"isExternal": false,
3900+
"children": [],
3901+
"disableCollapsible": false
3902+
},
38793903
{
38803904
"name": "Other",
38813905
"path": "/recipes/other",

docs/generated/manifests/nx.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,17 @@
27792779
"isExternal": false,
27802780
"path": "/recipes/nx-release/publish-custom-dist-directory",
27812781
"tags": ["nx-release"]
2782+
},
2783+
{
2784+
"id": "build-before-versioning",
2785+
"name": "Build Before Versioning",
2786+
"description": "",
2787+
"mediaImage": "",
2788+
"file": "shared/recipes/nx-release/build-before-versioning",
2789+
"itemList": [],
2790+
"isExternal": false,
2791+
"path": "/recipes/nx-release/build-before-versioning",
2792+
"tags": ["nx-release"]
27822793
}
27832794
],
27842795
"isExternal": false,
@@ -5169,6 +5180,17 @@
51695180
"isExternal": false,
51705181
"path": "/recipes/nx-release/publish-custom-dist-directory",
51715182
"tags": ["nx-release"]
5183+
},
5184+
{
5185+
"id": "build-before-versioning",
5186+
"name": "Build Before Versioning",
5187+
"description": "",
5188+
"mediaImage": "",
5189+
"file": "shared/recipes/nx-release/build-before-versioning",
5190+
"itemList": [],
5191+
"isExternal": false,
5192+
"path": "/recipes/nx-release/build-before-versioning",
5193+
"tags": ["nx-release"]
51725194
}
51735195
],
51745196
"isExternal": false,
@@ -5307,6 +5329,17 @@
53075329
"path": "/recipes/nx-release/publish-custom-dist-directory",
53085330
"tags": ["nx-release"]
53095331
},
5332+
"/recipes/nx-release/build-before-versioning": {
5333+
"id": "build-before-versioning",
5334+
"name": "Build Before Versioning",
5335+
"description": "",
5336+
"mediaImage": "",
5337+
"file": "shared/recipes/nx-release/build-before-versioning",
5338+
"itemList": [],
5339+
"isExternal": false,
5340+
"path": "/recipes/nx-release/build-before-versioning",
5341+
"tags": ["nx-release"]
5342+
},
53105343
"/recipes/other": {
53115344
"id": "other",
53125345
"name": "Other",

docs/generated/manifests/tags.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,13 @@
553553
"name": "Publish a Custom Dist Directory",
554554
"path": "/recipes/nx-release/publish-custom-dist-directory"
555555
},
556+
{
557+
"description": "",
558+
"file": "shared/recipes/nx-release/build-before-versioning",
559+
"id": "build-before-versioning",
560+
"name": "Build Before Versioning",
561+
"path": "/recipes/nx-release/build-before-versioning"
562+
},
556563
{
557564
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
558565
"file": "generated/packages/nx/documents/release",

docs/map.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,12 @@
10681068
"id": "publish-custom-dist-directory",
10691069
"tags": ["nx-release"],
10701070
"file": "shared/recipes/nx-release/publish-custom-dist-directory"
1071+
},
1072+
{
1073+
"name": "Build Before Versioning",
1074+
"id": "build-before-versioning",
1075+
"tags": ["nx-release"],
1076+
"file": "shared/recipes/nx-release/build-before-versioning"
10711077
}
10721078
]
10731079
},
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Build Before Versioning
2+
3+
In order to ensure that projects are built before the new version is applied to their package manifest, you can use the `preVersionCommand` property in `nx.json`:
4+
5+
```json {% fileName="nx.json" %}
6+
{
7+
"release": {
8+
"version": {
9+
"preVersionCommand": "npx nx run-many -t build"
10+
}
11+
}
12+
}
13+
```
14+
15+
This command will run the `build` target for all projects before the version step of Nx Release. Any command can be specified, including non-nx commands. This step is often required when [publishing from a custom dist directory](/recipes/nx-release/publish-custom-dist-directory), as the dist directory must be built before the version is applied to the dist directory's package manifest.

docs/shared/reference/sitemap.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
- [Update Your Local Registry Setup to use Nx Release](/recipes/nx-release/update-local-registry-setup)
170170
- [Configure Changelog Format](/recipes/nx-release/configure-changelog-format)
171171
- [Publish a Custom Dist Directory](/recipes/nx-release/publish-custom-dist-directory)
172+
- [Build Before Versioning](/recipes/nx-release/build-before-versioning)
172173
- [Other](/recipes/other)
173174
- [Rescope Packages from @nrwl to @nx](/recipes/other/rescope)
174175
- [Troubleshoot Nx Console Issues](/recipes/nx-console/console-troubleshooting)

0 commit comments

Comments
 (0)