|
11 | 11 | // affected — faster command for `pnpm pre-ci:affected` (defaults to `command`) |
12 | 12 | // affectedWhen: 'codegen' — in affected mode, run only when the diff plausibly |
13 | 13 | // changes generated output; otherwise skip with a reminder. |
| 14 | +// |
| 15 | +// Affected commands base on `origin/main` (not the local `main` that nx's |
| 16 | +// defaultBase would use), matching the codegen/vitest change detection so all of |
| 17 | +// pre-ci:affected reasons about the same diff. |
14 | 18 |
|
15 | 19 | export const CI_GATES = [ |
16 | 20 | // --- gates a contributor can reproduce locally before pushing --- |
17 | 21 | // Ordered as pre-ci should run them: build precedes the oclif codegen check, |
18 | 22 | // and the graphql check precedes the oclif check (their whole-repo `git status` |
19 | 23 | // asserts otherwise cross-contaminate in a single working tree). |
20 | | - {job: 'type-check', kind: 'pre-ci', command: 'pnpm type-check', affected: 'pnpm type-check:affected'}, |
21 | | - {job: 'lint', kind: 'pre-ci', command: 'pnpm lint', affected: 'pnpm lint:affected'}, |
22 | | - {job: 'bundle', kind: 'pre-ci', command: 'pnpm build', affected: 'pnpm build:affected'}, |
| 24 | + {job: 'type-check', kind: 'pre-ci', command: 'pnpm type-check', affected: 'pnpm exec nx affected --target=type-check --base=origin/main'}, |
| 25 | + {job: 'lint', kind: 'pre-ci', command: 'pnpm lint', affected: 'pnpm exec nx affected --target=lint --base=origin/main'}, |
| 26 | + {job: 'bundle', kind: 'pre-ci', command: 'pnpm build', affected: 'pnpm exec nx affected --target=build --base=origin/main'}, |
23 | 27 | {job: 'knip', kind: 'pre-ci', command: 'pnpm knip'}, |
24 | 28 | {job: 'graphql-schema', kind: 'pre-ci', command: 'pnpm codegen:check:graphql', affectedWhen: 'codegen'}, |
25 | 29 | {job: 'oclif-checks', kind: 'pre-ci', command: 'pnpm codegen:check:oclif', affectedWhen: 'codegen'}, |
|
0 commit comments