Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Dependency updates #573

Merged
merged 7 commits into from
Apr 19, 2019
Merged

Dependency updates #573

merged 7 commits into from
Apr 19, 2019

Conversation

olets
Copy link
Contributor

@olets olets commented Mar 11, 2019

Introduces breaking changes: in task-config.js's javascripts.babel.presets, es2015 must be replaced with env. e.g.

    babel: {
      presets: ['es2015', 'stage-1']
    }

would become

    babel: {
      presets: ['env', 'stage-1']
    }

What this PR does

  • Resolves warnings on the command line during installation, run, and in npm audit
    • includes all significant security warnings
    • doesn't include Gulp 3-related warnings
  • Updates Gulp task dependencies as identified by yarn upgrade --latest
  • Drops two deprecated Gulp plugins in favor of their replacements

What this PR doesn't do

  • Updates that are more involved to test manually, which should be their own PR
  • Updates that require significant codebase changes
    • the move to Gulp 4
    • the move from gulp-autoprefixer to Autoprefixer
    • the move from gulp-cssnano to cssnano

Steps to test:

1. Dummy project

# Set up a new Blendid project
mkdir <a new directory>
cd <that directory>
yarn init

# Add this PR's version of Blendid
yarn add ssh://git@github.com:vigetlabs/blendid.git#dependency-updates
yarn

# Verify that the basic functionality works
yarn run blendid init
yarn run blendid
# check live site in browser: html and js changes should trigger reload, stylesheet changes should hot update

# Verify that revving works
yarn run blendid build
# check static file in browser
yarn run blendid build
# verify that all references updated

2. Existing projects

To use this update in an existing project, run

yarn add ssh://git@github.com:vigetlabs/blendid.git#dependency-updates

and then in task-config.js change es2015 to env as explained at the top of this post.

  1. Try on an exisiting project that uses data
  2. Try on an exisiting Craft project

To revert your project to the latest version of Blendid run

yarn add blendid

To restore an older version of Blendid, run yarn add blendid@<version> or yarn add blendid@"<semver>". Or just discard the changes, delete the node_modules folder, and run yarn.

Changes

Where significant work was done that isn't clearly reflected in the diff, command history is included in the commit message.

Security-motivated updates

  • browser-sync
  • babel-core
  • gulp-nunjucks-render
  • lodash
  • debug

Warning resolution-motivated updates

  • babel-present-env replaces babel-preset-es2015
  • gulp's watch replaces gulp-watch
  • dev:test script uses mocha 6 in place of mocha 3

General upkeep-motivated updates

  • ansi-colors
  • del
  • es6-promise
  • fancy-log
  • gulp-autoprefixer
  • gulp-changed
  • gulp-cssnano
  • gulp-data
  • gulp-htmlmin
  • gulp-notify
  • gulp-rename
  • gulp-replace
  • gulp-rev
  • gulp-rev-replace
  • gulp-sass
  • gulp-sequence
  • gulp-sizereport
  • gulp-sourcemaps
  • gulp-svgstore
  • node-sass-glob-importer
  • plugin-error
  • require-dir

Modernization-motivated updates:

  • gulp-rev-rewrite replaces gulp-rev-replace
  • gulp-rev-delete-original replaces gulp-rev-napkin

Updates

- browser-sync
- babel-core
- gulp-nunjucks-render
- lodash
- debug

and regenerates the Yarn lockfile.

Drops 490 vulnerabilities (266 low, 207 moderate, 15 high, 2 critical)
to 15 vulnerabilities (7 low, 2 moderate, 4 high, 2 critical).

Actions run:

npm install --package-lock-only
npm audit
npm install browser-sync@2.26.3
npm install babel-core@6.26.3
npm install gulp-nunjucks-render@2.2.2
npm install lodash@4.17.11
npm update lodash --depth 10
npm update debug --depth 9
rm yarn.lock
yarn import

Sticking with yarn.lock rather than switch wholesale to package-lock.json
to avoid the "verbose stack TypeError: Cannot read property 'match' of undefined"
npm-shrinkwrap error.
Actions run:

npm install babel-preset-env
npm uninstall babel-preset-es2015
rm yarn.lock
yarn import
Actions run:

npm uninstall gulp-watch
Upgrades:

- ansi-colors
- del
- es6-promise
- fancy-log
- gulp-autoprefixer
- gulp-changed
- gulp-cssnano
- gulp-data
- gulp-htmlmin
- gulp-notify
- gulp-rename
- gulp-replace
- gulp-rev
- gulp-rev-replace
- gulp-sass
- gulp-sequence
- gulp-sizereport
- gulp-sourcemaps
- gulp-svgstore
- node-sass-glob-importer
- plugin-error
- require-dir

Actions run:

> yarn upgrade --latest
> yarn add babel-loader@"^7.1.1"
> yarn add gulp@3.9.1
> yarn add webpack@"^3.4.1"
> yarn add webpack-dev-middleware@"^1.12.0"
> yarn add webpack-hot-middleware@"^2.18.2"
> yarn add chai@"^3.5.0" -D
@olets olets requested a review from benjtinsley March 11, 2019 22:59
@olets olets changed the base branch from master to develop March 11, 2019 23:16
Copy link

@leobauza leobauza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am the wrong person to properly review this but I did have a questions there

"babel-loader": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.7.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are all the babel plugins purposely not updated to their latest versions? ie. 7.x.x I could be wrong about this but I think all the latest stuff is in the namespaced packages like @babel/core and @babel/preset-env

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if npm audit and yarn upgrade --latest didn't pick those up because of the namespace change. Thanks for calling it out

Primary aim of this PR is to clear out security warnings, secondary goal is to clear out other warnings. The first in several steps towards truly bringing things up to date. Will add Babel updates to the list of next steps

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the PR description to be more clear about this

Copy link
Contributor

@benjtinsley benjtinsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet

Copy link

@ten1seven ten1seven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@olets olets merged commit 4bfa3f5 into develop Apr 19, 2019
@olets olets deleted the dependency-updates branch May 28, 2019 18:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants