Skip to content

Commit

Permalink
feature: migrate to nx (15.3.0) and angular 15 (ngworker#147)
Browse files Browse the repository at this point in the history
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)

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)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:
```

The workspace is using Nx 14.x and Angular 14.x

The workspace uses the latest Nx 15.2.x and the latest Angular 15.0.x

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

---------

Co-authored-by: Lars Gyrup Brink Nielsen <[email protected]>
  • Loading branch information
NachoVazquez and LayZeeDK committed Jun 12, 2023
1 parent 9fb23ff commit b69d069
Show file tree
Hide file tree
Showing 76 changed files with 4,447 additions and 3,574 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.18.0
18.12.1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Refer to the following table to determine which version of Lumberjack is compati

| Angular version | Lumberjack version |
| --------------- | ------------------ |
| 15.x | 15.x |
| 14.x | 14.x |
| 13.x | 2.x |
| 12.x | 2.x |
Expand Down
6 changes: 6 additions & 0 deletions e2e/examples/lumberjack-app-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: nxE2EPreset(__dirname),
});
12 changes: 0 additions & 12 deletions e2e/examples/lumberjack-app-e2e/cypress.json

This file was deleted.

6 changes: 4 additions & 2 deletions e2e/examples/lumberjack-app-e2e/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "examples-lumberjack-app-e2e",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/examples/lumberjack-app-e2e/src",
"projectType": "application",
Expand All @@ -12,8 +13,9 @@
}
],
"options": {
"cypressConfig": "e2e/examples/lumberjack-app-e2e/cypress.json",
"devServerTarget": "examples-lumberjack-app:serve:development"
"cypressConfig": "e2e/examples/lumberjack-app-e2e/cypress.config.ts",
"devServerTarget": "examples-lumberjack-app:serve:development",
"testingType": "e2e"
},
"configurations": {
"production": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { VERSION } from '@angular/core';

describe('Console log driver', () => {
function visit() {
cy.visit('/', {
Expand All @@ -9,7 +11,7 @@ describe('Console log driver', () => {
}

const expectedPayload = {
angularVersion: '14',
angularVersion: VERSION.major,
};
it('logs a greeting info message', () => {
visit();
Expand Down
9 changes: 9 additions & 0 deletions e2e/examples/lumberjack-app-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
3 changes: 2 additions & 1 deletion e2e/examples/lumberjack-app-e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.js"],
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
Expand Down
32 changes: 23 additions & 9 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
"defaultCollection": "@nrwl/angular",
"packageManager": "yarn"
},
"implicitDependencies": {
"package.json": {
"dependencies": "*",
"devDependencies": "*"
},
".eslintrc.json": "*",
"README.md": ["ngworker-lumberjack"]
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
Expand Down Expand Up @@ -48,11 +40,33 @@
"projects": "dependencies",
"target": "build"
}
]
],
"inputs": ["production", "^production"]
},
"e2e": {
"inputs": ["default", "^production"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
}
},
"workspaceLayout": {
"appsDir": "e2e",
"libsDir": "packages"
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals", "projectSpecificFiles"],
"sharedGlobals": [],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.eslintrc.json"
],
"projectSpecificFiles": []
}
}
99 changes: 50 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,78 +19,79 @@
"test": "nx run-many --target=test --all"
},
"engines": {
"node": "16.18.0",
"node": "18.12.1",
"npm": "Use the Yarn Classic (1.x) CLI instead of npm",
"yarn": "1.22.19"
},
"volta": {
"node": "16.18.0",
"node": "18.12.1",
"yarn": "1.22.19"
},
"dependencies": {
"@angular/animations": "14.0.7",
"@angular/common": "14.0.7",
"@angular/compiler": "14.0.7",
"@angular/core": "14.0.7",
"@angular/forms": "14.0.7",
"@angular/platform-browser": "14.0.7",
"@angular/platform-browser-dynamic": "14.0.7",
"@angular/router": "14.0.7",
"@nrwl/angular": "14.4.3",
"rxjs": "7.4.0",
"tslib": "2.4.0",
"zone.js": "0.11.6"
"@angular/animations": "15.0.3",
"@angular/common": "15.0.3",
"@angular/compiler": "15.0.3",
"@angular/core": "15.0.3",
"@angular/forms": "15.0.3",
"@angular/platform-browser": "15.0.3",
"@angular/platform-browser-dynamic": "15.0.3",
"@angular/router": "15.0.3",
"@nrwl/angular": "15.3.0",
"rxjs": "7.5.7",
"tslib": "2.4.1",
"zone.js": "0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "14.0.7",
"@angular-eslint/eslint-plugin": "14.0.4",
"@angular-eslint/eslint-plugin-template": "14.0.4",
"@angular-eslint/template-parser": "14.0.4",
"@angular/cli": "14.0.7",
"@angular/compiler-cli": "14.0.7",
"@angular/language-service": "14.0.7",
"@commitlint/cli": "17.1.2",
"@commitlint/config-conventional": "17.1.0",
"@jscutlery/semver": "2.27.1",
"@nrwl/cli": "14.4.3",
"@nrwl/cypress": "14.4.3",
"@nrwl/devkit": "14.4.3",
"@nrwl/eslint-plugin-nx": "14.4.3",
"@nrwl/jest": "14.4.3",
"@nrwl/linter": "14.4.3",
"@nrwl/nx-cloud": "14.7.0",
"@nrwl/workspace": "14.4.3",
"@angular-devkit/build-angular": "15.0.3",
"@angular-eslint/eslint-plugin": "15.1.0",
"@angular-eslint/eslint-plugin-template": "15.1.0",
"@angular-eslint/template-parser": "15.1.0",
"@angular/cli": "15.0.3",
"@angular/compiler-cli": "15.0.3",
"@angular/language-service": "15.0.3",
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@jscutlery/semver": "2.29.2",
"@nrwl/cli": "15.3.0",
"@nrwl/cypress": "15.3.0",
"@nrwl/devkit": "15.3.0",
"@nrwl/eslint-plugin-nx": "15.3.0",
"@nrwl/jest": "15.3.0",
"@nrwl/linter": "15.3.0",
"@nrwl/nx-cloud": "15.0.2",
"@nrwl/workspace": "15.3.0",
"@types/copy": "0.3.2",
"@types/jest": "27.4.1",
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"@types/jest": "28.1.8",
"@types/node": "18.11.13",
"@typescript-eslint/eslint-plugin": "5.45.0",
"@typescript-eslint/parser": "5.45.0",
"copy": "0.3.2",
"cypress": "9.1.1",
"cypress": "11.2.0",
"eslint": "8.15.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "2.10.3",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-etc": "2.0.2",
"eslint-plugin-ordered-imports": "0.6.0",
"eslint-plugin-rxjs": "5.0.2",
"eslint-plugin-rxjs-angular": "2.0.0",
"eslint-plugin-sonarjs": "0.13.0",
"eslint-plugin-sonarjs": "0.17.0",
"glob": "8.0.3",
"husky": "8.0.0",
"jest": "27.5.1",
"jest-preset-angular": "11.1.2",
"ng-packagr": "14.0.2",
"ngx-deploy-npm": "4.1.0",
"nx": "14.4.3",
"husky": "8.0.2",
"jest": "28.1.3",
"jest-environment-jsdom": "28.1.3",
"jest-preset-angular": "12.2.3",
"ng-packagr": "15.0.3",
"ngx-deploy-npm": "4.3.10",
"nx": "15.3.0",
"postcss": "8.4.18",
"postcss-import": "14.1.0",
"postcss-preset-env": "7.5.0",
"postcss-url": "10.1.3",
"prettier": "2.6.2",
"prettier": "2.8.1",
"replace-in-file": "6.3.5",
"rimraf": "3.0.2",
"ts-jest": "27.1.5",
"ts-node": "10.8.1",
"typescript": "4.6.4"
"ts-jest": "28.0.8",
"ts-node": "10.9.1",
"typescript": "4.8.4"
}
}
16 changes: 0 additions & 16 deletions packages/examples/lumberjack-app/.browserslistrc

This file was deleted.

16 changes: 6 additions & 10 deletions packages/examples/lumberjack-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"outputPath": "dist/packages/examples/lumberjack-app",
"index": "packages/examples/lumberjack-app/src/index.html",
"main": "packages/examples/lumberjack-app/src/main.ts",
"polyfills": "packages/examples/lumberjack-app/src/polyfills.ts",
"polyfills": ["zone.js"],
"tsConfig": "packages/examples/lumberjack-app/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["packages/examples/lumberjack-app/src/favicon.ico", "packages/examples/lumberjack-app/src/assets"],
Expand All @@ -32,12 +32,6 @@
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "packages/examples/lumberjack-app/src/environments/environment.ts",
"with": "packages/examples/lumberjack-app/src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
Expand Down Expand Up @@ -91,10 +85,11 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/packages/examples/lumberjack-app"],
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/examples/lumberjack-app/jest.config.ts",
"passWithNoTests": true
"passWithNoTests": true,
"reporters": ["default", "github-actions"]
},
"configurations": {
"coverage": {
Expand All @@ -105,5 +100,6 @@
}
}
},
"tags": ["scope:internal", "type:app"]
"tags": ["scope:internal", "type:app"],
"name": "examples-lumberjack-app"
}

This file was deleted.

16 changes: 0 additions & 16 deletions packages/examples/lumberjack-app/src/environments/environment.ts

This file was deleted.

10 changes: 2 additions & 8 deletions packages/examples/lumberjack-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { enableProdMode, importProvidersFrom } from '@angular/core';
import { bootstrapApplication, BrowserModule } from '@angular/platform-browser';
import { importProvidersFrom } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';

import { LumberjackLog, LumberjackModule, LumberjackOptions } from '@ngworker/lumberjack';
import { LumberjackConsoleDriverModule } from '@ngworker/lumberjack/console-driver';

import { environment } from './environments/environment';
import { AppComponent } from './app/app.component';

const cypressLumberjackOptions: LumberjackOptions = {
Expand All @@ -17,14 +16,9 @@ const cypressLumberjackOptions: LumberjackOptions = {
},
};

if (environment.production) {
enableProdMode();
}

bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom([
BrowserModule,
LumberjackModule.forRoot('Cypress' in window ? cypressLumberjackOptions : undefined),
LumberjackConsoleDriverModule.forRoot(),
]),
Expand Down
Loading

0 comments on commit b69d069

Please sign in to comment.