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ASY,IAAI,CAACJ;QAChC,IAAIG,MAAME,MAAM,IACd,MAAMf,+BACJE,SAASc,gBAAgB,CAACN,aAC1BN,cAAca,iBAAiB,CAACL;aAE7B,IAAIC,MAAMK,WAAW,IAC1B,MAAMjB,0CAAIC,UAAUQ,YAAYN,eAAeQ;IAEnD;AACF","sources":["packages/core/fs/src/index.js","packages/core/fs/src/NodeFS.browser.js","packages/core/fs/src/MemoryFS.js","packages/core/fs/package.json","node_modules/nullthrows/nullthrows.js","packages/core/fs/src/find.js","packages/core/fs/src/OverlayFS.js"],"sourcesContent":["// @flow strict-local\nimport type {FileSystem} from './types';\nimport type {FilePath} from '@parcel/types';\nimport type {Readable, Writable} from 'stream';\n\nimport path from 'path';\nimport stream from 'stream';\nimport {promisify} from 'util';\n\nexport type * from './types';\nexport * from './NodeFS';\nexport * from './MemoryFS';\nexport * from './OverlayFS';\n\nconst pipeline: (Readable, Writable) => Promise<void> = promisify(\n stream.pipeline,\n);\n\n// Recursively copies a directory from the sourceFS to the destinationFS\nexport async function ncp(\n sourceFS: FileSystem,\n source: FilePath,\n destinationFS: FileSystem,\n destination: FilePath,\n) {\n await destinationFS.mkdirp(destination);\n let files = await sourceFS.readdir(source);\n for (let file of files) {\n let sourcePath = path.join(source, file);\n let destPath = path.join(destination, file);\n let stats = await sourceFS.stat(sourcePath);\n if (stats.isFile()) {\n await pipeline(\n sourceFS.createReadStream(sourcePath),\n destinationFS.createWriteStream(destPath),\n );\n } else if (stats.isDirectory()) {\n await ncp(sourceFS, sourcePath, destinationFS, destPath);\n }\n }\n}\n","// @flow\nimport type {FileSystem} from './types';\n\n// $FlowFixMe[prop-missing] handled by the throwing constructor\nexport class NodeFS implements FileSystem {\n constructor() {\n throw new Error(\"NodeFS isn't available in the browser\");\n }\n}\n","// @flow\n\nimport type {FileSystem, FileOptions, ReaddirOptions, Encoding} from './types';\nimport type {FilePath} from '@parcel/types';\nimport type {\n Event,\n Options as WatcherOptions,\n AsyncSubscription,\n} from '@parcel/watcher';\n\nimport path from 'path';\nimport {Readable, Writable} from 'stream';\nimport {registerSerializableClass} from '@parcel/core';\nimport {SharedBuffer} from '@parcel/utils';\nimport packageJSON from '../package.json';\nimport WorkerFarm, {Handle} from '@parcel/workers';\nimport nullthrows from 'nullthrows';\nimport EventEmitter from 'events';\nimport {findAncestorFile, findNodeModule, findFirstFile} from './find';\n\nconst instances: Map<number, MemoryFS> = new Map();\nlet id = 0;\n\ntype HandleFunction = (...args: Array<any>) => any;\ntype SerializedMemoryFS = {\n id: number,\n handle: any,\n dirs: Map<FilePath, Directory>,\n files: Map<FilePath, File>,\n symlinks: Map<FilePath, FilePath>,\n ...\n};\n\ntype WorkerEvent = {|\n type: 'writeFile' | 'unlink' | 'mkdir' | 'symlink',\n path: FilePath,\n entry?: Entry,\n target?: FilePath,\n|};\n\ntype ResolveFunction = () => mixed;\n\nexport class MemoryFS implements FileSystem {\n dirs: Map<FilePath, Directory>;\n files: Map<FilePath, File>;\n symlinks: Map<FilePath, FilePath>;\n watchers: Map<FilePath, Set<Watcher>>;\n events: Array<Event>;\n id: number;\n handle: Handle;\n farm: WorkerFarm;\n _cwd: FilePath;\n _eventQueue: Array<Event>;\n _watcherTimer: TimeoutID;\n _numWorkerInstances: number = 0;\n _workerHandles: Array<Handle>;\n _workerRegisterResolves: Array<ResolveFunction> = [];\n _emitter: EventEmitter = new EventEmitter();\n\n constructor(workerFarm: WorkerFarm) {\n this.farm = workerFarm;\n this._cwd = path.resolve(path.sep);\n this.dirs = new Map([[this._cwd, new Directory()]]);\n this.files = new Map();\n this.symlinks = new Map();\n this.watchers = new Map();\n this.events = [];\n this.id = id++;\n this._workerHandles = [];\n this._eventQueue = [];\n instances.set(this.id, this);\n this._emitter.on('allWorkersRegistered', () => {\n for (let resolve of this._workerRegisterResolves) {\n resolve();\n }\n this._workerRegisterResolves = [];\n });\n }\n\n static deserialize(opts: SerializedMemoryFS): MemoryFS | WorkerFS {\n let existing = instances.get(opts.id);\n if (existing != null) {\n // Correct the count of worker instances since serialization assumes a new instance is created\n WorkerFarm.getWorkerApi().runHandle(opts.handle, [\n 'decrementWorkerInstance',\n [],\n ]);\n return existing;\n }\n\n let fs = new WorkerFS(opts.id, nullthrows(opts.handle));\n fs.dirs = opts.dirs;\n fs.files = opts.files;\n fs.symlinks = opts.symlinks;\n return fs;\n }\n\n serialize(): SerializedMemoryFS {\n if (!this.handle) {\n this.handle = this.farm.createReverseHandle(\n (fn: string, args: Array<mixed>) => {\n // $FlowFixMe\n return this[fn](...args);\n },\n );\n }\n\n // If a worker instance already exists, it will decrement this number\n this._numWorkerInstances++;\n\n return {\n $$raw: false,\n id: this.id,\n handle: this.handle,\n dirs: this.dirs,\n files: this.files,\n symlinks: this.symlinks,\n };\n }\n\n decrementWorkerInstance() {\n this._numWorkerInstances--;\n if (this._numWorkerInstances === this._workerHandles.length) {\n this._emitter.emit('allWorkersRegistered');\n }\n }\n\n cwd(): FilePath {\n return this._cwd;\n }\n\n chdir(dir: FilePath) {\n this._cwd = dir;\n }\n\n _normalizePath(filePath: FilePath, realpath: boolean = true): FilePath {\n filePath = path.normalize(filePath);\n if (!filePath.startsWith(this.cwd())) {\n filePath = path.resolve(this.cwd(), filePath);\n }\n\n // get realpath by following symlinks\n if (realpath) {\n let {root, dir, base} = path.parse(filePath);\n let parts = dir.slice(root.length).split(path.sep).concat(base);\n let res = root;\n for (let part of parts) {\n res = path.join(res, part);\n let symlink = this.symlinks.get(res);\n if (symlink) {\n res = symlink;\n }\n }\n\n return res;\n }\n\n return filePath;\n }\n\n async writeFile(\n filePath: FilePath,\n contents: Buffer | string,\n options?: ?FileOptions,\n ) {\n filePath = this._normalizePath(filePath);\n if (this.dirs.has(filePath)) {\n throw new FSError('EISDIR', filePath, 'is a directory');\n }\n\n let dir = path.dirname(filePath);\n if (!this.dirs.has(dir)) {\n throw new FSError('ENOENT', dir, 'does not exist');\n }\n\n let buffer = makeShared(contents);\n let file = this.files.get(filePath);\n let mode = (options && options.mode) || 0o666;\n if (file) {\n file.write(buffer, mode);\n this.files.set(filePath, file);\n } else {\n this.files.set(filePath, new File(buffer, mode));\n }\n\n await this._sendWorkerEvent({\n type: 'writeFile',\n path: filePath,\n entry: this.files.get(filePath),\n });\n\n this._triggerEvent({\n type: file ? 'update' : 'create',\n path: filePath,\n });\n }\n\n // eslint-disable-next-line require-await\n async readFile(filePath: FilePath, encoding?: Encoding): Promise<any> {\n return this.readFileSync(filePath, encoding);\n }\n\n readFileSync(filePath: FilePath, encoding?: Encoding): any {\n filePath = this._normalizePath(filePath);\n let file = this.files.get(filePath);\n if (file == null) {\n throw new FSError('ENOENT', filePath, 'does not exist');\n }\n\n let buffer = file.read();\n if (encoding) {\n return buffer.toString(encoding);\n }\n\n return buffer;\n }\n\n async copyFile(source: FilePath, destination: FilePath) {\n let contents = await this.readFile(source);\n await this.writeFile(destination, contents);\n }\n\n statSync(filePath: FilePath): Stat {\n filePath = this._normalizePath(filePath);\n\n let dir = this.dirs.get(filePath);\n if (dir) {\n return dir.stat();\n }\n\n let file = this.files.get(filePath);\n if (file == null) {\n throw new FSError('ENOENT', filePath, 'does not exist');\n }\n\n return file.stat();\n }\n\n // eslint-disable-next-line require-await\n async stat(filePath: FilePath): Promise<Stat> {\n return this.statSync(filePath);\n }\n\n readdirSync(dir: FilePath, opts?: ReaddirOptions): any {\n dir = this._normalizePath(dir);\n if (!this.dirs.has(dir)) {\n throw new FSError('ENOENT', dir, 'does not exist');\n }\n\n if (!dir.endsWith(path.sep)) {\n dir += path.sep;\n }\n\n let res = [];\n for (let [filePath, entry] of this.dirs) {\n if (filePath === dir) {\n continue;\n }\n if (\n filePath.startsWith(dir) &&\n filePath.indexOf(path.sep, dir.length) === -1\n ) {\n let name = filePath.slice(dir.length);\n if (opts?.withFileTypes) {\n res.push(new Dirent(name, entry));\n } else {\n res.push(name);\n }\n }\n }\n\n for (let [filePath, entry] of this.files) {\n if (\n filePath.startsWith(dir) &&\n filePath.indexOf(path.sep, dir.length) === -1\n ) {\n let name = filePath.slice(dir.length);\n if (opts?.withFileTypes) {\n res.push(new Dirent(name, entry));\n } else {\n res.push(name);\n }\n }\n }\n\n for (let [from] of this.symlinks) {\n if (from.startsWith(dir) && from.indexOf(path.sep, dir.length) === -1) {\n let name = from.slice(dir.length);\n if (opts?.withFileTypes) {\n res.push(new Dirent(name, {mode: S_IFLNK}));\n } else {\n res.push(name);\n }\n }\n }\n\n return res;\n }\n\n // eslint-disable-next-line require-await\n async readdir(dir: FilePath, opts?: ReaddirOptions): Promise<any> {\n return this.readdirSync(dir, opts);\n }\n\n async unlink(filePath: FilePath): Promise<void> {\n filePath = this._normalizePath(filePath);\n if (!this.files.has(filePath) && !this.dirs.has(filePath)) {\n throw new FSError('ENOENT', filePath, 'does not exist');\n }\n\n this.files.delete(filePath);\n this.dirs.delete(filePath);\n this.watchers.delete(filePath);\n\n await this._sendWorkerEvent({\n type: 'unlink',\n path: filePath,\n });\n\n this._triggerEvent({\n type: 'delete',\n path: filePath,\n });\n\n return Promise.resolve();\n }\n\n async mkdirp(dir: FilePath): Promise<void> {\n dir = this._normalizePath(dir);\n if (this.dirs.has(dir)) {\n return Promise.resolve();\n }\n\n if (this.files.has(dir)) {\n throw new FSError('ENOENT', dir, 'is not a directory');\n }\n\n let root = path.parse(dir).root;\n while (dir !== root) {\n if (this.dirs.has(dir)) {\n break;\n }\n\n this.dirs.set(dir, new Directory());\n await this._sendWorkerEvent({\n type: 'mkdir',\n path: dir,\n });\n\n this._triggerEvent({\n type: 'create',\n path: dir,\n });\n\n dir = path.dirname(dir);\n }\n\n return Promise.resolve();\n }\n\n async rimraf(filePath: FilePath): Promise<void> {\n filePath = this._normalizePath(filePath);\n\n if (this.dirs.has(filePath)) {\n let dir = filePath + path.sep;\n for (let filePath of this.files.keys()) {\n if (filePath.startsWith(dir)) {\n this.files.delete(filePath);\n await this._sendWorkerEvent({\n type: 'unlink',\n path: filePath,\n });\n\n this._triggerEvent({\n type: 'delete',\n path: filePath,\n });\n }\n }\n\n for (let dirPath of this.dirs.keys()) {\n if (dirPath.startsWith(dir)) {\n this.dirs.delete(dirPath);\n this.watchers.delete(dirPath);\n await this._sendWorkerEvent({\n type: 'unlink',\n path: filePath,\n });\n\n this._triggerEvent({\n type: 'delete',\n path: dirPath,\n });\n }\n }\n\n for (let filePath of this.symlinks.keys()) {\n if (filePath.startsWith(dir)) {\n this.symlinks.delete(filePath);\n await this._sendWorkerEvent({\n type: 'unlink',\n path: filePath,\n });\n }\n }\n\n this.dirs.delete(filePath);\n await this._sendWorkerEvent({\n type: 'unlink',\n path: filePath,\n });\n\n this._triggerEvent({\n type: 'delete',\n path: filePath,\n });\n } else if (this.files.has(filePath)) {\n this.files.delete(filePath);\n await this._sendWorkerEvent({\n type: 'unlink',\n path: filePath,\n });\n\n this._triggerEvent({\n type: 'delete',\n path: filePath,\n });\n }\n\n return Promise.resolve();\n }\n\n async ncp(source: FilePath, destination: FilePath) {\n source = this._normalizePath(source);\n\n if (this.dirs.has(source)) {\n if (!this.dirs.has(destination)) {\n this.dirs.set(destination, new Directory());\n await this._sendWorkerEvent({\n type: 'mkdir',\n path: destination,\n });\n\n this._triggerEvent({\n type: 'create',\n path: destination,\n });\n }\n\n let dir = source + path.sep;\n for (let dirPath of this.dirs.keys()) {\n if (dirPath.startsWith(dir)) {\n let destName = path.join(destination, dirPath.slice(dir.length));\n if (!this.dirs.has(destName)) {\n this.dirs.set(destName, new Directory());\n await this._sendWorkerEvent({\n type: 'mkdir',\n path: destination,\n });\n this._triggerEvent({\n type: 'create',\n path: destName,\n });\n }\n }\n }\n\n for (let [filePath, file] of this.files) {\n if (filePath.startsWith(dir)) {\n let destName = path.join(destination, filePath.slice(dir.length));\n let exists = this.files.has(destName);\n this.files.set(destName, file);\n await this._sendWorkerEvent({\n type: 'writeFile',\n path: destName,\n entry: file,\n });\n\n this._triggerEvent({\n type: exists ? 'update' : 'create',\n path: destName,\n });\n }\n }\n } else {\n await this.copyFile(source, destination);\n }\n }\n\n createReadStream(filePath: FilePath): ReadStream {\n return new ReadStream(this, filePath);\n }\n\n createWriteStream(filePath: FilePath, options: ?FileOptions): WriteStream {\n return new WriteStream(this, filePath, options);\n }\n\n realpathSync(filePath: FilePath): FilePath {\n return this._normalizePath(filePath);\n }\n\n // eslint-disable-next-line require-await\n async realpath(filePath: FilePath): Promise<FilePath> {\n return this.realpathSync(filePath);\n }\n\n async symlink(target: FilePath, path: FilePath) {\n target = this._normalizePath(target);\n path = this._normalizePath(path);\n this.symlinks.set(path, target);\n await this._sendWorkerEvent({\n type: 'symlink',\n path,\n target,\n });\n }\n\n existsSync(filePath: FilePath): boolean {\n filePath = this._normalizePath(filePath);\n return this.files.has(filePath) || this.dirs.has(filePath);\n }\n\n // eslint-disable-next-line require-await\n async exists(filePath: FilePath): Promise<boolean> {\n return this.existsSync(filePath);\n }\n\n _triggerEvent(event: Event) {\n this.events.push(event);\n if (this.watchers.size === 0) {\n return;\n }\n\n // Batch events\n this._eventQueue.push(event);\n clearTimeout(this._watcherTimer);\n\n this._watcherTimer = setTimeout(() => {\n let events = this._eventQueue;\n this._eventQueue = [];\n\n for (let [dir, watchers] of this.watchers) {\n if (!dir.endsWith(path.sep)) {\n dir += path.sep;\n }\n\n if (event.path.startsWith(dir)) {\n for (let watcher of watchers) {\n watcher.trigger(events);\n }\n }\n }\n }, 50);\n }\n\n _registerWorker(handle: Handle) {\n this._workerHandles.push(handle);\n if (this._numWorkerInstances === this._workerHandles.length) {\n this._emitter.emit('allWorkersRegistered');\n }\n }\n\n async _sendWorkerEvent(event: WorkerEvent) {\n // Wait for worker instances to register their handles\n while (this._workerHandles.length < this._numWorkerInstances) {\n await new Promise(resolve => this._workerRegisterResolves.push(resolve));\n }\n\n await Promise.all(\n this._workerHandles.map(workerHandle =>\n this.farm.workerApi.runHandle(workerHandle, [event]),\n ),\n );\n }\n\n watch(\n dir: FilePath,\n fn: (err: ?Error, events: Array<Event>) => mixed,\n opts: WatcherOptions,\n ): Promise<AsyncSubscription> {\n dir = this._normalizePath(dir);\n let watcher = new Watcher(fn, opts);\n let watchers = this.watchers.get(dir);\n if (!watchers) {\n watchers = new Set();\n this.watchers.set(dir, watchers);\n }\n\n watchers.add(watcher);\n\n return Promise.resolve({\n unsubscribe: () => {\n watchers = nullthrows(watchers);\n watchers.delete(watcher);\n\n if (watchers.size === 0) {\n this.watchers.delete(dir);\n }\n\n return Promise.resolve();\n },\n });\n }\n\n async getEventsSince(\n dir: FilePath,\n snapshot: FilePath,\n opts: WatcherOptions,\n ): Promise<Array<Event>> {\n let contents = await this.readFile(snapshot, 'utf8');\n let len = Number(contents);\n let events = this.events.slice(len);\n let ignore = opts.ignore;\n if (ignore) {\n events = events.filter(\n event => !ignore.some(i => event.path.startsWith(i + path.sep)),\n );\n }\n\n return events;\n }\n\n async writeSnapshot(dir: FilePath, snapshot: FilePath): Promise<void> {\n await this.writeFile(snapshot, '' + this.events.length);\n }\n\n findAncestorFile(\n fileNames: Array<string>,\n fromDir: FilePath,\n root: FilePath,\n ): ?FilePath {\n return findAncestorFile(this, fileNames, fromDir, root);\n }\n\n findNodeModule(moduleName: string, fromDir: FilePath): ?FilePath {\n return findNodeModule(this, moduleName, fromDir);\n }\n\n findFirstFile(filePaths: Array<FilePath>): ?FilePath {\n return findFirstFile(this, filePaths);\n }\n}\n\nclass Watcher {\n fn: (err: ?Error, events: Array<Event>) => mixed;\n options: WatcherOptions;\n\n constructor(\n fn: (err: ?Error, events: Array<Event>) => mixed,\n options: WatcherOptions,\n ) {\n this.fn = fn;\n this.options = options;\n }\n\n trigger(events: Array<Event>) {\n let ignore = this.options.ignore;\n if (ignore) {\n events = events.filter(\n event => !ignore.some(i => event.path.startsWith(i + path.sep)),\n );\n }\n\n if (events.length > 0) {\n this.fn(null, events);\n }\n }\n}\n\nexport class FSError extends Error {\n code: string;\n path: FilePath;\n constructor(code: string, path: FilePath, message: string) {\n super(`${code}: ${path} ${message}`);\n this.name = 'FSError';\n this.code = code;\n this.path = path;\n Error.captureStackTrace?.(this, this.constructor);\n }\n}\n\nclass ReadStream extends Readable {\n fs: FileSystem;\n filePath: FilePath;\n reading: boolean;\n bytesRead: number;\n constructor(fs: FileSystem, filePath: FilePath) {\n super();\n this.fs = fs;\n this.filePath = filePath;\n this.reading = false;\n this.bytesRead = 0;\n }\n\n _read() {\n if (this.reading) {\n return;\n }\n\n this.reading = true;\n this.fs.readFile(this.filePath).then(\n res => {\n this.bytesRead += res.byteLength;\n this.push(res);\n this.push(null);\n },\n err => {\n this.emit('error', err);\n },\n );\n }\n}\n\nclass WriteStream extends Writable {\n fs: FileSystem;\n filePath: FilePath;\n options: ?FileOptions;\n buffer: Buffer;\n\n constructor(fs: FileSystem, filePath: FilePath, options: ?FileOptions) {\n super({emitClose: true, autoDestroy: true});\n this.fs = fs;\n this.filePath = filePath;\n this.options = options;\n this.buffer = Buffer.alloc(0);\n }\n\n _write(\n chunk: Buffer | string,\n encoding: any,\n callback: (error?: Error) => void,\n ) {\n let c = typeof chunk === 'string' ? Buffer.from(chunk, encoding) : chunk;\n this.buffer = Buffer.concat([this.buffer, c]);\n callback();\n }\n\n _final(callback: (error?: Error) => void) {\n this.fs\n .writeFile(this.filePath, this.buffer, this.options)\n .then(callback)\n .catch(callback);\n }\n}\n\nconst S_IFREG = 0o100000;\nconst S_IFDIR = 0o040000;\nconst S_IFLNK = 0o120000;\nconst S_IFMT = 0o170000;\n\nclass Entry {\n mode: number;\n atime: number;\n mtime: number;\n ctime: number;\n birthtime: number;\n constructor(mode: number) {\n this.mode = mode;\n let now = Date.now();\n this.atime = now;\n this.mtime = now;\n this.ctime = now;\n this.birthtime = now;\n }\n\n access() {\n let now = Date.now();\n this.atime = now;\n this.ctime = now;\n }\n\n modify(mode: number) {\n let now = Date.now();\n this.mtime = now;\n this.ctime = now;\n this.mode = mode;\n }\n\n getSize(): number {\n return 0;\n }\n\n stat(): Stat {\n return new Stat(this);\n }\n}\n\nclass Stat {\n dev: number = 0;\n ino: number = 0;\n mode: number;\n nlink: number = 0;\n uid: number = 0;\n gid: number = 0;\n rdev: number = 0;\n size: number;\n blksize: number = 0;\n blocks: number = 0;\n atimeMs: number;\n mtimeMs: number;\n ctimeMs: number;\n birthtimeMs: number;\n atime: Date;\n mtime: Date;\n ctime: Date;\n birthtime: Date;\n\n constructor(entry: Entry) {\n this.mode = entry.mode;\n this.size = entry.getSize();\n this.atimeMs = entry.atime;\n this.mtimeMs = entry.mtime;\n this.ctimeMs = entry.ctime;\n this.birthtimeMs = entry.birthtime;\n this.atime = new Date(entry.atime);\n this.mtime = new Date(entry.mtime);\n this.ctime = new Date(entry.ctime);\n this.birthtime = new Date(entry.birthtime);\n }\n\n isFile(): boolean {\n return Boolean(this.mode & S_IFREG);\n }\n\n isDirectory(): boolean {\n return Boolean(this.mode & S_IFDIR);\n }\n\n isBlockDevice(): boolean {\n return false;\n }\n\n isCharacterDevice(): boolean {\n return false;\n }\n\n isSymbolicLink(): boolean {\n return false;\n }\n\n isFIFO(): boolean {\n return false;\n }\n\n isSocket(): boolean {\n return false;\n }\n}\n\nclass Dirent {\n name: string;\n #mode: number;\n\n constructor(name: string, entry: interface {mode: number}) {\n this.name = name;\n this.#mode = entry.mode;\n }\n\n isFile(): boolean {\n return (this.#mode & S_IFMT) === S_IFREG;\n }\n\n isDirectory(): boolean {\n return (this.#mode & S_IFMT) === S_IFDIR;\n }\n\n isBlockDevice(): boolean {\n return false;\n }\n\n isCharacterDevice(): boolean {\n return false;\n }\n\n isSymbolicLink(): boolean {\n return (this.#mode & S_IFMT) === S_IFLNK;\n }\n\n isFIFO(): boolean {\n return false;\n }\n\n isSocket(): boolean {\n return false;\n }\n}\n\nexport class File extends Entry {\n buffer: Buffer;\n constructor(buffer: Buffer, mode: number) {\n super(S_IFREG | mode);\n this.buffer = buffer;\n }\n\n read(): Buffer {\n super.access();\n return Buffer.from(this.buffer);\n }\n\n write(buffer: Buffer, mode: number) {\n super.modify(S_IFREG | mode);\n this.buffer = buffer;\n }\n\n getSize(): number {\n return this.buffer.byteLength;\n }\n}\n\nclass Directory extends Entry {\n constructor() {\n super(S_IFDIR);\n }\n}\n\nexport function makeShared(contents: Buffer | string): Buffer {\n if (typeof contents !== 'string' && contents.buffer instanceof SharedBuffer) {\n return contents;\n }\n\n let contentsBuffer: Buffer | string = contents;\n // $FlowFixMe\n if (process.browser) {\n // For the polyfilled buffer module, it's faster to always convert once so that the subsequent\n // operations are fast (.byteLength and using .set instead of .write)\n contentsBuffer =\n contentsBuffer instanceof Buffer\n ? contentsBuffer\n : Buffer.from(contentsBuffer);\n }\n\n let length = Buffer.byteLength(contentsBuffer);\n let shared = new SharedBuffer(length);\n let buffer = Buffer.from(shared);\n if (length > 0) {\n if (typeof contentsBuffer === 'string') {\n buffer.write(contentsBuffer);\n } else {\n buffer.set(contentsBuffer);\n }\n }\n\n return buffer;\n}\n\nclass WorkerFS extends MemoryFS {\n id: number;\n handleFn: HandleFunction;\n\n constructor(id: number, handle: Handle) {\n // TODO Make this not a subclass\n // $FlowFixMe\n super();\n this.id = id;\n this.handleFn = (methodName, args) =>\n WorkerFarm.getWorkerApi().runHandle(handle, [methodName, args]);\n\n this.handleFn('_registerWorker', [\n WorkerFarm.getWorkerApi().createReverseHandle(event => {\n switch (event.type) {\n case 'writeFile':\n this.files.set(event.path, event.entry);\n break;\n case 'unlink':\n this.files.delete(event.path);\n this.dirs.delete(event.path);\n this.symlinks.delete(event.path);\n break;\n case 'mkdir':\n this.dirs.set(event.path, new Directory());\n break;\n case 'symlink':\n this.symlinks.set(event.path, event.target);\n break;\n }\n }),\n ]);\n }\n\n static deserialize(opts: SerializedMemoryFS): MemoryFS {\n return nullthrows(instances.get(opts.id));\n }\n\n serialize(): SerializedMemoryFS {\n // $FlowFixMe\n return {\n id: this.id,\n };\n }\n\n writeFile(\n filePath: FilePath,\n contents: Buffer | string,\n options: ?FileOptions,\n ): Promise<void> {\n super.writeFile(filePath, contents, options);\n let buffer = makeShared(contents);\n return this.handleFn('writeFile', [filePath, buffer, options]);\n }\n\n unlink(filePath: FilePath): Promise<void> {\n super.unlink(filePath);\n return this.handleFn('unlink', [filePath]);\n }\n\n mkdirp(dir: FilePath): Promise<void> {\n super.mkdirp(dir);\n return this.handleFn('mkdirp', [dir]);\n }\n\n rimraf(filePath: FilePath): Promise<void> {\n super.rimraf(filePath);\n return this.handleFn('rimraf', [filePath]);\n }\n\n ncp(source: FilePath, destination: FilePath): Promise<void> {\n super.ncp(source, destination);\n return this.handleFn('ncp', [source, destination]);\n }\n\n symlink(target: FilePath, path: FilePath): Promise<void> {\n super.symlink(target, path);\n return this.handleFn('symlink', [target, path]);\n }\n}\n\nregisterSerializableClass(`${packageJSON.version}:MemoryFS`, MemoryFS);\nregisterSerializableClass(`${packageJSON.version}:WorkerFS`, WorkerFS);\nregisterSerializableClass(`${packageJSON.version}:Stat`, Stat);\nregisterSerializableClass(`${packageJSON.version}:File`, File);\nregisterSerializableClass(`${packageJSON.version}:Directory`, Directory);\n","{\n \"name\": \"@parcel/fs\",\n \"version\": \"2.12.0\",\n \"description\": \"Blazing fast, zero configuration web application bundler\",\n \"license\": \"MIT\",\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/parcel-bundler/parcel.git\"\n },\n \"main\": \"lib/index.js\",\n \"source\": \"src/index.js\",\n \"types\": \"index.d.ts\",\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"targets\": {\n \"types\": false,\n \"main\": {\n \"includeNodeModules\": {\n \"@parcel/core\": false,\n \"@parcel/rust\": false,\n \"@parcel/types\": false,\n \"@parcel/utils\": false,\n \"@parcel/watcher\": false,\n \"@parcel/workers\": false\n }\n },\n \"browser\": {\n \"includeNodeModules\": {\n \"@parcel/core\": false,\n \"@parcel/rust\": false,\n \"@parcel/types\": false,\n \"@parcel/utils\": false,\n \"@parcel/watcher\": false,\n \"@parcel/workers\": false\n }\n }\n },\n \"scripts\": {\n \"build-ts\": \"mkdir -p lib && flow-to-ts src/types.js > lib/types.d.ts\",\n \"check-ts\": \"tsc --noEmit index.d.ts\"\n },\n \"dependencies\": {\n \"@parcel/rust\": \"2.12.0\",\n \"@parcel/types\": \"2.12.0\",\n \"@parcel/utils\": \"2.12.0\",\n \"@parcel/watcher\": \"^2.0.7\",\n \"@parcel/workers\": \"2.12.0\"\n },\n \"devDependencies\": {\n \"graceful-fs\": \"^4.2.4\",\n \"ncp\": \"^2.0.0\",\n \"nullthrows\": \"^1.1.1\",\n \"utility-types\": \"^3.10.0\"\n },\n \"peerDependencies\": {\n \"@parcel/core\": \"^2.12.0\"\n },\n \"browser\": {\n \"@parcel/fs\": \"./lib/browser.js\",\n \"./src/NodeFS.js\": \"./src/NodeFS.browser.js\"\n },\n \"gitHead\": \"2059029ee91e5f03a273b0954d3e629d7375f986\"\n}\n","'use strict';\n\nfunction nullthrows(x, message) {\n if (x != null) {\n return x;\n }\n var error = new Error(message !== undefined ? message : 'Got unexpected ' + x);\n error.framesToPop = 1; // Skip nullthrows's own stack frame.\n throw error;\n}\n\nmodule.exports = nullthrows;\nmodule.exports.default = nullthrows;\n\nObject.defineProperty(module.exports, '__esModule', {value: true});\n","// @flow\nimport type {FilePath} from '@parcel/types';\nimport type {FileSystem} from './types';\nimport path from 'path';\n\nexport function findNodeModule(\n fs: FileSystem,\n moduleName: string,\n dir: FilePath,\n): ?FilePath {\n let {root} = path.parse(dir);\n while (dir !== root) {\n // Skip node_modules directories\n if (path.basename(dir) === 'node_modules') {\n dir = path.dirname(dir);\n }\n\n try {\n let moduleDir = path.join(dir, 'node_modules', moduleName);\n let stats = fs.statSync(moduleDir);\n if (stats.isDirectory()) {\n return moduleDir;\n }\n } catch (err) {\n // ignore\n }\n\n // Move up a directory\n dir = path.dirname(dir);\n }\n\n return null;\n}\n\nexport function findAncestorFile(\n fs: FileSystem,\n fileNames: Array<string>,\n dir: FilePath,\n root: FilePath,\n): ?FilePath {\n let {root: pathRoot} = path.parse(dir);\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (path.basename(dir) === 'node_modules') {\n return null;\n }\n\n for (const fileName of fileNames) {\n let filePath = path.join(dir, fileName);\n try {\n if (fs.statSync(filePath).isFile()) {\n return filePath;\n }\n } catch (err) {\n // ignore\n }\n }\n\n if (dir === root || dir === pathRoot) {\n break;\n }\n\n dir = path.dirname(dir);\n }\n\n return null;\n}\n\nexport function findFirstFile(\n fs: FileSystem,\n filePaths: Array<FilePath>,\n): ?FilePath {\n for (let filePath of filePaths) {\n try {\n if (fs.statSync(filePath).isFile()) {\n return filePath;\n }\n } catch (err) {\n // ignore\n }\n }\n}\n","// @flow\n\nimport type {Readable, Writable} from 'stream';\nimport type {\n Encoding,\n FileOptions,\n FileSystem,\n ReaddirOptions,\n Stats,\n} from './types';\nimport type {FilePath} from '@parcel/types';\nimport type {\n Event,\n Options as WatcherOptions,\n AsyncSubscription,\n} from '@parcel/watcher';\n\nimport {registerSerializableClass} from '@parcel/core';\nimport WorkerFarm from '@parcel/workers';\nimport packageJSON from '../package.json';\nimport {findAncestorFile, findNodeModule, findFirstFile} from './find';\nimport {MemoryFS} from './MemoryFS';\n\nimport nullthrows from 'nullthrows';\nimport path from 'path';\n\nexport class OverlayFS implements FileSystem {\n deleted: Set<FilePath> = new Set();\n writable: FileSystem;\n readable: FileSystem;\n _cwd: FilePath;\n\n constructor(workerFarmOrFS: WorkerFarm | FileSystem, readable: FileSystem) {\n if (workerFarmOrFS instanceof WorkerFarm) {\n this.writable = new MemoryFS(workerFarmOrFS);\n } else {\n this.writable = workerFarmOrFS;\n }\n this.readable = readable;\n this._cwd = readable.cwd();\n }\n\n static deserialize(opts: any): OverlayFS {\n let fs = new OverlayFS(opts.writable, opts.readable);\n if (opts.deleted != null) fs.deleted = opts.deleted;\n return fs;\n }\n\n serialize(): {|\n $$raw: boolean,\n readable: FileSystem,\n writable: FileSystem,\n deleted: Set<FilePath>,\n |} {\n return {\n $$raw: false,\n writable: this.writable,\n readable: this.readable,\n deleted: this.deleted,\n };\n }\n\n _deletedThrows(filePath: FilePath): FilePath {\n filePath = this._normalizePath(filePath);\n if (this.deleted.has(filePath)) {\n throw new FSError('ENOENT', filePath, 'does not exist');\n }\n return filePath;\n }\n\n _checkExists(filePath: FilePath): FilePath {\n filePath = this._deletedThrows(filePath);\n if (!this.existsSync(filePath)) {\n throw new FSError('ENOENT', filePath, 'does not exist');\n }\n return filePath;\n }\n\n _isSymlink(filePath: FilePath): boolean {\n filePath = this._normalizePath(filePath);\n // Check the parts of the path to see if any are symlinks.\n let {root, dir, base} = path.parse(filePath);\n let segments = dir.slice(root.length).split(path.sep).concat(base);\n while (segments.length) {\n filePath = path.join(root, ...segments);\n let name = segments.pop();\n if (this.deleted.has(filePath)) {\n return false;\n } else if (\n this.writable instanceof MemoryFS &&\n this.writable.symlinks.has(filePath)\n ) {\n return true;\n } else {\n // HACK: Parcel fs does not provide `lstatSync`,\n // so we use `readdirSync` to check if the path is a symlink.\n let parent = path.resolve(filePath, '..');\n if (parent === filePath) {\n return false;\n }\n try {\n for (let dirent of this.readdirSync(parent, {withFileTypes: true})) {\n if (typeof dirent === 'string') {\n break; // {withFileTypes: true} not supported\n } else if (dirent.name === name) {\n if (dirent.isSymbolicLink()) {\n return true;\n }\n }\n }\n } catch (e) {\n if (e.code === 'ENOENT') {\n return false;\n }\n throw e;\n }\n }\n }\n\n return false;\n }\n\n async _copyPathForWrite(filePath: FilePath): Promise<FilePath> {\n filePath = await this._normalizePath(filePath);\n let dirPath = path.dirname(filePath);\n if (this.existsSync(dirPath) && !this.writable.existsSync(dirPath)) {\n await this.writable.mkdirp(dirPath);\n }\n return filePath;\n }\n\n _normalizePath(filePath: FilePath): FilePath {\n return path.resolve(this.cwd(), filePath);\n }\n\n // eslint-disable-next-line require-await\n async readFile(filePath: FilePath, encoding?: Encoding): Promise<any> {\n return this.readFileSync(filePath, encoding);\n }\n\n async writeFile(\n filePath: FilePath,\n contents: string | Buffer,\n options: ?FileOptions,\n ): Promise<void> {\n filePath = await this._copyPathForWrite(filePath);\n await this.writable.writeFile(filePath, contents, options);\n this.deleted.delete(filePath);\n }\n\n async copyFile(source: FilePath, destination: FilePath): Promise<void> {\n source = this._normalizePath(source);\n destination = await this._copyPathForWrite(destination);\n\n if (await this.writable.exists(source)) {\n await this.writable.writeFile(\n destination,\n await this.writable.readFile(source),\n );\n } else {\n await this.writable.writeFile(\n destination,\n await this.readable.readFile(source),\n );\n }\n\n this.deleted.delete(destination);\n }\n\n // eslint-disable-next-line require-await\n async stat(filePath: FilePath): Promise<Stats> {\n return this.statSync(filePath);\n }\n\n async symlink(target: FilePath, filePath: FilePath): Promise<void> {\n target = this._normalizePath(target);\n filePath = this._normalizePath(filePath);\n await this.writable.symlink(target, filePath);\n this.deleted.delete(filePath);\n }\n\n async unlink(filePath: FilePath): Promise<void> {\n filePath = this._normalizePath(filePath);\n\n let toDelete = [filePath];\n\n if (this.writable instanceof MemoryFS && this._isSymlink(filePath)) {\n this.writable.symlinks.delete(filePath);\n } else if (this.statSync(filePath).isDirectory()) {\n let stack = [filePath];\n\n // Recursively add every descendant path to deleted.\n while (stack.length) {\n let root = nullthrows(stack.pop());\n for (let ent of this.readdirSync(root, {withFileTypes: true})) {\n if (typeof ent === 'string') {\n let childPath = path.join(root, ent);\n toDelete.push(childPath);\n if (this.statSync(childPath).isDirectory()) {\n stack.push(childPath);\n }\n } else {\n let childPath = path.join(root, ent.name);\n toDelete.push(childPath);\n if (ent.isDirectory()) {\n stack.push(childPath);\n }\n }\n }\n }\n }\n\n try {\n await this.writable.unlink(filePath);\n } catch (e) {\n if (e.code === 'ENOENT' && !this.readable.existsSync(filePath)) {\n throw e;\n }\n }\n\n for (let pathToDelete of toDelete) {\n this.deleted.add(pathToDelete);\n }\n }\n\n async mkdirp(dir: FilePath): Promise<void> {\n dir = this._normalizePath(dir);\n await this.writable.mkdirp(dir);\n\n if (this.deleted != null) {\n let root = path.parse(dir).root;\n while (dir !== root) {\n this.deleted.delete(dir);\n dir = path.dirname(dir);\n }\n }\n }\n\n async rimraf(filePath: FilePath): Promise<void> {\n try {\n await this.unlink(filePath);\n } catch (e) {\n // noop\n }\n }\n\n // eslint-disable-next-line require-await\n async ncp(source: FilePath, destination: FilePath): Promise<void> {\n // TODO: Implement this correctly.\n return this.writable.ncp(source, destination);\n }\n\n createReadStream(filePath: FilePath, opts?: ?FileOptions): Readable {\n filePath = this._deletedThrows(filePath);\n if (this.writable.existsSync(filePath)) {\n return this.writable.createReadStream(filePath, opts);\n }\n\n return this.readable.createReadStream(filePath, opts);\n }\n\n createWriteStream(path: FilePath, opts?: ?FileOptions): Writable {\n path = this._normalizePath(path);\n this.deleted.delete(path);\n return this.writable.createWriteStream(path, opts);\n }\n\n cwd(): FilePath {\n return this._cwd;\n }\n\n chdir(path: FilePath): void {\n this._cwd = this._checkExists(path);\n }\n\n // eslint-disable-next-line require-await\n async realpath(filePath: FilePath): Promise<FilePath> {\n return this.realpathSync(filePath);\n }\n\n readFileSync(filePath: FilePath, encoding?: Encoding): any {\n filePath = this.realpathSync(filePath);\n try {\n // $FlowFixMe[incompatible-call]\n return this.writable.readFileSync(filePath, encoding);\n } catch (err) {\n // $FlowFixMe[incompatible-call]\n return this.readable.readFileSync(filePath, encoding);\n }\n }\n\n statSync(filePath: FilePath): Stats {\n filePath = this._normalizePath(filePath);\n try {\n return this.writable.statSync(filePath);\n } catch (e) {\n if (e.code === 'ENOENT' && this.existsSync(filePath)) {\n return this.readable.statSync(filePath);\n }\n throw e;\n }\n }\n\n realpathSync(filePath: FilePath): FilePath {\n filePath = this._deletedThrows(filePath);\n filePath = this._deletedThrows(this.writable.realpathSync(filePath));\n if (!this.writable.existsSync(filePath)) {\n return this.readable.realpathSync(filePath);\n }\n return filePath;\n }\n\n // eslint-disable-next-line require-await\n async exists(filePath: FilePath): Promise<boolean> {\n return this.existsSync(filePath);\n }\n\n existsSync(filePath: FilePath): boolean {\n filePath = this._normalizePath(filePath);\n if (this.deleted.has(filePath)) return false;\n\n try {\n filePath = this.realpathSync(filePath);\n } catch (err) {\n if (err.code !== 'ENOENT') throw err;\n }\n\n if (this.deleted.has(filePath)) return false;\n\n return (\n this.writable.existsSync(filePath) || this.readable.existsSync(filePath)\n );\n }\n\n // eslint-disable-next-line require-await\n async readdir(path: FilePath, opts?: ReaddirOptions): Promise<any> {\n return this.readdirSync(path, opts);\n }\n\n readdirSync(dir: FilePath, opts?: ReaddirOptions): any {\n dir = this.realpathSync(dir);\n // Read from both filesystems and merge the results\n let entries = new Map();\n\n try {\n for (let entry: any of this.writable.readdirSync(dir, opts)) {\n let filePath = path.join(dir, entry.name ?? entry);\n if (this.deleted.has(filePath)) continue;\n entries.set(filePath, entry);\n }\n } catch {\n // noop\n }\n\n try {\n for (let entry: any of this.readable.readdirSync(dir, opts)) {\n let filePath = path.join(dir, entry.name ?? entry);\n if (this.deleted.has(filePath)) continue;\n if (entries.has(filePath)) continue;\n entries.set(filePath, entry);\n }\n } catch {\n // noop\n }\n\n return Array.from(entries.values());\n }\n\n async watch(\n dir: FilePath,\n fn: (err: ?Error, events: Array<Event>) => mixed,\n opts: WatcherOptions,\n ): Promise<AsyncSubscription> {\n let writableSubscription = await this.writable.watch(dir, fn, opts);\n let readableSubscription = await this.readable.watch(dir, fn, opts);\n return {\n unsubscribe: async () => {\n await writableSubscription.unsubscribe();\n await readableSubscription.unsubscribe();\n },\n };\n }\n\n async getEventsSince(\n dir: FilePath,\n snapshot: FilePath,\n opts: WatcherOptions,\n ): Promise<Array<Event>> {\n let writableEvents = await this.writable.getEventsSince(\n dir,\n snapshot,\n opts,\n );\n let readableEvents = await this.readable.getEventsSince(\n dir,\n snapshot,\n opts,\n );\n return [...writableEvents, ...readableEvents];\n }\n\n async writeSnapshot(\n dir: FilePath,\n snapshot: FilePath,\n opts: WatcherOptions,\n ): Promise<void> {\n await this.writable.writeSnapshot(dir, snapshot, opts);\n }\n\n findAncestorFile(\n fileNames: Array<string>,\n fromDir: FilePath,\n root: FilePath,\n ): ?FilePath {\n return findAncestorFile(this, fileNames, fromDir, root);\n }\n\n findNodeModule(moduleName: string, fromDir: FilePath): ?FilePath {\n return findNodeModule(this, moduleName, fromDir);\n }\n\n findFirstFile(filePaths: Array<FilePath>): ?FilePath {\n return findFirstFile(this, filePaths);\n }\n}\n\nclass FSError extends Error {\n code: string;\n path: FilePath;\n constructor(code: string, path: FilePath, message: string) {\n super(`${code}: ${path} ${message}`);\n this.name = 'FSError';\n this.code = code;\n this.path = path;\n Error.captureStackTrace?.(this, this.constructor);\n }\n}\n\nregisterSerializableClass(`${packageJSON.version}:OverlayFS`, OverlayFS);\n"],"names":["path","stream","promisify","pipeline","ncp","sourceFS","source","destinationFS","destination","mkdirp","files","readdir","file","sourcePath","join","destPath","stats","stat","isFile","createReadStream","createWriteStream","isDirectory","NodeFS","constructor","Error","Readable","Writable","registerSerializableClass","SharedBuffer","packageJSON","WorkerFarm","Handle","nullthrows","EventEmitter","findAncestorFile","findNodeModule","findFirstFile","instances","Map","id","MemoryFS","_numWorkerInstances","_workerRegisterResolves","_emitter","workerFarm","farm","_cwd","resolve","sep","dirs","Directory","symlinks","watchers","events","_workerHandles","_eventQueue","set","on","deserialize","opts","existing","get","getWorkerApi","runHandle","handle","fs","WorkerFS","serialize","createReverseHandle","fn","args","$$raw","decrementWorkerInstance","length","emit","cwd","chdir","dir","_normalizePath","filePath","realpath","normalize","startsWith","root","base","parse","parts","slice","split","concat","res","part","symlink","writeFile","contents","options","has","FSError","dirname","buffer","makeShared","mode","write","File","_sendWorkerEvent","type","entry","_triggerEvent","readFile","encoding","readFileSync","read","toString","copyFile","statSync","readdirSync","endsWith","indexOf","name","withFileTypes","push","Dirent","from","S_IFLNK","unlink","delete","Promise","rimraf","keys","dirPath","destName","exists","ReadStream","WriteStream","realpathSync","target","existsSync","event","size","clearTimeout","_watcherTimer","setTimeout","watcher","trigger","_registerWorker","all","map","workerHandle","workerApi","watch","Watcher","Set","add","unsubscribe","getEventsSince","snapshot","len","Number","ignore","filter","some","i","writeSnapshot","fileNames","fromDir","moduleName","filePaths","code","message","captureStackTrace","reading","bytesRead","_read","then","byteLength","err","emitClose","autoDestroy","Buffer","alloc","_write","chunk","callback","c","_final","catch","S_IFREG","S_IFDIR","S_IFMT","Entry","now","Date","atime","mtime","ctime","birthtime","access","modify","getSize","Stat","dev","ino","nlink","uid","gid","rdev","blksize","blocks","atimeMs","mtimeMs","ctimeMs","birthtimeMs","Boolean","isBlockDevice","isCharacterDevice","isSymbolicLink","isFIFO","isSocket","contentsBuffer","process","browser","shared","handleFn","methodName","version","module","exports","JSON","basename","moduleDir","pathRoot","fileName","OverlayFS","deleted","workerFarmOrFS","readable","writable","_deletedThrows","_checkExists","_isSymlink","segments","pop","parent","dirent","e","_copyPathForWrite","toDelete","stack","ent","childPath","pathToDelete","entries","Array","values","writableSubscription","readableSubscription","writableEvents","readableEvents"],"version":3,"file":"browser.js.map"} |