Skip to content

Commit

Permalink
Merge pull request #27 from scaleflex/migrate-to-13
Browse files Browse the repository at this point in the history
  • Loading branch information
amrw-js committed Apr 27, 2022
2 parents d3fe52b + 9ee1246 commit 8cda2bf
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 98 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -30,6 +30,7 @@ speed-measure-plugin.json
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
57 changes: 19 additions & 38 deletions angular.json
Expand Up @@ -10,10 +10,15 @@
"prefix": "ci",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/lib/tsconfig.lib.json",
"project": "projects/lib/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/lib/tsconfig.lib.prod.json"
}
}
},
"test": {
Expand All @@ -23,18 +28,6 @@
"tsConfig": "projects/lib/tsconfig.spec.json",
"karmaConfig": "projects/lib/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/lib/tsconfig.lib.json",
"projects/lib/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
Expand All @@ -61,7 +54,13 @@
"projects/example/src/styles.css",
"./node_modules/highlight.js/styles/github.css"
],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -74,9 +73,7 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -85,10 +82,15 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -123,18 +125,6 @@
"projects/example/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/example/tsconfig.app.json",
"projects/example/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
Expand All @@ -154,15 +144,6 @@
"devServerTarget": "example:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "projects/example-e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
Expand Down
58 changes: 28 additions & 30 deletions package.json
Expand Up @@ -19,46 +19,44 @@
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "^0.801.1",
"@angular/animations": "~8.1.1",
"@angular/common": "~8.1.1",
"@angular/compiler": "~8.1.1",
"@angular/core": "~8.1.1",
"@angular/forms": "~8.1.1",
"@angular/platform-browser": "~8.1.1",
"@angular/platform-browser-dynamic": "~8.1.1",
"@angular/router": "~8.1.1",
"@angular-devkit/build-angular": "~13.3.3",
"@angular/animations": "~13.3.3",
"@angular/common": "~13.3.3",
"@angular/compiler": "~13.3.3",
"@angular/core": "~13.3.3",
"@angular/forms": "~13.3.3",
"@angular/platform-browser": "~13.3.3",
"@angular/platform-browser-dynamic": "~13.3.3",
"@angular/router": "~13.3.3",
"core-js": "^3.6.5",
"fibers": "^4.0.2",
"highlight.js": "^9.18.1",
"ng-lazyload-image": "^7.0.1",
"ngx-highlightjs": "^3.0.3",
"rxjs": "^6.5.5",
"zone.js": "^0.9.1"
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-ng-packagr": "~0.801.1",
"@angular/cli": "^8.3.26",
"@angular/compiler-cli": "~8.1.1",
"@angular/language-service": "~8.1.1",
"@types/jasmine": "^3.5.10",
"@angular/cli": "^13.3.3",
"@angular/compiler-cli": "~13.3.3",
"@angular/language-service": "~13.3.3",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "^2.0.8",
"@types/node": "~12.6.6",
"codelyzer": "^5.1.2",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"gh-pages": "^2.2.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.2.0",
"karma-chrome-launcher": "~3.0.0",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.3",
"ng-packagr": "^5.7.1",
"protractor": "^5.4.4",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.18",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^13.3.1",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tsickle": "^0.36.0",
"tslib": "^1.11.1",
"tslint": "~5.18.0",
"typescript": "~3.4.5"
"tslint": "~6.1.0",
"typescript": "~4.6.3"
}
}
File renamed without changes.
@@ -1,4 +1,4 @@
import {Component, OnInit, ViewChild, ElementRef, OnDestroy} from '@angular/core';
import { Component, OnInit, ViewChild, ElementRef, OnDestroy, AfterViewInit } from '@angular/core';
import {fromEvent, Observable, Subscription} from 'rxjs';
import {debounceTime} from 'rxjs/operators';

Expand All @@ -8,7 +8,7 @@ import {debounceTime} from 'rxjs/operators';
})

export default class ContainerBoxComponent implements OnInit, OnDestroy {
@ViewChild('containerElem', null) containerElem: ElementRef;
@ViewChild('containerElem', { static: true }) containerElem: ElementRef;

resizeObservable$: Observable<Event>;
resizeSubscription$: Subscription;
Expand Down
2 changes: 1 addition & 1 deletion projects/example/src/environments/environment.ts
Expand Up @@ -13,4 +13,4 @@ export const environment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
12 changes: 1 addition & 11 deletions projects/example/src/polyfills.ts
Expand Up @@ -37,19 +37,9 @@
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';

/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
Expand Down Expand Up @@ -77,7 +67,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.


/***************************************************************************************************
Expand Down
6 changes: 4 additions & 2 deletions projects/example/src/test.ts
@@ -1,6 +1,6 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/zone-testing';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
Expand All @@ -12,7 +12,9 @@ declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
9 changes: 6 additions & 3 deletions projects/example/tsconfig.app.json
Expand Up @@ -4,8 +4,11 @@
"outDir": "../../out-tsc/app",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"projects/example/src/**/*.d.ts"
]
}
2 changes: 1 addition & 1 deletion projects/lib/ng-package.json
Expand Up @@ -4,5 +4,5 @@
"lib": {
"entryFile": "src/public_api.ts"
},
"whitelistedNonPeerDependencies": ["ng-lazyload-image"]
"allowedNonPeerDependencies": ["ng-lazyload-image"]
}
4 changes: 2 additions & 2 deletions projects/lib/src/lib/img/img.component.ts
Expand Up @@ -14,8 +14,8 @@ import { isPlatformServer } from '@angular/common';
templateUrl: './img.component.html',
})
export class ImgComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
@ViewChild('imgElem', {static: false}) imgElem: ElementRef;
@ViewChild('pictureElem', {static: false}) pictureElem: ElementRef;
@ViewChild('imgElem') imgElem: ElementRef;
@ViewChild('pictureElem') pictureElem: ElementRef;
@Input() src: string;
@Input() class = '';
@Input() alt: string;
Expand Down
8 changes: 5 additions & 3 deletions projects/lib/src/test.ts
@@ -1,8 +1,8 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
Expand All @@ -14,7 +14,9 @@ declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
3 changes: 1 addition & 2 deletions projects/lib/tsconfig.lib.json
Expand Up @@ -2,13 +2,13 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"declarationMap": true,
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
Expand All @@ -18,7 +18,6 @@
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
Expand Down
9 changes: 9 additions & 0 deletions projects/lib/tsconfig.lib.prod.json
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
3 changes: 1 addition & 2 deletions tsconfig.json
Expand Up @@ -5,9 +5,8 @@
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"module": "es2020",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
Expand Down
1 change: 0 additions & 1 deletion tslint.json
Expand Up @@ -73,7 +73,6 @@
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
Expand Down

0 comments on commit 8cda2bf

Please sign in to comment.