Skip to content
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

fix(core): fix undefined projectName in tasks runner #13044

Merged
merged 1 commit into from Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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