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

Commit

Permalink
feat!: update to Angular 12 and Ivy distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea committed Jul 15, 2022
1 parent 839d776 commit 90e166b
Show file tree
Hide file tree
Showing 22 changed files with 36,472 additions and 12,440 deletions.
55 changes: 55 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: [
// TODO: warning No cached ProjectGraph is available. The rule will be skipped. @nrwl/nx/enforce-module-boundaries
// If you encounter this error as part of running standard `nx` commands then please open an issue on
// https://github.com/nrwl/nx
// './scripts/eslint/nx.js',
'@tinkoff/eslint-config-angular',
'@tinkoff/eslint-config-angular/html',
'@tinkoff/eslint-config-angular/imports',
'@tinkoff/eslint-config-angular/line-statements',
'@tinkoff/eslint-config-angular/member-ordering',
],
ignorePatterns: ['projects/**/test.ts', '*.js', '*.json', '*.less', '*.md'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: [require.resolve('./tsconfig.eslint.json')],
},
parser: '@typescript-eslint/parser',
rules: {
'dot-notation': 'off',
'@typescript-eslint/dot-notation': [
'error',
{
allowPrivateClassPropertyAccess: true,
allowProtectedClassPropertyAccess: true,
allowIndexSignaturePropertyAccess: true,
},
],
'@typescript-eslint/no-useless-constructor': 'off',
'no-prototype-builtins': 'off',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
'@typescript-eslint/prefer-includes': 'error',
'prefer-template': 'error',
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
allowDirectConstAssertionInArrowFunctions: true,
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
},
],
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
},
};
5 changes: 5 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
# shellcheck disable=SC1090
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
# shellcheck disable=SC1090
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npm run typecheck
91 changes: 66 additions & 25 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"main": "projects/demo/src/main.browser.ts",
"polyfills": "projects/demo/src/polyfills.ts",
"tsConfig": "tsconfig.json",
"aot": false,
"assets": [
{
"glob": "**/*",
Expand All @@ -30,6 +29,13 @@
"projects/demo/src/favicon.ico"
],
"styles": ["projects/demo/src/styles.css"],
"showCircularDependencies": false,
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true,
"scripts": []
},
"configurations": {
Expand All @@ -39,21 +45,24 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"statsJson": false,
"progress": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
},
"development": {
"baseHref": "/",
"deployUrl": "/"
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand All @@ -70,16 +79,58 @@
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/demo/server",
"main": "projects/demo/src/main.server.ts",
"tsConfig": "projects/demo/tsconfig.server.json"
}
"main": "projects/demo/server.ts",
"tsConfig": "projects/demo/tsconfig.server.json",
"inlineStyleLanguage": "less"
},
"configurations": {
"production": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "projects/demo/src/environments/environment.ts",
"with": "projects/demo/src/environments/environment.prod.ts"
}
]
},
"development": {
"optimization": false,
"sourceMap": true,
"extractLicenses": false
}
},
"defaultConfiguration": "production"
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"configurations": {
"development": {
"browserTarget": "demo:build:development",
"serverTarget": "demo:server:development"
},
"production": {
"browserTarget": "demo:build:production",
"serverTarget": "demo:server:production"
}
},
"defaultConfiguration": "development"
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"tsConfig": ["tsconfig.json"],
"exclude": ["**/node_modules/**"]
}
"routes": ["/"]
},
"configurations": {
"production": {
"browserTarget": "demo:build:production",
"serverTarget": "demo:server:production"
},
"development": {
"browserTarget": "demo:build:development",
"serverTarget": "demo:server:development"
}
},
"defaultConfiguration": "production"
}
}
},
Expand All @@ -89,7 +140,7 @@
"sourceRoot": "projects/intersection-observer/src",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/intersection-observer/tsconfig.lib.json",
"project": "projects/intersection-observer/ng-package.json"
Expand All @@ -104,16 +155,6 @@
"codeCoverage": true,
"browsers": "ChromeHeadless"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/intersection-observer/tsconfig.lib.json",
"projects/intersection-observer/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
Loading

0 comments on commit 90e166b

Please sign in to comment.