Skip to content

Commit 28c48dd

Browse files
author
John Doe
committed
Merge remote-tracking branch 'origin/feat/plugin-nx/allow-unreleased-code' into feat/plugin-nx/allow-unreleased-code
2 parents 340d700 + 60697d7 commit 28c48dd

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

packages/nx-plugin/src/plugin/target/executor-target.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ export function createExecutorTarget(options?: {
88
}): TargetConfiguration<ProjectPrefixOptions> {
99
const { bin, projectPrefix } = options ?? {};
1010

11-
const targetConfig: TargetConfiguration<ProjectPrefixOptions> = {
12-
executor: `${PACKAGE_NAME}:cli`,
11+
const executor = `${PACKAGE_NAME}:cli`;
12+
const options = (bin || projectPrefix) && {
13+
...(bin && { bin }),
14+
...(projectPrefix && { projectPrefix }),
1315
};
14-
15-
if (bin || projectPrefix) {
16-
targetConfig.options = {
17-
...(bin ? { bin } : {}),
18-
...(projectPrefix ? { projectPrefix } : {}),
19-
};
20-
}
21-
22-
return targetConfig;
16+
return { executor, ...(options && { options })};
2317
}

packages/nx-plugin/src/plugin/target/executor.target.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('createExecutorTarget', () => {
88
});
99
});
1010

11-
it('should use bin if provides', () => {
11+
it('should use bin if provided', () => {
1212
expect(
1313
createExecutorTarget({ bin: 'packages/cli/src/index.ts' }),
1414
).toStrictEqual({

0 commit comments

Comments
 (0)