Skip to content

Commit

Permalink
chore!: upgrade to angular 17 and nx 17.2 (#203)
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
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[x] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:
```

## What is the current behavior?

Lumberjack supports up to Angular 16

## What is the new behavior?

The project is updated to Angular 17 and Nx 17.2

## Does this PR introduce a breaking change?

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

BREAKING CHANGES:

- Changes support from Angular version 16 to 17
  • Loading branch information
NachoVazquez authored Jan 28, 2024
1 parent a392180 commit 6d75549
Show file tree
Hide file tree
Showing 36 changed files with 2,460 additions and 2,292 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ migrations.json
# Generated Docusaurus files
.docusaurus/
.cache-loader/

.nx/cache
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@

# Generated files
packages/**/CHANGELOG.md

/.nx/cache
70 changes: 0 additions & 70 deletions decorate-angular-cli.js

This file was deleted.

5 changes: 1 addition & 4 deletions e2e/docs/lumberjack-docs-app-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/docs/lumberjack-docs-app-e2e/**/*.{js,ts}"]
},
"configurations": {
"report": {
"format": "json",
Expand Down
5 changes: 1 addition & 4 deletions e2e/examples/lumberjack-app-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["e2e/examples/lumberjack-app-e2e/**/*.{js,ts}"]
},
"configurations": {
"report": {
"format": "json",
Expand Down
41 changes: 24 additions & 17 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,8 @@
"defaultBase": "main"
},
"cli": {
"defaultCollection": "@nx/angular",
"packageManager": "yarn"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "build-package", "lint", "test", "e2e"],
"accessToken": "M2I0MTZlMmMtYmQ5ZC00ZDg1LWFjOTQtZjU5ZGFkYWM3YjM2fHJlYWQ="
}
}
},
"generators": {
"@nx/angular:application": {
"style": "scss",
Expand All @@ -40,16 +30,32 @@
"dependencies": true
}
],
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"e2e": {
"inputs": ["default", "^production"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^production"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
},
"build-package": {
"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 @@ -68,5 +74,6 @@
"!{projectRoot}/src/test-setup.[jt]s"
],
"projectSpecificFiles": []
}
},
"nxCloudAccessToken": "M2I0MTZlMmMtYmQ5ZC00ZDg1LWFjOTQtZjU5ZGFkYWM3YjM2fHJlYWQ="
}
74 changes: 36 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"license": "MIT",
"private": true,
"scripts": {
"postinstall": "node ./decorate-angular-cli.js",
"build": "nx run-many --target=build --all",
"ci": "yarn lint && yarn test && yarn build && yarn e2e",
"clean": "rimraf dist coverage reports",
Expand All @@ -27,15 +26,14 @@
"yarn": "1.22.21"
},
"dependencies": {
"@angular/animations": "16.2.12",
"@angular/common": "16.2.12",
"@angular/compiler": "16.2.12",
"@angular/core": "16.2.12",
"@angular/forms": "16.2.12",
"@angular/platform-browser": "16.2.12",
"@angular/platform-browser-dynamic": "16.2.12",
"@angular/router": "16.2.12",
"@nx/angular": "16.7.0",
"@angular/animations": "17.0.9",
"@angular/common": "17.0.9",
"@angular/compiler": "17.0.9",
"@angular/core": "17.0.9",
"@angular/forms": "17.0.9",
"@angular/platform-browser": "17.0.9",
"@angular/platform-browser-dynamic": "17.0.9",
"@angular/router": "17.0.9",
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
Expand All @@ -45,40 +43,40 @@
"react-dom": "^18.2.0",
"rxjs": "7.8.1",
"tslib": "2.4.1",
"zone.js": "0.12.0"
"zone.js": "0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "16.2.11",
"@angular-devkit/core": "16.2.11",
"@angular-devkit/schematics": "16.2.11",
"@angular-eslint/eslint-plugin": "16.0.1",
"@angular-eslint/eslint-plugin-template": "16.0.1",
"@angular-eslint/template-parser": "16.0.1",
"@angular/cli": "~16.2.0",
"@angular/compiler-cli": "16.2.12",
"@angular/language-service": "16.2.12",
"@angular-devkit/build-angular": "17.0.10",
"@angular-devkit/core": "17.0.10",
"@angular-devkit/schematics": "17.0.10",
"@angular-eslint/eslint-plugin": "17.0.1",
"@angular-eslint/eslint-plugin-template": "17.0.1",
"@angular-eslint/template-parser": "17.0.1",
"@angular/cli": "~17.0.0",
"@angular/compiler-cli": "17.0.9",
"@angular/language-service": "17.0.9",
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@docusaurus/module-type-aliases": "2.4.1",
"@jscutlery/semver": "3.0.0",
"@nx/cypress": "16.7.0",
"@nx/devkit": "16.7.0",
"@nx/eslint-plugin": "16.7.0",
"@nx/jest": "16.7.0",
"@nx/linter": "16.7.0",
"@nx/workspace": "16.7.0",
"@nx/angular": "17.2.0",
"@nx/cypress": "17.2.0",
"@nx/devkit": "17.2.0",
"@nx/eslint-plugin": "17.2.0",
"@nx/jest": "17.2.0",
"@nx/workspace": "17.2.0",
"@nx-plus/docusaurus": "^15.0.0-rc.0",
"@schematics/angular": "16.2.11",
"@schematics/angular": "17.0.10",
"@tsconfig/docusaurus": "^1.0.6",
"@types/copy": "0.3.2",
"@types/jest": "29.4.4",
"@types/node": "18.11.13",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"@types/node": "18.16.9",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"copy": "0.3.2",
"cypress": "12.17.4",
"eslint": "8.46.0",
"eslint-config-prettier": "8.1.0",
"cypress": "^13.0.0",
"eslint": "8.48.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-cypress": "2.15.1",
"eslint-plugin-etc": "2.0.2",
"eslint-plugin-ordered-imports": "0.6.0",
Expand All @@ -88,11 +86,10 @@
"husky": "8.0.2",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"jest-preset-angular": "13.1.1",
"ng-packagr": "16.2.3",
"jest-preset-angular": "13.1.6",
"ng-packagr": "17.0.3",
"ngx-deploy-npm": "8.0.0",
"nx": "16.7.0",
"nx-cloud": "16.5.2",
"nx": "17.2.0",
"postcss": "8.4.18",
"postcss-import": "14.1.0",
"postcss-preset-env": "7.5.0",
Expand All @@ -102,6 +99,7 @@
"rimraf": "3.0.2",
"ts-jest": "29.1.0",
"ts-node": "10.9.1",
"typescript": "~5.1.3"
"typescript": "5.2.2",
"@nx/eslint": "17.2.0"
}
}
1 change: 1 addition & 0 deletions packages/docs/lumberjack-docs-app/docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Refer to the following table to determine which version of Lumberjack is compati

| Angular version | Lumberjack version |
| --------------- | ------------------ |
| 17.x | 17.x |
| 16.x | 16.x |
| 15.x | 15.x |
| 14.x | 14.x |
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/lumberjack-docs-app/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class MyComponent implements OnInit {
// (...)
ngOnInit(): void {
this.#lumberjack.log({
level: LumberjackLevel.Info,
level: 'info',
message: 'Hello, World!',
scope: 'MyComponent',
createdAt: this.#time.getUnixEpochTicks(),
Expand All @@ -158,7 +158,7 @@ export class MyComponent implements OnInit {
}
```

> Each log level has its associated shorthand version: `LumberjackLevel.Info` is `logInfo`, `LumberjackLevel.Debug` is `logDebug`, etc.
> Each log level has its associated shorthand version: `'info'` is `logInfo`, `'debug'` is `logDebug`, etc.
### LumberjackModule and provideLumberjack

Expand Down
12 changes: 4 additions & 8 deletions packages/examples/lumberjack-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,23 @@
],
"configurations": {
"production": {
"browserTarget": "examples-lumberjack-app:build:production"
"buildTarget": "examples-lumberjack-app:build:production"
},
"development": {
"browserTarget": "examples-lumberjack-app:build:development"
"buildTarget": "examples-lumberjack-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "examples-lumberjack-app:build"
"buildTarget": "examples-lumberjack-app:build"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/examples/lumberjack-app/**/*.ts", "packages/examples/lumberjack-app/**/*.html"]
},
"configurations": {
"report": {
"format": "json",
Expand All @@ -89,7 +86,6 @@
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/examples/lumberjack-app/jest.config.ts",
"passWithNoTests": true,
"reporters": ["default", "github-actions"]
},
"configurations": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,10 @@ import { Component, ViewEncapsulation } from '@angular/core';
Add UI library
</summary>
<pre><span># Generate UI lib</span>
nx g @nx/angular:lib ui
nx g &#64;nx/angular:lib ui
<span># Add a component</span>
nx g @nx/angular:component button --project ui</pre>
nx g &#64;nx/angular:component button --project ui</pre>
</details>
<details>
<summary>
Expand Down
9 changes: 1 addition & 8 deletions packages/internal/console-driver/test-util/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/internal/console-driver/test-util/jest.config.ts",
"passWithNoTests": true,
"reporters": ["default", "github-actions"]
},
"configurations": {
Expand All @@ -22,14 +21,8 @@
}
},
"lint": {
"executor": "@nx/linter:eslint",
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"packages/internal/console-driver/test-util/**/*.ts",
"packages/internal/console-driver/test-util/**/*.html"
]
},
"configurations": {
"report": {
"format": "json",
Expand Down
Loading

0 comments on commit 6d75549

Please sign in to comment.