From 941b9538e0ee82b051c09175c98b82f50225c9a1 Mon Sep 17 00:00:00 2001
From: Rajab Natshah <rajabn@gmail.com>
Date: Sun, 27 Mar 2022 17:49:16 +0300
Subject: [PATCH] Issue #3271850: Switch from deprecated Node Sass to Dart Sass
 compiler using Gulp and change minimum node version to 16.0 and later in the
 Varbase distribution

---
 .eslintignore     |  2 +-
 .eslintrc.json    | 17 ++-----------
 .prettierignore   |  2 ++
 .prettierrc.json  |  6 +++++
 .stylelintignore  |  8 ++++++
 .stylelintrc.json | 64 ++++++++++++++++++++++++++++++++++-------------
 gulpfile.js       |  6 +++--
 package.json      |  1 +
 yarn.lock         | 58 ++++++++++++++++++++++++++++++++++++------
 9 files changed, 121 insertions(+), 43 deletions(-)
 create mode 100644 .prettierignore
 create mode 100644 .prettierrc.json

diff --git a/.eslintignore b/.eslintignore
index 46f74536..0c0998a2 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -5,4 +5,4 @@ behat.yml
 behat.varbase.yml
 drupalci.yml
 **/drupalci.yml
-**/libraries
+**/libraries/
diff --git a/.eslintrc.json b/.eslintrc.json
index efd1bb4f..72a05f53 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -28,15 +28,8 @@
     "CKEditor5": true,
     "tabbable": true
   },
-  "settings": {
-    "react": {
-      "version": "latest"
-    }
-  },
   "rules": {
-    "prettier/prettier": ["error", {
-      "trailingComma": "none"
-    }],
+    "prettier/prettier": "error",
     "consistent-return": ["off"],
     "no-underscore-dangle": ["off"],
     "max-nested-callbacks": ["warn", 3],
@@ -54,12 +47,6 @@
       "requireReturn": false
     }],
     "no-unused-vars": ["warn"],
-    "object-shorthand": 0,
-    "prefer-arrow-callback": 0,
-    "func-names": 0,
-    "no-use-before-define": 0,
-    "one-var": 0,
-    "operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }],
-    "prefer-template": 0
+    "operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]
   }
 }
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..c4153d75
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,2 @@
+node_modules
+*.yml
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 00000000..c06cd1fd
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,6 @@
+{
+  "printWidth": 80,
+  "semi": true,
+  "singleQuote": true,
+  "trailingComma": "all"
+}
diff --git a/.stylelintignore b/.stylelintignore
index 65534c7a..9ec0b7da 100644
--- a/.stylelintignore
+++ b/.stylelintignore
@@ -1,5 +1,6 @@
 node_modules/**/*.css
 vendor/**/*.css
+**/libraries/
 **/*.min.css"
 /css/variables.css
 /css/mixins/
@@ -18,4 +19,11 @@ config/**/*.yml
 *.ico
 *.json
 *.make
+*.md
+*.po
+*.xml
+*.js
+*.install
+*.profile
+*.lock
 package
diff --git a/.stylelintrc.json b/.stylelintrc.json
index e62f4aca..58f01bb8 100644
--- a/.stylelintrc.json
+++ b/.stylelintrc.json
@@ -1,23 +1,32 @@
 {
   "extends": "stylelint-config-standard",
   "plugins": [
-    "stylelint-no-browser-hacks/lib",
     "stylelint-order"
   ],
   "rules": {
+    "alpha-value-notation": "number",
+    "at-rule-no-vendor-prefix": null,
+    "color-function-notation": "legacy",
     "comment-empty-line-before": null,
+    "custom-property-pattern": "^[a-z][-_a-z0-9IE]*$",
+    "declaration-block-no-redundant-longhand-properties": null,
     "function-linear-gradient-no-nonstandard-direction": null,
+    "function-url-quotes": null,
     "function-whitespace-after": null,
+    "hue-degree-notation": "number",
     "no-descending-specificity": null,
     "no-duplicate-selectors": null,
     "no-unknown-animations": true,
+    "max-line-length": null,
     "media-feature-name-no-unknown": [true, {
       "ignoreMediaFeatureNames": [
         "prefers-reduced-motion",
         "min--moz-device-pixel-ratio"
       ]
     }],
+    "media-feature-name-no-vendor-prefix": null,
     "number-leading-zero": "always",
+    "number-max-precision": 5,
     "order/order": [
       "custom-properties",
       "dollar-variables",
@@ -114,11 +123,19 @@
       "margin-right",
       "margin-bottom",
       "margin-left",
+      "margin-block-start",
+      "margin-block-end",
+      "margin-inline-start",
+      "margin-inline-end",
       "padding",
       "padding-top",
       "padding-right",
       "padding-bottom",
       "padding-left",
+      "padding-block-start",
+      "padding-block-end",
+      "padding-inline-start",
+      "padding-inline-end",
 
       "table-layout",
       "-webkit-columns",
@@ -325,6 +342,22 @@
       "border-left-width",
       "border-left-style",
       "border-left-color",
+      "border-block-start",
+      "border-block-start-width",
+      "border-block-start-style",
+      "border-block-start-color",
+      "border-inline-end",
+      "border-inline-end-width",
+      "border-inline-end-style",
+      "border-inline-end-color",
+      "border-block-end",
+      "border-block-end-width",
+      "border-block-end-style",
+      "border-block-end-color",
+      "border-inline-start",
+      "border-inline-start-width",
+      "border-inline-start-style",
+      "border-inline-start-color",
       "-webkit-border-radius",
       "-moz-border-radius",
       "border-radius",
@@ -421,27 +454,24 @@
       "font-smooth",
       "line-height"
     ],
-    "plugin/no-browser-hacks": [true, {
-      "browsers": [
-        "ie >= 9",
-        "edge >= 13",
-        "firefox >= 5",
-        "opera >= 12",
-        "safari >= 5",
-        "chrome >= 56"
-      ]
-    }],
     "property-no-unknown": null,
+    "property-no-vendor-prefix": null,
     "rule-empty-line-before": null,
+    "selector-attribute-quotes": null,
+    "selector-class-pattern": null,
+    "selector-id-pattern": "^[a-z][-_a-z0-9]*$",
+    "selector-no-vendor-prefix": null,
     "selector-pseudo-element-colon-notation": null,
     "shorthand-property-no-redundant-values": null,
     "string-quotes": "double",
-    "unit-allowed-list": ["deg", "em", "ex", "ms", "rem", "%", "s", "px", "vw", "vh"],
-    "font-family-no-missing-generic-family-keyword": [true, {
-      "ignoreFontFamilies": [
-        "Font Awesome 5 Brands",
-        "Font Awesome 5 Free"
+    "unit-allowed-list": ["ch", "deg", "em", "ex", "fr", "ms", "rem", "%", "s", "px", "vw", "vh"],
+    "value-keyword-case": ["lower", {
+      "camelCaseSvgKeywords": true,
+      "ignoreProperties": [
+        "--font-family",
+        "font-family"
       ]
-    }]
+    }],
+    "value-no-vendor-prefix": null
   }
 }
diff --git a/gulpfile.js b/gulpfile.js
index dc45aec5..dd45cc6e 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,5 +1,5 @@
 let gulp = require('gulp'),
-  sass = require("gulp-sass")(require('sass')),
+  sass = require('gulp-sass')(require('sass')),
   postcss = require('gulp-postcss'),
   csscomb = require('gulp-csscomb'),
   autoprefixer = require('autoprefixer'),
@@ -18,9 +18,11 @@ const paths = {
 function compile () {
   var sassOptions = {
     outputStyle: 'expanded',
+    indented: true,
     indentType: 'space',
     indentWidth: 2,
-    linefeed: 'lf'
+    linefeed: 'lf',
+    sourceMap: false
   };
 
   return gulp.src([paths.scss.src])
diff --git a/package.json b/package.json
index 5a510c6d..dcab0a82 100644
--- a/package.json
+++ b/package.json
@@ -66,6 +66,7 @@
     "gulp-scss-lint": "~1",
     "gulp-sourcemaps": "~3",
     "gulp-uglify": "~3",
+    "gulp-rtlcss": "~1",
     "merge-stream": "~2",
     "minimatch": "~5",
     "minimist": "~1",
diff --git a/yarn.lock b/yarn.lock
index e710a051..95e7e041 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -906,6 +906,13 @@
     "@babel/helper-validator-identifier" "^7.16.7"
     to-fast-properties "^2.0.0"
 
+"@choojs/findup@^0.2.1":
+  version "0.2.1"
+  resolved "https://registry.yarnpkg.com/@choojs/findup/-/findup-0.2.1.tgz#ac13c59ae7be6e1da64de0779a0a7f03d75615a3"
+  integrity sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==
+  dependencies:
+    commander "^2.15.1"
+
 "@csstools/convert-colors@^1.4.0":
   version "1.4.0"
   resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7"
@@ -1981,7 +1988,7 @@ chalk@^1.1.3:
     strip-ansi "^3.0.0"
     supports-color "^2.0.0"
 
-chalk@^2.0.0, chalk@^2.4.1, chalk@~2:
+chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2, chalk@~2:
   version "2.4.2"
   resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
   integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -2201,7 +2208,7 @@ commander@2.0.0:
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.0.0.tgz#d1b86f901f8b64bd941bdeadaf924530393be928"
   integrity sha1-0bhvkB+LZL2UG96tr5JFMDk76Sg=
 
-commander@^2.2.0, commander@^2.20.0:
+commander@^2.15.1, commander@^2.2.0, commander@^2.20.0:
   version "2.20.3"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
   integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
@@ -2696,9 +2703,9 @@ ee-first@1.1.1:
   integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
 
 electron-to-chromium@^1.4.84:
-  version "1.4.95"
-  resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.95.tgz#49303dbe037c15e2e0cc851d71c4cb86119a9cd6"
-  integrity sha512-h2VAMV/hPtmAeiDkwA8c5sjS+cWt6GlQL4ERdrOUWu7cRIG5IRk9uwR9f0utP+hPJ9ZZsADTq9HpbuT46eBYAg==
+  version "1.4.96"
+  resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.96.tgz#a97438a01d5db1460343fea4a344960b09330990"
+  integrity sha512-DPNjvNGPabv6FcyjzLAN4C0psN/GgD9rSGvMTuv81SeXG/EX3mCz0wiw9N1tUEnfQXYCJi3H8M0oFPRziZh7rw==
 
 emoji-regex@^8.0.0:
   version "8.0.0"
@@ -3825,6 +3832,16 @@ gulp-rename@~2:
   resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-2.0.0.tgz#9bbc3962b0c0f52fc67cd5eaff6c223ec5b9cf6c"
   integrity sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ==
 
+gulp-rtlcss@~1:
+  version "1.4.2"
+  resolved "https://registry.yarnpkg.com/gulp-rtlcss/-/gulp-rtlcss-1.4.2.tgz#f1c0b8ad579b1ca15e861126e9fd0d703b32ef0a"
+  integrity sha512-wd807z/xq4XKtSwgrEetbx/aPoI5gV0yWV2rNqEBRwe2cJvNKLDsYR9A968c3gZtaKRMGAue5g3pHn40R+GWSA==
+  dependencies:
+    plugin-error "^1.0.1"
+    rtlcss "^2.4.0"
+    through2 "^2.0.5"
+    vinyl-sourcemaps-apply "^0.2.1"
+
 gulp-sass@~5:
   version "5.1.0"
   resolved "https://registry.yarnpkg.com/gulp-sass/-/gulp-sass-5.1.0.tgz#bb3d9094f39a260f62a8d0a6797b95ab826f9663"
@@ -5080,7 +5097,7 @@ mixin-deep@^1.2.0:
     for-in "^1.0.2"
     is-extendable "^1.0.1"
 
-mkdirp@^0.5.0:
+mkdirp@^0.5.0, mkdirp@^0.5.1:
   version "0.5.6"
   resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
   integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==
@@ -6085,6 +6102,15 @@ postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1:
     indexes-of "^1.0.1"
     uniq "^1.0.1"
 
+postcss@^6.0.23:
+  version "6.0.23"
+  resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324"
+  integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==
+  dependencies:
+    chalk "^2.4.1"
+    source-map "^0.6.1"
+    supports-color "^5.4.0"
+
 postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.18, postcss@^7.0.2, postcss@^7.0.27, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6:
   version "7.0.39"
   resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309"
@@ -6539,6 +6565,17 @@ rimraf@^3.0.2:
   dependencies:
     glob "^7.1.3"
 
+rtlcss@^2.4.0:
+  version "2.6.2"
+  resolved "https://registry.yarnpkg.com/rtlcss/-/rtlcss-2.6.2.tgz#55b572b52c70015ba6e03d497e5c5cb8137104b4"
+  integrity sha512-06LFAr+GAPo+BvaynsXRfoYTJvSaWRyOhURCQ7aeI1MKph9meM222F+Zkt3bDamyHHJuGi3VPtiRkpyswmQbGA==
+  dependencies:
+    "@choojs/findup" "^0.2.1"
+    chalk "^2.4.2"
+    mkdirp "^0.5.1"
+    postcss "^6.0.23"
+    strip-json-comments "^2.0.0"
+
 run-parallel@^1.1.9:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
@@ -7148,6 +7185,11 @@ strip-indent@^3.0.0:
   dependencies:
     min-indent "^1.0.0"
 
+strip-json-comments@^2.0.0:
+  version "2.0.1"
+  resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+  integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
+
 strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
   version "3.1.1"
   resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
@@ -7237,7 +7279,7 @@ supports-color@^2.0.0:
   resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
   integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
 
-supports-color@^5.3.0:
+supports-color@^5.3.0, supports-color@^5.4.0:
   version "5.5.0"
   resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
   integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
@@ -7367,7 +7409,7 @@ through2@3.0.1:
   dependencies:
     readable-stream "2 || 3"
 
-through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0:
+through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@^2.0.5, through2@~2.0.0:
   version "2.0.5"
   resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
   integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==
-- 
GitLab