Skip to content

Commit

Permalink
fix(core): fix undefined projectName in tasks runner (#13044)
Browse files Browse the repository at this point in the history
Co-authored-by: eric.zhang <eric.zhang@backstopdevelopment.com>
CLOSED #13018
Fixes #13018
  • Loading branch information
yeezy58 committed Nov 8, 2022
1 parent c9b5f58 commit bcd43cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions packages/nx/src/tasks-runner/utils.spec.ts
Expand Up @@ -40,15 +40,20 @@ describe('utils', () => {
)
).toEqual([]);
});
it('should interpolate {workspaceRoot} and {projectRoot}', () => {

it('should interpolate {workspaceRoot}, {projectRoot} and {projectName}', () => {
expect(
getOutputsForTargetAndConfiguration(
task,
getNode({
outputs: ['{workspaceRoot}/one', '{projectRoot}/two'],
outputs: [
'{workspaceRoot}/one',
'{projectRoot}/two',
'{projectName}/three',
],
})
)
).toEqual(['one', 'myapp/two']);
).toEqual(['one', 'myapp/two', 'myapp/three']);
});

it('should interpolate {projectRoot} when it is not in front', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/tasks-runner/utils.ts
Expand Up @@ -157,8 +157,8 @@ export function getOutputsForTargetAndConfiguration(
.map((output: string) => {
return interpolate(output, {
projectRoot: node.data.root,
projectName: node.data.name,
project: { ...node.data, name: node.data.name }, // this is legacy
projectName: node.name,
project: { ...node.data, name: node.name }, // this is legacy
options,
});
})
Expand Down

1 comment on commit bcd43cb

@vercel
Copy link

@vercel vercel bot commented on bcd43cb Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.