Skip to content

Commit 7a20840

Browse files
krzotkikopach
andauthored
chore(deps): Upgrade NX to 17.3.0 (#36)
Co-authored-by: Ihor <[email protected]>
1 parent c813c01 commit 7a20840

File tree

246 files changed

+4665
-4323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+4665
-4323
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
**/mocks/**

.eslintrc.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nrwl/nx", "graphql"],
4+
"plugins": ["@nx", "graphql"],
55
"rules": {
66
"graphql/template-strings": "off",
77
"graphql/named-operations": "off"
@@ -10,7 +10,7 @@
1010
{
1111
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
1212
"rules": {
13-
"@nrwl/nx/enforce-module-boundaries": [
13+
"@nx/enforce-module-boundaries": [
1414
"error",
1515
{
1616
"enforceBuildableLibDependency": true,
@@ -27,13 +27,17 @@
2727
},
2828
{
2929
"files": ["*.ts", "*.tsx"],
30-
"extends": ["plugin:@nrwl/nx/typescript"],
31-
"rules": {}
30+
"extends": ["plugin:@nx/typescript"],
31+
"rules": {
32+
"@typescript-eslint/no-explicit-any": "warn"
33+
}
3234
},
3335
{
3436
"files": ["*.js", "*.jsx"],
35-
"extends": ["plugin:@nrwl/nx/javascript"],
36-
"rules": {}
37+
"extends": ["plugin:@nx/javascript"],
38+
"rules": {
39+
"@nx/enforce-module-boundaries": ["off"]
40+
}
3741
},
3842
{
3943
"files": "*.json",

.storybook/main.js

+7
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ module.exports = {
6969
...config.resolve,
7070
extensions: ['.mjs', '.ts', '.tsx', '.js', '.jsx'],
7171
plugins: [...(config.resolve.plugins ?? []), tsPaths],
72+
fallback: {
73+
...(config.resolve || {}).fallback,
74+
fs: false,
75+
stream: false,
76+
os: false,
77+
zlib: false
78+
},
7279
},
7380
module: {
7481
...config.module,

.storybook/preview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addParameters } from '@storybook/react';
2-
import { RouterContext } from 'next/dist/shared/lib/router-context';
2+
import { RouterContext } from "next/dist/shared/lib/router-context.shared-runtime";
33
import { rest } from 'msw';
44
import { mswDecorator } from 'msw-storybook-addon';
55

docs/docs-site/.eslintrc.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": [
3-
"plugin:@nrwl/nx/react-typescript",
3+
"plugin:@nx/react-typescript",
44
"../../.eslintrc.json",
55
"next",
66
"next/core-web-vitals"
@@ -9,10 +9,14 @@
99
"overrides": [
1010
{
1111
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
12+
// We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
13+
"parserOptions": {
14+
"project": ["docs/docs-site/tsconfig(.*)?.json"]
15+
},
1216
"rules": {
1317
"@next/next/no-html-link-for-pages": [
1418
"error",
15-
"packages/docs-site/pages"
19+
"docs/docs-site/pages"
1620
]
1721
}
1822
},

docs/docs-site/components/enlargable-content.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { useState, useEffect } from 'react';
2-
import { useTheme } from 'next-themes';
2+
// import { useTheme } from 'next-themes';
33

44
export default function EnlargableContent({ children }) {
55
const [isOpen, setIsOpen] = useState(false);
66

77
const openModal = () => setIsOpen(true);
88
const closeModal = () => setIsOpen(false);
99

10-
const { theme } = useTheme();
10+
// const { theme } = useTheme();
1111

1212
useEffect(() => {
1313
if (isOpen) {

docs/docs-site/components/search.tsx

+8-10
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,21 @@ function useDebounceValue<T>(value: T, delay: number): T {
2020
return debouncedValue;
2121
}
2222

23-
type ItemProps = {
24-
title: string;
25-
route: string;
26-
content: string;
27-
type: 'title' | 'content';
28-
searchValue: string | undefined;
29-
handleClick: () => void;
30-
};
31-
3223
const Item = ({
3324
title,
3425
route,
3526
content,
3627
searchValue,
3728
type,
3829
handleClick,
39-
}: ItemProps) => {
30+
}: {
31+
title: string;
32+
route: string;
33+
content: string;
34+
type: 'title' | 'content';
35+
searchValue: string | undefined;
36+
handleClick: () => void;
37+
}) => {
4038
const index =
4139
type === 'title'
4240
? title.toLowerCase().indexOf(searchValue.toLowerCase())

docs/docs-site/jest.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export default {
33
displayName: 'docs-site',
44
preset: '../../jest.preset.js',
55
transform: {
6-
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
7-
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/next/babel'] }],
6+
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
7+
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
88
},
99
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
1010
coverageDirectory: '../../coverage/packages/docs-site',

docs/docs-site/pages/gene/index.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ code .
114114
### Generate a new Next.js app
115115

116116
```sh copy
117-
pnpm nx g @brainly-gene/tools:nextjs-app --name my-first-app --directory web --no-interactive
117+
npm nx g @brainly-gene/tools:nextjs-app --name my-first-app --directory web --no-interactive
118118
```
119119

120120
### Run the app 🥳
121121

122122
```sh copy
123-
pnpm nx serve web-my-first-app
123+
npm nx serve web-my-first-app
124124
```
125125

126126
</Steps>

docs/docs-site/project.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "docs-docs-site",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"sourceRoot": "docs/docs-site",
45
"projectType": "application",
@@ -11,12 +12,12 @@
1112
"next build",
1213
"nx run docs-docs-site:build-styles"
1314
],
14-
"cwd": "docs/docs-site",
15-
"outputPath": "dist/docs/docs-site"
15+
"cwd": "docs/docs-site"
1616
},
1717
"configurations": {
1818
"production": {}
19-
}
19+
},
20+
"outputs": ["{workspaceRoot}/dist/docs/docs-site"]
2021
},
2122
"serve": {
2223
"executor": "nx:run-commands",
@@ -56,22 +57,22 @@
5657
}
5758
},
5859
"test": {
59-
"executor": "@nrwl/jest:jest",
60+
"executor": "@nx/jest:jest",
6061
"outputs": ["{workspaceRoot}/coverage/docs/docs-site"],
6162
"options": {
62-
"jestConfig": "docs/docs-site/jest.config.ts",
63-
"passWithNoTests": true,
64-
"updateBuildableProjectDepsInPackageJson": true
63+
"jestConfig": "docs/docs-site/jest.config.ts"
6564
}
6665
},
6766
"lint": {
68-
"executor": "@nrwl/linter:eslint",
67+
"executor": "@nx/linter:eslint",
6968
"outputs": ["{options.outputFile}"],
7069
"options": {
71-
"lintFilePatterns": ["docs/docs-site/**/*.{ts,tsx,js,jsx}"]
70+
"lintFilePatterns": [
71+
"docs/docs-site/lib/*.{ts,tsx,js,jsx}",
72+
"docs/docs-site/components/*.{ts,tsx,js,jsx}"
73+
]
7274
}
7375
}
7476
},
75-
"tags": [],
76-
"name": "docs-docs-site"
77+
"tags": []
7778
}

docs/docs-site/theme.config.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { DocsThemeConfig } from 'nextra-theme-docs';
2-
import { Github, Star, GitFork, Users, Dna } from 'lucide-react';
32
import Search from './components/search';
43
import Image from 'next/image';
54
import Link from 'next/link';

jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { getJestProjects } = require('@nrwl/jest');
1+
const { getJestProjects } = require('@nx/jest');
22

33
export default {
44
projects: getJestProjects(),

jest.preset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const nxPreset = require('@nrwl/jest/preset').default;
1+
const nxPreset = require('@nx/jest/preset').default;
22

33
module.exports = {
44
...nxPreset,

libs/assets/.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"presets": [
33
[
4-
"@nrwl/react/babel",
4+
"@nx/react/babel",
55
{
66
"runtime": "automatic",
77
"useBuiltIns": "usage"

libs/assets/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
44
"overrides": [
55
{

libs/assets/project.json

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2+
"name": "assets",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"sourceRoot": "libs/assets/src",
45
"projectType": "library",
56
"tags": ["type:utility"],
67
"targets": {
78
"lint": {
8-
"executor": "@nrwl/linter:eslint",
9+
"executor": "@nx/linter:eslint",
910
"outputs": ["{options.outputFile}"],
1011
"options": {
1112
"lintFilePatterns": ["libs/assets/**/*.{ts,tsx,js,jsx}"]
1213
}
1314
},
1415
"test": {
15-
"executor": "@nrwl/jest:jest",
16+
"executor": "@nx/jest:jest",
1617
"outputs": ["{workspaceRoot}/coverage/libs/assets"],
1718
"options": {
18-
"jestConfig": "libs/assets/jest.config.ts",
19-
"passWithNoTests": true
19+
"jestConfig": "libs/assets/jest.config.ts"
2020
}
2121
},
2222
"copy-assets-to-app": {
@@ -27,9 +27,7 @@
2727
"{options.projectRoot}/public/nx-static"
2828
],
2929
"options": {
30-
"commands": [
31-
"pnpm gene-tools copy-assets-to-app {args.projectName}"
32-
]
30+
"commands": ["pnpm gene-tools copy-assets-to-app {args.projectName}"]
3331
}
3432
},
3533
"copy-assets-to-storybook": {
@@ -43,6 +41,5 @@
4341
"command": "pnpm gene-tools prepare-storybook-root-assets --includeBrainlyStyleGuide && pnpm gene-tools copy-assets-to-storybook"
4442
}
4543
}
46-
},
47-
"name": "assets"
44+
}
4845
}

libs/assets/tsconfig.lib.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"types": ["node"]
66
},
77
"files": [
8-
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
9-
"../../node_modules/@nrwl/react/typings/image.d.ts"
8+
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
9+
"../../node_modules/@nx/react/typings/image.d.ts"
1010
],
1111
"exclude": [
1212
"**/*.spec.ts",

libs/e2e-testing-providers/.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"presets": [
33
[
4-
"@nrwl/react/babel",
4+
"@nx/react/babel",
55
{
66
"runtime": "automatic",
77
"useBuiltIns": "usage"

libs/e2e-testing-providers/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
44
"overrides": [
55
{

libs/e2e-testing-providers/project.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
"tags": [],
77
"targets": {
88
"lint": {
9-
"executor": "@nrwl/linter:eslint",
9+
"executor": "@nx/linter:eslint",
1010
"outputs": ["{options.outputFile}"],
1111
"options": {
1212
"lintFilePatterns": ["libs/e2e-testing-providers/**/*.{ts,tsx,js,jsx}"]
1313
}
1414
},
1515
"test": {
16-
"executor": "@nrwl/jest:jest",
16+
"executor": "@nx/jest:jest",
1717
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
1818
"options": {
19-
"jestConfig": "libs/e2e-testing-providers/jest.config.ts",
20-
"passWithNoTests": true
19+
"jestConfig": "libs/e2e-testing-providers/jest.config.ts"
2120
}
2221
}
2322
}

libs/e2e-testing-providers/src/lib/storybook/decorators/StorybookProviders.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { emit, EventBusContextProvider, register } from '@brainly-gene/core';
1717

1818
type OverwritableContainerKeys = 'adsContainer';
1919

20-
export type StorybookProvidersPropsType = {
20+
export interface StorybookProvidersPropsType {
2121
children: React.ReactNode;
2222
additionalContainers?: interfaces.Container[];
2323
overwriteContainers?: Partial<
@@ -27,7 +27,7 @@ export type StorybookProvidersPropsType = {
2727
initialAppContext?: AppStoreType;
2828
appContextReducer?: ReducerType;
2929
locale?: Locale;
30-
};
30+
}
3131

3232
export function StorybookProviders({
3333
children,

libs/e2e-testing-providers/tsconfig.lib.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"types": ["node"]
66
},
77
"files": [
8-
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
9-
"../../node_modules/@nrwl/react/typings/image.d.ts"
8+
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
9+
"../../node_modules/@nx/react/typings/image.d.ts"
1010
],
1111
"exclude": [
1212
"jest.config.ts",

libs/translations/.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"presets": [
33
[
4-
"@nrwl/react/babel",
4+
"@nx/react/babel",
55
{
66
"runtime": "automatic",
77
"useBuiltIns": "usage"

libs/translations/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
33
"ignorePatterns": ["!**/*"],
44
"overrides": [
55
{

0 commit comments

Comments
 (0)