NG16 - migrated with ADF

This commit is contained in:
VitoAlbano
2024-07-10 01:16:09 +01:00
parent 619e6ca960
commit 862646dab6
9 changed files with 13242 additions and 9966 deletions

View File

@@ -1,23 +1,41 @@
{ {
"root": true, "root": true,
"ignorePatterns": ["projects/**/*"], "ignorePatterns": [
"plugins": ["@nx"], "projects/**/*"
],
"plugins": [
"@nx"
],
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": [
"plugins": ["@alfresco/eslint-angular"], "*.ts"
"extends": ["plugin:@angular-eslint/template/process-inline-templates"], ],
"excludedFiles": ["*.spec.ts"], "plugins": [
"@alfresco/eslint-angular"
],
"extends": [
"plugin:@angular-eslint/template/process-inline-templates"
],
"excludedFiles": [
"*.spec.ts"
],
"rules": { "rules": {
"@alfresco/eslint-angular/use-none-component-view-encapsulation": "error" "@alfresco/eslint-angular/use-none-component-view-encapsulation": "error"
} }
}, },
{ {
"files": ["*.ts"], "files": [
"*.ts"
],
"parserOptions": { "parserOptions": {
"createDefaultProgram": true "createDefaultProgram": true
}, },
"extends": ["plugin:@nx/typescript", "plugin:@nx/angular", "plugin:@cspell/recommended"], "extends": [
"plugin:@nx/typescript",
"plugin:@nx/angular",
"plugin:@cspell/recommended"
],
"plugins": [ "plugins": [
"rxjs", "rxjs",
"unicorn", "unicorn",
@@ -90,7 +108,11 @@
"error", "error",
{ {
"type": "element", "type": "element",
"prefix": ["app", "aca", "adf"], "prefix": [
"app",
"aca",
"adf"
],
"style": "kebab-case" "style": "kebab-case"
} }
], ],
@@ -152,12 +174,17 @@
} }
} }
], ],
"@typescript-eslint/semi": ["error", "always"], "@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/naming-convention": [ "@typescript-eslint/naming-convention": [
"error", "error",
{ {
"selector": "enum", "selector": "enum",
"format": ["PascalCase"] "format": [
"PascalCase"
]
} }
], ],
"@typescript-eslint/no-inferrable-types": [ "@typescript-eslint/no-inferrable-types": [
@@ -175,7 +202,10 @@
} }
], ],
"@typescript-eslint/type-annotation-spacing": "error", "@typescript-eslint/type-annotation-spacing": "error",
"arrow-parents": ["off", "always"], "arrow-parents": [
"off",
"always"
],
"brace-style": [ "brace-style": [
"error", "error",
"1tbs", "1tbs",
@@ -187,7 +217,10 @@
"curly": "error", "curly": "error",
"dot-notation": "off", "dot-notation": "off",
"eol-last": "error", "eol-last": "error",
"eqeqeq": ["error", "smart"], "eqeqeq": [
"error",
"smart"
],
"guard-for-in": "error", "guard-for-in": "error",
"id-blacklist": "off", "id-blacklist": "off",
"id-match": "off", "id-match": "off",
@@ -257,7 +290,10 @@
"no-fallthrough": "error", "no-fallthrough": "error",
"no-multiple-empty-lines": "error", "no-multiple-empty-lines": "error",
"no-new-wrappers": "error", "no-new-wrappers": "error",
"no-restricted-imports": ["error", "rxjs/Rx"], "no-restricted-imports": [
"error",
"rxjs/Rx"
],
"no-self-assign": "error", "no-self-assign": "error",
"no-throw-literal": "error", "no-throw-literal": "error",
"no-trailing-spaces": "error", "no-trailing-spaces": "error",
@@ -283,7 +319,16 @@
"rxjs/no-unsafe-switchmap": [ "rxjs/no-unsafe-switchmap": [
"error", "error",
{ {
"disallow": ["add", "create", "delete", "post", "put", "remove", "set", "update"], "disallow": [
"add",
"create",
"delete",
"post",
"put",
"remove",
"set",
"update"
],
"observable": "action(s|\\$)?" "observable": "action(s|\\$)?"
} }
], ],
@@ -293,23 +338,40 @@
"error", "error",
"always", "always",
{ {
"markers": ["/"], "markers": [
"exceptions": ["!", "*"] "/"
],
"exceptions": [
"!",
"*"
]
} }
], ],
"space-before-function-paren": "off", "space-before-function-paren": "off",
"space-in-parens": ["off", "never"], "space-in-parens": [
"off",
"never"
],
"unicorn/filename-case": "error" "unicorn/filename-case": "error"
} }
}, },
{ {
"files": ["*.js"], "files": [
"extends": ["plugin:@nx/javascript"], "*.js"
],
"extends": [
"plugin:@nx/javascript"
],
"rules": {} "rules": {}
}, },
{ {
"files": ["*.html"], "files": [
"extends": ["plugin:@nx/angular-template", "plugin:@angular-eslint/template/accessibility"], "*.html"
],
"extends": [
"plugin:@nx/angular-template",
"plugin:@angular-eslint/template/accessibility"
],
"parser": "@angular-eslint/template-parser", "parser": "@angular-eslint/template-parser",
"rules": { "rules": {
"@angular-eslint/template/no-negated-async": "off", "@angular-eslint/template/no-negated-async": "off",
@@ -319,8 +381,14 @@
} }
}, },
{ {
"files": ["*.spec.ts", "*.test.ts", "*.e2e.ts"], "files": [
"plugins": ["@alfresco/eslint-angular"], "*.spec.ts",
"*.test.ts",
"*.e2e.ts"
],
"plugins": [
"@alfresco/eslint-angular"
],
"rules": { "rules": {
"@typescript-eslint/no-floating-promises": "warn", "@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-misused-promises": "warn", "@typescript-eslint/no-misused-promises": "warn",
@@ -329,8 +397,13 @@
} }
}, },
{ {
"files": ["*.e2e.ts", "*.ts"], "files": [
"extends": ["plugin:playwright/playwright-test"], "*.e2e.ts",
"*.ts"
],
"extends": [
"plugin:playwright/playwright-test"
],
"rules": { "rules": {
"no-empty-pattern": "off", "no-empty-pattern": "off",
"playwright/expect-expect": "off", "playwright/expect-expect": "off",

View File

@@ -1,11 +1,18 @@
{ {
"extends": "../.eslintrc.json", "extends": "../.eslintrc.json",
"ignorePatterns": ["!**/*"], "ignorePatterns": [
"!**/*"
],
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": [
"*.ts"
],
"parserOptions": { "parserOptions": {
"project": ["app/tsconfig.app.json", "app/tsconfig.spec.json"], "project": [
"app/tsconfig.app.json",
"app/tsconfig.spec.json"
],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"rules": {} "rules": {}

View File

@@ -1,14 +1,23 @@
{ {
"extends": "../../../.eslintrc.json", "extends": "../../../.eslintrc.json",
"ignorePatterns": ["!**/*"], "ignorePatterns": [
"!**/*"
],
"overrides": [ "overrides": [
{ {
"files": ["*.ts"], "files": [
"*.ts"
],
"parserOptions": { "parserOptions": {
"project": ["e2e/playwright/pagination/tsconfig.e2e.json"], "project": [
"e2e/playwright/pagination/tsconfig.e2e.json"
],
"createDefaultProgram": true "createDefaultProgram": true
}, },
"plugins": ["rxjs", "unicorn"], "plugins": [
"rxjs",
"unicorn"
],
"rules": { "rules": {
"@typescript-eslint/no-floating-promises": "off" "@typescript-eslint/no-floating-promises": "off"
} }

11
migrations.json Normal file
View File

@@ -0,0 +1,11 @@
{
"migrations": [
{
"version": "16.0.0-alpha.0",
"description": "Updates @angular-eslint to v16",
"factory": "./migrations/update-16-0-0/update-16-0-0",
"package": "@angular-eslint/schematics",
"name": "update-16-0-0"
}
]
}

22953
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,6 @@
"version": "4.5.0", "version": "4.5.0",
"license": "LGPL-3.0", "license": "LGPL-3.0",
"scripts": { "scripts": {
"postinstall": "ngcc",
"ng": "ng", "ng": "ng",
"start": "nx serve content-ce", "start": "nx serve content-ce",
"start:prod": "node --max-old-space-size=8192 nx serve content-ce --configuration production", "start:prod": "node --max-old-space-size=8192 nx serve content-ce --configuration production",
@@ -34,28 +33,28 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@alfresco/adf-content-services": "6.10.0-9567457758", "@alfresco/adf-content-services": "6.10.0-9865499484",
"@alfresco/adf-core": "6.10.0-9567457758", "@alfresco/adf-core": "6.10.0-9865499484",
"@alfresco/adf-extensions": "6.10.0-9567457758", "@alfresco/adf-extensions": "6.10.0-9865499484",
"@alfresco/eslint-plugin-eslint-angular": "6.10.0-9567457758", "@alfresco/eslint-plugin-eslint-angular": "6.10.0-9865499484",
"@alfresco/js-api": ">=7.9.0-0", "@alfresco/js-api": ">=7.9.0-0",
"@angular/animations": "15.2.10", "@angular/animations": "16.2.9",
"@angular/cdk": "15.2.9", "@angular/cdk": "16.2.9",
"@angular/common": "15.2.10", "@angular/common": "16.2.9",
"@angular/compiler": "15.2.10", "@angular/compiler": "16.2.9",
"@angular/core": "15.2.10", "@angular/core": "16.2.9",
"@angular/forms": "15.2.10", "@angular/forms": "16.2.9",
"@angular/material": "15.2.9", "@angular/material": "16.2.9",
"@angular/material-date-fns-adapter": "15.2.9", "@angular/material-date-fns-adapter": "16.2.9",
"@angular/platform-browser": "15.2.10", "@angular/platform-browser": "16.2.9",
"@angular/platform-browser-dynamic": "15.2.10", "@angular/platform-browser-dynamic": "16.2.9",
"@angular/router": "15.2.10", "@angular/router": "16.2.9",
"@fontsource/open-sans": "^5.0.27", "@fontsource/open-sans": "^5.0.27",
"@mat-datetimepicker/core": "11.0.3", "@mat-datetimepicker/core": "12.0.1",
"@ngrx/effects": "^15.2.0", "@ngrx/effects": "16.3.0",
"@ngrx/router-store": "^15.2.0", "@ngrx/router-store": "16.3.0",
"@ngrx/store": "^15.2.0", "@ngrx/store": "16.3.0",
"@ngrx/store-devtools": "^15.2.0", "@ngrx/store-devtools": "16.3.0",
"@ngx-translate/core": "^14.0.0", "@ngx-translate/core": "^14.0.0",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"material-icons": "^1.13.12", "material-icons": "^1.13.12",
@@ -63,21 +62,21 @@
"pdfjs-dist": "3.3.122", "pdfjs-dist": "3.3.122",
"rxjs": "6.6.6", "rxjs": "6.6.6",
"tslib": "^2.5.3", "tslib": "^2.5.3",
"zone.js": "0.11.8" "zone.js": "0.13.0"
}, },
"devDependencies": { "devDependencies": {
"@alfresco/adf-cli": "6.10.0-9567457758", "@alfresco/adf-cli": "6.10.0-9865499484",
"@angular-devkit/build-angular": "15.2.10", "@angular-devkit/build-angular": "16.2.9",
"@angular-devkit/core": "15.2.10", "@angular-devkit/core": "16.2.9",
"@angular-devkit/schematics": "15.2.10", "@angular-devkit/schematics": "16.2.9",
"@angular-eslint/builder": "^15.2.1", "@angular-eslint/builder": "16.3.1",
"@angular-eslint/eslint-plugin": "^16.1.2", "@angular-eslint/eslint-plugin": "16.3.1",
"@angular-eslint/eslint-plugin-template": "^16.0.2", "@angular-eslint/eslint-plugin-template": "16.3.1",
"@angular-eslint/schematics": "15.2.1", "@angular-eslint/schematics": "16.3.1",
"@angular-eslint/template-parser": "^15.2.1", "@angular-eslint/template-parser": "16.3.1",
"@angular/cli": "15.2.10", "@angular/cli": "16.2.9",
"@angular/compiler-cli": "15.2.10", "@angular/compiler-cli": "16.2.9",
"@angular/language-service": "15.2.10", "@angular/language-service": "16.2.9",
"@cspell/eslint-plugin": "^8.3.2", "@cspell/eslint-plugin": "^8.3.2",
"@nx/angular": "17.0.2", "@nx/angular": "17.0.2",
"@nx/eslint-plugin": "17.0.2", "@nx/eslint-plugin": "17.0.2",
@@ -90,11 +89,11 @@
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
"@types/selenium-webdriver": "^4.0.9", "@types/selenium-webdriver": "^4.0.9",
"@types/superagent": "^4.1.10", "@types/superagent": "^4.1.10",
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.48.2", "@typescript-eslint/parser": "^5.59.2",
"dotenv": "16.4.5", "dotenv": "16.4.5",
"dotenv-expand": "^5.1.0", "dotenv-expand": "^5.1.0",
"eslint": "^8.42.0", "eslint": "^8.39.0",
"eslint-plugin-ban": "^1.6.0", "eslint-plugin-ban": "^1.6.0",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-jsdoc": "48.2.3",
@@ -114,9 +113,9 @@
"karma-jasmine-html-reporter": "^2.0.0", "karma-jasmine-html-reporter": "^2.0.0",
"karma-mocha-reporter": "^2.2.5", "karma-mocha-reporter": "^2.2.5",
"lint-staged": "^15.2.0", "lint-staged": "^15.2.0",
"ng-packagr": "^15.2.1", "ng-packagr": "16.2.3",
"node-stream-zip": "^1.14.0", "node-stream-zip": "^1.14.0",
"nx": "17.3.1", "nx": "16.7.0",
"prettier": "2.8.8", "prettier": "2.8.8",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"protractor-retry-angular-cli": "^2.0.3", "protractor-retry-angular-cli": "^2.0.3",

View File

@@ -23,14 +23,14 @@
*/ */
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { AuthenticationService } from '@alfresco/adf-core'; import { AuthenticationService } from '@alfresco/adf-core';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class ViewProfileRuleGuard implements CanActivate { export class ViewProfileRuleGuard {
constructor(private authService: AuthenticationService) {} constructor(private authService: AuthenticationService) {}
canActivate(): Observable<boolean> | Promise<boolean> | boolean { canActivate(): Observable<boolean> | Promise<boolean> | boolean {

View File

@@ -23,7 +23,7 @@
*/ */
import { Injectable, InjectionToken, Inject } from '@angular/core'; import { Injectable, InjectionToken, Inject } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot } from '@angular/router';
import { Observable, forkJoin, of } from 'rxjs'; import { Observable, forkJoin, of } from 'rxjs';
import { tap, map, catchError } from 'rxjs/operators'; import { tap, map, catchError } from 'rxjs/operators';
@@ -37,7 +37,7 @@ export const EXTENSION_DATA_LOADERS = new InjectionToken<ExtensionLoaderCallback
}); });
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class ExtensionsDataLoaderGuard implements CanActivate { export class ExtensionsDataLoaderGuard {
private invoked = false; private invoked = false;
constructor( constructor(

View File

@@ -23,7 +23,7 @@
*/ */
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store'; import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store';
@@ -31,7 +31,7 @@ import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class AppSharedRuleGuard implements CanActivate { export class AppSharedRuleGuard {
isQuickShareEnabled$: Observable<boolean>; isQuickShareEnabled$: Observable<boolean>;
constructor(store: Store<AppStore>) { constructor(store: Store<AppStore>) {