From 471458b4faed3944829bb4a4c1073a9f61738f64 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Wed, 19 Dec 2018 21:06:03 +0100 Subject: [PATCH] use extended dayjs until dayjs supports utc (#2233) --- .travis.yml | 2 +- lib/plugins/browsertime/index.js | 2 +- lib/sitespeed.js | 2 +- lib/support/messageMaker.js | 2 +- package-lock.json | 31 ++++++++++++++++++++++++++++++- package.json | 2 +- test/graphiteTests.js | 2 +- test/influxdbTests.js | 2 +- test/storageManagerTests.js | 2 +- 9 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fb35030b..026d1facd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ script: - npm run build:css && test -z "$(git status --porcelain lib/plugins/html/assets/css/index.css)" - bin/sitespeed.js -b firefox -n 2 --budget.configPath test/budget.json --summary https://www.sitespeed.io/ - bin/sitespeed.js --useHash -n 1 https://www.sitespeed.io/#heybaberia -- bin/sitespeed.js --useAlias start --mobile -n 1 https://www.sitespeed.io/ +- bin/sitespeed.js --useAlias start --mobile -n 1 --utc https://www.sitespeed.io/ - bin/sitespeed.js -b firefox --metrics.list --mobile -n 1 https://www.sitespeed.io/ - bin/sitespeed.js -b chrome -n 2 https://www.sitespeed.io/ --preScript test/prepostscripts/preSample.js --postScript test/prepostscripts/postSample.js diff --git a/lib/plugins/browsertime/index.js b/lib/plugins/browsertime/index.js index 5a864d03c..9b8494ec2 100644 --- a/lib/plugins/browsertime/index.js +++ b/lib/plugins/browsertime/index.js @@ -6,7 +6,7 @@ const api = require('webcoach'); const log = require('intel').getLogger('plugin.browsertime'); const merge = require('lodash.merge'); const analyzer = require('./analyzer'); -const dayjs = require('dayjs'); +const dayjs = require('dayjs-ext'); const isEmpty = require('lodash.isempty'); const get = require('lodash.get'); const defaultConfig = require('./default/config'); diff --git a/lib/sitespeed.js b/lib/sitespeed.js index faf8bbebb..8ff7ac5dc 100644 --- a/lib/sitespeed.js +++ b/lib/sitespeed.js @@ -1,6 +1,6 @@ 'use strict'; -const dayjs = require('dayjs'); +const dayjs = require('dayjs-ext'); const log = require('intel').getLogger('sitespeedio'); const intel = require('intel'); const os = require('os'); diff --git a/lib/support/messageMaker.js b/lib/support/messageMaker.js index f9eef8714..60ee612f3 100644 --- a/lib/support/messageMaker.js +++ b/lib/support/messageMaker.js @@ -1,6 +1,6 @@ 'use strict'; -const dayjs = require('dayjs'), +const dayjs = require('dayjs-ext'), merge = require('lodash.merge'), makeUuid = require('uuid').v4; diff --git a/package-lock.json b/package-lock.json index 3ce3cf588..b017a8f4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -402,7 +402,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" } } @@ -1437,6 +1437,15 @@ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.7.7.tgz", "integrity": "sha512-Qlkiu0NNDpYwhk0syK4ImvAl/5YnsEMkvC2O123INviGeOA3Q8s5VyVkZzmN5SC7Wv9bb1+rfwO+uSqtHB4UWw==" }, + "dayjs-ext": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dayjs-ext/-/dayjs-ext-2.2.0.tgz", + "integrity": "sha512-n7u711rSmAOPcx1xqj2WUSU/1PbWEst1VC/FeIQsC/ULQLNVlAUwYwRc8D1CdTWqZgliw/SVcox+xNyQl9Q4IA==", + "requires": { + "fast-plural-rules": "^0.0.1", + "timezone-support": "^1.8.0" + } + }, "dbug": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/dbug/-/dbug-0.4.2.tgz", @@ -2653,6 +2662,11 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fast-plural-rules": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/fast-plural-rules/-/fast-plural-rules-0.0.1.tgz", + "integrity": "sha512-0Cxx7LaH7+dNJEBozlisCxqaN5g68VTFT9PyLeFGBHmkPnQ3e46zss+r8pRC94KpzPlitL6m33GVdbMIDiUgqg==" + }, "fast-stats": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/fast-stats/-/fast-stats-0.0.4.tgz", @@ -7608,6 +7622,21 @@ } } }, + "timezone-support": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/timezone-support/-/timezone-support-1.8.1.tgz", + "integrity": "sha512-+pKzxoUe4PZXaQcswceJlA+69oRyyu1uivnYKdpsC7eGzZiuvTLbU4WYPqTKslEsoSvjN8k/u/6qNfGikBB/wA==", + "requires": { + "commander": "2.19.0" + }, + "dependencies": { + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + } + } + }, "tmp": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz", diff --git a/package.json b/package.json index f3bc869b8..eb4db4b45 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "browsertime": "3.12.0", "cli-color": "1.4.0", "concurrent-queue": "7.0.2", - "dayjs": "1.7.7", + "dayjs-ext": "2.2.0", "fast-stats": "0.0.4", "fs-extra": "7.0.1", "influx": "5.0.7", diff --git a/test/graphiteTests.js b/test/graphiteTests.js index acf5e1101..b9b411569 100644 --- a/test/graphiteTests.js +++ b/test/graphiteTests.js @@ -2,7 +2,7 @@ const DataGenerator = require('../lib/plugins/graphite/data-generator'), expect = require('chai').expect, - dayjs = require('dayjs'); + dayjs = require('dayjs-ext'); describe('graphite', function() { describe('dataGenerator', function() { diff --git a/test/influxdbTests.js b/test/influxdbTests.js index 51abf2238..d7b560729 100644 --- a/test/influxdbTests.js +++ b/test/influxdbTests.js @@ -1,7 +1,7 @@ 'use strict'; const DataGenerator = require('../lib/plugins/influxdb/data-generator'), - dayjs = require('dayjs'), + dayjs = require('dayjs-ext'), expect = require('chai').expect; describe('influxdb', function() { diff --git a/test/storageManagerTests.js b/test/storageManagerTests.js index cdb44b0bb..ae1ce2387 100644 --- a/test/storageManagerTests.js +++ b/test/storageManagerTests.js @@ -1,7 +1,7 @@ 'use strict'; const resultsStorage = require('../lib/core/resultsStorage'); -const dayjs = require('dayjs'); +const dayjs = require('dayjs-ext'); const path = require('path'); const expect = require('chai').expect;