Skip to content

Commit

Permalink
chore: update to Nx 20 (#4596)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver authored Nov 19, 2024
1 parent 4e8d529 commit 698f0b7
Show file tree
Hide file tree
Showing 61 changed files with 737 additions and 766 deletions.
4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const { getJestProjects } = require('@nx/jest');
const { getJestProjectsAsync } = require('@nx/jest');

export default { projects: getJestProjects() };
export default async () => ({ projects: await getJestProjectsAsync() });
2 changes: 1 addition & 1 deletion modules/component-store/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"outputs": ["{workspaceRoot}/dist/modules/component-store"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"modules/component-store/*/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/component/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"outputs": ["{workspaceRoot}/dist/modules/component"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"modules/component/*/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/data/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"outputs": ["{workspaceRoot}/dist/modules/data"]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"modules/data/*/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/effects/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"modules/effects/*/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/entity/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
]
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"modules/entity/*/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/eslint-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"generators": {},
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"modules/eslint-plugin/*/**/*.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const validConstructor: () => RunTests['valid'] = () => [
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
`
import { ComponentStore } from '@ngrx/component-store'
class Ok extends ComponentStore<MoviesState> {
Expand Down Expand Up @@ -68,7 +71,7 @@ class Ok extends ComponentStore<MoviesState> {
}`,
];

const validInject: () => RunTests['valid'] = () => [
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
`
import { inject } from '@angular/core'
import { ComponentStore } from '@ngrx/component-store'
Expand All @@ -91,7 +94,7 @@ class Ok {
}`,
];

const invalidConstructor: () => RunTests['invalid'] = () => [
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
import { ComponentStore } from '@ngrx/component-store'
Expand Down Expand Up @@ -178,7 +181,7 @@ class NotOk {
`),
];

const invalidInject: () => RunTests['invalid'] = () => [
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
import { inject } from '@angular/core'
import { ComponentStore } from '@ngrx/component-store'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const validConstructor: () => RunTests['valid'] = () => [
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
`
import { ComponentStore } from '@ngrx/component-store'
Expand Down Expand Up @@ -55,7 +58,7 @@ export class UserStore extends ComponentStore<UserState> {
`,
];

const validInject: () => RunTests['valid'] = () => [
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
`
import { inject } from '@angular/core'
import { ComponentStore } from '@ngrx/component-store'
Expand All @@ -67,7 +70,7 @@ class Ok {
}`,
];

const invalidConstructor: () => RunTests['invalid'] = () => [
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
import { ComponentStore } from '@ngrx/component-store'
Expand Down Expand Up @@ -113,7 +116,7 @@ export class UserStore extends ComponentStore<UserState> {
}`),
];

const invalidInject: () => RunTests['invalid'] = () => [
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
import { inject } from '@angular/core'
import { ComponentStore } from '@ngrx/component-store'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const validConstructor: () => RunTests['valid'] = () => [
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
`
import { ComponentStore } from '@ngrx/component-store'
Expand Down Expand Up @@ -62,7 +65,7 @@ class Ok3 {
}`,
];

const validInject: () => RunTests['valid'] = () => [
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
`
import { ComponentStore } from '@ngrx/component-store'
import { inject } from '@angular/core'
Expand Down Expand Up @@ -93,7 +96,7 @@ class Ok5 {
}`,
];

const invalidConstructor: () => RunTests['invalid'] = () => [
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
import { ComponentStore } from '@ngrx/component-store'
Expand Down Expand Up @@ -162,7 +165,7 @@ export class CompetitorsStore2 extends CompetitorsStore1 {
}`),
];

const invalidInject: () => RunTests['invalid'] = () => [
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
import { ComponentStore } from '@ngrx/component-store'
import { inject } from '@angular/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,7 +11,6 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const setup = `
import type { OnRunEffects } from '@ngrx/effects'
Expand All @@ -29,7 +32,7 @@ const genericFoo = createAction(\`$\{subject} FOO\`)
const genericBar = createAction(\`$\{subject} BAR\`)
`;

const validConstructor: () => RunTests['valid'] = () => [
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
`
${setup}
class Effect {
Expand Down Expand Up @@ -151,7 +154,7 @@ class Effect {
}`,
];

const validInject: () => RunTests['valid'] = () => [
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
`
${setup}
class Effect {
Expand Down Expand Up @@ -268,7 +271,7 @@ class Effect {
}`,
];

const invalidConstructor: () => RunTests['invalid'] = () => [
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
${setup}
class Effect {
Expand Down Expand Up @@ -382,7 +385,7 @@ class Effect {
}`),
];

const invalidInject: () => RunTests['invalid'] = () => [
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(`
${setup}
class Effect {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
noDispatchInEffects,
Expand All @@ -8,9 +12,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const validConstructor: () => RunTests['valid'] = () => [
const validConstructor: () => (string | ValidTestCase<Options>)[] = () => [
`
import { Store } from '@ngrx/store'
Expand Down Expand Up @@ -50,7 +53,7 @@ const validConstructor: () => RunTests['valid'] = () => [
}`,
];

const validInject: () => RunTests['valid'] = () => [
const validInject: () => (string | ValidTestCase<Options>)[] = () => [
`
import { Store } from '@ngrx/store'
import { inject } from '@angular/core'
Expand Down Expand Up @@ -102,7 +105,7 @@ class Ok5 {
}`,
];

const invalidConstructor: () => RunTests['invalid'] = () => [
const invalidConstructor: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(
`
import { Store } from '@ngrx/store'
Expand Down Expand Up @@ -335,7 +338,7 @@ class NotOk3 {
),
];

const invalidInject: () => RunTests['invalid'] = () => [
const invalidInject: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(
`
import { Store } from '@ngrx/store'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const valid: () => RunTests['valid'] = () => [
const valid: () => (string | ValidTestCase<Options>)[] = () => [
`
@NgModule({
imports: [
Expand All @@ -22,7 +25,7 @@ const valid: () => RunTests['valid'] = () => [
export class AppModule {}`,
];

const invalid: () => RunTests['invalid'] = () => [
const invalid: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(
`
@NgModule({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const valid: () => RunTests['valid'] = () => [
const valid: () => (string | ValidTestCase<Options>)[] = () => [
`
@Injectable()
export class Effects {
Expand Down Expand Up @@ -114,7 +117,7 @@ export class Effects {
}`,
];

const invalid: () => RunTests['invalid'] = () => [
const invalid: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(
`
@Injectable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ESLintUtils, TSESLint } from '@typescript-eslint/utils';
import type { ESLintUtils } from '@typescript-eslint/utils';
import type {
InvalidTestCase,
ValidTestCase,
} from '@typescript-eslint/rule-tester';
import * as path from 'path';
import rule, {
messageId,
Expand All @@ -7,9 +11,8 @@ import { ruleTester, fromFixture } from '../../utils';

type MessageIds = ESLintUtils.InferMessageIdsTypeFromRule<typeof rule>;
type Options = ESLintUtils.InferOptionsTypeFromRule<typeof rule>;
type RunTests = TSESLint.RunTests<MessageIds, Options>;

const valid: () => RunTests['valid'] = () => [
const valid: () => (string | ValidTestCase<Options>)[] = () => [
`
@Injectable()
class Effect {
Expand Down Expand Up @@ -52,7 +55,7 @@ class Effect {
}`,
];

const invalid: () => RunTests['invalid'] = () => [
const invalid: () => InvalidTestCase<MessageIds, Options>[] = () => [
fromFixture(
`
@Injectable()
Expand Down
Loading

0 comments on commit 698f0b7

Please sign in to comment.