Skip to content

Commit

Permalink
fix(semver): handle post targets with format project:target
Browse files Browse the repository at this point in the history
  • Loading branch information
edbzn committed Mar 24, 2024
1 parent 5396ebb commit 3f61354
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/semver/src/generators/migrate-nx-release/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,18 @@ function removeSemverTargets(
const [versionTarget, targetConfig] = findVersionTarget(projectConfig)!;
const postTargets = (targetConfig.options?.postTargets ?? []).filter(
(target) => {
const executor = projectConfig.targets?.[target].executor;
// Note: we are not using parseTargetString here as we need to pass the project graph, let's keep it simple.
const targetName = target.includes(':') ? target.split(':')[1] : target;
const executor = projectConfig.targets?.[targetName].executor;
return (
executor?.includes('semver') ||
executor?.includes('ngx-deploy-npm') ||
// Drop targets defined with both format:
// { command: "npm publish" }
// { executor: "nx:run-commands", options: { commands: "npm publish" } }
/npm publish/.test(JSON.stringify(projectConfig.targets?.[target])) ||
/npm publish/.test(
JSON.stringify(projectConfig.targets?.[targetName]),
) ||
false
);
},
Expand Down

0 comments on commit 3f61354

Please sign in to comment.