@clary-so/measure 0.4.4 → 0.4.6

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.
@@ -0,0 +1,305 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __commonJS = (cb, mod) => function __require() {
3
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
+ };
5
+
6
+ // ../../../node_modules/react/cjs/react.production.min.js
7
+ var require_react_production_min = __commonJS({
8
+ "../../../node_modules/react/cjs/react.production.min.js"(exports2) {
9
+ "use strict";
10
+ var l = /* @__PURE__ */ Symbol.for("react.element");
11
+ var n = /* @__PURE__ */ Symbol.for("react.portal");
12
+ var p = /* @__PURE__ */ Symbol.for("react.fragment");
13
+ var q = /* @__PURE__ */ Symbol.for("react.strict_mode");
14
+ var r = /* @__PURE__ */ Symbol.for("react.profiler");
15
+ var t = /* @__PURE__ */ Symbol.for("react.provider");
16
+ var u = /* @__PURE__ */ Symbol.for("react.context");
17
+ var v = /* @__PURE__ */ Symbol.for("react.forward_ref");
18
+ var w = /* @__PURE__ */ Symbol.for("react.suspense");
19
+ var x = /* @__PURE__ */ Symbol.for("react.memo");
20
+ var y = /* @__PURE__ */ Symbol.for("react.lazy");
21
+ var z = Symbol.iterator;
22
+ function A(a) {
23
+ if (null === a || "object" !== typeof a) return null;
24
+ a = z && a[z] || a["@@iterator"];
25
+ return "function" === typeof a ? a : null;
26
+ }
27
+ var B = { isMounted: function() {
28
+ return false;
29
+ }, enqueueForceUpdate: function() {
30
+ }, enqueueReplaceState: function() {
31
+ }, enqueueSetState: function() {
32
+ } };
33
+ var C = Object.assign;
34
+ var D = {};
35
+ function E(a, b, e) {
36
+ this.props = a;
37
+ this.context = b;
38
+ this.refs = D;
39
+ this.updater = e || B;
40
+ }
41
+ E.prototype.isReactComponent = {};
42
+ E.prototype.setState = function(a, b) {
43
+ if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
44
+ this.updater.enqueueSetState(this, a, b, "setState");
45
+ };
46
+ E.prototype.forceUpdate = function(a) {
47
+ this.updater.enqueueForceUpdate(this, a, "forceUpdate");
48
+ };
49
+ function F() {
50
+ }
51
+ F.prototype = E.prototype;
52
+ function G(a, b, e) {
53
+ this.props = a;
54
+ this.context = b;
55
+ this.refs = D;
56
+ this.updater = e || B;
57
+ }
58
+ var H = G.prototype = new F();
59
+ H.constructor = G;
60
+ C(H, E.prototype);
61
+ H.isPureReactComponent = true;
62
+ var I = Array.isArray;
63
+ var J = Object.prototype.hasOwnProperty;
64
+ var K = { current: null };
65
+ var L = { key: true, ref: true, __self: true, __source: true };
66
+ function M(a, b, e) {
67
+ var d, c = {}, k = null, h = null;
68
+ if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
69
+ var g = arguments.length - 2;
70
+ if (1 === g) c.children = e;
71
+ else if (1 < g) {
72
+ for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2];
73
+ c.children = f;
74
+ }
75
+ if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]);
76
+ return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current };
77
+ }
78
+ function N(a, b) {
79
+ return { $$typeof: l, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner };
80
+ }
81
+ function O(a) {
82
+ return "object" === typeof a && null !== a && a.$$typeof === l;
83
+ }
84
+ function escape(a) {
85
+ var b = { "=": "=0", ":": "=2" };
86
+ return "$" + a.replace(/[=:]/g, function(a2) {
87
+ return b[a2];
88
+ });
89
+ }
90
+ var P = /\/+/g;
91
+ function Q(a, b) {
92
+ return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
93
+ }
94
+ function R(a, b, e, d, c) {
95
+ var k = typeof a;
96
+ if ("undefined" === k || "boolean" === k) a = null;
97
+ var h = false;
98
+ if (null === a) h = true;
99
+ else switch (k) {
100
+ case "string":
101
+ case "number":
102
+ h = true;
103
+ break;
104
+ case "object":
105
+ switch (a.$$typeof) {
106
+ case l:
107
+ case n:
108
+ h = true;
109
+ }
110
+ }
111
+ if (h) return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R(c, b, e, "", function(a2) {
112
+ return a2;
113
+ })) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1;
114
+ h = 0;
115
+ d = "" === d ? "." : d + ":";
116
+ if (I(a)) for (var g = 0; g < a.length; g++) {
117
+ k = a[g];
118
+ var f = d + Q(k, g);
119
+ h += R(k, b, e, f, c);
120
+ }
121
+ else if (f = A(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done; ) k = k.value, f = d + Q(k, g++), h += R(k, b, e, f, c);
122
+ else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
123
+ return h;
124
+ }
125
+ function S(a, b, e) {
126
+ if (null == a) return a;
127
+ var d = [], c = 0;
128
+ R(a, d, "", "", function(a2) {
129
+ return b.call(e, a2, c++);
130
+ });
131
+ return d;
132
+ }
133
+ function T(a) {
134
+ if (-1 === a._status) {
135
+ var b = a._result;
136
+ b = b();
137
+ b.then(function(b2) {
138
+ if (0 === a._status || -1 === a._status) a._status = 1, a._result = b2;
139
+ }, function(b2) {
140
+ if (0 === a._status || -1 === a._status) a._status = 2, a._result = b2;
141
+ });
142
+ -1 === a._status && (a._status = 0, a._result = b);
143
+ }
144
+ if (1 === a._status) return a._result.default;
145
+ throw a._result;
146
+ }
147
+ var U = { current: null };
148
+ var V = { transition: null };
149
+ var W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K };
150
+ function X() {
151
+ throw Error("act(...) is not supported in production builds of React.");
152
+ }
153
+ exports2.Children = { map: S, forEach: function(a, b, e) {
154
+ S(a, function() {
155
+ b.apply(this, arguments);
156
+ }, e);
157
+ }, count: function(a) {
158
+ var b = 0;
159
+ S(a, function() {
160
+ b++;
161
+ });
162
+ return b;
163
+ }, toArray: function(a) {
164
+ return S(a, function(a2) {
165
+ return a2;
166
+ }) || [];
167
+ }, only: function(a) {
168
+ if (!O(a)) throw Error("React.Children.only expected to receive a single React element child.");
169
+ return a;
170
+ } };
171
+ exports2.Component = E;
172
+ exports2.Fragment = p;
173
+ exports2.Profiler = r;
174
+ exports2.PureComponent = G;
175
+ exports2.StrictMode = q;
176
+ exports2.Suspense = w;
177
+ exports2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W;
178
+ exports2.act = X;
179
+ exports2.cloneElement = function(a, b, e) {
180
+ if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
181
+ var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner;
182
+ if (null != b) {
183
+ void 0 !== b.ref && (k = b.ref, h = K.current);
184
+ void 0 !== b.key && (c = "" + b.key);
185
+ if (a.type && a.type.defaultProps) var g = a.type.defaultProps;
186
+ for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]);
187
+ }
188
+ var f = arguments.length - 2;
189
+ if (1 === f) d.children = e;
190
+ else if (1 < f) {
191
+ g = Array(f);
192
+ for (var m = 0; m < f; m++) g[m] = arguments[m + 2];
193
+ d.children = g;
194
+ }
195
+ return { $$typeof: l, type: a.type, key: c, ref: k, props: d, _owner: h };
196
+ };
197
+ exports2.createContext = function(a) {
198
+ a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
199
+ a.Provider = { $$typeof: t, _context: a };
200
+ return a.Consumer = a;
201
+ };
202
+ exports2.createElement = M;
203
+ exports2.createFactory = function(a) {
204
+ var b = M.bind(null, a);
205
+ b.type = a;
206
+ return b;
207
+ };
208
+ exports2.createRef = function() {
209
+ return { current: null };
210
+ };
211
+ exports2.forwardRef = function(a) {
212
+ return { $$typeof: v, render: a };
213
+ };
214
+ exports2.isValidElement = O;
215
+ exports2.lazy = function(a) {
216
+ return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T };
217
+ };
218
+ exports2.memo = function(a, b) {
219
+ return { $$typeof: x, type: a, compare: void 0 === b ? null : b };
220
+ };
221
+ exports2.startTransition = function(a) {
222
+ var b = V.transition;
223
+ V.transition = {};
224
+ try {
225
+ a();
226
+ } finally {
227
+ V.transition = b;
228
+ }
229
+ };
230
+ exports2.unstable_act = X;
231
+ exports2.useCallback = function(a, b) {
232
+ return U.current.useCallback(a, b);
233
+ };
234
+ exports2.useContext = function(a) {
235
+ return U.current.useContext(a);
236
+ };
237
+ exports2.useDebugValue = function() {
238
+ };
239
+ exports2.useDeferredValue = function(a) {
240
+ return U.current.useDeferredValue(a);
241
+ };
242
+ exports2.useEffect = function(a, b) {
243
+ return U.current.useEffect(a, b);
244
+ };
245
+ exports2.useId = function() {
246
+ return U.current.useId();
247
+ };
248
+ exports2.useImperativeHandle = function(a, b, e) {
249
+ return U.current.useImperativeHandle(a, b, e);
250
+ };
251
+ exports2.useInsertionEffect = function(a, b) {
252
+ return U.current.useInsertionEffect(a, b);
253
+ };
254
+ exports2.useLayoutEffect = function(a, b) {
255
+ return U.current.useLayoutEffect(a, b);
256
+ };
257
+ exports2.useMemo = function(a, b) {
258
+ return U.current.useMemo(a, b);
259
+ };
260
+ exports2.useReducer = function(a, b, e) {
261
+ return U.current.useReducer(a, b, e);
262
+ };
263
+ exports2.useRef = function(a) {
264
+ return U.current.useRef(a);
265
+ };
266
+ exports2.useState = function(a) {
267
+ return U.current.useState(a);
268
+ };
269
+ exports2.useSyncExternalStore = function(a, b, e) {
270
+ return U.current.useSyncExternalStore(a, b, e);
271
+ };
272
+ exports2.useTransition = function() {
273
+ return U.current.useTransition();
274
+ };
275
+ exports2.version = "18.3.1";
276
+ }
277
+ });
278
+
279
+ // ../../../node_modules/react/index.js
280
+ var require_react = __commonJS({
281
+ "../../../node_modules/react/index.js"(exports2, module2) {
282
+ "use strict";
283
+ if (true) {
284
+ module2.exports = require_react_production_min();
285
+ } else {
286
+ module2.exports = null;
287
+ }
288
+ }
289
+ });
290
+
291
+ // <stdin>
292
+ module.exports = require_react();
293
+ /*! Bundled license information:
294
+
295
+ react/cjs/react.production.min.js:
296
+ (**
297
+ * @license React
298
+ * react.production.min.js
299
+ *
300
+ * Copyright (c) Facebook, Inc. and its affiliates.
301
+ *
302
+ * This source code is licensed under the MIT license found in the
303
+ * LICENSE file in the root directory of this source tree.
304
+ *)
305
+ */
package/esbuild-bin.mjs CHANGED
@@ -1,26 +1,44 @@
1
1
  import * as esbuild from "esbuild";
2
+ import { writeFileSync } from "fs";
2
3
 
4
+ // Step 1: Bundle just React into its own file
3
5
  await esbuild.build({
4
6
  absWorkingDir: new URL(".", import.meta.url).pathname,
5
- entryPoints: ["dist/server/bin.js"],
7
+ stdin: {
8
+ contents: `module.exports = require("react");`,
9
+ resolveDir: ".",
10
+ },
6
11
  bundle: true,
7
12
  platform: "node",
8
13
  target: "node18",
9
- outfile: "dist/bin-bundled.js",
10
- banner: { js: "#!/usr/bin/env node" },
11
- // Bundle react, ink, and react-reconciler so they share one instance
12
- // Keep other node_modules as external (express, socket.io, etc.)
13
- external: [
14
- "express",
15
- "cors",
16
- "socket.io",
17
- "commander",
18
- "@clary-so/*",
19
- "yoga-wasm-web",
20
- ],
14
+ outfile: "dist/react-bundled.js",
21
15
  define: {
22
16
  "process.env.NODE_ENV": '"production"',
23
17
  },
24
18
  });
25
19
 
26
- console.log("Bundled bin-bundled.js");
20
+ // Step 2: Create a wrapper that patches require('react') to use our bundled copy,
21
+ // then runs the original bin
22
+ const wrapper = `#!/usr/bin/env node
23
+ "use strict";
24
+ const path = require("path");
25
+ const Module = require("module");
26
+
27
+ // Load our single bundled React instance
28
+ const bundledReact = require(path.join(__dirname, "react-bundled.js"));
29
+
30
+ // Patch require so all packages resolve to the same React instance
31
+ const origResolve = Module._resolveFilename;
32
+ Module._resolveFilename = function(request, parent, ...args) {
33
+ if (request === "react") {
34
+ return path.join(__dirname, "react-bundled.js");
35
+ }
36
+ return origResolve.call(this, request, parent, ...args);
37
+ };
38
+
39
+ // Now load the actual bin
40
+ require("./server/bin.js");
41
+ `;
42
+
43
+ writeFileSync(new URL("dist/bin-bundled.js", import.meta.url), wrapper);
44
+ console.log("Created bin-bundled.js wrapper");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clary-so/measure",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "author": {
5
5
  "name": "Almouro",
6
6
  "email": "alexandrem@bam.tech"