@salla.sa/twilight 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@salla.sa/twilight.min.js +1 -1
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/types/api/loyalty.d.ts +1 -1
- package/watcher.js +23 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/core": "^7.18.10",
|
|
47
|
-
"@babel/preset-env": "^7.18.
|
|
47
|
+
"@babel/preset-env": "^7.18.10",
|
|
48
48
|
"@rollup/plugin-babel": "^5.3.1",
|
|
49
49
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
50
50
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
package/types/api/loyalty.d.ts
CHANGED
package/watcher.js
CHANGED
|
@@ -70,22 +70,31 @@ class WatcherPlugin {
|
|
|
70
70
|
this.draft_id = args.draft_id;
|
|
71
71
|
port = args.port || 8000;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
client.on('connectFailed', function(error) {
|
|
77
|
-
console.error('[x] Oops! Hot reload is currently not working. Check the error message for details: ',error.toString());
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
client.on('connect', (connection)=> {
|
|
81
|
-
this.connection = connection;
|
|
82
|
-
console.log(color.green, `✓ Performing hot reload on port ws://localhost:${port}`, color.normal);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
client.connect(`ws://localhost:${port}`, 'echo-protocol');
|
|
73
|
+
// try to connect to ws server
|
|
74
|
+
this.wsConnectingTries = 1;
|
|
75
|
+
this.tryConnectWebsocket(port);
|
|
86
76
|
|
|
87
77
|
}
|
|
88
|
-
|
|
78
|
+
|
|
79
|
+
tryConnectWebsocket(port){
|
|
80
|
+
let client = new WebSocketClient();
|
|
81
|
+
client.on('connectFailed', (error)=> {
|
|
82
|
+
if(this.wsConnectingTries===10){
|
|
83
|
+
console.error('[x] Oops! Hot reload is currently not working. Check the error message for details: ',error.toString());
|
|
84
|
+
}else{
|
|
85
|
+
this.wsConnectingTries++;
|
|
86
|
+
setTimeout(()=>{
|
|
87
|
+
this.tryConnectWebsocket(port);
|
|
88
|
+
},1000);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
client.on('connect', (connection)=> {
|
|
93
|
+
this.connection = connection;
|
|
94
|
+
console.log(color.green, `✓ Performing hot reload on port ws://localhost:${port}`, color.normal);
|
|
95
|
+
});
|
|
96
|
+
client.connect(`ws://localhost:${port}`, 'echo-protocol');
|
|
97
|
+
}
|
|
89
98
|
/**
|
|
90
99
|
* @param {Compiler} compiler
|
|
91
100
|
*/
|