Skip to content

Commit

Permalink
chore: migrated to the latest nx version
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasHaderer committed Jan 4, 2024
1 parent a09a1e1 commit c3ab045
Show file tree
Hide file tree
Showing 38 changed files with 2,170 additions and 1,708 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
"*.json"
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"ignorePatterns": ["**/*", "*.json"],
"plugins": ["@nx"],
"rules": {
"@nx/enforce-module-boundaries": [
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ migrations.json
package-lock.json

.nx-container

.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
**/tmp
*.lock
apps/url-shortener/thunder-tests

/.nx/cache
2 changes: 1 addition & 1 deletion apps/authentication/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "*.json", "webpack.config.js"],
"parserOptions": {
"project": ["apps/authentication/tsconfig.app.json", "apps/authentication/tsconfig.spec.json"]
}
Expand Down
15 changes: 6 additions & 9 deletions apps/authentication/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"generatePackageJson": true,
"sourceMap": true,
"target": "node",
"compiler": "tsc"
"compiler": "tsc",
"webpackConfig": "apps/authentication/webpack.config.js"
},
"defaultConfiguration": "production",
"configurations": {
Expand All @@ -39,7 +40,7 @@
}
},
"serve": {
"executor": "@nx/node:node",
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "authentication:build"
Expand All @@ -54,18 +55,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/authentication/**/*.ts"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/authentication"],
"options": {
"jestConfig": "apps/authentication/jest.config.ts",
"passWithNoTests": true
"jestConfig": "apps/authentication/jest.config.ts"
}
},
"container": {
Expand Down
8 changes: 8 additions & 0 deletions apps/authentication/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { composePlugins, withNx } = require("@nx/webpack");

// Nx plugins for webpack.
module.exports = composePlugins(withNx(), config => {
// Note: This was added by an Nx migration. Webpack builds are required to have a corresponding Webpack config file.
// See: https://nx.dev/recipes/webpack/webpack-config-setup
return config;
});
2 changes: 1 addition & 1 deletion apps/demo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "*.json", "webpack.config.js"],
"parserOptions": {
"project": ["apps/demo/tsconfig.app.json", "apps/demo/tsconfig.spec.json"]
}
Expand Down
15 changes: 6 additions & 9 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"tsConfig": "apps/demo/tsconfig.app.json",
"assets": ["apps/demo/src/assets"],
"target": "node",
"compiler": "tsc"
"compiler": "tsc",
"webpackConfig": "apps/demo/webpack.config.js"
},
"configurations": {
"production": {
Expand All @@ -30,7 +31,7 @@
}
},
"serve": {
"executor": "@nx/node:node",
"executor": "@nx/js:node",
"options": {
"buildTarget": "demo:build"
},
Expand All @@ -41,18 +42,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/demo/**/*.ts"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/demo"],
"options": {
"jestConfig": "apps/demo/jest.config.ts",
"passWithNoTests": true
"jestConfig": "apps/demo/jest.config.ts"
}
}
},
Expand Down
8 changes: 8 additions & 0 deletions apps/demo/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { composePlugins, withNx } = require("@nx/webpack");

// Nx plugins for webpack.
module.exports = composePlugins(withNx(), config => {
// Note: This was added by an Nx migration. Webpack builds are required to have a corresponding Webpack config file.
// See: https://nx.dev/recipes/webpack/webpack-config-setup
return config;
});
2 changes: 1 addition & 1 deletion apps/url-shortener/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "*.json", "webpack.config.js"],
"parserOptions": {
"project": ["apps/url-shortener/tsconfig.app.json", "apps/url-shortener/tsconfig.spec.json"]
}
Expand Down
15 changes: 6 additions & 9 deletions apps/url-shortener/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"generatePackageJson": true,
"sourceMap": true,
"target": "node",
"compiler": "tsc"
"compiler": "tsc",
"webpackConfig": "apps/url-shortener/webpack.config.js"
},
"defaultConfiguration": "production",
"configurations": {
Expand All @@ -39,7 +40,7 @@
}
},
"serve": {
"executor": "@nx/node:node",
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "url-shortener:build"
Expand All @@ -54,18 +55,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/url-shortener/**/*.ts"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/url-shortener"],
"options": {
"jestConfig": "apps/url-shortener/jest.config.ts",
"passWithNoTests": true
"jestConfig": "apps/url-shortener/jest.config.ts"
}
},
"container": {
Expand Down
8 changes: 8 additions & 0 deletions apps/url-shortener/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { composePlugins, withNx } = require("@nx/webpack");

// Nx plugins for webpack.
module.exports = composePlugins(withNx(), config => {
// Note: This was added by an Nx migration. Webpack builds are required to have a corresponding Webpack config file.
// See: https://nx.dev/recipes/webpack/webpack-config-setup
return config;
});
38 changes: 21 additions & 17 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"npmScope": "luftschloss",
"affected": {
"defaultBase": "main"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "ZmQ3ZTYyZjYtNTUyNS00MTAwLTk1MWItOGI0ZDA3NWI5ZThhfHJlYWQtd3JpdGU="
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["production", "^production"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"workspaceLayout": {
Expand All @@ -37,7 +39,9 @@
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.eslintrc.json"
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/src/test-setup.[jt]s"
]
}
},
"nxCloudAccessToken": "ZmQ3ZTYyZjYtNTUyNS00MTAwLTk1MWItOGI0ZDA3NWI5ZThhfHJlYWQtd3JpdGU="
}
49 changes: 23 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "MIT",
"scripts": {
"clean": "rm -rf node_modules/.cache/nx dist",
"clean": "rm -rf node_modules/.cache/nx dist .nx/cache",
"postinstall": "husky install"
},
"dependencies": {
Expand All @@ -18,44 +18,41 @@
"devDependencies": {
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@nrwl/js": "16.1.0",
"@nrwl/js": "17.2.8",
"@nx-tools/container-metadata": "^4.0.3",
"@nx-tools/nx-container": "^4.0.3",
"@nx/devkit": "16.1.0",
"@nx/eslint-plugin": "16.1.0",
"@nx/jest": "16.1.0",
"@nx/js": "16.1.0",
"@nx/linter": "16.1.0",
"@nx/node": "16.1.0",
"@nx/plugin": "16.1.0",
"@nx/web": "16.1.0",
"@nx/webpack": "16.1.0",
"@nx/workspace": "16.1.0",
"@swc-node/register": "^1.4.2",
"@nx/devkit": "17.2.8",
"@nx/eslint-plugin": "17.2.8",
"@nx/jest": "17.2.8",
"@nx/js": "17.2.8",
"@nx/node": "17.2.8",
"@nx/plugin": "17.2.8",
"@nx/web": "17.2.8",
"@nx/webpack": "17.2.8",
"@nx/workspace": "17.2.8",
"@swc-node/register": "~1.6.7",
"@swc/cli": "0.1.62",
"@swc/core": "^1.2.173",
"@swc/helpers": "0.5.1",
"@swc/core": "~1.3.85",
"@swc/helpers": "~0.5.2",
"@types/jest": "29.4.4",
"@types/mime-db": "^1.43.1",
"@types/node": "^18.11.9",
"@types/range-parser": "^1.2.4",
"@types/source-map-support": "^0.5.6",
"@types/node": "^20.10.6",
"@types/sqlite3": "^3.1.8",
"@typescript-eslint/eslint-plugin": "5.59.2",
"@typescript-eslint/parser": "5.59.2",
"eslint": "~8.15.0",
"@typescript-eslint/eslint-plugin": "6.17.0",
"@typescript-eslint/parser": "6.17.0",
"eslint": "8.48.0",
"husky": "^8.0.3",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"jest-environment-node": "^29.4.1",
"jsonc-eslint-parser": "^2.1.0",
"nx": "16.1.0",
"nx-cloud": "16.0.5",
"prettier": "^2.8.7",
"nx": "17.2.8",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"ts-jest": "29.1.0",
"ts-node": "10.9.1",
"tslib": "^2.3.0",
"typescript": "~5.0.2"
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"@nx/eslint": "17.2.8"
}
}
2 changes: 1 addition & 1 deletion packages/client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "*.json"],
"parserOptions": {
"project": ["packages/client/tsconfig.lib.json", "packages/client/tsconfig.spec.json"]
}
Expand Down
10 changes: 3 additions & 7 deletions packages/client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/client/**/*.ts"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/packages/client"],
"options": {
"jestConfig": "packages/client/jest.config.ts",
"passWithNoTests": true
"jestConfig": "packages/client/jest.config.ts"
}
},
"version": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["!**/*", "*.json"],
"parserOptions": {
"project": ["packages/common/tsconfig.lib.json", "packages/common/tsconfig.spec.json"]
}
Expand Down
10 changes: 3 additions & 7 deletions packages/common/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/common/**/*.ts"]
}
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/packages/common"],
"options": {
"jestConfig": "packages/common/jest.config.ts",
"passWithNoTests": true
"jestConfig": "packages/common/jest.config.ts"
}
},
"version": {
Expand Down
Loading

0 comments on commit c3ab045

Please sign in to comment.