Skip to content

fix(release): adjust publish error message and version schema #31190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions e2e/release/src/private-js-packages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ describe('nx release - private JS packages', () => {

- {private-project-name}

This is usually caused by not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "nx-release-publish" target for you automatically.

This is usually caused by either
- not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "nx-release-publish" target for you automatically
- having "private": true set in your package.json, which prevents the target from being created

Pass --verbose to see the stacktrace.


Expand Down
23 changes: 22 additions & 1 deletion packages/nx/schemas/nx-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,28 @@
"manifestRootsToUpdate": {
"type": "array",
"items": {
"type": "string"
"oneOf": [
{
"type": "string",
"description": "Path to the directory containing manifest files to update. Supports placeholders like {projectRoot} and {projectName}."
},
{
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path to the directory containing manifest files to update. Supports placeholders like {projectRoot} and {projectName}."
},
"preserveLocalDependencyProtocols": {
"type": "boolean",
"description": "Whether to preserve local dependency references using protocols like 'workspace:' or 'file:'. Set to false for dist files that need to be published.",
"default": true
}
},
"required": ["path"],
"additionalProperties": false
}
]
},
"description": "A list of directories containing manifest files (such as package.json) to apply updates to when versioning. By default, only the project root will be used, but you could customize this to only version a manifest in a dist directory, or even version multiple manifests in different directories, such as both source and dist."
},
Expand Down
4 changes: 3 additions & 1 deletion packages/nx/src/command-line/release/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ async function runPublishOnProjects(
`Based on your config, the following projects were matched for publishing but do not have the "${requiredTargetName}" target specified:\n${[
...projectsToRun.map((p) => `- ${p.name}`),
'',
`This is usually caused by not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "${requiredTargetName}" target for you automatically.`,
`This is usually caused by either`,
`- not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "${requiredTargetName}" target for you automatically`,
`- having "private": true set in your package.json, which prevents the target from being created`,
].join('\n')}\n`
);
}
Expand Down
Loading