From dfc0e05890fb08f05266dc8971bbd025f78d134d Mon Sep 17 00:00:00 2001 From: eromano Date: Thu, 3 Mar 2022 16:10:15 +0000 Subject: [PATCH] fix fix lint workaround to remove remove some unused dependencies fix flex import Signed-off-by: eromano --- .stylelintignore | 1 + angular.json | 2 +- .../src/lib/tag/tag-node-list.component.scss | 2 +- .../sidenav-layout.component.scss | 4 +- lib/core/pagination/pagination.component.scss | 4 +- lib/core/styles/_flex.scss | 78 +++++++++++++++++++ lib/core/styles/_theming.scss | 1 - nx.json | 11 +++ scripts/lint.sh | 6 +- 9 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 lib/core/styles/_flex.scss diff --git a/.stylelintignore b/.stylelintignore index 66f64bc148..e4152edfa6 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,2 +1,3 @@ _theming.scss lib/core/viewer/components/pdf-viewer-host.component.scss +lib/dist diff --git a/angular.json b/angular.json index 75f855025e..3acb4d7f32 100644 --- a/angular.json +++ b/angular.json @@ -188,7 +188,7 @@ "budgets": [ { "type": "anyComponentStyle", - "maximumWarning": "6kb" + "maximumWarning": "12kb" } ], "optimization": true, diff --git a/lib/content-services/src/lib/tag/tag-node-list.component.scss b/lib/content-services/src/lib/tag/tag-node-list.component.scss index ab14d76697..edc2a7e19c 100644 --- a/lib/content-services/src/lib/tag/tag-node-list.component.scss +++ b/lib/content-services/src/lib/tag/tag-node-list.component.scss @@ -20,7 +20,7 @@ font-size: var(--theme-title-font-size); background-repeat: no-repeat; display: inline-block; - fill: currentColor; + fill: currentcolor; height: 20px; width: 20px; color: var(--theme-primary-color-default-contrast) !important; diff --git a/lib/core/layout/components/sidenav-layout/sidenav-layout.component.scss b/lib/core/layout/components/sidenav-layout/sidenav-layout.component.scss index 0561a129c9..567638a13f 100644 --- a/lib/core/layout/components/sidenav-layout/sidenav-layout.component.scss +++ b/lib/core/layout/components/sidenav-layout/sidenav-layout.component.scss @@ -1,4 +1,4 @@ -@import '@angular/flex-layout/mq'; +@use '../../../styles/flex' as flex; @import '../../../styles/mixins'; .adf-sidenav-layout { @@ -24,7 +24,7 @@ flex: 0 0; } - @include layout-bp(lt-sm) { + @include flex.layout-bp(lt-sm) { .mat-drawer { width: calc(-50px + 100vw) !important; max-width: 300px !important; diff --git a/lib/core/pagination/pagination.component.scss b/lib/core/pagination/pagination.component.scss index 358dc216bc..0ee24c3217 100644 --- a/lib/core/pagination/pagination.component.scss +++ b/lib/core/pagination/pagination.component.scss @@ -1,4 +1,4 @@ -@import '@angular/flex-layout/mq'; +@use '../styles/flex' as flex; $adf-pagination-height: 48px !default; $adf-pagination-icon-button-size: 32px !default; @@ -29,7 +29,7 @@ $adf-pagination-empty-border: none !default; } } - @include layout-bp(lt-sm) { + @include flex.layout-bp(lt-sm) { & { flex-wrap: wrap; padding: 0 16px; diff --git a/lib/core/styles/_flex.scss b/lib/core/styles/_flex.scss new file mode 100644 index 0000000000..910fdeaa92 --- /dev/null +++ b/lib/core/styles/_flex.scss @@ -0,0 +1,78 @@ +@charset "UTF-8"; +/* stylelint-disable */ + +// Non-overlapping Material Design breakpoints +// @type map +$breakpoints: ( + xs: ( + begin: 0, + end: 599.9px + ), + sm: ( + begin: 600px, + end: 959.9px + ), + md: ( + begin: 960px, + end: 1279.9px + ), + lg: ( + begin: 1280px, + end: 1919.9px + ), + xl: ( + begin: 1920px, + end: 4999.99px + ), +) !default; + +// Overlapping breakpoints that are greater than defined +// Material Design breakpoints +// @type map +$overlapping-gt: ( + gt-xs: 600px, + gt-sm: 960px, + gt-md: 1280px, + gt-lg: 1920px, +) !default; + +// Overlapping breakpoints that are less than defined +// Material Design breakpoints +// @type map +$overlapping-lt: ( + lt-sm: 599.9px, + lt-md: 959.9px, + lt-lg: 1279.9px, + lt-xl: 1919.9px, +) !default; + + +// Media Query Mixin, takes a breakpoint and returns a wrapping +// media query statement +// e.g. +// +// @include layout-bp(xs) { +// background-color: red; +// } +// +// becomes +// +// @media (min-width: 0px) and (max-width: 599px) { +// background-color: red; +// } +@mixin layout-bp($bp) { + @if map-has-key($breakpoints, $bp) { + $min: map-get(map-get($breakpoints, $bp), begin); + $max: map-get(map-get($breakpoints, $bp), end); + @media (min-width: $min) and (max-width: $max) { @content; } + } + @else if map-has-key($overlapping-gt, $bp) { + $min: map-get($overlapping-gt, $bp); + @media (min-width: $min) { @content; } + } + @else if map-has-key($overlapping-lt, $bp) { + $max: map-get($overlapping-lt, $bp); + @media (max-width: $max) { @content; } + } +} +/* stylelint-enable */ diff --git a/lib/core/styles/_theming.scss b/lib/core/styles/_theming.scss index 1924af119a..7c75472f15 100644 --- a/lib/core/styles/_theming.scss +++ b/lib/core/styles/_theming.scss @@ -1,4 +1,3 @@ -@import '@angular/flex-layout/mq'; @import './colors'; @import './mixins'; @import './typography'; diff --git a/nx.json b/nx.json index 15e747957c..f935cd55f6 100644 --- a/nx.json +++ b/nx.json @@ -13,44 +13,55 @@ }, "projects": { "demoshell": { + "root": "demo-shell", "implicitDependencies": ["process-services", "content-services", "process-services-cloud", "core", "insights", "extensions"], "tags": ["scope:demoshell", "type:app"] }, "extensions": { + "root": "lib/extensions", "tags": ["scope:extensions", "type:lib"] }, "core": { + "root": "lib/core", "implicitDependencies": ["extensions"], "tags": ["scope:core", "type:lib"] }, "content-services": { + "root": "lib/content-services", "implicitDependencies": ["core"], "tags": ["scope:content-services", "type:lib"] }, "process-services": { + "root": "lib/process-services", "implicitDependencies": ["content-services"], "tags": ["scope:process-services", "type:lib"] }, "process-services-cloud": { + "root": "lib/process-services-cloud", "implicitDependencies": ["content-services"], "tags": ["scope:process-services-cloud", "type:lib"] }, "insights": { + "root": "lib/insights", "implicitDependencies": ["core"], "tags": ["scope:insights", "type:lib"] }, "demoshell-e2e": { + "root": "lib/demoshell-e2e", "implicitDependencies": ["testing"], "tags": ["scope:demoshell-e2e", "type:e2e"] }, "testing": { + "root": "lib/testing", "implicitDependencies": [], "tags": ["scope:testing", "type:lib"] }, "cli": { + "root": "lib/cli", "tags": ["scope:cli", "type:lib"] }, "stories": { + "root": "lib/stories", "tags": ["scope:stories", "type:lib"] } } diff --git a/scripts/lint.sh b/scripts/lint.sh index 676abcad09..bd3198c895 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -3,13 +3,15 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$DIR/../" -if grep "envalfresco" . -R --exclude-dir={node_modules,.history,.idea,scripts,dist,e2e-output,.git} --exclude={.env,.env.*}; then +echo "Check envs" + +if grep "envalfresco" . -R --exclude-dir={.angular,.lib,.coverage,node_modules,.history,.idea,scripts,dist,e2e-output,.git} --exclude={.env,.env.*}; then echo not permitted word exit 1 fi echo "Lint" -nx affected:lint --parallel --all --maxParallel=9 || exit 1 +nx affected:lint --parallel=5 --all || exit 1 echo "Style Lint" npm run stylelint || exit 1