NG-16 - migration step 1

This commit is contained in:
VitoAlbano
2024-08-02 00:10:21 +01:00
committed by Ehsan Rezaei
parent c08e8d6b31
commit 28813693da
34 changed files with 9357 additions and 6925 deletions

View File

@@ -4,7 +4,7 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nrwl/nx/angular"],
"extends": ["plugin:@nx/angular"],
"parserOptions": {
"project": ["lib/core/tsconfig.lib.json", "lib/core/tsconfig.spec.json"],
"createDefaultProgram": true
@@ -15,7 +15,12 @@
"@typescript-eslint/consistent-type-assertions": "warn",
"@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/member-ordering": "off",
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
"no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"no-shadow": "warn",
"quote-props": "warn",
"object-shorthand": "warn",
@@ -24,7 +29,6 @@
"arrow-body-style": "warn",
"@angular-eslint/no-output-native": "off",
"space-before-function-paren": "warn",
"@angular-eslint/component-selector": [
"error",
{
@@ -77,11 +81,10 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {
"@angular-eslint/template/no-autofocus": "error",
"@angular-eslint/template/no-positive-tabindex": "error",
"@angular-eslint/template/no-negated-async": "off"
}
}

View File

@@ -4,14 +4,19 @@ module.exports = {
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [...rootMain.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
framework: {
name: "@storybook/angular",
options: (()=>console.log('loaded config!'))()
},
staticDirs: [
...rootMain.staticDirs,
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-core/i18n' },
{ from: __dirname + '/../src/lib/assets/images', to: 'assets/images' }
],
addons: ['@storybook/addon-essentials', ...rootMain.addons]
addons: ['@storybook/addon-essentials', ...rootMain.addons],
docs: {}
};

View File

@@ -3,3 +3,4 @@ const rootPreview = require('../../../.storybook/preview');
export const parameters = {
...rootPreview.preview
};
export const tags = ['autodocs'];

View File

@@ -17,13 +17,13 @@
import { Inject, Injectable, inject } from '@angular/core';
import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface';
import { CanMatch, Route } from '@angular/router';
import { Route } from '@angular/router';
import { Observable } from 'rxjs';
export const isFeatureOff = (flag: string) => () => inject(FeaturesServiceToken).isOff$(flag);
@Injectable({ providedIn: 'root' })
export class IsFeatureOff implements CanMatch {
export class IsFeatureOff {
constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {}
canMatch(route: Route): Observable<boolean> {

View File

@@ -17,13 +17,13 @@
import { Inject, Injectable, inject } from '@angular/core';
import { FeaturesServiceToken, IFeaturesService } from '../interfaces/features.interface';
import { CanMatch, Route } from '@angular/router';
import { Route } from '@angular/router';
import { Observable } from 'rxjs';
export const isFeatureOn = (flag: string) => () => inject(FeaturesServiceToken).isOn$(flag);
@Injectable({ providedIn: 'root' })
export class IsFeatureOn implements CanMatch {
export class IsFeatureOn {
constructor(@Inject(FeaturesServiceToken) private featuresServiceToken: IFeaturesService) {}
canMatch(route: Route): Observable<boolean> {

View File

@@ -17,12 +17,12 @@
import { Inject, Injectable, Optional, inject } from '@angular/core';
import { FlagsOverrideToken } from '../interfaces/features.interface';
import { CanMatch } from '@angular/router';
export const isFlagsOverrideOn = () => () => inject(FlagsOverrideToken) ?? false;
@Injectable({ providedIn: 'root' })
export class IsFlagsOverrideOn implements CanMatch {
export class IsFlagsOverrideOn {
constructor(@Optional() @Inject(FlagsOverrideToken) private devToolsToken: boolean) {}
canMatch(): boolean {