From c6a3a1775f4d1d2e88714d4b557bff20cb1301ea Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 May 2019 11:50:10 +0000 Subject: [PATCH 1/2] chore(deps): update dependency pretty-quick to v1.11.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 899049e5..7be559e0 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "husky": "1.3.1", "jest": "24.8.0", "prettier": "1.17.1", - "pretty-quick": "1.10.0", + "pretty-quick": "1.11.0", "rimraf": "2.6.3", "semantic-release": "15.13.12", "ts-jest": "24.0.2", diff --git a/yarn.lock b/yarn.lock index b242e600..5cc6c2ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5339,10 +5339,10 @@ pretty-format@^24.8.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-quick@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-1.10.0.tgz#d86cc46fe92ed8cfcfba6a082ec5949c53858198" - integrity sha512-uNvm2N3UWmnZRZrClyQI45hIbV20f5BpSyZY51Spbvn4APp9+XLyX4bCjWRGT3fGyVyQ/2/iw7dbQq1UUaq7SQ== +pretty-quick@1.11.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-1.11.0.tgz#d0bf997f3eb7de3d1bac5ffeb9c335f404d844c8" + integrity sha512-hy0yOSnqVykrgoHcCcB72p3B5ERQJcjQI6ExeSGSTFE2cDrPwCQtFb3kXA1F+jUPrbt7orra8U+fjS/Emjgpuw== dependencies: chalk "^2.3.0" execa "^0.8.0" From e3456b289da1f0f5a847c724a602dbcec57b5adc Mon Sep 17 00:00:00 2001 From: pizzafroide Date: Tue, 21 May 2019 16:36:03 +0200 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20mocks=20process.emitW?= =?UTF-8?q?arning=20for=20browser=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #374 --- src/process.ts | 6 ++++++ src/volume.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/process.ts b/src/process.ts index 5656227f..b43e74ff 100644 --- a/src/process.ts +++ b/src/process.ts @@ -6,6 +6,7 @@ export interface IProcess { cwd(): string; platform: string; nextTick: (callback: (...args) => void, ...args) => void; + emitWarning: (message: string, type: string) => void; env: { MEMFS_DONT_WARN?: boolean; }; @@ -23,6 +24,11 @@ export function createProcess(p: IProcess = process): IProcess { if (!p.getgid) p.getgid = () => 0; if (!p.cwd) p.cwd = () => '/'; if (!p.nextTick) p.nextTick = require('./setImmediate').default; + if (!p.emitWarning) + p.emitWarning = (message, type) => { + // tslint:disable-next-line:no-console + console.warn(`${type}${type ? ': ' : ''}${message}`); + }; if (!p.env) p.env = {}; return p; } diff --git a/src/volume.ts b/src/volume.ts index 3c377c5f..0f41091f 100644 --- a/src/volume.ts +++ b/src/volume.ts @@ -582,7 +582,7 @@ export class Volume { get promises() { if (promisesWarn) { promisesWarn = false; - require('process').emitWarning('The fs.promises API is experimental', 'ExperimentalWarning'); + process.emitWarning('The fs.promises API is experimental', 'ExperimentalWarning'); } if (this.promisesApi === null) throw new Error('Promise is not supported in this environment.'); return this.promisesApi;