@chromatic-com/cypress 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,14 +11,14 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
11
11
|
var me__default = /*#__PURE__*/_interopDefault(me);
|
|
12
12
|
var qe__default = /*#__PURE__*/_interopDefault(qe);
|
|
13
13
|
|
|
14
|
-
var Ue=Object.defineProperty;var i=(p,
|
|
15
|
-
GFS4: `),console.error(t);},"debug")),e[l]||(_=global[l]||[],F(e,_),e.close=function(t){function u(d,v){return t.call(e,d,function(E){E||k(),typeof v=="function"&&v.apply(this,arguments);})}return i(u,"t"),c(u,"close"),Object.defineProperty(u,r,{value:t}),u}(e.close),e.closeSync=function(t){function u(d){t.apply(e,arguments),k();}return i(u,"t"),c(u,"closeSync"),Object.defineProperty(u,r,{value:t}),u}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){S(e[l]),K("assert").equal(e[l].length,0);}));var _;global[l]||F(global,e[l]),s.exports=x(m(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(s.exports=x(e),e.__patched=!0);function x(t){n(t),t.gracefulify=x,t.createReadStream=ae,t.createWriteStream=se;var u=t.readFile;t.readFile=d;function d(I,W,M){return typeof W=="function"&&(M=W,W=null),Y(I,W,M);function Y(z,B,V,G){return u(z,B,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?a([Y,[z,B,V],J,G||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments);})}}i(d,"r"),c(d,"readFile");var v=t.writeFile;t.writeFile=E;function E(I,W,M,Y){return typeof M=="function"&&(Y=M,M=null),z(I,W,M,Y);function z(B,V,G,J,X){return v(B,V,G,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?a([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}i(E,"i"),c(E,"writeFile");var b=t.appendFile;b&&(t.appendFile=w);function w(I,W,M,Y){return typeof M=="function"&&(Y=M,M=null),z(I,W,M,Y);function z(B,V,G,J,X){return b(B,V,G,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?a([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}i(w,"c"),c(w,"appendFile");var O=t.copyFile;O&&(t.copyFile=j);function j(I,W,M,Y){return typeof M=="function"&&(Y=M,M=0),z(I,W,M,Y);function z(B,V,G,J,X){return O(B,V,G,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?a([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}i(j,"f"),c(j,"copyFile");var T=t.readdir;t.readdir=L;var D=/^v[0-5]\./;function L(I,W,M){typeof W=="function"&&(M=W,W=null);var Y=D.test(process.version)?c(function(B,V,G,J){return T(B,z(B,V,G,J))},"go$readdir"):c(function(B,V,G,J){return T(B,V,z(B,V,G,J))},"go$readdir");return Y(I,W,M);function z(B,V,G,J){return function(X,U){X&&(X.code==="EMFILE"||X.code==="ENFILE")?a([Y,[B,V,G],X,J||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof G=="function"&&G.call(this,X,U));}}}if(i(L,"m"),c(L,"readdir"),process.version.substr(0,4)==="v0.8"){var g=o(t);q=g.ReadStream,Q=g.WriteStream;}var N=t.ReadStream;N&&(q.prototype=Object.create(N.prototype),q.prototype.open=H);var C=t.WriteStream;C&&(Q.prototype=Object.create(C.prototype),Q.prototype.open=re),Object.defineProperty(t,"ReadStream",{get:function(){return q},set:function(I){q=I;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return Q},set:function(I){Q=I;},enumerable:!0,configurable:!0});var $=q;Object.defineProperty(t,"FileReadStream",{get:function(){return $},set:function(I){$=I;},enumerable:!0,configurable:!0});var R=Q;Object.defineProperty(t,"FileWriteStream",{get:function(){return R},set:function(I){R=I;},enumerable:!0,configurable:!0});function q(I,W){return this instanceof q?(N.apply(this,arguments),this):q.apply(Object.create(q.prototype),arguments)}i(q,"q"),c(q,"ReadStream");function H(){var I=this;le(I.path,I.flags,I.mode,function(W,M){W?(I.autoClose&&I.destroy(),I.emit("error",W)):(I.fd=M,I.emit("open",M),I.read());});}i(H,"W"),c(H,"ReadStream$open");function Q(I,W){return this instanceof Q?(C.apply(this,arguments),this):Q.apply(Object.create(Q.prototype),arguments)}i(Q,"$"),c(Q,"WriteStream");function re(){var I=this;le(I.path,I.flags,I.mode,function(W,M){W?(I.destroy(),I.emit("error",W)):(I.fd=M,I.emit("open",M));});}i(re,"ie"),c(re,"WriteStream$open");function ae(I,W){return new t.ReadStream(I,W)}i(ae,"He"),c(ae,"createReadStream");function se(I,W){return new t.WriteStream(I,W)}i(se,"Ke"),c(se,"createWriteStream");var ue=t.open;t.open=le;function le(I,W,M,Y){return typeof M=="function"&&(Y=M,M=null),z(I,W,M,Y);function z(B,V,G,J,X){return ue(B,V,G,function(U,Dt){U&&(U.code==="EMFILE"||U.code==="ENFILE")?a([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}return i(le,"Oe"),c(le,"open"),t}i(x,"_e"),c(x,"patch");function a(t){S("ENQUEUE",t[0].name,t[1]),e[l].push(t),P();}i(a,"ee"),c(a,"enqueue");var y;function k(){for(var t=Date.now(),u=0;u<e[l].length;++u)e[l][u].length>2&&(e[l][u][3]=t,e[l][u][4]=t);P();}i(k,"ut"),c(k,"resetQueue");function P(){if(clearTimeout(y),y=void 0,e[l].length!==0){var t=e[l].shift(),u=t[0],d=t[1],v=t[2],E=t[3],b=t[4];if(E===void 0)S("RETRY",u.name,d),u.apply(null,d);else if(Date.now()-E>=6e4){S("TIMEOUT",u.name,d);var w=d.pop();typeof w=="function"&&w.call(null,v);}else {var O=Date.now()-b,j=Math.max(b-E,1),T=Math.min(j*1.2,100);O>=T?(S("RETRY",u.name,d),u.apply(null,d.concat([E]))):e[l].push(t);}y===void 0&&(y=setTimeout(P,0));}}i(P,"Ie"),c(P,"retry");}),oe=A(p=>{var s=Z().fromCallback,e=ee(),n=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(o=>typeof e[o]=="function");Object.assign(p,e),n.forEach(o=>{p[o]=s(e[o]);}),p.exists=function(o,m){return typeof m=="function"?e.exists(o,m):new Promise(f=>e.exists(o,f))},p.read=function(o,m,f,l,r,h){return typeof h=="function"?e.read(o,m,f,l,r,h):new Promise((F,S)=>{e.read(o,m,f,l,r,(_,x,a)=>{if(_)return S(_);F({bytesRead:x,buffer:a});});})},p.write=function(o,m,...f){return typeof f[f.length-1]=="function"?e.write(o,m,...f):new Promise((l,r)=>{e.write(o,m,...f,(h,F,S)=>{if(h)return r(h);l({bytesWritten:F,buffer:S});});})},p.readv=function(o,m,...f){return typeof f[f.length-1]=="function"?e.readv(o,m,...f):new Promise((l,r)=>{e.readv(o,m,...f,(h,F,S)=>{if(h)return r(h);l({bytesRead:F,buffers:S});});})},p.writev=function(o,m,...f){return typeof f[f.length-1]=="function"?e.writev(o,m,...f):new Promise((l,r)=>{e.writev(o,m,...f,(h,F,S)=>{if(h)return r(h);l({bytesWritten:F,buffers:S});});})},typeof e.realpath.native=="function"?p.realpath.native=s(e.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");}),et=A((p,s)=>{var e=K("path");s.exports.checkPath=c(function(n){if(process.platform==="win32"&&/[<>:"|?*]/.test(n.replace(e.parse(n).root,""))){let o=new Error(`Path contains invalid characters: ${n}`);throw o.code="EINVAL",o}},"checkPath");}),tt=A((p,s)=>{var e=oe(),{checkPath:n}=et(),o=c(m=>typeof m=="number"?m:{...{mode:511},...m}.mode,"getMode");s.exports.makeDir=async(m,f)=>(n(m),e.mkdir(m,{mode:o(f),recursive:!0})),s.exports.makeDirSync=(m,f)=>(n(m),e.mkdirSync(m,{mode:o(f),recursive:!0}));}),te=A((p,s)=>{var e=Z().fromPromise,{makeDir:n,makeDirSync:o}=tt(),m=e(n);s.exports={mkdirs:m,mkdirsSync:o,mkdirp:m,mkdirpSync:o,ensureDir:m,ensureDirSync:o};}),ie=A((p,s)=>{var e=Z().fromPromise,n=oe();function o(m){return n.access(m).then(()=>!0).catch(()=>!1)}i(o,"_n"),c(o,"pathExists"),s.exports={pathExists:e(o),pathExistsSync:n.existsSync};}),Pe=A((p,s)=>{var e=ee();function n(m,f,l,r){e.open(m,"r+",(h,F)=>{if(h)return r(h);e.futimes(F,f,l,S=>{e.close(F,_=>{r&&r(S||_);});});});}i(n,"In"),c(n,"utimesMillis");function o(m,f,l){let r=e.openSync(m,"r+");return e.futimesSync(r,f,l),e.closeSync(r)}i(o,"Ln"),c(o,"utimesMillisSync"),s.exports={utimesMillis:n,utimesMillisSync:o};}),ce=A((p,s)=>{var e=oe(),n=K("path"),o=K("util");function m(a,y,k){let P=k.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([P(a),P(y).catch(t=>{if(t.code==="ENOENT")return null;throw t})]).then(([t,u])=>({srcStat:t,destStat:u}))}i(m,"jn"),c(m,"getStats");function f(a,y,k){let P,t=k.dereference?d=>e.statSync(d,{bigint:!0}):d=>e.lstatSync(d,{bigint:!0}),u=t(a);try{P=t(y);}catch(d){if(d.code==="ENOENT")return {srcStat:u,destStat:null};throw d}return {srcStat:u,destStat:P}}i(f,"An"),c(f,"getStatsSync");function l(a,y,k,P,t){o.callbackify(m)(a,y,P,(u,d)=>{if(u)return t(u);let{srcStat:v,destStat:E}=d;if(E){if(S(v,E)){let b=n.basename(a),w=n.basename(y);return k==="move"&&b!==w&&b.toLowerCase()===w.toLowerCase()?t(null,{srcStat:v,destStat:E,isChangingCase:!0}):t(new Error("Source and destination must not be the same."))}if(v.isDirectory()&&!E.isDirectory())return t(new Error(`Cannot overwrite non-directory '${y}' with directory '${a}'.`));if(!v.isDirectory()&&E.isDirectory())return t(new Error(`Cannot overwrite directory '${y}' with non-directory '${a}'.`))}return v.isDirectory()&&_(a,y)?t(new Error(x(a,y,k))):t(null,{srcStat:v,destStat:E})});}i(l,"Rn"),c(l,"checkPaths");function r(a,y,k,P){let{srcStat:t,destStat:u}=f(a,y,P);if(u){if(S(t,u)){let d=n.basename(a),v=n.basename(y);if(k==="move"&&d!==v&&d.toLowerCase()===v.toLowerCase())return {srcStat:t,destStat:u,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(t.isDirectory()&&!u.isDirectory())throw new Error(`Cannot overwrite non-directory '${y}' with directory '${a}'.`);if(!t.isDirectory()&&u.isDirectory())throw new Error(`Cannot overwrite directory '${y}' with non-directory '${a}'.`)}if(t.isDirectory()&&_(a,y))throw new Error(x(a,y,k));return {srcStat:t,destStat:u}}i(r,"Wn"),c(r,"checkPathsSync");function h(a,y,k,P,t){let u=n.resolve(n.dirname(a)),d=n.resolve(n.dirname(k));if(d===u||d===n.parse(d).root)return t();e.stat(d,{bigint:!0},(v,E)=>v?v.code==="ENOENT"?t():t(v):S(y,E)?t(new Error(x(a,k,P))):h(a,y,d,P,t));}i(h,"vt"),c(h,"checkParentPaths");function F(a,y,k,P){let t=n.resolve(n.dirname(a)),u=n.resolve(n.dirname(k));if(u===t||u===n.parse(u).root)return;let d;try{d=e.statSync(u,{bigint:!0});}catch(v){if(v.code==="ENOENT")return;throw v}if(S(y,d))throw new Error(x(a,k,P));return F(a,y,u,P)}i(F,"Et"),c(F,"checkParentPathsSync");function S(a,y){return y.ino&&y.dev&&y.ino===a.ino&&y.dev===a.dev}i(S,"oe"),c(S,"areIdentical");function _(a,y){let k=n.resolve(a).split(n.sep).filter(t=>t),P=n.resolve(y).split(n.sep).filter(t=>t);return k.reduce((t,u,d)=>t&&P[d]===u,!0)}i(_,"We"),c(_,"isSrcSubdir");function x(a,y,k){return `Cannot ${k} '${a}' to a subdirectory of itself, '${y}'.`}i(x,"ve"),c(x,"errMsg"),s.exports={checkPaths:l,checkPathsSync:r,checkParentPaths:h,checkParentPathsSync:F,isSrcSubdir:_,areIdentical:S};}),rt=A((p,s)=>{var e=ee(),n=K("path"),o=te().mkdirs,m=ie().pathExists,f=Pe().utimesMillis,l=ce();function r(D,L,g,N){typeof g=="function"&&!N?(N=g,g={}):typeof g=="function"&&(g={filter:g}),N=N||function(){},g=g||{},g.clobber="clobber"in g?!!g.clobber:!0,g.overwrite="overwrite"in g?!!g.overwrite:g.clobber,g.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
14
|
+
var Ue=Object.defineProperty;var i=(p,a)=>Ue(p,"name",{value:a,configurable:!0}),ne=(p=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(p,{get:(a,e)=>(typeof require<"u"?require:a)[e]}):p)(function(p){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+p+'" is not supported')});var Be=Object.create,de=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Ge=Object.getOwnPropertyNames,Ke=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,c=i((p,a)=>de(p,"name",{value:a,configurable:!0}),"o"),K=(p=>typeof ne<"u"?ne:typeof Proxy<"u"?new Proxy(p,{get:(a,e)=>(typeof ne<"u"?ne:a)[e]}):p)(function(p){if(typeof ne<"u")return ne.apply(this,arguments);throw Error('Dynamic require of "'+p+'" is not supported')}),A=i((p,a)=>()=>(a||p((a={exports:{}}).exports,a),a.exports),"d"),Ye=i((p,a,e,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of Ge(a))!He.call(p,o)&&o!==e&&de(p,o,{get:()=>a[o],enumerable:!(n=Ve(a,o))||n.enumerable});return p},"mn"),ze=i((p,a,e)=>(e=p!=null?Be(Ke(p)):{},Ye(a||!p||!p.__esModule?de(e,"default",{value:p,enumerable:!0}):e,p)),"yn"),Z=A(p=>{p.fromCallback=function(a){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")a.apply(this,e);else return new Promise((n,o)=>{a.call(this,...e,(m,f)=>m!=null?o(m):n(f));})},"name",{value:a.name})},p.fromPromise=function(a){return Object.defineProperty(function(...e){let n=e[e.length-1];if(typeof n!="function")return a.apply(this,e);a.apply(this,e.slice(0,-1)).then(o=>n(null,o),n);},"name",{value:a.name})};}),Qe=A((p,a)=>{var e=K("constants"),n=process.cwd,o=null,m=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return o||(o=n.call(process)),o};try{process.cwd();}catch{}typeof process.chdir=="function"&&(f=process.chdir,process.chdir=function(r){o=null,f.call(process,r);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,f));var f;a.exports=l;function l(r){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&h(r),r.lutimes||F(r),r.chown=x(r.chown),r.fchown=x(r.fchown),r.lchown=x(r.lchown),r.chmod=S(r.chmod),r.fchmod=S(r.fchmod),r.lchmod=S(r.lchmod),r.chownSync=s(r.chownSync),r.fchownSync=s(r.fchownSync),r.lchownSync=s(r.lchownSync),r.chmodSync=_(r.chmodSync),r.fchmodSync=_(r.fchmodSync),r.lchmodSync=_(r.lchmodSync),r.stat=y(r.stat),r.fstat=y(r.fstat),r.lstat=y(r.lstat),r.statSync=k(r.statSync),r.fstatSync=k(r.fstatSync),r.lstatSync=k(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(t,u,d){d&&process.nextTick(d);},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(t,u,d,v){v&&process.nextTick(v);},r.lchownSync=function(){}),m==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(t){function u(d,v,E){var b=Date.now(),w=0;t(d,v,c(i(function O(j){if(j&&(j.code==="EACCES"||j.code==="EPERM"||j.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){r.stat(v,function(T,D){T&&T.code==="ENOENT"?t(d,v,O):E(j);});},w),w<100&&(w+=10);return}E&&E(j);},"q"),"CB"));}return i(u,"m"),c(u,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(u,t),u}(r.rename)),r.read=typeof r.read!="function"?r.read:function(t){function u(d,v,E,b,w,O){var j;if(O&&typeof O=="function"){var T=0;j=c(function(D,L,g){if(D&&D.code==="EAGAIN"&&T<10)return T++,t.call(r,d,v,E,b,w,j);O.apply(this,arguments);},"callback");}return t.call(r,d,v,E,b,w,j)}return i(u,"m"),c(u,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(u,t),u}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(t){return function(u,d,v,E,b){for(var w=0;;)try{return t.call(r,u,d,v,E,b)}catch(O){if(O.code==="EAGAIN"&&w<10){w++;continue}throw O}}}(r.readSync);function h(t){t.lchmod=function(u,d,v){t.open(u,e.O_WRONLY|e.O_SYMLINK,d,function(E,b){if(E){v&&v(E);return}t.fchmod(b,d,function(w){t.close(b,function(O){v&&v(w||O);});});});},t.lchmodSync=function(u,d){var v=t.openSync(u,e.O_WRONLY|e.O_SYMLINK,d),E=!0,b;try{b=t.fchmodSync(v,d),E=!1;}finally{if(E)try{t.closeSync(v);}catch{}else t.closeSync(v);}return b};}i(h,"t"),c(h,"patchLchmod");function F(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(u,d,v,E){t.open(u,e.O_SYMLINK,function(b,w){if(b){E&&E(b);return}t.futimes(w,d,v,function(O){t.close(w,function(j){E&&E(O||j);});});});},t.lutimesSync=function(u,d,v){var E=t.openSync(u,e.O_SYMLINK),b,w=!0;try{b=t.futimesSync(E,d,v),w=!1;}finally{if(w)try{t.closeSync(E);}catch{}else t.closeSync(E);}return b}):t.futimes&&(t.lutimes=function(u,d,v,E){E&&process.nextTick(E);},t.lutimesSync=function(){});}i(F,"r"),c(F,"patchLutimes");function S(t){return t&&function(u,d,v){return t.call(r,u,d,function(E){P(E)&&(E=null),v&&v.apply(this,arguments);})}}i(S,"n"),c(S,"chmodFix");function _(t){return t&&function(u,d){try{return t.call(r,u,d)}catch(v){if(!P(v))throw v}}}i(_,"i"),c(_,"chmodFixSync");function x(t){return t&&function(u,d,v,E){return t.call(r,u,d,v,function(b){P(b)&&(b=null),E&&E.apply(this,arguments);})}}i(x,"u"),c(x,"chownFix");function s(t){return t&&function(u,d,v){try{return t.call(r,u,d,v)}catch(E){if(!P(E))throw E}}}i(s,"c"),c(s,"chownFixSync");function y(t){return t&&function(u,d,v){typeof d=="function"&&(v=d,d=null);function E(b,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),v&&v.apply(this,arguments);}return i(E,"p"),c(E,"callback"),d?t.call(r,u,d,E):t.call(r,u,E)}}i(y,"a"),c(y,"statFix");function k(t){return t&&function(u,d){var v=d?t.call(r,u,d):t.call(r,u);return v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),v}}i(k,"f"),c(k,"statFixSync");function P(t){if(!t||t.code==="ENOSYS")return !0;var u=!process.getuid||process.getuid()!==0;return !!(u&&(t.code==="EINVAL"||t.code==="EPERM"))}i(P,"S"),c(P,"chownErOk");}i(l,"vn"),c(l,"patch");}),Xe=A((p,a)=>{var e=K("stream").Stream;a.exports=n;function n(o){return {ReadStream:m,WriteStream:f};function m(l,r){if(!(this instanceof m))return new m(l,r);e.call(this);var h=this;this.path=l,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var F=Object.keys(r),S=0,_=F.length;S<_;S++){var x=F[S];this[x]=r[x];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){h._read();});return}o.open(this.path,this.flags,this.mode,function(s,y){if(s){h.emit("error",s),h.readable=!1;return}h.fd=y,h.emit("open",y),h._read();});}function f(l,r){if(!(this instanceof f))return new f(l,r);e.call(this),this.path=l,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var h=Object.keys(r),F=0,S=h.length;F<S;F++){var _=h[F];this[_]=r[_];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=o.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}i(n,"En"),c(n,"legacy");}),Ze=A((p,a)=>{a.exports=n;var e=Object.getPrototypeOf||function(o){return o.__proto__};function n(o){if(o===null||typeof o!="object")return o;if(o instanceof Object)var m={__proto__:e(o)};else var m=Object.create(null);return Object.getOwnPropertyNames(o).forEach(function(f){Object.defineProperty(m,f,Object.getOwnPropertyDescriptor(o,f));}),m}i(n,"kn"),c(n,"clone");}),ee=A((p,a)=>{var e=K("fs"),n=Qe(),o=Xe(),m=Ze(),f=K("util"),l,r;typeof Symbol=="function"&&typeof Symbol.for=="function"?(l=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(l="___graceful-fs.queue",r="___graceful-fs.previous");function h(){}i(h,"Pn"),c(h,"noop");function F(t,u){Object.defineProperty(t,l,{get:function(){return u}});}i(F,"ct"),c(F,"publishQueue");var S=h;f.debuglog?S=f.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(S=c(function(){var t=f.format.apply(f,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
15
|
+
GFS4: `),console.error(t);},"debug")),e[l]||(_=global[l]||[],F(e,_),e.close=function(t){function u(d,v){return t.call(e,d,function(E){E||k(),typeof v=="function"&&v.apply(this,arguments);})}return i(u,"t"),c(u,"close"),Object.defineProperty(u,r,{value:t}),u}(e.close),e.closeSync=function(t){function u(d){t.apply(e,arguments),k();}return i(u,"t"),c(u,"closeSync"),Object.defineProperty(u,r,{value:t}),u}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){S(e[l]),K("assert").equal(e[l].length,0);}));var _;global[l]||F(global,e[l]),a.exports=x(m(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(a.exports=x(e),e.__patched=!0);function x(t){n(t),t.gracefulify=x,t.createReadStream=se,t.createWriteStream=ae;var u=t.readFile;t.readFile=d;function d(I,W,M){return typeof W=="function"&&(M=W,W=null),Y(I,W,M);function Y(z,B,V,G){return u(z,B,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?s([Y,[z,B,V],J,G||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments);})}}i(d,"r"),c(d,"readFile");var v=t.writeFile;t.writeFile=E;function E(I,W,M,Y){return typeof M=="function"&&(Y=M,M=null),z(I,W,M,Y);function z(B,V,G,J,X){return v(B,V,G,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?s([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}i(E,"i"),c(E,"writeFile");var b=t.appendFile;b&&(t.appendFile=w);function w(I,W,M,Y){return typeof M=="function"&&(Y=M,M=null),z(I,W,M,Y);function z(B,V,G,J,X){return b(B,V,G,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?s([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}i(w,"c"),c(w,"appendFile");var O=t.copyFile;O&&(t.copyFile=j);function j(I,W,M,Y){return typeof M=="function"&&(Y=M,M=0),z(I,W,M,Y);function z(B,V,G,J,X){return O(B,V,G,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?s([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}i(j,"f"),c(j,"copyFile");var T=t.readdir;t.readdir=L;var D=/^v[0-5]\./;function L(I,W,M){typeof W=="function"&&(M=W,W=null);var Y=D.test(process.version)?c(function(B,V,G,J){return T(B,z(B,V,G,J))},"go$readdir"):c(function(B,V,G,J){return T(B,V,z(B,V,G,J))},"go$readdir");return Y(I,W,M);function z(B,V,G,J){return function(X,U){X&&(X.code==="EMFILE"||X.code==="ENFILE")?s([Y,[B,V,G],X,J||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof G=="function"&&G.call(this,X,U));}}}if(i(L,"m"),c(L,"readdir"),process.version.substr(0,4)==="v0.8"){var g=o(t);q=g.ReadStream,Q=g.WriteStream;}var N=t.ReadStream;N&&(q.prototype=Object.create(N.prototype),q.prototype.open=H);var C=t.WriteStream;C&&(Q.prototype=Object.create(C.prototype),Q.prototype.open=re),Object.defineProperty(t,"ReadStream",{get:function(){return q},set:function(I){q=I;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return Q},set:function(I){Q=I;},enumerable:!0,configurable:!0});var $=q;Object.defineProperty(t,"FileReadStream",{get:function(){return $},set:function(I){$=I;},enumerable:!0,configurable:!0});var R=Q;Object.defineProperty(t,"FileWriteStream",{get:function(){return R},set:function(I){R=I;},enumerable:!0,configurable:!0});function q(I,W){return this instanceof q?(N.apply(this,arguments),this):q.apply(Object.create(q.prototype),arguments)}i(q,"q"),c(q,"ReadStream");function H(){var I=this;le(I.path,I.flags,I.mode,function(W,M){W?(I.autoClose&&I.destroy(),I.emit("error",W)):(I.fd=M,I.emit("open",M),I.read());});}i(H,"W"),c(H,"ReadStream$open");function Q(I,W){return this instanceof Q?(C.apply(this,arguments),this):Q.apply(Object.create(Q.prototype),arguments)}i(Q,"$"),c(Q,"WriteStream");function re(){var I=this;le(I.path,I.flags,I.mode,function(W,M){W?(I.destroy(),I.emit("error",W)):(I.fd=M,I.emit("open",M));});}i(re,"ie"),c(re,"WriteStream$open");function se(I,W){return new t.ReadStream(I,W)}i(se,"He"),c(se,"createReadStream");function ae(I,W){return new t.WriteStream(I,W)}i(ae,"Ke"),c(ae,"createWriteStream");var ue=t.open;t.open=le;function le(I,W,M,Y){return typeof M=="function"&&(Y=M,M=null),z(I,W,M,Y);function z(B,V,G,J,X){return ue(B,V,G,function(U,Dt){U&&(U.code==="EMFILE"||U.code==="ENFILE")?s([z,[B,V,G,J],U,X||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments);})}}return i(le,"Oe"),c(le,"open"),t}i(x,"_e"),c(x,"patch");function s(t){S("ENQUEUE",t[0].name,t[1]),e[l].push(t),P();}i(s,"ee"),c(s,"enqueue");var y;function k(){for(var t=Date.now(),u=0;u<e[l].length;++u)e[l][u].length>2&&(e[l][u][3]=t,e[l][u][4]=t);P();}i(k,"ut"),c(k,"resetQueue");function P(){if(clearTimeout(y),y=void 0,e[l].length!==0){var t=e[l].shift(),u=t[0],d=t[1],v=t[2],E=t[3],b=t[4];if(E===void 0)S("RETRY",u.name,d),u.apply(null,d);else if(Date.now()-E>=6e4){S("TIMEOUT",u.name,d);var w=d.pop();typeof w=="function"&&w.call(null,v);}else {var O=Date.now()-b,j=Math.max(b-E,1),T=Math.min(j*1.2,100);O>=T?(S("RETRY",u.name,d),u.apply(null,d.concat([E]))):e[l].push(t);}y===void 0&&(y=setTimeout(P,0));}}i(P,"Ie"),c(P,"retry");}),oe=A(p=>{var a=Z().fromCallback,e=ee(),n=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(o=>typeof e[o]=="function");Object.assign(p,e),n.forEach(o=>{p[o]=a(e[o]);}),p.exists=function(o,m){return typeof m=="function"?e.exists(o,m):new Promise(f=>e.exists(o,f))},p.read=function(o,m,f,l,r,h){return typeof h=="function"?e.read(o,m,f,l,r,h):new Promise((F,S)=>{e.read(o,m,f,l,r,(_,x,s)=>{if(_)return S(_);F({bytesRead:x,buffer:s});});})},p.write=function(o,m,...f){return typeof f[f.length-1]=="function"?e.write(o,m,...f):new Promise((l,r)=>{e.write(o,m,...f,(h,F,S)=>{if(h)return r(h);l({bytesWritten:F,buffer:S});});})},p.readv=function(o,m,...f){return typeof f[f.length-1]=="function"?e.readv(o,m,...f):new Promise((l,r)=>{e.readv(o,m,...f,(h,F,S)=>{if(h)return r(h);l({bytesRead:F,buffers:S});});})},p.writev=function(o,m,...f){return typeof f[f.length-1]=="function"?e.writev(o,m,...f):new Promise((l,r)=>{e.writev(o,m,...f,(h,F,S)=>{if(h)return r(h);l({bytesWritten:F,buffers:S});});})},typeof e.realpath.native=="function"?p.realpath.native=a(e.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");}),et=A((p,a)=>{var e=K("path");a.exports.checkPath=c(function(n){if(process.platform==="win32"&&/[<>:"|?*]/.test(n.replace(e.parse(n).root,""))){let o=new Error(`Path contains invalid characters: ${n}`);throw o.code="EINVAL",o}},"checkPath");}),tt=A((p,a)=>{var e=oe(),{checkPath:n}=et(),o=c(m=>typeof m=="number"?m:{...{mode:511},...m}.mode,"getMode");a.exports.makeDir=async(m,f)=>(n(m),e.mkdir(m,{mode:o(f),recursive:!0})),a.exports.makeDirSync=(m,f)=>(n(m),e.mkdirSync(m,{mode:o(f),recursive:!0}));}),te=A((p,a)=>{var e=Z().fromPromise,{makeDir:n,makeDirSync:o}=tt(),m=e(n);a.exports={mkdirs:m,mkdirsSync:o,mkdirp:m,mkdirpSync:o,ensureDir:m,ensureDirSync:o};}),ie=A((p,a)=>{var e=Z().fromPromise,n=oe();function o(m){return n.access(m).then(()=>!0).catch(()=>!1)}i(o,"_n"),c(o,"pathExists"),a.exports={pathExists:e(o),pathExistsSync:n.existsSync};}),Pe=A((p,a)=>{var e=ee();function n(m,f,l,r){e.open(m,"r+",(h,F)=>{if(h)return r(h);e.futimes(F,f,l,S=>{e.close(F,_=>{r&&r(S||_);});});});}i(n,"In"),c(n,"utimesMillis");function o(m,f,l){let r=e.openSync(m,"r+");return e.futimesSync(r,f,l),e.closeSync(r)}i(o,"Ln"),c(o,"utimesMillisSync"),a.exports={utimesMillis:n,utimesMillisSync:o};}),ce=A((p,a)=>{var e=oe(),n=K("path"),o=K("util");function m(s,y,k){let P=k.dereference?t=>e.stat(t,{bigint:!0}):t=>e.lstat(t,{bigint:!0});return Promise.all([P(s),P(y).catch(t=>{if(t.code==="ENOENT")return null;throw t})]).then(([t,u])=>({srcStat:t,destStat:u}))}i(m,"jn"),c(m,"getStats");function f(s,y,k){let P,t=k.dereference?d=>e.statSync(d,{bigint:!0}):d=>e.lstatSync(d,{bigint:!0}),u=t(s);try{P=t(y);}catch(d){if(d.code==="ENOENT")return {srcStat:u,destStat:null};throw d}return {srcStat:u,destStat:P}}i(f,"An"),c(f,"getStatsSync");function l(s,y,k,P,t){o.callbackify(m)(s,y,P,(u,d)=>{if(u)return t(u);let{srcStat:v,destStat:E}=d;if(E){if(S(v,E)){let b=n.basename(s),w=n.basename(y);return k==="move"&&b!==w&&b.toLowerCase()===w.toLowerCase()?t(null,{srcStat:v,destStat:E,isChangingCase:!0}):t(new Error("Source and destination must not be the same."))}if(v.isDirectory()&&!E.isDirectory())return t(new Error(`Cannot overwrite non-directory '${y}' with directory '${s}'.`));if(!v.isDirectory()&&E.isDirectory())return t(new Error(`Cannot overwrite directory '${y}' with non-directory '${s}'.`))}return v.isDirectory()&&_(s,y)?t(new Error(x(s,y,k))):t(null,{srcStat:v,destStat:E})});}i(l,"Rn"),c(l,"checkPaths");function r(s,y,k,P){let{srcStat:t,destStat:u}=f(s,y,P);if(u){if(S(t,u)){let d=n.basename(s),v=n.basename(y);if(k==="move"&&d!==v&&d.toLowerCase()===v.toLowerCase())return {srcStat:t,destStat:u,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(t.isDirectory()&&!u.isDirectory())throw new Error(`Cannot overwrite non-directory '${y}' with directory '${s}'.`);if(!t.isDirectory()&&u.isDirectory())throw new Error(`Cannot overwrite directory '${y}' with non-directory '${s}'.`)}if(t.isDirectory()&&_(s,y))throw new Error(x(s,y,k));return {srcStat:t,destStat:u}}i(r,"Wn"),c(r,"checkPathsSync");function h(s,y,k,P,t){let u=n.resolve(n.dirname(s)),d=n.resolve(n.dirname(k));if(d===u||d===n.parse(d).root)return t();e.stat(d,{bigint:!0},(v,E)=>v?v.code==="ENOENT"?t():t(v):S(y,E)?t(new Error(x(s,k,P))):h(s,y,d,P,t));}i(h,"vt"),c(h,"checkParentPaths");function F(s,y,k,P){let t=n.resolve(n.dirname(s)),u=n.resolve(n.dirname(k));if(u===t||u===n.parse(u).root)return;let d;try{d=e.statSync(u,{bigint:!0});}catch(v){if(v.code==="ENOENT")return;throw v}if(S(y,d))throw new Error(x(s,k,P));return F(s,y,u,P)}i(F,"Et"),c(F,"checkParentPathsSync");function S(s,y){return y.ino&&y.dev&&y.ino===s.ino&&y.dev===s.dev}i(S,"oe"),c(S,"areIdentical");function _(s,y){let k=n.resolve(s).split(n.sep).filter(t=>t),P=n.resolve(y).split(n.sep).filter(t=>t);return k.reduce((t,u,d)=>t&&P[d]===u,!0)}i(_,"We"),c(_,"isSrcSubdir");function x(s,y,k){return `Cannot ${k} '${s}' to a subdirectory of itself, '${y}'.`}i(x,"ve"),c(x,"errMsg"),a.exports={checkPaths:l,checkPathsSync:r,checkParentPaths:h,checkParentPathsSync:F,isSrcSubdir:_,areIdentical:S};}),rt=A((p,a)=>{var e=ee(),n=K("path"),o=te().mkdirs,m=ie().pathExists,f=Pe().utimesMillis,l=ce();function r(D,L,g,N){typeof g=="function"&&!N?(N=g,g={}):typeof g=="function"&&(g={filter:g}),N=N||function(){},g=g||{},g.clobber="clobber"in g?!!g.clobber:!0,g.overwrite="overwrite"in g?!!g.overwrite:g.clobber,g.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
16
16
|
|
|
17
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),l.checkPaths(D,L,"copy",g,(C,$)=>{if(C)return N(C);let{srcStat:R,destStat:q}=$;l.checkParentPaths(D,R,L,"copy",H=>{if(H)return N(H);F(D,L,g,(Q,re)=>{if(Q)return N(Q);if(!re)return N();h(q,D,L,g,N);});});});}i(r,"Bn"),c(r,"copy");function h(D,L,g,N,C){let $=n.dirname(g);m($,(R,q)=>{if(R)return C(R);if(q)return S(D,L,g,N,C);o($,H=>H?C(H):S(D,L,g,N,C));});}i(h,"Un"),c(h,"checkParentDir");function F(D,L,g,N){if(!g.filter)return N(null,!0);Promise.resolve(g.filter(D,L)).then(C=>N(null,C),C=>N(C));}i(F,"xt"),c(F,"runFilter");function S(D,L,g,N,C){(N.dereference?e.stat:e.lstat)(L,($,R)=>$?C($):R.isDirectory()?v(R,D,L,g,N,C):R.isFile()||R.isCharacterDevice()||R.isBlockDevice()?_(R,D,L,g,N,C):R.isSymbolicLink()?j(D,L,g,N,C):R.isSocket()?C(new Error(`Cannot copy a socket file: ${L}`)):R.isFIFO()?C(new Error(`Cannot copy a FIFO pipe: ${L}`)):C(new Error(`Unknown file: ${L}`)));}i(S,"Me"),c(S,"getStats");function _(D,L,g,N,C,$){return L?x(D,g,N,C,$):
|
|
17
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),l.checkPaths(D,L,"copy",g,(C,$)=>{if(C)return N(C);let{srcStat:R,destStat:q}=$;l.checkParentPaths(D,R,L,"copy",H=>{if(H)return N(H);F(D,L,g,(Q,re)=>{if(Q)return N(Q);if(!re)return N();h(q,D,L,g,N);});});});}i(r,"Bn"),c(r,"copy");function h(D,L,g,N,C){let $=n.dirname(g);m($,(R,q)=>{if(R)return C(R);if(q)return S(D,L,g,N,C);o($,H=>H?C(H):S(D,L,g,N,C));});}i(h,"Un"),c(h,"checkParentDir");function F(D,L,g,N){if(!g.filter)return N(null,!0);Promise.resolve(g.filter(D,L)).then(C=>N(null,C),C=>N(C));}i(F,"xt"),c(F,"runFilter");function S(D,L,g,N,C){(N.dereference?e.stat:e.lstat)(L,($,R)=>$?C($):R.isDirectory()?v(R,D,L,g,N,C):R.isFile()||R.isCharacterDevice()||R.isBlockDevice()?_(R,D,L,g,N,C):R.isSymbolicLink()?j(D,L,g,N,C):R.isSocket()?C(new Error(`Cannot copy a socket file: ${L}`)):R.isFIFO()?C(new Error(`Cannot copy a FIFO pipe: ${L}`)):C(new Error(`Unknown file: ${L}`)));}i(S,"Me"),c(S,"getStats");function _(D,L,g,N,C,$){return L?x(D,g,N,C,$):s(D,g,N,C,$)}i(_,"Yn"),c(_,"onFile");function x(D,L,g,N,C){if(N.overwrite)e.unlink(g,$=>$?C($):s(D,L,g,N,C));else return N.errorOnExist?C(new Error(`'${g}' already exists`)):C()}i(x,"bn"),c(x,"mayCopyFile");function s(D,L,g,N,C){e.copyFile(L,g,$=>$?C($):N.preserveTimestamps?y(D.mode,L,g,C):u(g,D.mode,C));}i(s,"qt"),c(s,"copyFile");function y(D,L,g,N){return k(D)?P(g,D,C=>C?N(C):t(D,L,g,N)):t(D,L,g,N)}i(y,"Gn"),c(y,"handleTimestampsAndMode");function k(D){return (D&128)===0}i(k,"Hn"),c(k,"fileIsNotWritable");function P(D,L,g){return u(D,L|128,g)}i(P,"Kn"),c(P,"makeFileWritable");function t(D,L,g,N){d(L,g,C=>C?N(C):u(g,D,N));}i(t,"kt"),c(t,"setDestTimestampsAndMode");function u(D,L,g){return e.chmod(D,L,g)}i(u,"Ee"),c(u,"setDestMode");function d(D,L,g){e.stat(D,(N,C)=>N?g(N):f(L,C.atime,C.mtime,g));}i(d,"zn"),c(d,"setDestTimestamps");function v(D,L,g,N,C,$){return L?b(g,N,C,$):E(D.mode,g,N,C,$)}i(v,"Qn"),c(v,"onDir");function E(D,L,g,N,C){e.mkdir(g,$=>{if($)return C($);b(L,g,N,R=>R?C(R):u(g,D,C));});}i(E,"Xn"),c(E,"mkDirAndCopy");function b(D,L,g,N){e.readdir(D,(C,$)=>C?N(C):w($,D,L,g,N));}i(b,"gt"),c(b,"copyDir");function w(D,L,g,N,C){let $=D.pop();return $?O(D,$,L,g,N,C):C()}i(w,"Je"),c(w,"copyDirItems");function O(D,L,g,N,C,$){let R=n.join(g,L),q=n.join(N,L);F(R,q,C,(H,Q)=>{if(H)return $(H);if(!Q)return w(D,g,N,C,$);l.checkPaths(R,q,"copy",C,(re,se)=>{if(re)return $(re);let{destStat:ae}=se;S(ae,R,q,C,ue=>ue?$(ue):w(D,g,N,C,$));});});}i(O,"Zn"),c(O,"copyDirItem");function j(D,L,g,N,C){e.readlink(L,($,R)=>{if($)return C($);if(N.dereference&&(R=n.resolve(process.cwd(),R)),D)e.readlink(g,(q,H)=>q?q.code==="EINVAL"||q.code==="UNKNOWN"?e.symlink(R,g,C):C(q):(N.dereference&&(H=n.resolve(process.cwd(),H)),l.isSrcSubdir(R,H)?C(new Error(`Cannot copy '${R}' to a subdirectory of itself, '${H}'.`)):l.isSrcSubdir(H,R)?C(new Error(`Cannot overwrite '${H}' with '${R}'.`)):T(R,g,C)));else return e.symlink(R,g,C)});}i(j,"ei"),c(j,"onLink");function T(D,L,g){e.unlink(L,N=>N?g(N):e.symlink(D,L,g));}i(T,"ti"),c(T,"copyLink"),a.exports=r;}),nt=A((p,a)=>{var e=ee(),n=K("path"),o=te().mkdirsSync,m=Pe().utimesMillisSync,f=ce();function l(b,w,O){typeof O=="function"&&(O={filter:O}),O=O||{},O.clobber="clobber"in O?!!O.clobber:!0,O.overwrite="overwrite"in O?!!O.overwrite:O.clobber,O.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
18
18
|
|
|
19
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:j,destStat:T}=f.checkPathsSync(b,w,"copy",O);if(f.checkParentPathsSync(b,j,w,"copy"),O.filter&&!O.filter(b,w))return;let D=n.dirname(w);return e.existsSync(D)||o(D),r(T,b,w,O)}i(l,"ii"),c(l,"copySync");function r(b,w,O,j){let T=(j.dereference?e.statSync:e.lstatSync)(w);if(T.isDirectory())return P(T,b,w,O,j);if(T.isFile()||T.isCharacterDevice()||T.isBlockDevice())return h(T,b,w,O,j);if(T.isSymbolicLink())return v(b,w,O,j);throw T.isSocket()?new Error(`Cannot copy a socket file: ${w}`):T.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${w}`):new Error(`Unknown file: ${w}`)}i(r,"Dt"),c(r,"getStats");function h(b,w,O,j,T){return w?F(b,O,j,T):S(b,O,j,T)}i(h,"oi"),c(h,"onFile");function F(b,w,O,j){if(j.overwrite)return e.unlinkSync(O),S(b,w,O,j);if(j.errorOnExist)throw new Error(`'${O}' already exists`)}i(F,"ui"),c(F,"mayCopyFile");function S(b,w,O,j){return e.copyFileSync(w,O),j.preserveTimestamps&&_(b.mode,w,O),y(O,b.mode)}i(S,"Nt"),c(S,"copyFile");function _(b,w,O){return x(b)&&
|
|
20
|
-
`,finalEOL:f=!0,replacer:l=null,spaces:r}={}){let h=f?m:"";return JSON.stringify(o,l,r).replace(/\n/g,m)+h}i(e,"Bi"),c(e,"stringify");function n(o){return Buffer.isBuffer(o)&&(o=o.toString("utf8")),o.replace(/^\uFEFF/,"")}i(n,"Ui"),c(n,"stripBom"),
|
|
19
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:j,destStat:T}=f.checkPathsSync(b,w,"copy",O);if(f.checkParentPathsSync(b,j,w,"copy"),O.filter&&!O.filter(b,w))return;let D=n.dirname(w);return e.existsSync(D)||o(D),r(T,b,w,O)}i(l,"ii"),c(l,"copySync");function r(b,w,O,j){let T=(j.dereference?e.statSync:e.lstatSync)(w);if(T.isDirectory())return P(T,b,w,O,j);if(T.isFile()||T.isCharacterDevice()||T.isBlockDevice())return h(T,b,w,O,j);if(T.isSymbolicLink())return v(b,w,O,j);throw T.isSocket()?new Error(`Cannot copy a socket file: ${w}`):T.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${w}`):new Error(`Unknown file: ${w}`)}i(r,"Dt"),c(r,"getStats");function h(b,w,O,j,T){return w?F(b,O,j,T):S(b,O,j,T)}i(h,"oi"),c(h,"onFile");function F(b,w,O,j){if(j.overwrite)return e.unlinkSync(O),S(b,w,O,j);if(j.errorOnExist)throw new Error(`'${O}' already exists`)}i(F,"ui"),c(F,"mayCopyFile");function S(b,w,O,j){return e.copyFileSync(w,O),j.preserveTimestamps&&_(b.mode,w,O),y(O,b.mode)}i(S,"Nt"),c(S,"copyFile");function _(b,w,O){return x(b)&&s(O,b),k(w,O)}i(_,"ci"),c(_,"handleTimestamps");function x(b){return (b&128)===0}i(x,"si"),c(x,"fileIsNotWritable");function s(b,w){return y(b,w|128)}i(s,"ai"),c(s,"makeFileWritable");function y(b,w){return e.chmodSync(b,w)}i(y,"Ve"),c(y,"setDestMode");function k(b,w){let O=e.statSync(b);return m(w,O.atime,O.mtime)}i(k,"fi"),c(k,"setDestTimestamps");function P(b,w,O,j,T){return w?u(O,j,T):t(b.mode,O,j,T)}i(P,"li"),c(P,"onDir");function t(b,w,O,j){return e.mkdirSync(O),u(w,O,j),y(O,b)}i(t,"mi"),c(t,"mkDirAndCopy");function u(b,w,O){e.readdirSync(b).forEach(j=>d(j,b,w,O));}i(u,"Ct"),c(u,"copyDir");function d(b,w,O,j){let T=n.join(w,b),D=n.join(O,b);if(j.filter&&!j.filter(T,D))return;let{destStat:L}=f.checkPathsSync(T,D,"copy",j);return r(L,T,D,j)}i(d,"yi"),c(d,"copyDirItem");function v(b,w,O,j){let T=e.readlinkSync(w);if(j.dereference&&(T=n.resolve(process.cwd(),T)),b){let D;try{D=e.readlinkSync(O);}catch(L){if(L.code==="EINVAL"||L.code==="UNKNOWN")return e.symlinkSync(T,O);throw L}if(j.dereference&&(D=n.resolve(process.cwd(),D)),f.isSrcSubdir(T,D))throw new Error(`Cannot copy '${T}' to a subdirectory of itself, '${D}'.`);if(f.isSrcSubdir(D,T))throw new Error(`Cannot overwrite '${D}' with '${T}'.`);return E(T,O)}else return e.symlinkSync(T,O)}i(v,"hi"),c(v,"onLink");function E(b,w){return e.unlinkSync(w),e.symlinkSync(b,w)}i(E,"pi"),c(E,"copyLink"),a.exports=l;}),he=A((p,a)=>{var e=Z().fromCallback;a.exports={copy:e(rt()),copySync:nt()};}),fe=A((p,a)=>{var e=ee(),n=Z().fromCallback;function o(f,l){e.rm(f,{recursive:!0,force:!0},l);}i(o,"wi"),c(o,"remove");function m(f){e.rmSync(f,{recursive:!0,force:!0});}i(m,"vi"),c(m,"removeSync"),a.exports={remove:n(o),removeSync:m};}),it=A((p,a)=>{var e=Z().fromPromise,n=oe(),o=K("path"),m=te(),f=fe(),l=e(c(async function(h){let F;try{F=await n.readdir(h);}catch{return m.mkdirs(h)}return Promise.all(F.map(S=>f.remove(o.join(h,S))))},"emptyDir"));function r(h){let F;try{F=n.readdirSync(h);}catch{return m.mkdirsSync(h)}F.forEach(S=>{S=o.join(h,S),f.removeSync(S);});}i(r,"At"),c(r,"emptyDirSync"),a.exports={emptyDirSync:r,emptydirSync:r,emptyDir:l,emptydir:l};}),ot=A((p,a)=>{var e=Z().fromCallback,n=K("path"),o=ee(),m=te();function f(r,h){function F(){o.writeFile(r,"",S=>{if(S)return h(S);h();});}i(F,"r"),c(F,"makeFile"),o.stat(r,(S,_)=>{if(!S&&_.isFile())return h();let x=n.dirname(r);o.stat(x,(s,y)=>{if(s)return s.code==="ENOENT"?m.mkdirs(x,k=>{if(k)return h(k);F();}):h(s);y.isDirectory()?F():o.readdir(x,k=>{if(k)return h(k)});});});}i(f,"ki"),c(f,"createFile");function l(r){let h;try{h=o.statSync(r);}catch{}if(h&&h.isFile())return;let F=n.dirname(r);try{o.statSync(F).isDirectory()||o.readdirSync(F);}catch(S){if(S&&S.code==="ENOENT")m.mkdirsSync(F);else throw S}o.writeFileSync(r,"");}i(l,"xi"),c(l,"createFileSync"),a.exports={createFile:e(f),createFileSync:l};}),ct=A((p,a)=>{var e=Z().fromCallback,n=K("path"),o=ee(),m=te(),f=ie().pathExists,{areIdentical:l}=ce();function r(F,S,_){function x(s,y){o.link(s,y,k=>{if(k)return _(k);_(null);});}i(x,"n"),c(x,"makeLink"),o.lstat(S,(s,y)=>{o.lstat(F,(k,P)=>{if(k)return k.message=k.message.replace("lstat","ensureLink"),_(k);if(y&&l(P,y))return _(null);let t=n.dirname(S);f(t,(u,d)=>{if(u)return _(u);if(d)return x(F,S);m.mkdirs(t,v=>{if(v)return _(v);x(F,S);});});});});}i(r,"Pi"),c(r,"createLink");function h(F,S){let _;try{_=o.lstatSync(S);}catch{}try{let s=o.lstatSync(F);if(_&&l(s,_))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let x=n.dirname(S);return o.existsSync(x)||m.mkdirsSync(x),o.linkSync(F,S)}i(h,"Oi"),c(h,"createLinkSync"),a.exports={createLink:e(r),createLinkSync:h};}),st=A((p,a)=>{var e=K("path"),n=ee(),o=ie().pathExists;function m(l,r,h){if(e.isAbsolute(l))return n.lstat(l,F=>F?(F.message=F.message.replace("lstat","ensureSymlink"),h(F)):h(null,{toCwd:l,toDst:l}));{let F=e.dirname(r),S=e.join(F,l);return o(S,(_,x)=>_?h(_):x?h(null,{toCwd:S,toDst:l}):n.lstat(l,s=>s?(s.message=s.message.replace("lstat","ensureSymlink"),h(s)):h(null,{toCwd:l,toDst:e.relative(F,l)})))}}i(m,"Ni"),c(m,"symlinkPaths");function f(l,r){let h;if(e.isAbsolute(l)){if(h=n.existsSync(l),!h)throw new Error("absolute srcpath does not exist");return {toCwd:l,toDst:l}}else {let F=e.dirname(r),S=e.join(F,l);if(h=n.existsSync(S),h)return {toCwd:S,toDst:l};if(h=n.existsSync(l),!h)throw new Error("relative srcpath does not exist");return {toCwd:l,toDst:e.relative(F,l)}}}i(f,"Ci"),c(f,"symlinkPathsSync"),a.exports={symlinkPaths:m,symlinkPathsSync:f};}),at=A((p,a)=>{var e=ee();function n(m,f,l){if(l=typeof f=="function"?f:l,f=typeof f=="function"?!1:f,f)return l(null,f);e.lstat(m,(r,h)=>{if(r)return l(null,"file");f=h&&h.isDirectory()?"dir":"file",l(null,f);});}i(n,"Ti"),c(n,"symlinkType");function o(m,f){let l;if(f)return f;try{l=e.lstatSync(m);}catch{return "file"}return l&&l.isDirectory()?"dir":"file"}i(o,"_i"),c(o,"symlinkTypeSync"),a.exports={symlinkType:n,symlinkTypeSync:o};}),ut=A((p,a)=>{var e=Z().fromCallback,n=K("path"),o=oe(),m=te(),f=m.mkdirs,l=m.mkdirsSync,r=st(),h=r.symlinkPaths,F=r.symlinkPathsSync,S=at(),_=S.symlinkType,x=S.symlinkTypeSync,s=ie().pathExists,{areIdentical:y}=ce();function k(u,d,v,E){E=typeof v=="function"?v:E,v=typeof v=="function"?!1:v,o.lstat(d,(b,w)=>{!b&&w.isSymbolicLink()?Promise.all([o.stat(u),o.stat(d)]).then(([O,j])=>{if(y(O,j))return E(null);P(u,d,v,E);}):P(u,d,v,E);});}i(k,"Ji"),c(k,"createSymlink");function P(u,d,v,E){h(u,d,(b,w)=>{if(b)return E(b);u=w.toDst,_(w.toCwd,v,(O,j)=>{if(O)return E(O);let T=n.dirname(d);s(T,(D,L)=>{if(D)return E(D);if(L)return o.symlink(u,d,j,E);f(T,g=>{if(g)return E(g);o.symlink(u,d,j,E);});});});});}i(P,"ir"),c(P,"_createSymlink");function t(u,d,v){let E;try{E=o.lstatSync(d);}catch{}if(E&&E.isSymbolicLink()){let O=o.statSync(u),j=o.statSync(d);if(y(O,j))return}let b=F(u,d);u=b.toDst,v=x(b.toCwd,v);let w=n.dirname(d);return o.existsSync(w)||l(w),o.symlinkSync(u,d,v)}i(t,"Vi"),c(t,"createSymlinkSync"),a.exports={createSymlink:e(k),createSymlinkSync:t};}),lt=A((p,a)=>{var{createFile:e,createFileSync:n}=ot(),{createLink:o,createLinkSync:m}=ct(),{createSymlink:f,createSymlinkSync:l}=ut();a.exports={createFile:e,createFileSync:n,ensureFile:e,ensureFileSync:n,createLink:o,createLinkSync:m,ensureLink:o,ensureLinkSync:m,createSymlink:f,createSymlinkSync:l,ensureSymlink:f,ensureSymlinkSync:l};}),Se=A((p,a)=>{function e(o,{EOL:m=`
|
|
20
|
+
`,finalEOL:f=!0,replacer:l=null,spaces:r}={}){let h=f?m:"";return JSON.stringify(o,l,r).replace(/\n/g,m)+h}i(e,"Bi"),c(e,"stringify");function n(o){return Buffer.isBuffer(o)&&(o=o.toString("utf8")),o.replace(/^\uFEFF/,"")}i(n,"Ui"),c(n,"stripBom"),a.exports={stringify:e,stripBom:n};}),ft=A((p,a)=>{var e;try{e=ee();}catch{e=K("fs");}var n=Z(),{stringify:o,stripBom:m}=Se();async function f(x,s={}){typeof s=="string"&&(s={encoding:s});let y=s.fs||e,k="throws"in s?s.throws:!0,P=await n.fromCallback(y.readFile)(x,s);P=m(P);let t;try{t=JSON.parse(P,s?s.reviver:null);}catch(u){if(k)throw u.message=`${x}: ${u.message}`,u;return null}return t}i(f,"Yi"),c(f,"_readFile");var l=n.fromPromise(f);function r(x,s={}){typeof s=="string"&&(s={encoding:s});let y=s.fs||e,k="throws"in s?s.throws:!0;try{let P=y.readFileSync(x,s);return P=m(P),JSON.parse(P,s.reviver)}catch(P){if(k)throw P.message=`${x}: ${P.message}`,P;return null}}i(r,"Gi"),c(r,"readFileSync");async function h(x,s,y={}){let k=y.fs||e,P=o(s,y);await n.fromCallback(k.writeFile)(x,P,y);}i(h,"Hi"),c(h,"_writeFile");var F=n.fromPromise(h);function S(x,s,y={}){let k=y.fs||e,P=o(s,y);return k.writeFileSync(x,P,y)}i(S,"zi"),c(S,"writeFileSync");var _={readFile:l,readFileSync:r,writeFile:F,writeFileSync:S};a.exports=_;}),yt=A((p,a)=>{var e=ft();a.exports={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync};}),ve=A((p,a)=>{var e=Z().fromCallback,n=ee(),o=K("path"),m=te(),f=ie().pathExists;function l(h,F,S,_){typeof S=="function"&&(_=S,S="utf8");let x=o.dirname(h);f(x,(s,y)=>{if(s)return _(s);if(y)return n.writeFile(h,F,S,_);m.mkdirs(x,k=>{if(k)return _(k);n.writeFile(h,F,S,_);});});}i(l,"eo"),c(l,"outputFile");function r(h,...F){let S=o.dirname(h);if(n.existsSync(S))return n.writeFileSync(h,...F);m.mkdirsSync(S),n.writeFileSync(h,...F);}i(r,"to"),c(r,"outputFileSync"),a.exports={outputFile:e(l),outputFileSync:r};}),pt=A((p,a)=>{var{stringify:e}=Se(),{outputFile:n}=ve();async function o(m,f,l={}){let r=e(f,l);await n(m,r,l);}i(o,"io"),c(o,"outputJson"),a.exports=o;}),mt=A((p,a)=>{var{stringify:e}=Se(),{outputFileSync:n}=ve();function o(m,f,l){let r=e(f,l);n(m,r,l);}i(o,"co"),c(o,"outputJsonSync"),a.exports=o;}),dt=A((p,a)=>{var e=Z().fromPromise,n=yt();n.outputJson=e(pt()),n.outputJsonSync=mt(),n.outputJSON=n.outputJson,n.outputJSONSync=n.outputJsonSync,n.writeJSON=n.writeJson,n.writeJSONSync=n.writeJsonSync,n.readJSON=n.readJson,n.readJSONSync=n.readJsonSync,a.exports=n;}),ht=A((p,a)=>{var e=ee(),n=K("path"),o=he().copy,m=fe().remove,f=te().mkdirp,l=ie().pathExists,r=ce();function h(s,y,k,P){typeof k=="function"&&(P=k,k={}),k=k||{};let t=k.overwrite||k.clobber||!1;r.checkPaths(s,y,"move",k,(u,d)=>{if(u)return P(u);let{srcStat:v,isChangingCase:E=!1}=d;r.checkParentPaths(s,v,y,"move",b=>{if(b)return P(b);if(F(y))return S(s,y,t,E,P);f(n.dirname(y),w=>w?P(w):S(s,y,t,E,P));});});}i(h,"yo"),c(h,"move");function F(s){let y=n.dirname(s);return n.parse(y).root===y}i(F,"ho"),c(F,"isParentRoot");function S(s,y,k,P,t){if(P)return _(s,y,k,t);if(k)return m(y,u=>u?t(u):_(s,y,k,t));l(y,(u,d)=>u?t(u):d?t(new Error("dest already exists.")):_(s,y,k,t));}i(S,"Ar"),c(S,"doRename");function _(s,y,k,P){e.rename(s,y,t=>t?t.code!=="EXDEV"?P(t):x(s,y,k,P):P());}i(_,"Be"),c(_,"rename");function x(s,y,k,P){o(s,y,{overwrite:k,errorOnExist:!0,preserveTimestamps:!0},t=>t?P(t):m(s,P));}i(x,"po"),c(x,"moveAcrossDevice"),a.exports=h;}),St=A((p,a)=>{var e=ee(),n=K("path"),o=he().copySync,m=fe().removeSync,f=te().mkdirpSync,l=ce();function r(x,s,y){y=y||{};let k=y.overwrite||y.clobber||!1,{srcStat:P,isChangingCase:t=!1}=l.checkPathsSync(x,s,"move",y);return l.checkParentPathsSync(x,P,s,"move"),h(s)||f(n.dirname(s)),F(x,s,k,t)}i(r,"vo"),c(r,"moveSync");function h(x){let s=n.dirname(x);return n.parse(s).root===s}i(h,"Eo"),c(h,"isParentRoot");function F(x,s,y,k){if(k)return S(x,s,y);if(y)return m(s),S(x,s,y);if(e.existsSync(s))throw new Error("dest already exists.");return S(x,s,y)}i(F,"Fo"),c(F,"doRename");function S(x,s,y){try{e.renameSync(x,s);}catch(k){if(k.code!=="EXDEV")throw k;return _(x,s,y)}}i(S,"Ye"),c(S,"rename");function _(x,s,y){return o(x,s,{overwrite:y,errorOnExist:!0,preserveTimestamps:!0}),m(x)}i(_,"ko"),c(_,"moveAcrossDevice"),a.exports=r;}),vt=A((p,a)=>{var e=Z().fromCallback;a.exports={move:e(ht()),moveSync:St()};}),wt=A((p,a)=>{a.exports={...oe(),...he(),...it(),...lt(),...dt(),...te(),...vt(),...ve(),...ie(),...fe()};});function xe(){return process.cwd()}i(xe,"pn");c(xe,"rootDir");function Ce(){let{CHROMATIC_ARCHIVE_LOCATION:p}=process.env;return p}i(Ce,"dn");c(Ce,"outputDirOverride");function ye(p){let a=Ce()||p;return me__default.default.resolve(xe(),a,"chromatic-archives")}i(ye,"he");c(ye,"archivesDir");function Ne(p){return me__default.default.resolve(ye(p),"archive")}i(Ne,"Qe");c(Ne,"assetsDir");function we(p){let a=ye(p);if(!qe__default.default.existsSync(a))throw new Error(`Chromatic archives directory cannot be found: ${a}
|
|
21
21
|
|
|
22
|
-
Please make sure that you have run your E2E tests, or have set the CHROMATIC_ARCHIVE_LOCATION env var if the output directory for the tests is not in the standard location.`)}i(we,"Ne");c(we,"checkArchivesDirExists");var ge=ze(wt());function pe(p){return `w${p.width}h${p.height}`}i(pe,"ye");c(pe,"viewportToString");function Le(p){let
|
|
22
|
+
Please make sure that you have run your E2E tests, or have set the CHROMATIC_ARCHIVE_LOCATION env var if the output directory for the tests is not in the standard location.`)}i(we,"Ne");c(we,"checkArchivesDirExists");var ge=ze(wt());function pe(p){return `w${p.width}h${p.height}`}i(pe,"ye");c(pe,"viewportToString");function Le(p){let a=p.match(/w(\d+)h(\d+)/);return {width:Number(a[1]),height:Number(a[2])}}i(Le,"zr");c(Le,"parseViewport");var bt="snapshot.json";function _e(p){let a=p.split(".");return a.slice(0,a.length-3).join(".")}i(_e,"Qr");c(_e,"snapshotIdFromFileName");function je(p){let a=p.split("."),e=a[a.length-3];return Le(e)}i(je,"Xr");c(je,"viewportFromFileName");async function Te(p){return (await promises.readdir(p)).filter(a=>a.endsWith(`.${bt}`))}i(Te,"Zr");c(Te,"listSnapshotFiles");var kt="stories.json";function Ie(p,a){let{stories:e}=p,n=e.map(o=>{let m=o.parameters.server.id,f=a[m];return {...o,parameters:{...o.parameters,chromatic:{...o.parameters.chromatic,modes:Re(f)},viewport:{viewports:Ae(f),defaultViewport:pe(Me(f))}}}});return {...p,stories:n}}i(Ie,"en");c(Ie,"addViewportsToStories");async function $e(p){return (await promises.readdir(p)).filter(a=>a.endsWith(`.${kt}`))}i($e,"tn");c($e,"listStoriesFiles");function Re(p){return p.reduce((a,e)=>{let n=pe(e);return a[n]={viewport:n},a},{})}i(Re,"No");c(Re,"buildStoryModesConfig");function Ae(p){return p.reduce((a,e)=>{let n=pe(e);return a[n]={name:n,styles:{width:`${e.width}px`,height:`${e.height}px`}},a},{})}i(Ae,"Co");c(Ae,"buildStoryViewportsConfig");function Me(p){let a=c((e,n)=>e.width<n.width?1:e.width>n.width?-1:0,"compareFn");return p.sort(a)[0]}i(Me,"To");c(Me,"findDefaultViewport");async function be(p){let a=Ne(p),e=await Te(a),n=We(e),o=ye(p),m=(await $e(o)).map(f=>me__default.default.resolve(o,f));await Promise.all(m.map(async f=>{let l=await(0, ge.readJSON)(f),r=Ie(l,n);await(0, ge.outputJSON)(f,r);}));}i(be,"Ge");c(be,"addViewportsToStoriesFiles");function We(p){let a={};return p.forEach(e=>{let n=_e(e),o=a[n]||[];o.push(je(e)),a[n]=o;}),a}i(We,"Io");c(We,"buildSnapshotViewportsLookup");function ke(p,a,e){we(e),be(e).then(()=>{let n=me.resolve(me.dirname(K.resolve("storybook/package.json")),"./index.js");child_process.execFileSync("node",[n,"dev",...p,"-c",a],{stdio:"inherit"});});}i(ke,"Sc");c(ke,"archiveStorybook");function gt(p,a,e){we(e),be(e).then(()=>{let n=me.resolve(me.dirname(K.resolve("storybook/package.json")),"./index.js");child_process.execFileSync("node",[n,"build",...p,"-c",a],{stdio:"inherit"});});}i(gt,"wc");c(gt,"buildArchiveStorybook");var Je="cypress/downloads";var Ft=process.argv.slice(2),Ot=me__default.default.resolve(__dirname,"../storybook-config");try{ke(Ft,Ot,Je);}catch(p){console.error(p.message),process.exitCode=1;}
|
|
23
23
|
//# sourceMappingURL=out.js.map
|
|
24
24
|
//# sourceMappingURL=archive-storybook.js.map
|