@wix/create-app 0.0.96 → 0.0.98

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.
@@ -7,104 +7,6 @@ import {
7
7
  init_esm_shims
8
8
  } from "./chunk-PYIAC2GK.js";
9
9
 
10
- // ../../node_modules/ws/lib/stream.js
11
- var require_stream = __commonJS({
12
- "../../node_modules/ws/lib/stream.js"(exports, module) {
13
- "use strict";
14
- init_esm_shims();
15
- var { Duplex } = __require("stream");
16
- function emitClose(stream) {
17
- stream.emit("close");
18
- }
19
- function duplexOnEnd() {
20
- if (!this.destroyed && this._writableState.finished) {
21
- this.destroy();
22
- }
23
- }
24
- function duplexOnError(err) {
25
- this.removeListener("error", duplexOnError);
26
- this.destroy();
27
- if (this.listenerCount("error") === 0) {
28
- this.emit("error", err);
29
- }
30
- }
31
- function createWebSocketStream2(ws, options) {
32
- let terminateOnDestroy = true;
33
- const duplex = new Duplex({
34
- ...options,
35
- autoDestroy: false,
36
- emitClose: false,
37
- objectMode: false,
38
- writableObjectMode: false
39
- });
40
- ws.on("message", function message(msg, isBinary) {
41
- const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
42
- if (!duplex.push(data)) ws.pause();
43
- });
44
- ws.once("error", function error(err) {
45
- if (duplex.destroyed) return;
46
- terminateOnDestroy = false;
47
- duplex.destroy(err);
48
- });
49
- ws.once("close", function close() {
50
- if (duplex.destroyed) return;
51
- duplex.push(null);
52
- });
53
- duplex._destroy = function(err, callback) {
54
- if (ws.readyState === ws.CLOSED) {
55
- callback(err);
56
- process.nextTick(emitClose, duplex);
57
- return;
58
- }
59
- let called = false;
60
- ws.once("error", function error(err2) {
61
- called = true;
62
- callback(err2);
63
- });
64
- ws.once("close", function close() {
65
- if (!called) callback(err);
66
- process.nextTick(emitClose, duplex);
67
- });
68
- if (terminateOnDestroy) ws.terminate();
69
- };
70
- duplex._final = function(callback) {
71
- if (ws.readyState === ws.CONNECTING) {
72
- ws.once("open", function open() {
73
- duplex._final(callback);
74
- });
75
- return;
76
- }
77
- if (ws._socket === null) return;
78
- if (ws._socket._writableState.finished) {
79
- callback();
80
- if (duplex._readableState.endEmitted) duplex.destroy();
81
- } else {
82
- ws._socket.once("finish", function finish() {
83
- callback();
84
- });
85
- ws.close();
86
- }
87
- };
88
- duplex._read = function() {
89
- if (ws.isPaused) ws.resume();
90
- };
91
- duplex._write = function(chunk, encoding, callback) {
92
- if (ws.readyState === ws.CONNECTING) {
93
- ws.once("open", function open() {
94
- duplex._write(chunk, encoding, callback);
95
- });
96
- return;
97
- }
98
- ws.send(chunk, callback);
99
- };
100
- duplex.on("end", duplexOnEnd);
101
- duplex.on("error", duplexOnError);
102
- return duplex;
103
- }
104
- module.exports = createWebSocketStream2;
105
- }
106
- });
107
-
108
10
  // ../../node_modules/ws/lib/constants.js
109
11
  var require_constants = __commonJS({
110
12
  "../../node_modules/ws/lib/constants.js"(exports, module) {
@@ -1888,7 +1790,7 @@ var require_sender = __commonJS({
1888
1790
  /**
1889
1791
  * Sends a frame.
1890
1792
  *
1891
- * @param {Buffer[]} list The frame to send
1793
+ * @param {(Buffer | String)[]} list The frame to send
1892
1794
  * @param {Function} [cb] Callback
1893
1795
  * @private
1894
1796
  */
@@ -3187,6 +3089,105 @@ var require_websocket = __commonJS({
3187
3089
  }
3188
3090
  });
3189
3091
 
3092
+ // ../../node_modules/ws/lib/stream.js
3093
+ var require_stream = __commonJS({
3094
+ "../../node_modules/ws/lib/stream.js"(exports, module) {
3095
+ "use strict";
3096
+ init_esm_shims();
3097
+ var WebSocket2 = require_websocket();
3098
+ var { Duplex } = __require("stream");
3099
+ function emitClose(stream) {
3100
+ stream.emit("close");
3101
+ }
3102
+ function duplexOnEnd() {
3103
+ if (!this.destroyed && this._writableState.finished) {
3104
+ this.destroy();
3105
+ }
3106
+ }
3107
+ function duplexOnError(err) {
3108
+ this.removeListener("error", duplexOnError);
3109
+ this.destroy();
3110
+ if (this.listenerCount("error") === 0) {
3111
+ this.emit("error", err);
3112
+ }
3113
+ }
3114
+ function createWebSocketStream2(ws, options) {
3115
+ let terminateOnDestroy = true;
3116
+ const duplex = new Duplex({
3117
+ ...options,
3118
+ autoDestroy: false,
3119
+ emitClose: false,
3120
+ objectMode: false,
3121
+ writableObjectMode: false
3122
+ });
3123
+ ws.on("message", function message(msg, isBinary) {
3124
+ const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
3125
+ if (!duplex.push(data)) ws.pause();
3126
+ });
3127
+ ws.once("error", function error(err) {
3128
+ if (duplex.destroyed) return;
3129
+ terminateOnDestroy = false;
3130
+ duplex.destroy(err);
3131
+ });
3132
+ ws.once("close", function close() {
3133
+ if (duplex.destroyed) return;
3134
+ duplex.push(null);
3135
+ });
3136
+ duplex._destroy = function(err, callback) {
3137
+ if (ws.readyState === ws.CLOSED) {
3138
+ callback(err);
3139
+ process.nextTick(emitClose, duplex);
3140
+ return;
3141
+ }
3142
+ let called = false;
3143
+ ws.once("error", function error(err2) {
3144
+ called = true;
3145
+ callback(err2);
3146
+ });
3147
+ ws.once("close", function close() {
3148
+ if (!called) callback(err);
3149
+ process.nextTick(emitClose, duplex);
3150
+ });
3151
+ if (terminateOnDestroy) ws.terminate();
3152
+ };
3153
+ duplex._final = function(callback) {
3154
+ if (ws.readyState === ws.CONNECTING) {
3155
+ ws.once("open", function open() {
3156
+ duplex._final(callback);
3157
+ });
3158
+ return;
3159
+ }
3160
+ if (ws._socket === null) return;
3161
+ if (ws._socket._writableState.finished) {
3162
+ callback();
3163
+ if (duplex._readableState.endEmitted) duplex.destroy();
3164
+ } else {
3165
+ ws._socket.once("finish", function finish() {
3166
+ callback();
3167
+ });
3168
+ ws.close();
3169
+ }
3170
+ };
3171
+ duplex._read = function() {
3172
+ if (ws.isPaused) ws.resume();
3173
+ };
3174
+ duplex._write = function(chunk, encoding, callback) {
3175
+ if (ws.readyState === ws.CONNECTING) {
3176
+ ws.once("open", function open() {
3177
+ duplex._write(chunk, encoding, callback);
3178
+ });
3179
+ return;
3180
+ }
3181
+ ws.send(chunk, callback);
3182
+ };
3183
+ duplex.on("end", duplexOnEnd);
3184
+ duplex.on("error", duplexOnError);
3185
+ return duplex;
3186
+ }
3187
+ module.exports = createWebSocketStream2;
3188
+ }
3189
+ });
3190
+
3190
3191
  // ../../node_modules/ws/lib/subprotocol.js
3191
3192
  var require_subprotocol = __commonJS({
3192
3193
  "../../node_modules/ws/lib/subprotocol.js"(exports, module) {
@@ -3699,4 +3700,4 @@ customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
3699
3700
  // ../../node_modules/ink/build/devtools.js
3700
3701
  import devtools from "react-devtools-core";
3701
3702
  devtools.connectToDevTools();
3702
- //# sourceMappingURL=devtools-YPSDP32D.js.map
3703
+ //# sourceMappingURL=devtools-JB2HYTEA.js.map