From 95f502221f970b67a6ff7d623e731b6e7492d26e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:18:42 +0000 Subject: [PATCH] fix(deps): update dependency react-router-dom to v6.26.1 --- .pnp.cjs | 414 ++++++++++++++++++++++++++---------------------- .pnp.loader.mjs | 54 ++++--- package.json | 2 +- yarn.lock | 32 ++-- 4 files changed, 274 insertions(+), 228 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index de11b24..30f4be6 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -63,7 +63,7 @@ const RAW_RUNTIME_STATE = ["prettier", "npm:2.7.1"],\ ["react", "npm:18.3.1"],\ ["react-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:18.3.1"],\ - ["react-router-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.23.1"],\ + ["react-router-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.26.1"],\ ["sass", "npm:1.77.8"],\ ["semantic-release", "npm:19.0.5"],\ ["standard-version", "npm:9.5.0"],\ @@ -1791,10 +1791,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@remix-run/router", [\ - ["npm:1.16.1", {\ - "packageLocation": "../../../../cache/others/berry/cache/@remix-run-router-npm-1.16.1-cfa8039af0-10c0.zip/node_modules/@remix-run/router/",\ + ["npm:1.19.1", {\ + "packageLocation": "../../../../cache/others/berry/cache/@remix-run-router-npm-1.19.1-61ed432c7e-10c0.zip/node_modules/@remix-run/router/",\ "packageDependencies": [\ - ["@remix-run/router", "npm:1.16.1"]\ + ["@remix-run/router", "npm:1.19.1"]\ ],\ "linkType": "HARD"\ }]\ @@ -10743,18 +10743,18 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["react-router", [\ - ["npm:6.23.1", {\ - "packageLocation": "../../../../cache/others/berry/cache/react-router-npm-6.23.1-793f9d0865-10c0.zip/node_modules/react-router/",\ + ["npm:6.26.1", {\ + "packageLocation": "../../../../cache/others/berry/cache/react-router-npm-6.26.1-cb8ea73315-10c0.zip/node_modules/react-router/",\ "packageDependencies": [\ - ["react-router", "npm:6.23.1"]\ + ["react-router", "npm:6.26.1"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:5d1bfbd91f5ab8d6399b4df3fdabbd01b93bf343140639cbfd293c599525131a7bdcf9fca658ff7afad71a45d185c1f4b536effe2edc5c1a519c17a6192d2f31#npm:6.23.1", {\ - "packageLocation": "./.yarn/__virtual__/react-router-virtual-9eb8ba00af/5/cache/others/berry/cache/react-router-npm-6.23.1-793f9d0865-10c0.zip/node_modules/react-router/",\ + ["virtual:be20902db4626d280da8bf181060121886f83d2efa3f224023e5bc903ebeb9fa77d02511989308a305562a0187b8a7c7b787324a8821f50a8684a0df658d70d5#npm:6.26.1", {\ + "packageLocation": "./.yarn/__virtual__/react-router-virtual-7bafb96065/5/cache/others/berry/cache/react-router-npm-6.26.1-cb8ea73315-10c0.zip/node_modules/react-router/",\ "packageDependencies": [\ - ["react-router", "virtual:5d1bfbd91f5ab8d6399b4df3fdabbd01b93bf343140639cbfd293c599525131a7bdcf9fca658ff7afad71a45d185c1f4b536effe2edc5c1a519c17a6192d2f31#npm:6.23.1"],\ - ["@remix-run/router", "npm:1.16.1"],\ + ["react-router", "virtual:be20902db4626d280da8bf181060121886f83d2efa3f224023e5bc903ebeb9fa77d02511989308a305562a0187b8a7c7b787324a8821f50a8684a0df658d70d5#npm:6.26.1"],\ + ["@remix-run/router", "npm:1.19.1"],\ ["@types/react", "npm:18.3.4"],\ ["react", "npm:18.3.1"]\ ],\ @@ -10766,23 +10766,23 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["react-router-dom", [\ - ["npm:6.23.1", {\ - "packageLocation": "../../../../cache/others/berry/cache/react-router-dom-npm-6.23.1-a0a4fb9537-10c0.zip/node_modules/react-router-dom/",\ + ["npm:6.26.1", {\ + "packageLocation": "../../../../cache/others/berry/cache/react-router-dom-npm-6.26.1-7932358248-10c0.zip/node_modules/react-router-dom/",\ "packageDependencies": [\ - ["react-router-dom", "npm:6.23.1"]\ + ["react-router-dom", "npm:6.26.1"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.23.1", {\ - "packageLocation": "./.yarn/__virtual__/react-router-dom-virtual-5d1bfbd91f/5/cache/others/berry/cache/react-router-dom-npm-6.23.1-a0a4fb9537-10c0.zip/node_modules/react-router-dom/",\ + ["virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.26.1", {\ + "packageLocation": "./.yarn/__virtual__/react-router-dom-virtual-be20902db4/5/cache/others/berry/cache/react-router-dom-npm-6.26.1-7932358248-10c0.zip/node_modules/react-router-dom/",\ "packageDependencies": [\ - ["react-router-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.23.1"],\ - ["@remix-run/router", "npm:1.16.1"],\ + ["react-router-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.26.1"],\ + ["@remix-run/router", "npm:1.19.1"],\ ["@types/react", "npm:18.3.4"],\ ["@types/react-dom", "npm:18.3.0"],\ ["react", "npm:18.3.1"],\ ["react-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:18.3.1"],\ - ["react-router", "virtual:5d1bfbd91f5ab8d6399b4df3fdabbd01b93bf343140639cbfd293c599525131a7bdcf9fca658ff7afad71a45d185c1f4b536effe2edc5c1a519c17a6192d2f31#npm:6.23.1"]\ + ["react-router", "virtual:be20902db4626d280da8bf181060121886f83d2efa3f224023e5bc903ebeb9fa77d02511989308a305562a0187b8a7c7b787324a8821f50a8684a0df658d70d5#npm:6.26.1"]\ ],\ "packagePeers": [\ "@types/react-dom",\ @@ -10834,7 +10834,7 @@ const RAW_RUNTIME_STATE = ["prettier", "npm:2.7.1"],\ ["react", "npm:18.3.1"],\ ["react-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:18.3.1"],\ - ["react-router-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.23.1"],\ + ["react-router-dom", "virtual:2a4e9dace022057175a083496c0ac5b75c33c32a608467b972f1b2536df13ef41f37b30a5cc92f9313818befb060475002505ecbb105b86b1a7fbf67cdbfb676#npm:6.26.1"],\ ["sass", "npm:1.77.8"],\ ["semantic-release", "npm:19.0.5"],\ ["standard-version", "npm:9.5.0"],\ @@ -13575,26 +13575,24 @@ function ERR_DIR_CLOSED() { const DEFAULT_MODE = S_IFREG | 420; class StatEntry { - constructor() { - this.uid = 0; - this.gid = 0; - this.size = 0; - this.blksize = 0; - this.atimeMs = 0; - this.mtimeMs = 0; - this.ctimeMs = 0; - this.birthtimeMs = 0; - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = 0; - this.ino = 0; - this.mode = DEFAULT_MODE; - this.nlink = 1; - this.rdev = 0; - this.blocks = 1; - } + uid = 0; + gid = 0; + size = 0; + blksize = 0; + atimeMs = 0; + mtimeMs = 0; + ctimeMs = 0; + birthtimeMs = 0; + atime = /* @__PURE__ */ new Date(0); + mtime = /* @__PURE__ */ new Date(0); + ctime = /* @__PURE__ */ new Date(0); + birthtime = /* @__PURE__ */ new Date(0); + dev = 0; + ino = 0; + mode = DEFAULT_MODE; + nlink = 1; + rdev = 0; + blocks = 1; isBlockDevice() { return false; } @@ -13618,30 +13616,28 @@ class StatEntry { } } class BigIntStatsEntry { - constructor() { - this.uid = BigInt(0); - this.gid = BigInt(0); - this.size = BigInt(0); - this.blksize = BigInt(0); - this.atimeMs = BigInt(0); - this.mtimeMs = BigInt(0); - this.ctimeMs = BigInt(0); - this.birthtimeMs = BigInt(0); - this.atimeNs = BigInt(0); - this.mtimeNs = BigInt(0); - this.ctimeNs = BigInt(0); - this.birthtimeNs = BigInt(0); - this.atime = new Date(0); - this.mtime = new Date(0); - this.ctime = new Date(0); - this.birthtime = new Date(0); - this.dev = BigInt(0); - this.ino = BigInt(0); - this.mode = BigInt(DEFAULT_MODE); - this.nlink = BigInt(1); - this.rdev = BigInt(0); - this.blocks = BigInt(1); - } + uid = BigInt(0); + gid = BigInt(0); + size = BigInt(0); + blksize = BigInt(0); + atimeMs = BigInt(0); + mtimeMs = BigInt(0); + ctimeMs = BigInt(0); + birthtimeMs = BigInt(0); + atimeNs = BigInt(0); + mtimeNs = BigInt(0); + ctimeNs = BigInt(0); + birthtimeNs = BigInt(0); + atime = /* @__PURE__ */ new Date(0); + mtime = /* @__PURE__ */ new Date(0); + ctime = /* @__PURE__ */ new Date(0); + birthtime = /* @__PURE__ */ new Date(0); + dev = BigInt(0); + ino = BigInt(0); + mode = BigInt(DEFAULT_MODE); + nlink = BigInt(1); + rdev = BigInt(0); + blocks = BigInt(1); isBlockDevice() { return false; } @@ -13676,7 +13672,7 @@ function clearStats(stats) { } else if (typeof element === `bigint`) { stats[key] = BigInt(0); } else if (nodeUtils__namespace.types.isDate(element)) { - stats[key] = new Date(0); + stats[key] = /* @__PURE__ */ new Date(0); } } } @@ -13767,6 +13763,9 @@ const Filename = { manifest: `package.json`, lockfile: `yarn.lock`, virtual: `__virtual__`, + /** + * @deprecated + */ pnpJs: `.pnp.js`, pnpCjs: `.pnp.cjs`, pnpData: `.pnp.data.json`, @@ -14048,8 +14047,8 @@ class CustomDir { this.path = path; this.nextDirent = nextDirent; this.opts = opts; - this.closed = false; } + closed = false; throwIfClosed() { if (this.closed) { throw ERR_DIR_CLOSED(); @@ -14107,21 +14106,25 @@ function assertStatus(current, expected) { } } class CustomStatWatcher extends events.EventEmitter { + fakeFs; + path; + bigint; + status = "ready" /* Ready */; + changeListeners = /* @__PURE__ */ new Map(); + lastStats; + startTimeout = null; + static create(fakeFs, path, opts) { + const statWatcher = new CustomStatWatcher(fakeFs, path, opts); + statWatcher.start(); + return statWatcher; + } constructor(fakeFs, path, { bigint = false } = {}) { super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); - this.startTimeout = null; this.fakeFs = fakeFs; this.path = path; this.bigint = bigint; this.lastStats = this.stat(); } - static create(fakeFs, path, opts) { - const statWatcher = new CustomStatWatcher(fakeFs, path, opts); - statWatcher.start(); - return statWatcher; - } start() { assertStatus(this.status, "ready" /* Ready */); this.status = "running" /* Running */; @@ -14149,6 +14152,11 @@ class CustomStatWatcher extends events.EventEmitter { return clearStats(statInstance); } } + /** + * Creates an interval whose callback compares the current stats with the previous stats and notifies all listeners in case of changes. + * + * @param opts.persistent Decides whether the interval should be immediately unref-ed. + */ makeInterval(opts) { const interval = setInterval(() => { const currentStats = this.stat(); @@ -14160,10 +14168,16 @@ class CustomStatWatcher extends events.EventEmitter { }, opts.interval); return opts.persistent ? interval : interval.unref(); } + /** + * Registers a listener and assigns it an interval. + */ registerChangeListener(listener, opts) { this.addListener("change" /* Change */, listener); this.changeListeners.set(listener, this.makeInterval(opts)); } + /** + * Unregisters the listener and clears the assigned interval. + */ unregisterChangeListener(listener) { this.removeListener("change" /* Change */, listener); const interval = this.changeListeners.get(listener); @@ -14171,6 +14185,9 @@ class CustomStatWatcher extends events.EventEmitter { clearInterval(interval); this.changeListeners.delete(listener); } + /** + * Unregisters all listeners and clears all assigned intervals. + */ unregisterAllChangeListeners() { for (const listener of this.changeListeners.keys()) { this.unregisterChangeListener(listener); @@ -14179,11 +14196,17 @@ class CustomStatWatcher extends events.EventEmitter { hasChangeListeners() { return this.changeListeners.size > 0; } + /** + * Refs all stored intervals. + */ ref() { for (const interval of this.changeListeners.values()) interval.ref(); return this; } + /** + * Unrefs all stored intervals. + */ unref() { for (const interval of this.changeListeners.values()) interval.unref(); @@ -14254,6 +14277,7 @@ function unwatchAllFiles(fakeFs) { } class FakeFS { + pathUtils; constructor(pathUtils) { this.pathUtils = pathUtils; } @@ -14862,6 +14886,7 @@ class ProxiedFS extends FakeFS { watch(p, a, b) { return this.baseFs.watch( this.mapToBase(p), + // @ts-expect-error a, b ); @@ -14869,6 +14894,7 @@ class ProxiedFS extends FakeFS { watchFile(p, a, b) { return this.baseFs.watchFile( this.mapToBase(p), + // @ts-expect-error a, b ); @@ -14892,6 +14918,7 @@ function direntToPortable(dirent) { return portableDirent; } class NodeFS extends BasePortableFakeFS { + realFs; constructor(realFs = fs__default.default) { super(); this.realFs = realFs; @@ -15287,6 +15314,7 @@ class NodeFS extends BasePortableFakeFS { watch(p, a, b) { return this.realFs.watch( npath.fromPortablePath(p), + // @ts-expect-error a, b ); @@ -15294,6 +15322,7 @@ class NodeFS extends BasePortableFakeFS { watchFile(p, a, b) { return this.realFs.watchFile( npath.fromPortablePath(p), + // @ts-expect-error a, b ); @@ -15314,16 +15343,25 @@ class NodeFS extends BasePortableFakeFS { const MOUNT_MASK = 4278190080; class MountFS extends BasePortableFakeFS { + baseFs; + mountInstances; + fdMap = /* @__PURE__ */ new Map(); + nextFd = 3; + factoryPromise; + factorySync; + filter; + getMountPoint; + magic; + maxAge; + maxOpenFiles; + typeCheck; + isMount = /* @__PURE__ */ new Set(); + notMount = /* @__PURE__ */ new Set(); + realPaths = /* @__PURE__ */ new Map(); constructor({ baseFs = new NodeFS(), filter = null, magicByte = 42, maxOpenFiles = Infinity, useCache = true, maxAge = 5e3, typeCheck = fs.constants.S_IFREG, getMountPoint, factoryPromise, factorySync }) { if (Math.floor(magicByte) !== magicByte || !(magicByte > 1 && magicByte <= 127)) throw new Error(`The magic byte must be set to a round value between 1 and 127 included`); super(); - this.fdMap = /* @__PURE__ */ new Map(); - this.nextFd = 3; - this.isMount = /* @__PURE__ */ new Set(); - this.notMount = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); - this.limitOpenFilesTimeout = null; this.baseFs = baseFs; this.mountInstances = useCache ? /* @__PURE__ */ new Map() : null; this.factoryPromise = factoryPromise; @@ -15979,12 +16017,14 @@ class MountFS extends BasePortableFakeFS { return this.makeCallSync(p, () => { return this.baseFs.watch( p, + // @ts-expect-error a, b ); }, (mountFs, { subPath }) => { return mountFs.watch( subPath, + // @ts-expect-error a, b ); @@ -15994,6 +16034,7 @@ class MountFS extends BasePortableFakeFS { return this.makeCallSync(p, () => { return this.baseFs.watchFile( p, + // @ts-expect-error a, b ); @@ -16059,6 +16100,7 @@ class MountFS extends BasePortableFakeFS { }; } } + limitOpenFilesTimeout = null; limitOpenFiles(max) { if (this.mountInstances === null) return; @@ -16148,6 +16190,7 @@ class MountFS extends BasePortableFakeFS { } class PosixFS extends ProxiedFS { + baseFs; constructor(baseFs) { super(npath); this.baseFs = baseFs; @@ -16164,10 +16207,7 @@ const NUMBER_REGEXP = /^[0-9]+$/; const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } + baseFs; static makeVirtualPath(base, component, to) { if (ppath.basename(base) !== `__virtual__`) throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); @@ -16197,6 +16237,10 @@ class VirtualFS extends ProxiedFS { const subpath = match[5] || `.`; return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); } + constructor({ baseFs = new NodeFS() } = {}) { + super(ppath); + this.baseFs = baseFs; + } getExtractHint(hints) { return this.baseFs.getExtractHint(hints); } @@ -16238,6 +16282,7 @@ class VirtualFS extends ProxiedFS { const URL = Number(process.versions.node.split('.', 1)[0]) < 20 ? url.URL : globalThis.URL; class NodePathFS extends ProxiedFS { + baseFs; constructor(baseFs) { super(npath); this.baseFs = baseFs; @@ -16265,7 +16310,6 @@ function isUtf8(buf, str) { return Buffer.byteLength(str) === buf.byteLength; } -var _a, _b, _c, _d; const kBaseFs = Symbol(`kBaseFs`); const kFd = Symbol(`kFd`); const kClosePromise = Symbol(`kClosePromise`); @@ -16275,11 +16319,13 @@ const kRefs = Symbol(`kRefs`); const kRef = Symbol(`kRef`); const kUnref = Symbol(`kUnref`); class FileHandle { + [kBaseFs]; + [kFd]; + [kRefs] = 1; + [kClosePromise] = void 0; + [kCloseResolve] = void 0; + [kCloseReject] = void 0; constructor(fd, baseFs) { - this[_a] = 1; - this[_b] = void 0; - this[_c] = void 0; - this[_d] = void 0; this[kBaseFs] = baseFs; this[kFd] = fd; } @@ -16317,9 +16363,11 @@ class FileHandle { createWriteStream(options) { return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); } + // FIXME: Missing FakeFS version datasync() { throw new Error(`Method not implemented.`); } + // FIXME: Missing FakeFS version sync() { throw new Error(`Method not implemented.`); } @@ -16384,6 +16432,7 @@ class FileHandle { this[kUnref](); } } + // FIXME: Missing FakeFS version utimes(atime, mtime) { throw new Error(`Method not implemented.`); } @@ -16412,6 +16461,7 @@ class FileHandle { this[kUnref](); } } + // TODO: Use writev from FakeFS when that is implemented async writev(buffers, position) { try { this[kRef](this.writev); @@ -16436,14 +16486,13 @@ class FileHandle { this[kUnref](); } } + // FIXME: Missing FakeFS version readv(buffers, position) { throw new Error(`Method not implemented.`); } close() { - if (this[kFd] === -1) - return Promise.resolve(); - if (this[kClosePromise]) - return this[kClosePromise]; + if (this[kFd] === -1) return Promise.resolve(); + if (this[kClosePromise]) return this[kClosePromise]; this[kRefs]--; if (this[kRefs] === 0) { const fd = this[kFd]; @@ -16463,7 +16512,7 @@ class FileHandle { } return this[kClosePromise]; } - [(_a = kRefs, _b = kClosePromise, _c = kCloseResolve, _d = kCloseReject, kRef)](caller) { + [kRef](caller) { if (this[kFd] === -1) { const err = new Error(`file closed`); err.code = `EBADF`; @@ -16723,8 +16772,7 @@ var libzipSync = {exports: {}}; var frozenFs = Object.assign({}, fs__default.default); var createModule = function() { var _scriptDir = void 0; - if (typeof __filename !== "undefined") - _scriptDir = _scriptDir || __filename; + if (typeof __filename !== "undefined") _scriptDir = _scriptDir || __filename; return function(createModule2) { createModule2 = createModule2 || {}; var Module = typeof createModule2 !== "undefined" ? createModule2 : {}; @@ -16759,10 +16807,8 @@ var createModule = function() { if (ret) { return binary ? ret : ret.toString(); } - if (!nodeFS) - nodeFS = frozenFs; - if (!nodePath) - nodePath = path__default.default; + if (!nodeFS) nodeFS = frozenFs; + if (!nodePath) nodePath = path__default.default; filename = nodePath["normalize"](filename); return nodeFS["readFileSync"](filename, binary ? null : "utf8"); }; @@ -16790,23 +16836,18 @@ var createModule = function() { } } moduleOverrides = null; - if (Module["arguments"]) - ; - if (Module["thisProgram"]) - ; - if (Module["quit"]) - ; + if (Module["arguments"]) ; + if (Module["thisProgram"]) ; + if (Module["quit"]) ; var wasmBinary; - if (Module["wasmBinary"]) - wasmBinary = Module["wasmBinary"]; + if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; Module["noExitRuntime"] || true; if (typeof WebAssembly !== "object") { abort("no native wasm support detected"); } function getValue(ptr, type, noSafe) { type = type || "i8"; - if (type.charAt(type.length - 1) === "*") - type = "i32"; + if (type.charAt(type.length - 1) === "*") type = "i32"; switch (type) { case "i1": return HEAP8[ptr >> 0]; @@ -16860,10 +16901,8 @@ var createModule = function() { } }; function convertReturnValue(ret2) { - if (returnType === "string") - return UTF8ToString(ret2); - if (returnType === "boolean") - return Boolean(ret2); + if (returnType === "string") return UTF8ToString(ret2); + if (returnType === "boolean") return Boolean(ret2); return ret2; } var func = getCFunc(ident); @@ -16873,8 +16912,7 @@ var createModule = function() { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { - if (stack === 0) - stack = stackSave(); + if (stack === 0) stack = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; @@ -16883,8 +16921,7 @@ var createModule = function() { } var ret = func.apply(null, cArgs); ret = convertReturnValue(ret); - if (stack !== 0) - stackRestore(stack); + if (stack !== 0) stackRestore(stack); return ret; } function cwrap(ident, returnType, argTypes, opts) { @@ -16902,16 +16939,13 @@ var createModule = function() { } var UTF8Decoder = new TextDecoder("utf8"); function UTF8ToString(ptr, maxBytesToRead) { - if (!ptr) - return ""; + if (!ptr) return ""; var maxPtr = ptr + maxBytesToRead; - for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) - ++end; + for (var end = ptr; !(end >= maxPtr) && HEAPU8[end]; ) ++end; return UTF8Decoder.decode(HEAPU8.subarray(ptr, end)); } function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) - return 0; + if (!(maxBytesToWrite > 0)) return 0; var startIdx = outIdx; var endIdx = outIdx + maxBytesToWrite - 1; for (var i = 0; i < str.length; ++i) { @@ -16921,23 +16955,19 @@ var createModule = function() { u = 65536 + ((u & 1023) << 10) | u1 & 1023; } if (u <= 127) { - if (outIdx >= endIdx) - break; + if (outIdx >= endIdx) break; heap[outIdx++] = u; } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) - break; + if (outIdx + 1 >= endIdx) break; heap[outIdx++] = 192 | u >> 6; heap[outIdx++] = 128 | u & 63; } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) - break; + if (outIdx + 2 >= endIdx) break; heap[outIdx++] = 224 | u >> 12; heap[outIdx++] = 128 | u >> 6 & 63; heap[outIdx++] = 128 | u & 63; } else { - if (outIdx + 3 >= endIdx) - break; + if (outIdx + 3 >= endIdx) break; heap[outIdx++] = 240 | u >> 18; heap[outIdx++] = 128 | u >> 12 & 63; heap[outIdx++] = 128 | u >> 6 & 63; @@ -16956,22 +16986,17 @@ var createModule = function() { var u = str.charCodeAt(i); if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023; - if (u <= 127) - ++len; - else if (u <= 2047) - len += 2; - else if (u <= 65535) - len += 3; - else - len += 4; + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4; } return len; } function allocateUTF8(str) { var size = lengthBytesUTF8(str) + 1; var ret = _malloc(size); - if (ret) - stringToUTF8Array(str, HEAP8, ret, size); + if (ret) stringToUTF8Array(str, HEAP8, ret, size); return ret; } function writeArrayToMemory(array, buffer2) { @@ -17188,8 +17213,7 @@ var createModule = function() { var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0; LE_HEAP_STORE_I32((tmPtr + 28 >> 2) * 4, yday); - if (!_gmtime_r.GMTString) - _gmtime_r.GMTString = allocateUTF8("GMT"); + if (!_gmtime_r.GMTString) _gmtime_r.GMTString = allocateUTF8("GMT"); LE_HEAP_STORE_I32((tmPtr + 40 >> 2) * 4, _gmtime_r.GMTString); return tmPtr; } @@ -17241,10 +17265,9 @@ var createModule = function() { return ret; } function _tzset() { - if (_tzset.called) - return; + if (_tzset.called) return; _tzset.called = true; - var currentYear = new Date().getFullYear(); + var currentYear = (/* @__PURE__ */ new Date()).getFullYear(); var winter = new Date(currentYear, 0, 1); var summer = new Date(currentYear, 6, 1); var winterOffset = winter.getTimezoneOffset(); @@ -17372,10 +17395,8 @@ var createModule = function() { Module["getValue"] = getValue; var calledRun; dependenciesFulfilled = function runCaller() { - if (!calledRun) - run(); - if (!calledRun) - dependenciesFulfilled = runCaller; + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; }; function run(args) { if (runDependencies > 0) { @@ -17386,16 +17407,13 @@ var createModule = function() { return; } function doRun() { - if (calledRun) - return; + if (calledRun) return; calledRun = true; Module["calledRun"] = true; - if (ABORT) - return; + if (ABORT) return; initRuntime(); readyPromiseResolve(Module); - if (Module["onRuntimeInitialized"]) - Module["onRuntimeInitialized"](); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); postRun(); } if (Module["setStatus"]) { @@ -17429,7 +17447,9 @@ const createModule = libzipSync.exports; const number64 = [ `number`, + // low `number` + // high ]; var Errors = /* @__PURE__ */ ((Errors2) => { Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; @@ -17467,6 +17487,7 @@ var Errors = /* @__PURE__ */ ((Errors2) => { return Errors2; })(Errors || {}); const makeInterface = (emZip) => ({ + // Those are getters because they can change after memory growth get HEAPU8() { return emZip.HEAPU8; }, @@ -17669,6 +17690,7 @@ function makeEmptyArchive() { ]); } class LibzipError extends Error { + code; constructor(message, code) { super(message); this.name = `Libzip Error`; @@ -17676,15 +17698,28 @@ class LibzipError extends Error { } } class ZipFS extends BasePortableFakeFS { + libzip; + baseFs; + path; + stats; + zip; + lzSource; + level; + listings = /* @__PURE__ */ new Map(); + entries = /* @__PURE__ */ new Map(); + /** + * A cache of indices mapped to file sources. + * Populated by `setFileSource` calls. + * Required for supporting read after write. + */ + fileSources = /* @__PURE__ */ new Map(); + symlinkCount; + fds = /* @__PURE__ */ new Map(); + nextFd = 0; + ready = false; + readOnly = false; constructor(source, opts = {}) { super(); - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); - this.nextFd = 0; - this.ready = false; - this.readOnly = false; const pathOptions = opts; this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; source ??= makeEmptyArchive(); @@ -17933,6 +17968,7 @@ class ZipFS extends BasePortableFakeFS { }, bytesRead: 0, path: p, + // "This property is `true` if the underlying file has not been opened yet" pending: false } ); @@ -17979,6 +18015,7 @@ class ZipFS extends BasePortableFakeFS { }, bytesWritten: 0, path: p, + // "This property is `true` if the underlying file has not been opened yet" pending: false } ); @@ -19118,6 +19155,8 @@ function hydrateRuntimeState(data, { basePath }) { packagePeers: new Set(packageInformationData.packagePeers), linkType: packageInformationData.linkType, discardFromLookup, + // we only need this for packages that are used by the currently running script + // this is a lazy getter because `ppath.join` has some overhead get packageLocation() { return resolvedPackageLocation || (resolvedPackageLocation = ppath.join(absolutePortablePath, packageInformationData.packageLocation)); } @@ -19379,8 +19418,7 @@ function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base const packagePath = new URL(".", packageJSONUrl).pathname; if (!StringPrototypeStartsWith(resolvedPath, packagePath)) throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; + if (subpath === "") return resolved; if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; throwInvalidSubpath(request, packageJSONUrl, internal, base); @@ -19394,8 +19432,7 @@ function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base } function isArrayIndex(key) { const keyNum = +key; - if (`${keyNum}` !== key) - return false; + if (`${keyNum}` !== key) return false; return keyNum >= 0 && keyNum < 4294967295; } function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { @@ -19472,8 +19509,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, b internal, conditions ); - if (resolveResult === void 0) - continue; + if (resolveResult === void 0) continue; return resolveResult; } } @@ -19494,25 +19530,17 @@ function patternKeyCompare(a, b) { const bPatternIndex = StringPrototypeIndexOf(b, "*"); const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - if (baseLenA > baseLenB) - return -1; - if (baseLenB > baseLenA) - return 1; - if (aPatternIndex === -1) - return 1; - if (bPatternIndex === -1) - return -1; - if (a.length > b.length) - return -1; - if (b.length > a.length) - return 1; + if (baseLenA > baseLenB) return -1; + if (baseLenB > baseLenA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; return 0; } function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { - if (typeof exports === "string" || ArrayIsArray(exports)) - return true; - if (typeof exports !== "object" || exports === null) - return false; + if (typeof exports === "string" || ArrayIsArray(exports)) return true; + if (typeof exports !== "object" || exports === null) return false; const keys = ObjectGetOwnPropertyNames(exports); let isConditionalSugar = false; let i = 0; @@ -19541,8 +19569,7 @@ function throwExportsNotFound(subpath, packageJSONUrl, base) { const emittedPackageWarnings = /* @__PURE__ */ new Set(); function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { const pjsonPath = url.fileURLToPath(pjsonUrl); - if (emittedPackageWarnings.has(pjsonPath + "|" + match)) - return; + if (emittedPackageWarnings.has(pjsonPath + "|" + match)) return; emittedPackageWarnings.add(pjsonPath + "|" + match); process.emitWarning( `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, @@ -20811,9 +20838,9 @@ const defaultFsLayer = new VirtualFS({ }) }); class DynamicFS extends ProxiedFS { + baseFs = defaultFsLayer; constructor() { super(ppath); - this.baseFs = defaultFsLayer; } mapToBase(p) { return p; @@ -20828,6 +20855,11 @@ const defaultApi = Object.assign(makeApi(defaultRuntimeState, { fakeFs: dynamicFsLayer, pnpapiResolution: defaultPnpapiResolution }), { + /** + * Can be used to generate a different API than the default one (for example + * to map it on `/` rather than the local directory path, or to use a + * different FS layer than the default one). + */ makeApi: ({ basePath = void 0, fakeFs = dynamicFsLayer, @@ -20841,6 +20873,10 @@ const defaultApi = Object.assign(makeApi(defaultRuntimeState, { ...rest }); }, + /** + * Will inject the specified API into the environment, monkey-patching FS. Is + * automatically called when the hook is loaded through `--require`. + */ setup: (api) => { applyPatch(api || defaultApi, { fakeFs: defaultFsLayer, diff --git a/.pnp.loader.mjs b/.pnp.loader.mjs index 0d28791..e5a5429 100644 --- a/.pnp.loader.mjs +++ b/.pnp.loader.mjs @@ -286,6 +286,7 @@ async function copySymlink(prelayout, postlayout, destinationFs, destination, de } class FakeFS { + pathUtils; constructor(pathUtils) { this.pathUtils = pathUtils; } @@ -894,6 +895,7 @@ class ProxiedFS extends FakeFS { watch(p, a, b) { return this.baseFs.watch( this.mapToBase(p), + // @ts-expect-error a, b ); @@ -901,6 +903,7 @@ class ProxiedFS extends FakeFS { watchFile(p, a, b) { return this.baseFs.watchFile( this.mapToBase(p), + // @ts-expect-error a, b ); @@ -924,6 +927,7 @@ function direntToPortable(dirent) { return portableDirent; } class NodeFS extends BasePortableFakeFS { + realFs; constructor(realFs = fs) { super(); this.realFs = realFs; @@ -1319,6 +1323,7 @@ class NodeFS extends BasePortableFakeFS { watch(p, a, b) { return this.realFs.watch( npath.fromPortablePath(p), + // @ts-expect-error a, b ); @@ -1326,6 +1331,7 @@ class NodeFS extends BasePortableFakeFS { watchFile(p, a, b) { return this.realFs.watchFile( npath.fromPortablePath(p), + // @ts-expect-error a, b ); @@ -1348,10 +1354,7 @@ const NUMBER_REGEXP = /^[0-9]+$/; const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; class VirtualFS extends ProxiedFS { - constructor({ baseFs = new NodeFS() } = {}) { - super(ppath); - this.baseFs = baseFs; - } + baseFs; static makeVirtualPath(base, component, to) { if (ppath.basename(base) !== `__virtual__`) throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); @@ -1381,6 +1384,10 @@ class VirtualFS extends ProxiedFS { const subpath = match[5] || `.`; return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); } + constructor({ baseFs = new NodeFS() } = {}) { + super(ppath); + this.baseFs = baseFs; + } getExtractHint(hints) { return this.baseFs.getExtractHint(hints); } @@ -1777,8 +1784,7 @@ function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base const packagePath = new URL(".", packageJSONUrl).pathname; if (!StringPrototypeStartsWith(resolvedPath, packagePath)) throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; + if (subpath === "") return resolved; if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; throwInvalidSubpath(request, packageJSONUrl, internal, base); @@ -1792,8 +1798,7 @@ function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base } function isArrayIndex(key) { const keyNum = +key; - if (`${keyNum}` !== key) - return false; + if (`${keyNum}` !== key) return false; return keyNum >= 0 && keyNum < 4294967295; } function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { @@ -1870,8 +1875,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, b internal, conditions ); - if (resolveResult === void 0) - continue; + if (resolveResult === void 0) continue; return resolveResult; } } @@ -1892,18 +1896,12 @@ function patternKeyCompare(a, b) { const bPatternIndex = StringPrototypeIndexOf(b, "*"); const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; - if (baseLenA > baseLenB) - return -1; - if (baseLenB > baseLenA) - return 1; - if (aPatternIndex === -1) - return 1; - if (bPatternIndex === -1) - return -1; - if (a.length > b.length) - return -1; - if (b.length > a.length) - return 1; + if (baseLenA > baseLenB) return -1; + if (baseLenB > baseLenA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; return 0; } function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { @@ -2044,6 +2042,7 @@ async function resolve$1(originalSpecifier, context, nextResolve) { try { result = pnpapi.resolveRequest(specifier, issuer, { conditions: new Set(conditions), + // TODO: Handle --experimental-specifier-resolution=node extensions: allowLegacyResolve ? void 0 : [] }); } catch (err) { @@ -2074,6 +2073,9 @@ if (!HAS_LAZY_LOADED_TRANSLATORS) { try { return fs.readFileSync(args[0], { encoding: `utf8`, + // @ts-expect-error - The docs says it needs to be a string but + // links to https://nodejs.org/dist/latest-v20.x/docs/api/fs.html#file-system-flags + // which says it can be a number which matches the implementation. flag: args[1] }); } catch { @@ -2101,6 +2103,14 @@ if (!HAS_LAZY_LOADED_TRANSLATORS) { stats.ino, stats.size, stats.blocks + // atime sec + // atime ns + // mtime sec + // mtime ns + // ctime sec + // ctime ns + // birthtime sec + // birthtime ns ]); } catch { } diff --git a/package.json b/package.json index 5d7d916..1aeea72 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "react": "18.3.1", "react-dom": "18.3.1", - "react-router-dom": "6.23.1" + "react-router-dom": "6.26.1" }, "devDependencies": { "@commitlint/cli": "17.8.1", diff --git a/yarn.lock b/yarn.lock index bce7727..87d6c34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1438,10 +1438,10 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.16.1": - version: 1.16.1 - resolution: "@remix-run/router@npm:1.16.1" - checksum: 10c0/5f1b0aef4924830eeab9c86dcaa5af8157066e5de65b449e7fdf406532b2384828a46a447c31b0735fd713a06938dd88bfd4e566d9989be70c770457dda16c92 +"@remix-run/router@npm:1.19.1": + version: 1.19.1 + resolution: "@remix-run/router@npm:1.19.1" + checksum: 10c0/9101fc96646e5107b6b0ef248d4c93bd965590c37ac02d35bcc57d1902467db7fc6eeec0a1fb97d0ce5bc96fae58e75239555e44a983239a61badba18e82d3b8 languageName: node linkType: hard @@ -8947,27 +8947,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:6.23.1": - version: 6.23.1 - resolution: "react-router-dom@npm:6.23.1" +"react-router-dom@npm:6.26.1": + version: 6.26.1 + resolution: "react-router-dom@npm:6.26.1" dependencies: - "@remix-run/router": "npm:1.16.1" - react-router: "npm:6.23.1" + "@remix-run/router": "npm:1.19.1" + react-router: "npm:6.26.1" peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: 10c0/01b954d7d0ff4c53bb2edbc816458f3fad1ce9ee49a4dfdc5c866065c23026c9cce429b46b754cbaebb83b22cfe5f605bbf441acf515e3c377cbdf021b0bec4c + checksum: 10c0/9d9d8ed54d1c95497c6fa35a6ab46992efeccf1cfc6f0f6089c6c9b040af3eae09568fbb80c690bae08051a955d92d7aa3a0e730f626eb69285114993d31d430 languageName: node linkType: hard -"react-router@npm:6.23.1": - version: 6.23.1 - resolution: "react-router@npm:6.23.1" +"react-router@npm:6.26.1": + version: 6.26.1 + resolution: "react-router@npm:6.26.1" dependencies: - "@remix-run/router": "npm:1.16.1" + "@remix-run/router": "npm:1.19.1" peerDependencies: react: ">=16.8" - checksum: 10c0/091949805745136350ab049b2a96281bf38742c9d3651019fb48ea79c5eafbfb0379f1d3e636602dd56b0ef278389e8fd25be983dc2c0ffd1103d06dfa8019f3 + checksum: 10c0/463078e740462b42bb5ba8004448f33fc9e63778f432a4ed55c57b93c5b519e25fb17913ee8435b0fda33c6b9f75df8ef6fcb2c3a4f8db84fb546d202e29aa51 languageName: node linkType: hard @@ -9011,7 +9011,7 @@ __metadata: prettier: "npm:2.7.1" react: "npm:18.3.1" react-dom: "npm:18.3.1" - react-router-dom: "npm:6.23.1" + react-router-dom: "npm:6.26.1" sass: "npm:1.77.8" semantic-release: "npm:19.0.5" standard-version: "npm:9.5.0"