Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #86

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Conversation

agibson-godaddy
Copy link
Contributor

@agibson-godaddy agibson-godaddy commented Feb 4, 2025

This updates many dependencies. I also committed the lock file. If we commit that then we can use dependabot in the future.

It turns out I wasn't able to update as many dependencies as I'd like. (See "ESM Packages" note below for reasons why. gulp-imagemin in particular has a ton of vulnerabilities but we can't upgrade any further.)

Notes

ESM Packages

I didn't update the following packages (or not all the way to latest) because they're now ESM packages, which would require doing significant overhauls to our whole code base. (which we should do at some point, but not part of this PR!)

See https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

  • chalk
  • dateformat
  • strip-ansi
  • gulp-imagemin
  • inquirer

I have created a follow-up JIRA story to update our code base to ESM https://godaddy-corp.atlassian.net/browse/MWC-17961

gulp-clean

I removed gulp-clean in favour of del because the former has been deprecated: https://www.npmjs.com/package/gulp-clean

Empty Directories

After updating (maybe gulp?) I started getting errors when entire directories don't exist. For example:

I'd run: sake imagemin

And get this error:

[15:42:14] Using gulpfile ~/Projects/sake/gulpfile.js
[15:42:14] Starting 'imagemin'...
[15:42:14] 'imagemin' errored after 22 ms
[15:42:14] Error: ENOENT: no such file or directory, scandir 'wp-content/plugins/woocommerce-pdf-product-vouchers/assets/img'

And in fact that directory doesn't exist, because the correct one for the plugin I was testing (PDF vouchers) is /assets/images/ but the plugin fails to customize that in the Sake config.

tl;dr: for some reason in older versions I wouldn't get an error if the entire directory doesn't exist, but in newer versions I do. So I hardened some checks around checking if a directory exists before using it. (Reference: gulpjs/glob-stream#134 (comment))

Vulnerabilities stemming from gulp-saas-lint

I created a follow-up story to address vulnerabilities as a result of gulp-saas-lint. See https://godaddy-corp.atlassian.net/browse/MWC-17960

This will require replacing an entire package.

QA

@agibson-godaddy agibson-godaddy self-assigned this Feb 4, 2025
@agibson-godaddy agibson-godaddy marked this pull request as ready for review February 11, 2025 16:25
@agibson-godaddy agibson-godaddy changed the title [WIP] Update dependencies Update dependencies Feb 11, 2025
@agibson-godaddy agibson-godaddy marked this pull request as draft February 13, 2025 16:11
@agibson-godaddy
Copy link
Contributor Author

⚠️ Reverting this to draft. I realized that sake build for some reason includes its own build directory recursively!

So this exists:

build/woocommerce-pdf-product-vouchers/build/woocommerce-pdf-product-vouchers/build/

@agibson-godaddy
Copy link
Contributor Author

This might fix it but need more testing c5edd07

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.

1 participant