@immediately-run/sandpack-client 2.22.1 → 2.22.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandpack-client",
3
- "version": "2.22.1",
4
- "srcHash": "10bae547420c39b69868a88e4aa7810abbbd8490309a16a6154ca3fdc16e7b4f",
5
- "builtAt": "2026-09-13T05:42:11.272Z"
3
+ "version": "2.22.2",
4
+ "srcHash": "1b2b97ac12ce881cefee67f8583e02965e7ed59384142cd56ec1101fce9ba741",
5
+ "builtAt": "2026-09-22T19:28:04.451Z"
6
6
  }
@@ -2,9 +2,9 @@
2
2
 
3
3
  var utils = require('../../utils-BiVyytui.js');
4
4
  var nodebox = require('@codesandbox/nodebox');
5
- require('../../types-B3g_70H8.js');
5
+ require('../../types-xQEV22hP.js');
6
6
  var base = require('../../base-DelKLlDk.js');
7
- var consoleHook = require('../../consoleHook-vrsBdedj.js');
7
+ var consoleHook = require('../../consoleHook-cqJc2nPr.js');
8
8
  require('outvariant');
9
9
  require('@zenfs/core');
10
10
  require('dequal');
@@ -1,8 +1,8 @@
1
1
  import { _ as __awaiter, a as __generator, f as nullthrows, c as createError, g as __extends, h as __assign } from '../../utils-DG1HA4RZ.mjs';
2
2
  import { INJECT_MESSAGE_TYPE, Nodebox, PREVIEW_LOADED_MESSAGE_TYPE } from '@codesandbox/nodebox';
3
- import '../../types-DRg992RB.mjs';
3
+ import '../../types-oQzEw86T.mjs';
4
4
  import { S as SandpackClient } from '../../base-DBh7xJX9.mjs';
5
- import { c as consoleHook, g as generateRandomId, E as EventEmitter, a as getMessageFromError, f as findStartScriptPackageJson } from '../../consoleHook-DT9Wd42J.mjs';
5
+ import { c as consoleHook, g as generateRandomId, E as EventEmitter, a as getMessageFromError, f as findStartScriptPackageJson } from '../../consoleHook-BXwdFsm6.mjs';
6
6
  import 'outvariant';
7
7
  import '@zenfs/core';
8
8
  import 'dequal';
@@ -2,7 +2,7 @@
2
2
 
3
3
  var utils = require('../../utils-BiVyytui.js');
4
4
  var dequal = require('dequal');
5
- var types = require('../../types-B3g_70H8.js');
5
+ var types = require('../../types-xQEV22hP.js');
6
6
  var base = require('../../base-DelKLlDk.js');
7
7
  var iframeFactory = require('../../iframe-factory-Bc7tcyQZ.js');
8
8
  var mimeDB = require('mime-db');
@@ -722,7 +722,7 @@ var notifyCodeSandboxExportRefused$1 = function () {
722
722
 
723
723
  var _a;
724
724
  var SUFFIX_PLACEHOLDER = "-{{suffix}}";
725
- var BUNDLER_URL = "https://".concat((_a = "2.22.1") === null || _a === void 0 ? void 0 : _a.replace(/\./g, "-")).concat(SUFFIX_PLACEHOLDER, "-sandpack.codesandbox.io/");
725
+ var BUNDLER_URL = "https://".concat((_a = "2.22.2") === null || _a === void 0 ? void 0 : _a.replace(/\./g, "-")).concat(SUFFIX_PLACEHOLDER, "-sandpack.codesandbox.io/");
726
726
  var SandpackRuntime = /** @class */ (function (_super) {
727
727
  utils.__extends(SandpackRuntime, _super);
728
728
  function SandpackRuntime(selector, sandboxSetup, options) {
@@ -1,6 +1,6 @@
1
1
  import { _ as __awaiter, a as __generator, h as __assign, i as __rest, j as __spreadArray, g as __extends, f as nullthrows, e as extractErrorDetails, c as createError, d as createPackageJSON } from '../../utils-DG1HA4RZ.mjs';
2
2
  import { dequal } from 'dequal';
3
- import { a as SandpackLogLevel } from '../../types-DRg992RB.mjs';
3
+ import { a as SandpackLogLevel } from '../../types-oQzEw86T.mjs';
4
4
  import { S as SandpackClient } from '../../base-DBh7xJX9.mjs';
5
5
  import { c as createSandboxedIframe, e as ensureSandboxed } from '../../iframe-factory-C8M0b9uf.mjs';
6
6
  import mimeDB from 'mime-db';
@@ -720,7 +720,7 @@ var notifyCodeSandboxExportRefused$1 = function () {
720
720
 
721
721
  var _a;
722
722
  var SUFFIX_PLACEHOLDER = "-{{suffix}}";
723
- var BUNDLER_URL = "https://".concat((_a = "2.22.1") === null || _a === void 0 ? void 0 : _a.replace(/\./g, "-")).concat(SUFFIX_PLACEHOLDER, "-sandpack.codesandbox.io/");
723
+ var BUNDLER_URL = "https://".concat((_a = "2.22.2") === null || _a === void 0 ? void 0 : _a.replace(/\./g, "-")).concat(SUFFIX_PLACEHOLDER, "-sandpack.codesandbox.io/");
724
724
  var SandpackRuntime = /** @class */ (function (_super) {
725
725
  __extends(SandpackRuntime, _super);
726
726
  function SandpackRuntime(selector, sandboxSetup, options) {
@@ -1,6 +1,6 @@
1
1
  import { invariant } from 'outvariant';
2
2
  import { c as createError } from './utils-DG1HA4RZ.mjs';
3
- import './types-DRg992RB.mjs';
3
+ import './types-oQzEw86T.mjs';
4
4
 
5
5
  var EventEmitter = /** @class */ (function () {
6
6
  function EventEmitter() {
@@ -2,7 +2,7 @@
2
2
 
3
3
  var outvariant = require('outvariant');
4
4
  var utils = require('./utils-BiVyytui.js');
5
- require('./types-B3g_70H8.js');
5
+ require('./types-xQEV22hP.js');
6
6
 
7
7
  var EventEmitter = /** @class */ (function () {
8
8
  function EventEmitter() {
@@ -2,11 +2,11 @@
2
2
 
3
3
  var utils = require('./utils-BiVyytui.js');
4
4
  var staticBrowserServer = require('static-browser-server');
5
- var consoleHook = require('./consoleHook-vrsBdedj.js');
5
+ var consoleHook = require('./consoleHook-cqJc2nPr.js');
6
6
  var base = require('./base-DelKLlDk.js');
7
7
  var iframeFactory = require('./iframe-factory-Bc7tcyQZ.js');
8
8
  require('outvariant');
9
- require('./types-B3g_70H8.js');
9
+ require('./types-xQEV22hP.js');
10
10
  require('@zenfs/core');
11
11
  require('dequal');
12
12
 
@@ -1,10 +1,10 @@
1
1
  import { g as __extends, h as __assign, _ as __awaiter, a as __generator } from './utils-DG1HA4RZ.mjs';
2
2
  import { PreviewController } from 'static-browser-server';
3
- import { E as EventEmitter, g as generateRandomId, c as consoleHook } from './consoleHook-DT9Wd42J.mjs';
3
+ import { E as EventEmitter, g as generateRandomId, c as consoleHook } from './consoleHook-BXwdFsm6.mjs';
4
4
  import { S as SandpackClient } from './base-DBh7xJX9.mjs';
5
5
  import { c as createSandboxedIframe, e as ensureSandboxed } from './iframe-factory-C8M0b9uf.mjs';
6
6
  import 'outvariant';
7
- import './types-DRg992RB.mjs';
7
+ import './types-oQzEw86T.mjs';
8
8
  import '@zenfs/core';
9
9
  import 'dequal';
10
10
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var utils = require('./utils-BiVyytui.js');
4
- var types = require('./types-B3g_70H8.js');
4
+ var types = require('./types-xQEV22hP.js');
5
5
  require('outvariant');
6
6
  require('@zenfs/core');
7
7
 
@@ -24,7 +24,7 @@ function loadSandpackClient(iframeSelector_1, sandboxSetup_1) {
24
24
  case 2:
25
25
  Client = _c.sent();
26
26
  return [3 /*break*/, 7];
27
- case 3: return [4 /*yield*/, Promise.resolve().then(function () { return require('./index-Dnq1i5aM.js'); }).then(function (m) { return m.SandpackStatic; })];
27
+ case 3: return [4 /*yield*/, Promise.resolve().then(function () { return require('./index-DrIcrFsl.js'); }).then(function (m) { return m.SandpackStatic; })];
28
28
  case 4:
29
29
  Client = _c.sent();
30
30
  return [3 /*break*/, 7];
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ as __awaiter, a as __generator } from './utils-DG1HA4RZ.mjs';
2
2
  export { b as addPackageJSONIfNeededToMap, c as createError, d as createPackageJSON, e as extractErrorDetails, n as normalizePath, f as nullthrows } from './utils-DG1HA4RZ.mjs';
3
- export { M as META_PATH, S as SandpackFS, a as SandpackLogLevel } from './types-DRg992RB.mjs';
3
+ export { M as META_PATH, S as SandpackFS, a as SandpackLogLevel } from './types-oQzEw86T.mjs';
4
4
  import 'outvariant';
5
5
  import '@zenfs/core';
6
6
 
@@ -23,7 +23,7 @@ function loadSandpackClient(iframeSelector_1, sandboxSetup_1) {
23
23
  case 2:
24
24
  Client = _c.sent();
25
25
  return [3 /*break*/, 7];
26
- case 3: return [4 /*yield*/, import('./index-CSAGdFtt.mjs').then(function (m) { return m.SandpackStatic; })];
26
+ case 3: return [4 /*yield*/, import('./index-DtpWLpjX.mjs').then(function (m) { return m.SandpackStatic; })];
27
27
  case 4:
28
28
  Client = _c.sent();
29
29
  return [3 /*break*/, 7];
@@ -34,27 +34,33 @@ var GUARDED_WRITE_METHODS = [
34
34
  "rm",
35
35
  "rmdir",
36
36
  ];
37
- /**
38
- * Dev-only. Wrap the store-mutating methods on a SandpackFS instance's
39
- * bound-context `fs.promises` so any write that did **not** go through
40
- * `SandpackFS.writeFile` / `handleRemoteChange` (those use captured raw methods,
41
- * which stay unwrapped) emits a single loud `console.error` naming the offending
42
- * method + path, then still performs the write. Enforces the class writer invariant
43
- * (roadmap R3-110).
44
- *
45
- * This is a module-level function (not a class method) and its **only** reference
46
- * is behind the `if (IS_DEV)` branch in {@link ensureGuard} — so once a consumer's
47
- * production build folds `IS_DEV` to `false`, the branch and this whole function
48
- * tree-shake away (a class method would be retained). No-op in production.
49
- */
50
- function installOutOfBandGuard(fsContext) {
51
- var p = fsContext.fs.promises;
37
+ var OUT_OF_BAND_GUARD_KEY = Symbol.for("@immediately-run/sandpack-client:out-of-band-guard");
38
+ var PRISTINE_WRITE_METHODS_KEY = Symbol.for("@immediately-run/sandpack-client:pristine-write-methods");
39
+ var asWriteMethod = function (value) {
40
+ return typeof value === "function" ? value : undefined;
41
+ };
42
+ var isSidecarPath = function (path) {
43
+ return path === META_DIR || path === META_PATH;
44
+ };
45
+ var faceAddsWritePolicy = function (face, current) {
46
+ return face.writeFile !== current.writeFile ||
47
+ face.unlink !== current.unlink ||
48
+ face.mkdir !== current.mkdir;
49
+ };
50
+ // site-main's `src/filesystem/roEditorContext.ts` returns a fresh write-wrapper
51
+ // closure on every `fs.promises` access; that instability distinguishes a policy
52
+ // face from a raw ZenFS face when no pristine stash exists yet.
53
+ var isLikelyPolicyFace = function (face) {
54
+ return face.writeFile !== face.writeFile ||
55
+ face.unlink !== face.unlink ||
56
+ face.mkdir !== face.mkdir;
57
+ };
58
+ function installOutOfBandGuard(face, pristine) {
52
59
  var _loop_1 = function (method) {
53
- var original = p[method];
60
+ var original = pristine.methods[method];
54
61
  if (typeof original !== "function")
55
62
  return "continue";
56
- var call = original;
57
- p[method] = function () {
63
+ face[method] = function () {
58
64
  var args = [];
59
65
  for (var _i = 0; _i < arguments.length; _i++) {
60
66
  args[_i] = arguments[_i];
@@ -63,41 +69,78 @@ function installOutOfBandGuard(fsContext) {
63
69
  "no onChange \u2014 the editor view and bundler relay will miss it. Route the " +
64
70
  "write through SandpackFS (EDITOR_AS_APP_SPEC D-EDIT-1 writer invariant; " +
65
71
  "LOCAL_DEVELOPMENT_SPEC \u00A76.5).");
66
- return call.apply(p, args);
72
+ return original.apply(pristine.receiver, args);
67
73
  };
68
74
  };
69
75
  for (var _i = 0, GUARDED_WRITE_METHODS_1 = GUARDED_WRITE_METHODS; _i < GUARDED_WRITE_METHODS_1.length; _i++) {
70
76
  var method = GUARDED_WRITE_METHODS_1[_i];
71
77
  _loop_1(method);
72
78
  }
79
+ face[OUT_OF_BAND_GUARD_KEY] = true;
73
80
  }
74
- /**
75
- * The true raw write methods per bound context, captured once and shared by every
76
- * SandpackFS instance that adopts that context. Without this, a second instance's
77
- * constructor captures the first instance's wrapper as its "raw" method because the
78
- * guard has already replaced `fsContext.fs.promises` entries — so SandpackFS's own
79
- * writes trip the guard once per prior adoption (the R3-614 stacking bug).
80
- */
81
- var RAW = new WeakMap();
82
- /**
83
- * Return the context's raw write methods, capturing them and installing the out-of-band
84
- * guard exactly once per context (see {@link installOutOfBandGuard}). Reads `RAW` first,
85
- * so adopting the same context any number of times never re-wraps, never re-captures a
86
- * wrapper as raw, and never disarms a sibling instance.
87
- */
88
- function ensureGuard(fsContext) {
89
- var existing = RAW.get(fsContext);
90
- if (existing)
91
- return existing;
92
- var p = fsContext.fs.promises;
93
- var raw = {
94
- writeFile: p.writeFile.bind(p),
95
- unlink: p.unlink.bind(p),
96
- mkdir: p.mkdir.bind(p),
81
+ var capturePristine = function (face) {
82
+ var methods = {};
83
+ for (var _i = 0, GUARDED_WRITE_METHODS_2 = GUARDED_WRITE_METHODS; _i < GUARDED_WRITE_METHODS_2.length; _i++) {
84
+ var method = GUARDED_WRITE_METHODS_2[_i];
85
+ var original = asWriteMethod(face[method]);
86
+ if (original)
87
+ methods[method] = original;
88
+ }
89
+ var pristine = { receiver: face, methods: methods };
90
+ face[PRISTINE_WRITE_METHODS_KEY] = pristine;
91
+ return pristine;
92
+ };
93
+ var captureRaw = function (face, pristine) {
94
+ var policy = faceAddsWritePolicy(face, pristine.receiver);
95
+ var faceWriteFile = asWriteMethod(face.writeFile);
96
+ var faceUnlink = asWriteMethod(face.unlink);
97
+ var faceMkdir = asWriteMethod(face.mkdir);
98
+ var call = function (faceMethod, pristineMethod, path, args) {
99
+ if (policy && !isSidecarPath(path) && faceMethod) {
100
+ return faceMethod.apply(face, args);
101
+ }
102
+ var method = (pristineMethod !== null && pristineMethod !== void 0 ? pristineMethod : faceMethod);
103
+ return method.apply(pristine.receiver, args);
104
+ };
105
+ return {
106
+ writeFile: function (path, data) {
107
+ return call(faceWriteFile, pristine.methods.writeFile, path, [
108
+ path,
109
+ data,
110
+ ]);
111
+ },
112
+ unlink: function (path) {
113
+ return call(faceUnlink, pristine.methods.unlink, path, [path]);
114
+ },
115
+ mkdir: function (path, opts) {
116
+ return call(faceMkdir, pristine.methods.mkdir, path, [
117
+ path,
118
+ opts,
119
+ ]);
120
+ },
97
121
  };
98
- RAW.set(fsContext, raw);
99
- if (IS_DEV)
100
- installOutOfBandGuard(fsContext);
122
+ };
123
+ var capturePolicyRaw = function (face) {
124
+ var faceWriteFile = face.writeFile;
125
+ var faceUnlink = face.unlink;
126
+ var faceMkdir = face.mkdir;
127
+ return {
128
+ writeFile: function (path, data) { return faceWriteFile.call(face, path, data); },
129
+ unlink: function (path) { return faceUnlink.call(face, path); },
130
+ mkdir: function (path, opts) { return faceMkdir.call(face, path, opts); },
131
+ };
132
+ };
133
+ function ensureGuard(fsContext) {
134
+ var face = fsContext.fs.promises;
135
+ var existing = face[PRISTINE_WRITE_METHODS_KEY];
136
+ if (!existing && isLikelyPolicyFace(face)) {
137
+ return capturePolicyRaw(face);
138
+ }
139
+ var pristine = existing !== null && existing !== void 0 ? existing : capturePristine(face);
140
+ var raw = captureRaw(face, pristine);
141
+ if (IS_DEV && !face[OUT_OF_BAND_GUARD_KEY]) {
142
+ installOutOfBandGuard(face, pristine);
143
+ }
101
144
  return raw;
102
145
  }
103
146
  var mountCounter = 0;
@@ -36,27 +36,33 @@ var GUARDED_WRITE_METHODS = [
36
36
  "rm",
37
37
  "rmdir",
38
38
  ];
39
- /**
40
- * Dev-only. Wrap the store-mutating methods on a SandpackFS instance's
41
- * bound-context `fs.promises` so any write that did **not** go through
42
- * `SandpackFS.writeFile` / `handleRemoteChange` (those use captured raw methods,
43
- * which stay unwrapped) emits a single loud `console.error` naming the offending
44
- * method + path, then still performs the write. Enforces the class writer invariant
45
- * (roadmap R3-110).
46
- *
47
- * This is a module-level function (not a class method) and its **only** reference
48
- * is behind the `if (IS_DEV)` branch in {@link ensureGuard} — so once a consumer's
49
- * production build folds `IS_DEV` to `false`, the branch and this whole function
50
- * tree-shake away (a class method would be retained). No-op in production.
51
- */
52
- function installOutOfBandGuard(fsContext) {
53
- var p = fsContext.fs.promises;
39
+ var OUT_OF_BAND_GUARD_KEY = Symbol.for("@immediately-run/sandpack-client:out-of-band-guard");
40
+ var PRISTINE_WRITE_METHODS_KEY = Symbol.for("@immediately-run/sandpack-client:pristine-write-methods");
41
+ var asWriteMethod = function (value) {
42
+ return typeof value === "function" ? value : undefined;
43
+ };
44
+ var isSidecarPath = function (path) {
45
+ return path === META_DIR || path === META_PATH;
46
+ };
47
+ var faceAddsWritePolicy = function (face, current) {
48
+ return face.writeFile !== current.writeFile ||
49
+ face.unlink !== current.unlink ||
50
+ face.mkdir !== current.mkdir;
51
+ };
52
+ // site-main's `src/filesystem/roEditorContext.ts` returns a fresh write-wrapper
53
+ // closure on every `fs.promises` access; that instability distinguishes a policy
54
+ // face from a raw ZenFS face when no pristine stash exists yet.
55
+ var isLikelyPolicyFace = function (face) {
56
+ return face.writeFile !== face.writeFile ||
57
+ face.unlink !== face.unlink ||
58
+ face.mkdir !== face.mkdir;
59
+ };
60
+ function installOutOfBandGuard(face, pristine) {
54
61
  var _loop_1 = function (method) {
55
- var original = p[method];
62
+ var original = pristine.methods[method];
56
63
  if (typeof original !== "function")
57
64
  return "continue";
58
- var call = original;
59
- p[method] = function () {
65
+ face[method] = function () {
60
66
  var args = [];
61
67
  for (var _i = 0; _i < arguments.length; _i++) {
62
68
  args[_i] = arguments[_i];
@@ -65,41 +71,78 @@ function installOutOfBandGuard(fsContext) {
65
71
  "no onChange \u2014 the editor view and bundler relay will miss it. Route the " +
66
72
  "write through SandpackFS (EDITOR_AS_APP_SPEC D-EDIT-1 writer invariant; " +
67
73
  "LOCAL_DEVELOPMENT_SPEC \u00A76.5).");
68
- return call.apply(p, args);
74
+ return original.apply(pristine.receiver, args);
69
75
  };
70
76
  };
71
77
  for (var _i = 0, GUARDED_WRITE_METHODS_1 = GUARDED_WRITE_METHODS; _i < GUARDED_WRITE_METHODS_1.length; _i++) {
72
78
  var method = GUARDED_WRITE_METHODS_1[_i];
73
79
  _loop_1(method);
74
80
  }
81
+ face[OUT_OF_BAND_GUARD_KEY] = true;
75
82
  }
76
- /**
77
- * The true raw write methods per bound context, captured once and shared by every
78
- * SandpackFS instance that adopts that context. Without this, a second instance's
79
- * constructor captures the first instance's wrapper as its "raw" method because the
80
- * guard has already replaced `fsContext.fs.promises` entries — so SandpackFS's own
81
- * writes trip the guard once per prior adoption (the R3-614 stacking bug).
82
- */
83
- var RAW = new WeakMap();
84
- /**
85
- * Return the context's raw write methods, capturing them and installing the out-of-band
86
- * guard exactly once per context (see {@link installOutOfBandGuard}). Reads `RAW` first,
87
- * so adopting the same context any number of times never re-wraps, never re-captures a
88
- * wrapper as raw, and never disarms a sibling instance.
89
- */
90
- function ensureGuard(fsContext) {
91
- var existing = RAW.get(fsContext);
92
- if (existing)
93
- return existing;
94
- var p = fsContext.fs.promises;
95
- var raw = {
96
- writeFile: p.writeFile.bind(p),
97
- unlink: p.unlink.bind(p),
98
- mkdir: p.mkdir.bind(p),
83
+ var capturePristine = function (face) {
84
+ var methods = {};
85
+ for (var _i = 0, GUARDED_WRITE_METHODS_2 = GUARDED_WRITE_METHODS; _i < GUARDED_WRITE_METHODS_2.length; _i++) {
86
+ var method = GUARDED_WRITE_METHODS_2[_i];
87
+ var original = asWriteMethod(face[method]);
88
+ if (original)
89
+ methods[method] = original;
90
+ }
91
+ var pristine = { receiver: face, methods: methods };
92
+ face[PRISTINE_WRITE_METHODS_KEY] = pristine;
93
+ return pristine;
94
+ };
95
+ var captureRaw = function (face, pristine) {
96
+ var policy = faceAddsWritePolicy(face, pristine.receiver);
97
+ var faceWriteFile = asWriteMethod(face.writeFile);
98
+ var faceUnlink = asWriteMethod(face.unlink);
99
+ var faceMkdir = asWriteMethod(face.mkdir);
100
+ var call = function (faceMethod, pristineMethod, path, args) {
101
+ if (policy && !isSidecarPath(path) && faceMethod) {
102
+ return faceMethod.apply(face, args);
103
+ }
104
+ var method = (pristineMethod !== null && pristineMethod !== void 0 ? pristineMethod : faceMethod);
105
+ return method.apply(pristine.receiver, args);
106
+ };
107
+ return {
108
+ writeFile: function (path, data) {
109
+ return call(faceWriteFile, pristine.methods.writeFile, path, [
110
+ path,
111
+ data,
112
+ ]);
113
+ },
114
+ unlink: function (path) {
115
+ return call(faceUnlink, pristine.methods.unlink, path, [path]);
116
+ },
117
+ mkdir: function (path, opts) {
118
+ return call(faceMkdir, pristine.methods.mkdir, path, [
119
+ path,
120
+ opts,
121
+ ]);
122
+ },
99
123
  };
100
- RAW.set(fsContext, raw);
101
- if (IS_DEV)
102
- installOutOfBandGuard(fsContext);
124
+ };
125
+ var capturePolicyRaw = function (face) {
126
+ var faceWriteFile = face.writeFile;
127
+ var faceUnlink = face.unlink;
128
+ var faceMkdir = face.mkdir;
129
+ return {
130
+ writeFile: function (path, data) { return faceWriteFile.call(face, path, data); },
131
+ unlink: function (path) { return faceUnlink.call(face, path); },
132
+ mkdir: function (path, opts) { return faceMkdir.call(face, path, opts); },
133
+ };
134
+ };
135
+ function ensureGuard(fsContext) {
136
+ var face = fsContext.fs.promises;
137
+ var existing = face[PRISTINE_WRITE_METHODS_KEY];
138
+ if (!existing && isLikelyPolicyFace(face)) {
139
+ return capturePolicyRaw(face);
140
+ }
141
+ var pristine = existing !== null && existing !== void 0 ? existing : capturePristine(face);
142
+ var raw = captureRaw(face, pristine);
143
+ if (IS_DEV && !face[OUT_OF_BAND_GUARD_KEY]) {
144
+ installOutOfBandGuard(face, pristine);
145
+ }
103
146
  return raw;
104
147
  }
105
148
  var mountCounter = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/sandpack-client",
3
- "version": "2.22.1",
3
+ "version": "2.22.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  "clean": "rm -rf dist sandpack src/clients/node/inject-scripts/dist",
49
49
  "prebuild": "yarn run clean",
50
50
  "test": "jest . --transformIgnorePatterns \"node_modules/(?!@zenfs)/\"",
51
- "lint": "eslint '**/*.ts?(x)' --fix",
51
+ "lint": "eslint '**/*.ts?(x)' --max-warnings 0",
52
52
  "build": "rollup -c --bundleConfigAsCjs",
53
53
  "build:publish": "yarn build && gulp",
54
54
  "build:bundler": "gulp",