Skip to content

Commit 46be16a

Browse files
refactor: client
1 parent d96af16 commit 46be16a

36 files changed

+192
-158
lines changed

babel.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ module.exports = (api) => {
44
api.cache(true);
55

66
return {
7-
presets: ['@babel/preset-env'],
7+
presets: [
8+
[
9+
'@babel/preset-env',
10+
{
11+
targets: {
12+
node: '0.12',
13+
},
14+
},
15+
],
16+
],
817
env: {
918
test: {
1019
plugins: ['@babel/plugin-transform-runtime'],

client-src/clients/SockJSClient.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use strict';
22

33
const SockJS = require('sockjs-client/dist/sockjs');
4-
const { log } = require('../default/utils/log');
4+
const { log } = require('../modules/logger');
55
const BaseClient = require('./BaseClient');
66

77
module.exports = class SockJSClient extends BaseClient {
88
constructor(url) {
99
super();
10+
1011
const sockUrl = url.replace(/^(?:chrome-extension|file)/i, 'http');
11-
this.sock = new SockJS(sockUrl);
1212

13+
this.sock = new SockJS(sockUrl);
1314
this.sock.onerror = (err) => {
1415
log.error(err);
1516
};

client-src/clients/WebsocketClient.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

3-
/* global WebSocket */
4-
5-
const { log } = require('../default/utils/log');
3+
const { log } = require('../modules/logger');
64
const BaseClient = require('./BaseClient');
75

86
module.exports = class WebsocketClient extends BaseClient {

client-src/default/webpack.config.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

client-src/default/index.js renamed to client-src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

3-
/* global __resourceQuery WorkerGlobalScope self */
4-
const stripAnsi = require('../transpiled-modules/strip-ansi');
3+
/* global __resourceQuery WorkerGlobalScope */
4+
5+
const stripAnsi = require('./modules/strip-ansi');
56
const socket = require('./socket');
67
const overlay = require('./overlay');
78
const { log, setLogLevel } = require('./utils/log');
File renamed without changes.

client-src/modules/logger/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
// eslint-disable-next-line import/no-extraneous-dependencies
4+
require('core-js/stable/symbol');
5+
6+
module.exports = require('webpack/lib/logging/runtime');
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)