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

Commit 3099816

Browse files
committed
feat!: update to Angular 12 and Ivy distribution
1 parent 48434d8 commit 3099816

23 files changed

+36009
-11663
lines changed

.eslintrc.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* @type {import('eslint').Linter.Config}
3+
*/
4+
module.exports = {
5+
root: true,
6+
extends: [
7+
// TODO: warning No cached ProjectGraph is available. The rule will be skipped. @nrwl/nx/enforce-module-boundaries
8+
// If you encounter this error as part of running standard `nx` commands then please open an issue on
9+
// https://github.com/nrwl/nx
10+
// './scripts/eslint/nx.js',
11+
'@tinkoff/eslint-config-angular',
12+
'@tinkoff/eslint-config-angular/html',
13+
'@tinkoff/eslint-config-angular/imports',
14+
'@tinkoff/eslint-config-angular/line-statements',
15+
'@tinkoff/eslint-config-angular/member-ordering',
16+
],
17+
ignorePatterns: [
18+
'projects/**/test.ts',
19+
'projects/**/icons/all.ts',
20+
'*.js',
21+
'*.json',
22+
'*.less',
23+
'*.md',
24+
],
25+
parserOptions: {
26+
ecmaVersion: 'latest',
27+
sourceType: 'module',
28+
project: [require.resolve('./tsconfig.eslint.json')],
29+
},
30+
parser: '@typescript-eslint/parser',
31+
rules: {
32+
'dot-notation': 'off',
33+
'@typescript-eslint/dot-notation': [
34+
'error',
35+
{
36+
allowPrivateClassPropertyAccess: true,
37+
allowProtectedClassPropertyAccess: true,
38+
allowIndexSignaturePropertyAccess: true,
39+
},
40+
],
41+
'@typescript-eslint/no-useless-constructor': 'off',
42+
'no-prototype-builtins': 'off',
43+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
44+
'@typescript-eslint/prefer-includes': 'error',
45+
'prefer-template': 'error',
46+
'@typescript-eslint/explicit-function-return-type': [
47+
'error',
48+
{
49+
allowExpressions: true,
50+
allowTypedFunctionExpressions: true,
51+
allowHigherOrderFunctions: true,
52+
allowDirectConstAssertionInArrowFunctions: true,
53+
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
54+
},
55+
],
56+
'@typescript-eslint/no-base-to-string': 'error',
57+
'@typescript-eslint/ban-types': 'error',
58+
'@typescript-eslint/no-for-in-array': 'error',
59+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
60+
'@typescript-eslint/prefer-optional-chain': 'error',
61+
},
62+
};

.husky/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# shellcheck disable=SC1090
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npx commitlint --edit $1

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
# shellcheck disable=SC1090
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npx lint-staged
6+
npm run typecheck

angular.json

Lines changed: 66 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"main": "projects/demo/src/main.browser.ts",
2121
"polyfills": "projects/demo/src/polyfills.ts",
2222
"tsConfig": "tsconfig.json",
23-
"aot": false,
2423
"assets": [
2524
{
2625
"glob": "**/*",
@@ -30,6 +29,13 @@
3029
"projects/demo/src/favicon.ico"
3130
],
3231
"styles": ["projects/demo/src/styles.css"],
32+
"showCircularDependencies": false,
33+
"vendorChunk": true,
34+
"extractLicenses": false,
35+
"buildOptimizer": false,
36+
"sourceMap": true,
37+
"optimization": false,
38+
"namedChunks": true,
3339
"scripts": []
3440
},
3541
"configurations": {
@@ -39,21 +45,24 @@
3945
"optimization": true,
4046
"outputHashing": "all",
4147
"sourceMap": false,
42-
"extractCss": true,
4348
"namedChunks": false,
44-
"aot": true,
45-
"extractLicenses": true,
46-
"vendorChunk": false,
4749
"buildOptimizer": true,
50+
"statsJson": false,
51+
"progress": false,
4852
"budgets": [
4953
{
5054
"type": "initial",
5155
"maximumWarning": "2mb",
5256
"maximumError": "5mb"
5357
}
5458
]
59+
},
60+
"development": {
61+
"baseHref": "/",
62+
"deployUrl": "/"
5563
}
56-
}
64+
},
65+
"defaultConfiguration": "production"
5766
},
5867
"serve": {
5968
"builder": "@angular-devkit/build-angular:dev-server",
@@ -70,16 +79,58 @@
7079
"builder": "@angular-devkit/build-angular:server",
7180
"options": {
7281
"outputPath": "dist/demo/server",
73-
"main": "projects/demo/src/main.server.ts",
74-
"tsConfig": "projects/demo/tsconfig.server.json"
75-
}
82+
"main": "projects/demo/server.ts",
83+
"tsConfig": "projects/demo/tsconfig.server.json",
84+
"inlineStyleLanguage": "less"
85+
},
86+
"configurations": {
87+
"production": {
88+
"outputHashing": "media",
89+
"fileReplacements": [
90+
{
91+
"replace": "projects/demo/src/environments/environment.ts",
92+
"with": "projects/demo/src/environments/environment.prod.ts"
93+
}
94+
]
95+
},
96+
"development": {
97+
"optimization": false,
98+
"sourceMap": true,
99+
"extractLicenses": false
100+
}
101+
},
102+
"defaultConfiguration": "production"
103+
},
104+
"serve-ssr": {
105+
"builder": "@nguniversal/builders:ssr-dev-server",
106+
"configurations": {
107+
"development": {
108+
"browserTarget": "demo:build:development",
109+
"serverTarget": "demo:server:development"
110+
},
111+
"production": {
112+
"browserTarget": "demo:build:production",
113+
"serverTarget": "demo:server:production"
114+
}
115+
},
116+
"defaultConfiguration": "development"
76117
},
77-
"lint": {
78-
"builder": "@angular-devkit/build-angular:tslint",
118+
"prerender": {
119+
"builder": "@nguniversal/builders:prerender",
79120
"options": {
80-
"tsConfig": ["tsconfig.json"],
81-
"exclude": ["**/node_modules/**"]
82-
}
121+
"routes": ["/"]
122+
},
123+
"configurations": {
124+
"production": {
125+
"browserTarget": "demo:build:production",
126+
"serverTarget": "demo:server:production"
127+
},
128+
"development": {
129+
"browserTarget": "demo:build:development",
130+
"serverTarget": "demo:server:development"
131+
}
132+
},
133+
"defaultConfiguration": "production"
83134
}
84135
}
85136
},
@@ -89,7 +140,7 @@
89140
"sourceRoot": "projects/mutation-observer/src",
90141
"architect": {
91142
"build": {
92-
"builder": "@angular-devkit/build-ng-packagr:build",
143+
"builder": "@angular-devkit/build-angular:ng-packagr",
93144
"options": {
94145
"tsConfig": "projects/mutation-observer/tsconfig.lib.json",
95146
"project": "projects/mutation-observer/ng-package.json"
@@ -104,16 +155,6 @@
104155
"codeCoverage": true,
105156
"browsers": "ChromeHeadless"
106157
}
107-
},
108-
"lint": {
109-
"builder": "@angular-devkit/build-angular:tslint",
110-
"options": {
111-
"tsConfig": [
112-
"projects/mutation-observer/tsconfig.lib.json",
113-
"projects/mutation-observer/tsconfig.spec.json"
114-
],
115-
"exclude": ["**/node_modules/**"]
116-
}
117158
}
118159
}
119160
}

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']};

0 commit comments

Comments
 (0)