Skip to content

Commit

Permalink
chore: 🤖 upgrade to v13
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Upgrade to Angular v13
  • Loading branch information
shaharkazaz committed Mar 15, 2022
1 parent ebf6098 commit fa1e5f9
Show file tree
Hide file tree
Showing 24 changed files with 22,787 additions and 43,792 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -27,4 +27,4 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- run: npm i
- run: npm test
- run: npm run test:lib
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
177 changes: 4 additions & 173 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,177 +1,8 @@
{
"version": 1,
"version": 2,
"projects": {
"playground": {
"projectType": "application",
"schematics": {
"@nrwl/angular:component": {
"style": "scss"
}
},
"root": "apps/playground",
"sourceRoot": "apps/playground/src",
"prefix": "ngneat",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/playground",
"index": "apps/playground/src/index.html",
"main": "apps/playground/src/main.ts",
"polyfills": "apps/playground/src/polyfills.ts",
"tsConfig": "apps/playground/tsconfig.app.json",
"aot": true,
"assets": [
"apps/playground/src/favicon.ico",
"apps/playground/src/assets",
{
"glob": "**/*",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
}
],
"styles": [
"apps/playground/src/styles.scss",
"./node_modules/ng-zorro-antd/ng-zorro-antd.min.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/playground/src/environments/environment.ts",
"with": "apps/playground/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "playground:build"
},
"configurations": {
"production": {
"browserTarget": "playground:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "playground:build"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/playground/src/**/*.ts",
"apps/playground/src/**/*.html"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/playground/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/apps/playground"]
}
}
},
"playground-e2e": {
"root": "apps/playground-e2e",
"sourceRoot": "apps/playground-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/playground-e2e/cypress.json",
"tsConfig": "apps/playground-e2e/tsconfig.e2e.json",
"devServerTarget": "playground:serve"
},
"configurations": {
"production": {
"devServerTarget": "playground:serve:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/playground-e2e/**/*.{js,ts}"]
}
}
}
},
"dirty-check-forms": {
"projectType": "library",
"root": "libs/dirty-check-forms",
"sourceRoot": "libs/dirty-check-forms/src",
"prefix": "ngneat",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"options": {
"tsConfig": "libs/dirty-check-forms/tsconfig.lib.json",
"project": "libs/dirty-check-forms/ng-package.json",
"buildableProjectDepsInPackageJsonType": "dependencies"
},
"configurations": {
"production": {
"tsConfig": "libs/dirty-check-forms/tsconfig.lib.prod.json"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"libs/dirty-check-forms/src/**/*.ts",
"libs/dirty-check-forms/src/**/*.html"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/dirty-check-forms/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/libs/dirty-check-forms"]
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
}
"dirty-check-forms": "libs/dirty-check-forms",
"playground": "apps/playground",
"playground-e2e": "apps/playground-e2e"
}
}
28 changes: 28 additions & 0 deletions apps/playground-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"root": "apps/playground-e2e",
"sourceRoot": "apps/playground-e2e/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/playground-e2e/cypress.json",
"tsConfig": "apps/playground-e2e/tsconfig.e2e.json",
"devServerTarget": "playground:serve"
},
"configurations": {
"production": {
"devServerTarget": "playground:serve:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/playground-e2e/**/*.{js,ts}"]
}
}
},
"implicitDependencies": ["playground"]
}
5 changes: 4 additions & 1 deletion apps/playground/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ module.exports = {
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' },
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
102 changes: 102 additions & 0 deletions apps/playground/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"projectType": "application",
"generators": {
"@nrwl/angular:component": {
"style": "scss"
}
},
"root": "apps/playground",
"sourceRoot": "apps/playground/src",
"prefix": "ngneat",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/apps/playground",
"index": "apps/playground/src/index.html",
"main": "apps/playground/src/main.ts",
"polyfills": "apps/playground/src/polyfills.ts",
"tsConfig": "apps/playground/tsconfig.app.json",
"aot": true,
"assets": [
"apps/playground/src/favicon.ico",
"apps/playground/src/assets",
{
"glob": "**/*",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
}
],
"styles": [
"apps/playground/src/styles.scss",
"./node_modules/ng-zorro-antd/ng-zorro-antd.min.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/playground/src/environments/environment.ts",
"with": "apps/playground/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "playground:build"
},
"configurations": {
"production": {
"browserTarget": "playground:build:production"
}
}
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "playground:build"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/playground/src/**/*.ts",
"apps/playground/src/**/*.html"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"options": {
"jestConfig": "apps/playground/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/apps/playground"]
}
}
}
17 changes: 14 additions & 3 deletions apps/playground/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import { ReactiveFormsModule } from '@angular/forms';
import { SettingsComponent } from './settings/settings.component';
import { HomeComponent } from './home/home.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { en_US, NgZorroAntdModule, NZ_I18N } from 'ng-zorro-antd';
import { registerLocaleData } from '@angular/common';
import en from '@angular/common/locales/en';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { en_US, NZ_I18N } from 'ng-zorro-antd/i18n';

registerLocaleData(en);

Expand All @@ -19,9 +25,14 @@ registerLocaleData(en);
AppRoutingModule,
ReactiveFormsModule,
BrowserAnimationsModule,
NgZorroAntdModule
NzSelectModule,
NzFormModule,
NzInputModule,
NzCheckboxModule,
NzButtonModule,
NzRadioModule,
],
providers: [{ provide: NZ_I18N, useValue: en_US }],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule {}
4 changes: 2 additions & 2 deletions apps/playground/src/app/dirty-form.guard.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { DirtyCheckGuard } from '@ngneat/dirty-check-forms';
import { NzModalService } from 'ng-zorro-antd';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { NzModalService } from 'ng-zorro-antd/modal';

@Injectable({ providedIn: 'root' })
export class FormDirtyGuard extends DirtyCheckGuard {
Expand All @@ -23,7 +23,7 @@ export class FormDirtyGuard extends DirtyCheckGuard {
},
nzOnCancel() {
navigate = true;
}
},
})
.afterClose.pipe(map(() => navigate));
}
Expand Down
Loading

0 comments on commit fa1e5f9

Please # to comment.