Skip to content

Commit

Permalink
feat!: update to the latest nx (#215)
Browse files Browse the repository at this point in the history
## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] The commit message follows our guidelines: CONTRIBUTING.md#commit
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)

## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

```
[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:
```

## What is the current behavior?

We support the previous version of Angular (18)

Closes: #213 

## What is the new behavior?

Migrate to the latest Angular and Nx.

## Does this PR introduce a breaking change?

```
[x] Yes
[ ] No
```

BREAKING CHANGES:

Only support Angular version 19
  • Loading branch information
NachoVazquez authored Nov 26, 2024
1 parent bd515ee commit 762206f
Show file tree
Hide file tree
Showing 12 changed files with 7,736 additions and 3,544 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:

- uses: pnpm/action-setup@v2
with:
version: 9
version: 9.5

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ jobs:
with:
fetch-depth: 0

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"

- uses: pnpm/action-setup@v2
with:
version: 9
version: 9.5
# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="4 linux-medium-js"

- uses: nrwl/nx-set-shas@v4

Expand Down Expand Up @@ -96,8 +95,7 @@ jobs:
- name: Run NX Commands
run: |
pnpm exec nx-cloud record -- nx format:check
pnpm exec nx affected -t lint test build
pnpm exec nx affected -t e2e-ci --parallel=1
pnpm exec nx affected -t lint test build e2e-ci
sonarcloud:
name: SonarCloud
Expand Down
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJestProjects } from '@nx/jest';
import { getJestProjectsAsync } from '@nx/jest';

export default {
projects: getJestProjects(),
};
export default async () => ({
projects: await getJestProjectsAsync(),
});
16 changes: 15 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"e2e-ci--**/*": {
"dependsOn": ["^^build", "^build:production"]
}
},
"workspaceLayout": { "appsDir": "e2e", "libsDir": "packages" },
Expand All @@ -63,7 +66,18 @@
"ciTargetName": "e2e-ci"
}
},
{ "plugin": "@nx/eslint/plugin", "options": { "targetName": "lint" } }
{
"plugin": "@nx/eslint/plugin",
"options": {
"targetName": "lint"
}
},
{
"plugin": "@nx/jest/plugin",
"options": {
"targetName": "test"
}
}
],
"nxCloudAccessToken": "OTNjMDE5MjItZjQ3Mi00NTM0LTgxNjYtODBjY2EyMTgzYzhlfHJlYWQtd3JpdGU=",
"defaultBase": "main"
Expand Down
85 changes: 43 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"clean": "rimraf dist coverage reports",
"configure-sonar-report-paths": "node tools/scripts/configure-sonar-report-paths.mjs",
"delete-path-alias": "node tools/scripts/delete-path-alias.mjs",
"e2e": "nx run-many --target=e2e-ci --parallel=1",
"e2e": "nx run-many --target=e2e --parallel=1",
"format": "pnpm run nx format:write",
"lint": "nx run-many --target=lint --max-warnings=0",
"nx": "nx",
Expand All @@ -26,15 +26,16 @@
"node": "20",
"pnpm": "9.5.0"
},
"packageManager": "[email protected]",
"dependencies": {
"@angular/animations": "18.0.0",
"@angular/common": "18.0.0",
"@angular/compiler": "18.0.0",
"@angular/core": "18.0.0",
"@angular/forms": "18.0.0",
"@angular/platform-browser": "18.0.0",
"@angular/platform-browser-dynamic": "18.0.0",
"@angular/router": "18.0.0",
"@angular/animations": "19.0.0",
"@angular/common": "19.0.0",
"@angular/compiler": "19.0.0",
"@angular/core": "19.0.0",
"@angular/forms": "19.0.0",
"@angular/platform-browser": "19.0.0",
"@angular/platform-browser-dynamic": "19.0.0",
"@angular/router": "19.0.0",
"@docusaurus/core": "3.3.2",
"@docusaurus/preset-classic": "3.3.2",
"@mdx-js/react": "^3.0.1",
Expand All @@ -48,40 +49,40 @@
"zone.js": "0.14.6"
},
"devDependencies": {
"@angular-devkit/build-angular": "18.0.1",
"@angular-devkit/core": "18.0.1",
"@angular-devkit/schematics": "18.0.1",
"@angular-eslint/eslint-plugin": "18.1.0",
"@angular-eslint/eslint-plugin-template": "18.1.0",
"@angular-eslint/template-parser": "18.1.0",
"@angular/cli": "~18.0.0",
"@angular/compiler-cli": "18.0.0",
"@angular/language-service": "18.0.0",
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@angular-devkit/build-angular": "19.0.2",
"@angular-devkit/core": "19.0.2",
"@angular-devkit/schematics": "19.0.2",
"@angular-eslint/eslint-plugin": "18.4.2",
"@angular-eslint/eslint-plugin-template": "18.4.2",
"@angular-eslint/template-parser": "18.4.2",
"@angular/cli": "19.0.2",
"@angular/compiler-cli": "19.0.0",
"@angular/language-service": "19.0.0",
"@commitlint/cli": "19.0.1",
"@commitlint/config-conventional": "19.0.0",
"@docusaurus/module-type-aliases": "3.3.2",
"@docusaurus/types": "3.0.0",
"@jscutlery/semver": "^5.2.0",
"@nx/angular": "19.4.3",
"@nx/cypress": "19.4.3",
"@nx/devkit": "19.4.3",
"@nx/eslint": "19.4.3",
"@nx/eslint-plugin": "19.4.3",
"@nx/jest": "19.4.3",
"@nx/js": "19.4.3",
"@nx/web": "19.4.3",
"@nx/workspace": "19.4.3",
"@schematics/angular": "18.0.1",
"@jscutlery/semver": "^5.3.1",
"@nx/angular": "20.1.3",
"@nx/cypress": "20.1.3",
"@nx/devkit": "20.1.3",
"@nx/eslint": "20.1.3",
"@nx/eslint-plugin": "20.1.3",
"@nx/jest": "20.1.3",
"@nx/js": "20.1.3",
"@nx/web": "20.1.3",
"@nx/workspace": "20.1.3",
"@schematics/angular": "19.0.2",
"@swc-node/register": "1.9.2",
"@swc/core": "1.5.7",
"@swc/helpers": "0.5.12",
"@tsconfig/docusaurus": "^1.0.7",
"@types/copy": "0.3.2",
"@types/jest": "29.4.4",
"@types/jest": "29.5.14",
"@types/node": "18.16.9",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"@typescript-eslint/utils": "^8.0.0-alpha.28",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@typescript-eslint/utils": "7.18.0",
"autoprefixer": "^10.4.0",
"copy": "0.3.2",
"cypress": "13.13.0",
Expand All @@ -94,12 +95,12 @@
"eslint-plugin-sonarjs": "0.17.0",
"glob": "8.0.3",
"husky": "8.0.2",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"jest-preset-angular": "14.1.0",
"ng-packagr": "18.0.0",
"ngx-deploy-npm": "^7.1.0",
"nx": "19.4.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-preset-angular": "14.3.3",
"ng-packagr": "18.2.1",
"ngx-deploy-npm": "^8.0.0",
"nx": "20.1.3",
"postcss": "8.4.18",
"postcss-import": "14.1.0",
"postcss-preset-env": "7.5.0",
Expand All @@ -109,6 +110,6 @@
"rimraf": "3.0.2",
"ts-jest": "29.1.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
"typescript": "5.5.4"
}
}
17 changes: 8 additions & 9 deletions packages/examples/lumberjack-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
"maximumError": "15kb"
}
],
"outputHashing": "all"
Expand Down Expand Up @@ -73,21 +73,20 @@
"buildTarget": "examples-lumberjack-app:build"
}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/examples/lumberjack-app/jest.config.ts",
"passWithNoTests": true,
"reporters": ["default", "github-actions"]
},
"configurations": {
"ci": {
"ci": true,
"coverage": true
},
"coverage": {
"codeCoverage": true,
"ci": true,
"coverageReporters": ["lcovonly", "text-summary"]
"coverageReporters": ["lcovonly", "text-summary"],
"coverage": true
}
}
},
Expand Down
2 changes: 0 additions & 2 deletions packages/examples/lumberjack-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { ForestService } from './forest.service';
import { NxWelcomeComponent } from './nx-welcome.component';

@Component({
standalone: true,
imports: [NxWelcomeComponent],

selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
Expand Down
16 changes: 8 additions & 8 deletions packages/internal/console-driver/test-util/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
"tags": ["scope:internal", "type:test-util"],
"targets": {
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/internal/console-driver/test-util/jest.config.ts",
"passWithNoTests": true,
"reporters": ["default", "github-actions"]
},
"configurations": {
"ci": {
"ci": true,
"coverage": true
},
"coverage": {
"codeCoverage": true,
"ci": true,
"coverageReporters": ["lcovonly", "text-summary"]
"coverageReporters": ["lcovonly", "text-summary"],
"coverage": true
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"configurations": {
"report": {
"format": "json",
"force": true,
"outputFile": "reports/packages/internal/console-driver/test-util/lint/report.json"
"output-file": "reports/packages/internal/console-driver/test-util/lint/report.json"
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions packages/internal/test-util/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
"tags": ["scope:internal", "type:test-util"],
"targets": {
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/internal/test-util/jest.config.ts",
"passWithNoTests": true,
"reporters": ["default", "github-actions"]
},
"configurations": {
"ci": {
"ci": true,
"coverage": true
},
"coverage": {
"codeCoverage": true,
"ci": true,
"coverageReporters": ["lcovonly", "text-summary"]
"coverageReporters": ["lcovonly", "text-summary"],
"coverage": true
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"configurations": {
"report": {
"format": "json",
"force": true,
"outputFile": "reports/packages/internal/test-util/lint/report.json"
"output-file": "reports/packages/internal/test-util/lint/report.json"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/ngworker/lumberjack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngworker/lumberjack",
"version": "18.0.0",
"version": "19.0.0",
"description": "Lumberjack is a versatile Angular logging library, specifically designed to be extended and customized",
"homepage": "https://ngworker.github.io/lumberjack/",
"license": "MIT",
Expand Down Expand Up @@ -37,8 +37,8 @@
"url": "https://github.com/ngworker/lumberjack/issues?q=is:issue+is:open+"
},
"peerDependencies": {
"@angular/core": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/core": "^19.0.0",
"@angular/common": "^19.0.0",
"rxjs": ">= 7.8.1 < 8.0.0"
},
"peerDependenciesMeta": {
Expand Down
Loading

0 comments on commit 762206f

Please sign in to comment.