From 3e7dc7b53cce75d386fd86a14fd14f4c412e7c22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 18:32:20 +0000 Subject: [PATCH] build(deps): Bump ua-parser-js from 0.7.32 to 0.7.33 Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.32 to 0.7.33. - [Release notes](https://github.com/faisalman/ua-parser-js/releases) - [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md) - [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.32...0.7.33) --- updated-dependencies: - dependency-name: ua-parser-js dependency-type: indirect ... Signed-off-by: dependabot[bot] --- .pnp.cjs | 2005 +++++++++++++++------------------------------ package-lock.json | 88 +- yarn.lock | 10 +- 3 files changed, 744 insertions(+), 1359 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 96a0898..47b1f5d 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -1,6 +1,11 @@ #!/usr/bin/env node /* eslint-disable */ -"use strict"; + +try { + Object.freeze({}).detectStrictMode = true; +} catch (error) { + throw new Error(`The whole PnP file got strict-mode-ified, which is known to break (Emscripten libraries aren't strict mode). This usually happens when the file goes through Babel.`); +} function $$SETUP_STATE(hydrateRuntimeState, basePath) { return hydrateRuntimeState(JSON.parse('{\ @@ -294,7 +299,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["gensync", "npm:1.0.0-beta.2"],\ ["json5", "npm:2.2.2"],\ ["lodash", "npm:4.17.21"],\ - ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d"],\ + ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b"],\ ["semver", "npm:5.7.1"],\ ["source-map", "npm:0.5.7"]\ ],\ @@ -453,7 +458,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/babel__core", null],\ ["debug", "virtual:dc0e9498d700f80ca3b0d172d2c879b3b5c09eb83d3efd647256b1daa54c605273cda90b8697936295a53fe89b5505efe928551dbf95d9b7e6c2bba5a81cb59c#npm:4.3.4"],\ ["lodash.debounce", "npm:4.0.8"],\ - ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d"],\ + ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b"],\ ["semver", "npm:6.3.0"]\ ],\ "packagePeers": [\ @@ -6085,7 +6090,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["chokidar", "npm:3.5.3"],\ ["anymatch", "npm:3.1.3"],\ ["braces", "npm:3.0.2"],\ - ["fsevents", "patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1"],\ + ["fsevents", "patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7"],\ ["glob-parent", "npm:5.1.2"],\ ["is-binary-path", "npm:2.1.0"],\ ["is-glob", "npm:4.0.3"],\ @@ -7731,7 +7736,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["object-assign", "npm:4.1.1"],\ ["promise", "npm:7.3.1"],\ ["setimmediate", "npm:1.0.5"],\ - ["ua-parser-js", "npm:0.7.32"]\ + ["ua-parser-js", "npm:0.7.33"]\ ],\ "linkType": "HARD"\ }]\ @@ -8026,10 +8031,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["fsevents", [\ - ["patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1", {\ - "packageLocation": "./.yarn/unplugged/fsevents-patch-2882183fbf/node_modules/fsevents/",\ + ["patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7", {\ + "packageLocation": "./.yarn/unplugged/fsevents-patch-3340e2eb10/node_modules/fsevents/",\ "packageDependencies": [\ - ["fsevents", "patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1"],\ + ["fsevents", "patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7"],\ ["node-gyp", "npm:9.3.1"]\ ],\ "linkType": "HARD"\ @@ -12424,7 +12429,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageLocation": "./.yarn/cache/rechoir-npm-0.6.2-0df5f171ec-fe76bf9c21.zip/node_modules/rechoir/",\ "packageDependencies": [\ ["rechoir", "npm:0.6.2"],\ - ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d"]\ + ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b"]\ ],\ "linkType": "HARD"\ }]\ @@ -12664,10 +12669,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["resolve", [\ - ["patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d", {\ - "packageLocation": "./.yarn/cache/resolve-patch-0c52e0e4f7-5656f4d0be.zip/node_modules/resolve/",\ + ["patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b", {\ + "packageLocation": "./.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip/node_modules/resolve/",\ "packageDependencies": [\ - ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d"],\ + ["resolve", "patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b"],\ ["is-core-module", "npm:2.11.0"],\ ["path-parse", "npm:1.0.7"],\ ["supports-preserve-symlinks-flag", "npm:1.0.0"]\ @@ -13809,10 +13814,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["ua-parser-js", [\ - ["npm:0.7.32", {\ - "packageLocation": "./.yarn/cache/ua-parser-js-npm-0.7.32-8b96a27c56-6b6b035dd7.zip/node_modules/ua-parser-js/",\ + ["npm:0.7.33", {\ + "packageLocation": "./.yarn/cache/ua-parser-js-npm-0.7.33-4d3f482ab6-1510e9ec26.zip/node_modules/ua-parser-js/",\ "packageDependencies": [\ - ["ua-parser-js", "npm:0.7.32"]\ + ["ua-parser-js", "npm:0.7.33"]\ ],\ "linkType": "HARD"\ }]\ @@ -14793,7 +14798,6 @@ const StringDecoder = require('string_decoder'); const url = require('url'); const os = require('os'); const nodeUtils = require('util'); -const assert = require('assert'); const stream = require('stream'); const zlib = require('zlib'); const events = require('events'); @@ -14823,7 +14827,6 @@ const path__default = /*#__PURE__*/_interopDefaultLegacy(path); const require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); const StringDecoder__default = /*#__PURE__*/_interopDefaultLegacy(StringDecoder); const nodeUtils__namespace = /*#__PURE__*/_interopNamespace(nodeUtils); -const assert__default = /*#__PURE__*/_interopDefaultLegacy(assert); const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); const S_IFMT = 61440; @@ -15015,10 +15018,15 @@ function areStatsEqual(a, b) { return true; } +var PathType; +(function(PathType2) { + PathType2[PathType2["File"] = 0] = "File"; + PathType2[PathType2["Portable"] = 1] = "Portable"; + PathType2[PathType2["Native"] = 2] = "Native"; +})(PathType || (PathType = {})); const PortablePath = { root: `/`, - dot: `.`, - parent: `..` + dot: `.` }; const Filename = { nodeModules: `node_modules`, @@ -15088,16 +15096,40 @@ function convertPath(targetPathUtils, sourcePath) { return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); } +var __defProp$5 = Object.defineProperty; +var __defProps$3 = Object.defineProperties; +var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols; +var __hasOwnProp$6 = Object.prototype.hasOwnProperty; +var __propIsEnum$6 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; +var __spreadValues$5 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$6.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); + if (__getOwnPropSymbols$6) + for (var prop of __getOwnPropSymbols$6(b)) { + if (__propIsEnum$6.call(b, prop)) + __defNormalProp$5(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b)); const defaultTime = new Date(SAFE_TIME * 1e3); +var LinkStrategy; +(function(LinkStrategy2) { + LinkStrategy2["Allow"] = `allow`; + LinkStrategy2["ReadOnly"] = `readOnly`; +})(LinkStrategy || (LinkStrategy = {})); async function copyPromise(destinationFs, destination, sourceFs, source, opts) { const normalizedDestination = destinationFs.pathUtils.normalize(destination); const normalizedSource = sourceFs.pathUtils.normalize(source); const prelayout = []; const postlayout = []; - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : await sourceFs.lstatPromise(normalizedSource); - await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), { utimes: [atime, mtime] }); + const {atime, mtime} = opts.stableTime ? {atime: defaultTime, mtime: defaultTime} : await sourceFs.lstatPromise(normalizedSource); + await destinationFs.mkdirpPromise(destinationFs.pathUtils.dirname(destination), {utimes: [atime, mtime]}); const updateTime = typeof destinationFs.lutimesPromise === `function` ? destinationFs.lutimesPromise.bind(destinationFs) : destinationFs.utimesPromise.bind(destinationFs); - await copyImpl(prelayout, postlayout, updateTime, destinationFs, normalizedDestination, sourceFs, normalizedSource, { ...opts, didParentExist: true }); + await copyImpl(prelayout, postlayout, updateTime, destinationFs, normalizedDestination, sourceFs, normalizedSource, __spreadProps$3(__spreadValues$5({}, opts), {didParentExist: true})); for (const operation of prelayout) await operation(); await Promise.all(postlayout.map((operation) => { @@ -15108,7 +15140,7 @@ async function copyImpl(prelayout, postlayout, updateTime, destinationFs, destin var _a, _b; const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null; const sourceStat = await sourceFs.lstatPromise(source); - const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat; + const {atime, mtime} = opts.stableTime ? {atime: defaultTime, mtime: defaultTime} : sourceStat; let updated; switch (true) { case sourceStat.isDirectory(): @@ -15161,7 +15193,7 @@ async function copyFolder(prelayout, postlayout, updateTime, destinationFs, dest if (destinationStat === null) { prelayout.push(async () => { try { - await destinationFs.mkdirPromise(destination, { mode: sourceStat.mode }); + await destinationFs.mkdirPromise(destination, {mode: sourceStat.mode}); } catch (err) { if (err.code !== `EEXIST`) { throw err; @@ -15171,7 +15203,7 @@ async function copyFolder(prelayout, postlayout, updateTime, destinationFs, dest updated = true; } const entries = await sourceFs.readdirPromise(source); - const nextOpts = opts.didParentExist && !destinationStat ? { ...opts, didParentExist: false } : opts; + const nextOpts = opts.didParentExist && !destinationStat ? __spreadProps$3(__spreadValues$5({}, opts), {didParentExist: false}) : opts; if (opts.stableSort) { for (const entry of entries.sort()) { if (await copyImpl(prelayout, postlayout, updateTime, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), nextOpts)) { @@ -15188,11 +15220,11 @@ async function copyFolder(prelayout, postlayout, updateTime, destinationFs, dest } return updated; } -const isCloneSupportedCache = /* @__PURE__ */ new WeakMap(); +const isCloneSupportedCache = new WeakMap(); function makeLinkOperation(opFs, destination, source, sourceStat, linkStrategy) { return async () => { await opFs.linkPromise(source, destination); - if (linkStrategy === "readOnly" /* ReadOnly */) { + if (linkStrategy === LinkStrategy.ReadOnly) { sourceStat.mode &= ~146; await opFs.chmodPromise(destination, sourceStat.mode); } @@ -15253,7 +15285,7 @@ async function copySymlink(prelayout, postlayout, updateTime, destinationFs, des } function makeError$1(code, message) { - return Object.assign(new Error(`${code}: ${message}`), { code }); + return Object.assign(new Error(`${code}: ${message}`), {code}); } function EBUSY(message) { return makeError$1(`EBUSY`, message); @@ -15360,7 +15392,7 @@ class FakeFS { constructor(pathUtils) { this.pathUtils = pathUtils; } - async *genTraversePromise(init, { stableSort = false } = {}) { + async *genTraversePromise(init, {stableSort = false} = {}) { const stack = [init]; while (stack.length > 0) { const p = stack.shift(); @@ -15379,7 +15411,7 @@ class FakeFS { } } } - async removePromise(p, { recursive = true, maxRetries = 5 } = {}) { + async removePromise(p, {recursive = true, maxRetries = 5} = {}) { let stat; try { stat = await this.lstatPromise(p); @@ -15413,7 +15445,7 @@ class FakeFS { await this.unlinkPromise(p); } } - removeSync(p, { recursive = true } = {}) { + removeSync(p, {recursive = true} = {}) { let stat; try { stat = this.lstatSync(p); @@ -15433,7 +15465,7 @@ class FakeFS { this.unlinkSync(p); } } - async mkdirpPromise(p, { chmod, utimes } = {}) { + async mkdirpPromise(p, {chmod, utimes} = {}) { p = this.resolve(p); if (p === this.pathUtils.dirname(p)) return void 0; @@ -15464,7 +15496,7 @@ class FakeFS { } return createdDirectory; } - mkdirpSync(p, { chmod, utimes } = {}) { + mkdirpSync(p, {chmod, utimes} = {}) { p = this.resolve(p); if (p === this.pathUtils.dirname(p)) return void 0; @@ -15495,17 +15527,17 @@ class FakeFS { } return createdDirectory; } - async copyPromise(destination, source, { baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null } = {}) { - return await copyPromise(this, destination, baseFs, source, { overwrite, stableSort, stableTime, linkStrategy }); + async copyPromise(destination, source, {baseFs = this, overwrite = true, stableSort = false, stableTime = false, linkStrategy = null} = {}) { + return await copyPromise(this, destination, baseFs, source, {overwrite, stableSort, stableTime, linkStrategy}); } - copySync(destination, source, { baseFs = this, overwrite = true } = {}) { + copySync(destination, source, {baseFs = this, overwrite = true} = {}) { const stat = baseFs.lstatSync(source); const exists = this.existsSync(destination); if (stat.isDirectory()) { this.mkdirpSync(destination); const directoryListing = baseFs.readdirSync(source); for (const entry of directoryListing) { - this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { baseFs, overwrite }); + this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), {baseFs, overwrite}); } } else if (stat.isFile()) { if (!exists || overwrite) { @@ -15534,7 +15566,7 @@ class FakeFS { return this.changeFileTextPromise(p, content, opts); } } - async changeFileBufferPromise(p, content, { mode } = {}) { + async changeFileBufferPromise(p, content, {mode} = {}) { let current = Buffer.alloc(0); try { current = await this.readFilePromise(p); @@ -15542,9 +15574,9 @@ class FakeFS { } if (Buffer.compare(current, content) === 0) return; - await this.writeFilePromise(p, content, { mode }); + await this.writeFilePromise(p, content, {mode}); } - async changeFileTextPromise(p, content, { automaticNewlines, mode } = {}) { + async changeFileTextPromise(p, content, {automaticNewlines, mode} = {}) { let current = ``; try { current = await this.readFilePromise(p, `utf8`); @@ -15553,7 +15585,7 @@ class FakeFS { const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; if (current === normalizedContent) return; - await this.writeFilePromise(p, normalizedContent, { mode }); + await this.writeFilePromise(p, normalizedContent, {mode}); } changeFileSync(p, content, opts = {}) { if (Buffer.isBuffer(content)) { @@ -15562,7 +15594,7 @@ class FakeFS { return this.changeFileTextSync(p, content, opts); } } - changeFileBufferSync(p, content, { mode } = {}) { + changeFileBufferSync(p, content, {mode} = {}) { let current = Buffer.alloc(0); try { current = this.readFileSync(p); @@ -15570,9 +15602,9 @@ class FakeFS { } if (Buffer.compare(current, content) === 0) return; - this.writeFileSync(p, content, { mode }); + this.writeFileSync(p, content, {mode}); } - changeFileTextSync(p, content, { automaticNewlines = false, mode } = {}) { + changeFileTextSync(p, content, {automaticNewlines = false, mode} = {}) { let current = ``; try { current = this.readFileSync(p, `utf8`); @@ -15581,7 +15613,7 @@ class FakeFS { const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; if (current === normalizedContent) return; - this.writeFileSync(p, normalizedContent, { mode }); + this.writeFileSync(p, normalizedContent, {mode}); } async movePromise(fromP, toP) { try { @@ -15762,12 +15794,12 @@ class NodeFS extends BasePortableFakeFS { this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); } }).then((dir) => { - return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true }); + return Object.defineProperty(dir, `path`, {value: p, configurable: true, writable: true}); }); } opendirSync(p, opts) { const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); - return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true }); + return Object.defineProperty(dir, `path`, {value: p, configurable: true, writable: true}); } async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { return await new Promise((resolve, reject) => { @@ -15905,14 +15937,6 @@ class NodeFS extends BasePortableFakeFS { chmodSync(p, mask) { return this.realFs.chmodSync(npath.fromPortablePath(p), mask); } - async fchownPromise(fd, uid, gid) { - return await new Promise((resolve, reject) => { - this.realFs.fchown(fd, uid, gid, this.makeCallback(resolve, reject)); - }); - } - fchownSync(fd, uid, gid) { - return this.realFs.fchownSync(fd, uid, gid); - } async chownPromise(p, uid, gid) { return await new Promise((resolve, reject) => { this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); @@ -16052,7 +16076,7 @@ class NodeFS extends BasePortableFakeFS { async readdirPromise(p, opts) { return await new Promise((resolve, reject) => { if (opts == null ? void 0 : opts.withFileTypes) { - this.realFs.readdir(npath.fromPortablePath(p), { withFileTypes: true }, this.makeCallback(resolve, reject)); + this.realFs.readdir(npath.fromPortablePath(p), {withFileTypes: true}, this.makeCallback(resolve, reject)); } else { this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback((value) => resolve(value), reject)); } @@ -16060,7 +16084,7 @@ class NodeFS extends BasePortableFakeFS { } readdirSync(p, opts) { if (opts == null ? void 0 : opts.withFileTypes) { - return this.realFs.readdirSync(npath.fromPortablePath(p), { withFileTypes: true }); + return this.realFs.readdirSync(npath.fromPortablePath(p), {withFileTypes: true}); } else { return this.realFs.readdirSync(npath.fromPortablePath(p)); } @@ -16092,18 +16116,10 @@ class NodeFS extends BasePortableFakeFS { return this.realFs.ftruncateSync(fd, len); } watch(p, a, b) { - return this.realFs.watch( - npath.fromPortablePath(p), - a, - b - ); + return this.realFs.watch(npath.fromPortablePath(p), a, b); } watchFile(p, a, b) { - return this.realFs.watchFile( - npath.fromPortablePath(p), - a, - b - ); + return this.realFs.watchFile(npath.fromPortablePath(p), a, b); } unwatchFile(p, cb) { return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); @@ -16119,16 +16135,27 @@ class NodeFS extends BasePortableFakeFS { } } +var Event; +(function(Event2) { + Event2["Change"] = `change`; + Event2["Stop"] = `stop`; +})(Event || (Event = {})); +var Status; +(function(Status2) { + Status2["Ready"] = `ready`; + Status2["Running"] = `running`; + Status2["Stopped"] = `stopped`; +})(Status || (Status = {})); function assertStatus(current, expected) { if (current !== expected) { throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); } } class CustomStatWatcher extends events.EventEmitter { - constructor(fakeFs, path, { bigint = false } = {}) { + constructor(fakeFs, path, {bigint = false} = {}) { super(); - this.status = "ready" /* Ready */; - this.changeListeners = /* @__PURE__ */ new Map(); + this.status = Status.Ready; + this.changeListeners = new Map(); this.startTimeout = null; this.fakeFs = fakeFs; this.path = path; @@ -16141,27 +16168,27 @@ class CustomStatWatcher extends events.EventEmitter { return statWatcher; } start() { - assertStatus(this.status, "ready" /* Ready */); - this.status = "running" /* Running */; + assertStatus(this.status, Status.Ready); + this.status = Status.Running; this.startTimeout = setTimeout(() => { this.startTimeout = null; if (!this.fakeFs.existsSync(this.path)) { - this.emit("change" /* Change */, this.lastStats, this.lastStats); + this.emit(Event.Change, this.lastStats, this.lastStats); } }, 3); } stop() { - assertStatus(this.status, "running" /* Running */); - this.status = "stopped" /* Stopped */; + assertStatus(this.status, Status.Running); + this.status = Status.Stopped; if (this.startTimeout !== null) { clearTimeout(this.startTimeout); this.startTimeout = null; } - this.emit("stop" /* Stop */); + this.emit(Event.Stop); } stat() { try { - return this.fakeFs.statSync(this.path, { bigint: this.bigint }); + return this.fakeFs.statSync(this.path, {bigint: this.bigint}); } catch (error) { const statInstance = this.bigint ? new BigIntStatsEntry() : new StatEntry(); return clearStats(statInstance); @@ -16174,16 +16201,16 @@ class CustomStatWatcher extends events.EventEmitter { if (areStatsEqual(currentStats, previousStats)) return; this.lastStats = currentStats; - this.emit("change" /* Change */, currentStats, previousStats); + this.emit(Event.Change, currentStats, previousStats); }, opts.interval); return opts.persistent ? interval : interval.unref(); } registerChangeListener(listener, opts) { - this.addListener("change" /* Change */, listener); + this.addListener(Event.Change, listener); this.changeListeners.set(listener, this.makeInterval(opts)); } unregisterChangeListener(listener) { - this.removeListener("change" /* Change */, listener); + this.removeListener(Event.Change, listener); const interval = this.changeListeners.get(listener); if (typeof interval !== `undefined`) clearInterval(interval); @@ -16209,7 +16236,7 @@ class CustomStatWatcher extends events.EventEmitter { } } -const statWatchersByFakeFS = /* @__PURE__ */ new WeakMap(); +const statWatchersByFakeFS = new WeakMap(); function watchFile(fakeFs, path, a, b) { let bigint; let persistent; @@ -16237,13 +16264,13 @@ function watchFile(fakeFs, path, a, b) { } let statWatchers = statWatchersByFakeFS.get(fakeFs); if (typeof statWatchers === `undefined`) - statWatchersByFakeFS.set(fakeFs, statWatchers = /* @__PURE__ */ new Map()); + statWatchersByFakeFS.set(fakeFs, statWatchers = new Map()); let statWatcher = statWatchers.get(path); if (typeof statWatcher === `undefined`) { - statWatcher = CustomStatWatcher.create(fakeFs, path, { bigint }); + statWatcher = CustomStatWatcher.create(fakeFs, path, {bigint}); statWatchers.set(path, statWatcher); } - statWatcher.registerChangeListener(listener, { persistent, interval }); + statWatcher.registerChangeListener(listener, {persistent, interval}); return statWatcher; } function unwatchFile(fakeFs, path, cb) { @@ -16271,6 +16298,22 @@ function unwatchAllFiles(fakeFs) { } } +var __defProp$4 = Object.defineProperty; +var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols; +var __hasOwnProp$5 = Object.prototype.hasOwnProperty; +var __propIsEnum$5 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; +var __spreadValues$4 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$5.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + if (__getOwnPropSymbols$5) + for (var prop of __getOwnPropSymbols$5(b)) { + if (__propIsEnum$5.call(b, prop)) + __defNormalProp$4(a, prop, b[prop]); + } + return a; +}; const DEFAULT_COMPRESSION_LEVEL = `mixed`; function toUnixTimestamp(time) { if (typeof time === `string` && String(+time) === time) @@ -16316,10 +16359,10 @@ class ZipFS extends BasePortableFakeFS { constructor(source, opts) { super(); this.lzSource = null; - this.listings = /* @__PURE__ */ new Map(); - this.entries = /* @__PURE__ */ new Map(); - this.fileSources = /* @__PURE__ */ new Map(); - this.fds = /* @__PURE__ */ new Map(); + this.listings = new Map(); + this.entries = new Map(); + this.fileSources = new Map(); + this.fds = new Map(); this.nextFd = 0; this.ready = false; this.readOnly = false; @@ -16328,7 +16371,7 @@ class ZipFS extends BasePortableFakeFS { this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; source != null ? source : source = makeEmptyArchive(); if (typeof source === `string`) { - const { baseFs = new NodeFS() } = pathOptions; + const {baseFs = new NodeFS()} = pathOptions; this.baseFs = baseFs; this.path = source; } else { @@ -16381,7 +16424,7 @@ class ZipFS extends BasePortableFakeFS { } finally { this.libzip.free(errPtr); } - this.listings.set(PortablePath.root, /* @__PURE__ */ new Set()); + this.listings.set(PortablePath.root, new Set()); const entryCount = this.libzip.getNumEntries(this.zip, 0); for (let t = 0; t < entryCount; ++t) { const raw = this.libzip.getName(this.zip, t, 0); @@ -16478,7 +16521,7 @@ class ZipFS extends BasePortableFakeFS { const newMode = this.baseFs.existsSync(this.path) || this.stats.mode === DEFAULT_MODE ? void 0 : this.stats.mode; if (this.entries.size === 0) { this.discardAndClose(); - this.baseFs.writeFileSync(this.path, makeEmptyArchive(), { mode: newMode }); + this.baseFs.writeFileSync(this.path, makeEmptyArchive(), {mode: newMode}); } else { const rc = this.libzip.close(this.zip); if (rc === -1) @@ -16502,7 +16545,7 @@ class ZipFS extends BasePortableFakeFS { } openSync(p, flags, mode) { const fd = this.nextFd++; - this.fds.set(fd, { cursor: 0, p }); + this.fds.set(fd, {cursor: 0, p}); return fd; } hasOpenFileHandles() { @@ -16523,7 +16566,7 @@ class ZipFS extends BasePortableFakeFS { const onClose = () => { this.closeSync(fd); }; - return opendir(this, resolvedP, entries, { onClose }); + return opendir(this, resolvedP, entries, {onClose}); } async readPromise(fd, buffer, offset, length, position) { return this.readSync(fd, buffer, offset, length, position); @@ -16562,28 +16605,25 @@ class ZipFS extends BasePortableFakeFS { throw EBADF(`read`); this.fds.delete(fd); } - createReadStream(p, { encoding } = {}) { + createReadStream(p, {encoding} = {}) { if (p === null) throw new Error(`Unimplemented`); const fd = this.openSync(p, `r`); - const stream$1 = Object.assign( - new stream.PassThrough({ - emitClose: true, - autoDestroy: true, - destroy: (error, callback) => { - clearImmediate(immediate); - this.closeSync(fd); - callback(error); - } - }), - { - close() { - stream$1.destroy(); - }, - bytesRead: 0, - path: p + const stream$1 = Object.assign(new stream.PassThrough({ + emitClose: true, + autoDestroy: true, + destroy: (error, callback) => { + clearImmediate(immediate); + this.closeSync(fd); + callback(error); } - ); + }), { + close() { + stream$1.destroy(); + }, + bytesRead: 0, + path: p + }); const immediate = setImmediate(async () => { try { const data = await this.readFilePromise(p, encoding); @@ -16595,40 +16635,37 @@ class ZipFS extends BasePortableFakeFS { }); return stream$1; } - createWriteStream(p, { encoding } = {}) { + createWriteStream(p, {encoding} = {}) { if (this.readOnly) throw EROFS(`open '${p}'`); if (p === null) throw new Error(`Unimplemented`); const chunks = []; const fd = this.openSync(p, `w`); - const stream$1 = Object.assign( - new stream.PassThrough({ - autoDestroy: true, - emitClose: true, - destroy: (error, callback) => { - try { - if (error) { - callback(error); - } else { - this.writeFileSync(p, Buffer.concat(chunks), encoding); - callback(null); - } - } catch (err) { - callback(err); - } finally { - this.closeSync(fd); + const stream$1 = Object.assign(new stream.PassThrough({ + autoDestroy: true, + emitClose: true, + destroy: (error, callback) => { + try { + if (error) { + callback(error); + } else { + this.writeFileSync(p, Buffer.concat(chunks), encoding); + callback(null); } + } catch (err) { + callback(err); + } finally { + this.closeSync(fd); } - }), - { - bytesWritten: 0, - path: p, - close() { - stream$1.destroy(); - } } - ); + }), { + bytesWritten: 0, + path: p, + close() { + stream$1.destroy(); + } + }); stream$1.on(`data`, (chunk) => { const chunkBuffer = Buffer.from(chunk); stream$1.bytesWritten += chunkBuffer.length; @@ -16676,12 +16713,12 @@ class ZipFS extends BasePortableFakeFS { throw EROFS(`access '${p}'`); } } - async statPromise(p, opts = { bigint: false }) { + async statPromise(p, opts = {bigint: false}) { if (opts.bigint) - return this.statSync(p, { bigint: true }); + return this.statSync(p, {bigint: true}); return this.statSync(p); } - statSync(p, opts = { bigint: false, throwIfNoEntry: true }) { + statSync(p, opts = {bigint: false, throwIfNoEntry: true}) { const resolvedP = this.resolveFilename(`stat '${p}'`, p, void 0, opts.throwIfNoEntry); if (resolvedP === void 0) return void 0; @@ -16701,7 +16738,7 @@ class ZipFS extends BasePortableFakeFS { const entry = this.fds.get(fd); if (typeof entry === `undefined`) throw EBADF(`fstatSync`); - const { p } = entry; + const {p} = entry; const resolvedP = this.resolveFilename(`stat '${p}'`, p); if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`stat '${p}'`); @@ -16709,12 +16746,12 @@ class ZipFS extends BasePortableFakeFS { throw ENOTDIR(`stat '${p}'`); return this.statImpl(`fstat '${p}'`, resolvedP, opts); } - async lstatPromise(p, opts = { bigint: false }) { + async lstatPromise(p, opts = {bigint: false}) { if (opts.bigint) - return this.lstatSync(p, { bigint: true }); + return this.lstatSync(p, {bigint: true}); return this.lstatSync(p); } - lstatSync(p, opts = { bigint: false, throwIfNoEntry: true }) { + lstatSync(p, opts = {bigint: false, throwIfNoEntry: true}) { const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false, opts.throwIfNoEntry); if (resolvedP === void 0) return void 0; @@ -16751,7 +16788,7 @@ class ZipFS extends BasePortableFakeFS { const defaultMode = type === S_IFDIR ? 493 : 420; const mode = type | this.getUnixMode(entry, defaultMode) & 511; const crc = this.libzip.struct.statCrc(stat); - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); + const statInstance = Object.assign(new StatEntry(), {uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc}); return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; } if (this.listings.has(p)) { @@ -16770,7 +16807,7 @@ class ZipFS extends BasePortableFakeFS { const mtime = new Date(mtimeMs); const mode = S_IFDIR | 493; const crc = 0; - const statInstance = Object.assign(new StatEntry(), { uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc }); + const statInstance = Object.assign(new StatEntry(), {uid, gid, size, blksize, blocks, atime, birthtime, ctime, mtime, atimeMs, birthtimeMs, ctimeMs, mtimeMs, mode, crc}); return opts.bigint === true ? convertToBigIntStats(statInstance) : statInstance; } throw new Error(`Unreachable`); @@ -16790,7 +16827,7 @@ class ZipFS extends BasePortableFakeFS { return existingListing; const parentListing = this.registerListing(ppath.dirname(p)); parentListing.add(ppath.basename(p)); - const newListing = /* @__PURE__ */ new Set(); + const newListing = new Set(); this.listings.set(p, newListing); return newListing; } @@ -16873,11 +16910,11 @@ class ZipFS extends BasePortableFakeFS { throw new Error(`Couldn't allocate enough memory`); const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); heap.set(content); - return { buffer, byteLength: content.byteLength }; + return {buffer, byteLength: content.byteLength}; } allocateUnattachedSource(content) { const error = this.libzip.struct.errorS(); - const { buffer, byteLength } = this.allocateBuffer(content); + const {buffer, byteLength} = this.allocateBuffer(content); const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, true, error); if (source === 0) { this.libzip.free(error); @@ -16886,7 +16923,7 @@ class ZipFS extends BasePortableFakeFS { return source; } allocateSource(content) { - const { buffer, byteLength } = this.allocateBuffer(content); + const {buffer, byteLength} = this.allocateBuffer(content); const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, true); if (source === 0) { this.libzip.free(buffer); @@ -16928,7 +16965,7 @@ class ZipFS extends BasePortableFakeFS { const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; return (attributes & S_IFMT) === S_IFLNK; } - getFileSource(index, opts = { asyncDecompress: false }) { + getFileSource(index, opts = {asyncDecompress: false}) { const cachedFileSource = this.fileSources.get(index); if (typeof cachedFileSource !== `undefined`) return cachedFileSource; @@ -17003,12 +17040,6 @@ class ZipFS extends BasePortableFakeFS { throw this.makeLibzipError(this.libzip.getError(this.zip)); } } - async fchownPromise(fd, uid, gid) { - return this.chownPromise(this.fdToPath(fd, `fchown`), uid, gid); - } - fchownSync(fd, uid, gid) { - return this.chownSync(this.fdToPath(fd, `fchownSync`), uid, gid); - } async chownPromise(p, uid, gid) { return this.chownSync(p, uid, gid); } @@ -17022,15 +17053,15 @@ class ZipFS extends BasePortableFakeFS { throw new Error(`Unimplemented`); } async copyFilePromise(sourceP, destP, flags) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); - const source = await this.getFileSource(indexSource, { asyncDecompress: true }); + const {indexSource, indexDest, resolvedDestP} = this.prepareCopyFile(sourceP, destP, flags); + const source = await this.getFileSource(indexSource, {asyncDecompress: true}); const newIndex = this.setFileSource(resolvedDestP, source); if (newIndex !== indexDest) { this.registerEntry(resolvedDestP, newIndex); } } copyFileSync(sourceP, destP, flags = 0) { - const { indexSource, indexDest, resolvedDestP } = this.prepareCopyFile(sourceP, destP, flags); + const {indexSource, indexDest, resolvedDestP} = this.prepareCopyFile(sourceP, destP, flags); const source = this.getFileSource(indexSource); const newIndex = this.setFileSource(resolvedDestP, source); if (newIndex !== indexDest) { @@ -17060,22 +17091,22 @@ class ZipFS extends BasePortableFakeFS { if (this.readOnly) throw EROFS(`open '${p}'`); if (typeof opts === `undefined`) - opts = { flag: `a` }; + opts = {flag: `a`}; else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; + opts = {flag: `a`, encoding: opts}; else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; + opts = __spreadValues$4({flag: `a`}, opts); return this.writeFilePromise(p, content, opts); } appendFileSync(p, content, opts = {}) { if (this.readOnly) throw EROFS(`open '${p}'`); if (typeof opts === `undefined`) - opts = { flag: `a` }; + opts = {flag: `a`}; else if (typeof opts === `string`) - opts = { flag: `a`, encoding: opts }; + opts = {flag: `a`, encoding: opts}; else if (typeof opts.flag === `undefined`) - opts = { flag: `a`, ...opts }; + opts = __spreadValues$4({flag: `a`}, opts); return this.writeFileSync(p, content, opts); } fdToPath(fd, reason) { @@ -17086,9 +17117,9 @@ class ZipFS extends BasePortableFakeFS { return path; } async writeFilePromise(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); + const {encoding, mode, index, resolvedP} = this.prepareWriteFile(p, opts); if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) - content = Buffer.concat([await this.getFileSource(index, { asyncDecompress: true }), Buffer.from(content)]); + content = Buffer.concat([await this.getFileSource(index, {asyncDecompress: true}), Buffer.from(content)]); if (encoding !== null) content = content.toString(encoding); const newIndex = this.setFileSource(resolvedP, content); @@ -17099,7 +17130,7 @@ class ZipFS extends BasePortableFakeFS { } } writeFileSync(p, content, opts) { - const { encoding, mode, index, resolvedP } = this.prepareWriteFile(p, opts); + const {encoding, mode, index, resolvedP} = this.prepareWriteFile(p, opts); if (index !== void 0 && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); if (encoding !== null) @@ -17184,9 +17215,9 @@ class ZipFS extends BasePortableFakeFS { async mkdirPromise(p, opts) { return this.mkdirSync(p, opts); } - mkdirSync(p, { mode = 493, recursive = false } = {}) { + mkdirSync(p, {mode = 493, recursive = false} = {}) { if (recursive) - return this.mkdirpSync(p, { chmod: mode }); + return this.mkdirpSync(p, {chmod: mode}); if (this.readOnly) throw EROFS(`mkdir '${p}'`); const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); @@ -17199,7 +17230,7 @@ class ZipFS extends BasePortableFakeFS { async rmdirPromise(p, opts) { return this.rmdirSync(p, opts); } - rmdirSync(p, { recursive = false } = {}) { + rmdirSync(p, {recursive = false} = {}) { if (this.readOnly) throw EROFS(`rmdir '${p}'`); if (recursive) { @@ -17252,7 +17283,7 @@ class ZipFS extends BasePortableFakeFS { async readFilePromise(p, encoding) { if (typeof encoding === `object`) encoding = encoding ? encoding.encoding : void 0; - const data = await this.readFileBuffer(p, { asyncDecompress: true }); + const data = await this.readFileBuffer(p, {asyncDecompress: true}); return encoding ? data.toString(encoding) : data; } readFileSync(p, encoding) { @@ -17261,7 +17292,7 @@ class ZipFS extends BasePortableFakeFS { const data = this.readFileBuffer(p); return encoding ? data.toString(encoding) : data; } - readFileBuffer(p, opts = { asyncDecompress: false }) { + readFileBuffer(p, opts = {asyncDecompress: false}) { if (typeof p === `number`) p = this.fdToPath(p, `read`); const resolvedP = this.resolveFilename(`open '${p}'`, p); @@ -17297,7 +17328,7 @@ class ZipFS extends BasePortableFakeFS { } async readlinkPromise(p) { const entry = this.prepareReadlink(p); - return (await this.getFileSource(entry, { asyncDecompress: true })).toString(); + return (await this.getFileSource(entry, {asyncDecompress: true})).toString(); } readlinkSync(p) { const entry = this.prepareReadlink(p); @@ -17323,7 +17354,7 @@ class ZipFS extends BasePortableFakeFS { const index = this.entries.get(resolvedP); if (typeof index === `undefined`) throw EINVAL(`open '${p}'`); - const source = await this.getFileSource(index, { asyncDecompress: true }); + const source = await this.getFileSource(index, {asyncDecompress: true}); const truncated = Buffer.alloc(len, 0); source.copy(truncated); return await this.writeFilePromise(p, truncated); @@ -17356,20 +17387,20 @@ class ZipFS extends BasePortableFakeFS { break; default: { - ({ persistent = true } = a); + ({persistent = true} = a); } break; } if (!persistent) - return { on: () => { + return {on: () => { }, close: () => { - } }; + }}; const interval = setInterval(() => { }, 24 * 60 * 60 * 1e3); - return { on: () => { + return {on: () => { }, close: () => { clearInterval(interval); - } }; + }}; } watchFile(p, a, b) { const resolvedP = ppath.resolve(PortablePath.root, p); @@ -17398,10 +17429,10 @@ class ProxiedFS extends FakeFS { return this.baseFs.openSync(this.mapToBase(p), flags, mode); } async opendirPromise(p, opts) { - return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { path: p }); + return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), {path: p}); } opendirSync(p, opts) { - return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { path: p }); + return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), {path: p}); } async readPromise(fd, buffer, offset, length, position) { return await this.baseFs.readPromise(fd, buffer, offset, length, position); @@ -17483,12 +17514,6 @@ class ProxiedFS extends FakeFS { chmodSync(p, mask) { return this.baseFs.chmodSync(this.mapToBase(p), mask); } - async fchownPromise(fd, uid, gid) { - return this.baseFs.fchownPromise(fd, uid, gid); - } - fchownSync(fd, uid, gid) { - return this.baseFs.fchownSync(fd, uid, gid); - } async chownPromise(p, uid, gid) { return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); } @@ -17604,18 +17629,10 @@ class ProxiedFS extends FakeFS { return this.baseFs.ftruncateSync(fd, len); } watch(p, a, b) { - return this.baseFs.watch( - this.mapToBase(p), - a, - b - ); + return this.baseFs.watch(this.mapToBase(p), a, b); } watchFile(p, a, b) { - return this.baseFs.watchFile( - this.mapToBase(p), - a, - b - ); + return this.baseFs.watchFile(this.mapToBase(p), a, b); } unwatchFile(p, cb) { return this.baseFs.unwatchFile(this.mapToBase(p), cb); @@ -17646,10 +17663,6 @@ 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; - } static makeVirtualPath(base, component, to) { if (ppath.basename(base) !== `__virtual__`) throw new Error(`Assertion failed: Virtual folders must be named "__virtual__"`); @@ -17679,6 +17692,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); } @@ -17737,17 +17754,17 @@ const getArchivePart = (path, extension) => { return path.slice(0, nextCharIdx); }; class ZipOpenFS extends BasePortableFakeFS { - constructor({ libzip, baseFs = new NodeFS(), filter = null, maxOpenFiles = Infinity, readOnlyArchives = false, useCache = true, maxAge = 5e3, fileExtensions = null }) { + constructor({libzip, baseFs = new NodeFS(), filter = null, maxOpenFiles = Infinity, readOnlyArchives = false, useCache = true, maxAge = 5e3, fileExtensions = null}) { super(); - this.fdMap = /* @__PURE__ */ new Map(); + this.fdMap = new Map(); this.nextFd = 3; - this.isZip = /* @__PURE__ */ new Set(); - this.notZip = /* @__PURE__ */ new Set(); - this.realPaths = /* @__PURE__ */ new Map(); + this.isZip = new Set(); + this.notZip = new Set(); + this.realPaths = new Map(); this.limitOpenFilesTimeout = null; this.libzipFactory = typeof libzip !== `function` ? () => libzip : libzip; this.baseFs = baseFs; - this.zipInstances = useCache ? /* @__PURE__ */ new Map() : null; + this.zipInstances = useCache ? new Map() : null; this.filter = filter; this.maxOpenFiles = maxOpenFiles; this.readOnlyArchives = readOnlyArchives; @@ -17776,7 +17793,7 @@ class ZipOpenFS extends BasePortableFakeFS { saveAndClose() { unwatchAllFiles(this); if (this.zipInstances) { - for (const [path, { zipFs }] of this.zipInstances.entries()) { + for (const [path, {zipFs}] of this.zipInstances.entries()) { zipFs.saveAndClose(); this.zipInstances.delete(path); } @@ -17785,7 +17802,7 @@ class ZipOpenFS extends BasePortableFakeFS { discardAndClose() { unwatchAllFiles(this); if (this.zipInstances) { - for (const [path, { zipFs }] of this.zipInstances.entries()) { + for (const [path, {zipFs}] of this.zipInstances.entries()) { zipFs.discardAndClose(); this.zipInstances.delete(path); } @@ -17802,21 +17819,21 @@ class ZipOpenFS extends BasePortableFakeFS { async openPromise(p, flags, mode) { return await this.makeCallPromise(p, async () => { return await this.baseFs.openPromise(p, flags, mode); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return this.remapFd(zipFs, await zipFs.openPromise(subPath, flags, mode)); }); } openSync(p, flags, mode) { return this.makeCallSync(p, () => { return this.baseFs.openSync(p, flags, mode); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return this.remapFd(zipFs, zipFs.openSync(subPath, flags, mode)); }); } async opendirPromise(p, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.opendirPromise(p, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.opendirPromise(subPath, opts); }, { requireSubpath: false @@ -17825,7 +17842,7 @@ class ZipOpenFS extends BasePortableFakeFS { opendirSync(p, opts) { return this.makeCallSync(p, () => { return this.baseFs.opendirSync(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.opendirSync(subPath, opts); }, { requireSubpath: false @@ -17910,7 +17927,7 @@ class ZipOpenFS extends BasePortableFakeFS { return this.baseFs.createReadStream(p, opts); return this.makeCallSync(p, () => { return this.baseFs.createReadStream(p, opts); - }, (zipFs, { archivePath, subPath }) => { + }, (zipFs, {archivePath, subPath}) => { const stream = zipFs.createReadStream(subPath, opts); stream.path = npath.fromPortablePath(this.pathUtils.join(archivePath, subPath)); return stream; @@ -17921,14 +17938,14 @@ class ZipOpenFS extends BasePortableFakeFS { return this.baseFs.createWriteStream(p, opts); return this.makeCallSync(p, () => { return this.baseFs.createWriteStream(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.createWriteStream(subPath, opts); }); } async realpathPromise(p) { return await this.makeCallPromise(p, async () => { return await this.baseFs.realpathPromise(p); - }, async (zipFs, { archivePath, subPath }) => { + }, async (zipFs, {archivePath, subPath}) => { let realArchivePath = this.realPaths.get(archivePath); if (typeof realArchivePath === `undefined`) { realArchivePath = await this.baseFs.realpathPromise(archivePath); @@ -17940,7 +17957,7 @@ class ZipOpenFS extends BasePortableFakeFS { realpathSync(p) { return this.makeCallSync(p, () => { return this.baseFs.realpathSync(p); - }, (zipFs, { archivePath, subPath }) => { + }, (zipFs, {archivePath, subPath}) => { let realArchivePath = this.realPaths.get(archivePath); if (typeof realArchivePath === `undefined`) { realArchivePath = this.baseFs.realpathSync(archivePath); @@ -17952,42 +17969,42 @@ class ZipOpenFS extends BasePortableFakeFS { async existsPromise(p) { return await this.makeCallPromise(p, async () => { return await this.baseFs.existsPromise(p); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.existsPromise(subPath); }); } existsSync(p) { return this.makeCallSync(p, () => { return this.baseFs.existsSync(p); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.existsSync(subPath); }); } async accessPromise(p, mode) { return await this.makeCallPromise(p, async () => { return await this.baseFs.accessPromise(p, mode); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.accessPromise(subPath, mode); }); } accessSync(p, mode) { return this.makeCallSync(p, () => { return this.baseFs.accessSync(p, mode); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.accessSync(subPath, mode); }); } async statPromise(p, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.statPromise(p, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.statPromise(subPath, opts); }); } statSync(p, opts) { return this.makeCallSync(p, () => { return this.baseFs.statSync(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.statSync(subPath, opts); }); } @@ -18012,14 +18029,14 @@ class ZipOpenFS extends BasePortableFakeFS { async lstatPromise(p, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.lstatPromise(p, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.lstatPromise(subPath, opts); }); } lstatSync(p, opts) { return this.makeCallSync(p, () => { return this.baseFs.lstatSync(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.lstatSync(subPath, opts); }); } @@ -18044,46 +18061,28 @@ class ZipOpenFS extends BasePortableFakeFS { async chmodPromise(p, mask) { return await this.makeCallPromise(p, async () => { return await this.baseFs.chmodPromise(p, mask); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.chmodPromise(subPath, mask); }); } chmodSync(p, mask) { return this.makeCallSync(p, () => { return this.baseFs.chmodSync(p, mask); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.chmodSync(subPath, mask); }); } - async fchownPromise(fd, uid, gid) { - if ((fd & ZIP_MASK) !== ZIP_MAGIC) - return this.baseFs.fchownPromise(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchown`); - const [zipFs, realFd] = entry; - return zipFs.fchownPromise(realFd, uid, gid); - } - fchownSync(fd, uid, gid) { - if ((fd & ZIP_MASK) !== ZIP_MAGIC) - return this.baseFs.fchownSync(fd, uid, gid); - const entry = this.fdMap.get(fd); - if (typeof entry === `undefined`) - throw EBADF(`fchownSync`); - const [zipFs, realFd] = entry; - return zipFs.fchownSync(realFd, uid, gid); - } async chownPromise(p, uid, gid) { return await this.makeCallPromise(p, async () => { return await this.baseFs.chownPromise(p, uid, gid); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.chownPromise(subPath, uid, gid); }); } chownSync(p, uid, gid) { return this.makeCallSync(p, () => { return this.baseFs.chownSync(p, uid, gid); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.chownSync(subPath, uid, gid); }); } @@ -18092,14 +18091,14 @@ class ZipOpenFS extends BasePortableFakeFS { return await this.makeCallPromise(newP, async () => { return await this.baseFs.renamePromise(oldP, newP); }, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), {code: `EEXDEV`}); }); - }, async (zipFsO, { subPath: subPathO }) => { + }, async (zipFsO, {subPath: subPathO}) => { return await this.makeCallPromise(newP, async () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, async (zipFsN, { subPath: subPathN }) => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), {code: `EEXDEV`}); + }, async (zipFsN, {subPath: subPathN}) => { if (zipFsO !== zipFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), {code: `EEXDEV`}); } else { return await zipFsO.renamePromise(subPathO, subPathN); } @@ -18111,14 +18110,14 @@ class ZipOpenFS extends BasePortableFakeFS { return this.makeCallSync(newP, () => { return this.baseFs.renameSync(oldP, newP); }, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), {code: `EEXDEV`}); }); - }, (zipFsO, { subPath: subPathO }) => { + }, (zipFsO, {subPath: subPathO}) => { return this.makeCallSync(newP, () => { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); - }, (zipFsN, { subPath: subPathN }) => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), {code: `EEXDEV`}); + }, (zipFsN, {subPath: subPathN}) => { if (zipFsO !== zipFsN) { - throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { code: `EEXDEV` }); + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), {code: `EEXDEV`}); } else { return zipFsO.renameSync(subPathO, subPathN); } @@ -18128,27 +18127,27 @@ class ZipOpenFS extends BasePortableFakeFS { async copyFilePromise(sourceP, destP, flags = 0) { const fallback = async (sourceFs, sourceP2, destFs, destP2) => { if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); + throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), {code: `EXDEV`}); if (flags & fs.constants.COPYFILE_EXCL && await this.existsPromise(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); + throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), {code: `EEXIST`}); let content; try { content = await sourceFs.readFilePromise(sourceP2); } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), {code: `EINVAL`}); } await destFs.writeFilePromise(destP2, content); }; return await this.makeCallPromise(sourceP, async () => { return await this.makeCallPromise(destP, async () => { return await this.baseFs.copyFilePromise(sourceP, destP, flags); - }, async (zipFsD, { subPath: subPathD }) => { + }, async (zipFsD, {subPath: subPathD}) => { return await fallback(this.baseFs, sourceP, zipFsD, subPathD); }); - }, async (zipFsS, { subPath: subPathS }) => { + }, async (zipFsS, {subPath: subPathS}) => { return await this.makeCallPromise(destP, async () => { return await fallback(zipFsS, subPathS, this.baseFs, destP); - }, async (zipFsD, { subPath: subPathD }) => { + }, async (zipFsD, {subPath: subPathD}) => { if (zipFsS !== zipFsD) { return await fallback(zipFsS, subPathS, zipFsD, subPathD); } else { @@ -18160,27 +18159,27 @@ class ZipOpenFS extends BasePortableFakeFS { copyFileSync(sourceP, destP, flags = 0) { const fallback = (sourceFs, sourceP2, destFs, destP2) => { if ((flags & fs.constants.COPYFILE_FICLONE_FORCE) !== 0) - throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), { code: `EXDEV` }); + throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP2}' -> ${destP2}'`), {code: `EXDEV`}); if (flags & fs.constants.COPYFILE_EXCL && this.existsSync(sourceP2)) - throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EEXIST` }); + throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP2}' -> '${destP2}'`), {code: `EEXIST`}); let content; try { content = sourceFs.readFileSync(sourceP2); } catch (error) { - throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), { code: `EINVAL` }); + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP2}' -> '${destP2}'`), {code: `EINVAL`}); } destFs.writeFileSync(destP2, content); }; return this.makeCallSync(sourceP, () => { return this.makeCallSync(destP, () => { return this.baseFs.copyFileSync(sourceP, destP, flags); - }, (zipFsD, { subPath: subPathD }) => { + }, (zipFsD, {subPath: subPathD}) => { return fallback(this.baseFs, sourceP, zipFsD, subPathD); }); - }, (zipFsS, { subPath: subPathS }) => { + }, (zipFsS, {subPath: subPathS}) => { return this.makeCallSync(destP, () => { return fallback(zipFsS, subPathS, this.baseFs, destP); - }, (zipFsD, { subPath: subPathD }) => { + }, (zipFsD, {subPath: subPathD}) => { if (zipFsS !== zipFsD) { return fallback(zipFsS, subPathS, zipFsD, subPathD); } else { @@ -18192,112 +18191,112 @@ class ZipOpenFS extends BasePortableFakeFS { async appendFilePromise(p, content, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.appendFilePromise(p, content, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.appendFilePromise(subPath, content, opts); }); } appendFileSync(p, content, opts) { return this.makeCallSync(p, () => { return this.baseFs.appendFileSync(p, content, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.appendFileSync(subPath, content, opts); }); } async writeFilePromise(p, content, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.writeFilePromise(p, content, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.writeFilePromise(subPath, content, opts); }); } writeFileSync(p, content, opts) { return this.makeCallSync(p, () => { return this.baseFs.writeFileSync(p, content, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.writeFileSync(subPath, content, opts); }); } async unlinkPromise(p) { return await this.makeCallPromise(p, async () => { return await this.baseFs.unlinkPromise(p); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.unlinkPromise(subPath); }); } unlinkSync(p) { return this.makeCallSync(p, () => { return this.baseFs.unlinkSync(p); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.unlinkSync(subPath); }); } async utimesPromise(p, atime, mtime) { return await this.makeCallPromise(p, async () => { return await this.baseFs.utimesPromise(p, atime, mtime); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.utimesPromise(subPath, atime, mtime); }); } utimesSync(p, atime, mtime) { return this.makeCallSync(p, () => { return this.baseFs.utimesSync(p, atime, mtime); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.utimesSync(subPath, atime, mtime); }); } async mkdirPromise(p, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.mkdirPromise(p, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.mkdirPromise(subPath, opts); }); } mkdirSync(p, opts) { return this.makeCallSync(p, () => { return this.baseFs.mkdirSync(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.mkdirSync(subPath, opts); }); } async rmdirPromise(p, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.rmdirPromise(p, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.rmdirPromise(subPath, opts); }); } rmdirSync(p, opts) { return this.makeCallSync(p, () => { return this.baseFs.rmdirSync(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.rmdirSync(subPath, opts); }); } async linkPromise(existingP, newP) { return await this.makeCallPromise(newP, async () => { return await this.baseFs.linkPromise(existingP, newP); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.linkPromise(existingP, subPath); }); } linkSync(existingP, newP) { return this.makeCallSync(newP, () => { return this.baseFs.linkSync(existingP, newP); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.linkSync(existingP, subPath); }); } async symlinkPromise(target, p, type) { return await this.makeCallPromise(p, async () => { return await this.baseFs.symlinkPromise(target, p, type); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.symlinkPromise(target, subPath); }); } symlinkSync(target, p, type) { return this.makeCallSync(p, () => { return this.baseFs.symlinkSync(target, p, type); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.symlinkSync(target, subPath); }); } @@ -18309,7 +18308,7 @@ class ZipOpenFS extends BasePortableFakeFS { default: return await this.baseFs.readFilePromise(p, encoding); } - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.readFilePromise(subPath, encoding); }); } @@ -18321,14 +18320,14 @@ class ZipOpenFS extends BasePortableFakeFS { default: return this.baseFs.readFileSync(p, encoding); } - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.readFileSync(subPath, encoding); }); } async readdirPromise(p, opts) { return await this.makeCallPromise(p, async () => { return await this.baseFs.readdirPromise(p, opts); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.readdirPromise(subPath, opts); }, { requireSubpath: false @@ -18337,7 +18336,7 @@ class ZipOpenFS extends BasePortableFakeFS { readdirSync(p, opts) { return this.makeCallSync(p, () => { return this.baseFs.readdirSync(p, opts); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.readdirSync(subPath, opts); }, { requireSubpath: false @@ -18346,28 +18345,28 @@ class ZipOpenFS extends BasePortableFakeFS { async readlinkPromise(p) { return await this.makeCallPromise(p, async () => { return await this.baseFs.readlinkPromise(p); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.readlinkPromise(subPath); }); } readlinkSync(p) { return this.makeCallSync(p, () => { return this.baseFs.readlinkSync(p); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.readlinkSync(subPath); }); } async truncatePromise(p, len) { return await this.makeCallPromise(p, async () => { return await this.baseFs.truncatePromise(p, len); - }, async (zipFs, { subPath }) => { + }, async (zipFs, {subPath}) => { return await zipFs.truncatePromise(subPath, len); }); } truncateSync(p, len) { return this.makeCallSync(p, () => { return this.baseFs.truncateSync(p, len); - }, (zipFs, { subPath }) => { + }, (zipFs, {subPath}) => { return zipFs.truncateSync(subPath, len); }); } @@ -18391,26 +18390,14 @@ class ZipOpenFS extends BasePortableFakeFS { } watch(p, a, b) { return this.makeCallSync(p, () => { - return this.baseFs.watch( - p, - a, - b - ); - }, (zipFs, { subPath }) => { - return zipFs.watch( - subPath, - a, - b - ); + return this.baseFs.watch(p, a, b); + }, (zipFs, {subPath}) => { + return zipFs.watch(subPath, a, b); }); } watchFile(p, a, b) { return this.makeCallSync(p, () => { - return this.baseFs.watchFile( - p, - a, - b - ); + return this.baseFs.watchFile(p, a, b); }, () => { return watchFile(this, p, a, b); }); @@ -18422,7 +18409,7 @@ class ZipOpenFS extends BasePortableFakeFS { return unwatchFile(this, p, cb); }); } - async makeCallPromise(p, discard, accept, { requireSubpath = true } = {}) { + async makeCallPromise(p, discard, accept, {requireSubpath = true} = {}) { if (typeof p !== `string`) return await discard(); const normalizedP = this.resolve(p); @@ -18433,7 +18420,7 @@ class ZipOpenFS extends BasePortableFakeFS { return await discard(); return await this.getZipPromise(zipInfo.archivePath, async (zipFs) => await accept(zipFs, zipInfo)); } - makeCallSync(p, discard, accept, { requireSubpath = true } = {}) { + makeCallSync(p, discard, accept, {requireSubpath = true} = {}) { if (typeof p !== `string`) return discard(); const normalizedP = this.resolve(p); @@ -18489,7 +18476,7 @@ class ZipOpenFS extends BasePortableFakeFS { const now = Date.now(); let nextExpiresAt = now + this.maxAge; let closeCount = max === null ? 0 : this.zipInstances.size - max; - for (const [path, { zipFs, expiresAt, refCount }] of this.zipInstances.entries()) { + for (const [path, {zipFs, expiresAt, refCount}] of this.zipInstances.entries()) { if (refCount !== 0 || zipFs.hasOpenFileHandles()) { continue; } else if (now >= expiresAt) { @@ -18583,7 +18570,7 @@ class ZipOpenFS extends BasePortableFakeFS { } } -class NodePathFS extends ProxiedFS { +class URLFS extends ProxiedFS { constructor(baseFs) { super(npath); this.baseFs = baseFs; @@ -18592,20 +18579,31 @@ class NodePathFS extends ProxiedFS { return path; } mapToBase(path) { - if (typeof path === `string`) - return path; if (path instanceof url.URL) return url.fileURLToPath(path); - if (Buffer.isBuffer(path)) { - const str = path.toString(); - if (Buffer.byteLength(str) !== path.byteLength) - 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`); - return str; - } - throw new Error(`Unsupported path type: ${nodeUtils.inspect(path)}`); + return path; } } +var __defProp$3 = Object.defineProperty; +var __defProps$2 = Object.defineProperties; +var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols; +var __hasOwnProp$4 = Object.prototype.hasOwnProperty; +var __propIsEnum$4 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; +var __spreadValues$3 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$4.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + if (__getOwnPropSymbols$4) + for (var prop of __getOwnPropSymbols$4(b)) { + if (__propIsEnum$4.call(b, prop)) + __defNormalProp$3(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b)); var _a, _b, _c, _d; const kBaseFs = Symbol(`kBaseFs`); const kFd = Symbol(`kFd`); @@ -18632,18 +18630,13 @@ class FileHandle { try { this[kRef](this.appendFile); const encoding = (_a2 = typeof options === `string` ? options : options == null ? void 0 : options.encoding) != null ? _a2 : void 0; - return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? { encoding } : void 0); + return await this[kBaseFs].appendFilePromise(this.fd, data, encoding ? {encoding} : void 0); } finally { this[kUnref](); } } - async chown(uid, gid) { - try { - this[kRef](this.chown); - return await this[kBaseFs].fchownPromise(this.fd, uid, gid); - } finally { - this[kUnref](); - } + chown(uid, gid) { + throw new Error(`Method not implemented.`); } async chmod(mode) { try { @@ -18654,10 +18647,10 @@ class FileHandle { } } createReadStream(options) { - return this[kBaseFs].createReadStream(null, { ...options, fd: this.fd }); + return this[kBaseFs].createReadStream(null, __spreadProps$2(__spreadValues$3({}, options), {fd: this.fd})); } createWriteStream(options) { - return this[kBaseFs].createWriteStream(null, { ...options, fd: this.fd }); + return this[kBaseFs].createWriteStream(null, __spreadProps$2(__spreadValues$3({}, options), {fd: this.fd})); } datasync() { throw new Error(`Method not implemented.`); @@ -18741,11 +18734,11 @@ class FileHandle { if (ArrayBuffer.isView(args[0])) { const [buffer, offset, length, position] = args; const bytesWritten = await this[kBaseFs].writePromise(this.fd, buffer, offset != null ? offset : void 0, length != null ? length : void 0, position != null ? position : void 0); - return { bytesWritten, buffer }; + return {bytesWritten, buffer}; } else { const [data, position, encoding] = args; const bytesWritten = await this[kBaseFs].writePromise(this.fd, data, position, encoding); - return { bytesWritten, buffer: data }; + return {bytesWritten, buffer: data}; } } finally { this[kUnref](); @@ -18821,7 +18814,7 @@ class FileHandle { } } -const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ +const SYNC_IMPLEMENTATIONS = new Set([ `accessSync`, `appendFileSync`, `createReadStream`, @@ -18829,7 +18822,6 @@ const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ `chmodSync`, `fchmodSync`, `chownSync`, - `fchownSync`, `closeSync`, `copyFileSync`, `linkSync`, @@ -18858,12 +18850,11 @@ const SYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ `writeFileSync`, `writeSync` ]); -const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ +const ASYNC_IMPLEMENTATIONS = new Set([ `accessPromise`, `appendFilePromise`, `fchmodPromise`, `chmodPromise`, - `fchownPromise`, `chownPromise`, `closePromise`, `copyFilePromise`, @@ -18891,7 +18882,7 @@ const ASYNC_IMPLEMENTATIONS = /* @__PURE__ */ new Set([ `writeSync` ]); function patchFs(patchedFs, fakeFs) { - fakeFs = new NodePathFS(fakeFs); + fakeFs = new URLFS(fakeFs); const setupFn = (target, name, replacement) => { const orig = target[name]; target[name] = replacement; @@ -18983,7 +18974,7 @@ function patchFs(patchedFs, fakeFs) { let [fd, buffer, offset, length, position] = args; if (args.length <= 3) { const options = args[2] || {}; - ({ offset = 0, length = buffer.byteLength, position } = options); + ({offset = 0, length = buffer.byteLength, position} = options); } if (offset == null) offset = 0; @@ -19042,11 +19033,11 @@ function patchFs(patchedFs, fakeFs) { { patchedFs.read[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { const res = fakeFs.readPromise(fd, buffer, ...args); - return { bytesRead: await res, buffer }; + return {bytesRead: await res, buffer}; }; patchedFs.write[nodeUtils.promisify.custom] = async (fd, buffer, ...args) => { const res = fakeFs.writePromise(fd, buffer, ...args); - return { bytesWritten: await res, buffer }; + return {bytesWritten: await res, buffer}; }; } } @@ -19176,10 +19167,7 @@ var createModule = function() { } function getCFunc(ident) { var func = Module["_" + ident]; - assert( - func, - "Cannot call unknown function " + ident + ", make sure it is exported" - ); + assert(func, "Cannot call unknown function " + ident + ", make sure it is exported"); return func; } function ccall(ident, returnType, argTypes, args, opts) { @@ -19478,16 +19466,14 @@ var createModule = function() { var str = e.toString(); err("failed to compile wasm module: " + str); if (str.includes("imported Memory") || str.includes("memory import")) { - err( - "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." - ); + err("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."); } throw e; } return [instance, module2]; } function createWasm() { - var info = { a: asmLibraryArg }; + var info = {a: asmLibraryArg}; function receiveInstance(instance, module2) { var exports3 = instance.exports; Module["asm"] = exports3; @@ -19582,12 +19568,9 @@ var createModule = function() { }, normalize: function(path) { var isAbsolute = path.charAt(0) === "/", trailingSlash = path.substr(-1) === "/"; - path = PATH.normalizeArray( - path.split("/").filter(function(p) { - return !!p; - }), - !isAbsolute - ).join("/"); + path = PATH.normalizeArray(path.split("/").filter(function(p) { + return !!p; + }), !isAbsolute).join("/"); if (!path && !isAbsolute) { path = "."; } @@ -19654,12 +19637,9 @@ var createModule = function() { resolvedPath = path + "/" + resolvedPath; resolvedAbsolute = path.charAt(0) === "/"; } - resolvedPath = PATH.normalizeArray( - resolvedPath.split("/").filter(function(p) { - return !!p; - }), - !resolvedAbsolute - ).join("/"); + resolvedPath = PATH.normalizeArray(resolvedPath.split("/").filter(function(p) { + return !!p; + }), !resolvedAbsolute).join("/"); return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; }, relative: function(from, to) { @@ -19705,7 +19685,7 @@ var createModule = function() { shutdown: function() { }, register: function(dev, ops) { - TTY.ttys[dev] = { input: [], output: [], ops }; + TTY.ttys[dev] = {input: [], output: [], ops}; FS.registerDevice(dev, TTY.stream_ops); }, stream_ops: { @@ -19774,13 +19754,7 @@ var createModule = function() { var buf = Buffer.alloc ? Buffer.alloc(BUFSIZE) : new Buffer(BUFSIZE); var bytesRead = 0; try { - bytesRead = nodeFS.readSync( - process.stdin.fd, - buf, - 0, - BUFSIZE, - null - ); + bytesRead = nodeFS.readSync(process.stdin.fd, buf, 0, BUFSIZE, null); } catch (e) { if (e.toString().includes("EOF")) bytesRead = 0; @@ -19864,7 +19838,7 @@ var createModule = function() { readdir: MEMFS.node_ops.readdir, symlink: MEMFS.node_ops.symlink }, - stream: { llseek: MEMFS.stream_ops.llseek } + stream: {llseek: MEMFS.stream_ops.llseek} }, file: { node: { @@ -19933,10 +19907,7 @@ var createModule = function() { if (prevCapacity >= newCapacity) return; var CAPACITY_DOUBLING_MAX = 1024 * 1024; - newCapacity = Math.max( - newCapacity, - prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0 - ); + newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) >>> 0); if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); var oldContents = node.contents; @@ -19954,9 +19925,7 @@ var createModule = function() { var oldContents = node.contents; node.contents = new Uint8Array(newSize); if (oldContents) { - node.contents.set( - oldContents.subarray(0, Math.min(newSize, node.usedBytes)) - ); + node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes))); } node.usedBytes = newSize; } @@ -20090,19 +20059,13 @@ var createModule = function() { node.usedBytes = length; return length; } else if (position + length <= node.usedBytes) { - node.contents.set( - buffer2.subarray(offset, offset + length), - position - ); + node.contents.set(buffer2.subarray(offset, offset + length), position); return length; } } MEMFS.expandFileStorage(node, position + length); if (node.contents.subarray && buffer2.subarray) { - node.contents.set( - buffer2.subarray(offset, offset + length), - position - ); + node.contents.set(buffer2.subarray(offset, offset + length), position); } else { for (var i = 0; i < length; i++) { node.contents[position + i] = buffer2[offset + i]; @@ -20127,10 +20090,7 @@ var createModule = function() { }, allocate: function(stream, offset, length) { MEMFS.expandFileStorage(stream.node, offset + length); - stream.node.usedBytes = Math.max( - stream.node.usedBytes, - offset + length - ); + stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length); }, mmap: function(stream, address, length, position, prot, flags) { if (address !== 0) { @@ -20150,11 +20110,7 @@ var createModule = function() { if (contents.subarray) { contents = contents.subarray(position, position + length); } else { - contents = Array.prototype.slice.call( - contents, - position, - position + length - ); + contents = Array.prototype.slice.call(contents, position, position + length); } } allocated = true; @@ -20164,7 +20120,7 @@ var createModule = function() { } HEAP8.set(contents, ptr); } - return { ptr, allocated }; + return {ptr, allocated}; }, msync: function(stream, buffer2, offset, length, mmapFlags) { if (!FS.isFile(stream.node.mode)) { @@ -20173,14 +20129,7 @@ var createModule = function() { if (mmapFlags & 2) { return 0; } - MEMFS.stream_ops.write( - stream, - buffer2, - 0, - length, - offset, - false - ); + MEMFS.stream_ops.write(stream, buffer2, 0, length, offset, false); return 0; } } @@ -20312,7 +20261,7 @@ var createModule = function() { isWindows: false, staticInit: function() { NODEFS.isWindows = !!process.platform.match(/^win/); - var flags = { fs: fs.constants }; + var flags = {fs: fs.constants}; if (flags["fs"]) { flags = flags["fs"]; } @@ -20454,7 +20403,7 @@ var createModule = function() { if (FS.isDir(node.mode)) { fs.mkdirSync(path, node.mode); } else { - fs.writeFileSync(path, "", { mode: node.mode }); + fs.writeFileSync(path, "", {mode: node.mode}); } } catch (e) { if (!e.code) @@ -20519,10 +20468,7 @@ var createModule = function() { var path = NODEFS.realPath(node); try { path = fs.readlinkSync(path); - path = NODEJS_PATH.relative( - NODEJS_PATH.resolve(node.mount.opts.root), - path - ); + path = NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root), path); return path; } catch (e) { if (!e.code) @@ -20559,26 +20505,14 @@ var createModule = function() { if (length === 0) return 0; try { - return fs.readSync( - stream.nfd, - NODEFS.bufferFrom(buffer2.buffer), - offset, - length, - position - ); + return fs.readSync(stream.nfd, NODEFS.bufferFrom(buffer2.buffer), offset, length, position); } catch (e) { throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); } }, write: function(stream, buffer2, offset, length, position) { try { - return fs.writeSync( - stream.nfd, - NODEFS.bufferFrom(buffer2.buffer), - offset, - length, - position - ); + return fs.writeSync(stream.nfd, NODEFS.bufferFrom(buffer2.buffer), offset, length, position); } catch (e) { throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); } @@ -20611,7 +20545,7 @@ var createModule = function() { } var ptr = mmapAlloc(length); NODEFS.stream_ops.read(stream, HEAP8, ptr, length, position); - return { ptr, allocated: true }; + return {ptr, allocated: true}; }, msync: function(stream, buffer2, offset, length, mmapFlags) { if (!FS.isFile(stream.node.mode)) { @@ -20620,21 +20554,14 @@ var createModule = function() { if (mmapFlags & 2) { return 0; } - NODEFS.stream_ops.write( - stream, - buffer2, - 0, - length, - offset, - false - ); + NODEFS.stream_ops.write(stream, buffer2, 0, length, offset, false); return 0; } } }; var NODERAWFS = { lookupPath: function(path) { - return { path, node: { mode: NODEFS.getMode(path) } }; + return {path, node: {mode: NODEFS.getMode(path)}}; }, createStandardStreams: function() { FS.streams[0] = { @@ -20668,7 +20595,7 @@ var createModule = function() { if (FS.isDir(path)) { fs.mkdirSync(path, mode); } else { - fs.writeFileSync(path, "", { mode }); + fs.writeFileSync(path, "", {mode}); } }, mkdir: function() { @@ -20770,13 +20697,7 @@ var createModule = function() { var seeking = typeof position !== "undefined"; if (!seeking && stream.seekable) position = stream.position; - var bytesRead = fs.readSync( - stream.nfd, - NODEFS.bufferFrom(buffer2.buffer), - offset, - length, - position - ); + var bytesRead = fs.readSync(stream.nfd, NODEFS.bufferFrom(buffer2.buffer), offset, length, position); if (!seeking) stream.position += bytesRead; return bytesRead; @@ -20791,13 +20712,7 @@ var createModule = function() { var seeking = typeof position !== "undefined"; if (!seeking && stream.seekable) position = stream.position; - var bytesWritten = fs.writeSync( - stream.nfd, - NODEFS.bufferFrom(buffer2.buffer), - offset, - length, - position - ); + var bytesWritten = fs.writeSync(stream.nfd, NODEFS.bufferFrom(buffer2.buffer), offset, length, position); if (!seeking) stream.position += bytesWritten; return bytesWritten; @@ -20814,7 +20729,7 @@ var createModule = function() { } var ptr = mmapAlloc(length); FS.read(stream, HEAP8, ptr, length, position); - return { ptr, allocated: true }; + return {ptr, allocated: true}; }, msync: function(stream, buffer2, offset, length, mmapFlags) { if (stream.stream_ops) { @@ -20844,7 +20759,7 @@ var createModule = function() { initialized: false, ignorePermissions: true, trackingDelegate: {}, - tracking: { openFlags: { READ: 1, WRITE: 2 } }, + tracking: {openFlags: {READ: 1, WRITE: 2}}, ErrnoError: null, genericErrors: {}, filesystems: null, @@ -20853,8 +20768,8 @@ var createModule = function() { path = PATH_FS.resolve(FS.cwd(), path); opts = opts || {}; if (!path) - return { path: "", node: null }; - var defaults = { follow_mount: true, recurse_count: 0 }; + return {path: "", node: null}; + var defaults = {follow_mount: true, recurse_count: 0}; for (var key2 in defaults) { if (opts[key2] === void 0) { opts[key2] = defaults[key2]; @@ -20863,12 +20778,9 @@ var createModule = function() { if (opts.recurse_count > 8) { throw new FS.ErrnoError(32); } - var parts = PATH.normalizeArray( - path.split("/").filter(function(p) { - return !!p; - }), - false - ); + var parts = PATH.normalizeArray(path.split("/").filter(function(p) { + return !!p; + }), false); var current = FS.root; var current_path = "/"; for (var i = 0; i < parts.length; i++) { @@ -20898,7 +20810,7 @@ var createModule = function() { } } } - return { path: current_path, node: current }; + return {path: current_path, node: current}; }, getPath: function(node) { var path; @@ -20989,7 +20901,7 @@ var createModule = function() { isSocket: function(mode) { return (mode & 49152) === 49152; }, - flagModes: { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }, + flagModes: {r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090}, modeStringToFlags: function(str) { var flags = FS.flagModes[str]; if (typeof flags === "undefined") { @@ -21150,7 +21062,7 @@ var createModule = function() { return ma << 8 | mi; }, registerDevice: function(dev, ops) { - FS.devices[dev] = { stream_ops: ops }; + FS.devices[dev] = {stream_ops: ops}; }, getDevice: function(dev) { return FS.devices[dev]; @@ -21172,9 +21084,7 @@ var createModule = function() { } FS.syncFSRequests++; if (FS.syncFSRequests > 1) { - err( - "warning: " + FS.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work" - ); + err("warning: " + FS.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work"); } var mounts = FS.getMounts(FS.root.mount); var completed = 0; @@ -21208,7 +21118,7 @@ var createModule = function() { if (root && FS.root) { throw new FS.ErrnoError(10); } else if (!root && !pseudo) { - var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + var lookup = FS.lookupPath(mountpoint, {follow_mount: false}); mountpoint = lookup.path; node = lookup.node; if (FS.isMountpoint(node)) { @@ -21238,7 +21148,7 @@ var createModule = function() { return mountRoot; }, unmount: function(mountpoint) { - var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + var lookup = FS.lookupPath(mountpoint, {follow_mount: false}); if (!FS.isMountpoint(lookup.node)) { throw new FS.ErrnoError(28); } @@ -21263,7 +21173,7 @@ var createModule = function() { return parent.node_ops.lookup(parent, name); }, mknod: function(path, mode, dev) { - var lookup = FS.lookupPath(path, { parent: true }); + var lookup = FS.lookupPath(path, {parent: true}); var parent = lookup.node; var name = PATH.basename(path); if (!name || name === "." || name === "..") { @@ -21317,7 +21227,7 @@ var createModule = function() { if (!PATH_FS.resolve(oldpath)) { throw new FS.ErrnoError(44); } - var lookup = FS.lookupPath(newpath, { parent: true }); + var lookup = FS.lookupPath(newpath, {parent: true}); var parent = lookup.node; if (!parent) { throw new FS.ErrnoError(44); @@ -21338,9 +21248,9 @@ var createModule = function() { var old_name = PATH.basename(old_path); var new_name = PATH.basename(new_path); var lookup, old_dir, new_dir; - lookup = FS.lookupPath(old_path, { parent: true }); + lookup = FS.lookupPath(old_path, {parent: true}); old_dir = lookup.node; - lookup = FS.lookupPath(new_path, { parent: true }); + lookup = FS.lookupPath(new_path, {parent: true}); new_dir = lookup.node; if (!old_dir || !new_dir) throw new FS.ErrnoError(44); @@ -21390,9 +21300,7 @@ var createModule = function() { FS.trackingDelegate["willMovePath"](old_path, new_path); } } catch (e) { - err( - "FS.trackingDelegate['willMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['willMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message); } FS.hashRemoveNode(old_node); try { @@ -21406,13 +21314,11 @@ var createModule = function() { if (FS.trackingDelegate["onMovePath"]) FS.trackingDelegate["onMovePath"](old_path, new_path); } catch (e) { - err( - "FS.trackingDelegate['onMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['onMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message); } }, rmdir: function(path) { - var lookup = FS.lookupPath(path, { parent: true }); + var lookup = FS.lookupPath(path, {parent: true}); var parent = lookup.node; var name = PATH.basename(path); var node = FS.lookupNode(parent, name); @@ -21431,9 +21337,7 @@ var createModule = function() { FS.trackingDelegate["willDeletePath"](path); } } catch (e) { - err( - "FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message); } parent.node_ops.rmdir(parent, name); FS.destroyNode(node); @@ -21441,13 +21345,11 @@ var createModule = function() { if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path); } catch (e) { - err( - "FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message); } }, readdir: function(path) { - var lookup = FS.lookupPath(path, { follow: true }); + var lookup = FS.lookupPath(path, {follow: true}); var node = lookup.node; if (!node.node_ops.readdir) { throw new FS.ErrnoError(54); @@ -21455,7 +21357,7 @@ var createModule = function() { return node.node_ops.readdir(node); }, unlink: function(path) { - var lookup = FS.lookupPath(path, { parent: true }); + var lookup = FS.lookupPath(path, {parent: true}); var parent = lookup.node; var name = PATH.basename(path); var node = FS.lookupNode(parent, name); @@ -21474,9 +21376,7 @@ var createModule = function() { FS.trackingDelegate["willDeletePath"](path); } } catch (e) { - err( - "FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message); } parent.node_ops.unlink(parent, name); FS.destroyNode(node); @@ -21484,9 +21384,7 @@ var createModule = function() { if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path); } catch (e) { - err( - "FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message); } }, readlink: function(path) { @@ -21498,13 +21396,10 @@ var createModule = function() { if (!link.node_ops.readlink) { throw new FS.ErrnoError(28); } - return PATH_FS.resolve( - FS.getPath(link.parent), - link.node_ops.readlink(link) - ); + return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link)); }, stat: function(path, dontFollow) { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var lookup = FS.lookupPath(path, {follow: !dontFollow}); var node = lookup.node; if (!node) { throw new FS.ErrnoError(44); @@ -21520,7 +21415,7 @@ var createModule = function() { chmod: function(path, mode, dontFollow) { var node; if (typeof path === "string") { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var lookup = FS.lookupPath(path, {follow: !dontFollow}); node = lookup.node; } else { node = path; @@ -21546,7 +21441,7 @@ var createModule = function() { chown: function(path, uid, gid, dontFollow) { var node; if (typeof path === "string") { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var lookup = FS.lookupPath(path, {follow: !dontFollow}); node = lookup.node; } else { node = path; @@ -21554,7 +21449,7 @@ var createModule = function() { if (!node.node_ops.setattr) { throw new FS.ErrnoError(63); } - node.node_ops.setattr(node, { timestamp: Date.now() }); + node.node_ops.setattr(node, {timestamp: Date.now()}); }, lchown: function(path, uid, gid) { FS.chown(path, uid, gid, true); @@ -21572,7 +21467,7 @@ var createModule = function() { } var node; if (typeof path === "string") { - var lookup = FS.lookupPath(path, { follow: true }); + var lookup = FS.lookupPath(path, {follow: true}); node = lookup.node; } else { node = path; @@ -21590,7 +21485,7 @@ var createModule = function() { if (errCode) { throw new FS.ErrnoError(errCode); } - node.node_ops.setattr(node, { size: len, timestamp: Date.now() }); + node.node_ops.setattr(node, {size: len, timestamp: Date.now()}); }, ftruncate: function(fd, len) { var stream = FS.getStream(fd); @@ -21603,9 +21498,9 @@ var createModule = function() { FS.truncate(stream.node, len); }, utime: function(path, atime, mtime) { - var lookup = FS.lookupPath(path, { follow: true }); + var lookup = FS.lookupPath(path, {follow: true}); var node = lookup.node; - node.node_ops.setattr(node, { timestamp: Math.max(atime, mtime) }); + node.node_ops.setattr(node, {timestamp: Math.max(atime, mtime)}); }, open: function(path, flags, mode, fd_start, fd_end) { if (path === "") { @@ -21624,7 +21519,7 @@ var createModule = function() { } else { path = PATH.normalize(path); try { - var lookup = FS.lookupPath(path, { follow: !(flags & 131072) }); + var lookup = FS.lookupPath(path, {follow: !(flags & 131072)}); node = lookup.node; } catch (e) { } @@ -21659,20 +21554,16 @@ var createModule = function() { FS.truncate(node, 0); } flags &= ~(128 | 512 | 131072); - var stream = FS.createStream( - { - node, - path: FS.getPath(node), - flags, - seekable: true, - position: 0, - stream_ops: node.stream_ops, - ungotten: [], - error: false - }, - fd_start, - fd_end - ); + var stream = FS.createStream({ + node, + path: FS.getPath(node), + flags, + seekable: true, + position: 0, + stream_ops: node.stream_ops, + ungotten: [], + error: false + }, fd_start, fd_end); if (stream.stream_ops.open) { stream.stream_ops.open(stream); } @@ -21696,9 +21587,7 @@ var createModule = function() { FS.trackingDelegate["onOpenFile"](path, trackingFlags); } } catch (e) { - err( - "FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message - ); + err("FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message); } return stream; }, @@ -21758,13 +21647,7 @@ var createModule = function() { } else if (!stream.seekable) { throw new FS.ErrnoError(70); } - var bytesRead = stream.stream_ops.read( - stream, - buffer2, - offset, - length, - position - ); + var bytesRead = stream.stream_ops.read(stream, buffer2, offset, length, position); if (!seeking) stream.position += bytesRead; return bytesRead; @@ -21794,23 +21677,14 @@ var createModule = function() { } else if (!stream.seekable) { throw new FS.ErrnoError(70); } - var bytesWritten = stream.stream_ops.write( - stream, - buffer2, - offset, - length, - position, - canOwn - ); + var bytesWritten = stream.stream_ops.write(stream, buffer2, offset, length, position, canOwn); if (!seeking) stream.position += bytesWritten; try { if (stream.path && FS.trackingDelegate["onWriteToFile"]) FS.trackingDelegate["onWriteToFile"](stream.path); } catch (e) { - err( - "FS.trackingDelegate['onWriteToFile']('" + stream.path + "') threw an exception: " + e.message - ); + err("FS.trackingDelegate['onWriteToFile']('" + stream.path + "') threw an exception: " + e.message); } return bytesWritten; }, @@ -21842,26 +21716,13 @@ var createModule = function() { if (!stream.stream_ops.mmap) { throw new FS.ErrnoError(43); } - return stream.stream_ops.mmap( - stream, - address, - length, - position, - prot, - flags - ); + return stream.stream_ops.mmap(stream, address, length, position, prot, flags); }, msync: function(stream, buffer2, offset, length, mmapFlags) { if (!stream || !stream.stream_ops.msync) { return 0; } - return stream.stream_ops.msync( - stream, - buffer2, - offset, - length, - mmapFlags - ); + return stream.stream_ops.msync(stream, buffer2, offset, length, mmapFlags); }, munmap: function(stream) { return 0; @@ -21912,7 +21773,7 @@ var createModule = function() { return FS.currentPath; }, chdir: function(path) { - var lookup = FS.lookupPath(path, { follow: true }); + var lookup = FS.lookupPath(path, {follow: true}); if (lookup.node === null) { throw new FS.ErrnoError(44); } @@ -21955,35 +21816,31 @@ var createModule = function() { FS.mkdir("/proc"); var proc_self = FS.mkdir("/proc/self"); FS.mkdir("/proc/self/fd"); - FS.mount( - { - mount: function() { - var node = FS.createNode(proc_self, "fd", 16384 | 511, 73); - node.node_ops = { - lookup: function(parent, name) { - var fd = +name; - var stream = FS.getStream(fd); - if (!stream) - throw new FS.ErrnoError(8); - var ret = { - parent: null, - mount: { mountpoint: "fake" }, - node_ops: { - readlink: function() { - return stream.path; - } + FS.mount({ + mount: function() { + var node = FS.createNode(proc_self, "fd", 16384 | 511, 73); + node.node_ops = { + lookup: function(parent, name) { + var fd = +name; + var stream = FS.getStream(fd); + if (!stream) + throw new FS.ErrnoError(8); + var ret = { + parent: null, + mount: {mountpoint: "fake"}, + node_ops: { + readlink: function() { + return stream.path; } - }; - ret.parent = ret; - return ret; - } - }; - return node; - } - }, - {}, - "/proc/self/fd" - ); + } + }; + ret.parent = ret; + return ret; + } + }; + return node; + } + }, {}, "/proc/self/fd"); }, createStandardStreams: function() { if (Module["stdin"]) { @@ -22030,7 +21887,7 @@ var createModule = function() { FS.createDefaultDirectories(); FS.createDefaultDevices(); FS.createSpecialDirectories(); - FS.filesystems = { MEMFS, NODEFS }; + FS.filesystems = {MEMFS, NODEFS}; }, init: function(input, output, error) { FS.init.initialized = true; @@ -22071,7 +21928,7 @@ var createModule = function() { }, analyzePath: function(path, dontResolveLastLink) { try { - var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + var lookup = FS.lookupPath(path, {follow: !dontResolveLastLink}); path = lookup.path; } catch (e) { } @@ -22087,12 +21944,12 @@ var createModule = function() { parentObject: null }; try { - var lookup = FS.lookupPath(path, { parent: true }); + var lookup = FS.lookupPath(path, {parent: true}); ret.parentExists = true; ret.parentPath = lookup.path; ret.parentObject = lookup.node; ret.name = PATH.basename(path); - lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + lookup = FS.lookupPath(path, {follow: !dontResolveLastLink}); ret.exists = true; ret.path = lookup.path; ret.object = lookup.node; @@ -22120,18 +21977,12 @@ var createModule = function() { return current; }, createFile: function(parent, name, properties, canRead, canWrite) { - var path = PATH.join2( - typeof parent === "string" ? parent : FS.getPath(parent), - name - ); + var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name); var mode = FS.getMode(canRead, canWrite); return FS.create(path, mode); }, createDataFile: function(parent, name, data, canRead, canWrite, canOwn) { - var path = name ? PATH.join2( - typeof parent === "string" ? parent : FS.getPath(parent), - name - ) : parent; + var path = name ? PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name) : parent; var mode = FS.getMode(canRead, canWrite); var node = FS.create(path, mode); if (data) { @@ -22150,10 +22001,7 @@ var createModule = function() { return node; }, createDevice: function(parent, name, input, output) { - var path = PATH.join2( - typeof parent === "string" ? parent : FS.getPath(parent), - name - ); + var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name); var mode = FS.getMode(!!input, !!output); if (!FS.createDevice.major) FS.createDevice.major = 64; @@ -22221,7 +22069,7 @@ var createModule = function() { }, createLazyFile: function(parent, name, url, canRead, canWrite) { var properties; { - var properties = { isDevice: false, url }; + var properties = {isDevice: false, url}; } var node = FS.createFile(parent, name, properties, canRead, canWrite); if (properties.contents) { @@ -22274,14 +22122,7 @@ var createModule = function() { if (preFinish) preFinish(); if (!dontCreateFile) { - FS.createDataFile( - parent, - name, - byteArray2, - canRead, - canWrite, - canOwn - ); + FS.createDataFile(parent, name, byteArray2, canRead, canWrite, canOwn); } if (onload) onload(); @@ -22305,13 +22146,9 @@ var createModule = function() { } addRunDependency(); if (typeof url == "string") { - Browser.asyncLoad( - url, - function(byteArray) { - processData(byteArray); - }, - onerror - ); + Browser.asyncLoad(url, function(byteArray) { + processData(byteArray); + }, onerror); } else { processData(url); } @@ -22352,10 +22189,7 @@ var createModule = function() { onerror(); } paths.forEach(function(path) { - var putRequest = files.put( - FS.analyzePath(path).object.contents, - path - ); + var putRequest = files.put(FS.analyzePath(path).object.contents, path); putRequest.onsuccess = function putRequest_onsuccess() { ok++; if (ok + fail == total) @@ -22405,14 +22239,7 @@ var createModule = function() { if (FS.analyzePath(path).exists) { FS.unlink(path); } - FS.createDataFile( - PATH.dirname(path), - PATH.basename(path), - getRequest.result, - true, - true, - true - ); + FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true); ok++; if (ok + fail == total) finish(); @@ -22473,9 +22300,7 @@ var createModule = function() { HEAP32[buf + 32 >> 2] = 0; tempI64 = [ stat.size >>> 0, - (tempDouble = stat.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil( - (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 - ) >>> 0 : 0) + (tempDouble = stat.size, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) ], HEAP32[buf + 40 >> 2] = tempI64[0], HEAP32[buf + 44 >> 2] = tempI64[1]; HEAP32[buf + 48 >> 2] = 4096; HEAP32[buf + 52 >> 2] = stat.blocks; @@ -22487,9 +22312,7 @@ var createModule = function() { HEAP32[buf + 76 >> 2] = 0; tempI64 = [ stat.ino >>> 0, - (tempDouble = stat.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil( - (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 - ) >>> 0 : 0) + (tempDouble = stat.ino, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) ], HEAP32[buf + 80 >> 2] = tempI64[0], HEAP32[buf + 84 >> 2] = tempI64[1]; return 0; }, @@ -22533,7 +22356,7 @@ var createModule = function() { return -28; } var node; - var lookup = FS.lookupPath(path, { follow: true }); + var lookup = FS.lookupPath(path, {follow: true}); node = lookup.node; if (!node) { return -44; @@ -22809,14 +22632,8 @@ var createModule = function() { } for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)); var replacement = emscripten_realloc_buffer(newSize); if (replacement) { return true; @@ -22871,9 +22688,7 @@ var createModule = function() { FS.llseek(stream, offset, whence); tempI64 = [ stream.position >>> 0, - (tempDouble = stream.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil( - (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 - ) >>> 0 : 0) + (tempDouble = stream.position, +Math.abs(tempDouble) >= 1 ? tempDouble > 0 ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> 0 : 0) ], HEAP32[newOffset >> 2] = tempI64[0], HEAP32[newOffset + 4 >> 2] = tempI64[1]; if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; @@ -22935,15 +22750,7 @@ var createModule = function() { } function _timegm(tmPtr) { _tzset(); - var time = Date.UTC( - HEAP32[tmPtr + 20 >> 2] + 1900, - HEAP32[tmPtr + 16 >> 2], - HEAP32[tmPtr + 12 >> 2], - HEAP32[tmPtr + 8 >> 2], - HEAP32[tmPtr + 4 >> 2], - HEAP32[tmPtr >> 2], - 0 - ); + var time = Date.UTC(HEAP32[tmPtr + 20 >> 2] + 1900, HEAP32[tmPtr + 16 >> 2], HEAP32[tmPtr + 12 >> 2], HEAP32[tmPtr + 8 >> 2], HEAP32[tmPtr + 4 >> 2], HEAP32[tmPtr >> 2], 0); var date = new Date(time); HEAP32[tmPtr + 24 >> 2] = date.getUTCDay(); var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); @@ -23021,12 +22828,7 @@ var createModule = function() { function intArrayFromString(stringy, dontAddNull, length) { var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; var u8array = new Array(len); - var numBytesWritten = stringToUTF8Array( - stringy, - u8array, - 0, - u8array.length - ); + var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); if (dontAddNull) u8array.length = numBytesWritten; return u8array; @@ -23039,11 +22841,7 @@ var createModule = function() { } catch (_) { buf = new Buffer(s, "base64"); } - return new Uint8Array( - buf["buffer"], - buf["byteOffset"], - buf["byteLength"] - ); + return new Uint8Array(buf["buffer"], buf["byteOffset"], buf["byteLength"]); } } function tryParseAsDataURI(filename) { @@ -23196,7 +22994,8 @@ const number64 = [ `number`, `number` ]; -var Errors = /* @__PURE__ */ ((Errors2) => { +var Errors; +(function(Errors2) { Errors2[Errors2["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; Errors2[Errors2["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; Errors2[Errors2["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; @@ -23229,8 +23028,7 @@ var Errors = /* @__PURE__ */ ((Errors2) => { Errors2[Errors2["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; Errors2[Errors2["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; Errors2[Errors2["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; - return Errors2; -})(Errors || {}); +})(Errors || (Errors = {})); const makeInterface = (libzip) => ({ get HEAP8() { return libzip.HEAP8; @@ -23350,7 +23148,27 @@ function getLibzipSync() { return mod; } -var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { +var __defProp$2 = Object.defineProperty; +var __defProps$1 = Object.defineProperties; +var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols; +var __hasOwnProp$3 = Object.prototype.hasOwnProperty; +var __propIsEnum$3 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; +var __spreadValues$2 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$3.call(b, prop)) + __defNormalProp$2(a, prop, b[prop]); + if (__getOwnPropSymbols$3) + for (var prop of __getOwnPropSymbols$3(b)) { + if (__propIsEnum$3.call(b, prop)) + __defNormalProp$2(a, prop, b[prop]); + } + return a; +}; +var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b)); +var ErrorCode; +(function(ErrorCode2) { ErrorCode2["API_ERROR"] = `API_ERROR`; ErrorCode2["BUILTIN_NODE_RESOLUTION_FAILED"] = `BUILTIN_NODE_RESOLUTION_FAILED`; ErrorCode2["EXPORTS_RESOLUTION_FAILED"] = `EXPORTS_RESOLUTION_FAILED`; @@ -23360,14 +23178,13 @@ var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => { ErrorCode2["INTERNAL"] = `INTERNAL`; ErrorCode2["UNDECLARED_DEPENDENCY"] = `UNDECLARED_DEPENDENCY`; ErrorCode2["UNSUPPORTED"] = `UNSUPPORTED`; - return ErrorCode2; -})(ErrorCode || {}); -const MODULE_NOT_FOUND_ERRORS = /* @__PURE__ */ new Set([ - "BUILTIN_NODE_RESOLUTION_FAILED" /* BUILTIN_NODE_RESOLUTION_FAILED */, - "MISSING_DEPENDENCY" /* MISSING_DEPENDENCY */, - "MISSING_PEER_DEPENDENCY" /* MISSING_PEER_DEPENDENCY */, - "QUALIFIED_PATH_RESOLUTION_FAILED" /* QUALIFIED_PATH_RESOLUTION_FAILED */, - "UNDECLARED_DEPENDENCY" /* UNDECLARED_DEPENDENCY */ +})(ErrorCode || (ErrorCode = {})); +const MODULE_NOT_FOUND_ERRORS = new Set([ + ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, + ErrorCode.MISSING_DEPENDENCY, + ErrorCode.MISSING_PEER_DEPENDENCY, + ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, + ErrorCode.UNDECLARED_DEPENDENCY ]); function makeError(pnpCode, message, data = {}, code) { code != null ? code : code = MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; @@ -23377,18 +23194,15 @@ function makeError(pnpCode, message, data = {}, code) { enumerable: false }; return Object.defineProperties(new Error(message), { - code: { - ...propertySpec, + code: __spreadProps$1(__spreadValues$2({}, propertySpec), { value: code - }, - pnpCode: { - ...propertySpec, + }), + pnpCode: __spreadProps$1(__spreadValues$2({}, propertySpec), { value: pnpCode - }, - data: { - ...propertySpec, + }), + data: __spreadProps$1(__spreadValues$2({}, propertySpec), { value: data - } + }) }); } function getIssuerModule(parent) { @@ -23436,12 +23250,21 @@ Instead change the require of ${basename} in ${parentPath} to a dynamic import() return err; } -const shouldReportRequiredModules = process.env.WATCH_REPORT_DEPENDENCIES; -function reportModuleToWatchMode(filename) { - if (shouldReportRequiredModules && process.send) { - process.send({ "watch:require": npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))) }); - } -} +var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols; +var __hasOwnProp$2 = Object.prototype.hasOwnProperty; +var __propIsEnum$2 = Object.prototype.propertyIsEnumerable; +var __objRest$1 = (source, exclude) => { + var target = {}; + for (var prop in source) + if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0) + target[prop] = source[prop]; + if (source != null && __getOwnPropSymbols$2) + for (var prop of __getOwnPropSymbols$2(source)) { + if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop)) + target[prop] = source[prop]; + } + return target; +}; function applyPatch(pnpapi, opts) { const defaultCache = {}; let enableNativeHooks = true; @@ -23482,7 +23305,7 @@ function applyPatch(pnpapi, opts) { const modulePath = require$$0.Module._resolveFilename(request, parent, isMain); const isOwnedByRuntime = parentApi !== null ? parentApi.findPackageLocator(modulePath) !== null : false; const moduleApiPath = isOwnedByRuntime ? parentApiPath : opts.manager.findApiPathFor(npath.dirname(modulePath)); - const entry = moduleApiPath !== null ? opts.manager.getApiEntry(moduleApiPath) : { instance: null, cache: defaultCache }; + const entry = moduleApiPath !== null ? opts.manager.getApiEntry(moduleApiPath) : {instance: null, cache: defaultCache}; const cacheEntry = entry.cache[modulePath]; if (cacheEntry) { if (cacheEntry.loaded === false && cacheEntry.isLoading !== true) { @@ -23501,7 +23324,6 @@ function applyPatch(pnpapi, opts) { } const module = new require$$0.Module(modulePath, parent != null ? parent : void 0); module.pnpApiPath = moduleApiPath; - reportModuleToWatchMode(modulePath); entry.cache[modulePath] = module; if (isMain) { process.mainModule = module; @@ -23540,11 +23362,11 @@ function applyPatch(pnpapi, opts) { if (issuer !== null) { const path = npath.dirname(issuer.filename); const apiPath = opts.manager.getApiPathFromParent(issuer); - return [{ apiPath, path, module }]; + return [{apiPath, path, module}]; } else { const path = process.cwd(); const apiPath = (_a = opts.manager.findApiPathFor(npath.join(path, `[file]`))) != null ? _a : opts.manager.getApiPathFromParent(null); - return [{ apiPath, path, module }]; + return [{apiPath, path, module}]; } } function makeFakeParent(path) { @@ -23561,7 +23383,7 @@ function applyPatch(pnpapi, opts) { if (!enableNativeHooks) return originalModuleResolveFilename.call(require$$0.Module, request, parent, isMain, options); if (options && options.plugnplay === false) { - const { plugnplay, ...rest } = options; + const _a = options, rest = __objRest$1(_a, ["plugnplay"]); const forwardedOptions = Object.keys(rest).length > 0 ? rest : void 0; try { enableNativeHooks = false; @@ -23575,10 +23397,7 @@ function applyPatch(pnpapi, opts) { optionNames.delete(`paths`); optionNames.delete(`plugnplay`); if (optionNames.size > 0) { - throw makeError( - ErrorCode.UNSUPPORTED, - `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})` - ); + throw makeError(ErrorCode.UNSUPPORTED, `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})`); } } const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); @@ -23597,7 +23416,7 @@ function applyPatch(pnpapi, opts) { } } let firstError; - for (const { apiPath, path, module } of issuerSpecs) { + for (const {apiPath, path, module} of issuerSpecs) { let resolution; const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; try { @@ -23678,12 +23497,7 @@ Require stack: const originalDlopen = process.dlopen; process.dlopen = function(...args) { const [module, filename, ...rest] = args; - return originalDlopen.call( - this, - module, - npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), - ...rest - ); + return originalDlopen.call(this, module, npath.fromPortablePath(VirtualFS.resolveVirtual(npath.toPortablePath(filename))), ...rest); }; const originalEmit = process.emit; process.emit = function(name, data, ...args) { @@ -23694,21 +23508,21 @@ Require stack: patchFs(fs__default.default, new PosixFS(opts.fakeFs)); } -function hydrateRuntimeState(data, { basePath }) { +function hydrateRuntimeState(data, {basePath}) { const portablePath = npath.toPortablePath(basePath); const absolutePortablePath = ppath.resolve(portablePath); const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; - const packageLocatorsByLocations = /* @__PURE__ */ new Map(); + const packageLocatorsByLocations = new Map(); const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { var _a; if (packageName === null !== (packageReference === null)) throw new Error(`Assertion failed: The name and reference should be null, or neither should`); const discardFromLookup = (_a = packageInformationData.discardFromLookup) != null ? _a : false; - const packageLocator = { name: packageName, reference: packageReference }; + const packageLocator = {name: packageName, reference: packageReference}; const entry = packageLocatorsByLocations.get(packageInformationData.packageLocation); if (!entry) { - packageLocatorsByLocations.set(packageInformationData.packageLocation, { locator: packageLocator, discardFromLookup }); + packageLocatorsByLocations.set(packageInformationData.packageLocation, {locator: packageLocator, discardFromLookup}); } else { entry.discardFromLookup = entry.discardFromLookup && discardFromLookup; if (!discardFromLookup) { @@ -23857,459 +23671,25 @@ function resolve(pkg, entry='.', options={}) { } } -const ArrayIsArray = Array.isArray; -const JSONStringify = JSON.stringify; -const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; -const ObjectPrototypeHasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -const RegExpPrototypeExec = (obj, string) => RegExp.prototype.exec.call(obj, string); -const RegExpPrototypeSymbolReplace = (obj, ...rest) => RegExp.prototype[Symbol.replace].apply(obj, rest); -const StringPrototypeEndsWith = (str, ...rest) => String.prototype.endsWith.apply(str, rest); -const StringPrototypeIncludes = (str, ...rest) => String.prototype.includes.apply(str, rest); -const StringPrototypeLastIndexOf = (str, ...rest) => String.prototype.lastIndexOf.apply(str, rest); -const StringPrototypeIndexOf = (str, ...rest) => String.prototype.indexOf.apply(str, rest); -const StringPrototypeReplace = (str, ...rest) => String.prototype.replace.apply(str, rest); -const StringPrototypeSlice = (str, ...rest) => String.prototype.slice.apply(str, rest); -const StringPrototypeStartsWith = (str, ...rest) => String.prototype.startsWith.apply(str, rest); -const SafeMap = Map; -const JSONParse = JSON.parse; - -function createErrorType(code, messageCreator, errorType) { - return class extends errorType { - constructor(...args) { - super(messageCreator(...args)); - this.code = code; - this.name = `${errorType.name} [${code}]`; - } - }; -} -const ERR_PACKAGE_IMPORT_NOT_DEFINED = createErrorType( - `ERR_PACKAGE_IMPORT_NOT_DEFINED`, - (specifier, packagePath, base) => { - return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ``} imported from ${base}`; - }, - TypeError -); -const ERR_INVALID_MODULE_SPECIFIER = createErrorType( - `ERR_INVALID_MODULE_SPECIFIER`, - (request, reason, base = void 0) => { - return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ``}`; - }, - TypeError -); -const ERR_INVALID_PACKAGE_TARGET = createErrorType( - `ERR_INVALID_PACKAGE_TARGET`, - (pkgPath, key, target, isImport = false, base = void 0) => { - const relError = typeof target === `string` && !isImport && target.length && !StringPrototypeStartsWith(target, `./`); - if (key === `.`) { - assert__default.default(isImport === false); - return `Invalid "exports" main target ${JSONStringify(target)} defined in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - } - return `Invalid "${isImport ? `imports` : `exports`}" target ${JSONStringify( - target - )} defined for '${key}' in the package config ${pkgPath}package.json${base ? ` imported from ${base}` : ``}${relError ? `; targets must start with "./"` : ``}`; - }, - Error -); -const ERR_INVALID_PACKAGE_CONFIG = createErrorType( - `ERR_INVALID_PACKAGE_CONFIG`, - (path, base, message) => { - return `Invalid package config ${path}${base ? ` while importing ${base}` : ``}${message ? `. ${message}` : ``}`; - }, - Error -); - -function filterOwnProperties(source, keys) { - const filtered = /* @__PURE__ */ Object.create(null); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (ObjectPrototypeHasOwnProperty(source, key)) { - filtered[key] = source[key]; - } - } - return filtered; -} - -const packageJSONCache = new SafeMap(); -function getPackageConfig(path, specifier, base, readFileSyncFn) { - const existing = packageJSONCache.get(path); - if (existing !== void 0) { - return existing; - } - const source = readFileSyncFn(path); - if (source === void 0) { - const packageConfig2 = { - pjsonPath: path, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(path, packageConfig2); - return packageConfig2; - } - let packageJSON; - try { - packageJSON = JSONParse(source); - } catch (error) { - throw new ERR_INVALID_PACKAGE_CONFIG( - path, - (base ? `"${specifier}" from ` : "") + url.fileURLToPath(base || specifier), - error.message - ); - } - let { imports, main, name, type } = filterOwnProperties(packageJSON, [ - "imports", - "main", - "name", - "type" - ]); - const exports = ObjectPrototypeHasOwnProperty(packageJSON, "exports") ? packageJSON.exports : void 0; - if (typeof imports !== "object" || imports === null) { - imports = void 0; - } - if (typeof main !== "string") { - main = void 0; - } - if (typeof name !== "string") { - name = void 0; - } - if (type !== "module" && type !== "commonjs") { - type = "none"; - } - const packageConfig = { - pjsonPath: path, - exists: true, - main, - name, - type, - exports, - imports - }; - packageJSONCache.set(path, packageConfig); - return packageConfig; -} -function getPackageScopeConfig(resolved, readFileSyncFn) { - let packageJSONUrl = new URL("./package.json", resolved); - while (true) { - const packageJSONPath2 = packageJSONUrl.pathname; - if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) { - break; - } - const packageConfig2 = getPackageConfig( - url.fileURLToPath(packageJSONUrl), - resolved, - void 0, - readFileSyncFn - ); - if (packageConfig2.exists) { - return packageConfig2; - } - const lastPackageJSONUrl = packageJSONUrl; - packageJSONUrl = new URL("../package.json", packageJSONUrl); - if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { - break; - } - } - const packageJSONPath = url.fileURLToPath(packageJSONUrl); - const packageConfig = { - pjsonPath: packageJSONPath, - exists: false, - main: void 0, - name: void 0, - type: "none", - exports: void 0, - imports: void 0 - }; - packageJSONCache.set(packageJSONPath, packageConfig); - return packageConfig; -} - -/** - @license - Copyright Node.js contributors. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function throwImportNotDefined(specifier, packageJSONUrl, base) { - throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( - specifier, - packageJSONUrl && url.fileURLToPath(new URL(".", packageJSONUrl)), - url.fileURLToPath(base) - ); -} -function throwInvalidSubpath(subpath, packageJSONUrl, internal, base) { - const reason = `request is not a valid subpath for the "${internal ? "imports" : "exports"}" resolution of ${url.fileURLToPath(packageJSONUrl)}`; - throw new ERR_INVALID_MODULE_SPECIFIER( - subpath, - reason, - base && url.fileURLToPath(base) - ); -} -function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal, base) { - if (typeof target === "object" && target !== null) { - target = JSONStringify(target, null, ""); - } else { - target = `${target}`; - } - throw new ERR_INVALID_PACKAGE_TARGET( - url.fileURLToPath(new URL(".", packageJSONUrl)), - subpath, - target, - internal, - base && url.fileURLToPath(base) - ); -} -const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; -const patternRegEx = /\*/g; -function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern, internal, conditions) { - if (subpath !== "" && !pattern && target[target.length - 1] !== "/") - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (!StringPrototypeStartsWith(target, "./")) { - if (internal && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { - let isURL = false; - try { - new URL(target); - isURL = true; - } catch { - } - if (!isURL) { - const exportTarget = pattern ? RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) : target + subpath; - return exportTarget; - } +var __defProp$1 = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols; +var __hasOwnProp$1 = Object.prototype.hasOwnProperty; +var __propIsEnum$1 = Object.prototype.propertyIsEnumerable; +var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; +var __spreadValues$1 = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp$1.call(b, prop)) + __defNormalProp$1(a, prop, b[prop]); + if (__getOwnPropSymbols$1) + for (var prop of __getOwnPropSymbols$1(b)) { + if (__propIsEnum$1.call(b, prop)) + __defNormalProp$1(a, prop, b[prop]); } - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - } - if (RegExpPrototypeExec( - invalidSegmentRegEx, - StringPrototypeSlice(target, 2) - ) !== null) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - const resolved = new URL(target, packageJSONUrl); - const resolvedPath = resolved.pathname; - const packagePath = new URL(".", packageJSONUrl).pathname; - if (!StringPrototypeStartsWith(resolvedPath, packagePath)) - throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base); - if (subpath === "") - return resolved; - if (RegExpPrototypeExec(invalidSegmentRegEx, subpath) !== null) { - const request = pattern ? StringPrototypeReplace(match, "*", () => subpath) : match + subpath; - throwInvalidSubpath(request, packageJSONUrl, internal, base); - } - if (pattern) { - return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) - ); - } - return new URL(subpath, resolved); -} -function isArrayIndex(key) { - const keyNum = +key; - if (`${keyNum}` !== key) - return false; - return keyNum >= 0 && keyNum < 4294967295; -} -function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern, internal, conditions) { - if (typeof target === "string") { - return resolvePackageTargetString( - target, - subpath, - packageSubpath, - packageJSONUrl, - base, - pattern, - internal); - } else if (ArrayIsArray(target)) { - if (target.length === 0) { - return null; - } - let lastException; - for (let i = 0; i < target.length; i++) { - const targetItem = target[i]; - let resolveResult; - try { - resolveResult = resolvePackageTarget( - packageJSONUrl, - targetItem, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - } catch (e) { - lastException = e; - if (e.code === "ERR_INVALID_PACKAGE_TARGET") { - continue; - } - throw e; - } - if (resolveResult === void 0) { - continue; - } - if (resolveResult === null) { - lastException = null; - continue; - } - return resolveResult; - } - if (lastException === void 0 || lastException === null) - return lastException; - throw lastException; - } else if (typeof target === "object" && target !== null) { - const keys = ObjectGetOwnPropertyNames(target); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (isArrayIndex(key)) { - throw new ERR_INVALID_PACKAGE_CONFIG( - url.fileURLToPath(packageJSONUrl), - base, - '"exports" cannot contain numeric property keys.' - ); - } - } - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key === "default" || conditions.has(key)) { - const conditionalTarget = target[key]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - conditionalTarget, - subpath, - packageSubpath, - base, - pattern, - internal, - conditions - ); - if (resolveResult === void 0) - continue; - return resolveResult; - } - } - return void 0; - } else if (target === null) { - return null; - } - throwInvalidPackageTarget( - packageSubpath, - target, - packageJSONUrl, - internal, - base - ); -} -function patternKeyCompare(a, b) { - const aPatternIndex = StringPrototypeIndexOf(a, "*"); - 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; - return 0; -} -function packageImportsResolve({ - name, - base, - conditions, - readFileSyncFn -}) { - if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { - const reason = "is not a valid internal imports specifier name"; - throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); - } - let packageJSONUrl; - const packageConfig = getPackageScopeConfig(base, readFileSyncFn); - if (packageConfig.exists) { - packageJSONUrl = url.pathToFileURL(packageConfig.pjsonPath); - const imports = packageConfig.imports; - if (imports) { - if (ObjectPrototypeHasOwnProperty(imports, name) && !StringPrototypeIncludes(name, "*")) { - const resolveResult = resolvePackageTarget( - packageJSONUrl, - imports[name], - "", - name, - base, - false, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } else { - let bestMatch = ""; - let bestMatchSubpath; - const keys = ObjectGetOwnPropertyNames(imports); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const patternIndex = StringPrototypeIndexOf(key, "*"); - if (patternIndex !== -1 && StringPrototypeStartsWith( - name, - StringPrototypeSlice(key, 0, patternIndex) - )) { - const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); - if (name.length >= key.length && StringPrototypeEndsWith(name, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { - bestMatch = key; - bestMatchSubpath = StringPrototypeSlice( - name, - patternIndex, - name.length - patternTrailer.length - ); - } - } - } - if (bestMatch) { - const target = imports[bestMatch]; - const resolveResult = resolvePackageTarget( - packageJSONUrl, - target, - bestMatchSubpath, - bestMatch, - base, - true, - true, - conditions - ); - if (resolveResult != null) { - return resolveResult; - } - } - } - } - } - throwImportNotDefined(name, packageJSONUrl, base); -} - + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); function makeApi(runtimeState, opts) { const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); @@ -24317,9 +23697,9 @@ function makeApi(runtimeState, opts) { const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; const isDirRegExp = /\/$/; const isRelativeRegexp = /^\.{0,2}\//; - const topLevelLocator = { name: null, reference: null }; + const topLevelLocator = {name: null, reference: null}; const fallbackLocators = []; - const emittedWarnings = /* @__PURE__ */ new Set(); + const emittedWarnings = new Set(); if (runtimeState.enableTopLevelFallback === true) fallbackLocators.push(topLevelLocator); if (opts.compatibilityMode !== false) { @@ -24330,7 +23710,7 @@ function makeApi(runtimeState, opts) { if (reference === null) { throw new Error(`Assertion failed: This reference shouldn't be null`); } else { - fallbackLocators.push({ name, reference }); + fallbackLocators.push({name, reference}); } } } @@ -24352,7 +23732,7 @@ function makeApi(runtimeState, opts) { function trace(entry) { var _a, _b, _c, _d, _e, _f; const colors = (_c = (_b = (_a = process.stderr) == null ? void 0 : _a.hasColors) == null ? void 0 : _b.call(_a)) != null ? _c : process.stdout.isTTY; - const c = (n, str) => `\x1B[${n}m${str}\x1B[0m`; + const c = (n, str) => `[${n}m${str}`; const error = entry.error; if (error) console.error(c(`31;1`, `\u2716 ${(_d = entry.error) == null ? void 0 : _d.message.replace(/\n.*/s, ``)}`)); @@ -24361,10 +23741,10 @@ function makeApi(runtimeState, opts) { if (entry.args.length > 0) console.error(); for (const arg of entry.args) - console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, { colors, compact: true })}`); + console.error(` ${c(`37;1`, `In \u2190`)} ${nodeUtils.inspect(arg, {colors, compact: true})}`); if (entry.result) { console.error(); - console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, { colors, compact: true })}`); + console.error(` ${c(`37;1`, `Out \u2192`)} ${nodeUtils.inspect(entry.result, {colors, compact: true})}`); } const stack = (_f = (_e = new Error().stack.match(/(?<=^ +)at.*/gm)) == null ? void 0 : _e.slice(2)) != null ? _f : []; if (stack.length > 0) { @@ -24408,10 +23788,7 @@ function makeApi(runtimeState, opts) { function getPackageInformationSafe(packageLocator) { const packageInformation = getPackageInformation(packageLocator); if (!packageInformation) { - throw makeError( - ErrorCode.INTERNAL, - `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)` - ); + throw makeError(ErrorCode.INTERNAL, `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)`); } return packageInformation; } @@ -24423,29 +23800,23 @@ function makeApi(runtimeState, opts) { return true; return false; } - const defaultExportsConditions = /* @__PURE__ */ new Set([`default`, `node`, `require`]); + const defaultExportsConditions = new Set([`default`, `node`, `require`]); function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions) { const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { resolveIgnored: true, includeDiscardFromLookup: true }); if (locator === null) { - throw makeError( - ErrorCode.INTERNAL, - `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)` - ); + throw makeError(ErrorCode.INTERNAL, `The locator that owns the "${unqualifiedPath}" path can't be found inside the dependency tree (this is probably an internal error)`); } - const { packageLocation } = getPackageInformationSafe(locator); + const {packageLocation} = getPackageInformationSafe(locator); const manifestPath = ppath.join(packageLocation, Filename.manifest); if (!opts.fakeFs.existsSync(manifestPath)) return null; const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); let subpath = ppath.contains(packageLocation, unqualifiedPath); if (subpath === null) { - throw makeError( - ErrorCode.INTERNAL, - `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` - ); + throw makeError(ErrorCode.INTERNAL, `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)`); } if (!isRelativeRegexp.test(subpath)) subpath = `./${subpath}`; @@ -24456,18 +23827,13 @@ function makeApi(runtimeState, opts) { unsafe: true }); } catch (error) { - throw makeError( - ErrorCode.EXPORTS_RESOLUTION_FAILED, - error.message, - { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - `ERR_PACKAGE_PATH_NOT_EXPORTED` - ); + throw makeError(ErrorCode.EXPORTS_RESOLUTION_FAILED, error.message, {unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions}, `ERR_PACKAGE_PATH_NOT_EXPORTED`); } if (typeof resolvedExport === `string`) return ppath.join(packageLocation, resolvedExport); return null; } - function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { + function applyNodeExtensionResolution(unqualifiedPath, candidates, {extensions}) { let stat; try { candidates.push(unqualifiedPath); @@ -24486,7 +23852,7 @@ function makeApi(runtimeState, opts) { if (pkgJson && pkgJson.main) nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { - const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { extensions }); + const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, {extensions}); if (resolution !== null) { return resolution; } @@ -24501,7 +23867,7 @@ function makeApi(runtimeState, opts) { } if (stat && stat.isDirectory()) { for (let i = 0, length = extensions.length; i < length; i++) { - const candidateFile = ppath.format({ dir: unqualifiedPath, name: `index`, ext: extensions[i] }); + const candidateFile = ppath.format({dir: unqualifiedPath, name: `index`, ext: extensions[i]}); candidates.push(candidateFile); if (opts.fakeFs.existsSync(candidateFile)) { return candidateFile; @@ -24519,7 +23885,7 @@ function makeApi(runtimeState, opts) { function callNativeResolution(request, issuer) { if (issuer.endsWith(`/`)) issuer = ppath.join(issuer, `internal.js`); - return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { plugnplay: false }); + return require$$0.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, {plugnplay: false}); } function isPathIgnored(path) { if (ignorePattern === null) @@ -24533,9 +23899,9 @@ function makeApi(runtimeState, opts) { return false; } } - const VERSIONS = { std: 3, resolveVirtual: 1, getAllLocators: 1 }; + const VERSIONS = {std: 3, resolveVirtual: 1, getAllLocators: 1}; const topLevel = topLevelLocator; - function getPackageInformation({ name, reference }) { + function getPackageInformation({name, reference}) { const packageInformationStore = packageRegistry.get(name); if (!packageInformationStore) return null; @@ -24544,7 +23910,7 @@ function makeApi(runtimeState, opts) { return null; return packageInformation; } - function findPackageDependents({ name, reference }) { + function findPackageDependents({name, reference}) { const dependents = []; for (const [dependentName, packageInformationStore] of packageRegistry) { if (dependentName === null) @@ -24566,8 +23932,8 @@ function makeApi(runtimeState, opts) { return dependents; } function findBrokenPeerDependencies(dependency, initialPackage) { - const brokenPackages = /* @__PURE__ */ new Map(); - const alreadyVisited = /* @__PURE__ */ new Set(); + const brokenPackages = new Map(); + const alreadyVisited = new Set(); const traversal = (currentPackage) => { const identifier = JSON.stringify(currentPackage.name); if (alreadyVisited.has(identifier)) @@ -24581,7 +23947,7 @@ function makeApi(runtimeState, opts) { } else { let brokenSet = brokenPackages.get(dependent.name); if (typeof brokenSet === `undefined`) - brokenPackages.set(dependent.name, brokenSet = /* @__PURE__ */ new Set()); + brokenPackages.set(dependent.name, brokenSet = new Set()); brokenSet.add(dependent.reference); } } @@ -24590,10 +23956,10 @@ function makeApi(runtimeState, opts) { const brokenList = []; for (const name of [...brokenPackages.keys()].sort()) for (const reference of [...brokenPackages.get(name)].sort()) - brokenList.push({ name, reference }); + brokenList.push({name, reference}); return brokenList; } - function findPackageLocator(location, { resolveIgnored = false, includeDiscardFromLookup = false } = {}) { + function findPackageLocator(location, {resolveIgnored = false, includeDiscardFromLookup = false} = {}) { if (isPathIgnored(location) && !resolveIgnored) return null; let relativeLocation = ppath.relative(runtimeState.basePath, location); @@ -24611,18 +23977,7 @@ function makeApi(runtimeState, opts) { } while (relativeLocation !== ``); return null; } - function tryReadFile(filePath) { - try { - return opts.fakeFs.readFileSync(npath.toPortablePath(filePath), `utf8`); - } catch (err) { - if (err.code === `ENOENT`) - return void 0; - throw err; - } - } - function resolveToUnqualified(request, issuer, { considerBuiltins = true } = {}) { - if (request.startsWith(`#`)) - throw new Error(`resolveToUnqualified can not handle private import mappings`); + function resolveToUnqualified(request, issuer, {considerBuiltins = true} = {}) { if (request === `pnpapi`) return npath.toPortablePath(opts.pnpapiResolution); if (considerBuiltins && isBuiltinModule(request)) @@ -24633,15 +23988,11 @@ function makeApi(runtimeState, opts) { if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { const result = callNativeResolution(request, issuer); if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) + throw makeError(ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) Require request: "${requestForDisplay}" Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay}); } return npath.toPortablePath(result); } @@ -24653,11 +24004,7 @@ Required by: ${issuerForDisplay} unqualifiedPath = ppath.normalize(request); } else { if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); + throw makeError(ErrorCode.API_ERROR, `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, {request: requestForDisplay, issuer: issuerForDisplay}); } const absoluteIssuer = ppath.resolve(issuer); if (issuer.match(isDirRegExp)) { @@ -24668,26 +24015,18 @@ Required by: ${issuerForDisplay} } } else { if (!issuer) { - throw makeError( - ErrorCode.API_ERROR, - `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); + throw makeError(ErrorCode.API_ERROR, `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, {request: requestForDisplay, issuer: issuerForDisplay}); } const [, dependencyName, subPath] = dependencyNameMatch; const issuerLocator = findPackageLocator(issuer); if (!issuerLocator) { const result = callNativeResolution(request, issuer); if (result === false) { - throw makeError( - ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, - `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). + throw makeError(ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). Require path: "${requestForDisplay}" Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay}); } return npath.toPortablePath(result); } @@ -24724,88 +24063,60 @@ Required by: ${issuerForDisplay} let error = null; if (dependencyReference === null) { if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. + error = makeError(ErrorCode.MISSING_PEER_DEPENDENCY, `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, dependencyName}); } else { const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); if (brokenAncestors.every((ancestor) => isDependencyTreeRoot(ancestor))) { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. + error = makeError(ErrorCode.MISSING_PEER_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) ${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} `).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors}); } else { - error = makeError( - ErrorCode.MISSING_PEER_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. + error = makeError(ErrorCode.MISSING_PEER_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) ${brokenAncestors.map((ancestorLocator) => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference} `).join(``)} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName, brokenAncestors}); } } } else if (dependencyReference === void 0) { if (!considerBuiltins && isBuiltinModule(request)) { if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. + error = makeError(ErrorCode.UNDECLARED_DEPENDENCY, `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, dependencyName}); } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. + error = makeError(ErrorCode.UNDECLARED_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName}); } } else { if (isDependencyTreeRoot(issuerLocator)) { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. + error = makeError(ErrorCode.UNDECLARED_DEPENDENCY, `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerForDisplay} -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyName } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, dependencyName}); } else { - error = makeError( - ErrorCode.UNDECLARED_DEPENDENCY, - `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. + error = makeError(ErrorCode.UNDECLARED_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. Required package: ${dependencyName}${dependencyName !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, issuerLocator: Object.assign({}, issuerLocator), dependencyName}); } } } @@ -24820,18 +24131,14 @@ Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDi process.emitWarning(error); } } - const dependencyLocator = Array.isArray(dependencyReference) ? { name: dependencyReference[0], reference: dependencyReference[1] } : { name: dependencyName, reference: dependencyReference }; + const dependencyLocator = Array.isArray(dependencyReference) ? {name: dependencyReference[0], reference: dependencyReference[1]} : {name: dependencyName, reference: dependencyReference}; const dependencyInformation = getPackageInformationSafe(dependencyLocator); if (!dependencyInformation.packageLocation) { - throw makeError( - ErrorCode.MISSING_DEPENDENCY, - `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. + throw makeError(ErrorCode.MISSING_DEPENDENCY, `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. Required package: ${dependencyLocator.name}@${dependencyLocator.reference}${dependencyLocator.name !== requestForDisplay ? ` (via "${requestForDisplay}")` : ``} Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay}) -`, - { request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator) } - ); +`, {request: requestForDisplay, issuer: issuerForDisplay, dependencyLocator: Object.assign({}, dependencyLocator)}); } const dependencyLocation = dependencyInformation.packageLocation; if (subPath) { @@ -24852,17 +24159,17 @@ Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDi return unqualifiedPath; } } - function resolveUnqualified(unqualifiedPath, { extensions = Object.keys(require$$0.Module._extensions) } = {}) { + function resolveUnqualified(unqualifiedPath, {extensions = Object.keys(require$$0.Module._extensions)} = {}) { var _a, _b; const candidates = []; - const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }); + const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, {extensions}); if (qualifiedPath) { return ppath.normalize(qualifiedPath); } else { const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); const containingPackage = findPackageLocator(unqualifiedPath); if (containingPackage) { - const { packageLocation } = getPackageInformationSafe(containingPackage); + const {packageLocation} = getPackageInformationSafe(containingPackage); let exists = true; try { opts.fakeFs.accessSync(packageLocation); @@ -24875,67 +24182,38 @@ Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDi Missing package: ${containingPackage.name}@${containingPackage.reference} Expected package location: ${getPathForDisplay(packageLocation)} -`, { unqualifiedPath: unqualifiedPathForDisplay, extensions }); +`, {unqualifiedPath: unqualifiedPathForDisplay, extensions}); } } if (!exists) { const errorMessage = packageLocation.includes(`/unplugged/`) ? `Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).` : `Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.`; - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `${errorMessage} + throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `${errorMessage} Missing package: ${containingPackage.name}@${containingPackage.reference} Expected package location: ${getPathForDisplay(packageLocation)} -`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); +`, {unqualifiedPath: unqualifiedPathForDisplay, extensions}); } } - throw makeError( - ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, - `Qualified path resolution failed: we looked for the following paths, but none could be accessed. + throw makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Qualified path resolution failed: we looked for the following paths, but none could be accessed. Source path: ${unqualifiedPathForDisplay} ${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} -`).join(``)}`, - { unqualifiedPath: unqualifiedPathForDisplay, extensions } - ); - } - } - function resolvePrivateRequest(request, issuer, opts2) { - var _a; - if (!issuer) - throw new Error(`Assertion failed: An issuer is required to resolve private import mappings`); - const resolved = packageImportsResolve({ - name: request, - base: url.pathToFileURL(npath.fromPortablePath(issuer)), - conditions: (_a = opts2.conditions) != null ? _a : defaultExportsConditions, - readFileSyncFn: tryReadFile - }); - if (resolved instanceof URL) { - return resolveUnqualified(npath.toPortablePath(url.fileURLToPath(resolved)), { extensions: opts2.extensions }); - } else { - if (resolved.startsWith(`#`)) - throw new Error(`Mapping from one private import to another isn't allowed`); - return resolveRequest(resolved, issuer, opts2); +`).join(``)}`, {unqualifiedPath: unqualifiedPathForDisplay, extensions}); } } - function resolveRequest(request, issuer, opts2 = {}) { + function resolveRequest(request, issuer, {considerBuiltins, extensions, conditions} = {}) { try { - if (request.startsWith(`#`)) - return resolvePrivateRequest(request, issuer, opts2); - const { considerBuiltins, extensions, conditions } = opts2; - const unqualifiedPath = resolveToUnqualified(request, issuer, { considerBuiltins }); + const unqualifiedPath = resolveToUnqualified(request, issuer, {considerBuiltins}); if (request === `pnpapi`) return unqualifiedPath; if (unqualifiedPath === null) return null; const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; const remappedPath = (!considerBuiltins || !isBuiltinModule(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions) : unqualifiedPath; - return resolveUnqualified(remappedPath, { extensions }); + return resolveUnqualified(remappedPath, {extensions}); } catch (error) { if (Object.prototype.hasOwnProperty.call(error, `pnpCode`)) - Object.assign(error.data, { request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer) }); + Object.assign(error.data, {request: getPathForDisplay(request), issuer: issuer && getPathForDisplay(issuer)}); throw error; } } @@ -24949,9 +24227,9 @@ ${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} topLevel, getLocator: (name, referencish) => { if (Array.isArray(referencish)) { - return { name: referencish[0], reference: referencish[1] }; + return {name: referencish[0], reference: referencish[1]}; } else { - return { name, reference: referencish }; + return {name, reference: referencish}; } }, getDependencyTreeRoots: () => { @@ -24962,7 +24240,7 @@ ${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} for (const [name, entry] of packageRegistry) for (const reference of entry.keys()) if (name !== null && reference !== null) - locators.push({ name, reference }); + locators.push({name, reference}); return locators; }, getPackageInformation: (locator) => { @@ -24970,7 +24248,7 @@ ${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} if (info === null) return null; const packageLocation = npath.fromPortablePath(info.packageLocation); - const nativeInfo = { ...info, packageLocation }; + const nativeInfo = __spreadProps(__spreadValues$1({}, info), {packageLocation}); return nativeInfo; }, findPackageLocator: (path) => { @@ -25007,7 +24285,7 @@ ${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} function makeManager(pnpapi, opts) { const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); - const apiMetadata = /* @__PURE__ */ new Map([ + const apiMetadata = new Map([ [initialApiPath, { cache: require$$0.Module._cache, instance: pnpapi, @@ -25049,7 +24327,7 @@ function makeManager(pnpapi, opts) { } return apiEntry; } - const findApiPathCache = /* @__PURE__ */ new Map(); + const findApiPathCache = new Map(); function addToCacheAndReturn(start, end, target) { if (target !== null) target = VirtualFS.resolveVirtual(target); @@ -25074,11 +24352,11 @@ function makeManager(pnpapi, opts) { if (!packageInformation) throw new Error(`Assertion failed: Couldn't get package information for '${modulePath}'`); if (!bestCandidate) - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [] }; + bestCandidate = {packageLocation: packageInformation.packageLocation, apiPaths: []}; if (packageInformation.packageLocation === bestCandidate.packageLocation) { bestCandidate.apiPaths.push(apiPath); } else if (packageInformation.packageLocation.length > bestCandidate.packageLocation.length) { - bestCandidate = { packageLocation: packageInformation.packageLocation, apiPaths: [apiPath] }; + bestCandidate = {packageLocation: packageInformation.packageLocation, apiPaths: [apiPath]}; } } if (bestCandidate) { @@ -25132,7 +24410,35 @@ ${controlSegment} }; } -const localFs = { ...fs__default.default }; +var __defProp = Object.defineProperty; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __objRest = (source, exclude) => { + var target = {}; + for (var prop in source) + if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) + target[prop] = source[prop]; + if (source != null && __getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(source)) { + if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) + target[prop] = source[prop]; + } + return target; +}; +const localFs = __spreadValues({}, fs__default.default); const nodeFs = new NodeFS(localFs); const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); const defaultPnpapiResolution = __filename; @@ -25162,18 +24468,21 @@ const defaultApi = Object.assign(makeApi(defaultRuntimeState, { fakeFs: dynamicFsLayer, pnpapiResolution: defaultPnpapiResolution }), { - makeApi: ({ - basePath = void 0, - fakeFs = dynamicFsLayer, - pnpapiResolution = defaultPnpapiResolution, - ...rest - }) => { + makeApi: (_a) => { + var _b = _a, { + basePath = void 0, + fakeFs = dynamicFsLayer, + pnpapiResolution = defaultPnpapiResolution + } = _b, rest = __objRest(_b, [ + "basePath", + "fakeFs", + "pnpapiResolution" + ]); const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; - return makeApi(apiRuntimeState, { + return makeApi(apiRuntimeState, __spreadValues({ fakeFs, - pnpapiResolution, - ...rest - }); + pnpapiResolution + }, rest)); }, setup: (api) => { applyPatch(api || defaultApi, { @@ -25194,7 +24503,7 @@ if (module.parent && module.parent.id === `internal/preload`) { } if (process.mainModule === module) { const reportError = (code, message, data) => { - process.stdout.write(`${JSON.stringify([{ code, message, data }, null])} + process.stdout.write(`${JSON.stringify([{code, message, data}, null])} `); }; const reportSuccess = (resolution) => { diff --git a/package-lock.json b/package-lock.json index f882a27..a99a95b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,9 @@ "@docusaurus/preset-classic": "2.2.0", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", + "docusaurus-plugin-matomo": "^0.0.6", "prism-react-renderer": "^1.3.5", + "raw-loader": "^4.0.2", "react": "^17.0.2", "react-dom": "^17.0.2" }, @@ -5379,6 +5381,17 @@ "node": ">=6" } }, + "node_modules/docusaurus-plugin-matomo": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-matomo/-/docusaurus-plugin-matomo-0.0.6.tgz", + "integrity": "sha512-zAhUz3eMaW2tUJsvV5guOMwb554swoVEeI55BZA10LVk3+PyfWYpBl2FEHITe0ofA8/vG6BTuTzGNSWxW70NwA==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "@docusaurus/core": "^2.0.0-alpha.56" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -9262,6 +9275,42 @@ "node": ">= 0.8" } }, + "node_modules/raw-loader": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", + "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==", + "dependencies": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/raw-loader/node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -11211,9 +11260,9 @@ } }, "node_modules/ua-parser-js": { - "version": "0.7.32", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.32.tgz", - "integrity": "sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==", + "version": "0.7.33", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", + "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==", "funding": [ { "type": "opencollective", @@ -16296,6 +16345,12 @@ "@leichtgewicht/ip-codec": "^2.0.1" } }, + "docusaurus-plugin-matomo": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-matomo/-/docusaurus-plugin-matomo-0.0.6.tgz", + "integrity": "sha512-zAhUz3eMaW2tUJsvV5guOMwb554swoVEeI55BZA10LVk3+PyfWYpBl2FEHITe0ofA8/vG6BTuTzGNSWxW70NwA==", + "requires": {} + }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -19041,6 +19096,27 @@ } } }, + "raw-loader": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", + "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==", + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "dependencies": { + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } + } + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -20491,9 +20567,9 @@ "peer": true }, "ua-parser-js": { - "version": "0.7.32", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.32.tgz", - "integrity": "sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==" + "version": "0.7.33", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", + "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==" }, "unherit": { "version": "1.1.3", diff --git a/yarn.lock b/yarn.lock index 6aeb281..9a74c9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5509,7 +5509,7 @@ __metadata: "fsevents@patch:fsevents@~2.3.2#~builtin": version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" + resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7" dependencies: node-gyp: latest conditions: os=darwin @@ -9037,7 +9037,7 @@ __metadata: "resolve@patch:resolve@^1.1.6#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.3.2#~builtin": version: 1.22.1 - resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" + resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b" dependencies: is-core-module: ^2.9.0 path-parse: ^1.0.7 @@ -10028,9 +10028,9 @@ __metadata: linkType: hard "ua-parser-js@npm:^0.7.30": - version: 0.7.32 - resolution: "ua-parser-js@npm:0.7.32" - checksum: 6b6b035dd78a0ab3369f166ab6f26225d823d83630788806d634f16259297a8f4ae6fe0be4e48f4353ac10dffded3971d7745c55d1432fdfc78a893ba58ef044 + version: 0.7.33 + resolution: "ua-parser-js@npm:0.7.33" + checksum: 1510e9ec26fcaf0d8c6ae8f1078a8230e8816f083e1b5f453ea19d06b8ef2b8a596601c92148fd41899e8b3e5f83fa69c42332bd5729b931a721040339831696 languageName: node linkType: hard