diff --git a/.eslintrc.js.off2 b/.eslintrc.js.off2 deleted file mode 100644 index 4b1913d..0000000 --- a/.eslintrc.js.off2 +++ /dev/null @@ -1,47 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - parser: 'babel-eslint', - sourceType: 'module' - }, - env: { - browser: true - }, - extends: [ - // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention - // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. - // 'plugin:vue/essential', - // https://github.com/standard/standard/blob/master/docs/RULES-en.md - 'standard' - ], - // required to lint *.vue files - plugins: [ - // 'vue' - ], - globals: { - 'ga': true, // Google Analytics - 'cordova': true, - '__statics': true - }, - // add your custom rules here - 'rules': { - // allow async-await - 'generator-star-spacing': 'off', - - // allow paren-less arrow functions - 'arrow-parens': 0, - 'one-var': 0, - - 'import/first': 0, - 'import/named': 2, - 'import/namespace': 2, - 'import/default': 2, - 'import/export': 2, - 'import/extensions': 0, - 'import/no-unresolved': 0, - 'import/no-extraneous-dependencies': 0, - - // allow debugger during development - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 - } -} diff --git a/.gitignore b/.gitignore index caddd9f..41de00a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /syncd/ *.log /temp/ +/archive/ diff --git a/.npmignore b/.npmignore index 943a6ee..b193a5e 100644 --- a/.npmignore +++ b/.npmignore @@ -3,3 +3,4 @@ test/ *.test.js testing/ test-client +archive/ diff --git a/src/WSConsumer.js b/src/WSConsumer.js index 0a4ceb2..132e87c 100644 --- a/src/WSConsumer.js +++ b/src/WSConsumer.js @@ -71,13 +71,12 @@ class WSConsumer extends EventEmitter { function open () { this.listen() // this handles messages - console.log(`socket open to server at : ${this.url}`) + // console.log(`socket open to server at : ${this.url}`) if (!this.started) this.emit('connected') else this.emit('reconnected') clearTimeout(timeout) // this.socket.onerror = error.bind(this) this.socket.onclose = close.bind(this) - console.log(this.socket) count = 0 this.started = true resolve({url:this.url, msg:`socket open to server at : ${this.url}`}) @@ -112,9 +111,7 @@ class WSConsumer extends EventEmitter { let res = await this._packetProcess(packet) if (!res) { // if process was not promise returning like just logged to console - console.log( - 'warning: consumer process function was not promise returning' - ) + // console.log('warning: consumer process function was not promise returning') } }) @@ -167,9 +164,7 @@ class WSConsumer extends EventEmitter { if (!res) { // if process was not promise returning like just logged to console res = reply - console.log( - 'consumer function was not promise returning - resolving unprocessed' - ) + // console.log('consumer function was not promise returning - resolving unprocessed') } resolve(res) }) // end reply listener diff --git a/test-client/package.json b/test-client/package.json index 7c694b3..4b33a6c 100644 --- a/test-client/package.json +++ b/test-client/package.json @@ -8,6 +8,7 @@ "private": true, "scripts": { "lint": "eslint --ext .js,.vue src", + "tcw": "WSS='ws://pine64.kebler.net:8090' quasar dev", "tc": "quasar dev" }, "dependencies": { diff --git a/test-client/quasar.conf.js b/test-client/quasar.conf.js index 1ab32bb..1b85c78 100644 --- a/test-client/quasar.conf.js +++ b/test-client/quasar.conf.js @@ -14,6 +14,17 @@ module.exports = function (ctx) { ], supportIE: false, build: { + env: ctx.dev + // pass environment variable to browser client + ? { // so on dev we'll have + DBURL: JSON.stringify(process.env.DBURL), + // DBURL: JSON.stringify('ws://192.168.0.231:3030'), + WSS: JSON.stringify(process.env.WSS) + } + : { // and on build (production): + DBURL: JSON.stringify('ws://192.168.0.231:3030'), + WSS: JSON.stringify('ws://relays2.kebler.net:8090') + }, scopeHoisting: true, vueRouterMode: 'history', // vueCompiler: true,