gritty 9.0.3 → 9.0.4

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026.02.10, v9.0.4
2
+
3
+ feature:
4
+ - 00e92e2 gritty: client: get rid of mock-require
5
+
1
6
  2026.02.10, v9.0.3
2
7
 
3
8
  feature:
package/dist/gritty.js CHANGED
@@ -1319,7 +1319,7 @@ const {
1319
1319
  FitAddon
1320
1320
  } = __webpack_require__(6804);
1321
1321
  const {
1322
- WebglAddon
1322
+ WebglAddon: _WebglAddon
1323
1323
  } = __webpack_require__(3688);
1324
1324
  const currify = __webpack_require__(4299);
1325
1325
  const {
@@ -1330,7 +1330,7 @@ const {
1330
1330
  io
1331
1331
  } = __webpack_require__(8007);
1332
1332
  const {
1333
- Terminal
1333
+ Terminal: _Terminal
1334
1334
  } = __webpack_require__(5492);
1335
1335
  const getEl = __webpack_require__(5847);
1336
1336
  const getHost = __webpack_require__(3832);
@@ -1358,27 +1358,37 @@ function gritty(element, options = {}) {
1358
1358
  prefix = '/gritty',
1359
1359
  command,
1360
1360
  autoRestart,
1361
- cwd
1361
+ cwd,
1362
+ connect,
1363
+ Terminal = _Terminal,
1364
+ WebglAddon = _WebglAddon
1362
1365
  } = options;
1363
1366
  const env = getEnv(options.env || {});
1364
- const socket = connect(prefix, socketPath);
1367
+ const socket = doConnect(prefix, socketPath, {
1368
+ connect
1369
+ });
1365
1370
  return createTerminal(el, {
1366
1371
  env,
1367
1372
  cwd,
1368
1373
  command,
1369
1374
  autoRestart,
1370
1375
  socket,
1371
- fontFamily
1376
+ fontFamily,
1377
+ Terminal,
1378
+ WebglAddon
1372
1379
  });
1373
1380
  }
1374
- function createTerminal(terminalContainer, {
1375
- env,
1376
- cwd,
1377
- command,
1378
- autoRestart,
1379
- socket,
1380
- fontFamily
1381
- }) {
1381
+ function createTerminal(terminalContainer, overrides) {
1382
+ const {
1383
+ env,
1384
+ cwd,
1385
+ command,
1386
+ autoRestart,
1387
+ socket,
1388
+ fontFamily,
1389
+ Terminal,
1390
+ WebglAddon
1391
+ } = overrides;
1382
1392
  const fitAddon = new FitAddon();
1383
1393
  const webglAddon = new WebglAddon();
1384
1394
  const terminal = new Terminal({
@@ -1460,11 +1470,14 @@ function _onWindowResize(fitAddon) {
1460
1470
  const fit = fitAddon.fit.bind(fitAddon);
1461
1471
  tryCatch(fit);
1462
1472
  }
1463
- function connect(prefix, socketPath) {
1473
+ function doConnect(prefix, socketPath, overrides = {}) {
1474
+ const {
1475
+ connect = io.connect
1476
+ } = overrides;
1464
1477
  const href = getHost();
1465
1478
  const FIVE_SECONDS = 5000;
1466
1479
  const path = `${socketPath}/socket.io`;
1467
- const socket = io.connect(href + prefix, {
1480
+ const socket = connect(href + prefix, {
1468
1481
  'max reconnection attempts': 2 ** 32,
1469
1482
  'reconnection limit': FIVE_SECONDS,
1470
1483
  path