Skip to content

Commit

Permalink
docs(release): add recipe for preVersionCommand (#27782)
Browse files Browse the repository at this point in the history
Adds a recipe for using `release.preVersionCommand` to ensure packages
are built before they are versioned.
  • Loading branch information
fahslaj authored Sep 5, 2024
1 parent d0293b2 commit 3d8c3ed
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Build Before Versioning",
"path": "/recipes/nx-release/build-before-versioning",
"id": "build-before-versioning",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
Expand Down Expand Up @@ -3776,6 +3784,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Build Before Versioning",
"path": "/recipes/nx-release/build-before-versioning",
"id": "build-before-versioning",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
Expand Down Expand Up @@ -3876,6 +3892,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Build Before Versioning",
"path": "/recipes/nx-release/build-before-versioning",
"id": "build-before-versioning",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Other",
"path": "/recipes/other",
Expand Down
33 changes: 33 additions & 0 deletions docs/generated/manifests/nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -2779,6 +2779,17 @@
"isExternal": false,
"path": "/recipes/nx-release/publish-custom-dist-directory",
"tags": ["nx-release"]
},
{
"id": "build-before-versioning",
"name": "Build Before Versioning",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/build-before-versioning",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/build-before-versioning",
"tags": ["nx-release"]
}
],
"isExternal": false,
Expand Down Expand Up @@ -5169,6 +5180,17 @@
"isExternal": false,
"path": "/recipes/nx-release/publish-custom-dist-directory",
"tags": ["nx-release"]
},
{
"id": "build-before-versioning",
"name": "Build Before Versioning",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/build-before-versioning",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/build-before-versioning",
"tags": ["nx-release"]
}
],
"isExternal": false,
Expand Down Expand Up @@ -5307,6 +5329,17 @@
"path": "/recipes/nx-release/publish-custom-dist-directory",
"tags": ["nx-release"]
},
"/recipes/nx-release/build-before-versioning": {
"id": "build-before-versioning",
"name": "Build Before Versioning",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/build-before-versioning",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/build-before-versioning",
"tags": ["nx-release"]
},
"/recipes/other": {
"id": "other",
"name": "Other",
Expand Down
7 changes: 7 additions & 0 deletions docs/generated/manifests/tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,13 @@
"name": "Publish a Custom Dist Directory",
"path": "/recipes/nx-release/publish-custom-dist-directory"
},
{
"description": "",
"file": "shared/recipes/nx-release/build-before-versioning",
"id": "build-before-versioning",
"name": "Build Before Versioning",
"path": "/recipes/nx-release/build-before-versioning"
},
{
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/release",
Expand Down
6 changes: 6 additions & 0 deletions docs/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,12 @@
"id": "publish-custom-dist-directory",
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/publish-custom-dist-directory"
},
{
"name": "Build Before Versioning",
"id": "build-before-versioning",
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/build-before-versioning"
}
]
},
Expand Down
15 changes: 15 additions & 0 deletions docs/shared/recipes/nx-release/build-before-versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Build Before Versioning

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`:

```json {% fileName="nx.json" %}
{
"release": {
"version": {
"preVersionCommand": "npx nx run-many -t build"
}
}
}
```

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.
1 change: 1 addition & 0 deletions docs/shared/reference/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
- [Update Your Local Registry Setup to use Nx Release](/recipes/nx-release/update-local-registry-setup)
- [Configure Changelog Format](/recipes/nx-release/configure-changelog-format)
- [Publish a Custom Dist Directory](/recipes/nx-release/publish-custom-dist-directory)
- [Build Before Versioning](/recipes/nx-release/build-before-versioning)
- [Other](/recipes/other)
- [Rescope Packages from @nrwl to @nx](/recipes/other/rescope)
- [Troubleshoot Nx Console Issues](/recipes/nx-console/console-troubleshooting)
Expand Down

0 comments on commit 3d8c3ed

Please sign in to comment.