Skip to content

Commit 6160a7c

Browse files
committed
Updating gulp and related packages to 4
1 parent 54887bf commit 6160a7c

File tree

10 files changed

+83
-84
lines changed

10 files changed

+83
-84
lines changed

.github/workflows/npm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [10.x]
16+
node-version: [12.x]
1717

1818
steps:
1919
- uses: actions/checkout@v2

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10
1+
12

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:10-buster-slim as builder
1+
FROM node:12-buster-slim as builder
22
LABEL author="Devin Matte <[email protected]>"
33

44
WORKDIR /usr/src/schedule

assets/src/modules/sm/Generate/controllers/GenerateController.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ angular.module('sm').controller('GenerateController', function ($scope, globalKb
161161
.success(function (data, status, headers, config) {
162162
ga('send', 'event', 'generate', 'schedule')
163163
window.DD_RUM &&
164-
window.DD_RUM.addUserAction('Generate', {
164+
window.DD_RUM.addAction('Generate', {
165165
type: 'Schedule',
166166
data: data
167167
})

assets/src/modules/sm/Schedule/directives/scheduleActionsDirective.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
5252
if (saveType === 'create') {
5353
ga('send', 'event', 'schedule', 'save')
5454
window.DD_RUM &&
55-
window.DD_RUM.addUserAction('Schedule', {
55+
window.DD_RUM.addAction('Schedule', {
5656
type: 'Save'
5757
})
5858
getSavedInfo().then(function (data) {
@@ -67,7 +67,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
6767
} else {
6868
ga('send', 'event', 'schedule', 'fork')
6969
window.DD_RUM &&
70-
window.DD_RUM.addUserAction('Schedule', {
70+
window.DD_RUM.addAction('Schedule', {
7171
type: 'Fork'
7272
})
7373

@@ -79,7 +79,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
7979
shareToService: function ($event, serviceName, newWindow) {
8080
ga('send', 'event', 'schedule', 'share', serviceName)
8181
window.DD_RUM &&
82-
window.DD_RUM.addUserAction('Schedule', {
82+
window.DD_RUM.addAction('Schedule', {
8383
type: 'Share',
8484
serviceName: serviceName
8585
})
@@ -101,7 +101,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
101101
shareToEmail: function ($event) {
102102
ga('send', 'event', 'schedule', 'share', 'email')
103103
window.DD_RUM &&
104-
window.DD_RUM.addUserAction('Schedule', {
104+
window.DD_RUM.addAction('Schedule', {
105105
type: 'Share',
106106
subtype: 'Email'
107107
})
@@ -119,7 +119,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
119119
shareToDirectLink: function ($event) {
120120
ga('send', 'event', 'schedule', 'share', 'link')
121121
window.DD_RUM &&
122-
window.DD_RUM.addUserAction('Schedule', {
122+
window.DD_RUM.addAction('Schedule', {
123123
type: 'Share',
124124
subtype: 'Link'
125125
})
@@ -131,7 +131,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
131131
downloadiCal: function ($event) {
132132
ga('send', 'event', 'schedule', 'download', 'iCal')
133133
window.DD_RUM &&
134-
window.DD_RUM.addUserAction('Schedule', {
134+
window.DD_RUM.addAction('Schedule', {
135135
type: 'Download',
136136
subtype: 'iCal'
137137
})
@@ -145,7 +145,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
145145
downloadImage: function ($event) {
146146
ga('send', 'event', 'schedule', 'download', 'image')
147147
window.DD_RUM &&
148-
window.DD_RUM.addUserAction('Schedule', {
148+
window.DD_RUM.addAction('Schedule', {
149149
type: 'Download',
150150
subtype: 'Image'
151151
})
@@ -162,7 +162,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
162162
print: function () {
163163
ga('send', 'event', 'schedule', 'print')
164164
window.DD_RUM &&
165-
window.DD_RUM.addUserAction('Schedule', {
165+
window.DD_RUM.addAction('Schedule', {
166166
type: 'Print'
167167
})
168168

@@ -180,7 +180,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
180180
hide: function () {
181181
ga('send', 'event', 'schedule', 'hide')
182182
window.DD_RUM &&
183-
window.DD_RUM.addUserAction('Schedule', {
183+
window.DD_RUM.addAction('Schedule', {
184184
type: 'Hide'
185185
})
186186
const appstate = scope.$parent.$parent.state

assets/src/modules/sm/Search/controllers/SearchController.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ angular.module('sm').controller('SearchController', function ($scope, $http, ent
140140

141141
ga('send', 'event', 'search', 'find')
142142
window.DD_RUM &&
143-
window.DD_RUM.addUserAction('Search', {
143+
window.DD_RUM.addAction('Search', {
144144
type: 'Find',
145145
data: data
146146
})

assets/src/modules/sm/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ angular.module('sm', ['ngAnimate', 'ngSanitize', 'ui.router'])
8080
$rootScope.$on('$stateChangeSuccess', function (evt) {
8181
ga('send', 'pageview')
8282
window.DD_RUM &&
83-
window.DD_RUM.addUserAction('Pageview', {
83+
window.DD_RUM.addAction('Pageview', {
8484
type: 'On Load'
8585
})
8686
$($window).scrollTop(0)

gulpfile.js

+51-52
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1+
/* eslint-disable standard/no-callback-literal */
2+
13
// Get the version info
2-
var pkg = require('./package.json')
4+
const pkg = require('./package.json')
35
if (!pkg.version) {
46
console.error('No version information in package.json.')
57
proccess.exit()
68
}
79

8-
var assetsRoot = {
10+
const assetsRoot = {
911
src: 'assets/src/',
1012
dist: 'assets/dist/',
1113
dest: 'assets/prod/'
1214
}
1315

1416
// Set up core routes
15-
var modulesRoot = {
17+
const modulesRoot = {
1618
src: assetsRoot.src + 'modules/',
1719
dist: assetsRoot.dist + 'modules/',
1820
dest: assetsRoot.dest + pkg.version + '/modules/'
1921
}
2022

21-
var assetModuleList = {
23+
const assetModuleList = {
2224
sm: ['App', 'Schedule', 'Generate', 'Browse', 'Search', 'Help', 'Index']
2325
}
2426

25-
var assetTypes = {
27+
const assetTypes = {
2628
scripts: {
2729
paths: [
2830
'',
@@ -48,16 +50,16 @@ var assetTypes = {
4850
}
4951
}
5052

51-
var paths = {}
52-
var distPaths = {}
53+
const paths = {}
54+
const distPaths = {}
5355

5456
const getPaths = (rootPath, pathsDict) => {
55-
for (var moduleName in assetModuleList) {
57+
for (const moduleName in assetModuleList) {
5658
subModuleList = assetModuleList[moduleName]
5759

5860
pathsDict[moduleName] = {}
59-
for (var assetType in assetTypes) {
60-
var assetOpts = assetTypes[assetType]
61+
for (const assetType in assetTypes) {
62+
const assetOpts = assetTypes[assetType]
6163

6264
pathsDict[moduleName][assetType] = []
6365

@@ -68,9 +70,9 @@ const getPaths = (rootPath, pathsDict) => {
6870
}
6971
}
7072

71-
var doFor = function (assetType, cb) {
72-
var streamResults = []
73-
for (var moduleName in assetModuleList) {
73+
const doFor = function (assetType, cb) {
74+
const streamResults = []
75+
for (const moduleName in assetModuleList) {
7476
streamResults.push(cb({
7577
src: paths[moduleName][assetType],
7678
dist: distPaths[moduleName][assetType],
@@ -82,31 +84,27 @@ var doFor = function (assetType, cb) {
8284

8385
getPaths(modulesRoot.src, paths)
8486

85-
var fs = require('fs')
86-
var dump = function (tvar) {
87-
fs.writeFileSync('./dump.json', JSON.stringify(tvar))
88-
}
89-
9087
// Import required plugins
91-
var gulp = require('gulp')
92-
var htmlmin = require('gulp-htmlmin')
93-
var ngmin = require('gulp-ngmin')
94-
var uglify = require('gulp-uglify')
95-
var clean = require('gulp-clean')
96-
var concat = require('gulp-concat')
97-
var rename = require('gulp-rename')
98-
var sourcemaps = require('gulp-sourcemaps')
99-
var replace = require('gulp-replace')
100-
var es = require('event-stream')
101-
var minifyCSS = require('gulp-minify-css')
102-
var template = require('gulp-template')
103-
var ts = require('gulp-typescript')
104-
105-
var tsProject = ts.createProject('tsconfig.json')
88+
const gulp = require('gulp')
89+
const htmlmin = require('gulp-htmlmin')
90+
const ngAnnotate = require('gulp-ng-annotate')
91+
const uglify = require('gulp-uglify')
92+
const concat = require('gulp-concat')
93+
const rename = require('gulp-rename')
94+
const sourcemaps = require('gulp-sourcemaps')
95+
const replace = require('gulp-replace')
96+
const es = require('event-stream')
97+
const minifyCSS = require('gulp-minify-css')
98+
const template = require('gulp-template')
99+
const ts = require('gulp-typescript')
100+
const del = require('del')
101+
const vinylPaths = require('vinyl-paths')
102+
103+
const tsProject = ts.createProject('tsconfig.json')
106104

107105
// Define Tasks
108-
gulp.task('templates', function () {
109-
var mapped = doFor('templates', function (templatePaths) {
106+
gulp.task('templates', function (done) {
107+
const mapped = doFor('templates', function (templatePaths) {
110108
return gulp.src(templatePaths.src)
111109
.pipe(htmlmin({
112110
collapseWhitespace: true,
@@ -117,6 +115,7 @@ gulp.task('templates', function () {
117115
.pipe(gulp.dest(templatePaths.dest))
118116
})
119117

118+
done()
120119
return es.concat.apply(null, mapped)
121120
})
122121

@@ -128,11 +127,11 @@ gulp.task('compile', function () {
128127
return tsOut
129128
})
130129

131-
gulp.task('scripts', function () {
132-
var mapped = doFor('scripts', function (scriptPaths) {
130+
gulp.task('scripts', function (done) {
131+
const mapped = doFor('scripts', function (scriptPaths) {
133132
return gulp.src(scriptPaths.dist)
134133
.pipe(template({ modulePath: scriptPaths.dest }))
135-
.pipe(ngmin())
134+
.pipe(ngAnnotate())
136135
.pipe(concat('dist.js'))
137136
.pipe(gulp.dest(scriptPaths.dest))
138137
.pipe(sourcemaps.init())
@@ -144,49 +143,49 @@ gulp.task('scripts', function () {
144143
.pipe(gulp.dest(scriptPaths.dest))
145144
})
146145

146+
done()
147147
return es.concat.apply(null, mapped)
148148
})
149149

150-
gulp.task('styles', function () {
151-
var mapped = doFor('styles', function (stylePaths) {
150+
gulp.task('styles', function (done) {
151+
const mapped = doFor('styles', function (stylePaths) {
152152
return gulp.src(stylePaths.src)
153153
.pipe(concat('dist.css'))
154154
.pipe(gulp.dest(stylePaths.dest))
155-
.pipe(minifyCSS())
155+
.pipe(minifyCSS({ processImport: false }))
156156
.pipe(rename({ suffix: '.min' }))
157157
.pipe(gulp.dest(stylePaths.dest))
158158
})
159159

160+
done()
160161
return es.concat.apply(null, mapped)
161162
})
162163

163164
gulp.task('watch', function () {
164165
doFor('templates', function (templatePaths) {
165-
gulp.watch(templatePaths.src, ['templates']).on('error', function () {
166+
gulp.watch(templatePaths.src, gulp.series('templates')).on('error', function () {
166167
})
167168
})
168169
doFor('scripts', function (scriptPaths) {
169-
gulp.watch(scriptPaths.dist, ['scripts']).on('error', function () {
170+
gulp.watch(scriptPaths.dist, gulp.series('scripts')).on('error', function () {
170171
})
171172
})
172173
doFor('styles', function (stylesPaths) {
173-
gulp.watch(stylesPaths.src, ['styles']).on('error', function () {
174+
gulp.watch(stylesPaths.src, gulp.series('styles')).on('error', function () {
174175
})
175176
})
176177
})
177178

178179
gulp.task('clean', function () {
179-
return gulp.src(modulesRoot.dest, { read: false })
180-
.pipe(clean())
180+
return gulp.src(modulesRoot.dest, { read: false, allowEmpty: true })
181+
.pipe(vinylPaths(del))
181182
})
182183

183184
gulp.task('cleanAll', function () {
184-
return gulp.src([assetsRoot.dest + '/*', '!' + assetsRoot.dest + '.gitkeep'], { read: false })
185-
.pipe(clean())
185+
return gulp.src([assetsRoot.dest + '/*', '!' + assetsRoot.dest + '.gitkeep'], { read: false, allowEmpty: true })
186+
.pipe(vinylPaths(del))
186187
})
187188

188-
gulp.task('build', ['clean', 'compile'], function () {
189-
return gulp.start('scripts', 'templates', 'styles')
190-
})
189+
gulp.task('build', gulp.series('clean', 'compile', gulp.parallel('scripts', 'templates', 'styles')))
191190

192-
gulp.task('default', ['build'])
191+
gulp.task('default', gulp.series('build'))

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
ga('create', '<?= $GOOGLEANALYTICS ?>', 'rit.edu');
128128
</script>
129129
<script
130-
src="https://www.datadoghq-browser-agent.com/datadog-rum-recorder.js"
130+
src="https://www.datadoghq-browser-agent.com/datadog-rum-v3.js"
131131
type="text/javascript">
132132
</script>
133133
<script>

0 commit comments

Comments
 (0)