Skip to content

Commit

Permalink
chore: migrate to nx 18 (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmasberg authored Mar 29, 2024
1 parent fde85dc commit 445b341
Show file tree
Hide file tree
Showing 9 changed files with 3,958 additions and 5,960 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Nx 18 enables using plugins to infer targets by default
# This is disabled for existing workspaces to maintain compatibility
# For more info, see: https://nx.dev/concepts/inferred-tasks
NX_ADD_PLUGINS=false
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
RELEASE_VERSION: ${{ github.sha }}
- name: Build
run: |
npx nx run-many -t build --all --parallel=3
npx nx run-many -t build --prod --all --parallel=3
docker build -t kordis-api:${{ github.sha }} -f ./apps/api/Dockerfile --build-arg NODE_VERSION=$(cat .nvmrc | tr -cd '[:digit:].') . &
docker build -t kordis-spa:${{ github.sha }} -f ./apps/spa/docker/Dockerfile . &
wait
Expand Down
3 changes: 2 additions & 1 deletion apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ ENV NODE_ENV=production
# Install dependencies separately for caching
COPY ./dist/apps/api/package.json ./dist/apps/api/package-lock.json ./

RUN npm --omit=dev ci
# Change to npm ci when https://github.com/nrwl/nx/issues/22386 is fixed
RUN npm install --omit=dev

COPY ./dist/apps/api ./

Expand Down
9 changes: 2 additions & 7 deletions apps/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
"tsConfig": "apps/api/tsconfig.app.json",
"assets": ["apps/api/src/assets"],
"webpackConfig": "apps/api/webpack.config.js",
"generatePackageJson": true,
"isolatedConfig": true,
"babelUpwardRootMode": true
"isolatedConfig": true
},
"configurations": {
"production": {
"optimization": true,
"extractLicenses": true,
"generatePackageJson": true,
"inspect": false
}
}
Expand Down Expand Up @@ -67,10 +66,6 @@
"options": {
"jestConfig": "apps/api/jest.config.ts"
}
},
"docker-build": {
"dependsOn": ["build"],
"command": "docker build --build-arg NODE_VERSION=$(cat .nvmrc | tr -cd [:digit:].) -f apps/api/Dockerfile . -t api"
}
},
"tags": []
Expand Down
20 changes: 15 additions & 5 deletions migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
"migrations": [
{
"cli": "nx",
"version": "17.2.1-beta.0",
"description": "Add webpack.config.js file when webpackConfig is not defined",
"implementation": "./src/migrations/update-17-2-1/webpack-config-setup",
"package": "@nx/webpack",
"name": "update-17-2-1-webpack-config-setup"
"version": "18.2.0-beta.0",
"requires": {
"@angular/core": ">=17.3.0"
},
"description": "Update the @angular/cli package version to ~17.3.0.",
"factory": "./src/migrations/update-18-2-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-17-3-0"
},
{
"version": "17.3.0",
"description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.",
"factory": "./migrations/invalid-two-way-bindings/bundle",
"package": "@angular/core",
"name": "invalid-two-way-bindings"
}
]
}
16 changes: 0 additions & 16 deletions nest-cli.json

This file was deleted.

4 changes: 4 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"codeCoverage": true
}
}
},
"@nx/eslint:lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
}
},
"namedInputs": {
Expand Down
Loading

0 comments on commit 445b341

Please sign in to comment.