From cfaf581ae18b8742b86024d2ff80c5dbe5df69cf Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Mon, 21 May 2018 16:41:41 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20use=20Moment.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plugins can still use Discord’s Moment.js with WebpackModules --- client/src/modules/vendor.js | 6 ------ client/webpack.config.js | 2 +- client/webpack.production.config.js | 2 +- common/modules/logger.js | 5 ++--- csseditor/src/Editor.vue | 2 +- csseditor/webpack.config.js | 3 ++- csseditor/webpack.production.config.js | 3 ++- package-lock.json | 5 ----- package.json | 1 - tests/ext/plugins/Example 2/index.js | 4 ++-- tests/ext/plugins/Example 3/index.js | 2 +- tests/ext/plugins/Example/index.js | 2 +- 12 files changed, 13 insertions(+), 24 deletions(-) diff --git a/client/src/modules/vendor.js b/client/src/modules/vendor.js index 25e95e2d..6a98cc45 100644 --- a/client/src/modules/vendor.js +++ b/client/src/modules/vendor.js @@ -11,7 +11,6 @@ import jQuery from 'jquery'; import lodash from 'lodash'; import Vue from 'vue'; -import moment from 'moment'; export { jQuery as $ }; @@ -29,11 +28,6 @@ export default class { static get lodash() { return lodash } static get _() { return this.lodash } - /** - * Moment - */ - static get moment() { return moment } - /** * Vue */ diff --git a/client/webpack.config.js b/client/webpack.config.js index 8821001e..e7a75d2f 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -34,7 +34,7 @@ module.exports = { electron: 'window.require("electron")', fs: 'window.require("fs")', path: 'window.require("path")', - node_utils: 'window.require("util")', + util: 'window.require("util")', sparkplug: 'require("../../core/dist/sparkplug")' }, resolve: { diff --git a/client/webpack.production.config.js b/client/webpack.production.config.js index e200a115..ce82238d 100644 --- a/client/webpack.production.config.js +++ b/client/webpack.production.config.js @@ -35,7 +35,7 @@ module.exports = { electron: 'window.require("electron")', fs: 'window.require("fs")', path: 'window.require("path")', - node_utils: 'window.require("util")', + util: 'window.require("util")', sparkplug: 'require("./sparkplug")' }, resolve: { diff --git a/common/modules/logger.js b/common/modules/logger.js index 4fb87a7e..2e3be4d5 100644 --- a/common/modules/logger.js +++ b/common/modules/logger.js @@ -9,8 +9,7 @@ */ import { FileUtils } from './utils'; -import moment from 'moment'; -import node_utils from 'node_utils'; +import node_utils from 'util'; export const logLevels = { 'log': 'log', @@ -60,7 +59,7 @@ export default class Logger { } static get timestamp() { - return moment().format('DD/MM/YY hh:mm:ss'); + return (new Date()).toLocaleString('en-GB'); } } diff --git a/csseditor/src/Editor.vue b/csseditor/src/Editor.vue index 66d68f5f..e6b8324c 100644 --- a/csseditor/src/Editor.vue +++ b/csseditor/src/Editor.vue @@ -33,7 +33,7 @@