Update node libs to latest versions

Created on 30 November 2022, about 2 years ago
Updated 7 February 2023, almost 2 years ago

Problem/Motivation

Regular node libs update.

📌 Task
Status

Fixed

Version

1.0

Component

BS Base

Created by

🇷🇸Serbia pivica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇷🇸Serbia pivica

    On the end this became a much bigger update, among other things:
    - Node updated to 18 LTS,
    - gulp-sass update to 5.x version that switched how gulp-sass is required which breaks gulp-load-plugins loading of gulp-sass,
    - Update to Bootstrap 4.6.2.

    I've tried to update del package to 7.x version but they now support only native ESM module loading which is again not compatible with gulp-load-plugins. Decided not to update to 7.x and keep 6.x version for now - when we start working on 📌 Switch from Gulp build process to something else Active we can figure it out what to do with this.

    Patch is ready but it requires a bit more testing against real projects before committing.

  • 🇷🇸Serbia pivica

    Fixing some errors and also previous patch file got mixed a bit with changes from 📌 Drop support for IE11 Fixed .

  • 🇷🇸Serbia pivica

    While working on 📌 Decide what to do with css-mqpacker npm package is not maintained any more Closed: duplicate I've figured out that css-mqpacker is not depreciated, well it is depreciated on npm registry on https://www.npmjs.com/package/css-mqpacker, however from version 8.0.1 this project is using a github package registry as explained in it release https://github.com/hail2u/node-css-mqpacker/releases/tag/v8.0.1.

    I've was not aware of this change up until now, nor I was aware that Github has it own package repository.

    This means we can still use this css-mqpacker but we need to change package source. It makes then more sense to do this in this issue then in 📌 Decide what to do with css-mqpacker npm package is not maintained any more Closed: duplicate which we can close now.

    Here is a new patch which use new package repository for css-mqpacker.

  • 🇨🇭Switzerland berdir Switzerland
    1. +++ b/bs_base.bs_base.install
      @@ -195,3 +195,57 @@ function bs_base_bs_update_8009($target_theme_name) {
      +
      +    // Remove node_modules so, we are sure we install/rebuild everything clean.
      +    system('rm -rf ' . escapeshellarg($themes_info[$target_theme_name]->subpath . '/node_modules'));
      

      not sure if we could use \Drupal\Core\File\FileSystem::deleteRecursive() for this, rm -rf isn't going to work on windows but I guess we've done this before.

    2. +++ b/bs_base.drush.inc
      @@ -1434,6 +1436,22 @@ function _bs_base_get_sass_files($path) {
      +/**
      + * Helper to wrap regexp pattern.
      

      I don't like prefixing descriptions with Helper or helper function. Just write "Wraps a regex pattern".

    3. +++ b/bs_base.drush.inc
      @@ -1434,6 +1436,22 @@ function _bs_base_get_sass_files($path) {
      + * @param string $delimiter
      + *   PHP regular expression delimiter.
      + * @return string
      + */
      

      @return should have an empty line above and needs a description

    4. +++ b/bs_base.drush.inc
      @@ -1434,6 +1436,22 @@ function _bs_base_get_sass_files($path) {
      +function _bs_base_get_regexp($pattern, string $modifiers = 'm', string $delimiter = '%'): string
      +{
      

      { should be on the same line still

    5. +++ b/bs_base.drush.inc
      @@ -1481,13 +1500,35 @@ function _bs_base_regexp_file($file_name, array $regexps) {
      +/**
      +* Regular expression exist in the file.
      ...
      + * @param string $regexp
      +  *   Array of regexps searches with it replace values.
      

      param description is copied here, this doesn't replace, it's also not an array.

      For the description, what about "Checks if file content matches against a regular expression"?

  • 🇷🇸Serbia pivica

    > 1. not sure if we could use \Drupal\Core\File\FileSystem::deleteRecursive() for this, rm -rf isn't going to work on windows but I guess we've done this before.

    Tried but it didn't went well, it seems deleteRecursive() is confused with syml links (which are there because I use pnpm). It casted a bucnh of warnings like:

     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/node-sass): Not a directory FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/eslint): Not a directory FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/gulp-sass-inject): Not a directory FileSystem.php:268
    ...
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/homedir-polyfill@1.0.3/node_modules): Directory not empty FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/homedir-polyfill@1.0.3): Directory not empty FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/sass-graph@4.0.1/node_modules/glob): Not a directory FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/sass-graph@4.0.1/node_modules/scss-tokenizer): Not a directory FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/sass-graph@4.0.1/node_modules/yargs): Not a directory FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/sass-graph@4.0.1/node_modules/lodash): Not a directory FileSystem.php:268
     [warning] rmdir(profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/sass-graph@4.0.1/node_modules): Directory not empty FileSystem.php:268
    ...
    ...
     [notice] The file profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/node_modules/spdx-exceptions was not deleted because it does not exist.
     [notice] The file profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/node_modules/function-bind was not deleted because it does not exist.
     [notice] The file profiles/primer/themes/primer_demo_theme/node_modules/.pnpm/node_modules/pinkie-promise was not deleted because it does not exist.
    ...
    

    There were hundreds of this warnings and notices.

    And it didn't manage to fully delete node_modules, leaved there bunch of invalid sym links now - maybe it tried to follow the links and went to my home folder to remove node libs there instead of just removing symlinks?

    I have no idea is there some better service in Symfony for this... but for now I will keep system rm call - it is doing a better job.

    > 2. - 5.

    Done.

    • pivica committed d98c2135 on 8.x-1.x
      Issue #3324508 by pivica, Berdir: Update node libs to latest versions
      
  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024