Skip to content

Commit

Permalink
chore: upgrade nx to latest version
Browse files Browse the repository at this point in the history
This updates monorepo tools nx to latest version and tweaks libs configs of libs

Signed-off-by: Danil Kostromin <[email protected]>
  • Loading branch information
Danil Kostromin committed Jan 12, 2024
1 parent 5bd5778 commit 7150704
Show file tree
Hide file tree
Showing 49 changed files with 2,524 additions and 2,656 deletions.
5 changes: 1 addition & 4 deletions apps/bublik/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
"configurations": {}
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["apps/bublik/**/*.{ts,tsx,js,jsx}"]
}
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/vite:test",
Expand Down
8 changes: 2 additions & 6 deletions libs/bublik/+state/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["libs/bublik/+state/**/*.{ts,tsx,js,jsx}"]
}
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/bublik/+state"],
"options": {
"jestConfig": "libs/bublik/+state/jest.config.ts",
"passWithNoTests": true
"jestConfig": "libs/bublik/+state/jest.config.ts"
}
}
},
Expand Down
5 changes: 1 addition & 4 deletions libs/bublik/config/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/bublik/config/**/*.{ts,tsx,js,jsx}"]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
7 changes: 1 addition & 6 deletions libs/bublik/features/admin-users/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/bublik/features/admin-users/**/*.{ts,tsx,js,jsx}"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
5 changes: 1 addition & 4 deletions libs/bublik/features/auth/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/bublik/features/auth/**/*.{ts,tsx,js,jsx}"]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
3 changes: 1 addition & 2 deletions libs/bublik/features/auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"allowJs": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"types": ["vite/client", "vitest"]
"strict": true
},
"files": [],
"include": [],
Expand Down
12 changes: 6 additions & 6 deletions libs/bublik/features/auth/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../../dist/out-tsc",
"types": ["node", "vite/client"]
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"files": [
"../../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"**/*.spec.ts",
"**/*.test.ts",
Expand All @@ -18,5 +18,5 @@
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
}
5 changes: 3 additions & 2 deletions libs/bublik/features/auth/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"outDir": "../../../dist/out-tsc",
"types": [
"vitest/globals",
"vitest/importMeta",
"vite/client",
"node",
"@testing-library/jest-dom"
"vitest"
]
},
"include": [
"vite.config.ts",
"vitest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.test.tsx",
Expand Down
58 changes: 11 additions & 47 deletions libs/bublik/features/auth/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,28 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* SPDX-FileCopyrightText: 2021-2023 OKTET Labs Ltd. */
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsConfigPaths from 'vite-tsconfig-paths';
import dts from 'vite-plugin-dts';
import { joinPathFragments } from '@nx/devkit';
import svgr from 'vite-plugin-svgr';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
cacheDir: '../../../../node_modules/.vite/bublik-features-auth',
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/shared/tailwind',

plugins: [
dts({
entryRoot: 'src',
tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'),
skipDiagnostics: true
}),
react(),
viteTsConfigPaths({
root: '../../../../'
}),
svgr({ svgrOptions: { ref: true } })
],
plugins: [react(), nxViteTsPaths(), svgr({})],

// Uncomment this if you are using workers.
// worker: {
// plugins: [
// viteTsConfigPaths({
// root: '../../../../',
// }),
// ],
// plugins: [ nxViteTsPaths() ],
// },

// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: 'bublik-features-auth',
fileName: 'index',
// Change this to the formats you want to support.
// Don't forgot to update your package.json as well.
formats: ['es', 'cjs']
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: ['react', 'react-dom', 'react/jsx-runtime']
}
},

test: {
globals: true,
cache: {
dir: '../../../../node_modules/.vitest'
},
cache: { dir: '../../../node_modules/.vitest' },
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
setupFiles: [`${process.cwd()}/setup-globals.ts`]
// globalSetup: './setup-globals.ts',
reporters: ['default'],
coverage: {
reportsDirectory: '../../../coverage/libs/shared/tailwind',
provider: 'v8'
}
}
});
7 changes: 1 addition & 6 deletions libs/bublik/features/compromised-form/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/bublik/features/compromised-form/**/*.{ts,tsx,js,jsx}"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
15 changes: 15 additions & 0 deletions libs/bublik/features/dashboard-v2/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* SPDX-FileCopyrightText: 2021-2023 OKTET Labs Ltd. */
import { afterEach, expect } from 'vitest';
import { cleanup } from '@testing-library/react';
import matchers from '@testing-library/jest-dom/matchers';
import '@testing-library/jest-dom/extend-expect';

expect.extend(matchers);
afterEach(() => {
cleanup();
});

export const setup = () => {
process.env.TZ = 'UTC';
};
58 changes: 12 additions & 46 deletions libs/bublik/features/dashboard-v2/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,29 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* SPDX-FileCopyrightText: 2021-2023 OKTET Labs Ltd. */
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsConfigPaths from 'vite-tsconfig-paths';
import dts from 'vite-plugin-dts';
import { join } from 'path';
import svgr from 'vite-plugin-svgr';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
cacheDir: '../../../../node_modules/.vite/bublik-features-dashboard-v2',
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/bublik/features/dashboard-v2',

plugins: [
dts({
entryRoot: 'src',
tsConfigFilePath: join(__dirname, 'tsconfig.lib.json'),
skipDiagnostics: true
}),
react(),
svgr({ svgrOptions: { ref: true } }),
viteTsConfigPaths({
root: '../../../../'
})
],
plugins: [react(), nxViteTsPaths(), svgr({})],

// Uncomment this if you are using workers.
// worker: {
// plugins: [
// viteTsConfigPaths({
// root: '../../../../',
// }),
// ],
// plugins: [ nxViteTsPaths() ],
// },

// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: 'src/index.ts',
name: 'bublik-features-dashboard-v2',
fileName: 'index',
// Change this to the formats you want to support.
// Don't forgot to update your package.json as well.
formats: ['es', 'cjs']
},
rollupOptions: {
// External packages that should not be bundled into your library.
external: ['react', 'react-dom', 'react/jsx-runtime']
}
},

test: {
globals: true,
cache: {
dir: '../../../../node_modules/.vitest'
},
cache: { dir: '../../../node_modules/.vitest' },
environment: 'jsdom',
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
setupFiles: [`${process.cwd()}/setup-globals.ts`]
reporters: ['default'],
setupFiles: './setup.ts',
coverage: {
reportsDirectory: '../../../coverage/libs/shared/tailwind',
provider: 'v8'
}
}
});
7 changes: 1 addition & 6 deletions libs/bublik/features/deploy-info/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/bublik/features/deploy-info/**/*.{ts,tsx,js,jsx}"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
5 changes: 1 addition & 4 deletions libs/bublik/features/faq/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/bublik/features/faq/**/*.{ts,tsx,js,jsx}"]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
7 changes: 1 addition & 6 deletions libs/bublik/features/history/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/bublik/features/history/**/*.{ts,tsx,js,jsx}"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
7 changes: 1 addition & 6 deletions libs/bublik/features/link-to-source/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/bublik/features/link-to-source/**/*.{ts,tsx,js,jsx}"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
5 changes: 1 addition & 4 deletions libs/bublik/features/log/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
"projectType": "library",
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": ["libs/bublik/features/log/**/*.{ts,tsx,js,jsx}"]
}
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/vite:test",
Expand Down
7 changes: 1 addition & 6 deletions libs/bublik/features/measurements/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/bublik/features/measurements/**/*.{ts,tsx,js,jsx}"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test",
Expand Down
Loading

0 comments on commit 7150704

Please sign in to comment.