mmisw / orr-portal

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

ISSUE-161 Upgrade gulp 3.9.1 --> 4.0.1 #162

Closed lewismc closed 4 years ago

lewismc commented 4 years ago

This PR attempts to address #161 I thought it would be best to do this in a different branch rather than bundling it into #160

Environment

lmcgibbn@MT-207576 ~/Downloads/orr-portal(ISSUE-161) $ node --version
v14.3.0
...
lmcgibbn@MT-207576 ~/Downloads/orr-portal(ISSUE-161) $ gulp --version
[16:28:24] CLI version 1.4.0
[16:28:24] Local version 4.0.2

I can now run

lmcgibbn@MT-207576 ~/Downloads/orr-portal(master) $ gulp --tasks
[16:19:53] Tasks for ~/Downloads/orr-portal/gulpfile.js
[16:19:53] ├── default
[16:19:53] ├── dev
[16:19:53] ├── clean
[16:19:53] ├─┬ app
[16:19:53] │ └─┬ <series>
[16:19:53] │   └── clean
[16:19:53] ├─┬ vendor
[16:19:53] │ └─┬ <series>
[16:19:53] │   └── clean
[16:19:53] ├─┬ dist-directory
[16:19:53] │ └─┬ <series>
[16:19:53] │   ├─┬ app
[16:19:53] │   │ └─┬ <series>
[16:19:53] │   │   └── clean
[16:19:53] │   └─┬ vendor
[16:19:53] │     └─┬ <series>
[16:19:53] │       └── clean
[16:19:53] ├─┬ package
[16:19:53] │ └─┬ <series>
[16:19:53] │   └─┬ dist-directory
[16:19:53] │     └─┬ <series>
[16:19:53] │       ├─┬ app
[16:19:53] │       │ └─┬ <series>
[16:19:53] │       │   └── clean
[16:19:53] │       └─┬ vendor
[16:19:53] │         └─┬ <series>
[16:19:53] │           └── clean
[16:19:53] ├─┬ install
[16:19:53] │ └─┬ <series>
[16:19:53] │   ├── check_dest
[16:19:53] │   └── dist
[16:19:53] ├── test
[16:19:53] ├── ci
[16:19:53] ├── app-index-and-config
[16:19:53] ├── vendor-other
[16:19:53] ├── app-min-js
[16:19:53] ├── app-min-css
[16:19:53] ├─┬ app-min
[16:19:53] │ └─┬ <series>
[16:19:53] │   ├── app-min-css
[16:19:53] │   ├── vendor-other
[16:19:53] │   └── app-min-js
[16:19:53] └─┬ min
[16:19:53]   └─┬ <series>
[16:19:53]     ├── app-index-and-config
[16:19:53]     └─┬ app-min
[16:19:53]       └─┬ <series>
[16:19:53]         ├── app-min-css
[16:19:53]         ├── vendor-other
[16:19:53]         └── app-min-js

... and

lmcgibbn@MT-207576 ~/Downloads/orr-portal(master) $ gulp dev
[16:20:00] Building version 3.9.3
[16:20:00] Using gulpfile ~/Downloads/orr-portal/gulpfile.js
[16:20:00] Starting 'dev'...
[16:20:00] Webserver started at http://localhost:8000
lewismc commented 4 years ago

Hi @carueda I am not sure that TravisCI or my local npm is actually invoking Karma as part of the test task. Can you please check on your end? Thanks

carueda commented 4 years ago

gult test has traditionally called karma to run the tests ... just fetched you branch and this seems to be the case

➜  orr-portal git:(f2046ba) ✗ gulp test
[16:57:52] Building version 3.9.3
[16:57:52] Using gulpfile ~/github/mmisw/orr-portal/gulpfile.js
[16:57:52] Starting 'test'...
WARN `start` method is deprecated since 0.13. It will be removed in 0.14. Please use
  server = new Server(config, [done])
  server.start()
instead.
28 05 2020 16:57:52.828:WARN [karma]: No captured browser, open http://localhost:9876/
28 05 2020 16:57:52.832:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
28 05 2020 16:57:52.832:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited
28 05 2020 16:57:52.849:INFO [launcher]: Starting browser PhantomJS
28 05 2020 16:57:56.716:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket pg_GN5x83ESp0w8fAAAA with id 28694343
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 16 of 16 SUCCESS (0.012 secs / 0 secs)
TOTAL: 16 SUCCESS

However it is hanging there ... had to kill the process. Can you look into fixing that?

lewismc commented 4 years ago

However it is hanging there ... had to kill the process. Can you look into fixing that?

Yes, i will do. It looks like we may need to change the travis.yml as well then :)

carueda commented 4 years ago

Also, gulp dev is running on port 8000, but it has traditionally be on 9001. Any particular reason for this change?

carueda commented 4 years ago

The key local verifications are that gulp test and gulp dev are working. The latter in particular has traditionally opened http://localhost:9001/src/app/indexdev.html automatically.

lewismc commented 4 years ago

OK @carueda I had to upgrade Karma and associated drivers and do some magic to ensure the process exits from Karma and returns the correct status message. Please take a look. TravisCI seems to like it :) I should note, I've not deployed this as part of the stack yet. It would be nice if we could launch those commands on demand ;)

carueda commented 4 years ago

@lewismc I just fixed the gulp dev issue so it now opens the usual page with the following:

gulp.task('dev', webserver);

gulp.task('webserver', function() {
  gulp.src('.')
      .pipe(webserver({
        port: localPort,
        open: localUrl,
        livereload: true
      }));
});

Please do that change if you like it. Here's a diff view wrt your version

image

carueda commented 4 years ago

Sorry, I thought I had entered gulp dev but actually I had entered gulp webserver (and I thought the the 1st would trigger the 2nd...)

Here's the corrected diff so gulp dev directly triggers the webserver:

image

lewismc commented 4 years ago

Excellent @carueda I updated to your implementation (which is cleaner anyway). Please merge when you can and I will go ahead and update #160