Skip to content

Update to Gulp 5#49

Closed
gregpriday wants to merge 7 commits intomasterfrom
feature/gulp-update
Closed

Update to Gulp 5#49
gregpriday wants to merge 7 commits intomasterfrom
feature/gulp-update

Conversation

@gregpriday
Copy link
Member

This updates us to Gulp 5. I haven't fully checked the ZIP file it creates, but everything seems good at first glance.

The command is slightly different.

npm run build:release --release=1.2.3

You can see the scripts for all other available scripts

"scripts": {
    "preinstall": "npx npm-force-resolutions",
    "build:release": "gulp buildRelease --release=$npm_config_release",
    "build:dev": "gulp buildDev",
    "clean": "gulp clean",
    "version": "gulp version",
    "css": "gulp css",
    "js": "gulp js",
    "minify": "gulp minify",
    "copy": "gulp copy",
    "i18n": "gulp i18n",
    "move": "gulp move",
    "updateGoogleFonts": "gulp updateGoogleFonts --apiKey=$npm_config_apiKey",
    "updateFontAwesome": "gulp updateFontAwesome"
  },

This still needs quite a bit of checking, so we can consider it a WIP.

Just an initial rewrite, still needs to be checked.
@Misplon Misplon requested a review from AlexGStapleton July 15, 2024 12:18
@AlexGStapleton
Copy link
Member

Thank you for hitting this.

I've run a few tests using this with WB. A few questions/notes.

  • What version of Node do you suggest using for this? I'm testing using 22.4.1.
  • Google Fonts updated without issue.
  • updateFontAwesome failed for me:
Starting 'updateFontAwesome'...
(node:17596) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Downloading Font Awesome...
An error occurred while updating Font Awesome: TypeError [ERR_INVALID_ARG_TYPE]: The "cb" argument must be of type function. Received undefined
    at Object.writeFile (node:fs:2275:3)
    at updateFontAwesome (file:///C:/Users/alex/fork/so-widgets-bundle/build/gulpfile.js:313:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}
Finished 'updateFontAwesome' after 3
  • Due to the usage of $, two scripts won't run out of the box for Windows. Can something like cross vars (I'm actually not sure if that specific package is recommended anymore) or dedicated Windows scripts added for the two scripts that aren't compatible with Windows? For reference, here are the Windows compatible versions:
    "build:release": "gulp buildRelease --release=%npm_config_release%",
    "updateGoogleFonts": "gulp updateGoogleFonts --apiKey=%npm_config_apiKey%",
  • When doing a release, A few deprecated warnings were noted:
Starting 'buildRelease'...
(node:5108) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
...
Starting JS minification..
(node:5108) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
JS minification completed.

I noticed a few issues with the build:

  • There was a tmp directory present.
  • For WB, it appears .less files aren't being processed. The stylesheets of these files and this one weren't present.

After making a build, the generated .pot and tmp directory weren't removed.

@gregpriday
Copy link
Member Author

Thanks Alex! I'll get on all the fixes in the morning. It's possible we can resolve the punycode issue by locking it to an older version. I'll give that a shot.

@gregpriday
Copy link
Member Author

I'm going to put this aside for now, but I'll leave this open in case we ever need to finish off a transition to Gulp 5 for some reason. Something in the steps from copying to the tmp directory and then the dist directory is just not working the same as before, and I can't figure it out.

@Misplon
Copy link
Member

Misplon commented Sep 6, 2025

Closed in favor of #52.

@Misplon Misplon closed this Sep 6, 2025
@Misplon Misplon deleted the feature/gulp-update branch September 10, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants