mmisw / orr-portal

ORR Frontend component
Apache License 2.0
8 stars 5 forks source link

ISSUE-138 Address lodash.template deprecation warnings #160

Closed lewismc closed 4 years ago

lewismc commented 4 years ago

Hi @carueda this PR attempts to address #138. You are correct in stating that lodash.template is a transitive dependency of several packages

lmcgibbn@MT-207576 ~/Downloads/orr-portal(master) $ npm ls gulp-util
orrportal@3.9.3 /Users/lmcgibbn/Downloads/orr-portal
├─┬ gulp@3.9.1
│ └── gulp-util@3.0.8
├─┬ gulp-csso@3.0.0
│ └── gulp-util@3.0.8
├─┬ gulp-uglify@1.5.4
│ └── gulp-util@3.0.8
├── gulp-util@2.2.20
├─┬ gulp-webserver@0.9.0
│ └── gulp-util@2.2.20  deduped
└─┬ gulp-zip@2.0.3
  └── gulp-util@3.0.4

I therefore follow the guidance for upgrading gulp-util which resulted in me removing it as a direct dependency and import within gulpfile.js and replacing gutil.log and gutil.envwithfancy-logandminimistrespectively. Additionally, I upgfraded a few other packages inpackage.jsonhowever I have not checked whether the API's needed upgraded. There may be deprecation or something else which we need to address. Additionally, I am not sure about theminimist` logic I've used to process command line arguments passed to Gulp. This needs sanity checked.

With this PR, the following gulp-util violations can now be observed

lmcgibbn@MT-207576 ~/Downloads/orr-portal(ISSUE-138) $ npm ls gulp-util
orrportal@3.9.3 /Users/lmcgibbn/Downloads/orr-portal
└─┬ gulp-webserver@0.9.1
  └── gulp-util@2.2.20

There is actually an open pull request for addressing this in gulp-webserver but the project is no longer maintained. I suggest that we try to find a replacement for this module. Maybe via another issue?

Thanks in advance for any review.

lewismc commented 4 years ago

I'm not sure what the TravisCI build log indicates... the last build was successful though. Any thoughts? Thanks @carueda

carueda commented 4 years ago

@lewismc First off, thanks much for trying to fix this!

Are you able to run gulp dev?

I just fetched/checked out your branch, ran npm i but I'm getting the error output enclosed below.

For a good while I have had to use nvm to set the version prior to doing any orr-portal stuff (in particular regarding gulp -- which btw turned out to be a PITA with newer versions breaking compatibility).

What node version are you using?

➜  orr-portal git:(5eee7da) ✗ nvm use lts/dubnium
Now using node v10.16.2 (npm v6.9.0)
➜  orr-portal git:(5eee7da) ✗ gulp dev
[09:00:32] Building version 3.9.3
assert.js:339
    throw err;
    ^

AssertionError [ERR_ASSERTION]: Task function must be specified
    at Gulp.set [as _setTask] (/Users/carueda/github/mmisw/orr-portal/node_modules/undertaker/lib/set-task.js:10:3)
    at Gulp.task (/Users/carueda/github/mmisw/orr-portal/node_modules/undertaker/lib/task.js:13:8)
    at Object.<anonymous> (/Users/carueda/github/mmisw/orr-portal/gulpfile.js:53:6)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at execute (/Users/carueda/.nvm/versions/node/v10.16.2/lib/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js:36:18)
    at Liftoff.handleArguments (/Users/carueda/.nvm/versions/node/v10.16.2/lib/node_modules/gulp-cli/index.js:201:24)
    at Liftoff.execute (/Users/carueda/.nvm/versions/node/v10.16.2/lib/node_modules/gulp-cli/node_modules/liftoff/index.js:201:12)
    at module.exports (/Users/carueda/.nvm/versions/node/v10.16.2/lib/node_modules/gulp-cli/node_modules/flagged-respawn/index.js:51:3)
    at Liftoff.<anonymous> (/Users/carueda/.nvm/versions/node/v10.16.2/lib/node_modules/gulp-cli/node_modules/liftoff/index.js:191:5)
    at /Users/carueda/.nvm/versions/node/v10.16.2/lib/node_modules/gulp-cli/node_modules/liftoff/index.js:149:9
carueda commented 4 years ago

Just retried with node 12:

➜  orr-portal git:(5eee7da) ✗ nvm use 12
Now using node v12.17.0 (npm v6.14.4)
➜  orr-portal git:(5eee7da) ✗ gulp dev
[14:50:56] Building version 3.9.3
assert.js:385
    throw err;
    ^

AssertionError [ERR_ASSERTION]: Task function must be specified
    at Gulp.set [as _setTask] (/Users/carueda/github/mmisw/orr-portal/node_modules/undertaker/lib/set-task.js:10:3)
    at Gulp.task (/Users/carueda/github/mmisw/orr-portal/node_modules/undertaker/lib/task.js:13:8)
    at Object.<anonymous> (/Users/carueda/github/mmisw/orr-portal/gulpfile.js:53:6)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at execute (/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js:36:18)
    at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/node_modules/gulp-cli/index.js:201:24)
    at Liftoff.execute (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:201:12)
    at module.exports (/usr/local/lib/node_modules/gulp/node_modules/flagged-respawn/index.js:51:3)
    at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:191:5)
    at /usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:149:9
    at /usr/local/lib/node_modules/gulp/node_modules/v8flags/index.js:138:14 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}
lewismc commented 4 years ago

@carueda I looked at the merge conflicts above... they are pretty substantial. Any luck on your side? Would be good to get this issue finished off and tested.

carueda commented 4 years ago

let's create a new one (or let any of the monitoring services do that) or reopen this one if needed (hopefully not)