Problem/Motivation

We are getting next warnings on clean yarn install:

warning autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.             
warning eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.       
warning gulp > vinyl-fs > graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
warning gulp > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning gulp > vinyl-fs > glob-stream > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue           
warning gulp > vinyl-fs > glob-stream > glob > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue    
warning gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
warning gulp-rucksack@0.1.4: use gulp-postcss instead                                                                                      
warning gulp-rucksack > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning gulp-rucksack > rucksack-css > laggard > pixrem > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning gulp-sass > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning gulp-sass-inject > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning gulp-strip-css-comments > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

We should update all libraries to latest versions where possible.

Comments

pivica created an issue. See original summary.

pivica’s picture

Issue tags: +next-release-planned
ytsurk’s picture

Status: Active » Needs review
StatusFileSize
new4.38 KB

All dependencies updated. (gulp was also updated to 4.0.0, chaining tasks is now done by gulp.series)
One warning could not be removed, see https://github.com/sasstools/sass-lint/issues/1070

We need to push a new version for gulp-sass-inject too (https://github.com/pivica/gulp-sass-inject/issues/1)

pivica’s picture

Status: Needs review » Needs work

> We need to push a new version for gulp-sass-inject too (https://github.com/pivica/gulp-sass-inject/issues/1)

Done.

I think we should also update yarn.lock files because it make sense we tell the child themes about exact dependencies we are using. But i figure it out just now that generator is not coping yarn.lock from a parent theme.

Not sure how yarn.lock will work with update hooks - i guess we need to update versions there also, lets first fix generator and then figure this.

pivica’s picture

> lets first fix generator and then figure this.

Fixed with https://www.drupal.org/commitlog/commit/90986/dbc0df6622df54dbc4b429695d....

sasanikolic’s picture

Status: Needs work » Needs review
StatusFileSize
new47.1 KB
new3.85 KB
new5.97 KB

The patch #3 already works. However, I updated all other packages to their latest versions.

There were some stylelint related warnings, which this patch with the updates fixes.

There are also updates for bootstrap: https://github.com/twbs/bootstrap/releases, do we want to also update that at some point (in bs_bootstrap) as they contain security updates?

ytsurk’s picture

Status: Needs review » Needs work

Bootstrap update is in another issue: #3024835: Update gulp tooklit

It's good you updated "everything" else, I just took the ones with warnings.
Also the one warning i mentioned (@ivica) goes away like this, seems like I missed one ...
And we can use yarn install, and do not need yarn upgrade.

If we go this way (using install always) - the update hook doesn't need to call yarn upgrade.
Maybe we should let the user choose if he wants yarn install or yarn upgrade run by the bs-tu command ?

Please note that the update script (which can be run with drush bs-tu bs_bootstrap or equivalent, see the docs here: https://www.drupal.org/docs/8/themes/bs-base/theme-update-hooks) needs to update the versions of the packages in the child theme too !

ytsurk’s picture

Status: Needs work » Needs review
StatusFileSize
new2.28 KB
new7.41 KB

Here a new patch with the updated update-hook.

Do you think we can live with this warning/flaw for now ? (just popped up ..)
warning css-mqpacker@7.0.0: Package no longer supported. Contact support@npmjs.com for more info.
https://www.npmjs.com/package/css-mqpacker

We should fix that dependency in another issue and/or remove it right away.

ytsurk’s picture

StatusFileSize
new326.9 KB

Also here the compiled CSS, seems like it was missing other compilations, as there the following things in:

  • *:last-child margin-bottom: 0 is removed
  • fieldset.webform-composite-hidden-title margin-bottom:0 added
  • custom-control-input:only-child
  • dialog-off-canvas-main-canvas

And box-flex is removed.

pivica’s picture

> Also here the compiled CSS, seems like it was missing other compilations, as there the following things in:

Yeah, let's avoid this because we compile CSS only on point releases to avoid big patches and constant changing in base theme CSS which anyway we don't use in child themes.

Reviewing other stuff in patch #8 - i hope it has all changes and #9 is just compilation.

pivica’s picture

Status: Needs review » Needs work
+++ b/themes/bs_bootstrap/bs_bootstrap.bs_base.install
@@ -0,0 +1,48 @@
+      '"stylelint-scss": "\^2.2.0"' => '"stylelint-scss": "^3.5.2"',

The package.json have here now

"stylelint-scss": "^3.5.4"

and here we are stating ^3.5.2, any special reason or maybe c&p error?

ytsurk’s picture

StatusFileSize
new591.86 KB

You're right, this was a typo in the update script.

I like to see the changed CSS, for review, but yes -it does not need to be commited. So removed too.

ytsurk’s picture

ytsurk’s picture

Status: Needs work » Reviewed & tested by the community
pivica’s picture

> I like to see the changed CSS, for review, but yes -it does not need to be commited. So removed too.

I am testing this locally against Primer so yeah for sure we will test it :)

Getting next error while doing drush bs-tu

Rebuilding CSS files                                                                                                             [ok]
/usr/lib/node_modules/gulp/bin/gulp.js:129
    gulpInst.start.apply(gulpInst, toRun);
                   ^

TypeError: Cannot read property 'apply' of undefined
    at /usr/lib/node_modules/gulp/bin/gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickCallback (internal/process/next_tick.js:181:9)
    at Function.Module.runMain (module.js:696:11)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

Investigating still.

pivica’s picture

Hmmm

3024835-update_gulp_toolkit-9.patch 326.9 KB
3024835-update_gulp_toolkit-12.patch 591.86 KB

that is like a lot of size diff?

ytsurk’s picture

I compiled it with node10 instead of node8 - so that's the yarn.lock (filesize) difference.

Have you tried npm i -g gulp-cli to fix your issue, https://github.com/gulpjs/gulp-cli/issues/84 ?

pivica’s picture

Status: Reviewed & tested by the community » Needs work

I figure my global version of gulp was 3.x and just running

gulp sass

Was actually triggering global gulp and not local project gulp. Figure that if you run

yarn gulp sass

This will actually run a local version of gulp and i will not have gulpInst.start.apply(gulpInst, toRun); error any more.

However, then i've got next error

➜  primer_demo_theme git:(master) ✗ gulp -v
[08:03:59] CLI version 2.0.1
[08:03:59] Local version 4.0.0
➜  primer_demo_theme git:(master) ✗ gulp sass
[08:06:55] Using gulpfile ~/web/profiles/primer/themes/primer_demo_theme/gulpfile.js
[08:06:55] Starting 'sass'...
[08:06:55] 'sass' errored after 157 ms
[08:06:55] TypeError: plugins.stripCssComments is not a function
    at ~/web/themes/contrib/bs_base/gulp-tasks.js:67:21
    at taskWrapper (~/web/profiles/primer/themes/primer_demo_theme/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (domain.js:395:14)
    at runBound (domain.js:408:12)
    at asyncRunner (~/web/profiles/primer/themes/primer_demo_theme/node_modules/async-done/index.js:55:18)
    at process._tickCallback (internal/process/next_tick.js:61:11)

Tried updating node 8.5.x, updated now to 10.15.3.

> Have you tried npm i -g gulp-cli to fix your issue, https://github.com/gulpjs/gulp-cli/issues/84 ?

Did this also.

Error for stripCssComments is still happening. Maybe this is related to our custom gulp code, but @ytsurk i am confused now how you can compile stuff without error and i can't? Maybe something else is different in our environment.

Finally, i did yarn list to provide here used packages and then i noticed that i have strip-css-comments package instead of gulp-strip-css-comments, so in updated theme, i am missing gulp wrapper so the error makes total sense then:

+++ b/themes/bs_bootstrap/bs_bootstrap.bs_base.install
@@ -0,0 +1,48 @@
+      '"gulp-strip-css-comments": "\^1.2.0"' => '"strip-css-comments": "^2.0.0"',

The package name is wrong, we should use gulp-strip-css-comments in updated version also.

Locally build work now, will check now rebuilt CSS to check that everything is fine in custom themes.

@ytsurk, @sasanikolic what do you think we update doc and scripts with yarn gulp sass instead of current gulp sass?

ytsurk’s picture

Status: Needs work » Needs review
StatusFileSize
new591.86 KB

I think we really should document the environment .. right now it is compatible with node.js 8+.
It makes total sense to me using yarn to run gulp et al. But this should be covered in another issue too.

Sorry for this mad typo. Here the updated patch.

Again installed with node.js 8, but filesize remains. Also installed with node.js 10, and file size remains. So my guess now is that I did not run yarn install explicit in the patches before 12.

ytsurk’s picture

Tested now with a customer project too - and looks/same good visually :D

Suddenly I got this warning (needs debugging ..) when running yarn install width node.js 10:

(node:27522) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Could be done in another issue too ... ?

pivica’s picture

> It makes total sense to me using yarn to run gulp et al. But this should be covered in another issue too.

Agree, here is a follow-up issue #3041726: Use yarn to run gulp and document environment better.

> Suddenly I got this warning (needs debugging ..) when running yarn install width node.js 10:

Seems to me it's just a warning from node related to some library we are using. We could identify a library and update when this is fixed... Yeah, could be a follow-up i guess.

sasanikolic’s picture

One warning popped up when doing drush bs-tu ... : warning css-mqpacker@7.0.0: Package no longer supported. Contact support@npmjs.com for more info.

https://www.npmjs.com/package/css-mqpacker

Tested on the site and couldn't find any bugs.

ytsurk’s picture

Status: Needs review » Reviewed & tested by the community

Thx for review @sasanikolic. With which node.js version you tested ?

This package (css-mqpacker) is no longer supported. We should replace or remove it in another issue.

sasanikolic’s picture

I think it was with the latest 11 one (11.6.0).

  • pivica committed e3054d1 on 8.x-1.x authored by ytsurk
    Issue #3024835 by ytsurk, sasanikolic, pivica: Update gulp tooklit
    
pivica’s picture

Status: Reviewed & tested by the community » Fixed

I've tested the latest patch version, tested changes in custom themes, all looks good now. Great stuff guys, thx :)

Committed.

pivica’s picture

Added node, yarn and gulp-cli information into https://www.drupal.org/docs/8/themes/bs-base/installation.

> This package (css-mqpacker) is no longer supported. We should replace or remove it in another issue.

Follow-up issue created #3042171: Decide what to do with css-mqpacker npm package is not maintained any more

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.