Skip to content

Commit

Permalink
feat(core): run commands directly
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Mar 6, 2024
1 parent cc2f655 commit ab2318b
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 76 deletions.
18 changes: 18 additions & 0 deletions docs/generated/devkit/Task.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ A representation of the invocation of an Executor

- [cache](../../devkit/documents/Task#cache): boolean
- [endTime](../../devkit/documents/Task#endtime): number
- [executor](../../devkit/documents/Task#executor): string
- [hash](../../devkit/documents/Task#hash): string
- [hashDetails](../../devkit/documents/Task#hashdetails): Object
- [id](../../devkit/documents/Task#id): string
- [options](../../devkit/documents/Task#options): Record<string, any>
- [outputs](../../devkit/documents/Task#outputs): string[]
- [overrides](../../devkit/documents/Task#overrides): any
- [projectRoot](../../devkit/documents/Task#projectroot): string
Expand All @@ -35,6 +37,14 @@ Unix timestamp of when a Batch Task ends

---

### executor

`Optional` **executor**: `string`

the executor to use to run the task

---

### hash

`Optional` **hash**: `string`
Expand Down Expand Up @@ -68,6 +78,14 @@ Unique ID

---

### options

`Optional` **options**: `Record`\<`string`, `any`\>

The options of the executor

---

### outputs

**outputs**: `string`[]
Expand Down
6 changes: 6 additions & 0 deletions e2e/nx-misc/src/extras.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ describe('Extra Nx Misc Tests', () => {
const result = runCLI(
`run ${mylib}:${echoTarget} --var1=a --var2=b --var-hyphen=c --varCamelCase=d`
);
console.log('result', result);
console.log(
runCLI(
`run ${mylib}:${echoTarget} --var1=a --var2=b --var-hyphen=c --varCamelCase=d --verbose`
)
);
expect(result).toContain('var1: a');
expect(result).toContain('var2: b');
expect(result).toContain('hyphen: c');
Expand Down
1 change: 1 addition & 0 deletions e2e/nx-run/src/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ describe('Nx Running Tests', () => {
.split('\n')
.map((r) => r.trim())
.filter((r) => r);
console.log('withBai', withBail);
withBail = withBail.slice(withBail.indexOf('Failed tasks:'));
expect(withBail.length).toEqual(2);
if (withBail[1] === `- ${myapp1}:error`) {
Expand Down
1 change: 0 additions & 1 deletion e2e/webpack/src/webpack.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
checkFilesExist,
cleanupProject,
newProject,
rmDist,
Expand Down
8 changes: 8 additions & 0 deletions packages/nx/src/config/task-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export interface Task {
* Overrides for the configured options of the target
*/
overrides: any;
/**
* the executor to use to run the task
*/
executor?: string;
/**
* The options of the executor
*/
options?: Record<string, any>;

/**
* The outputs the task may produce
Expand Down
Loading

0 comments on commit ab2318b

Please sign in to comment.