diff --git a/e2e/release/src/private-js-packages.test.ts b/e2e/release/src/private-js-packages.test.ts index f08f2048cd8d74..99f50e86c37ad3 100644 --- a/e2e/release/src/private-js-packages.test.ts +++ b/e2e/release/src/private-js-packages.test.ts @@ -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. diff --git a/packages/nx/schemas/nx-schema.json b/packages/nx/schemas/nx-schema.json index a3aa09e8d62ba3..ff59caae1048c9 100644 --- a/packages/nx/schemas/nx-schema.json +++ b/packages/nx/schemas/nx-schema.json @@ -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." }, diff --git a/packages/nx/src/command-line/release/publish.ts b/packages/nx/src/command-line/release/publish.ts index 5d72331350f9a7..5bc58a68822a3f 100644 --- a/packages/nx/src/command-line/release/publish.ts +++ b/packages/nx/src/command-line/release/publish.ts @@ -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` ); }