Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Commit a3e9eaa

Browse files
authored
feat: update to Angular 12 and Ivy distribution (#25)
1 parent 515a619 commit a3e9eaa

16 files changed

+12437
-11769
lines changed

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
// TODO: move rules to @tinkoff/eslint-config-angular
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/eslint-recommended',
7+
'@tinkoff/eslint-config-angular',
8+
],
9+
ignorePatterns: ['projects/**/test.ts'],
10+
parserOptions: {
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
project: [require.resolve('./tsconfig.eslint.json')],
14+
},
15+
parser: '@typescript-eslint/parser',
16+
rules: {
17+
// TODO: move rules to @tinkoff/eslint-config-angular
18+
'@typescript-eslint/no-useless-constructor': 'off',
19+
'@typescript-eslint/no-inferrable-types': ['error', {ignoreParameters: true}],
20+
'@typescript-eslint/explicit-member-accessibility': [
21+
'error',
22+
{accessibility: 'no-public'},
23+
],
24+
'@typescript-eslint/prefer-readonly': ['error'],
25+
'no-console': ['error', {allow: ['info', 'assert', 'warn', 'error']}],
26+
27+
'no-prototype-builtins': 'off',
28+
// note you must disable the base rule as it can report incorrect errors
29+
'no-unused-vars': 'off',
30+
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
31+
},
32+
};

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "10"
3+
- "14"
44
script:
55
- npm run lint
66
- npm run build

angular.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"sourceRoot": "projects/universal/src",
1010
"architect": {
1111
"build": {
12-
"builder": "@angular-devkit/build-ng-packagr:build",
12+
"builder": "@angular-devkit/build-angular:ng-packagr",
1313
"options": {
1414
"tsConfig": "projects/universal/tsconfig.lib.json",
1515
"project": "projects/universal/ng-package.json"
@@ -24,16 +24,6 @@
2424
"codeCoverage": true,
2525
"browsers": "ChromeHeadless"
2626
}
27-
},
28-
"lint": {
29-
"builder": "@angular-devkit/build-angular:tslint",
30-
"options": {
31-
"tsConfig": [
32-
"projects/universal/tsconfig.lib.json",
33-
"projects/universal/tsconfig.spec.json"
34-
],
35-
"exclude": ["**/node_modules/**"]
36-
}
3727
}
3828
}
3929
}

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']};

package-lock.json

Lines changed: 12293 additions & 11645 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 52 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
"name": "@ng-web-apis/universal",
33
"version": "1.13.0",
44
"scripts": {
5+
"postinstall": "husky install",
56
"build": "ng build",
67
"postbuild": "node scripts/postbuild.js",
78
"test": "ng test",
89
"posttest": "node scripts/coveralls.js",
9-
"lint": "ng lint",
10+
"lint": "eslint . --fix",
1011
"typecheck": "tsc --noEmit --skipLibCheck",
1112
"release": "standard-version",
1213
"release:patch": "npm run release -- --release-as patch",
@@ -32,79 +33,70 @@
3233
"name": "Alex Inkin",
3334
"email": "[email protected]"
3435
},
35-
"contributors": ["Roman Sedov <[email protected]> (http://marsibarsi.me/)"],
36+
"contributors": [
37+
"Roman Sedov <[email protected]> (http://marsibarsi.me/)"
38+
],
3639
"repository": "https://github.com/ng-web-apis/universal",
3740
"bugs": "https://github.com/ng-web-apis/universal/issues",
3841
"homepage": "https://github.com/ng-web-apis/universal#README",
3942
"schematics": "./schematics/collection.json",
4043
"dependencies": {
41-
"@angular/animations": "^7.2.15",
42-
"@angular/common": "^7.2.15",
43-
"@angular/compiler": "^7.2.15",
44-
"@angular/core": "^7.2.15",
45-
"@angular/forms": "^7.2.15",
46-
"@angular/http": "^7.2.15",
47-
"@angular/platform-browser": "^7.2.15",
48-
"@angular/platform-browser-dynamic": "^7.2.15",
49-
"@angular/platform-server": "^7.2.15",
50-
"@angular/router": "^7.2.15",
51-
"@ng-web-apis/common": "1.13.0",
52-
"@nguniversal/common": "^7.1.1",
53-
"@nguniversal/express-engine": "^7.1.1",
54-
"@nguniversal/module-map-ngfactory-loader": "^7.1.1",
55-
"core-js": "^2.5.4",
56-
"rxjs": "^6.5.2",
57-
"tslib": "^1.10.0",
58-
"zone.js": "~0.8.29"
44+
"@angular/common": "12.2.15",
45+
"@angular/compiler": "12.2.15",
46+
"@angular/core": "12.2.15",
47+
"@angular/platform-browser": "12.2.15",
48+
"@angular/platform-browser-dynamic": "12.2.15",
49+
"core-js": "3.20.3",
50+
"rxjs": "7.5.2",
51+
"tslib": "2.3.1",
52+
"zone.js": "0.11.4"
5953
},
6054
"devDependencies": {
61-
"@angular-devkit/build-angular": "~0.13.9",
62-
"@angular-devkit/build-ng-packagr": "~0.13.9",
63-
"@angular-devkit/core": "^7.3.9",
64-
"@angular-devkit/schematics": "^7.3.9",
65-
"@angular-devkit/schematics-cli": "~0.13.9",
66-
"@angular/cli": "^7.3.9",
67-
"@angular/compiler-cli": "^7.2.15",
68-
"@angular/language-service": "^7.2.15",
69-
"@tinkoff/linters": "^0.4.0",
70-
"@types/express": "4.16.1",
71-
"@types/express-serve-static-core": "4.16.2",
72-
"@types/jasmine": "^3.3.16",
73-
"@types/jasminewd2": "^2.0.6",
74-
"@types/node": "~8.9.4",
75-
"codelyzer": "^5.1.0",
76-
"coveralls": "^3.0.5",
77-
"ecstatic": "^4.1.2",
78-
"express": "^4.17.1",
79-
"http-server": "^0.11.1",
80-
"husky": "^3.0.2",
81-
"jasmine-core": "~3.5.0",
82-
"jasmine-spec-reporter": "~4.2.1",
83-
"karma": "^4.2.0",
84-
"karma-chrome-launcher": "^3.0.0",
85-
"karma-coverage-istanbul-reporter": "^2.1.0",
86-
"karma-jasmine": "~2.0.1",
87-
"karma-jasmine-html-reporter": "^1.4.2",
88-
"lint-staged": "^9.2.1",
89-
"lodash": "^4.17.15",
90-
"ng-packagr": "4.7.1",
91-
"node-sass": "4.14.1",
92-
"prettier": "^1.18.2",
93-
"standard-version": "^8.0.1",
94-
"ts-node": "^8.3.0",
95-
"tsickle": "0.34.0",
96-
"tslint": "^5.18.0",
97-
"tsutils": "^3.17.1",
98-
"typescript": "3.1.6"
55+
"@angular-devkit/build-angular": "12.2.15",
56+
"@angular-devkit/core": "12.2.15",
57+
"@angular/cli": "12.2.15",
58+
"@angular/compiler-cli": "12.2.15",
59+
"@angular/language-service": "12.2.15",
60+
"@commitlint/cli": "^11.0.0",
61+
"@commitlint/config-conventional": "^11.0.0",
62+
"@ng-web-apis/common": "2.0.0",
63+
"@tinkoff/eslint-config": "^1.22.0",
64+
"@tinkoff/eslint-config-angular": "^1.23.0",
65+
"@tinkoff/prettier-config": "^1.22.0",
66+
"@types/jasmine": "3.10.3",
67+
"@types/jasminewd2": "2.0.10",
68+
"@types/node": "9.6.61",
69+
"coveralls": "3.1.1",
70+
"husky": "7.0.4",
71+
"jasmine-core": "4.0.0",
72+
"jasmine-spec-reporter": "7.0.0",
73+
"karma": "6.3.11",
74+
"karma-chrome-launcher": "3.1.0",
75+
"karma-coverage-istanbul-reporter": "3.0.3",
76+
"karma-jasmine": "4.0.1",
77+
"karma-jasmine-html-reporter": "1.7.0",
78+
"lint-staged": "12.2.1",
79+
"ng-packagr": "12.2.6",
80+
"prettier": "2.5.1",
81+
"standard-version": "9.3.2",
82+
"ts-node": "9.0.0",
83+
"tslint": "6.1.3",
84+
"typescript": "4.3.5"
9985
},
10086
"husky": {
10187
"hooks": {
10288
"pre-commit": "lint-staged && npm run typecheck"
10389
}
10490
},
10591
"lint-staged": {
106-
"*.{js,ts,html,md,less,json}": ["prettier --write", "git add"],
107-
"*.ts": "tslint"
92+
"*.{js,ts,html,md,less,json}": [
93+
"prettier --write",
94+
"git add"
95+
],
96+
"*.{js,ts}": [
97+
"eslint --fix",
98+
"git add"
99+
]
108100
},
109101
"standard-version": {
110102
"scripts": {

prettier.config.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
const base = require('@tinkoff/prettier-config/angular');
2+
13
module.exports = {
2-
...require('@tinkoff/linters/prettier/prettier.config'),
4+
...base,
5+
overrides: [
6+
...base.overrides,
7+
{
8+
files: ['*.js', '*.ts'],
9+
options: {printWidth: 90, parser: 'typescript'},
10+
},
11+
{
12+
files: '*.html',
13+
options: {printWidth: 80, parser: 'html'},
14+
},
15+
],
316
};

projects/universal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "@ng-web-apis/universal",
33
"version": "1.13.0",
44
"peerDependencies": {
5-
"@angular/core": ">=6.0.0",
6-
"@ng-web-apis/common": ">=1.13.0",
5+
"@angular/core": ">=12.0.0",
6+
"@ng-web-apis/common": ">=2.0.0",
77
"@types/node": ">=10.0.0",
88
"rxjs": ">=6.0.0"
99
},
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import {alwaysRejected} from '../utils/functions';
2+
13
export class BlobMock implements Blob {
24
size = 0;
35
type = '';
6+
arrayBuffer = () => alwaysRejected();
7+
stream = () => new ReadableStream();
8+
text = () => alwaysRejected();
49
slice = () => this;
510
}

projects/universal/src/constants/tests/universal-navigator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe('UNIVERSAL_NAVIGATOR', () => {
1919

2020
expect(mock.userAgent).toBe('');
2121
expect(mock.plugins.refresh).not.toThrow();
22-
expect(mock.plugins.item(0).item(0).description).toBe('');
23-
expect(mock.plugins.namedItem('whatever').namedItem('').suffixes).toBe('');
22+
expect(mock.plugins.item(0)).toBeNull();
23+
expect(mock.plugins.namedItem('whatever')).toBeNull();
2424
});
2525

2626
it('Reads provided user agent', () => {

0 commit comments

Comments
 (0)