storybook 10.0.0-beta.2 → 10.0.0-beta.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.
Files changed (75) hide show
  1. package/dist/_node-chunks/{builder-manager-KCNW2J74.js → builder-manager-IKHPPPFE.js} +16 -16
  2. package/dist/_node-chunks/{camelcase-FH5EGUIB.js → camelcase-O2O7JODG.js} +7 -7
  3. package/dist/_node-chunks/{chunk-NTXIDMDM.js → chunk-3J7DQ6TI.js} +7 -7
  4. package/dist/_node-chunks/{chunk-XWJNZVOR.js → chunk-4FMOVB65.js} +8 -8
  5. package/dist/_node-chunks/{chunk-6A2WP6N7.js → chunk-4VGW2SQA.js} +7 -7
  6. package/dist/_node-chunks/chunk-5OILJTZE.js +1476 -0
  7. package/dist/_node-chunks/{chunk-6B3CXS7K.js → chunk-6COBULLV.js} +7 -7
  8. package/dist/_node-chunks/{chunk-HSI4BG2J.js → chunk-7IIAUEWB.js} +8 -8
  9. package/dist/_node-chunks/{chunk-MX77OTGN.js → chunk-AC3BNULF.js} +582 -736
  10. package/dist/_node-chunks/{chunk-CIIY3F53.js → chunk-AXFNB3AN.js} +7 -7
  11. package/dist/_node-chunks/chunk-CHJLO2LV.js +62 -0
  12. package/dist/_node-chunks/{chunk-JWFNAC5N.js → chunk-DCHFG5TX.js} +7 -7
  13. package/dist/_node-chunks/{chunk-7DWWXKIE.js → chunk-FWFQ2GU7.js} +6 -6
  14. package/dist/_node-chunks/{chunk-FXPYWCQE.js → chunk-HAVE6SGK.js} +7 -7
  15. package/dist/_node-chunks/{chunk-2E5IZBC2.js → chunk-IB5AEYPX.js} +7 -7
  16. package/dist/_node-chunks/{chunk-2VOEBWNF.js → chunk-JECCFKKM.js} +7 -7
  17. package/dist/_node-chunks/{chunk-ZF6AXYHM.js → chunk-JP4LEAXM.js} +7 -7
  18. package/dist/_node-chunks/chunk-JSSBBVU5.js +79 -0
  19. package/dist/_node-chunks/chunk-MNG223PY.js +18 -0
  20. package/dist/_node-chunks/{chunk-PTT3CRNJ.js → chunk-MOO2Y4GI.js} +6 -6
  21. package/dist/_node-chunks/{chunk-KDKM7KMS.js → chunk-N3GFXZDP.js} +7 -7
  22. package/dist/_node-chunks/{chunk-B7L5A4BQ.js → chunk-NF3GXIEK.js} +9 -9
  23. package/dist/_node-chunks/{chunk-JZ7ZEAK6.js → chunk-NOSGJ5PL.js} +7 -7
  24. package/dist/_node-chunks/{chunk-DPF2NDLD.js → chunk-OL2HWCBH.js} +7 -7
  25. package/dist/_node-chunks/{chunk-RSG3AEWL.js → chunk-SF2IETZ2.js} +29 -81
  26. package/dist/_node-chunks/{chunk-CGY2ITTD.js → chunk-TBAIXCHN.js} +8 -8
  27. package/dist/_node-chunks/{chunk-CMFB2H3U.js → chunk-TTQRDWDJ.js} +12 -12
  28. package/dist/_node-chunks/{chunk-63VGATS4.js → chunk-TYGVOW7L.js} +7 -7
  29. package/dist/_node-chunks/{chunk-HSS67Y6T.js → chunk-USDZSU5L.js} +7 -7
  30. package/dist/_node-chunks/chunk-XA4TAMUS.js +4966 -0
  31. package/dist/_node-chunks/{chunk-NUODGCJN.js → chunk-XT6O5CVI.js} +7 -7
  32. package/dist/_node-chunks/{chunk-WBRWBEAS.js → chunk-YJHXEN7U.js} +10 -10
  33. package/dist/_node-chunks/{chunk-NWTLWMJN.js → chunk-YRPXGWKW.js} +143 -15
  34. package/dist/_node-chunks/{default-browser-id-YRAH7IMC.js → default-browser-id-J4OIAAJ5.js} +7 -7
  35. package/dist/_node-chunks/{dist-G5THJIW5.js → dist-BMKSKYDI.js} +9 -9
  36. package/dist/_node-chunks/{globby-FGF2JG5Z.js → globby-DASPUXWI.js} +9 -9
  37. package/dist/_node-chunks/{lib-OPOVJQIO.js → lib-L6BIH4EV.js} +11 -11
  38. package/dist/_node-chunks/{mdx-N42X6CFJ-N5MJA4NM.js → mdx-N42X6CFJ-2COTUDSL.js} +8 -8
  39. package/dist/_node-chunks/{p-limit-JNDYEQZX.js → p-limit-HVR3I7TJ.js} +76 -10
  40. package/dist/_node-chunks/{plugin-ZL4ZLDWE.js → plugin-2XPSFYWZ.js} +10 -10
  41. package/dist/_node-chunks/{plugin-6GW4GYGS.js → plugin-FZOHPRK7.js} +10 -10
  42. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-F6BXWV4R.js → webpack-inject-mocker-runtime-plugin-FGQM2EPC.js} +10 -10
  43. package/dist/_node-chunks/{webpack-mock-plugin-5QNP4V3B.js → webpack-mock-plugin-4HOAIYSX.js} +9 -9
  44. package/dist/babel/index.js +11 -11
  45. package/dist/bin/core.js +11 -11
  46. package/dist/bin/dispatcher.js +11 -11
  47. package/dist/bin/loader.js +8 -8
  48. package/dist/cli/index.d.ts +1 -1
  49. package/dist/cli/index.js +29 -30
  50. package/dist/common/index.d.ts +3 -1
  51. package/dist/common/index.js +23 -22
  52. package/dist/core-server/index.js +38 -39
  53. package/dist/core-server/presets/common-override-preset.js +9 -9
  54. package/dist/core-server/presets/common-preset.js +22 -22
  55. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  56. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  57. package/dist/csf/index.js +7 -1
  58. package/dist/csf-tools/index.d.ts +34 -0
  59. package/dist/csf-tools/index.js +9 -9
  60. package/dist/manager/globals-runtime.js +3 -2
  61. package/dist/manager-api/index.d.ts +1 -1
  62. package/dist/manager-api/index.js +1 -1
  63. package/dist/node-logger/index.js +13 -14
  64. package/dist/preview/runtime.js +9 -2
  65. package/dist/preview-api/index.d.ts +67 -68
  66. package/dist/server-errors.js +10 -10
  67. package/dist/telemetry/index.js +24 -25
  68. package/dist/test/index.js +2 -1
  69. package/package.json +3 -7
  70. package/dist/_node-chunks/chunk-2VH25RMB.js +0 -9845
  71. package/dist/_node-chunks/chunk-6FPFMFFH.js +0 -266
  72. package/dist/_node-chunks/chunk-IAAPNJG4.js +0 -62
  73. package/dist/_node-chunks/chunk-IBC4BVDB.js +0 -87
  74. package/dist/_node-chunks/chunk-NNJMYLJM.js +0 -18
  75. package/dist/_node-chunks/chunk-TLM4ECJN.js +0 -2377
@@ -1,24 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_qfbekemo7ri from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_qfbekemo7ri from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_qfbekemo7ri from "node:module";
1
+ import CJS_COMPAT_NODE_URL_bdftjtsviyb from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_bdftjtsviyb from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_bdftjtsviyb from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_qfbekemo7ri.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_qfbekemo7ri.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_qfbekemo7ri.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_bdftjtsviyb.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_bdftjtsviyb.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_bdftjtsviyb.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_picomatch
14
- } from "./chunk-2VOEBWNF.js";
14
+ } from "./chunk-JECCFKKM.js";
15
15
  import {
16
- parseNodeModulePath,
17
- resolvePathSync
18
- } from "./chunk-2VH25RMB.js";
16
+ resolveModulePath
17
+ } from "./chunk-5OILJTZE.js";
19
18
  import {
20
19
  versions_default
21
- } from "./chunk-IAAPNJG4.js";
20
+ } from "./chunk-CHJLO2LV.js";
22
21
  import {
23
22
  BUN_LOCKFILE,
24
23
  BUN_LOCKFILE_BINARY,
@@ -27,45 +26,45 @@ import {
27
26
  YARN_LOCKFILE,
28
27
  execa,
29
28
  execaCommandSync,
29
+ findFilesUp,
30
30
  getProjectRoot,
31
31
  normalizeStoryPath,
32
32
  require_cross_spawn
33
- } from "./chunk-TLM4ECJN.js";
33
+ } from "./chunk-XA4TAMUS.js";
34
34
  import {
35
- findUp,
36
- findUpMultipleSync,
37
- findUpSync,
38
- locatePathSync
39
- } from "./chunk-6FPFMFFH.js";
35
+ any,
36
+ from,
37
+ up2 as up
38
+ } from "./chunk-JSSBBVU5.js";
40
39
  import {
41
40
  invariant
42
- } from "./chunk-HSS67Y6T.js";
41
+ } from "./chunk-USDZSU5L.js";
43
42
  import {
44
43
  importModule,
45
44
  resolvePackageDir,
46
45
  safeResolveModule
47
- } from "./chunk-CGY2ITTD.js";
46
+ } from "./chunk-TBAIXCHN.js";
48
47
  import {
49
48
  join,
50
49
  parse,
51
50
  resolve
52
- } from "./chunk-6A2WP6N7.js";
51
+ } from "./chunk-4VGW2SQA.js";
53
52
  import {
54
53
  require_prompts
55
- } from "./chunk-NTXIDMDM.js";
54
+ } from "./chunk-3J7DQ6TI.js";
56
55
  import {
57
56
  glob,
58
57
  globSync
59
- } from "./chunk-63VGATS4.js";
58
+ } from "./chunk-TYGVOW7L.js";
60
59
  import {
61
60
  slash
62
- } from "./chunk-DPF2NDLD.js";
61
+ } from "./chunk-OL2HWCBH.js";
63
62
  import {
64
63
  require_dist
65
- } from "./chunk-JZ7ZEAK6.js";
64
+ } from "./chunk-NOSGJ5PL.js";
66
65
  import {
67
66
  require_picocolors
68
- } from "./chunk-KDKM7KMS.js";
67
+ } from "./chunk-N3GFXZDP.js";
69
68
  import {
70
69
  __commonJS,
71
70
  __esm,
@@ -74,84 +73,7 @@ import {
74
73
  __require,
75
74
  __toCommonJS,
76
75
  __toESM
77
- } from "./chunk-PTT3CRNJ.js";
78
-
79
- // ../node_modules/common-path-prefix/index.js
80
- var require_common_path_prefix = __commonJS({
81
- "../node_modules/common-path-prefix/index.js"(exports, module) {
82
- "use strict";
83
- var { sep: DEFAULT_SEPARATOR } = __require("path");
84
- var determineSeparator = /* @__PURE__ */ __name((paths) => {
85
- for (const path4 of paths) {
86
- const match = /(\/|\\)/.exec(path4);
87
- if (match !== null) return match[0];
88
- }
89
- return DEFAULT_SEPARATOR;
90
- }, "determineSeparator");
91
- module.exports = /* @__PURE__ */ __name(function commonPathPrefix2(paths, sep2 = determineSeparator(paths)) {
92
- const [first = "", ...remaining] = paths;
93
- if (first === "" || remaining.length === 0) return "";
94
- const parts = first.split(sep2);
95
- let endOfPrefix = parts.length;
96
- for (const path4 of remaining) {
97
- const compare = path4.split(sep2);
98
- for (let i = 0; i < endOfPrefix; i++) {
99
- if (compare[i] !== parts[i]) {
100
- endOfPrefix = i;
101
- }
102
- }
103
- if (endOfPrefix === 0) return "";
104
- }
105
- const prefix = parts.slice(0, endOfPrefix).join(sep2);
106
- return prefix.endsWith(sep2) ? prefix : prefix + sep2;
107
- }, "commonPathPrefix");
108
- }
109
- });
110
-
111
- // ../node_modules/resolve-from/index.js
112
- var require_resolve_from = __commonJS({
113
- "../node_modules/resolve-from/index.js"(exports, module) {
114
- "use strict";
115
- var path4 = __require("path");
116
- var Module = __require("module");
117
- var fs2 = __require("fs");
118
- var resolveFrom2 = /* @__PURE__ */ __name((fromDirectory, moduleId, silent) => {
119
- if (typeof fromDirectory !== "string") {
120
- throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``);
121
- }
122
- if (typeof moduleId !== "string") {
123
- throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
124
- }
125
- try {
126
- fromDirectory = fs2.realpathSync(fromDirectory);
127
- } catch (error) {
128
- if (error.code === "ENOENT") {
129
- fromDirectory = path4.resolve(fromDirectory);
130
- } else if (silent) {
131
- return;
132
- } else {
133
- throw error;
134
- }
135
- }
136
- const fromFile = path4.join(fromDirectory, "noop.js");
137
- const resolveFileName = /* @__PURE__ */ __name(() => Module._resolveFilename(moduleId, {
138
- id: fromFile,
139
- filename: fromFile,
140
- paths: Module._nodeModulePaths(fromDirectory)
141
- }), "resolveFileName");
142
- if (silent) {
143
- try {
144
- return resolveFileName();
145
- } catch (error) {
146
- return;
147
- }
148
- }
149
- return resolveFileName();
150
- }, "resolveFrom");
151
- module.exports = (fromDirectory, moduleId) => resolveFrom2(fromDirectory, moduleId);
152
- module.exports.silent = (fromDirectory, moduleId) => resolveFrom2(fromDirectory, moduleId, true);
153
- }
154
- });
76
+ } from "./chunk-MOO2Y4GI.js";
155
77
 
156
78
  // ../node_modules/@yarnpkg/fslib/node_modules/tslib/tslib.es6.js
157
79
  var tslib_es6_exports = {};
@@ -820,23 +742,23 @@ var require_path = __commonJS({
820
742
  return path_1.default.posix.resolve(exports.ppath.cwd(), ...segments);
821
743
  }
822
744
  };
823
- var contains = /* @__PURE__ */ __name(function(pathUtils, from, to) {
824
- from = pathUtils.normalize(from);
745
+ var contains = /* @__PURE__ */ __name(function(pathUtils, from2, to) {
746
+ from2 = pathUtils.normalize(from2);
825
747
  to = pathUtils.normalize(to);
826
- if (from === to)
748
+ if (from2 === to)
827
749
  return `.`;
828
- if (!from.endsWith(pathUtils.sep))
829
- from = from + pathUtils.sep;
830
- if (to.startsWith(from)) {
831
- return to.slice(from.length);
750
+ if (!from2.endsWith(pathUtils.sep))
751
+ from2 = from2 + pathUtils.sep;
752
+ if (to.startsWith(from2)) {
753
+ return to.slice(from2.length);
832
754
  } else {
833
755
  return null;
834
756
  }
835
757
  }, "contains");
836
758
  exports.npath.fromPortablePath = fromPortablePath;
837
759
  exports.npath.toPortablePath = toPortablePath;
838
- exports.npath.contains = (from, to) => contains(exports.npath, from, to);
839
- exports.ppath.contains = (from, to) => contains(exports.ppath, from, to);
760
+ exports.npath.contains = (from2, to) => contains(exports.npath, from2, to);
761
+ exports.ppath.contains = (from2, to) => contains(exports.ppath, from2, to);
840
762
  var WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/;
841
763
  var UNC_WINDOWS_PATH_REGEXP = /^\/\/(\.\/)?(.*)$/;
842
764
  var PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/;
@@ -889,9 +811,9 @@ var require_copyPromise = __commonJS({
889
811
  exports.copyPromise = exports.LinkStrategy = void 0;
890
812
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
891
813
  var fs_1 = tslib_1.__importDefault(__require("fs"));
892
- var constants = tslib_1.__importStar(require_constants());
814
+ var constants2 = tslib_1.__importStar(require_constants());
893
815
  var path_1 = require_path();
894
- var defaultTime = new Date(constants.SAFE_TIME * 1e3);
816
+ var defaultTime = new Date(constants2.SAFE_TIME * 1e3);
895
817
  var LinkStrategy;
896
818
  (function(LinkStrategy2) {
897
819
  LinkStrategy2["Allow"] = "allow";
@@ -1168,8 +1090,8 @@ var require_opendir = __commonJS({
1168
1090
  static {
1169
1091
  __name(this, "CustomDir");
1170
1092
  }
1171
- constructor(path4, nextDirent, opts = {}) {
1172
- this.path = path4;
1093
+ constructor(path, nextDirent, opts = {}) {
1094
+ this.path = path;
1173
1095
  this.nextDirent = nextDirent;
1174
1096
  this.opts = opts;
1175
1097
  this.closed = false;
@@ -1213,16 +1135,16 @@ var require_opendir = __commonJS({
1213
1135
  }
1214
1136
  };
1215
1137
  exports.CustomDir = CustomDir;
1216
- function opendir(fakeFs, path4, entries, opts) {
1138
+ function opendir(fakeFs, path, entries, opts) {
1217
1139
  const nextDirent = /* @__PURE__ */ __name(() => {
1218
1140
  const filename = entries.shift();
1219
1141
  if (typeof filename === `undefined`)
1220
1142
  return null;
1221
- return Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path4, filename)), {
1143
+ return Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path, filename)), {
1222
1144
  name: filename
1223
1145
  });
1224
1146
  }, "nextDirent");
1225
- return new CustomDir(path4, nextDirent, opts);
1147
+ return new CustomDir(path, nextDirent, opts);
1226
1148
  }
1227
1149
  __name(opendir, "opendir");
1228
1150
  exports.opendir = opendir;
@@ -1727,8 +1649,8 @@ var require_NodeFS = __commonJS({
1727
1649
  async realpathPromise(p) {
1728
1650
  return await new Promise((resolve8, reject) => {
1729
1651
  this.realFs.realpath(path_1.npath.fromPortablePath(p), {}, this.makeCallback(resolve8, reject));
1730
- }).then((path4) => {
1731
- return path_1.npath.toPortablePath(path4);
1652
+ }).then((path) => {
1653
+ return path_1.npath.toPortablePath(path);
1732
1654
  });
1733
1655
  }
1734
1656
  realpathSync(p) {
@@ -1977,8 +1899,8 @@ var require_NodeFS = __commonJS({
1977
1899
  async readlinkPromise(p) {
1978
1900
  return await new Promise((resolve8, reject) => {
1979
1901
  this.realFs.readlink(path_1.npath.fromPortablePath(p), this.makeCallback(resolve8, reject));
1980
- }).then((path4) => {
1981
- return path_1.npath.toPortablePath(path4);
1902
+ }).then((path) => {
1903
+ return path_1.npath.toPortablePath(path);
1982
1904
  });
1983
1905
  }
1984
1906
  readlinkSync(p) {
@@ -2064,18 +1986,18 @@ var require_CustomStatWatcher = __commonJS({
2064
1986
  static {
2065
1987
  __name(this, "CustomStatWatcher");
2066
1988
  }
2067
- static create(fakeFs, path4, opts) {
2068
- const statWatcher = new _CustomStatWatcher(fakeFs, path4, opts);
1989
+ static create(fakeFs, path, opts) {
1990
+ const statWatcher = new _CustomStatWatcher(fakeFs, path, opts);
2069
1991
  statWatcher.start();
2070
1992
  return statWatcher;
2071
1993
  }
2072
- constructor(fakeFs, path4, { bigint = false } = {}) {
1994
+ constructor(fakeFs, path, { bigint = false } = {}) {
2073
1995
  super();
2074
1996
  this.status = Status.Ready;
2075
1997
  this.changeListeners = /* @__PURE__ */ new Map();
2076
1998
  this.startTimeout = null;
2077
1999
  this.fakeFs = fakeFs;
2078
- this.path = path4;
2000
+ this.path = path;
2079
2001
  this.bigint = bigint;
2080
2002
  this.lastStats = this.stat();
2081
2003
  }
@@ -2179,7 +2101,7 @@ var require_watchFile = __commonJS({
2179
2101
  exports.unwatchAllFiles = exports.unwatchFile = exports.watchFile = void 0;
2180
2102
  var CustomStatWatcher_1 = require_CustomStatWatcher();
2181
2103
  var statWatchersByFakeFS = /* @__PURE__ */ new WeakMap();
2182
- function watchFile(fakeFs, path4, a, b) {
2104
+ function watchFile(fakeFs, path, a, b) {
2183
2105
  let bigint;
2184
2106
  let persistent;
2185
2107
  let interval;
@@ -2207,21 +2129,21 @@ var require_watchFile = __commonJS({
2207
2129
  let statWatchers = statWatchersByFakeFS.get(fakeFs);
2208
2130
  if (typeof statWatchers === `undefined`)
2209
2131
  statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map());
2210
- let statWatcher = statWatchers.get(path4);
2132
+ let statWatcher = statWatchers.get(path);
2211
2133
  if (typeof statWatcher === `undefined`) {
2212
- statWatcher = CustomStatWatcher_1.CustomStatWatcher.create(fakeFs, path4, { bigint });
2213
- statWatchers.set(path4, statWatcher);
2134
+ statWatcher = CustomStatWatcher_1.CustomStatWatcher.create(fakeFs, path, { bigint });
2135
+ statWatchers.set(path, statWatcher);
2214
2136
  }
2215
2137
  statWatcher.registerChangeListener(listener, { persistent, interval });
2216
2138
  return statWatcher;
2217
2139
  }
2218
2140
  __name(watchFile, "watchFile");
2219
2141
  exports.watchFile = watchFile;
2220
- function unwatchFile(fakeFs, path4, cb) {
2142
+ function unwatchFile(fakeFs, path, cb) {
2221
2143
  const statWatchers = statWatchersByFakeFS.get(fakeFs);
2222
2144
  if (typeof statWatchers === `undefined`)
2223
2145
  return;
2224
- const statWatcher = statWatchers.get(path4);
2146
+ const statWatcher = statWatchers.get(path);
2225
2147
  if (typeof statWatcher === `undefined`)
2226
2148
  return;
2227
2149
  if (typeof cb === `undefined`)
@@ -2230,7 +2152,7 @@ var require_watchFile = __commonJS({
2230
2152
  statWatcher.unregisterChangeListener(cb);
2231
2153
  if (!statWatcher.hasChangeListeners()) {
2232
2154
  statWatcher.stop();
2233
- statWatchers.delete(path4);
2155
+ statWatchers.delete(path);
2234
2156
  }
2235
2157
  }
2236
2158
  __name(unwatchFile, "unwatchFile");
@@ -2239,8 +2161,8 @@ var require_watchFile = __commonJS({
2239
2161
  const statWatchers = statWatchersByFakeFS.get(fakeFs);
2240
2162
  if (typeof statWatchers === `undefined`)
2241
2163
  return;
2242
- for (const path4 of statWatchers.keys()) {
2243
- unwatchFile(fakeFs, path4);
2164
+ for (const path of statWatchers.keys()) {
2165
+ unwatchFile(fakeFs, path);
2244
2166
  }
2245
2167
  }
2246
2168
  __name(unwatchAllFiles, "unwatchAllFiles");
@@ -3080,10 +3002,10 @@ var require_ZipFS = __commonJS({
3080
3002
  }
3081
3003
  fdToPath(fd, reason) {
3082
3004
  var _a;
3083
- const path4 = (_a = this.fds.get(fd)) === null || _a === void 0 ? void 0 : _a.p;
3084
- if (typeof path4 === `undefined`)
3005
+ const path = (_a = this.fds.get(fd)) === null || _a === void 0 ? void 0 : _a.p;
3006
+ if (typeof path === `undefined`)
3085
3007
  throw errors.EBADF(reason);
3086
- return path4;
3008
+ return path;
3087
3009
  }
3088
3010
  async writeFilePromise(p, content, opts) {
3089
3011
  const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts);
@@ -3398,8 +3320,8 @@ var require_ProxiedFS = __commonJS({
3398
3320
  getExtractHint(hints) {
3399
3321
  return this.baseFs.getExtractHint(hints);
3400
3322
  }
3401
- resolve(path4) {
3402
- return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path4)));
3323
+ resolve(path) {
3324
+ return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path)));
3403
3325
  }
3404
3326
  getRealPath() {
3405
3327
  return this.mapFromBase(this.baseFs.getRealPath());
@@ -3708,14 +3630,14 @@ var require_CwdFS = __commonJS({
3708
3630
  return this.baseFs.resolve(path_1.ppath.join(this.target, p));
3709
3631
  }
3710
3632
  }
3711
- mapFromBase(path4) {
3712
- return path4;
3633
+ mapFromBase(path) {
3634
+ return path;
3713
3635
  }
3714
- mapToBase(path4) {
3715
- if (this.pathUtils.isAbsolute(path4)) {
3716
- return path4;
3636
+ mapToBase(path) {
3637
+ if (this.pathUtils.isAbsolute(path)) {
3638
+ return path;
3717
3639
  } else {
3718
- return this.pathUtils.join(this.target, path4);
3640
+ return this.pathUtils.join(this.target, path);
3719
3641
  }
3720
3642
  }
3721
3643
  };
@@ -4044,11 +3966,11 @@ var require_PosixFS = __commonJS({
4044
3966
  super(path_1.npath);
4045
3967
  this.baseFs = baseFs;
4046
3968
  }
4047
- mapFromBase(path4) {
4048
- return path_1.npath.fromPortablePath(path4);
3969
+ mapFromBase(path) {
3970
+ return path_1.npath.fromPortablePath(path);
4049
3971
  }
4050
- mapToBase(path4) {
4051
- return path_1.npath.toPortablePath(path4);
3972
+ mapToBase(path) {
3973
+ return path_1.npath.toPortablePath(path);
4052
3974
  }
4053
3975
  };
4054
3976
  exports.PosixFS = PosixFS2;
@@ -4161,22 +4083,22 @@ var require_ZipOpenFS = __commonJS({
4161
4083
  var path_1 = require_path();
4162
4084
  var ZIP_MASK = 4278190080;
4163
4085
  var ZIP_MAGIC = 704643072;
4164
- var getArchivePart = /* @__PURE__ */ __name((path4, extension) => {
4165
- let idx = path4.indexOf(extension);
4086
+ var getArchivePart = /* @__PURE__ */ __name((path, extension) => {
4087
+ let idx = path.indexOf(extension);
4166
4088
  if (idx <= 0)
4167
4089
  return null;
4168
4090
  let nextCharIdx = idx;
4169
4091
  while (idx >= 0) {
4170
4092
  nextCharIdx = idx + extension.length;
4171
- if (path4[nextCharIdx] === path_1.ppath.sep)
4093
+ if (path[nextCharIdx] === path_1.ppath.sep)
4172
4094
  break;
4173
- if (path4[idx - 1] === path_1.ppath.sep)
4095
+ if (path[idx - 1] === path_1.ppath.sep)
4174
4096
  return null;
4175
- idx = path4.indexOf(extension, nextCharIdx);
4097
+ idx = path.indexOf(extension, nextCharIdx);
4176
4098
  }
4177
- if (path4.length > nextCharIdx && path4[nextCharIdx] !== path_1.ppath.sep)
4099
+ if (path.length > nextCharIdx && path[nextCharIdx] !== path_1.ppath.sep)
4178
4100
  return null;
4179
- return path4.slice(0, nextCharIdx);
4101
+ return path.slice(0, nextCharIdx);
4180
4102
  }, "getArchivePart");
4181
4103
  exports.getArchivePart = getArchivePart;
4182
4104
  var ZipOpenFS2 = class _ZipOpenFS extends FakeFS_1.BasePortableFakeFS {
@@ -4222,18 +4144,18 @@ var require_ZipOpenFS = __commonJS({
4222
4144
  saveAndClose() {
4223
4145
  (0, watchFile_1.unwatchAllFiles)(this);
4224
4146
  if (this.zipInstances) {
4225
- for (const [path4, { zipFs }] of this.zipInstances.entries()) {
4147
+ for (const [path, { zipFs }] of this.zipInstances.entries()) {
4226
4148
  zipFs.saveAndClose();
4227
- this.zipInstances.delete(path4);
4149
+ this.zipInstances.delete(path);
4228
4150
  }
4229
4151
  }
4230
4152
  }
4231
4153
  discardAndClose() {
4232
4154
  (0, watchFile_1.unwatchAllFiles)(this);
4233
4155
  if (this.zipInstances) {
4234
- for (const [path4, { zipFs }] of this.zipInstances.entries()) {
4156
+ for (const [path, { zipFs }] of this.zipInstances.entries()) {
4235
4157
  zipFs.discardAndClose();
4236
- this.zipInstances.delete(path4);
4158
+ this.zipInstances.delete(path);
4237
4159
  }
4238
4160
  }
4239
4161
  }
@@ -4938,12 +4860,12 @@ var require_ZipOpenFS = __commonJS({
4938
4860
  const now = Date.now();
4939
4861
  let nextExpiresAt = now + this.maxAge;
4940
4862
  let closeCount = max === null ? 0 : this.zipInstances.size - max;
4941
- for (const [path4, { zipFs, expiresAt, refCount }] of this.zipInstances.entries()) {
4863
+ for (const [path, { zipFs, expiresAt, refCount }] of this.zipInstances.entries()) {
4942
4864
  if (refCount !== 0 || zipFs.hasOpenFileHandles()) {
4943
4865
  continue;
4944
4866
  } else if (now >= expiresAt) {
4945
4867
  zipFs.saveAndClose();
4946
- this.zipInstances.delete(path4);
4868
+ this.zipInstances.delete(path);
4947
4869
  closeCount -= 1;
4948
4870
  continue;
4949
4871
  } else if (max === null || closeCount <= 0) {
@@ -4951,7 +4873,7 @@ var require_ZipOpenFS = __commonJS({
4951
4873
  break;
4952
4874
  }
4953
4875
  zipFs.saveAndClose();
4954
- this.zipInstances.delete(path4);
4876
+ this.zipInstances.delete(path);
4955
4877
  closeCount -= 1;
4956
4878
  }
4957
4879
  if (this.limitOpenFilesTimeout === null && (max === null && this.zipInstances.size > 0 || max !== null)) {
@@ -5053,21 +4975,21 @@ var require_NodePathFS = __commonJS({
5053
4975
  super(path_1.npath);
5054
4976
  this.baseFs = baseFs;
5055
4977
  }
5056
- mapFromBase(path4) {
5057
- return path4;
5058
- }
5059
- mapToBase(path4) {
5060
- if (typeof path4 === `string`)
5061
- return path4;
5062
- if (path4 instanceof url_1.URL)
5063
- return (0, url_1.fileURLToPath)(path4);
5064
- if (Buffer.isBuffer(path4)) {
5065
- const str = path4.toString();
5066
- if (Buffer.byteLength(str) !== path4.byteLength)
4978
+ mapFromBase(path) {
4979
+ return path;
4980
+ }
4981
+ mapToBase(path) {
4982
+ if (typeof path === `string`)
4983
+ return path;
4984
+ if (path instanceof url_1.URL)
4985
+ return (0, url_1.fileURLToPath)(path);
4986
+ if (Buffer.isBuffer(path)) {
4987
+ const str = path.toString();
4988
+ if (Buffer.byteLength(str) !== path.byteLength)
5067
4989
  throw new Error(`Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942`);
5068
4990
  return str;
5069
4991
  }
5070
- throw new Error(`Unsupported path type: ${(0, util_1.inspect)(path4)}`);
4992
+ throw new Error(`Unsupported path type: ${(0, util_1.inspect)(path)}`);
5071
4993
  }
5072
4994
  };
5073
4995
  exports.NodePathFS = NodePathFS;
@@ -5690,8 +5612,8 @@ var require_lib = __commonJS({
5690
5612
  Object.defineProperty(exports, "__esModule", { value: true });
5691
5613
  exports.xfs = exports.extendFs = exports.patchFs = exports.ZipOpenFS = exports.ZipFS = exports.VirtualFS = exports.ProxiedFS = exports.PosixFS = exports.NodeFS = exports.NoFS = exports.LazyFS = exports.JailFS = exports.CwdFS = exports.FakeFS = exports.AliasFS = exports.toFilename = exports.ppath = exports.npath = exports.Filename = exports.PortablePath = exports.DEFAULT_COMPRESSION_LEVEL = exports.normalizeLineEndings = exports.statUtils = exports.CustomDir = exports.opendir = exports.LinkStrategy = exports.constants = void 0;
5692
5614
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
5693
- var constants = tslib_1.__importStar(require_constants());
5694
- exports.constants = constants;
5615
+ var constants2 = tslib_1.__importStar(require_constants());
5616
+ exports.constants = constants2;
5695
5617
  var statUtils = tslib_1.__importStar(require_statUtils());
5696
5618
  exports.statUtils = statUtils;
5697
5619
  var copyPromise_1 = require_copyPromise();
@@ -6187,11 +6109,11 @@ var require_libzipSync = __commonJS({
6187
6109
  var ENVIRONMENT_IS_WORKER = false;
6188
6110
  var ENVIRONMENT_IS_NODE = true;
6189
6111
  var scriptDirectory = "";
6190
- function locateFile(path4) {
6112
+ function locateFile(path) {
6191
6113
  if (Module["locateFile"]) {
6192
- return Module["locateFile"](path4, scriptDirectory);
6114
+ return Module["locateFile"](path, scriptDirectory);
6193
6115
  }
6194
- return scriptDirectory + path4;
6116
+ return scriptDirectory + path;
6195
6117
  }
6196
6118
  __name(locateFile, "locateFile");
6197
6119
  var read_, readBinary;
@@ -6705,44 +6627,44 @@ var require_libzipSync = __commonJS({
6705
6627
  return splitPathRe.exec(filename).slice(1);
6706
6628
  }, "splitPath"),
6707
6629
  normalizeArray: /* @__PURE__ */ __name(function(parts, allowAboveRoot) {
6708
- var up = 0;
6630
+ var up3 = 0;
6709
6631
  for (var i = parts.length - 1; i >= 0; i--) {
6710
6632
  var last = parts[i];
6711
6633
  if (last === ".") {
6712
6634
  parts.splice(i, 1);
6713
6635
  } else if (last === "..") {
6714
6636
  parts.splice(i, 1);
6715
- up++;
6716
- } else if (up) {
6637
+ up3++;
6638
+ } else if (up3) {
6717
6639
  parts.splice(i, 1);
6718
- up--;
6640
+ up3--;
6719
6641
  }
6720
6642
  }
6721
6643
  if (allowAboveRoot) {
6722
- for (; up; up--) {
6644
+ for (; up3; up3--) {
6723
6645
  parts.unshift("..");
6724
6646
  }
6725
6647
  }
6726
6648
  return parts;
6727
6649
  }, "normalizeArray"),
6728
- normalize: /* @__PURE__ */ __name(function(path4) {
6729
- var isAbsolute2 = path4.charAt(0) === "/", trailingSlash = path4.substr(-1) === "/";
6730
- path4 = PATH.normalizeArray(
6731
- path4.split("/").filter(function(p) {
6650
+ normalize: /* @__PURE__ */ __name(function(path) {
6651
+ var isAbsolute2 = path.charAt(0) === "/", trailingSlash = path.substr(-1) === "/";
6652
+ path = PATH.normalizeArray(
6653
+ path.split("/").filter(function(p) {
6732
6654
  return !!p;
6733
6655
  }),
6734
6656
  !isAbsolute2
6735
6657
  ).join("/");
6736
- if (!path4 && !isAbsolute2) {
6737
- path4 = ".";
6658
+ if (!path && !isAbsolute2) {
6659
+ path = ".";
6738
6660
  }
6739
- if (path4 && trailingSlash) {
6740
- path4 += "/";
6661
+ if (path && trailingSlash) {
6662
+ path += "/";
6741
6663
  }
6742
- return (isAbsolute2 ? "/" : "") + path4;
6664
+ return (isAbsolute2 ? "/" : "") + path;
6743
6665
  }, "normalize"),
6744
- dirname: /* @__PURE__ */ __name(function(path4) {
6745
- var result = PATH.splitPath(path4), root = result[0], dir = result[1];
6666
+ dirname: /* @__PURE__ */ __name(function(path) {
6667
+ var result = PATH.splitPath(path), root = result[0], dir = result[1];
6746
6668
  if (!root && !dir) {
6747
6669
  return ".";
6748
6670
  }
@@ -6751,16 +6673,16 @@ var require_libzipSync = __commonJS({
6751
6673
  }
6752
6674
  return root + dir;
6753
6675
  }, "dirname"),
6754
- basename: /* @__PURE__ */ __name(function(path4) {
6755
- if (path4 === "/") return "/";
6756
- path4 = PATH.normalize(path4);
6757
- path4 = path4.replace(/\/$/, "");
6758
- var lastSlash = path4.lastIndexOf("/");
6759
- if (lastSlash === -1) return path4;
6760
- return path4.substr(lastSlash + 1);
6676
+ basename: /* @__PURE__ */ __name(function(path) {
6677
+ if (path === "/") return "/";
6678
+ path = PATH.normalize(path);
6679
+ path = path.replace(/\/$/, "");
6680
+ var lastSlash = path.lastIndexOf("/");
6681
+ if (lastSlash === -1) return path;
6682
+ return path.substr(lastSlash + 1);
6761
6683
  }, "basename"),
6762
- extname: /* @__PURE__ */ __name(function(path4) {
6763
- return PATH.splitPath(path4)[3];
6684
+ extname: /* @__PURE__ */ __name(function(path) {
6685
+ return PATH.splitPath(path)[3];
6764
6686
  }, "extname"),
6765
6687
  join: /* @__PURE__ */ __name(function() {
6766
6688
  var paths = Array.prototype.slice.call(arguments, 0);
@@ -6795,14 +6717,14 @@ var require_libzipSync = __commonJS({
6795
6717
  resolve: /* @__PURE__ */ __name(function() {
6796
6718
  var resolvedPath = "", resolvedAbsolute = false;
6797
6719
  for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
6798
- var path4 = i >= 0 ? arguments[i] : FS.cwd();
6799
- if (typeof path4 !== "string") {
6720
+ var path = i >= 0 ? arguments[i] : FS.cwd();
6721
+ if (typeof path !== "string") {
6800
6722
  throw new TypeError("Arguments to path.resolve must be strings");
6801
- } else if (!path4) {
6723
+ } else if (!path) {
6802
6724
  return "";
6803
6725
  }
6804
- resolvedPath = path4 + "/" + resolvedPath;
6805
- resolvedAbsolute = path4.charAt(0) === "/";
6726
+ resolvedPath = path + "/" + resolvedPath;
6727
+ resolvedAbsolute = path.charAt(0) === "/";
6806
6728
  }
6807
6729
  resolvedPath = PATH.normalizeArray(
6808
6730
  resolvedPath.split("/").filter(function(p) {
@@ -6812,8 +6734,8 @@ var require_libzipSync = __commonJS({
6812
6734
  ).join("/");
6813
6735
  return (resolvedAbsolute ? "/" : "") + resolvedPath || ".";
6814
6736
  }, "resolve"),
6815
- relative: /* @__PURE__ */ __name(function(from, to) {
6816
- from = PATH_FS.resolve(from).substr(1);
6737
+ relative: /* @__PURE__ */ __name(function(from2, to) {
6738
+ from2 = PATH_FS.resolve(from2).substr(1);
6817
6739
  to = PATH_FS.resolve(to).substr(1);
6818
6740
  function trim(arr) {
6819
6741
  var start = 0;
@@ -6828,7 +6750,7 @@ var require_libzipSync = __commonJS({
6828
6750
  return arr.slice(start, end - start + 1);
6829
6751
  }
6830
6752
  __name(trim, "trim");
6831
- var fromParts = trim(from.split("/"));
6753
+ var fromParts = trim(from2.split("/"));
6832
6754
  var toParts = trim(to.split("/"));
6833
6755
  var length = Math.min(fromParts.length, toParts.length);
6834
6756
  var samePartsLength = length;
@@ -7459,7 +7381,7 @@ var require_libzipSync = __commonJS({
7459
7381
  isWindows: false,
7460
7382
  staticInit: /* @__PURE__ */ __name(function() {
7461
7383
  NODEFS.isWindows = !!process.platform.match(/^win/);
7462
- var flags = { fs: fs2.constants };
7384
+ var flags = { fs: fs.constants };
7463
7385
  if (flags["fs"]) {
7464
7386
  flags = flags["fs"];
7465
7387
  }
@@ -7494,10 +7416,10 @@ var require_libzipSync = __commonJS({
7494
7416
  node.stream_ops = NODEFS.stream_ops;
7495
7417
  return node;
7496
7418
  }, "createNode"),
7497
- getMode: /* @__PURE__ */ __name(function(path4) {
7419
+ getMode: /* @__PURE__ */ __name(function(path) {
7498
7420
  var stat;
7499
7421
  try {
7500
- stat = fs2.lstatSync(path4);
7422
+ stat = fs.lstatSync(path);
7501
7423
  if (NODEFS.isWindows) {
7502
7424
  stat.mode = stat.mode | (stat.mode & 292) >> 2;
7503
7425
  }
@@ -7537,10 +7459,10 @@ var require_libzipSync = __commonJS({
7537
7459
  }, "flagsForNode"),
7538
7460
  node_ops: {
7539
7461
  getattr: /* @__PURE__ */ __name(function(node) {
7540
- var path4 = NODEFS.realPath(node);
7462
+ var path = NODEFS.realPath(node);
7541
7463
  var stat;
7542
7464
  try {
7543
- stat = fs2.lstatSync(path4);
7465
+ stat = fs.lstatSync(path);
7544
7466
  } catch (e) {
7545
7467
  if (!e.code) throw e;
7546
7468
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
@@ -7568,18 +7490,18 @@ var require_libzipSync = __commonJS({
7568
7490
  };
7569
7491
  }, "getattr"),
7570
7492
  setattr: /* @__PURE__ */ __name(function(node, attr) {
7571
- var path4 = NODEFS.realPath(node);
7493
+ var path = NODEFS.realPath(node);
7572
7494
  try {
7573
7495
  if (attr.mode !== void 0) {
7574
- fs2.chmodSync(path4, attr.mode);
7496
+ fs.chmodSync(path, attr.mode);
7575
7497
  node.mode = attr.mode;
7576
7498
  }
7577
7499
  if (attr.timestamp !== void 0) {
7578
7500
  var date = new Date(attr.timestamp);
7579
- fs2.utimesSync(path4, date, date);
7501
+ fs.utimesSync(path, date, date);
7580
7502
  }
7581
7503
  if (attr.size !== void 0) {
7582
- fs2.truncateSync(path4, attr.size);
7504
+ fs.truncateSync(path, attr.size);
7583
7505
  }
7584
7506
  } catch (e) {
7585
7507
  if (!e.code) throw e;
@@ -7587,18 +7509,18 @@ var require_libzipSync = __commonJS({
7587
7509
  }
7588
7510
  }, "setattr"),
7589
7511
  lookup: /* @__PURE__ */ __name(function(parent, name) {
7590
- var path4 = PATH.join2(NODEFS.realPath(parent), name);
7591
- var mode = NODEFS.getMode(path4);
7512
+ var path = PATH.join2(NODEFS.realPath(parent), name);
7513
+ var mode = NODEFS.getMode(path);
7592
7514
  return NODEFS.createNode(parent, name, mode);
7593
7515
  }, "lookup"),
7594
7516
  mknod: /* @__PURE__ */ __name(function(parent, name, mode, dev) {
7595
7517
  var node = NODEFS.createNode(parent, name, mode, dev);
7596
- var path4 = NODEFS.realPath(node);
7518
+ var path = NODEFS.realPath(node);
7597
7519
  try {
7598
7520
  if (FS.isDir(node.mode)) {
7599
- fs2.mkdirSync(path4, node.mode);
7521
+ fs.mkdirSync(path, node.mode);
7600
7522
  } else {
7601
- fs2.writeFileSync(path4, "", { mode: node.mode });
7523
+ fs.writeFileSync(path, "", { mode: node.mode });
7602
7524
  }
7603
7525
  } catch (e) {
7604
7526
  if (!e.code) throw e;
@@ -7610,7 +7532,7 @@ var require_libzipSync = __commonJS({
7610
7532
  var oldPath = NODEFS.realPath(oldNode);
7611
7533
  var newPath = PATH.join2(NODEFS.realPath(newDir), newName);
7612
7534
  try {
7613
- fs2.renameSync(oldPath, newPath);
7535
+ fs.renameSync(oldPath, newPath);
7614
7536
  } catch (e) {
7615
7537
  if (!e.code) throw e;
7616
7538
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
@@ -7618,27 +7540,27 @@ var require_libzipSync = __commonJS({
7618
7540
  oldNode.name = newName;
7619
7541
  }, "rename"),
7620
7542
  unlink: /* @__PURE__ */ __name(function(parent, name) {
7621
- var path4 = PATH.join2(NODEFS.realPath(parent), name);
7543
+ var path = PATH.join2(NODEFS.realPath(parent), name);
7622
7544
  try {
7623
- fs2.unlinkSync(path4);
7545
+ fs.unlinkSync(path);
7624
7546
  } catch (e) {
7625
7547
  if (!e.code) throw e;
7626
7548
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
7627
7549
  }
7628
7550
  }, "unlink"),
7629
7551
  rmdir: /* @__PURE__ */ __name(function(parent, name) {
7630
- var path4 = PATH.join2(NODEFS.realPath(parent), name);
7552
+ var path = PATH.join2(NODEFS.realPath(parent), name);
7631
7553
  try {
7632
- fs2.rmdirSync(path4);
7554
+ fs.rmdirSync(path);
7633
7555
  } catch (e) {
7634
7556
  if (!e.code) throw e;
7635
7557
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
7636
7558
  }
7637
7559
  }, "rmdir"),
7638
7560
  readdir: /* @__PURE__ */ __name(function(node) {
7639
- var path4 = NODEFS.realPath(node);
7561
+ var path = NODEFS.realPath(node);
7640
7562
  try {
7641
- return fs2.readdirSync(path4);
7563
+ return fs.readdirSync(path);
7642
7564
  } catch (e) {
7643
7565
  if (!e.code) throw e;
7644
7566
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
@@ -7647,21 +7569,21 @@ var require_libzipSync = __commonJS({
7647
7569
  symlink: /* @__PURE__ */ __name(function(parent, newName, oldPath) {
7648
7570
  var newPath = PATH.join2(NODEFS.realPath(parent), newName);
7649
7571
  try {
7650
- fs2.symlinkSync(oldPath, newPath);
7572
+ fs.symlinkSync(oldPath, newPath);
7651
7573
  } catch (e) {
7652
7574
  if (!e.code) throw e;
7653
7575
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
7654
7576
  }
7655
7577
  }, "symlink"),
7656
7578
  readlink: /* @__PURE__ */ __name(function(node) {
7657
- var path4 = NODEFS.realPath(node);
7579
+ var path = NODEFS.realPath(node);
7658
7580
  try {
7659
- path4 = fs2.readlinkSync(path4);
7660
- path4 = NODEJS_PATH.relative(
7581
+ path = fs.readlinkSync(path);
7582
+ path = NODEJS_PATH.relative(
7661
7583
  NODEJS_PATH.resolve(node.mount.opts.root),
7662
- path4
7584
+ path
7663
7585
  );
7664
- return path4;
7586
+ return path;
7665
7587
  } catch (e) {
7666
7588
  if (!e.code) throw e;
7667
7589
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
@@ -7670,10 +7592,10 @@ var require_libzipSync = __commonJS({
7670
7592
  },
7671
7593
  stream_ops: {
7672
7594
  open: /* @__PURE__ */ __name(function(stream) {
7673
- var path4 = NODEFS.realPath(stream.node);
7595
+ var path = NODEFS.realPath(stream.node);
7674
7596
  try {
7675
7597
  if (FS.isFile(stream.node.mode)) {
7676
- stream.nfd = fs2.openSync(path4, NODEFS.flagsForNode(stream.flags));
7598
+ stream.nfd = fs.openSync(path, NODEFS.flagsForNode(stream.flags));
7677
7599
  }
7678
7600
  } catch (e) {
7679
7601
  if (!e.code) throw e;
@@ -7683,7 +7605,7 @@ var require_libzipSync = __commonJS({
7683
7605
  close: /* @__PURE__ */ __name(function(stream) {
7684
7606
  try {
7685
7607
  if (FS.isFile(stream.node.mode) && stream.nfd) {
7686
- fs2.closeSync(stream.nfd);
7608
+ fs.closeSync(stream.nfd);
7687
7609
  }
7688
7610
  } catch (e) {
7689
7611
  if (!e.code) throw e;
@@ -7693,7 +7615,7 @@ var require_libzipSync = __commonJS({
7693
7615
  read: /* @__PURE__ */ __name(function(stream, buffer2, offset, length, position) {
7694
7616
  if (length === 0) return 0;
7695
7617
  try {
7696
- return fs2.readSync(
7618
+ return fs.readSync(
7697
7619
  stream.nfd,
7698
7620
  NODEFS.bufferFrom(buffer2.buffer),
7699
7621
  offset,
@@ -7706,7 +7628,7 @@ var require_libzipSync = __commonJS({
7706
7628
  }, "read"),
7707
7629
  write: /* @__PURE__ */ __name(function(stream, buffer2, offset, length, position) {
7708
7630
  try {
7709
- return fs2.writeSync(
7631
+ return fs.writeSync(
7710
7632
  stream.nfd,
7711
7633
  NODEFS.bufferFrom(buffer2.buffer),
7712
7634
  offset,
@@ -7724,7 +7646,7 @@ var require_libzipSync = __commonJS({
7724
7646
  } else if (whence === 2) {
7725
7647
  if (FS.isFile(stream.node.mode)) {
7726
7648
  try {
7727
- var stat = fs2.fstatSync(stream.nfd);
7649
+ var stat = fs.fstatSync(stream.nfd);
7728
7650
  position += stat.size;
7729
7651
  } catch (e) {
7730
7652
  throw new FS.ErrnoError(NODEFS.convertNodeCode(e));
@@ -7767,8 +7689,8 @@ var require_libzipSync = __commonJS({
7767
7689
  }
7768
7690
  };
7769
7691
  var NODERAWFS = {
7770
- lookupPath: /* @__PURE__ */ __name(function(path4) {
7771
- return { path: path4, node: { mode: NODEFS.getMode(path4) } };
7692
+ lookupPath: /* @__PURE__ */ __name(function(path) {
7693
+ return { path, node: { mode: NODEFS.getMode(path) } };
7772
7694
  }, "lookupPath"),
7773
7695
  createStandardStreams: /* @__PURE__ */ __name(function() {
7774
7696
  FS.streams[0] = {
@@ -7798,75 +7720,75 @@ var require_libzipSync = __commonJS({
7798
7720
  chdir: /* @__PURE__ */ __name(function() {
7799
7721
  process.chdir.apply(void 0, arguments);
7800
7722
  }, "chdir"),
7801
- mknod: /* @__PURE__ */ __name(function(path4, mode) {
7802
- if (FS.isDir(path4)) {
7803
- fs2.mkdirSync(path4, mode);
7723
+ mknod: /* @__PURE__ */ __name(function(path, mode) {
7724
+ if (FS.isDir(path)) {
7725
+ fs.mkdirSync(path, mode);
7804
7726
  } else {
7805
- fs2.writeFileSync(path4, "", { mode });
7727
+ fs.writeFileSync(path, "", { mode });
7806
7728
  }
7807
7729
  }, "mknod"),
7808
7730
  mkdir: /* @__PURE__ */ __name(function() {
7809
- fs2.mkdirSync.apply(void 0, arguments);
7731
+ fs.mkdirSync.apply(void 0, arguments);
7810
7732
  }, "mkdir"),
7811
7733
  symlink: /* @__PURE__ */ __name(function() {
7812
- fs2.symlinkSync.apply(void 0, arguments);
7734
+ fs.symlinkSync.apply(void 0, arguments);
7813
7735
  }, "symlink"),
7814
7736
  rename: /* @__PURE__ */ __name(function() {
7815
- fs2.renameSync.apply(void 0, arguments);
7737
+ fs.renameSync.apply(void 0, arguments);
7816
7738
  }, "rename"),
7817
7739
  rmdir: /* @__PURE__ */ __name(function() {
7818
- fs2.rmdirSync.apply(void 0, arguments);
7740
+ fs.rmdirSync.apply(void 0, arguments);
7819
7741
  }, "rmdir"),
7820
7742
  readdir: /* @__PURE__ */ __name(function() {
7821
- fs2.readdirSync.apply(void 0, arguments);
7743
+ fs.readdirSync.apply(void 0, arguments);
7822
7744
  }, "readdir"),
7823
7745
  unlink: /* @__PURE__ */ __name(function() {
7824
- fs2.unlinkSync.apply(void 0, arguments);
7746
+ fs.unlinkSync.apply(void 0, arguments);
7825
7747
  }, "unlink"),
7826
7748
  readlink: /* @__PURE__ */ __name(function() {
7827
- return fs2.readlinkSync.apply(void 0, arguments);
7749
+ return fs.readlinkSync.apply(void 0, arguments);
7828
7750
  }, "readlink"),
7829
7751
  stat: /* @__PURE__ */ __name(function() {
7830
- return fs2.statSync.apply(void 0, arguments);
7752
+ return fs.statSync.apply(void 0, arguments);
7831
7753
  }, "stat"),
7832
7754
  lstat: /* @__PURE__ */ __name(function() {
7833
- return fs2.lstatSync.apply(void 0, arguments);
7755
+ return fs.lstatSync.apply(void 0, arguments);
7834
7756
  }, "lstat"),
7835
7757
  chmod: /* @__PURE__ */ __name(function() {
7836
- fs2.chmodSync.apply(void 0, arguments);
7758
+ fs.chmodSync.apply(void 0, arguments);
7837
7759
  }, "chmod"),
7838
7760
  fchmod: /* @__PURE__ */ __name(function() {
7839
- fs2.fchmodSync.apply(void 0, arguments);
7761
+ fs.fchmodSync.apply(void 0, arguments);
7840
7762
  }, "fchmod"),
7841
7763
  chown: /* @__PURE__ */ __name(function() {
7842
- fs2.chownSync.apply(void 0, arguments);
7764
+ fs.chownSync.apply(void 0, arguments);
7843
7765
  }, "chown"),
7844
7766
  fchown: /* @__PURE__ */ __name(function() {
7845
- fs2.fchownSync.apply(void 0, arguments);
7767
+ fs.fchownSync.apply(void 0, arguments);
7846
7768
  }, "fchown"),
7847
7769
  truncate: /* @__PURE__ */ __name(function() {
7848
- fs2.truncateSync.apply(void 0, arguments);
7770
+ fs.truncateSync.apply(void 0, arguments);
7849
7771
  }, "truncate"),
7850
7772
  ftruncate: /* @__PURE__ */ __name(function(fd, len) {
7851
7773
  if (len < 0) {
7852
7774
  throw new FS.ErrnoError(28);
7853
7775
  }
7854
- fs2.ftruncateSync.apply(void 0, arguments);
7776
+ fs.ftruncateSync.apply(void 0, arguments);
7855
7777
  }, "ftruncate"),
7856
7778
  utime: /* @__PURE__ */ __name(function() {
7857
- fs2.utimesSync.apply(void 0, arguments);
7779
+ fs.utimesSync.apply(void 0, arguments);
7858
7780
  }, "utime"),
7859
- open: /* @__PURE__ */ __name(function(path4, flags, mode, suggestFD) {
7781
+ open: /* @__PURE__ */ __name(function(path, flags, mode, suggestFD) {
7860
7782
  if (typeof flags === "string") {
7861
7783
  flags = VFS.modeStringToFlags(flags);
7862
7784
  }
7863
- var nfd = fs2.openSync(path4, NODEFS.flagsForNode(flags), mode);
7785
+ var nfd = fs.openSync(path, NODEFS.flagsForNode(flags), mode);
7864
7786
  var fd = suggestFD != null ? suggestFD : FS.nextfd(nfd);
7865
7787
  var stream = {
7866
7788
  fd,
7867
7789
  nfd,
7868
7790
  position: 0,
7869
- path: path4,
7791
+ path,
7870
7792
  flags,
7871
7793
  seekable: true
7872
7794
  };
@@ -7875,7 +7797,7 @@ var require_libzipSync = __commonJS({
7875
7797
  }, "open"),
7876
7798
  close: /* @__PURE__ */ __name(function(stream) {
7877
7799
  if (!stream.stream_ops) {
7878
- fs2.closeSync(stream.nfd);
7800
+ fs.closeSync(stream.nfd);
7879
7801
  }
7880
7802
  FS.closeStream(stream.fd);
7881
7803
  }, "close"),
@@ -7887,7 +7809,7 @@ var require_libzipSync = __commonJS({
7887
7809
  if (whence === 1) {
7888
7810
  position += stream.position;
7889
7811
  } else if (whence === 2) {
7890
- position += fs2.fstatSync(stream.nfd).size;
7812
+ position += fs.fstatSync(stream.nfd).size;
7891
7813
  } else if (whence !== 0) {
7892
7814
  throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
7893
7815
  }
@@ -7903,7 +7825,7 @@ var require_libzipSync = __commonJS({
7903
7825
  }
7904
7826
  var seeking = typeof position !== "undefined";
7905
7827
  if (!seeking && stream.seekable) position = stream.position;
7906
- var bytesRead = fs2.readSync(
7828
+ var bytesRead = fs.readSync(
7907
7829
  stream.nfd,
7908
7830
  NODEFS.bufferFrom(buffer2.buffer),
7909
7831
  offset,
@@ -7922,7 +7844,7 @@ var require_libzipSync = __commonJS({
7922
7844
  }
7923
7845
  var seeking = typeof position !== "undefined";
7924
7846
  if (!seeking && stream.seekable) position = stream.position;
7925
- var bytesWritten = fs2.writeSync(
7847
+ var bytesWritten = fs.writeSync(
7926
7848
  stream.nfd,
7927
7849
  NODEFS.bufferFrom(buffer2.buffer),
7928
7850
  offset,
@@ -7979,10 +7901,10 @@ var require_libzipSync = __commonJS({
7979
7901
  genericErrors: {},
7980
7902
  filesystems: null,
7981
7903
  syncFSRequests: 0,
7982
- lookupPath: /* @__PURE__ */ __name(function(path4, opts) {
7983
- path4 = PATH_FS.resolve(FS.cwd(), path4);
7904
+ lookupPath: /* @__PURE__ */ __name(function(path, opts) {
7905
+ path = PATH_FS.resolve(FS.cwd(), path);
7984
7906
  opts = opts || {};
7985
- if (!path4) return { path: "", node: null };
7907
+ if (!path) return { path: "", node: null };
7986
7908
  var defaults = { follow_mount: true, recurse_count: 0 };
7987
7909
  for (var key2 in defaults) {
7988
7910
  if (opts[key2] === void 0) {
@@ -7993,7 +7915,7 @@ var require_libzipSync = __commonJS({
7993
7915
  throw new FS.ErrnoError(32);
7994
7916
  }
7995
7917
  var parts = PATH.normalizeArray(
7996
- path4.split("/").filter(function(p) {
7918
+ path.split("/").filter(function(p) {
7997
7919
  return !!p;
7998
7920
  }),
7999
7921
  false
@@ -8030,14 +7952,14 @@ var require_libzipSync = __commonJS({
8030
7952
  return { path: current_path, node: current };
8031
7953
  }, "lookupPath"),
8032
7954
  getPath: /* @__PURE__ */ __name(function(node) {
8033
- var path4;
7955
+ var path;
8034
7956
  while (true) {
8035
7957
  if (FS.isRoot(node)) {
8036
7958
  var mount = node.mount.mountpoint;
8037
- if (!path4) return mount;
8038
- return mount[mount.length - 1] !== "/" ? mount + "/" + path4 : mount + path4;
7959
+ if (!path) return mount;
7960
+ return mount[mount.length - 1] !== "/" ? mount + "/" + path : mount + path;
8039
7961
  }
8040
- path4 = path4 ? node.name + "/" + path4 : node.name;
7962
+ path = path ? node.name + "/" + path : node.name;
8041
7963
  node = node.parent;
8042
7964
  }
8043
7965
  }, "getPath"),
@@ -8390,10 +8312,10 @@ var require_libzipSync = __commonJS({
8390
8312
  lookup: /* @__PURE__ */ __name(function(parent, name) {
8391
8313
  return parent.node_ops.lookup(parent, name);
8392
8314
  }, "lookup"),
8393
- mknod: /* @__PURE__ */ __name(function(path4, mode, dev) {
8394
- var lookup = FS.lookupPath(path4, { parent: true });
8315
+ mknod: /* @__PURE__ */ __name(function(path, mode, dev) {
8316
+ var lookup = FS.lookupPath(path, { parent: true });
8395
8317
  var parent = lookup.node;
8396
- var name = PATH.basename(path4);
8318
+ var name = PATH.basename(path);
8397
8319
  if (!name || name === "." || name === "..") {
8398
8320
  throw new FS.ErrnoError(28);
8399
8321
  }
@@ -8406,20 +8328,20 @@ var require_libzipSync = __commonJS({
8406
8328
  }
8407
8329
  return parent.node_ops.mknod(parent, name, mode, dev);
8408
8330
  }, "mknod"),
8409
- create: /* @__PURE__ */ __name(function(path4, mode) {
8331
+ create: /* @__PURE__ */ __name(function(path, mode) {
8410
8332
  mode = mode !== void 0 ? mode : 438;
8411
8333
  mode &= 4095;
8412
8334
  mode |= 32768;
8413
- return FS.mknod(path4, mode, 0);
8335
+ return FS.mknod(path, mode, 0);
8414
8336
  }, "create"),
8415
- mkdir: /* @__PURE__ */ __name(function(path4, mode) {
8337
+ mkdir: /* @__PURE__ */ __name(function(path, mode) {
8416
8338
  mode = mode !== void 0 ? mode : 511;
8417
8339
  mode &= 511 | 512;
8418
8340
  mode |= 16384;
8419
- return FS.mknod(path4, mode, 0);
8341
+ return FS.mknod(path, mode, 0);
8420
8342
  }, "mkdir"),
8421
- mkdirTree: /* @__PURE__ */ __name(function(path4, mode) {
8422
- var dirs = path4.split("/");
8343
+ mkdirTree: /* @__PURE__ */ __name(function(path, mode) {
8344
+ var dirs = path.split("/");
8423
8345
  var d = "";
8424
8346
  for (var i = 0; i < dirs.length; ++i) {
8425
8347
  if (!dirs[i]) continue;
@@ -8431,13 +8353,13 @@ var require_libzipSync = __commonJS({
8431
8353
  }
8432
8354
  }
8433
8355
  }, "mkdirTree"),
8434
- mkdev: /* @__PURE__ */ __name(function(path4, mode, dev) {
8356
+ mkdev: /* @__PURE__ */ __name(function(path, mode, dev) {
8435
8357
  if (typeof dev === "undefined") {
8436
8358
  dev = mode;
8437
8359
  mode = 438;
8438
8360
  }
8439
8361
  mode |= 8192;
8440
- return FS.mknod(path4, mode, dev);
8362
+ return FS.mknod(path, mode, dev);
8441
8363
  }, "mkdev"),
8442
8364
  symlink: /* @__PURE__ */ __name(function(oldpath, newpath) {
8443
8365
  if (!PATH_FS.resolve(oldpath)) {
@@ -8536,10 +8458,10 @@ var require_libzipSync = __commonJS({
8536
8458
  );
8537
8459
  }
8538
8460
  }, "rename"),
8539
- rmdir: /* @__PURE__ */ __name(function(path4) {
8540
- var lookup = FS.lookupPath(path4, { parent: true });
8461
+ rmdir: /* @__PURE__ */ __name(function(path) {
8462
+ var lookup = FS.lookupPath(path, { parent: true });
8541
8463
  var parent = lookup.node;
8542
- var name = PATH.basename(path4);
8464
+ var name = PATH.basename(path);
8543
8465
  var node = FS.lookupNode(parent, name);
8544
8466
  var errCode = FS.mayDelete(parent, name, true);
8545
8467
  if (errCode) {
@@ -8553,36 +8475,36 @@ var require_libzipSync = __commonJS({
8553
8475
  }
8554
8476
  try {
8555
8477
  if (FS.trackingDelegate["willDeletePath"]) {
8556
- FS.trackingDelegate["willDeletePath"](path4);
8478
+ FS.trackingDelegate["willDeletePath"](path);
8557
8479
  }
8558
8480
  } catch (e) {
8559
8481
  err(
8560
- "FS.trackingDelegate['willDeletePath']('" + path4 + "') threw an exception: " + e.message
8482
+ "FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message
8561
8483
  );
8562
8484
  }
8563
8485
  parent.node_ops.rmdir(parent, name);
8564
8486
  FS.destroyNode(node);
8565
8487
  try {
8566
8488
  if (FS.trackingDelegate["onDeletePath"])
8567
- FS.trackingDelegate["onDeletePath"](path4);
8489
+ FS.trackingDelegate["onDeletePath"](path);
8568
8490
  } catch (e) {
8569
8491
  err(
8570
- "FS.trackingDelegate['onDeletePath']('" + path4 + "') threw an exception: " + e.message
8492
+ "FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message
8571
8493
  );
8572
8494
  }
8573
8495
  }, "rmdir"),
8574
- readdir: /* @__PURE__ */ __name(function(path4) {
8575
- var lookup = FS.lookupPath(path4, { follow: true });
8496
+ readdir: /* @__PURE__ */ __name(function(path) {
8497
+ var lookup = FS.lookupPath(path, { follow: true });
8576
8498
  var node = lookup.node;
8577
8499
  if (!node.node_ops.readdir) {
8578
8500
  throw new FS.ErrnoError(54);
8579
8501
  }
8580
8502
  return node.node_ops.readdir(node);
8581
8503
  }, "readdir"),
8582
- unlink: /* @__PURE__ */ __name(function(path4) {
8583
- var lookup = FS.lookupPath(path4, { parent: true });
8504
+ unlink: /* @__PURE__ */ __name(function(path) {
8505
+ var lookup = FS.lookupPath(path, { parent: true });
8584
8506
  var parent = lookup.node;
8585
- var name = PATH.basename(path4);
8507
+ var name = PATH.basename(path);
8586
8508
  var node = FS.lookupNode(parent, name);
8587
8509
  var errCode = FS.mayDelete(parent, name, false);
8588
8510
  if (errCode) {
@@ -8596,26 +8518,26 @@ var require_libzipSync = __commonJS({
8596
8518
  }
8597
8519
  try {
8598
8520
  if (FS.trackingDelegate["willDeletePath"]) {
8599
- FS.trackingDelegate["willDeletePath"](path4);
8521
+ FS.trackingDelegate["willDeletePath"](path);
8600
8522
  }
8601
8523
  } catch (e) {
8602
8524
  err(
8603
- "FS.trackingDelegate['willDeletePath']('" + path4 + "') threw an exception: " + e.message
8525
+ "FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message
8604
8526
  );
8605
8527
  }
8606
8528
  parent.node_ops.unlink(parent, name);
8607
8529
  FS.destroyNode(node);
8608
8530
  try {
8609
8531
  if (FS.trackingDelegate["onDeletePath"])
8610
- FS.trackingDelegate["onDeletePath"](path4);
8532
+ FS.trackingDelegate["onDeletePath"](path);
8611
8533
  } catch (e) {
8612
8534
  err(
8613
- "FS.trackingDelegate['onDeletePath']('" + path4 + "') threw an exception: " + e.message
8535
+ "FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message
8614
8536
  );
8615
8537
  }
8616
8538
  }, "unlink"),
8617
- readlink: /* @__PURE__ */ __name(function(path4) {
8618
- var lookup = FS.lookupPath(path4);
8539
+ readlink: /* @__PURE__ */ __name(function(path) {
8540
+ var lookup = FS.lookupPath(path);
8619
8541
  var link = lookup.node;
8620
8542
  if (!link) {
8621
8543
  throw new FS.ErrnoError(44);
@@ -8628,8 +8550,8 @@ var require_libzipSync = __commonJS({
8628
8550
  link.node_ops.readlink(link)
8629
8551
  );
8630
8552
  }, "readlink"),
8631
- stat: /* @__PURE__ */ __name(function(path4, dontFollow) {
8632
- var lookup = FS.lookupPath(path4, { follow: !dontFollow });
8553
+ stat: /* @__PURE__ */ __name(function(path, dontFollow) {
8554
+ var lookup = FS.lookupPath(path, { follow: !dontFollow });
8633
8555
  var node = lookup.node;
8634
8556
  if (!node) {
8635
8557
  throw new FS.ErrnoError(44);
@@ -8639,16 +8561,16 @@ var require_libzipSync = __commonJS({
8639
8561
  }
8640
8562
  return node.node_ops.getattr(node);
8641
8563
  }, "stat"),
8642
- lstat: /* @__PURE__ */ __name(function(path4) {
8643
- return FS.stat(path4, true);
8564
+ lstat: /* @__PURE__ */ __name(function(path) {
8565
+ return FS.stat(path, true);
8644
8566
  }, "lstat"),
8645
- chmod: /* @__PURE__ */ __name(function(path4, mode, dontFollow) {
8567
+ chmod: /* @__PURE__ */ __name(function(path, mode, dontFollow) {
8646
8568
  var node;
8647
- if (typeof path4 === "string") {
8648
- var lookup = FS.lookupPath(path4, { follow: !dontFollow });
8569
+ if (typeof path === "string") {
8570
+ var lookup = FS.lookupPath(path, { follow: !dontFollow });
8649
8571
  node = lookup.node;
8650
8572
  } else {
8651
- node = path4;
8573
+ node = path;
8652
8574
  }
8653
8575
  if (!node.node_ops.setattr) {
8654
8576
  throw new FS.ErrnoError(63);
@@ -8658,8 +8580,8 @@ var require_libzipSync = __commonJS({
8658
8580
  timestamp: Date.now()
8659
8581
  });
8660
8582
  }, "chmod"),
8661
- lchmod: /* @__PURE__ */ __name(function(path4, mode) {
8662
- FS.chmod(path4, mode, true);
8583
+ lchmod: /* @__PURE__ */ __name(function(path, mode) {
8584
+ FS.chmod(path, mode, true);
8663
8585
  }, "lchmod"),
8664
8586
  fchmod: /* @__PURE__ */ __name(function(fd, mode) {
8665
8587
  var stream = FS.getStream(fd);
@@ -8668,21 +8590,21 @@ var require_libzipSync = __commonJS({
8668
8590
  }
8669
8591
  FS.chmod(stream.node, mode);
8670
8592
  }, "fchmod"),
8671
- chown: /* @__PURE__ */ __name(function(path4, uid, gid, dontFollow) {
8593
+ chown: /* @__PURE__ */ __name(function(path, uid, gid, dontFollow) {
8672
8594
  var node;
8673
- if (typeof path4 === "string") {
8674
- var lookup = FS.lookupPath(path4, { follow: !dontFollow });
8595
+ if (typeof path === "string") {
8596
+ var lookup = FS.lookupPath(path, { follow: !dontFollow });
8675
8597
  node = lookup.node;
8676
8598
  } else {
8677
- node = path4;
8599
+ node = path;
8678
8600
  }
8679
8601
  if (!node.node_ops.setattr) {
8680
8602
  throw new FS.ErrnoError(63);
8681
8603
  }
8682
8604
  node.node_ops.setattr(node, { timestamp: Date.now() });
8683
8605
  }, "chown"),
8684
- lchown: /* @__PURE__ */ __name(function(path4, uid, gid) {
8685
- FS.chown(path4, uid, gid, true);
8606
+ lchown: /* @__PURE__ */ __name(function(path, uid, gid) {
8607
+ FS.chown(path, uid, gid, true);
8686
8608
  }, "lchown"),
8687
8609
  fchown: /* @__PURE__ */ __name(function(fd, uid, gid) {
8688
8610
  var stream = FS.getStream(fd);
@@ -8691,16 +8613,16 @@ var require_libzipSync = __commonJS({
8691
8613
  }
8692
8614
  FS.chown(stream.node, uid, gid);
8693
8615
  }, "fchown"),
8694
- truncate: /* @__PURE__ */ __name(function(path4, len) {
8616
+ truncate: /* @__PURE__ */ __name(function(path, len) {
8695
8617
  if (len < 0) {
8696
8618
  throw new FS.ErrnoError(28);
8697
8619
  }
8698
8620
  var node;
8699
- if (typeof path4 === "string") {
8700
- var lookup = FS.lookupPath(path4, { follow: true });
8621
+ if (typeof path === "string") {
8622
+ var lookup = FS.lookupPath(path, { follow: true });
8701
8623
  node = lookup.node;
8702
8624
  } else {
8703
- node = path4;
8625
+ node = path;
8704
8626
  }
8705
8627
  if (!node.node_ops.setattr) {
8706
8628
  throw new FS.ErrnoError(63);
@@ -8727,13 +8649,13 @@ var require_libzipSync = __commonJS({
8727
8649
  }
8728
8650
  FS.truncate(stream.node, len);
8729
8651
  }, "ftruncate"),
8730
- utime: /* @__PURE__ */ __name(function(path4, atime, mtime) {
8731
- var lookup = FS.lookupPath(path4, { follow: true });
8652
+ utime: /* @__PURE__ */ __name(function(path, atime, mtime) {
8653
+ var lookup = FS.lookupPath(path, { follow: true });
8732
8654
  var node = lookup.node;
8733
8655
  node.node_ops.setattr(node, { timestamp: Math.max(atime, mtime) });
8734
8656
  }, "utime"),
8735
- open: /* @__PURE__ */ __name(function(path4, flags, mode, fd_start, fd_end) {
8736
- if (path4 === "") {
8657
+ open: /* @__PURE__ */ __name(function(path, flags, mode, fd_start, fd_end) {
8658
+ if (path === "") {
8737
8659
  throw new FS.ErrnoError(44);
8738
8660
  }
8739
8661
  flags = typeof flags === "string" ? FS.modeStringToFlags(flags) : flags;
@@ -8744,12 +8666,12 @@ var require_libzipSync = __commonJS({
8744
8666
  mode = 0;
8745
8667
  }
8746
8668
  var node;
8747
- if (typeof path4 === "object") {
8748
- node = path4;
8669
+ if (typeof path === "object") {
8670
+ node = path;
8749
8671
  } else {
8750
- path4 = PATH.normalize(path4);
8672
+ path = PATH.normalize(path);
8751
8673
  try {
8752
- var lookup = FS.lookupPath(path4, { follow: !(flags & 131072) });
8674
+ var lookup = FS.lookupPath(path, { follow: !(flags & 131072) });
8753
8675
  node = lookup.node;
8754
8676
  } catch (e) {
8755
8677
  }
@@ -8761,7 +8683,7 @@ var require_libzipSync = __commonJS({
8761
8683
  throw new FS.ErrnoError(20);
8762
8684
  }
8763
8685
  } else {
8764
- node = FS.mknod(path4, mode, 0);
8686
+ node = FS.mknod(path, mode, 0);
8765
8687
  created = true;
8766
8688
  }
8767
8689
  }
@@ -8803,9 +8725,9 @@ var require_libzipSync = __commonJS({
8803
8725
  }
8804
8726
  if (Module["logReadFiles"] && !(flags & 1)) {
8805
8727
  if (!FS.readFiles) FS.readFiles = {};
8806
- if (!(path4 in FS.readFiles)) {
8807
- FS.readFiles[path4] = 1;
8808
- err("FS.trackingDelegate error on read file: " + path4);
8728
+ if (!(path in FS.readFiles)) {
8729
+ FS.readFiles[path] = 1;
8730
+ err("FS.trackingDelegate error on read file: " + path);
8809
8731
  }
8810
8732
  }
8811
8733
  try {
@@ -8817,11 +8739,11 @@ var require_libzipSync = __commonJS({
8817
8739
  if ((flags & 2097155) !== 0) {
8818
8740
  trackingFlags |= FS.tracking.openFlags.WRITE;
8819
8741
  }
8820
- FS.trackingDelegate["onOpenFile"](path4, trackingFlags);
8742
+ FS.trackingDelegate["onOpenFile"](path, trackingFlags);
8821
8743
  }
8822
8744
  } catch (e) {
8823
8745
  err(
8824
- "FS.trackingDelegate['onOpenFile']('" + path4 + "', flags) threw an exception: " + e.message
8746
+ "FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message
8825
8747
  );
8826
8748
  }
8827
8749
  return stream;
@@ -8993,7 +8915,7 @@ var require_libzipSync = __commonJS({
8993
8915
  }
8994
8916
  return stream.stream_ops.ioctl(stream, cmd, arg);
8995
8917
  }, "ioctl"),
8996
- readFile: /* @__PURE__ */ __name(function(path4, opts) {
8918
+ readFile: /* @__PURE__ */ __name(function(path, opts) {
8997
8919
  opts = opts || {};
8998
8920
  opts.flags = opts.flags || 0;
8999
8921
  opts.encoding = opts.encoding || "binary";
@@ -9001,8 +8923,8 @@ var require_libzipSync = __commonJS({
9001
8923
  throw new Error('Invalid encoding type "' + opts.encoding + '"');
9002
8924
  }
9003
8925
  var ret;
9004
- var stream = FS.open(path4, opts.flags);
9005
- var stat = FS.stat(path4);
8926
+ var stream = FS.open(path, opts.flags);
8927
+ var stat = FS.stat(path);
9006
8928
  var length = stat.size;
9007
8929
  var buf = new Uint8Array(length);
9008
8930
  FS.read(stream, buf, 0, length, 0);
@@ -9014,10 +8936,10 @@ var require_libzipSync = __commonJS({
9014
8936
  FS.close(stream);
9015
8937
  return ret;
9016
8938
  }, "readFile"),
9017
- writeFile: /* @__PURE__ */ __name(function(path4, data, opts) {
8939
+ writeFile: /* @__PURE__ */ __name(function(path, data, opts) {
9018
8940
  opts = opts || {};
9019
8941
  opts.flags = opts.flags || 577;
9020
- var stream = FS.open(path4, opts.flags, opts.mode);
8942
+ var stream = FS.open(path, opts.flags, opts.mode);
9021
8943
  if (typeof data === "string") {
9022
8944
  var buf = new Uint8Array(lengthBytesUTF8(data) + 1);
9023
8945
  var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
@@ -9032,8 +8954,8 @@ var require_libzipSync = __commonJS({
9032
8954
  cwd: /* @__PURE__ */ __name(function() {
9033
8955
  return FS.currentPath;
9034
8956
  }, "cwd"),
9035
- chdir: /* @__PURE__ */ __name(function(path4) {
9036
- var lookup = FS.lookupPath(path4, { follow: true });
8957
+ chdir: /* @__PURE__ */ __name(function(path) {
8958
+ var lookup = FS.lookupPath(path, { follow: true });
9037
8959
  if (lookup.node === null) {
9038
8960
  throw new FS.ErrnoError(44);
9039
8961
  }
@@ -9177,18 +9099,18 @@ var require_libzipSync = __commonJS({
9177
9099
  if (canWrite) mode |= 146;
9178
9100
  return mode;
9179
9101
  }, "getMode"),
9180
- findObject: /* @__PURE__ */ __name(function(path4, dontResolveLastLink) {
9181
- var ret = FS.analyzePath(path4, dontResolveLastLink);
9102
+ findObject: /* @__PURE__ */ __name(function(path, dontResolveLastLink) {
9103
+ var ret = FS.analyzePath(path, dontResolveLastLink);
9182
9104
  if (ret.exists) {
9183
9105
  return ret.object;
9184
9106
  } else {
9185
9107
  return null;
9186
9108
  }
9187
9109
  }, "findObject"),
9188
- analyzePath: /* @__PURE__ */ __name(function(path4, dontResolveLastLink) {
9110
+ analyzePath: /* @__PURE__ */ __name(function(path, dontResolveLastLink) {
9189
9111
  try {
9190
- var lookup = FS.lookupPath(path4, { follow: !dontResolveLastLink });
9191
- path4 = lookup.path;
9112
+ var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
9113
+ path = lookup.path;
9192
9114
  } catch (e) {
9193
9115
  }
9194
9116
  var ret = {
@@ -9203,12 +9125,12 @@ var require_libzipSync = __commonJS({
9203
9125
  parentObject: null
9204
9126
  };
9205
9127
  try {
9206
- var lookup = FS.lookupPath(path4, { parent: true });
9128
+ var lookup = FS.lookupPath(path, { parent: true });
9207
9129
  ret.parentExists = true;
9208
9130
  ret.parentPath = lookup.path;
9209
9131
  ret.parentObject = lookup.node;
9210
- ret.name = PATH.basename(path4);
9211
- lookup = FS.lookupPath(path4, { follow: !dontResolveLastLink });
9132
+ ret.name = PATH.basename(path);
9133
+ lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
9212
9134
  ret.exists = true;
9213
9135
  ret.path = lookup.path;
9214
9136
  ret.object = lookup.node;
@@ -9219,9 +9141,9 @@ var require_libzipSync = __commonJS({
9219
9141
  }
9220
9142
  return ret;
9221
9143
  }, "analyzePath"),
9222
- createPath: /* @__PURE__ */ __name(function(parent, path4, canRead, canWrite) {
9144
+ createPath: /* @__PURE__ */ __name(function(parent, path, canRead, canWrite) {
9223
9145
  parent = typeof parent === "string" ? parent : FS.getPath(parent);
9224
- var parts = path4.split("/").reverse();
9146
+ var parts = path.split("/").reverse();
9225
9147
  while (parts.length) {
9226
9148
  var part = parts.pop();
9227
9149
  if (!part) continue;
@@ -9235,20 +9157,20 @@ var require_libzipSync = __commonJS({
9235
9157
  return current;
9236
9158
  }, "createPath"),
9237
9159
  createFile: /* @__PURE__ */ __name(function(parent, name, properties, canRead, canWrite) {
9238
- var path4 = PATH.join2(
9160
+ var path = PATH.join2(
9239
9161
  typeof parent === "string" ? parent : FS.getPath(parent),
9240
9162
  name
9241
9163
  );
9242
9164
  var mode = FS.getMode(canRead, canWrite);
9243
- return FS.create(path4, mode);
9165
+ return FS.create(path, mode);
9244
9166
  }, "createFile"),
9245
9167
  createDataFile: /* @__PURE__ */ __name(function(parent, name, data, canRead, canWrite, canOwn) {
9246
- var path4 = name ? PATH.join2(
9168
+ var path = name ? PATH.join2(
9247
9169
  typeof parent === "string" ? parent : FS.getPath(parent),
9248
9170
  name
9249
9171
  ) : parent;
9250
9172
  var mode = FS.getMode(canRead, canWrite);
9251
- var node = FS.create(path4, mode);
9173
+ var node = FS.create(path, mode);
9252
9174
  if (data) {
9253
9175
  if (typeof data === "string") {
9254
9176
  var arr = new Array(data.length);
@@ -9265,7 +9187,7 @@ var require_libzipSync = __commonJS({
9265
9187
  return node;
9266
9188
  }, "createDataFile"),
9267
9189
  createDevice: /* @__PURE__ */ __name(function(parent, name, input, output) {
9268
- var path4 = PATH.join2(
9190
+ var path = PATH.join2(
9269
9191
  typeof parent === "string" ? parent : FS.getPath(parent),
9270
9192
  name
9271
9193
  );
@@ -9316,7 +9238,7 @@ var require_libzipSync = __commonJS({
9316
9238
  return i;
9317
9239
  }, "write")
9318
9240
  });
9319
- return FS.mkdev(path4, mode, dev);
9241
+ return FS.mkdev(path, mode, dev);
9320
9242
  }, "createDevice"),
9321
9243
  forceLoadFile: /* @__PURE__ */ __name(function(obj) {
9322
9244
  if (obj.isDevice || obj.isFolder || obj.link || obj.contents)
@@ -9365,10 +9287,10 @@ var require_libzipSync = __commonJS({
9365
9287
  var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
9366
9288
  var chunkSize = 1024 * 1024;
9367
9289
  if (!hasByteServing) chunkSize = datalength;
9368
- var doXHR = /* @__PURE__ */ __name(function(from, to) {
9369
- if (from > to)
9290
+ var doXHR = /* @__PURE__ */ __name(function(from2, to) {
9291
+ if (from2 > to)
9370
9292
  throw new Error(
9371
- "invalid range (" + from + ", " + to + ") or no bytes requested!"
9293
+ "invalid range (" + from2 + ", " + to + ") or no bytes requested!"
9372
9294
  );
9373
9295
  if (to > datalength - 1)
9374
9296
  throw new Error(
@@ -9377,7 +9299,7 @@ var require_libzipSync = __commonJS({
9377
9299
  var xhr2 = new XMLHttpRequest();
9378
9300
  xhr2.open("GET", url, false);
9379
9301
  if (datalength !== chunkSize)
9380
- xhr2.setRequestHeader("Range", "bytes=" + from + "-" + to);
9302
+ xhr2.setRequestHeader("Range", "bytes=" + from2 + "-" + to);
9381
9303
  if (typeof Uint8Array != "undefined")
9382
9304
  xhr2.responseType = "arraybuffer";
9383
9305
  if (xhr2.overrideMimeType) {
@@ -9562,24 +9484,24 @@ var require_libzipSync = __commonJS({
9562
9484
  var db = openRequest.result;
9563
9485
  var transaction = db.transaction([FS.DB_STORE_NAME], "readwrite");
9564
9486
  var files = transaction.objectStore(FS.DB_STORE_NAME);
9565
- var ok = 0, fail = 0, total = paths.length;
9487
+ var ok2 = 0, fail = 0, total = paths.length;
9566
9488
  function finish() {
9567
9489
  if (fail == 0) onload();
9568
9490
  else onerror();
9569
9491
  }
9570
9492
  __name(finish, "finish");
9571
- paths.forEach(function(path4) {
9493
+ paths.forEach(function(path) {
9572
9494
  var putRequest = files.put(
9573
- FS.analyzePath(path4).object.contents,
9574
- path4
9495
+ FS.analyzePath(path).object.contents,
9496
+ path
9575
9497
  );
9576
9498
  putRequest.onsuccess = /* @__PURE__ */ __name(function putRequest_onsuccess() {
9577
- ok++;
9578
- if (ok + fail == total) finish();
9499
+ ok2++;
9500
+ if (ok2 + fail == total) finish();
9579
9501
  }, "putRequest_onsuccess");
9580
9502
  putRequest.onerror = /* @__PURE__ */ __name(function putRequest_onerror() {
9581
9503
  fail++;
9582
- if (ok + fail == total) finish();
9504
+ if (ok2 + fail == total) finish();
9583
9505
  }, "putRequest_onerror");
9584
9506
  });
9585
9507
  transaction.onerror = onerror;
@@ -9607,32 +9529,32 @@ var require_libzipSync = __commonJS({
9607
9529
  return;
9608
9530
  }
9609
9531
  var files = transaction.objectStore(FS.DB_STORE_NAME);
9610
- var ok = 0, fail = 0, total = paths.length;
9532
+ var ok2 = 0, fail = 0, total = paths.length;
9611
9533
  function finish() {
9612
9534
  if (fail == 0) onload();
9613
9535
  else onerror();
9614
9536
  }
9615
9537
  __name(finish, "finish");
9616
- paths.forEach(function(path4) {
9617
- var getRequest = files.get(path4);
9538
+ paths.forEach(function(path) {
9539
+ var getRequest = files.get(path);
9618
9540
  getRequest.onsuccess = /* @__PURE__ */ __name(function getRequest_onsuccess() {
9619
- if (FS.analyzePath(path4).exists) {
9620
- FS.unlink(path4);
9541
+ if (FS.analyzePath(path).exists) {
9542
+ FS.unlink(path);
9621
9543
  }
9622
9544
  FS.createDataFile(
9623
- PATH.dirname(path4),
9624
- PATH.basename(path4),
9545
+ PATH.dirname(path),
9546
+ PATH.basename(path),
9625
9547
  getRequest.result,
9626
9548
  true,
9627
9549
  true,
9628
9550
  true
9629
9551
  );
9630
- ok++;
9631
- if (ok + fail == total) finish();
9552
+ ok2++;
9553
+ if (ok2 + fail == total) finish();
9632
9554
  }, "getRequest_onsuccess");
9633
9555
  getRequest.onerror = /* @__PURE__ */ __name(function getRequest_onerror() {
9634
9556
  fail++;
9635
- if (ok + fail == total) finish();
9557
+ if (ok2 + fail == total) finish();
9636
9558
  }, "getRequest_onerror");
9637
9559
  });
9638
9560
  transaction.onerror = onerror;
@@ -9644,9 +9566,9 @@ var require_libzipSync = __commonJS({
9644
9566
  mappings: {},
9645
9567
  DEFAULT_POLLMASK: 5,
9646
9568
  umask: 511,
9647
- calculateAt: /* @__PURE__ */ __name(function(dirfd, path4, allowEmpty) {
9648
- if (path4[0] === "/") {
9649
- return path4;
9569
+ calculateAt: /* @__PURE__ */ __name(function(dirfd, path, allowEmpty) {
9570
+ if (path[0] === "/") {
9571
+ return path;
9650
9572
  }
9651
9573
  var dir;
9652
9574
  if (dirfd === -100) {
@@ -9656,19 +9578,19 @@ var require_libzipSync = __commonJS({
9656
9578
  if (!dirstream) throw new FS.ErrnoError(8);
9657
9579
  dir = dirstream.path;
9658
9580
  }
9659
- if (path4.length == 0) {
9581
+ if (path.length == 0) {
9660
9582
  if (!allowEmpty) {
9661
9583
  throw new FS.ErrnoError(44);
9662
9584
  }
9663
9585
  return dir;
9664
9586
  }
9665
- return PATH.join2(dir, path4);
9587
+ return PATH.join2(dir, path);
9666
9588
  }, "calculateAt"),
9667
- doStat: /* @__PURE__ */ __name(function(func, path4, buf) {
9589
+ doStat: /* @__PURE__ */ __name(function(func, path, buf) {
9668
9590
  try {
9669
- var stat = func(path4);
9591
+ var stat = func(path);
9670
9592
  } catch (e) {
9671
- if (e && e.node && PATH.normalize(path4) !== PATH.normalize(FS.getPath(e.node))) {
9593
+ if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) {
9672
9594
  return -54;
9673
9595
  }
9674
9596
  throw e;
@@ -9708,14 +9630,14 @@ var require_libzipSync = __commonJS({
9708
9630
  var buffer2 = HEAPU8.slice(addr, addr + len);
9709
9631
  FS.msync(stream, buffer2, offset, len, flags);
9710
9632
  }, "doMsync"),
9711
- doMkdir: /* @__PURE__ */ __name(function(path4, mode) {
9712
- path4 = PATH.normalize(path4);
9713
- if (path4[path4.length - 1] === "/")
9714
- path4 = path4.substr(0, path4.length - 1);
9715
- FS.mkdir(path4, mode, 0);
9633
+ doMkdir: /* @__PURE__ */ __name(function(path, mode) {
9634
+ path = PATH.normalize(path);
9635
+ if (path[path.length - 1] === "/")
9636
+ path = path.substr(0, path.length - 1);
9637
+ FS.mkdir(path, mode, 0);
9716
9638
  return 0;
9717
9639
  }, "doMkdir"),
9718
- doMknod: /* @__PURE__ */ __name(function(path4, mode, dev) {
9640
+ doMknod: /* @__PURE__ */ __name(function(path, mode, dev) {
9719
9641
  switch (mode & 61440) {
9720
9642
  case 32768:
9721
9643
  case 8192:
@@ -9726,24 +9648,24 @@ var require_libzipSync = __commonJS({
9726
9648
  default:
9727
9649
  return -28;
9728
9650
  }
9729
- FS.mknod(path4, mode, dev);
9651
+ FS.mknod(path, mode, dev);
9730
9652
  return 0;
9731
9653
  }, "doMknod"),
9732
- doReadlink: /* @__PURE__ */ __name(function(path4, buf, bufsize) {
9654
+ doReadlink: /* @__PURE__ */ __name(function(path, buf, bufsize) {
9733
9655
  if (bufsize <= 0) return -28;
9734
- var ret = FS.readlink(path4);
9656
+ var ret = FS.readlink(path);
9735
9657
  var len = Math.min(bufsize, lengthBytesUTF8(ret));
9736
9658
  var endChar = HEAP8[buf + len];
9737
9659
  stringToUTF8(ret, buf, bufsize + 1);
9738
9660
  HEAP8[buf + len] = endChar;
9739
9661
  return len;
9740
9662
  }, "doReadlink"),
9741
- doAccess: /* @__PURE__ */ __name(function(path4, amode) {
9663
+ doAccess: /* @__PURE__ */ __name(function(path, amode) {
9742
9664
  if (amode & ~7) {
9743
9665
  return -28;
9744
9666
  }
9745
9667
  var node;
9746
- var lookup = FS.lookupPath(path4, { follow: true });
9668
+ var lookup = FS.lookupPath(path, { follow: true });
9747
9669
  node = lookup.node;
9748
9670
  if (!node) {
9749
9671
  return -44;
@@ -9757,10 +9679,10 @@ var require_libzipSync = __commonJS({
9757
9679
  }
9758
9680
  return 0;
9759
9681
  }, "doAccess"),
9760
- doDup: /* @__PURE__ */ __name(function(path4, flags, suggestFD) {
9682
+ doDup: /* @__PURE__ */ __name(function(path, flags, suggestFD) {
9761
9683
  var suggest = FS.getStream(suggestFD);
9762
9684
  if (suggest) FS.close(suggest);
9763
- return FS.open(path4, flags, 0, suggestFD, suggestFD).fd;
9685
+ return FS.open(path, flags, 0, suggestFD, suggestFD).fd;
9764
9686
  }, "doDup"),
9765
9687
  doReadv: /* @__PURE__ */ __name(function(stream, iov, iovcnt, offset) {
9766
9688
  var ret = 0;
@@ -9804,10 +9726,10 @@ var require_libzipSync = __commonJS({
9804
9726
  return low;
9805
9727
  }, "get64")
9806
9728
  };
9807
- function ___sys_chmod(path4, mode) {
9729
+ function ___sys_chmod(path, mode) {
9808
9730
  try {
9809
- path4 = SYSCALLS.getStr(path4);
9810
- FS.chmod(path4, mode);
9731
+ path = SYSCALLS.getStr(path);
9732
+ FS.chmod(path, mode);
9811
9733
  return 0;
9812
9734
  } catch (e) {
9813
9735
  if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
@@ -9933,10 +9855,10 @@ var require_libzipSync = __commonJS({
9933
9855
  }
9934
9856
  }
9935
9857
  __name(___sys_ioctl, "___sys_ioctl");
9936
- function ___sys_open(path4, flags, varargs) {
9858
+ function ___sys_open(path, flags, varargs) {
9937
9859
  SYSCALLS.varargs = varargs;
9938
9860
  try {
9939
- var pathname = SYSCALLS.getStr(path4);
9861
+ var pathname = SYSCALLS.getStr(path);
9940
9862
  var mode = varargs ? SYSCALLS.get() : 0;
9941
9863
  var stream = FS.open(pathname, flags, mode);
9942
9864
  return stream.fd;
@@ -9960,10 +9882,10 @@ var require_libzipSync = __commonJS({
9960
9882
  }
9961
9883
  }
9962
9884
  __name(___sys_rename, "___sys_rename");
9963
- function ___sys_rmdir(path4) {
9885
+ function ___sys_rmdir(path) {
9964
9886
  try {
9965
- path4 = SYSCALLS.getStr(path4);
9966
- FS.rmdir(path4);
9887
+ path = SYSCALLS.getStr(path);
9888
+ FS.rmdir(path);
9967
9889
  return 0;
9968
9890
  } catch (e) {
9969
9891
  if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
@@ -9972,10 +9894,10 @@ var require_libzipSync = __commonJS({
9972
9894
  }
9973
9895
  }
9974
9896
  __name(___sys_rmdir, "___sys_rmdir");
9975
- function ___sys_stat64(path4, buf) {
9897
+ function ___sys_stat64(path, buf) {
9976
9898
  try {
9977
- path4 = SYSCALLS.getStr(path4);
9978
- return SYSCALLS.doStat(FS.stat, path4, buf);
9899
+ path = SYSCALLS.getStr(path);
9900
+ return SYSCALLS.doStat(FS.stat, path, buf);
9979
9901
  } catch (e) {
9980
9902
  if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
9981
9903
  abort(e);
@@ -9983,10 +9905,10 @@ var require_libzipSync = __commonJS({
9983
9905
  }
9984
9906
  }
9985
9907
  __name(___sys_stat64, "___sys_stat64");
9986
- function ___sys_unlink(path4) {
9908
+ function ___sys_unlink(path) {
9987
9909
  try {
9988
- path4 = SYSCALLS.getStr(path4);
9989
- FS.unlink(path4);
9910
+ path = SYSCALLS.getStr(path);
9911
+ FS.unlink(path);
9990
9912
  return 0;
9991
9913
  } catch (e) {
9992
9914
  if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
@@ -10217,7 +10139,7 @@ var require_libzipSync = __commonJS({
10217
10139
  FS.FSNode = FSNode;
10218
10140
  FS.staticInit();
10219
10141
  if (ENVIRONMENT_IS_NODE) {
10220
- var fs2 = frozenFs;
10142
+ var fs = frozenFs;
10221
10143
  var NODEJS_PATH = __require("path");
10222
10144
  NODEFS.staticInit();
10223
10145
  }
@@ -10662,15 +10584,27 @@ function getInterpretedFile(pathToFile) {
10662
10584
  }
10663
10585
  __name(getInterpretedFile, "getInterpretedFile");
10664
10586
 
10587
+ // src/common/utils/strip-abs-node-modules-path.ts
10588
+ import { posix, sep } from "node:path";
10589
+ function normalizePath(id) {
10590
+ return posix.normalize(slash(id));
10591
+ }
10592
+ __name(normalizePath, "normalizePath");
10593
+ function stripAbsNodeModulesPath(absPath) {
10594
+ const splits = absPath.split(`node_modules${sep}`);
10595
+ return normalizePath(splits[splits.length - 1]);
10596
+ }
10597
+ __name(stripAbsNodeModulesPath, "stripAbsNodeModulesPath");
10598
+
10665
10599
  // src/common/utils/validate-configuration-files.ts
10666
10600
  import { resolve as resolve2 } from "node:path";
10667
10601
  import { once } from "storybook/internal/node-logger";
10668
10602
  import { MainFileMissingError } from "storybook/internal/server-errors";
10669
10603
  var import_ts_dedent = __toESM(require_dist(), 1);
10670
- async function validateConfigurationFiles(configDir, cwd2) {
10604
+ async function validateConfigurationFiles(configDir, cwd) {
10671
10605
  const extensionsPattern = `{${Array.from(supportedExtensions).join(",")}}`;
10672
10606
  const mainConfigMatches = await glob(slash(resolve2(configDir, `main${extensionsPattern}`)), {
10673
- cwd: cwd2 ?? process.cwd()
10607
+ cwd: cwd ?? process.cwd()
10674
10608
  });
10675
10609
  const [mainConfigPath] = mainConfigMatches;
10676
10610
  if (mainConfigMatches.length > 1) {
@@ -10719,10 +10653,10 @@ var resolveAddonName = /* @__PURE__ */ __name((configDir, name, options) => {
10719
10653
  if (managerFile || previewFile || presetFile) {
10720
10654
  const previewAnnotations = [];
10721
10655
  if (previewFile) {
10722
- const parsedPreviewFile = parseNodeModulePath(previewFile);
10723
- if (parsedPreviewFile.name) {
10656
+ const parsedPreviewFile = stripAbsNodeModulesPath(previewFile);
10657
+ if (parsedPreviewFile !== previewFile) {
10724
10658
  previewAnnotations.push({
10725
- bare: join(parsedPreviewFile.name, parsedPreviewFile.subpath || ""),
10659
+ bare: parsedPreviewFile,
10726
10660
  absolute: previewFile
10727
10661
  });
10728
10662
  } else {
@@ -11021,136 +10955,76 @@ function createFileSystemCache(options) {
11021
10955
  __name(createFileSystemCache, "createFileSystemCache");
11022
10956
 
11023
10957
  // src/common/utils/resolve-path-in-sb-cache.ts
11024
- import { join as join3 } from "node:path";
11025
-
11026
- // node_modules/find-cache-dir/index.js
11027
- var import_common_path_prefix = __toESM(require_common_path_prefix(), 1);
11028
- import process2 from "node:process";
11029
- import path3 from "node:path";
11030
- import fs from "node:fs";
10958
+ import { join as join4 } from "node:path";
11031
10959
 
11032
- // ../node_modules/pkg-dir/index.js
11033
- import path2 from "node:path";
10960
+ // ../node_modules/empathic/package.mjs
10961
+ import { env } from "node:process";
10962
+ import { dirname, join as join3 } from "node:path";
10963
+ import { existsSync as existsSync2, mkdirSync as mkdirSync2 } from "node:fs";
11034
10964
 
11035
- // ../node_modules/pkg-dir/node_modules/find-up/index.js
11036
- import path from "node:path";
11037
- import { fileURLToPath } from "node:url";
11038
- var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath, "toPath");
11039
- var findUpStop = Symbol("findUpStop");
11040
- function findUpMultipleSync2(name, options = {}) {
11041
- let directory = path.resolve(toPath(options.cwd) || "");
11042
- const { root } = path.parse(directory);
11043
- const stopAt = options.stopAt || root;
11044
- const limit = options.limit || Number.POSITIVE_INFINITY;
11045
- const paths = [name].flat();
11046
- const runMatcher = /* @__PURE__ */ __name((locateOptions) => {
11047
- if (typeof name !== "function") {
11048
- return locatePathSync(paths, locateOptions);
11049
- }
11050
- const foundPath = name(locateOptions.cwd);
11051
- if (typeof foundPath === "string") {
11052
- return locatePathSync([foundPath], locateOptions);
11053
- }
11054
- return foundPath;
11055
- }, "runMatcher");
11056
- const matches = [];
11057
- while (true) {
11058
- const foundPath = runMatcher({ ...options, cwd: directory });
11059
- if (foundPath === findUpStop) {
11060
- break;
11061
- }
11062
- if (foundPath) {
11063
- matches.push(path.resolve(directory, foundPath));
11064
- }
11065
- if (directory === stopAt || matches.length >= limit) {
11066
- break;
11067
- }
11068
- directory = path.dirname(directory);
11069
- }
11070
- return matches;
11071
- }
11072
- __name(findUpMultipleSync2, "findUpMultipleSync");
11073
- function findUpSync2(name, options = {}) {
11074
- const matches = findUpMultipleSync2(name, { ...options, limit: 1 });
11075
- return matches[0];
11076
- }
11077
- __name(findUpSync2, "findUpSync");
11078
-
11079
- // ../node_modules/pkg-dir/index.js
11080
- function packageDirectorySync({ cwd: cwd2 } = {}) {
11081
- const filePath = findUpSync2("package.json", { cwd: cwd2 });
11082
- return filePath && path2.dirname(filePath);
11083
- }
11084
- __name(packageDirectorySync, "packageDirectorySync");
11085
-
11086
- // node_modules/find-cache-dir/index.js
11087
- var { env, cwd } = process2;
11088
- var isWritable = /* @__PURE__ */ __name((path4) => {
10965
+ // ../node_modules/empathic/access.mjs
10966
+ import { accessSync, constants } from "node:fs";
10967
+ function ok(path, mode) {
11089
10968
  try {
11090
- fs.accessSync(path4, fs.constants.W_OK);
10969
+ accessSync(path, mode);
11091
10970
  return true;
11092
10971
  } catch {
11093
10972
  return false;
11094
10973
  }
11095
- }, "isWritable");
11096
- function useDirectory(directory, options) {
11097
- if (options.create) {
11098
- fs.mkdirSync(directory, { recursive: true });
11099
- }
11100
- return directory;
11101
10974
  }
11102
- __name(useDirectory, "useDirectory");
11103
- function getNodeModuleDirectory(directory) {
11104
- const nodeModules = path3.join(directory, "node_modules");
11105
- if (!isWritable(nodeModules) && (fs.existsSync(nodeModules) || !isWritable(path3.join(directory)))) {
11106
- return;
11107
- }
11108
- return nodeModules;
10975
+ __name(ok, "ok");
10976
+ function writable(path) {
10977
+ return ok(path, constants.W_OK);
11109
10978
  }
11110
- __name(getNodeModuleDirectory, "getNodeModuleDirectory");
11111
- function findCacheDirectory(options = {}) {
11112
- if (env.CACHE_DIR && !["true", "false", "1", "0"].includes(env.CACHE_DIR)) {
11113
- return useDirectory(path3.join(env.CACHE_DIR, options.name), options);
11114
- }
11115
- let { cwd: directory = cwd(), files } = options;
11116
- if (files) {
11117
- if (!Array.isArray(files)) {
11118
- throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof files}\`.`);
11119
- }
11120
- directory = (0, import_common_path_prefix.default)(files.map((file) => path3.resolve(directory, file)));
11121
- }
11122
- directory = packageDirectorySync({ cwd: directory });
11123
- if (!directory) {
11124
- return;
11125
- }
11126
- const nodeModules = getNodeModuleDirectory(directory);
11127
- if (!nodeModules) {
11128
- return;
10979
+ __name(writable, "writable");
10980
+
10981
+ // ../node_modules/empathic/package.mjs
10982
+ function up2(options) {
10983
+ return up("package.json", options);
10984
+ }
10985
+ __name(up2, "up");
10986
+ function cache(name, options) {
10987
+ options = options || {};
10988
+ let dir = env.CACHE_DIR;
10989
+ if (!dir || /^(1|0|true|false)$/.test(dir)) {
10990
+ let pkg = up2(options);
10991
+ if (dir = pkg && dirname(pkg)) {
10992
+ let mods = join3(dir, "node_modules");
10993
+ let exists = existsSync2(mods);
10994
+ if (!writable(exists ? mods : dir)) return;
10995
+ dir = join3(mods, ".cache");
10996
+ }
10997
+ }
10998
+ if (dir) {
10999
+ dir = join3(dir, name);
11000
+ if (options.create && !existsSync2(dir)) {
11001
+ mkdirSync2(dir, { recursive: true });
11002
+ }
11003
+ return dir;
11129
11004
  }
11130
- return useDirectory(path3.join(directory, "node_modules", ".cache", options.name), options);
11131
11005
  }
11132
- __name(findCacheDirectory, "findCacheDirectory");
11006
+ __name(cache, "cache");
11133
11007
 
11134
11008
  // src/common/utils/resolve-path-in-sb-cache.ts
11135
11009
  function resolvePathInStorybookCache(fileOrDirectoryName, sub = "default") {
11136
- let cacheDirectory = findCacheDirectory({ name: "storybook" });
11137
- cacheDirectory ||= join3(process.cwd(), "node_modules", ".cache", "storybook");
11138
- return join3(cacheDirectory, sub, fileOrDirectoryName);
11010
+ let cacheDirectory = cache("storybook");
11011
+ cacheDirectory ||= join4(process.cwd(), "node_modules", ".cache", "storybook");
11012
+ return join4(cacheDirectory, sub, fileOrDirectoryName);
11139
11013
  }
11140
11014
  __name(resolvePathInStorybookCache, "resolvePathInStorybookCache");
11141
11015
 
11142
11016
  // src/common/utils/cache.ts
11143
- var cache = createFileSystemCache({
11017
+ var cache2 = createFileSystemCache({
11144
11018
  basePath: resolvePathInStorybookCache("dev-server"),
11145
11019
  ns: "storybook"
11146
11020
  // Optional. A grouping namespace for items.
11147
11021
  });
11148
11022
 
11149
11023
  // src/common/utils/cli.ts
11150
- import { createWriteStream, mkdirSync as mkdirSync2 } from "node:fs";
11024
+ import { createWriteStream, mkdirSync as mkdirSync3 } from "node:fs";
11151
11025
  import { copyFile, readFile as readFile2, realpath, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
11152
11026
  import os from "node:os";
11153
- import { join as join6 } from "node:path";
11027
+ import { join as join7 } from "node:path";
11154
11028
 
11155
11029
  // ../node_modules/crypto-random-string/index.js
11156
11030
  import { promisify } from "util";
@@ -11292,12 +11166,12 @@ var satellite_addons_default = [
11292
11166
  ];
11293
11167
 
11294
11168
  // src/common/utils/get-storybook-info.ts
11295
- import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
11296
- import { dirname as dirname2, join as join5 } from "node:path";
11169
+ import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
11170
+ import { dirname as dirname3, join as join6 } from "node:path";
11297
11171
 
11298
11172
  // src/common/js-package-manager/JsPackageManager.ts
11299
11173
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
11300
- import { dirname, isAbsolute, join as join4, resolve as resolve3 } from "node:path";
11174
+ import { dirname as dirname2, isAbsolute, join as join5, resolve as resolve3 } from "node:path";
11301
11175
  import { logger as logger2, prompt } from "storybook/internal/node-logger";
11302
11176
  var import_picocolors = __toESM(require_picocolors(), 1);
11303
11177
  import { gt, satisfies } from "semver";
@@ -11346,7 +11220,7 @@ var JsPackageManager = class _JsPackageManager {
11346
11220
  }
11347
11221
  constructor(options) {
11348
11222
  this.cwd = options?.cwd || process.cwd();
11349
- this.instanceDir = options?.configDir ? isAbsolute(options?.configDir) ? dirname(options?.configDir) : dirname(join4(this.cwd, options?.configDir)) : this.cwd;
11223
+ this.instanceDir = options?.configDir ? isAbsolute(options?.configDir) ? dirname2(options?.configDir) : dirname2(join5(this.cwd, options?.configDir)) : this.cwd;
11350
11224
  this.packageJsonPaths = _JsPackageManager.listAllPackageJsonPaths(
11351
11225
  this.instanceDir,
11352
11226
  options?.storiesPaths
@@ -11354,13 +11228,13 @@ var JsPackageManager = class _JsPackageManager {
11354
11228
  this.primaryPackageJson = this.#getPrimaryPackageJson();
11355
11229
  }
11356
11230
  isStorybookInMonorepo() {
11357
- const turboJsonPath = findUpSync(`turbo.json`, { stopAt: getProjectRoot() });
11358
- const rushJsonPath = findUpSync(`rush.json`, { stopAt: getProjectRoot() });
11359
- const nxJsonPath = findUpSync(`nx.json`, { stopAt: getProjectRoot() });
11231
+ const turboJsonPath = up(`turbo.json`, { last: getProjectRoot() });
11232
+ const rushJsonPath = up(`rush.json`, { last: getProjectRoot() });
11233
+ const nxJsonPath = up(`nx.json`, { last: getProjectRoot() });
11360
11234
  if (turboJsonPath || rushJsonPath || nxJsonPath) {
11361
11235
  return true;
11362
11236
  }
11363
- const packageJsonPaths = findUpMultipleSync(`package.json`, { stopAt: getProjectRoot() });
11237
+ const packageJsonPaths = findFilesUp(["package.json"]);
11364
11238
  if (packageJsonPaths.length === 0) {
11365
11239
  return false;
11366
11240
  }
@@ -11510,7 +11384,7 @@ var JsPackageManager = class _JsPackageManager {
11510
11384
  }
11511
11385
  });
11512
11386
  if (modified) {
11513
- this.writePackageJson(packageJson, dirname(pjPath));
11387
+ this.writePackageJson(packageJson, dirname2(pjPath));
11514
11388
  break;
11515
11389
  }
11516
11390
  } catch (e) {
@@ -11701,14 +11575,14 @@ var JsPackageManager = class _JsPackageManager {
11701
11575
  command,
11702
11576
  args = [],
11703
11577
  stdio,
11704
- cwd: cwd2,
11578
+ cwd,
11705
11579
  ignoreError = false,
11706
11580
  env: env2,
11707
11581
  ...execaOptions
11708
11582
  }) {
11709
11583
  try {
11710
11584
  const commandResult = execaCommandSync([command, ...args].join(" "), {
11711
- cwd: cwd2 ?? this.cwd,
11585
+ cwd: cwd ?? this.cwd,
11712
11586
  stdio: stdio ?? "pipe",
11713
11587
  shell: true,
11714
11588
  cleanup: true,
@@ -11738,13 +11612,13 @@ var JsPackageManager = class _JsPackageManager {
11738
11612
  command,
11739
11613
  args = [],
11740
11614
  stdio,
11741
- cwd: cwd2,
11615
+ cwd,
11742
11616
  ignoreError = false,
11743
11617
  env: env2,
11744
11618
  ...execaOptions
11745
11619
  }) {
11746
11620
  const execaProcess = execa([command, ...args].join(" "), {
11747
- cwd: cwd2 ?? this.cwd,
11621
+ cwd: cwd ?? this.cwd,
11748
11622
  stdio: stdio ?? "pipe",
11749
11623
  encoding: "utf8",
11750
11624
  shell: true,
@@ -11793,8 +11667,8 @@ var JsPackageManager = class _JsPackageManager {
11793
11667
  * the dependency.
11794
11668
  */
11795
11669
  getDependencyVersion(dependency) {
11796
- const dependencyVersion = this.packageJsonPaths.map((path4) => {
11797
- const packageJson = _JsPackageManager.getPackageJson(path4);
11670
+ const dependencyVersion = this.packageJsonPaths.map((path) => {
11671
+ const packageJson = _JsPackageManager.getPackageJson(path);
11798
11672
  return packageJson.dependencies?.[dependency] ?? packageJson.devDependencies?.[dependency];
11799
11673
  }).filter(Boolean);
11800
11674
  return dependencyVersion[0] ?? null;
@@ -11839,10 +11713,7 @@ var JsPackageManager = class _JsPackageManager {
11839
11713
  }
11840
11714
  /** List all package.json files starting from the given directory and stopping at the project root. */
11841
11715
  static listAllPackageJsonPaths(instanceDir, storiesPaths) {
11842
- const packageJsonPaths = findUpMultipleSync("package.json", {
11843
- cwd: instanceDir,
11844
- stopAt: getProjectRoot()
11845
- });
11716
+ const packageJsonPaths = findFilesUp(["package.json"], instanceDir);
11846
11717
  if (!storiesPaths) {
11847
11718
  return packageJsonPaths;
11848
11719
  }
@@ -11853,7 +11724,7 @@ var JsPackageManager = class _JsPackageManager {
11853
11724
  ignore: ["**/node_modules/**", "**/dist/**"]
11854
11725
  });
11855
11726
  const relevantPackageJsons = allPackageJsonFiles.filter((packageJsonPath) => {
11856
- const packageDir = dirname(packageJsonPath);
11727
+ const packageDir = dirname2(packageJsonPath);
11857
11728
  return storiesPaths.some((storyPath) => storyPath.startsWith(packageDir));
11858
11729
  });
11859
11730
  return Array.from(/* @__PURE__ */ new Set([...packageJsonPaths, ...relevantPackageJsons]));
@@ -11868,7 +11739,7 @@ var JsPackageManager = class _JsPackageManager {
11868
11739
  return _JsPackageManager.getPackageJsonInfo(finalTargetPackageJsonPath);
11869
11740
  }
11870
11741
  static getPackageJsonInfo(packageJsonPath) {
11871
- const operationDir = dirname(packageJsonPath);
11742
+ const operationDir = dirname2(packageJsonPath);
11872
11743
  return {
11873
11744
  packageJsonPath,
11874
11745
  operationDir,
@@ -11942,7 +11813,7 @@ var findDependency = /* @__PURE__ */ __name(({ dependencies, devDependencies, pe
11942
11813
  Object.entries(peerDependencies || {}).find(predicate)
11943
11814
  ], "findDependency");
11944
11815
  var getRendererInfo = /* @__PURE__ */ __name((configDir) => {
11945
- const packageJsonPaths = JsPackageManager.listAllPackageJsonPaths(dirname2(configDir));
11816
+ const packageJsonPaths = JsPackageManager.listAllPackageJsonPaths(dirname3(configDir));
11946
11817
  for (const packageJsonPath of packageJsonPaths) {
11947
11818
  const packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
11948
11819
  const [dep, devDep, peerDep] = findDependency(packageJson, ([key]) => rendererPackages[key]);
@@ -11961,13 +11832,13 @@ var getRendererInfo = /* @__PURE__ */ __name((configDir) => {
11961
11832
  }, "getRendererInfo");
11962
11833
  var validConfigExtensions = ["ts", "js", "tsx", "jsx", "mjs", "cjs"];
11963
11834
  var findConfigFile = /* @__PURE__ */ __name((prefix, configDir) => {
11964
- const filePrefix = join5(configDir, prefix);
11965
- const extension = validConfigExtensions.find((ext) => existsSync2(`${filePrefix}.${ext}`));
11835
+ const filePrefix = join6(configDir, prefix);
11836
+ const extension = validConfigExtensions.find((ext) => existsSync3(`${filePrefix}.${ext}`));
11966
11837
  return extension ? `${filePrefix}.${extension}` : null;
11967
11838
  }, "findConfigFile");
11968
11839
  var getConfigInfo = /* @__PURE__ */ __name((configDir) => {
11969
11840
  let storybookConfigDir = configDir ?? ".storybook";
11970
- if (!existsSync2(storybookConfigDir)) {
11841
+ if (!existsSync3(storybookConfigDir)) {
11971
11842
  const packageJsonPaths = JsPackageManager.listAllPackageJsonPaths(storybookConfigDir);
11972
11843
  for (const packageJsonPath of packageJsonPaths) {
11973
11844
  const packageJson = JSON.parse(readFileSync3(packageJsonPath, "utf-8"));
@@ -11999,10 +11870,10 @@ var getStorybookInfo = /* @__PURE__ */ __name((configDir = ".storybook") => {
11999
11870
 
12000
11871
  // src/common/utils/cli.ts
12001
11872
  var tempDir = /* @__PURE__ */ __name(() => realpath(os.tmpdir()), "tempDir");
12002
- var getPath = /* @__PURE__ */ __name(async (prefix = "") => join6(await tempDir(), prefix + uniqueString()), "getPath");
11873
+ var getPath = /* @__PURE__ */ __name(async (prefix = "") => join7(await tempDir(), prefix + uniqueString()), "getPath");
12003
11874
  async function temporaryDirectory({ prefix = "" } = {}) {
12004
11875
  const directory = await getPath(prefix);
12005
- mkdirSync2(directory);
11876
+ mkdirSync3(directory);
12006
11877
  return directory;
12007
11878
  }
12008
11879
  __name(temporaryDirectory, "temporaryDirectory");
@@ -12011,7 +11882,7 @@ async function temporaryFile({ name, extension } = {}) {
12011
11882
  if (extension !== void 0 && extension !== null) {
12012
11883
  throw new Error("The `name` and `extension` options are mutually exclusive");
12013
11884
  }
12014
- return join6(await temporaryDirectory(), name);
11885
+ return join7(await temporaryDirectory(), name);
12015
11886
  }
12016
11887
  return await getPath() + (extension === void 0 || extension === null ? "" : "." + extension.replace(/^\./, ""));
12017
11888
  }
@@ -12041,7 +11912,7 @@ function getEnvConfig(program, configEnv) {
12041
11912
  }
12042
11913
  __name(getEnvConfig, "getEnvConfig");
12043
11914
  var createLogStream = /* @__PURE__ */ __name(async (logFileName = "storybook.log") => {
12044
- const finalLogPath = join6(process.cwd(), logFileName);
11915
+ const finalLogPath = join7(process.cwd(), logFileName);
12045
11916
  const temporaryLogPath = await temporaryFile({ name: logFileName });
12046
11917
  const logStream = createWriteStream(temporaryLogPath, { encoding: "utf8" });
12047
11918
  return new Promise((resolve8, reject) => {
@@ -12151,11 +12022,11 @@ __name(getBuilderOptions, "getBuilderOptions");
12151
12022
  var import_ts_dedent3 = __toESM(require_dist(), 1);
12152
12023
 
12153
12024
  // src/common/utils/normalize-path.ts
12154
- import { posix } from "node:path";
12155
- function normalizePath(p) {
12156
- return posix.normalize(p.replace(/\\/g, "/"));
12025
+ import { posix as posix2 } from "node:path";
12026
+ function normalizePath2(p) {
12027
+ return posix2.normalize(p.replace(/\\/g, "/"));
12157
12028
  }
12158
- __name(normalizePath, "normalizePath");
12029
+ __name(normalizePath2, "normalizePath");
12159
12030
 
12160
12031
  // src/common/utils/get-framework-name.ts
12161
12032
  async function getFrameworkName(options) {
@@ -12171,7 +12042,7 @@ async function getFrameworkName(options) {
12171
12042
  }
12172
12043
  __name(getFrameworkName, "getFrameworkName");
12173
12044
  var extractProperFrameworkName = /* @__PURE__ */ __name((framework) => {
12174
- const normalizedPath = normalizePath(framework);
12045
+ const normalizedPath = normalizePath2(framework);
12175
12046
  const frameworkName = Object.keys(frameworkPackages).find((pkg) => normalizedPath.endsWith(pkg));
12176
12047
  return frameworkName ?? framework;
12177
12048
  }, "extractProperFrameworkName");
@@ -12197,24 +12068,20 @@ __name(extractProperRendererNameFromFramework, "extractProperRendererNameFromFra
12197
12068
 
12198
12069
  // src/common/utils/get-storybook-refs.ts
12199
12070
  import { readFile as readFile3 } from "node:fs/promises";
12200
- import { dirname as dirname3, join as join7 } from "node:path";
12071
+ import { dirname as dirname4, join as join8 } from "node:path";
12201
12072
  import { logger as logger4 } from "storybook/internal/node-logger";
12202
- var import_resolve_from = __toESM(require_resolve_from(), 1);
12203
12073
  var getAutoRefs = /* @__PURE__ */ __name(async (options) => {
12204
- const location = await findUp("package.json", {
12205
- cwd: options.configDir,
12206
- stopAt: getProjectRoot()
12207
- });
12074
+ const location = up2({ cwd: options.configDir, last: getProjectRoot() });
12208
12075
  if (!location) {
12209
12076
  return {};
12210
12077
  }
12211
- const directory = dirname3(location);
12078
+ const directory = dirname4(location);
12212
12079
  const { dependencies = [], devDependencies = [] } = JSON.parse(await readFile3(location, { encoding: "utf8" })) || {};
12213
12080
  const deps = Object.keys({ ...dependencies, ...devDependencies });
12214
12081
  const list = await Promise.all(
12215
12082
  deps.map(async (d) => {
12216
12083
  try {
12217
- const l = (0, import_resolve_from.default)(directory, join7(d, "package.json"));
12084
+ const l = from(directory, join8(d, "package.json"));
12218
12085
  const { storybook, name, version } = JSON.parse(await readFile3(l, { encoding: "utf8" })) || {};
12219
12086
  if (storybook?.url) {
12220
12087
  return { id: name, ...storybook, version };
@@ -12243,8 +12110,8 @@ var getAutoRefs = /* @__PURE__ */ __name(async (options) => {
12243
12110
  );
12244
12111
  }, "getAutoRefs");
12245
12112
  var checkRef = /* @__PURE__ */ __name((url) => fetch(`${url}/iframe.html`).then(
12246
- async ({ ok, status }) => {
12247
- if (ok) {
12113
+ async ({ ok: ok2, status }) => {
12114
+ if (ok2) {
12248
12115
  if (status !== 200) {
12249
12116
  return false;
12250
12117
  }
@@ -12255,7 +12122,7 @@ var checkRef = /* @__PURE__ */ __name((url) => fetch(`${url}/iframe.html`).then(
12255
12122
  return false;
12256
12123
  }
12257
12124
  }
12258
- return ok;
12125
+ return ok2;
12259
12126
  },
12260
12127
  () => false
12261
12128
  ), "checkRef");
@@ -12283,8 +12150,8 @@ async function getRefs(options) {
12283
12150
  });
12284
12151
  await Promise.all(
12285
12152
  Object.entries(refs).map(async ([k, value]) => {
12286
- const ok = await checkRef(value.url);
12287
- refs[k] = { ...value, type: ok ? "server-checked" : "unknown" };
12153
+ const ok2 = await checkRef(value.url);
12154
+ refs[k] = { ...value, type: ok2 ? "server-checked" : "unknown" };
12288
12155
  })
12289
12156
  );
12290
12157
  return refs;
@@ -12345,9 +12212,9 @@ import { relative, resolve as resolve4 } from "node:path";
12345
12212
  import { MainFileEvaluationError } from "storybook/internal/server-errors";
12346
12213
  async function loadMainConfig({
12347
12214
  configDir = ".storybook",
12348
- cwd: cwd2
12215
+ cwd
12349
12216
  }) {
12350
- await validateConfigurationFiles(configDir, cwd2);
12217
+ await validateConfigurationFiles(configDir, cwd);
12351
12218
  const mainPath = getInterpretedFile(resolve4(configDir, "main"));
12352
12219
  try {
12353
12220
  const out = await importModule(mainPath);
@@ -12465,7 +12332,7 @@ __name(logConfig, "logConfig");
12465
12332
  // src/common/utils/normalize-stories.ts
12466
12333
  var pico2 = __toESM(require_picomatch(), 1);
12467
12334
  import { lstatSync } from "node:fs";
12468
- import { basename, dirname as dirname4, relative as relative2, resolve as resolve7 } from "node:path";
12335
+ import { basename, dirname as dirname5, relative as relative2, resolve as resolve7 } from "node:path";
12469
12336
  import { InvalidStoriesEntryError } from "storybook/internal/server-errors";
12470
12337
  var DEFAULT_TITLE_PREFIX = "";
12471
12338
  var DEFAULT_FILES_PATTERN = "**/*.@(mdx|stories.@(js|jsx|mjs|ts|tsx))";
@@ -12506,7 +12373,7 @@ var normalizeStoriesEntry = /* @__PURE__ */ __name((entry, { configDir, workingD
12506
12373
  } else {
12507
12374
  specifierWithoutMatcher = {
12508
12375
  titlePrefix: DEFAULT_TITLE_PREFIX,
12509
- directory: dirname4(entry),
12376
+ directory: dirname5(entry),
12510
12377
  files: basename(entry)
12511
12378
  };
12512
12379
  }
@@ -12592,7 +12459,7 @@ function isPreservingSymlinks() {
12592
12459
  __name(isPreservingSymlinks, "isPreservingSymlinks");
12593
12460
 
12594
12461
  // src/common/utils/template.ts
12595
- import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
12462
+ import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
12596
12463
  var interpolate2 = /* @__PURE__ */ __name((string, data = {}) => Object.entries(data).reduce((acc, [k, v]) => acc.replace(new RegExp(`%${k}%`, "g"), v), string), "interpolate");
12597
12464
  function getPreviewBodyTemplate(configDirPath, interpolations) {
12598
12465
  const base = readFileSync4(
@@ -12601,7 +12468,7 @@ function getPreviewBodyTemplate(configDirPath, interpolations) {
12601
12468
  );
12602
12469
  const bodyHtmlPath = resolve(configDirPath, "preview-body.html");
12603
12470
  let result = base;
12604
- if (existsSync3(bodyHtmlPath)) {
12471
+ if (existsSync4(bodyHtmlPath)) {
12605
12472
  result = readFileSync4(bodyHtmlPath, "utf8") + result;
12606
12473
  }
12607
12474
  return interpolate2(result, interpolations);
@@ -12614,7 +12481,7 @@ function getPreviewHeadTemplate(configDirPath, interpolations) {
12614
12481
  );
12615
12482
  const headHtmlPath = resolve(configDirPath, "preview-head.html");
12616
12483
  let result = base;
12617
- if (existsSync3(headHtmlPath)) {
12484
+ if (existsSync4(headHtmlPath)) {
12618
12485
  result += readFileSync4(headHtmlPath, "utf8");
12619
12486
  }
12620
12487
  return interpolate2(result, interpolations);
@@ -12622,7 +12489,7 @@ function getPreviewHeadTemplate(configDirPath, interpolations) {
12622
12489
  __name(getPreviewHeadTemplate, "getPreviewHeadTemplate");
12623
12490
 
12624
12491
  // src/common/utils/validate-config.ts
12625
- import { join as join8 } from "node:path";
12492
+ import { join as join9 } from "node:path";
12626
12493
  import {
12627
12494
  CouldNotEvaluateFrameworkError,
12628
12495
  InvalidFrameworkNameError,
@@ -12641,7 +12508,7 @@ function validateFrameworkName(frameworkName) {
12641
12508
  return;
12642
12509
  }
12643
12510
  try {
12644
- resolvePathSync(join8(frameworkName, "preset"), {
12511
+ resolveModulePath(join9(frameworkName, "preset"), {
12645
12512
  extensions: [".mjs", ".js", ".cjs"],
12646
12513
  conditions: ["node", "import", "require"]
12647
12514
  });
@@ -12749,8 +12616,8 @@ var userOrAutoTitleFromSpecifier = /* @__PURE__ */ __name((fileName, entry, user
12749
12616
  }, "userOrAutoTitleFromSpecifier");
12750
12617
 
12751
12618
  // src/common/utils/posix.ts
12752
- import { posix as posixPath, sep } from "node:path";
12753
- var posix2 = /* @__PURE__ */ __name((localPath, seperator = sep) => localPath.split(seperator).filter(Boolean).join(posixPath.sep), "posix");
12619
+ import { posix as posixPath, sep as sep2 } from "node:path";
12620
+ var posix3 = /* @__PURE__ */ __name((localPath, seperator = sep2) => localPath.split(seperator).filter(Boolean).join(posixPath.sep), "posix");
12754
12621
 
12755
12622
  // src/common/utils/get-story-id.ts
12756
12623
  async function getStoryId(data, options) {
@@ -12783,7 +12650,7 @@ function getStoryTitle({
12783
12650
  workingDir
12784
12651
  });
12785
12652
  const relativePath = relative3(workingDir, storyFilePath);
12786
- const importPath = posix2(normalizeStoryPath2(relativePath));
12653
+ const importPath = posix3(normalizeStoryPath2(relativePath));
12787
12654
  return normalizedStories.map((normalizeStory) => userOrAutoTitleFromSpecifier(importPath, normalizeStory, userTitle)).filter(Boolean)[0];
12788
12655
  }
12789
12656
  __name(getStoryTitle, "getStoryTitle");
@@ -12801,7 +12668,7 @@ var getAddonNames = /* @__PURE__ */ __name((mainConfig) => {
12801
12668
  if (name.startsWith(".")) {
12802
12669
  return void 0;
12803
12670
  }
12804
- name = normalizePath(name);
12671
+ name = normalizePath2(name);
12805
12672
  name = name.replace(/.*node_modules\//, "");
12806
12673
  return name.replace(/\/dist\/.*$/, "").replace(/\.[mc]?[tj]?sx?$/, "").replace(/\/register$/, "").replace(/\/manager$/, "").replace(/\/preset$/, "");
12807
12674
  });
@@ -12904,9 +12771,9 @@ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
12904
12771
  import { basename as basename2, parse as parse2, relative as relative4 } from "node:path";
12905
12772
 
12906
12773
  // src/common/js-package-manager/BUNProxy.ts
12907
- import { existsSync as existsSync4, readFileSync as readFileSync5 } from "node:fs";
12774
+ import { readFileSync as readFileSync5 } from "node:fs";
12908
12775
  import { platform } from "node:os";
12909
- import { join as join9 } from "node:path";
12776
+ import { join as join10 } from "node:path";
12910
12777
  import { logger as logger9 } from "storybook/internal/node-logger";
12911
12778
  import { FindPackageVersionsError } from "storybook/internal/server-errors";
12912
12779
  import sort from "semver/functions/sort.js";
@@ -12965,13 +12832,8 @@ var BUNProxy = class extends JsPackageManager {
12965
12832
  return `bunx ${pkg}${specifier ? `@${specifier}` : ""} ${args.join(" ")}`;
12966
12833
  }
12967
12834
  async getModulePackageJSON(packageName) {
12968
- const packageJsonPath = findUpSync(
12969
- (dir) => {
12970
- const possiblePath = join9(dir, "node_modules", packageName, "package.json");
12971
- return existsSync4(possiblePath) ? possiblePath : void 0;
12972
- },
12973
- { cwd: this.cwd, stopAt: getProjectRoot() }
12974
- );
12835
+ const wantedPath = join10("node_modules", packageName, "package.json");
12836
+ const packageJsonPath = up(wantedPath, { cwd: this.cwd, last: getProjectRoot() });
12975
12837
  if (!packageJsonPath) {
12976
12838
  return null;
12977
12839
  }
@@ -12984,24 +12846,24 @@ var BUNProxy = class extends JsPackageManager {
12984
12846
  }
12985
12847
  return this.installArgs;
12986
12848
  }
12987
- runPackageCommandSync(command, args, cwd2, stdio) {
12849
+ runPackageCommandSync(command, args, cwd, stdio) {
12988
12850
  return this.executeCommandSync({
12989
12851
  command: "bun",
12990
12852
  args: ["run", command, ...args],
12991
- cwd: cwd2,
12853
+ cwd,
12992
12854
  stdio
12993
12855
  });
12994
12856
  }
12995
- runPackageCommand(command, args, cwd2, stdio) {
12857
+ runPackageCommand(command, args, cwd, stdio) {
12996
12858
  return this.executeCommand({
12997
12859
  command: "bun",
12998
12860
  args: ["run", command, ...args],
12999
- cwd: cwd2,
12861
+ cwd,
13000
12862
  stdio
13001
12863
  });
13002
12864
  }
13003
- runInternalCommand(command, args, cwd2, stdio) {
13004
- return this.executeCommand({ command: "bun", args: [command, ...args], cwd: cwd2, stdio });
12865
+ runInternalCommand(command, args, cwd, stdio) {
12866
+ return this.executeCommand({ command: "bun", args: [command, ...args], cwd, stdio });
13005
12867
  }
13006
12868
  async findInstallations(pattern, { depth = 99 } = {}) {
13007
12869
  const exec = /* @__PURE__ */ __name(async ({ packageDepth }) => {
@@ -13015,15 +12877,15 @@ var BUNProxy = class extends JsPackageManager {
13015
12877
  });
13016
12878
  }, "exec");
13017
12879
  try {
13018
- const process4 = await exec({ packageDepth: depth });
13019
- const result = await process4;
12880
+ const process3 = await exec({ packageDepth: depth });
12881
+ const result = await process3;
13020
12882
  const commandResult = result.stdout ?? "";
13021
12883
  const parsedOutput = JSON.parse(commandResult);
13022
12884
  return this.mapDependencies(parsedOutput, pattern);
13023
12885
  } catch (e) {
13024
12886
  try {
13025
- const process4 = await exec({ packageDepth: 0 });
13026
- const result = await process4;
12887
+ const process3 = await exec({ packageDepth: 0 });
12888
+ const result = await process3;
13027
12889
  const commandResult = result.stdout ?? "";
13028
12890
  const parsedOutput = JSON.parse(commandResult);
13029
12891
  return this.mapDependencies(parsedOutput, pattern);
@@ -13050,13 +12912,13 @@ var BUNProxy = class extends JsPackageManager {
13050
12912
  });
13051
12913
  }
13052
12914
  async getRegistryURL() {
13053
- const process4 = this.executeCommand({
12915
+ const process3 = this.executeCommand({
13054
12916
  command: "npm",
13055
12917
  // "npm config" commands are not allowed in workspaces per default
13056
12918
  // https://github.com/npm/cli/issues/6099#issuecomment-1847584792
13057
12919
  args: ["config", "get", "registry", "-ws=false", "-iwr"]
13058
12920
  });
13059
- const result = await process4;
12921
+ const result = await process3;
13060
12922
  const url = (result.stdout ?? "").trim();
13061
12923
  return url === "undefined" ? void 0 : url;
13062
12924
  }
@@ -13075,11 +12937,11 @@ var BUNProxy = class extends JsPackageManager {
13075
12937
  async runGetVersions(packageName, fetchAllVersions) {
13076
12938
  const args = fetchAllVersions ? ["versions", "--json"] : ["version"];
13077
12939
  try {
13078
- const process4 = this.executeCommand({
12940
+ const process3 = this.executeCommand({
13079
12941
  command: "npm",
13080
12942
  args: ["info", packageName, ...args]
13081
12943
  });
13082
- const result = await process4;
12944
+ const result = await process3;
13083
12945
  const commandResult = result.stdout ?? "";
13084
12946
  const parsedOutput = fetchAllVersions ? JSON.parse(commandResult) : commandResult.trim();
13085
12947
  if (parsedOutput.error?.summary) {
@@ -13151,9 +13013,9 @@ var BUNProxy = class extends JsPackageManager {
13151
13013
  };
13152
13014
 
13153
13015
  // src/common/js-package-manager/NPMProxy.ts
13154
- import { existsSync as existsSync5, readFileSync as readFileSync6 } from "node:fs";
13016
+ import { readFileSync as readFileSync6 } from "node:fs";
13155
13017
  import { platform as platform2 } from "node:os";
13156
- import { join as join10 } from "node:path";
13018
+ import { join as join11 } from "node:path";
13157
13019
  import { logger as logger10, prompt as prompt2 } from "storybook/internal/node-logger";
13158
13020
  import { FindPackageVersionsError as FindPackageVersionsError2 } from "storybook/internal/server-errors";
13159
13021
  import sort2 from "semver/functions/sort.js";
@@ -13206,13 +13068,8 @@ var NPMProxy = class extends JsPackageManager {
13206
13068
  return `npx ${pkg}${specifier ? `@${specifier}` : ""} ${args.join(" ")}`;
13207
13069
  }
13208
13070
  async getModulePackageJSON(packageName) {
13209
- const packageJsonPath = findUpSync(
13210
- (dir) => {
13211
- const possiblePath = join10(dir, "node_modules", packageName, "package.json");
13212
- return existsSync5(possiblePath) ? possiblePath : void 0;
13213
- },
13214
- { cwd: this.primaryPackageJson.operationDir, stopAt: getProjectRoot() }
13215
- );
13071
+ const wantedPath = join11("node_modules", packageName, "package.json");
13072
+ const packageJsonPath = up(wantedPath, { cwd: this.cwd, last: getProjectRoot() });
13216
13073
  if (!packageJsonPath) {
13217
13074
  return null;
13218
13075
  }
@@ -13225,27 +13082,27 @@ var NPMProxy = class extends JsPackageManager {
13225
13082
  }
13226
13083
  return this.installArgs;
13227
13084
  }
13228
- runPackageCommandSync(command, args, cwd2, stdio) {
13085
+ runPackageCommandSync(command, args, cwd, stdio) {
13229
13086
  return this.executeCommandSync({
13230
13087
  command: "npm",
13231
13088
  args: ["exec", "--", command, ...args],
13232
- cwd: cwd2,
13089
+ cwd,
13233
13090
  stdio
13234
13091
  });
13235
13092
  }
13236
- runPackageCommand(command, args, cwd2, stdio) {
13093
+ runPackageCommand(command, args, cwd, stdio) {
13237
13094
  return this.executeCommand({
13238
13095
  command: "npm",
13239
13096
  args: ["exec", "--", command, ...args],
13240
- cwd: cwd2,
13097
+ cwd,
13241
13098
  stdio
13242
13099
  });
13243
13100
  }
13244
- runInternalCommand(command, args, cwd2, stdio) {
13101
+ runInternalCommand(command, args, cwd, stdio) {
13245
13102
  return this.executeCommand({
13246
13103
  command: "npm",
13247
13104
  args: [command, ...args],
13248
- cwd: cwd2,
13105
+ cwd,
13249
13106
  stdio
13250
13107
  });
13251
13108
  }
@@ -13295,13 +13152,13 @@ var NPMProxy = class extends JsPackageManager {
13295
13152
  });
13296
13153
  }
13297
13154
  async getRegistryURL() {
13298
- const process4 = this.executeCommand({
13155
+ const process3 = this.executeCommand({
13299
13156
  command: "npm",
13300
13157
  // "npm config" commands are not allowed in workspaces per default
13301
13158
  // https://github.com/npm/cli/issues/6099#issuecomment-1847584792
13302
13159
  args: ["config", "get", "registry", "-ws=false", "-iwr"]
13303
13160
  });
13304
- const result = await process4;
13161
+ const result = await process3;
13305
13162
  const url = (result.stdout ?? "").trim();
13306
13163
  return url === "undefined" ? void 0 : url;
13307
13164
  }
@@ -13320,11 +13177,11 @@ var NPMProxy = class extends JsPackageManager {
13320
13177
  async runGetVersions(packageName, fetchAllVersions) {
13321
13178
  const args = fetchAllVersions ? ["versions", "--json"] : ["version"];
13322
13179
  try {
13323
- const process4 = this.executeCommand({
13180
+ const process3 = this.executeCommand({
13324
13181
  command: "npm",
13325
13182
  args: ["info", packageName, ...args]
13326
13183
  });
13327
- const result = await process4;
13184
+ const result = await process3;
13328
13185
  const commandResult = result.stdout ?? "";
13329
13186
  const parsedOutput = fetchAllVersions ? JSON.parse(commandResult) : commandResult.trim();
13330
13187
  if (parsedOutput.error?.summary) {
@@ -13397,7 +13254,7 @@ var NPMProxy = class extends JsPackageManager {
13397
13254
 
13398
13255
  // src/common/js-package-manager/PNPMProxy.ts
13399
13256
  import { existsSync as existsSync6, readFileSync as readFileSync7 } from "node:fs";
13400
- import { join as join11 } from "node:path";
13257
+ import { join as join12 } from "node:path";
13401
13258
  import { pathToFileURL } from "node:url";
13402
13259
  import { prompt as prompt3 } from "storybook/internal/node-logger";
13403
13260
  import { FindPackageVersionsError as FindPackageVersionsError3 } from "storybook/internal/server-errors";
@@ -13437,27 +13294,27 @@ var PNPMProxy = class extends JsPackageManager {
13437
13294
  }
13438
13295
  return this.installArgs;
13439
13296
  }
13440
- runPackageCommandSync(command, args, cwd2, stdio) {
13297
+ runPackageCommandSync(command, args, cwd, stdio) {
13441
13298
  return this.executeCommandSync({
13442
13299
  command: "pnpm",
13443
13300
  args: ["exec", command, ...args],
13444
- cwd: cwd2,
13301
+ cwd,
13445
13302
  stdio
13446
13303
  });
13447
13304
  }
13448
- runPackageCommand(command, args, cwd2, stdio) {
13305
+ runPackageCommand(command, args, cwd, stdio) {
13449
13306
  return this.executeCommand({
13450
13307
  command: "pnpm",
13451
13308
  args: ["exec", command, ...args],
13452
- cwd: cwd2,
13309
+ cwd,
13453
13310
  stdio
13454
13311
  });
13455
13312
  }
13456
- runInternalCommand(command, args, cwd2, stdio) {
13313
+ runInternalCommand(command, args, cwd, stdio) {
13457
13314
  return this.executeCommand({
13458
13315
  command: "pnpm",
13459
13316
  args: [command, ...args],
13460
- cwd: cwd2,
13317
+ cwd,
13461
13318
  stdio
13462
13319
  });
13463
13320
  }
@@ -13487,9 +13344,9 @@ var PNPMProxy = class extends JsPackageManager {
13487
13344
  }
13488
13345
  }
13489
13346
  async getModulePackageJSON(packageName) {
13490
- const pnpapiPath = findUpSync([".pnp.js", ".pnp.cjs"], {
13347
+ const pnpapiPath = any([".pnp.js", ".pnp.cjs"], {
13491
13348
  cwd: this.primaryPackageJson.operationDir,
13492
- stopAt: getProjectRoot()
13349
+ last: getProjectRoot()
13493
13350
  });
13494
13351
  if (pnpapiPath) {
13495
13352
  try {
@@ -13500,7 +13357,7 @@ var PNPMProxy = class extends JsPackageManager {
13500
13357
  const pkgLocator = pnpApi.findPackageLocator(resolvedPath);
13501
13358
  const pkg = pnpApi.getPackageInformation(pkgLocator);
13502
13359
  const packageJSON = JSON.parse(
13503
- readFileSync7(join11(pkg.packageLocation, "package.json"), "utf-8")
13360
+ readFileSync7(join12(pkg.packageLocation, "package.json"), "utf-8")
13504
13361
  );
13505
13362
  return packageJSON;
13506
13363
  } catch (error) {
@@ -13510,13 +13367,8 @@ var PNPMProxy = class extends JsPackageManager {
13510
13367
  return null;
13511
13368
  }
13512
13369
  }
13513
- const packageJsonPath = findUpSync(
13514
- (dir) => {
13515
- const possiblePath = join11(dir, "node_modules", packageName, "package.json");
13516
- return existsSync6(possiblePath) ? possiblePath : void 0;
13517
- },
13518
- { cwd: this.cwd, stopAt: getProjectRoot() }
13519
- );
13370
+ const wantedPath = join12("node_modules", packageName, "package.json");
13371
+ const packageJsonPath = up(wantedPath, { cwd: this.cwd, last: getProjectRoot() });
13520
13372
  if (!packageJsonPath) {
13521
13373
  return null;
13522
13374
  }
@@ -13554,11 +13406,11 @@ var PNPMProxy = class extends JsPackageManager {
13554
13406
  async runGetVersions(packageName, fetchAllVersions) {
13555
13407
  const args = fetchAllVersions ? ["versions", "--json"] : ["version"];
13556
13408
  try {
13557
- const process4 = this.executeCommand({
13409
+ const process3 = this.executeCommand({
13558
13410
  command: "pnpm",
13559
13411
  args: ["info", packageName, ...args]
13560
13412
  });
13561
- const result = await process4;
13413
+ const result = await process3;
13562
13414
  const commandResult = result.stdout ?? "";
13563
13415
  const parsedOutput = fetchAllVersions ? JSON.parse(commandResult) : commandResult.trim();
13564
13416
  if (parsedOutput.error?.summary) {
@@ -13627,9 +13479,9 @@ var PNPMProxy = class extends JsPackageManager {
13627
13479
  };
13628
13480
 
13629
13481
  // src/common/js-package-manager/Yarn1Proxy.ts
13630
- import { existsSync as existsSync7, readFileSync as readFileSync8 } from "node:fs";
13631
- import { join as join12 } from "node:path";
13632
- import process3 from "node:process";
13482
+ import { readFileSync as readFileSync8 } from "node:fs";
13483
+ import { join as join13 } from "node:path";
13484
+ import process2 from "node:process";
13633
13485
  import { prompt as prompt4 } from "storybook/internal/node-logger";
13634
13486
  import { FindPackageVersionsError as FindPackageVersionsError4 } from "storybook/internal/server-errors";
13635
13487
 
@@ -13654,7 +13506,7 @@ var Yarn1Proxy = class extends JsPackageManager {
13654
13506
  }
13655
13507
  getInstallArgs() {
13656
13508
  if (!this.installArgs) {
13657
- this.installArgs = process3.env.CI ? [] : ["--ignore-workspace-root-check"];
13509
+ this.installArgs = process2.env.CI ? [] : ["--ignore-workspace-root-check"];
13658
13510
  }
13659
13511
  return this.installArgs;
13660
13512
  }
@@ -13664,28 +13516,23 @@ var Yarn1Proxy = class extends JsPackageManager {
13664
13516
  getRemoteRunCommand(pkg, args, specifier) {
13665
13517
  return `npx ${pkg}${specifier ? `@${specifier}` : ""} ${args.join(" ")}`;
13666
13518
  }
13667
- runPackageCommandSync(command, args, cwd2, stdio) {
13519
+ runPackageCommandSync(command, args, cwd, stdio) {
13668
13520
  return this.executeCommandSync({
13669
13521
  command: `yarn`,
13670
13522
  args: ["exec", command, ...args],
13671
- cwd: cwd2,
13523
+ cwd,
13672
13524
  stdio
13673
13525
  });
13674
13526
  }
13675
- runPackageCommand(command, args, cwd2, stdio) {
13676
- return this.executeCommand({ command: `yarn`, args: ["exec", command, ...args], cwd: cwd2, stdio });
13527
+ runPackageCommand(command, args, cwd, stdio) {
13528
+ return this.executeCommand({ command: `yarn`, args: ["exec", command, ...args], cwd, stdio });
13677
13529
  }
13678
- runInternalCommand(command, args, cwd2, stdio) {
13679
- return this.executeCommand({ command: `yarn`, args: [command, ...args], cwd: cwd2, stdio });
13530
+ runInternalCommand(command, args, cwd, stdio) {
13531
+ return this.executeCommand({ command: `yarn`, args: [command, ...args], cwd, stdio });
13680
13532
  }
13681
13533
  async getModulePackageJSON(packageName) {
13682
- const packageJsonPath = findUpSync(
13683
- (dir) => {
13684
- const possiblePath = join12(dir, "node_modules", packageName, "package.json");
13685
- return existsSync7(possiblePath) ? possiblePath : void 0;
13686
- },
13687
- { cwd: this.primaryPackageJson.operationDir, stopAt: getProjectRoot() }
13688
- );
13534
+ const wantedPath = join13("node_modules", packageName, "package.json");
13535
+ const packageJsonPath = up(wantedPath, { cwd: this.cwd, last: getProjectRoot() });
13689
13536
  if (!packageJsonPath) {
13690
13537
  return null;
13691
13538
  }
@@ -13705,7 +13552,7 @@ var Yarn1Proxy = class extends JsPackageManager {
13705
13552
  yarnArgs.push("--recursive");
13706
13553
  }
13707
13554
  try {
13708
- const process4 = this.executeCommand({
13555
+ const process3 = this.executeCommand({
13709
13556
  command: "yarn",
13710
13557
  args: yarnArgs.concat(pattern),
13711
13558
  env: {
@@ -13713,7 +13560,7 @@ var Yarn1Proxy = class extends JsPackageManager {
13713
13560
  },
13714
13561
  cwd: this.instanceDir
13715
13562
  });
13716
- const result = await process4;
13563
+ const result = await process3;
13717
13564
  const commandResult = result.stdout ?? "";
13718
13565
  const parsedOutput = JSON.parse(commandResult);
13719
13566
  return this.mapDependencies(parsedOutput, pattern);
@@ -13752,11 +13599,11 @@ var Yarn1Proxy = class extends JsPackageManager {
13752
13599
  async runGetVersions(packageName, fetchAllVersions) {
13753
13600
  const args = [fetchAllVersions ? "versions" : "version", "--json"];
13754
13601
  try {
13755
- const process4 = this.executeCommand({
13602
+ const process3 = this.executeCommand({
13756
13603
  command: "yarn",
13757
13604
  args: ["info", packageName, ...args]
13758
13605
  });
13759
- const result = await process4;
13606
+ const result = await process3;
13760
13607
  const commandResult = result.stdout ?? "";
13761
13608
  const parsedOutput = JSON.parse(commandResult);
13762
13609
  if (parsedOutput.type === "inspect") {
@@ -13822,8 +13669,8 @@ var Yarn1Proxy = class extends JsPackageManager {
13822
13669
  // src/common/js-package-manager/Yarn2Proxy.ts
13823
13670
  var import_fslib = __toESM(require_lib(), 1);
13824
13671
  var import_libzip = __toESM(require_sync(), 1);
13825
- import { existsSync as existsSync8, readFileSync as readFileSync9 } from "node:fs";
13826
- import { join as join13 } from "node:path";
13672
+ import { readFileSync as readFileSync9 } from "node:fs";
13673
+ import { join as join14 } from "node:path";
13827
13674
  import { pathToFileURL as pathToFileURL2 } from "node:url";
13828
13675
  import { prompt as prompt5 } from "storybook/internal/node-logger";
13829
13676
  import { FindPackageVersionsError as FindPackageVersionsError5 } from "storybook/internal/server-errors";
@@ -13902,19 +13749,19 @@ var Yarn2Proxy = class extends JsPackageManager {
13902
13749
  getRemoteRunCommand(pkg, args, specifier) {
13903
13750
  return `yarn dlx ${pkg}${specifier ? `@${specifier}` : ""} ${args.join(" ")}`;
13904
13751
  }
13905
- runPackageCommandSync(command, args, cwd2, stdio) {
13752
+ runPackageCommandSync(command, args, cwd, stdio) {
13906
13753
  return this.executeCommandSync({
13907
13754
  command: "yarn",
13908
13755
  args: ["exec", command, ...args],
13909
- cwd: cwd2,
13756
+ cwd,
13910
13757
  stdio
13911
13758
  });
13912
13759
  }
13913
- runPackageCommand(command, args, cwd2, stdio) {
13914
- return this.executeCommand({ command: "yarn", args: ["exec", command, ...args], cwd: cwd2, stdio });
13760
+ runPackageCommand(command, args, cwd, stdio) {
13761
+ return this.executeCommand({ command: "yarn", args: ["exec", command, ...args], cwd, stdio });
13915
13762
  }
13916
- runInternalCommand(command, args, cwd2, stdio) {
13917
- return this.executeCommand({ command: "yarn", args: [command, ...args], cwd: cwd2, stdio });
13763
+ runInternalCommand(command, args, cwd, stdio) {
13764
+ return this.executeCommand({ command: "yarn", args: [command, ...args], cwd, stdio });
13918
13765
  }
13919
13766
  async findInstallations(pattern, { depth = 99 } = {}) {
13920
13767
  const yarnArgs = ["info", "--name-only"];
@@ -13937,9 +13784,9 @@ var Yarn2Proxy = class extends JsPackageManager {
13937
13784
  }
13938
13785
  }
13939
13786
  async getModulePackageJSON(packageName) {
13940
- const pnpapiPath = findUpSync([".pnp.js", ".pnp.cjs"], {
13787
+ const pnpapiPath = any([".pnp.js", ".pnp.cjs"], {
13941
13788
  cwd: this.cwd,
13942
- stopAt: getProjectRoot()
13789
+ last: getProjectRoot()
13943
13790
  });
13944
13791
  if (pnpapiPath) {
13945
13792
  try {
@@ -13958,7 +13805,7 @@ var Yarn2Proxy = class extends JsPackageManager {
13958
13805
  });
13959
13806
  const virtualFs = new import_fslib.VirtualFS({ baseFs: zipOpenFs });
13960
13807
  const crossFs = new import_fslib.PosixFS(virtualFs);
13961
- const virtualPath = join13(pkg.packageLocation, "package.json");
13808
+ const virtualPath = join14(pkg.packageLocation, "package.json");
13962
13809
  return crossFs.readJsonSync(virtualPath);
13963
13810
  } catch (error) {
13964
13811
  if (error.code !== "ERR_MODULE_NOT_FOUND") {
@@ -13967,13 +13814,11 @@ var Yarn2Proxy = class extends JsPackageManager {
13967
13814
  return null;
13968
13815
  }
13969
13816
  }
13970
- const packageJsonPath = findUpSync(
13971
- (dir) => {
13972
- const possiblePath = join13(dir, "node_modules", packageName, "package.json");
13973
- return existsSync8(possiblePath) ? possiblePath : void 0;
13974
- },
13975
- { cwd: this.primaryPackageJson.operationDir, stopAt: getProjectRoot() }
13976
- );
13817
+ const wantedPath = join14("node_modules", packageName, "package.json");
13818
+ const packageJsonPath = up(wantedPath, {
13819
+ cwd: this.primaryPackageJson.operationDir,
13820
+ last: getProjectRoot()
13821
+ });
13977
13822
  if (!packageJsonPath) {
13978
13823
  return null;
13979
13824
  }
@@ -14008,11 +13853,11 @@ var Yarn2Proxy = class extends JsPackageManager {
14008
13853
  });
14009
13854
  }
14010
13855
  async getRegistryURL() {
14011
- const process4 = this.executeCommand({
13856
+ const process3 = this.executeCommand({
14012
13857
  command: "yarn",
14013
13858
  args: ["config", "get", "npmRegistryServer"]
14014
13859
  });
14015
- const result = await process4;
13860
+ const result = await process3;
14016
13861
  const url = (result.stdout ?? "").trim();
14017
13862
  return url === "undefined" ? void 0 : url;
14018
13863
  }
@@ -14020,11 +13865,11 @@ var Yarn2Proxy = class extends JsPackageManager {
14020
13865
  const field = fetchAllVersions ? "versions" : "version";
14021
13866
  const args = ["--fields", field, "--json"];
14022
13867
  try {
14023
- const process4 = this.executeCommand({
13868
+ const process3 = this.executeCommand({
14024
13869
  command: "yarn",
14025
13870
  args: ["npm", "info", packageName, ...args]
14026
13871
  });
14027
- const result = await process4;
13872
+ const result = await process3;
14028
13873
  const commandResult = result.stdout ?? "";
14029
13874
  const parsedOutput = JSON.parse(commandResult);
14030
13875
  return parsedOutput[field];
@@ -14099,8 +13944,8 @@ var JsPackageManagerFactory = class {
14099
13944
  this.cache = /* @__PURE__ */ new Map();
14100
13945
  }
14101
13946
  /** Generate a cache key based on the parameters */
14102
- static getCacheKey(force, configDir = ".storybook", cwd2 = process.cwd(), storiesPaths) {
14103
- return JSON.stringify({ force: force || null, configDir, cwd: cwd2, storiesPaths });
13947
+ static getCacheKey(force, configDir = ".storybook", cwd = process.cwd(), storiesPaths) {
13948
+ return JSON.stringify({ force: force || null, configDir, cwd, storiesPaths });
14104
13949
  }
14105
13950
  /** Clear the package manager cache */
14106
13951
  static clearCache() {
@@ -14113,14 +13958,14 @@ var JsPackageManagerFactory = class {
14113
13958
  * @returns Package manager type as string: 'npm', 'pnpm', 'bun', 'yarn1', or 'yarn2'
14114
13959
  * @throws Error if no usable package manager is found
14115
13960
  */
14116
- static getPackageManagerType(cwd2 = process.cwd()) {
13961
+ static getPackageManagerType(cwd = process.cwd()) {
14117
13962
  const root = getProjectRoot();
14118
13963
  const lockFiles = [
14119
- findUpSync(YARN_LOCKFILE, { cwd: cwd2, stopAt: root }),
14120
- findUpSync(PNPM_LOCKFILE, { cwd: cwd2, stopAt: root }),
14121
- findUpSync(NPM_LOCKFILE, { cwd: cwd2, stopAt: root }),
14122
- findUpSync(BUN_LOCKFILE, { cwd: cwd2, stopAt: root }),
14123
- findUpSync(BUN_LOCKFILE_BINARY, { cwd: cwd2, stopAt: root })
13964
+ up(YARN_LOCKFILE, { cwd, last: root }),
13965
+ up(PNPM_LOCKFILE, { cwd, last: root }),
13966
+ up(NPM_LOCKFILE, { cwd, last: root }),
13967
+ up(BUN_LOCKFILE, { cwd, last: root }),
13968
+ up(BUN_LOCKFILE_BINARY, { cwd, last: root })
14124
13969
  ].filter(Boolean).sort((a, b) => {
14125
13970
  const dirA = parse2(a).dir;
14126
13971
  const dirB = parse2(b).dir;
@@ -14135,18 +13980,18 @@ var JsPackageManagerFactory = class {
14135
13980
  });
14136
13981
  const closestLockfilePath = lockFiles[0];
14137
13982
  const closestLockfile = closestLockfilePath && basename2(closestLockfilePath);
14138
- const yarnVersion = getYarnVersion(cwd2);
13983
+ const yarnVersion = getYarnVersion(cwd);
14139
13984
  if (yarnVersion && closestLockfile === YARN_LOCKFILE) {
14140
13985
  return yarnVersion === 1 ? "yarn1" : "yarn2";
14141
13986
  }
14142
- if (hasPNPM(cwd2) && closestLockfile === PNPM_LOCKFILE) {
13987
+ if (hasPNPM(cwd) && closestLockfile === PNPM_LOCKFILE) {
14143
13988
  return "pnpm";
14144
13989
  }
14145
- const isNPMCommandOk = hasNPM(cwd2);
13990
+ const isNPMCommandOk = hasNPM(cwd);
14146
13991
  if (isNPMCommandOk && closestLockfile === NPM_LOCKFILE) {
14147
13992
  return "npm";
14148
13993
  }
14149
- if (hasBun(cwd2) && (closestLockfile === BUN_LOCKFILE || closestLockfile === BUN_LOCKFILE_BINARY)) {
13994
+ if (hasBun(cwd) && (closestLockfile === BUN_LOCKFILE || closestLockfile === BUN_LOCKFILE_BINARY)) {
14150
13995
  return "bun";
14151
13996
  }
14152
13997
  const inferredPackageManager = this.inferPackageManagerFromUserAgent();
@@ -14163,19 +14008,19 @@ var JsPackageManagerFactory = class {
14163
14008
  configDir = ".storybook",
14164
14009
  storiesPaths,
14165
14010
  ignoreCache = false
14166
- } = {}, cwd2 = process.cwd()) {
14167
- const cacheKey = this.getCacheKey(force, configDir, cwd2, storiesPaths);
14011
+ } = {}, cwd = process.cwd()) {
14012
+ const cacheKey = this.getCacheKey(force, configDir, cwd, storiesPaths);
14168
14013
  const cached = this.cache.get(cacheKey);
14169
14014
  if (cached && !ignoreCache) {
14170
14015
  return cached;
14171
14016
  }
14172
14017
  if (force && force in this.PROXY_MAP) {
14173
- const packageManager2 = new this.PROXY_MAP[force]({ cwd: cwd2, configDir, storiesPaths });
14018
+ const packageManager2 = new this.PROXY_MAP[force]({ cwd, configDir, storiesPaths });
14174
14019
  this.cache.set(cacheKey, packageManager2);
14175
14020
  return packageManager2;
14176
14021
  }
14177
- const packageManagerType = this.getPackageManagerType(cwd2);
14178
- const packageManager = new this.PROXY_MAP[packageManagerType]({ cwd: cwd2, configDir, storiesPaths });
14022
+ const packageManagerType = this.getPackageManagerType(cwd);
14023
+ const packageManager = new this.PROXY_MAP[packageManagerType]({ cwd, configDir, storiesPaths });
14179
14024
  this.cache.set(cacheKey, packageManager);
14180
14025
  return packageManager;
14181
14026
  }
@@ -14212,9 +14057,9 @@ var JsPackageManagerFactory = class {
14212
14057
  return void 0;
14213
14058
  }
14214
14059
  };
14215
- function hasNPM(cwd2) {
14216
- const npmVersionCommand = (0, import_cross_spawn.sync)("npm", ["--version"], {
14217
- cwd: cwd2,
14060
+ function hasNPM(cwd) {
14061
+ const npmVersionCommand = (0, import_cross_spawn.sync)("npm --version", {
14062
+ cwd,
14218
14063
  shell: true,
14219
14064
  env: {
14220
14065
  ...process.env,
@@ -14224,9 +14069,9 @@ function hasNPM(cwd2) {
14224
14069
  return npmVersionCommand.status === 0;
14225
14070
  }
14226
14071
  __name(hasNPM, "hasNPM");
14227
- function hasBun(cwd2) {
14228
- const pnpmVersionCommand = (0, import_cross_spawn.sync)("bun", ["--version"], {
14229
- cwd: cwd2,
14072
+ function hasBun(cwd) {
14073
+ const pnpmVersionCommand = (0, import_cross_spawn.sync)("bun --version", {
14074
+ cwd,
14230
14075
  shell: true,
14231
14076
  env: {
14232
14077
  ...process.env,
@@ -14236,9 +14081,9 @@ function hasBun(cwd2) {
14236
14081
  return pnpmVersionCommand.status === 0;
14237
14082
  }
14238
14083
  __name(hasBun, "hasBun");
14239
- function hasPNPM(cwd2) {
14240
- const pnpmVersionCommand = (0, import_cross_spawn.sync)("pnpm", ["--version"], {
14241
- cwd: cwd2,
14084
+ function hasPNPM(cwd) {
14085
+ const pnpmVersionCommand = (0, import_cross_spawn.sync)("pnpm --version", {
14086
+ cwd,
14242
14087
  shell: true,
14243
14088
  env: {
14244
14089
  ...process.env,
@@ -14248,9 +14093,9 @@ function hasPNPM(cwd2) {
14248
14093
  return pnpmVersionCommand.status === 0;
14249
14094
  }
14250
14095
  __name(hasPNPM, "hasPNPM");
14251
- function getYarnVersion(cwd2) {
14252
- const yarnVersionCommand = (0, import_cross_spawn.sync)("yarn", ["--version"], {
14253
- cwd: cwd2,
14096
+ function getYarnVersion(cwd) {
14097
+ const yarnVersionCommand = (0, import_cross_spawn.sync)("yarn --version", {
14098
+ cwd,
14254
14099
  shell: true,
14255
14100
  env: {
14256
14101
  ...process.env,
@@ -14282,7 +14127,7 @@ async function scanAndTransformFiles({
14282
14127
  initial: defaultGlob
14283
14128
  });
14284
14129
  console.log("Scanning for affected files...");
14285
- const globby = (await import("./globby-FGF2JG5Z.js")).globby;
14130
+ const globby = (await import("./globby-DASPUXWI.js")).globby;
14286
14131
  const sourceFiles = await globby([glob2], {
14287
14132
  ...commonGlobOptions(""),
14288
14133
  ignore: ["**/node_modules/**"],
@@ -14300,8 +14145,8 @@ import { readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises
14300
14145
  function transformImports(source, renamedImports) {
14301
14146
  let hasChanges = false;
14302
14147
  let transformed = source;
14303
- for (const [from, to] of Object.entries(renamedImports)) {
14304
- const regex = new RegExp(`(['"])${from}(/.*)?\\1`, "g");
14148
+ for (const [from2, to] of Object.entries(renamedImports)) {
14149
+ const regex = new RegExp(`(['"])${from2}(/.*)?\\1`, "g");
14305
14150
  if (regex.test(transformed)) {
14306
14151
  transformed = transformed.replace(regex, `$1${to}$2$1`);
14307
14152
  hasChanges = true;
@@ -14312,7 +14157,7 @@ function transformImports(source, renamedImports) {
14312
14157
  __name(transformImports, "transformImports");
14313
14158
  var transformImportFiles = /* @__PURE__ */ __name(async (files, renamedImports, dryRun) => {
14314
14159
  const errors = [];
14315
- const { default: pLimit } = await import("./p-limit-JNDYEQZX.js");
14160
+ const { default: pLimit } = await import("./p-limit-HVR3I7TJ.js");
14316
14161
  const limit = pLimit(10);
14317
14162
  await Promise.all(
14318
14163
  files.map(
@@ -14334,6 +14179,7 @@ var transformImportFiles = /* @__PURE__ */ __name(async (files, renamedImports,
14334
14179
 
14335
14180
  export {
14336
14181
  userOrAutoTitleFromSpecifier,
14182
+ up2 as up,
14337
14183
  supportedExtensions,
14338
14184
  getInterpretedFile,
14339
14185
  validateConfigurationFiles,
@@ -14345,7 +14191,7 @@ export {
14345
14191
  FileSystemCache,
14346
14192
  createFileSystemCache,
14347
14193
  resolvePathInStorybookCache,
14348
- cache,
14194
+ cache2 as cache,
14349
14195
  HandledError,
14350
14196
  COMMON_ENV_VARS,
14351
14197
  getPackageDetails,
@@ -14398,7 +14244,7 @@ export {
14398
14244
  validateFrameworkName,
14399
14245
  satisfies2 as satisfies,
14400
14246
  formatFileContent,
14401
- posix2 as posix,
14247
+ posix3 as posix,
14402
14248
  getStoryId,
14403
14249
  getStoryTitle,
14404
14250
  getAddonNames,