@bazo/js-dev-scripts
Advanced tools
Comparing version 0.1.6 to 0.1.7
#!/usr/bin/env node | ||
var u=(e,n)=>()=>(n||(n={exports:{}},e(n.exports,n)),n.exports);var L=u((Ze,I)=>{I.exports=j;j.sync=Ce;var R=require("fs");function Te(e,n){var t=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var s=0;s<t.length;s++){var r=t[s].toLowerCase();if(r&&e.substr(-r.length).toLowerCase()===r)return!0}return!1}function D(e,n,t){return!e.isSymbolicLink()&&!e.isFile()?!1:Te(n,t)}function j(e,n,t){R.stat(e,function(s,r){t(s,s?!1:D(r,e,n))})}function Ce(e,n){return D(R.statSync(e),e,n)}});var G=u((en,M)=>{M.exports=F;F.sync=qe;var H=require("fs");function F(e,n,t){H.stat(e,function(s,r){t(s,s?!1:W(r,n))})}function qe(e,n){return W(H.statSync(e),n)}function W(e,n){return e.isFile()&&$e(e,n)}function $e(e,n){var t=e.mode,s=e.uid,r=e.gid,o=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),c=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),l=parseInt("100",8),p=parseInt("010",8),i=parseInt("001",8),h=l|p,a=t&i||t&p&&r===c||t&l&&s===o||t&h&&o===0;return a}});var K=u((tn,X)=>{var nn=require("fs"),w;process.platform==="win32"||global.TESTING_WINDOWS?w=L():w=G();X.exports=C;C.sync=Pe;function C(e,n,t){if(typeof n=="function"&&(t=n,n={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,r){C(e,n||{},function(o,c){o?r(o):s(c)})})}w(e,n||{},function(s,r){s&&(s.code==="EACCES"||n&&n.ignoreErrors)&&(s=null,r=!1),t(s,r)})}function Pe(e,n){try{return w.sync(e,n||{})}catch(t){if(n&&n.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Q=u((sn,U)=>{var m=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",V=require("path"),Oe=m?";":":",z=K(),B=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Y=(e,n)=>{let t=n.colon||Oe,s=e.match(/\//)||m&&e.match(/\\/)?[""]:[...m?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(t)],r=m?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=m?r.split(t):[""];return m&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:s,pathExt:o,pathExtExe:r}},J=(e,n,t)=>{typeof n=="function"&&(t=n,n={}),n||(n={});let{pathEnv:s,pathExt:r,pathExtExe:o}=Y(e,n),c=[],l=i=>new Promise((h,a)=>{if(i===s.length)return n.all&&c.length?h(c):a(B(e));let f=s[i],x=/^".*"$/.test(f)?f.slice(1,-1):f,d=V.join(x,e),b=!x&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;h(p(b,i,0))}),p=(i,h,a)=>new Promise((f,x)=>{if(a===r.length)return f(l(h+1));let d=r[a];z(i+d,{pathExt:o},(b,be)=>{if(!b&&be)if(n.all)c.push(i+d);else return f(i+d);return f(p(i,h,a+1))})});return t?l(0).then(i=>t(null,i),t):l(0)},_e=(e,n)=>{n=n||{};let{pathEnv:t,pathExt:s,pathExtExe:r}=Y(e,n),o=[];for(let c=0;c<t.length;c++){let l=t[c],p=/^".*"$/.test(l)?l.slice(1,-1):l,i=V.join(p,e),h=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+i:i;for(let a=0;a<s.length;a++){let f=h+s[a];try{if(z.sync(f,{pathExt:r}))if(n.all)o.push(f);else return f}catch(x){}}}if(n.all&&o.length)return o;if(n.nothrow)return null;throw B(e)};U.exports=J;J.sync=_e});var ee=u((rn,T)=>{"use strict";var Z=(e={})=>{let n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};T.exports=Z;T.exports.default=Z});var re=u((on,ne)=>{"use strict";var te=require("path"),Ne=Q(),ke=ee();function se(e,n){let t=e.options.env||process.env,s=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch(l){}let c;try{c=Ne.sync(e.command,{path:t[ke({env:t})],pathExt:n?te.delimiter:void 0})}catch(l){}finally{o&&process.chdir(s)}return c&&(c=te.resolve(r?e.options.cwd:"",c)),c}function Ae(e){return se(e)||se(e,!0)}ne.exports=Ae});var oe=u((cn,q)=>{"use strict";var $=/([()\][%!^"`<>&|;, *?])/g;function Ie(e){return e=e.replace($,"^$1"),e}function je(e,n){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace($,"^$1"),n&&(e=e.replace($,"^$1")),e}q.exports.command=Ie;q.exports.argument=je});var ie=u((un,ce)=>{"use strict";ce.exports=/^#!(.*)/});var le=u((ln,ue)=>{"use strict";var Re=ie();ue.exports=(e="")=>{let n=e.match(Re);if(!n)return null;let[t,s]=n[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?s:s?`${r} ${s}`:r}});var fe=u((an,ae)=>{"use strict";var P=require("fs"),De=le();function Le(e){let n=150,t=Buffer.alloc(n),s;try{s=P.openSync(e,"r"),P.readSync(s,t,0,n,0),P.closeSync(s)}catch(r){}return De(t.toString())}ae.exports=Le});var me=u((fn,he)=>{"use strict";var Me=require("path"),pe=re(),de=oe(),Fe=fe(),He=process.platform==="win32",We=/\.(?:com|exe)$/i,Ge=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Xe(e){e.file=pe(e);let n=e.file&&Fe(e.file);return n?(e.args.unshift(e.file),e.command=n,pe(e)):e.file}function Ke(e){if(!He)return e;let n=Xe(e),t=!We.test(n);if(e.options.forceShell||t){let s=Ge.test(n);e.command=Me.normalize(e.command),e.command=de.command(e.command),e.args=e.args.map(o=>de.argument(o,s));let r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Ue(e,n,t){n&&!Array.isArray(n)&&(t=n,n=null),n=n?n.slice(0):[],t=Object.assign({},t);let s={command:e,args:n,options:t,file:void 0,original:{command:e,args:n}};return t.shell?s:Ke(s)}he.exports=Ue});var ye=u((hn,Ee)=>{"use strict";var O=process.platform==="win32";function _(e,n){return Object.assign(new Error(`${n} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${n} ${e.command}`,path:e.command,spawnargs:e.args})}function Ve(e,n){if(!O)return;let t=e.emit;e.emit=function(s,r){if(s==="exit"){let o=xe(r,n,"spawn");if(o)return t.call(e,"error",o)}return t.apply(e,arguments)}}function xe(e,n){return O&&e===1&&!n.file?_(n.original,"spawn"):null}function ze(e,n){return O&&e===1&&!n.file?_(n.original,"spawnSync"):null}Ee.exports={hookChildProcess:Ve,verifyENOENT:xe,verifyENOENTSync:ze,notFoundError:_}});var we=u((pn,E)=>{"use strict";var ve=require("child_process"),N=me(),k=ye();function ge(e,n,t){let s=N(e,n,t),r=ve.spawn(s.command,s.args,s.options);return k.hookChildProcess(r,s),r}function Be(e,n,t){let s=N(e,n,t),r=ve.spawnSync(s.command,s.args,s.options);return r.error=r.error||k.verifyENOENTSync(r.status,s),r}E.exports=ge;E.exports.spawn=ge;E.exports.sync=Be;E.exports._parse=N;E.exports._enoent=k});process.env.__DEV_SCRIPTS_MODE==="development"&&require("pretty-error").start();process.on("unhandledRejection",e=>{throw e});var Ye=we(),Se=require("path"),y=process.argv.slice(2),v=y.findIndex(e=>e==="build"||e==="start"||e==="test"),S=v===-1?y[0]:y[v],g=v>0?y.slice(0,v):[],A="node",Je="js";process.env.__DEV_SCRIPTS_MODE==="development"&&(A=Se.resolve(__dirname,"../node_modules/.bin/ts-node-script"),S==="start"&&(A=Se.resolve(__dirname,"../node_modules/.bin/ts-node-dev"),g=g.concat(["--enable-source-maps","--script-mode","--rs","--exit-child","--clear"])));if(["build","start","test"].includes(S)){g=g.concat(require.resolve(`../scripts/${S}.${Je}`)).concat(y.slice(v+1));let e=Ye.sync(A,g,{stdio:"inherit"});e.signal&&(e.signal==="SIGKILL"?console.log("The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process."):e.signal==="SIGTERM"&&console.log("The build failed because the process exited too early. Someone might have called `kill` or `killall`, or the system could be shutting down."),process.exit(1)),process.exit(e.status)}else console.log('Unknown script "'+S+'".'),console.log("Perhaps you need to update dev-scripts?"); | ||
var __commonJS = (callback, module2) => () => { | ||
if (!module2) { | ||
module2 = {exports: {}}; | ||
callback(module2.exports, module2); | ||
} | ||
return module2.exports; | ||
}; | ||
// ../../node_modules/isexe/windows.js | ||
var require_windows = __commonJS((exports2, module2) => { | ||
module2.exports = isexe; | ||
isexe.sync = sync; | ||
var fs = require("fs"); | ||
function checkPathExt(path2, options) { | ||
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; | ||
if (!pathext) { | ||
return true; | ||
} | ||
pathext = pathext.split(";"); | ||
if (pathext.indexOf("") !== -1) { | ||
return true; | ||
} | ||
for (var i = 0; i < pathext.length; i++) { | ||
var p = pathext[i].toLowerCase(); | ||
if (p && path2.substr(-p.length).toLowerCase() === p) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
function checkStat(stat, path2, options) { | ||
if (!stat.isSymbolicLink() && !stat.isFile()) { | ||
return false; | ||
} | ||
return checkPathExt(path2, options); | ||
} | ||
function isexe(path2, options, cb) { | ||
fs.stat(path2, function(er, stat) { | ||
cb(er, er ? false : checkStat(stat, path2, options)); | ||
}); | ||
} | ||
function sync(path2, options) { | ||
return checkStat(fs.statSync(path2), path2, options); | ||
} | ||
}); | ||
// ../../node_modules/isexe/mode.js | ||
var require_mode = __commonJS((exports2, module2) => { | ||
module2.exports = isexe; | ||
isexe.sync = sync; | ||
var fs = require("fs"); | ||
function isexe(path2, options, cb) { | ||
fs.stat(path2, function(er, stat) { | ||
cb(er, er ? false : checkStat(stat, options)); | ||
}); | ||
} | ||
function sync(path2, options) { | ||
return checkStat(fs.statSync(path2), options); | ||
} | ||
function checkStat(stat, options) { | ||
return stat.isFile() && checkMode(stat, options); | ||
} | ||
function checkMode(stat, options) { | ||
var mod = stat.mode; | ||
var uid = stat.uid; | ||
var gid = stat.gid; | ||
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); | ||
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); | ||
var u = parseInt("100", 8); | ||
var g = parseInt("010", 8); | ||
var o = parseInt("001", 8); | ||
var ug = u | g; | ||
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0; | ||
return ret; | ||
} | ||
}); | ||
// ../../node_modules/isexe/index.js | ||
var require_isexe = __commonJS((exports2, module2) => { | ||
var fs = require("fs"); | ||
var core; | ||
if (process.platform === "win32" || global.TESTING_WINDOWS) { | ||
core = require_windows(); | ||
} else { | ||
core = require_mode(); | ||
} | ||
module2.exports = isexe; | ||
isexe.sync = sync; | ||
function isexe(path2, options, cb) { | ||
if (typeof options === "function") { | ||
cb = options; | ||
options = {}; | ||
} | ||
if (!cb) { | ||
if (typeof Promise !== "function") { | ||
throw new TypeError("callback not provided"); | ||
} | ||
return new Promise(function(resolve, reject) { | ||
isexe(path2, options || {}, function(er, is) { | ||
if (er) { | ||
reject(er); | ||
} else { | ||
resolve(is); | ||
} | ||
}); | ||
}); | ||
} | ||
core(path2, options || {}, function(er, is) { | ||
if (er) { | ||
if (er.code === "EACCES" || options && options.ignoreErrors) { | ||
er = null; | ||
is = false; | ||
} | ||
} | ||
cb(er, is); | ||
}); | ||
} | ||
function sync(path2, options) { | ||
try { | ||
return core.sync(path2, options || {}); | ||
} catch (er) { | ||
if (options && options.ignoreErrors || er.code === "EACCES") { | ||
return false; | ||
} else { | ||
throw er; | ||
} | ||
} | ||
} | ||
}); | ||
// ../../node_modules/cross-spawn/node_modules/which/which.js | ||
var require_which = __commonJS((exports2, module2) => { | ||
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; | ||
var path2 = require("path"); | ||
var COLON = isWindows ? ";" : ":"; | ||
var isexe = require_isexe(); | ||
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), {code: "ENOENT"}); | ||
var getPathInfo = (cmd, opt) => { | ||
const colon = opt.colon || COLON; | ||
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [ | ||
...isWindows ? [process.cwd()] : [], | ||
...(opt.path || process.env.PATH || "").split(colon) | ||
]; | ||
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : ""; | ||
const pathExt = isWindows ? pathExtExe.split(colon) : [""]; | ||
if (isWindows) { | ||
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") | ||
pathExt.unshift(""); | ||
} | ||
return { | ||
pathEnv, | ||
pathExt, | ||
pathExtExe | ||
}; | ||
}; | ||
var which = (cmd, opt, cb) => { | ||
if (typeof opt === "function") { | ||
cb = opt; | ||
opt = {}; | ||
} | ||
if (!opt) | ||
opt = {}; | ||
const {pathEnv, pathExt, pathExtExe} = getPathInfo(cmd, opt); | ||
const found = []; | ||
const step = (i) => new Promise((resolve, reject) => { | ||
if (i === pathEnv.length) | ||
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)); | ||
const ppRaw = pathEnv[i]; | ||
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; | ||
const pCmd = path2.join(pathPart, cmd); | ||
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; | ||
resolve(subStep(p, i, 0)); | ||
}); | ||
const subStep = (p, i, ii) => new Promise((resolve, reject) => { | ||
if (ii === pathExt.length) | ||
return resolve(step(i + 1)); | ||
const ext = pathExt[ii]; | ||
isexe(p + ext, {pathExt: pathExtExe}, (er, is) => { | ||
if (!er && is) { | ||
if (opt.all) | ||
found.push(p + ext); | ||
else | ||
return resolve(p + ext); | ||
} | ||
return resolve(subStep(p, i, ii + 1)); | ||
}); | ||
}); | ||
return cb ? step(0).then((res) => cb(null, res), cb) : step(0); | ||
}; | ||
var whichSync = (cmd, opt) => { | ||
opt = opt || {}; | ||
const {pathEnv, pathExt, pathExtExe} = getPathInfo(cmd, opt); | ||
const found = []; | ||
for (let i = 0; i < pathEnv.length; i++) { | ||
const ppRaw = pathEnv[i]; | ||
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; | ||
const pCmd = path2.join(pathPart, cmd); | ||
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; | ||
for (let j = 0; j < pathExt.length; j++) { | ||
const cur = p + pathExt[j]; | ||
try { | ||
const is = isexe.sync(cur, {pathExt: pathExtExe}); | ||
if (is) { | ||
if (opt.all) | ||
found.push(cur); | ||
else | ||
return cur; | ||
} | ||
} catch (ex) { | ||
} | ||
} | ||
} | ||
if (opt.all && found.length) | ||
return found; | ||
if (opt.nothrow) | ||
return null; | ||
throw getNotFoundError(cmd); | ||
}; | ||
module2.exports = which; | ||
which.sync = whichSync; | ||
}); | ||
// ../../node_modules/path-key/index.js | ||
var require_path_key = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var pathKey = (options = {}) => { | ||
const environment = options.env || process.env; | ||
const platform = options.platform || process.platform; | ||
if (platform !== "win32") { | ||
return "PATH"; | ||
} | ||
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; | ||
}; | ||
module2.exports = pathKey; | ||
module2.exports.default = pathKey; | ||
}); | ||
// ../../node_modules/cross-spawn/lib/util/resolveCommand.js | ||
var require_resolveCommand = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var path2 = require("path"); | ||
var which = require_which(); | ||
var getPathKey = require_path_key(); | ||
function resolveCommandAttempt(parsed, withoutPathExt) { | ||
const env = parsed.options.env || process.env; | ||
const cwd = process.cwd(); | ||
const hasCustomCwd = parsed.options.cwd != null; | ||
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled; | ||
if (shouldSwitchCwd) { | ||
try { | ||
process.chdir(parsed.options.cwd); | ||
} catch (err) { | ||
} | ||
} | ||
let resolved; | ||
try { | ||
resolved = which.sync(parsed.command, { | ||
path: env[getPathKey({env})], | ||
pathExt: withoutPathExt ? path2.delimiter : void 0 | ||
}); | ||
} catch (e) { | ||
} finally { | ||
if (shouldSwitchCwd) { | ||
process.chdir(cwd); | ||
} | ||
} | ||
if (resolved) { | ||
resolved = path2.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); | ||
} | ||
return resolved; | ||
} | ||
function resolveCommand(parsed) { | ||
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); | ||
} | ||
module2.exports = resolveCommand; | ||
}); | ||
// ../../node_modules/cross-spawn/lib/util/escape.js | ||
var require_escape = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; | ||
function escapeCommand(arg) { | ||
arg = arg.replace(metaCharsRegExp, "^$1"); | ||
return arg; | ||
} | ||
function escapeArgument(arg, doubleEscapeMetaChars) { | ||
arg = `${arg}`; | ||
arg = arg.replace(/(\\*)"/g, '$1$1\\"'); | ||
arg = arg.replace(/(\\*)$/, "$1$1"); | ||
arg = `"${arg}"`; | ||
arg = arg.replace(metaCharsRegExp, "^$1"); | ||
if (doubleEscapeMetaChars) { | ||
arg = arg.replace(metaCharsRegExp, "^$1"); | ||
} | ||
return arg; | ||
} | ||
module2.exports.command = escapeCommand; | ||
module2.exports.argument = escapeArgument; | ||
}); | ||
// ../../node_modules/shebang-regex/index.js | ||
var require_shebang_regex = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
module2.exports = /^#!(.*)/; | ||
}); | ||
// ../../node_modules/shebang-command/index.js | ||
var require_shebang_command = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var shebangRegex = require_shebang_regex(); | ||
module2.exports = (string = "") => { | ||
const match = string.match(shebangRegex); | ||
if (!match) { | ||
return null; | ||
} | ||
const [path2, argument] = match[0].replace(/#! ?/, "").split(" "); | ||
const binary = path2.split("/").pop(); | ||
if (binary === "env") { | ||
return argument; | ||
} | ||
return argument ? `${binary} ${argument}` : binary; | ||
}; | ||
}); | ||
// ../../node_modules/cross-spawn/lib/util/readShebang.js | ||
var require_readShebang = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var fs = require("fs"); | ||
var shebangCommand = require_shebang_command(); | ||
function readShebang(command) { | ||
const size = 150; | ||
const buffer = Buffer.alloc(size); | ||
let fd; | ||
try { | ||
fd = fs.openSync(command, "r"); | ||
fs.readSync(fd, buffer, 0, size, 0); | ||
fs.closeSync(fd); | ||
} catch (e) { | ||
} | ||
return shebangCommand(buffer.toString()); | ||
} | ||
module2.exports = readShebang; | ||
}); | ||
// ../../node_modules/cross-spawn/lib/parse.js | ||
var require_parse = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var path2 = require("path"); | ||
var resolveCommand = require_resolveCommand(); | ||
var escape = require_escape(); | ||
var readShebang = require_readShebang(); | ||
var isWin = process.platform === "win32"; | ||
var isExecutableRegExp = /\.(?:com|exe)$/i; | ||
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; | ||
function detectShebang(parsed) { | ||
parsed.file = resolveCommand(parsed); | ||
const shebang = parsed.file && readShebang(parsed.file); | ||
if (shebang) { | ||
parsed.args.unshift(parsed.file); | ||
parsed.command = shebang; | ||
return resolveCommand(parsed); | ||
} | ||
return parsed.file; | ||
} | ||
function parseNonShell(parsed) { | ||
if (!isWin) { | ||
return parsed; | ||
} | ||
const commandFile = detectShebang(parsed); | ||
const needsShell = !isExecutableRegExp.test(commandFile); | ||
if (parsed.options.forceShell || needsShell) { | ||
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); | ||
parsed.command = path2.normalize(parsed.command); | ||
parsed.command = escape.command(parsed.command); | ||
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); | ||
const shellCommand = [parsed.command].concat(parsed.args).join(" "); | ||
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`]; | ||
parsed.command = process.env.comspec || "cmd.exe"; | ||
parsed.options.windowsVerbatimArguments = true; | ||
} | ||
return parsed; | ||
} | ||
function parse(command, args2, options) { | ||
if (args2 && !Array.isArray(args2)) { | ||
options = args2; | ||
args2 = null; | ||
} | ||
args2 = args2 ? args2.slice(0) : []; | ||
options = Object.assign({}, options); | ||
const parsed = { | ||
command, | ||
args: args2, | ||
options, | ||
file: void 0, | ||
original: { | ||
command, | ||
args: args2 | ||
} | ||
}; | ||
return options.shell ? parsed : parseNonShell(parsed); | ||
} | ||
module2.exports = parse; | ||
}); | ||
// ../../node_modules/cross-spawn/lib/enoent.js | ||
var require_enoent = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var isWin = process.platform === "win32"; | ||
function notFoundError(original, syscall) { | ||
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { | ||
code: "ENOENT", | ||
errno: "ENOENT", | ||
syscall: `${syscall} ${original.command}`, | ||
path: original.command, | ||
spawnargs: original.args | ||
}); | ||
} | ||
function hookChildProcess(cp, parsed) { | ||
if (!isWin) { | ||
return; | ||
} | ||
const originalEmit = cp.emit; | ||
cp.emit = function(name, arg1) { | ||
if (name === "exit") { | ||
const err = verifyENOENT(arg1, parsed, "spawn"); | ||
if (err) { | ||
return originalEmit.call(cp, "error", err); | ||
} | ||
} | ||
return originalEmit.apply(cp, arguments); | ||
}; | ||
} | ||
function verifyENOENT(status, parsed) { | ||
if (isWin && status === 1 && !parsed.file) { | ||
return notFoundError(parsed.original, "spawn"); | ||
} | ||
return null; | ||
} | ||
function verifyENOENTSync(status, parsed) { | ||
if (isWin && status === 1 && !parsed.file) { | ||
return notFoundError(parsed.original, "spawnSync"); | ||
} | ||
return null; | ||
} | ||
module2.exports = { | ||
hookChildProcess, | ||
verifyENOENT, | ||
verifyENOENTSync, | ||
notFoundError | ||
}; | ||
}); | ||
// ../../node_modules/cross-spawn/index.js | ||
var require_cross_spawn = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var cp = require("child_process"); | ||
var parse = require_parse(); | ||
var enoent = require_enoent(); | ||
function spawn2(command, args2, options) { | ||
const parsed = parse(command, args2, options); | ||
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); | ||
enoent.hookChildProcess(spawned, parsed); | ||
return spawned; | ||
} | ||
function spawnSync(command, args2, options) { | ||
const parsed = parse(command, args2, options); | ||
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); | ||
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); | ||
return result; | ||
} | ||
module2.exports = spawn2; | ||
module2.exports.spawn = spawn2; | ||
module2.exports.sync = spawnSync; | ||
module2.exports._parse = parse; | ||
module2.exports._enoent = enoent; | ||
}); | ||
// bin/dev-scripts.ts | ||
if (process.env.__DEV_SCRIPTS_MODE === "development") { | ||
require("pretty-error").start(); | ||
} | ||
process.on("unhandledRejection", (err) => { | ||
throw err; | ||
}); | ||
var spawn = require_cross_spawn(); | ||
var path = require("path"); | ||
var args = process.argv.slice(2); | ||
var scriptIndex = args.findIndex((x) => x === "build" || x === "start" || x === "test"); | ||
var script = scriptIndex === -1 ? args[0] : args[scriptIndex]; | ||
var nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : []; | ||
var execPath = "node"; | ||
var fileExt = "js"; | ||
if (process.env.__DEV_SCRIPTS_MODE === "development") { | ||
execPath = path.resolve(__dirname, "../node_modules/.bin/ts-node-script"); | ||
if (script === "start") { | ||
execPath = path.resolve(__dirname, "../node_modules/.bin/ts-node-dev"); | ||
nodeArgs = nodeArgs.concat([ | ||
"--enable-source-maps", | ||
"--script-mode", | ||
"--rs", | ||
"--exit-child", | ||
"--clear" | ||
]); | ||
} | ||
} | ||
if (["build", "start", "test"].includes(script)) { | ||
nodeArgs = nodeArgs.concat(require.resolve(`../scripts/${script}.${fileExt}`)).concat(args.slice(scriptIndex + 1)); | ||
const result = spawn.sync(execPath, nodeArgs, { | ||
stdio: "inherit" | ||
}); | ||
if (result.signal) { | ||
if (result.signal === "SIGKILL") { | ||
console.log("The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process."); | ||
} else if (result.signal === "SIGTERM") { | ||
console.log("The build failed because the process exited too early. Someone might have called `kill` or `killall`, or the system could be shutting down."); | ||
} | ||
process.exit(1); | ||
} | ||
process.exit(result.status); | ||
} else { | ||
console.log('Unknown script "' + script + '".'); | ||
console.log("Perhaps you need to update dev-scripts?"); | ||
} |
{ | ||
"name": "@bazo/js-dev-scripts", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"repository": { | ||
@@ -19,4 +19,5 @@ "type": "git", | ||
"dependencies": { | ||
"@bazo/js-dev-overlay": "^0.0.25", | ||
"@bazo/js-dev-scripts-types": "^0.0.21", | ||
"@bazo/js-dev-overlay": "^0.0.26", | ||
"@bazo/js-dev-scripts-types": "^0.0.22", | ||
"debounce-promise": "^3.1.2", | ||
"esbuild": "^0.8.55", | ||
@@ -23,0 +24,0 @@ "eslint": "^7.21.0", |
@@ -1,1 +0,25 @@ | ||
var l=Object.defineProperty;var i=e=>l(e,"__esModule",{value:!0});var o=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})};i(exports);o(exports,{default:()=>s});var u=["png","svg","eot","woff","woff2","ttf","jpg","jpeg"],r=new RegExp(`[S/]*.(${u.join("|")})[S/]*`),g=()=>({name:"external",setup:function(e){e.onResolve({filter:r,namespace:"file"},async n=>({external:!0}))}}),s=g; | ||
var __defProp = Object.defineProperty; | ||
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, {get: all[name], enumerable: true}); | ||
}; | ||
// plugins/external.ts | ||
__markAsModule(exports); | ||
__export(exports, { | ||
default: () => external_default | ||
}); | ||
var externalFiles = ["png", "svg", "eot", "woff", "woff2", "ttf", "jpg", "jpeg"]; | ||
var filter = new RegExp(`[S/]*.(${externalFiles.join("|")})[S/]*`); | ||
var externalPlugin = () => ({ | ||
name: "external", | ||
setup: function(build) { | ||
build.onResolve({filter, namespace: "file"}, async (args) => { | ||
return { | ||
external: true | ||
}; | ||
}); | ||
} | ||
}); | ||
var external_default = externalPlugin; |
1322
plugins/scss.js
@@ -1,1 +0,1321 @@ | ||
var le=Object.create,g=Object.defineProperty,ce=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty,he=Object.getOwnPropertyNames,Re=Object.getOwnPropertyDescriptor;var q=e=>g(e,"__esModule",{value:!0});var Y=(e,r)=>()=>(r||(r={exports:{}},e(r.exports,r)),r.exports),Ie=(e,r)=>{for(var t in r)g(e,t,{get:r[t],enumerable:!0})},pe=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of he(r))!fe.call(e,n)&&n!=="default"&&g(e,n,{get:()=>r[n],enumerable:!(t=Re(r,n))||t.enumerable});return e},F=e=>pe(q(g(e!=null?le(ce(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var Q=Y((E,z)=>{E=z.exports=c;var I;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?I=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:I=function(){};E.SEMVER_SPEC_VERSION="2.0.0";var x=256,X=Number.MAX_SAFE_INTEGER||9007199254740991,B=16,R=E.re=[],i=E.src=[],s=E.tokens={},Z=0;function f(e){s[e]=Z++}f("NUMERICIDENTIFIER");i[s.NUMERICIDENTIFIER]="0|[1-9]\\d*";f("NUMERICIDENTIFIERLOOSE");i[s.NUMERICIDENTIFIERLOOSE]="[0-9]+";f("NONNUMERICIDENTIFIER");i[s.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";f("MAINVERSION");i[s.MAINVERSION]="("+i[s.NUMERICIDENTIFIER]+")\\.("+i[s.NUMERICIDENTIFIER]+")\\.("+i[s.NUMERICIDENTIFIER]+")";f("MAINVERSIONLOOSE");i[s.MAINVERSIONLOOSE]="("+i[s.NUMERICIDENTIFIERLOOSE]+")\\.("+i[s.NUMERICIDENTIFIERLOOSE]+")\\.("+i[s.NUMERICIDENTIFIERLOOSE]+")";f("PRERELEASEIDENTIFIER");i[s.PRERELEASEIDENTIFIER]="(?:"+i[s.NUMERICIDENTIFIER]+"|"+i[s.NONNUMERICIDENTIFIER]+")";f("PRERELEASEIDENTIFIERLOOSE");i[s.PRERELEASEIDENTIFIERLOOSE]="(?:"+i[s.NUMERICIDENTIFIERLOOSE]+"|"+i[s.NONNUMERICIDENTIFIER]+")";f("PRERELEASE");i[s.PRERELEASE]="(?:-("+i[s.PRERELEASEIDENTIFIER]+"(?:\\."+i[s.PRERELEASEIDENTIFIER]+")*))";f("PRERELEASELOOSE");i[s.PRERELEASELOOSE]="(?:-?("+i[s.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+i[s.PRERELEASEIDENTIFIERLOOSE]+")*))";f("BUILDIDENTIFIER");i[s.BUILDIDENTIFIER]="[0-9A-Za-z-]+";f("BUILD");i[s.BUILD]="(?:\\+("+i[s.BUILDIDENTIFIER]+"(?:\\."+i[s.BUILDIDENTIFIER]+")*))";f("FULL");f("FULLPLAIN");i[s.FULLPLAIN]="v?"+i[s.MAINVERSION]+i[s.PRERELEASE]+"?"+i[s.BUILD]+"?";i[s.FULL]="^"+i[s.FULLPLAIN]+"$";f("LOOSEPLAIN");i[s.LOOSEPLAIN]="[v=\\s]*"+i[s.MAINVERSIONLOOSE]+i[s.PRERELEASELOOSE]+"?"+i[s.BUILD]+"?";f("LOOSE");i[s.LOOSE]="^"+i[s.LOOSEPLAIN]+"$";f("GTLT");i[s.GTLT]="((?:<|>)?=?)";f("XRANGEIDENTIFIERLOOSE");i[s.XRANGEIDENTIFIERLOOSE]=i[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";f("XRANGEIDENTIFIER");i[s.XRANGEIDENTIFIER]=i[s.NUMERICIDENTIFIER]+"|x|X|\\*";f("XRANGEPLAIN");i[s.XRANGEPLAIN]="[v=\\s]*("+i[s.XRANGEIDENTIFIER]+")(?:\\.("+i[s.XRANGEIDENTIFIER]+")(?:\\.("+i[s.XRANGEIDENTIFIER]+")(?:"+i[s.PRERELEASE]+")?"+i[s.BUILD]+"?)?)?";f("XRANGEPLAINLOOSE");i[s.XRANGEPLAINLOOSE]="[v=\\s]*("+i[s.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+i[s.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+i[s.XRANGEIDENTIFIERLOOSE]+")(?:"+i[s.PRERELEASELOOSE]+")?"+i[s.BUILD]+"?)?)?";f("XRANGE");i[s.XRANGE]="^"+i[s.GTLT]+"\\s*"+i[s.XRANGEPLAIN]+"$";f("XRANGELOOSE");i[s.XRANGELOOSE]="^"+i[s.GTLT]+"\\s*"+i[s.XRANGEPLAINLOOSE]+"$";f("COERCE");i[s.COERCE]="(^|[^\\d])(\\d{1,"+B+"})(?:\\.(\\d{1,"+B+"}))?(?:\\.(\\d{1,"+B+"}))?(?:$|[^\\d])";f("COERCERTL");R[s.COERCERTL]=new RegExp(i[s.COERCE],"g");f("LONETILDE");i[s.LONETILDE]="(?:~>?)";f("TILDETRIM");i[s.TILDETRIM]="(\\s*)"+i[s.LONETILDE]+"\\s+";R[s.TILDETRIM]=new RegExp(i[s.TILDETRIM],"g");var Oe="$1~";f("TILDE");i[s.TILDE]="^"+i[s.LONETILDE]+i[s.XRANGEPLAIN]+"$";f("TILDELOOSE");i[s.TILDELOOSE]="^"+i[s.LONETILDE]+i[s.XRANGEPLAINLOOSE]+"$";f("LONECARET");i[s.LONECARET]="(?:\\^)";f("CARETTRIM");i[s.CARETTRIM]="(\\s*)"+i[s.LONECARET]+"\\s+";R[s.CARETTRIM]=new RegExp(i[s.CARETTRIM],"g");var Ne="$1^";f("CARET");i[s.CARET]="^"+i[s.LONECARET]+i[s.XRANGEPLAIN]+"$";f("CARETLOOSE");i[s.CARETLOOSE]="^"+i[s.LONECARET]+i[s.XRANGEPLAINLOOSE]+"$";f("COMPARATORLOOSE");i[s.COMPARATORLOOSE]="^"+i[s.GTLT]+"\\s*("+i[s.LOOSEPLAIN]+")$|^$";f("COMPARATOR");i[s.COMPARATOR]="^"+i[s.GTLT]+"\\s*("+i[s.FULLPLAIN]+")$|^$";f("COMPARATORTRIM");i[s.COMPARATORTRIM]="(\\s*)"+i[s.GTLT]+"\\s*("+i[s.LOOSEPLAIN]+"|"+i[s.XRANGEPLAIN]+")";R[s.COMPARATORTRIM]=new RegExp(i[s.COMPARATORTRIM],"g");var Le="$1$2$3";f("HYPHENRANGE");i[s.HYPHENRANGE]="^\\s*("+i[s.XRANGEPLAIN]+")\\s+-\\s+("+i[s.XRANGEPLAIN]+")\\s*$";f("HYPHENRANGELOOSE");i[s.HYPHENRANGELOOSE]="^\\s*("+i[s.XRANGEPLAINLOOSE]+")\\s+-\\s+("+i[s.XRANGEPLAINLOOSE]+")\\s*$";f("STAR");i[s.STAR]="(<|>)?=?\\s*\\*";for(var D=0;D<Z;D++)I(D,i[D]),R[D]||(R[D]=new RegExp(i[D]));E.parse=P;function P(e,r){if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),e instanceof c)return e;if(typeof e!="string"||e.length>x)return null;var t=r.loose?R[s.LOOSE]:R[s.FULL];if(!t.test(e))return null;try{return new c(e,r)}catch(n){return null}}E.valid=Te;function Te(e,r){var t=P(e,r);return t?t.version:null}E.clean=me;function me(e,r){var t=P(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}E.SemVer=c;function c(e,r){if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),e instanceof c){if(e.loose===r.loose)return e;e=e.version}else if(typeof e!="string")throw new TypeError("Invalid Version: "+e);if(e.length>x)throw new TypeError("version is longer than "+x+" characters");if(!(this instanceof c))return new c(e,r);I("SemVer",e,r),this.options=r,this.loose=!!r.loose;var t=e.trim().match(r.loose?R[s.LOOSE]:R[s.FULL]);if(!t)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>X||this.major<0)throw new TypeError("Invalid major version");if(this.minor>X||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>X||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var a=+n;if(a>=0&&a<X)return a}return n}):this.prerelease=[],this.build=t[5]?t[5].split("."):[],this.format()}c.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};c.prototype.toString=function(){return this.version};c.prototype.compare=function(e){return I("SemVer.compare",this.version,this.options,e),e instanceof c||(e=new c(e,this.options)),this.compareMain(e)||this.comparePre(e)};c.prototype.compareMain=function(e){return e instanceof c||(e=new c(e,this.options)),y(this.major,e.major)||y(this.minor,e.minor)||y(this.patch,e.patch)};c.prototype.comparePre=function(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r],n=e.prerelease[r];if(I("prerelease compare",r,t,n),t===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(t===void 0)return-1;if(t===n)continue;return y(t,n)}while(++r)};c.prototype.compareBuild=function(e){e instanceof c||(e=new c(e,this.options));var r=0;do{var t=this.build[r],n=e.build[r];if(I("prerelease compare",r,t,n),t===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(t===void 0)return-1;if(t===n)continue;return y(t,n)}while(++r)};c.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r),this.inc("pre",r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r),this.inc("pre",r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var t=this.prerelease.length;--t>=0;)typeof this.prerelease[t]=="number"&&(this.prerelease[t]++,t=-2);t===-1&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this};E.inc=Ae;function Ae(e,r,t,n){typeof t=="string"&&(n=t,t=void 0);try{return new c(e,t).inc(r,n).version}catch(a){return null}}E.diff=ve;function ve(e,r){if(M(e,r))return null;var t=P(e),n=P(r),a="";if(t.prerelease.length||n.prerelease.length){a="pre";var u="prerelease"}for(var o in t)if((o==="major"||o==="minor"||o==="patch")&&t[o]!==n[o])return a+o;return u}E.compareIdentifiers=y;var W=/^[0-9]+$/;function y(e,r){var t=W.test(e),n=W.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e<r?-1:1}E.rcompareIdentifiers=de;function de(e,r){return y(r,e)}E.major=Se;function Se(e,r){return new c(e,r).major}E.minor=we;function we(e,r){return new c(e,r).minor}E.patch=De;function De(e,r){return new c(e,r).patch}E.compare=S;function S(e,r,t){return new c(e,t).compare(new c(r,t))}E.compareLoose=Pe;function Pe(e,r){return S(e,r,!0)}E.compareBuild=ye;function ye(e,r,t){var n=new c(e,t),a=new c(r,t);return n.compare(a)||n.compareBuild(a)}E.rcompare=Ce;function Ce(e,r,t){return S(r,e,t)}E.sort=Fe;function Fe(e,r){return e.sort(function(t,n){return E.compareBuild(t,n,r)})}E.rsort=Ge;function Ge(e,r){return e.sort(function(t,n){return E.compareBuild(n,t,r)})}E.gt=G;function G(e,r,t){return S(e,r,t)>0}E.lt=U;function U(e,r,t){return S(e,r,t)<0}E.eq=M;function M(e,r,t){return S(e,r,t)===0}E.neq=J;function J(e,r,t){return S(e,r,t)!==0}E.gte=V;function V(e,r,t){return S(e,r,t)>=0}E.lte=H;function H(e,r,t){return S(e,r,t)<=0}E.cmp=j;function j(e,r,t,n){switch(r){case"===":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e===t;case"!==":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e!==t;case"":case"=":case"==":return M(e,t,n);case"!=":return J(e,t,n);case">":return G(e,t,n);case">=":return V(e,t,n);case"<":return U(e,t,n);case"<=":return H(e,t,n);default:throw new TypeError("Invalid operator: "+r)}}E.Comparator=v;function v(e,r){if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),e instanceof v){if(e.loose===!!r.loose)return e;e=e.value}if(!(this instanceof v))return new v(e,r);I("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===C?this.value="":this.value=this.operator+this.semver.version,I("comp",this)}var C={};v.prototype.parse=function(e){var r=this.options.loose?R[s.COMPARATORLOOSE]:R[s.COMPARATOR],t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1]!==void 0?t[1]:"",this.operator==="="&&(this.operator=""),t[2]?this.semver=new c(t[2],this.options.loose):this.semver=C};v.prototype.toString=function(){return this.value};v.prototype.test=function(e){if(I("Comparator.test",e,this.options.loose),this.semver===C||e===C)return!0;if(typeof e=="string")try{e=new c(e,this.options)}catch(r){return!1}return j(e,this.operator,this.semver,this.options)};v.prototype.intersects=function(e,r){if(!(e instanceof v))throw new TypeError("a Comparator is required");(!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1});var t;if(this.operator==="")return this.value===""?!0:(t=new p(e.value,r),$(this.value,t,r));if(e.operator==="")return e.value===""?!0:(t=new p(this.value,r),$(e.semver,t,r));var n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),a=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),u=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),h=j(this.semver,"<",e.semver,r)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=j(this.semver,">",e.semver,r)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||a||u&&o||h||l};E.Range=p;function p(e,r){if((!r||typeof r!="object")&&(r={loose:!!r,includePrerelease:!1}),e instanceof p)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new p(e.raw,r);if(e instanceof v)return new p(e.value,r);if(!(this instanceof p))return new p(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(t){return this.parseRange(t.trim())},this).filter(function(t){return t.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}p.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range};p.prototype.toString=function(){return this.range};p.prototype.parseRange=function(e){var r=this.options.loose;e=e.trim();var t=r?R[s.HYPHENRANGELOOSE]:R[s.HYPHENRANGE];e=e.replace(t,Xe),I("hyphen replace",e),e=e.replace(R[s.COMPARATORTRIM],Le),I("comparator trim",e,R[s.COMPARATORTRIM]),e=e.replace(R[s.TILDETRIM],Oe),e=e.replace(R[s.CARETTRIM],Ne),e=e.split(/\s+/).join(" ");var n=r?R[s.COMPARATORLOOSE]:R[s.COMPARATOR],a=e.split(" ").map(function(u){return ge(u,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter(function(u){return!!u.match(n)})),a=a.map(function(u){return new v(u,this.options)},this),a};p.prototype.intersects=function(e,r){if(!(e instanceof p))throw new TypeError("a Range is required");return this.set.some(function(t){return K(t,r)&&e.set.some(function(n){return K(n,r)&&t.every(function(a){return n.every(function(u){return a.intersects(u,r)})})})})};function K(e,r){for(var t=!0,n=e.slice(),a=n.pop();t&&n.length;)t=n.every(function(u){return a.intersects(u,r)}),a=n.pop();return t}E.toComparators=Ue;function Ue(e,r){return new p(e,r).set.map(function(t){return t.map(function(n){return n.value}).join(" ").trim().split(" ")})}function ge(e,r){return I("comp",e,r),e=$e(e,r),I("caret",e),e=je(e,r),I("tildes",e),e=ke(e,r),I("xrange",e),e=xe(e,r),I("stars",e),e}function N(e){return!e||e.toLowerCase()==="x"||e==="*"}function je(e,r){return e.trim().split(/\s+/).map(function(t){return Be(t,r)}).join(" ")}function Be(e,r){var t=r.loose?R[s.TILDELOOSE]:R[s.TILDE];return e.replace(t,function(n,a,u,o,h){I("tilde",e,n,a,u,o,h);var l;return N(a)?l="":N(u)?l=">="+a+".0.0 <"+(+a+1)+".0.0":N(o)?l=">="+a+"."+u+".0 <"+a+"."+(+u+1)+".0":h?(I("replaceTilde pr",h),l=">="+a+"."+u+"."+o+"-"+h+" <"+a+"."+(+u+1)+".0"):l=">="+a+"."+u+"."+o+" <"+a+"."+(+u+1)+".0",I("tilde return",l),l})}function $e(e,r){return e.trim().split(/\s+/).map(function(t){return Me(t,r)}).join(" ")}function Me(e,r){I("caret",e,r);var t=r.loose?R[s.CARETLOOSE]:R[s.CARET];return e.replace(t,function(n,a,u,o,h){I("caret",e,n,a,u,o,h);var l;return N(a)?l="":N(u)?l=">="+a+".0.0 <"+(+a+1)+".0.0":N(o)?a==="0"?l=">="+a+"."+u+".0 <"+a+"."+(+u+1)+".0":l=">="+a+"."+u+".0 <"+(+a+1)+".0.0":h?(I("replaceCaret pr",h),a==="0"?u==="0"?l=">="+a+"."+u+"."+o+"-"+h+" <"+a+"."+u+"."+(+o+1):l=">="+a+"."+u+"."+o+"-"+h+" <"+a+"."+(+u+1)+".0":l=">="+a+"."+u+"."+o+"-"+h+" <"+(+a+1)+".0.0"):(I("no pr"),a==="0"?u==="0"?l=">="+a+"."+u+"."+o+" <"+a+"."+u+"."+(+o+1):l=">="+a+"."+u+"."+o+" <"+a+"."+(+u+1)+".0":l=">="+a+"."+u+"."+o+" <"+(+a+1)+".0.0"),I("caret return",l),l})}function ke(e,r){return I("replaceXRanges",e,r),e.split(/\s+/).map(function(t){return Ve(t,r)}).join(" ")}function Ve(e,r){e=e.trim();var t=r.loose?R[s.XRANGELOOSE]:R[s.XRANGE];return e.replace(t,function(n,a,u,o,h,l){I("xRange",e,n,a,u,o,h,l);var m=N(u),A=m||N(o),L=A||N(h),O=L;return a==="="&&O&&(a=""),l=r.includePrerelease?"-0":"",m?a===">"||a==="<"?n="<0.0.0-0":n="*":a&&O?(A&&(o=0),h=0,a===">"?(a=">=",A?(u=+u+1,o=0,h=0):(o=+o+1,h=0)):a==="<="&&(a="<",A?u=+u+1:o=+o+1),n=a+u+"."+o+"."+h+l):A?n=">="+u+".0.0"+l+" <"+(+u+1)+".0.0"+l:L&&(n=">="+u+"."+o+".0"+l+" <"+u+"."+(+o+1)+".0"+l),I("xRange return",n),n})}function xe(e,r){return I("replaceStars",e,r),e.trim().replace(R[s.STAR],"")}function Xe(e,r,t,n,a,u,o,h,l,m,A,L,O){return N(t)?r="":N(n)?r=">="+t+".0.0":N(a)?r=">="+t+"."+n+".0":r=">="+r,N(l)?h="":N(m)?h="<"+(+l+1)+".0.0":N(A)?h="<"+l+"."+(+m+1)+".0":L?h="<="+l+"."+m+"."+A+"-"+L:h="<="+h,(r+" "+h).trim()}p.prototype.test=function(e){if(!e)return!1;if(typeof e=="string")try{e=new c(e,this.options)}catch(t){return!1}for(var r=0;r<this.set.length;r++)if(He(this.set[r],e,this.options))return!0;return!1};function He(e,r,t){for(var n=0;n<e.length;n++)if(!e[n].test(r))return!1;if(r.prerelease.length&&!t.includePrerelease){for(n=0;n<e.length;n++)if(I(e[n].semver),e[n].semver!==C&&e[n].semver.prerelease.length>0){var a=e[n].semver;if(a.major===r.major&&a.minor===r.minor&&a.patch===r.patch)return!0}return!1}return!0}E.satisfies=$;function $(e,r,t){try{r=new p(r,t)}catch(n){return!1}return r.test(e)}E.maxSatisfying=be;function be(e,r,t){var n=null,a=null;try{var u=new p(r,t)}catch(o){return null}return e.forEach(function(o){u.test(o)&&(!n||a.compare(o)===-1)&&(n=o,a=new c(n,t))}),n}E.minSatisfying=_e;function _e(e,r,t){var n=null,a=null;try{var u=new p(r,t)}catch(o){return null}return e.forEach(function(o){u.test(o)&&(!n||a.compare(o)===1)&&(n=o,a=new c(n,t))}),n}E.minVersion=qe;function qe(e,r){e=new p(e,r);var t=new c("0.0.0");if(e.test(t)||(t=new c("0.0.0-0"),e.test(t)))return t;t=null;for(var n=0;n<e.set.length;++n){var a=e.set[n];a.forEach(function(u){var o=new c(u.semver.version);switch(u.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!t||G(t,o))&&(t=o);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+u.operator)}})}return t&&e.test(t)?t:null}E.validRange=Ye;function Ye(e,r){try{return new p(e,r).range||"*"}catch(t){return null}}E.ltr=ze;function ze(e,r,t){return b(e,r,"<",t)}E.gtr=Ze;function Ze(e,r,t){return b(e,r,">",t)}E.outside=b;function b(e,r,t,n){e=new c(e,n),r=new p(r,n);var a,u,o,h,l;switch(t){case">":a=G,u=H,o=U,h=">",l=">=";break;case"<":a=U,u=V,o=G,h="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if($(e,r,n))return!1;for(var m=0;m<r.set.length;++m){var A=r.set[m],L=null,O=null;if(A.forEach(function(d){d.semver===C&&(d=new v(">=0.0.0")),L=L||d,O=O||d,a(d.semver,L.semver,n)?L=d:o(d.semver,O.semver,n)&&(O=d)}),L.operator===h||L.operator===l||(!O.operator||O.operator===h)&&u(e,O.semver))return!1;if(O.operator===l&&o(e,O.semver))return!1}return!0}E.prerelease=We;function We(e,r){var t=P(e,r);return t&&t.prerelease.length?t.prerelease:null}E.intersects=Je;function Je(e,r,t){return e=new p(e,t),r=new p(r,t),e.intersects(r)}E.coerce=Ke;function Ke(e,r){if(e instanceof c)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;r=r||{};var t=null;if(!r.rtl)t=e.match(R[s.COERCE]);else{for(var n;(n=R[s.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||n.index+n[0].length!==t.index+t[0].length)&&(t=n),R[s.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;R[s.COERCERTL].lastIndex=-1}return t===null?null:P(t[2]+"."+(t[3]||"0")+"."+(t[4]||"0"),r)}});var ie=Y((ar,_)=>{"use strict";var k=require("fs"),w=require("path"),{promisify:ee}=require("util"),Qe=Q(),re=Qe.satisfies(process.version,">=10.12.0"),te=e=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(w.parse(e).root,""))){let t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}},ne=e=>({...{mode:511,fs:k},...e}),se=e=>{let r=new Error(`operation not permitted, mkdir '${e}'`);return r.code="EPERM",r.errno=-4048,r.path=e,r.syscall="mkdir",r},er=async(e,r)=>{te(e),r=ne(r);let t=ee(r.fs.mkdir),n=ee(r.fs.stat);if(re&&r.fs.mkdir===k.mkdir){let u=w.resolve(e);return await t(u,{mode:r.mode,recursive:!0}),u}let a=async u=>{try{return await t(u,r.mode),u}catch(o){if(o.code==="EPERM")throw o;if(o.code==="ENOENT"){if(w.dirname(u)===u)throw se(u);if(o.message.includes("null bytes"))throw o;return await a(w.dirname(u)),a(u)}try{if(!(await n(u)).isDirectory())throw new Error("The path is not a directory")}catch(h){throw o}return u}};return a(w.resolve(e))};_.exports=er;_.exports.sync=(e,r)=>{if(te(e),r=ne(r),re&&r.fs.mkdirSync===k.mkdirSync){let n=w.resolve(e);return k.mkdirSync(n,{mode:r.mode,recursive:!0}),n}let t=n=>{try{r.fs.mkdirSync(n,r.mode)}catch(a){if(a.code==="EPERM")throw a;if(a.code==="ENOENT"){if(w.dirname(n)===n)throw se(n);if(a.message.includes("null bytes"))throw a;return t(w.dirname(n)),t(n)}try{if(!r.fs.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch(u){throw a}}return n};return t(w.resolve(e))}});q(exports);Ie(exports,{default:()=>sr});var ae=F(require("fs")),ue=F(require("util")),T=F(require("path")),oe=F(require("sass")),Ee=F(ie()),rr=ue.promisify(ae.writeFile),tr={plugins:[],rootDir:process.cwd(),tempDir:`${process.cwd()}/.temp`},nr=(e={})=>({name:"scss",setup:function(r){let t={...tr,...e},{rootDir:n,tempDir:a}=t;r.onResolve({filter:/.\.(scss)$/,namespace:"file"},async u=>{let o=T.resolve(u.resolveDir,u.path),h=T.extname(o),l=T.basename(o,h),m=T.dirname(o),A=T.relative(T.dirname(n),m),L=T.resolve(a,A),O=T.resolve(L,`${l}.css`),d=oe.default.renderSync({file:o,indentType:"tab"});return(0,Ee.default)(T.dirname(O)),await rr(O,d.css),{namespace:"file",path:O}})}}),sr=nr; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true}); | ||
var __commonJS = (callback, module2) => () => { | ||
if (!module2) { | ||
module2 = {exports: {}}; | ||
callback(module2.exports, module2); | ||
} | ||
return module2.exports; | ||
}; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, {get: all[name], enumerable: true}); | ||
}; | ||
var __exportStar = (target, module2, desc) => { | ||
if (module2 && typeof module2 === "object" || typeof module2 === "function") { | ||
for (let key of __getOwnPropNames(module2)) | ||
if (!__hasOwnProp.call(target, key) && key !== "default") | ||
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable}); | ||
} | ||
return target; | ||
}; | ||
var __toModule = (module2) => { | ||
return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2); | ||
}; | ||
// ../../node_modules/make-dir/node_modules/semver/semver.js | ||
var require_semver = __commonJS((exports2, module2) => { | ||
exports2 = module2.exports = SemVer; | ||
var debug; | ||
if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { | ||
debug = function() { | ||
var args = Array.prototype.slice.call(arguments, 0); | ||
args.unshift("SEMVER"); | ||
console.log.apply(console, args); | ||
}; | ||
} else { | ||
debug = function() { | ||
}; | ||
} | ||
exports2.SEMVER_SPEC_VERSION = "2.0.0"; | ||
var MAX_LENGTH = 256; | ||
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; | ||
var MAX_SAFE_COMPONENT_LENGTH = 16; | ||
var re = exports2.re = []; | ||
var src = exports2.src = []; | ||
var t = exports2.tokens = {}; | ||
var R = 0; | ||
function tok(n) { | ||
t[n] = R++; | ||
} | ||
tok("NUMERICIDENTIFIER"); | ||
src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*"; | ||
tok("NUMERICIDENTIFIERLOOSE"); | ||
src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+"; | ||
tok("NONNUMERICIDENTIFIER"); | ||
src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*"; | ||
tok("MAINVERSION"); | ||
src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")"; | ||
tok("MAINVERSIONLOOSE"); | ||
src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")"; | ||
tok("PRERELEASEIDENTIFIER"); | ||
src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; | ||
tok("PRERELEASEIDENTIFIERLOOSE"); | ||
src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")"; | ||
tok("PRERELEASE"); | ||
src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))"; | ||
tok("PRERELEASELOOSE"); | ||
src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))"; | ||
tok("BUILDIDENTIFIER"); | ||
src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+"; | ||
tok("BUILD"); | ||
src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))"; | ||
tok("FULL"); | ||
tok("FULLPLAIN"); | ||
src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?"; | ||
src[t.FULL] = "^" + src[t.FULLPLAIN] + "$"; | ||
tok("LOOSEPLAIN"); | ||
src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?"; | ||
tok("LOOSE"); | ||
src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$"; | ||
tok("GTLT"); | ||
src[t.GTLT] = "((?:<|>)?=?)"; | ||
tok("XRANGEIDENTIFIERLOOSE"); | ||
src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*"; | ||
tok("XRANGEIDENTIFIER"); | ||
src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*"; | ||
tok("XRANGEPLAIN"); | ||
src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?"; | ||
tok("XRANGEPLAINLOOSE"); | ||
src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?"; | ||
tok("XRANGE"); | ||
src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$"; | ||
tok("XRANGELOOSE"); | ||
src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$"; | ||
tok("COERCE"); | ||
src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])"; | ||
tok("COERCERTL"); | ||
re[t.COERCERTL] = new RegExp(src[t.COERCE], "g"); | ||
tok("LONETILDE"); | ||
src[t.LONETILDE] = "(?:~>?)"; | ||
tok("TILDETRIM"); | ||
src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+"; | ||
re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g"); | ||
var tildeTrimReplace = "$1~"; | ||
tok("TILDE"); | ||
src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$"; | ||
tok("TILDELOOSE"); | ||
src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$"; | ||
tok("LONECARET"); | ||
src[t.LONECARET] = "(?:\\^)"; | ||
tok("CARETTRIM"); | ||
src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+"; | ||
re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g"); | ||
var caretTrimReplace = "$1^"; | ||
tok("CARET"); | ||
src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$"; | ||
tok("CARETLOOSE"); | ||
src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$"; | ||
tok("COMPARATORLOOSE"); | ||
src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$"; | ||
tok("COMPARATOR"); | ||
src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$"; | ||
tok("COMPARATORTRIM"); | ||
src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")"; | ||
re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g"); | ||
var comparatorTrimReplace = "$1$2$3"; | ||
tok("HYPHENRANGE"); | ||
src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$"; | ||
tok("HYPHENRANGELOOSE"); | ||
src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$"; | ||
tok("STAR"); | ||
src[t.STAR] = "(<|>)?=?\\s*\\*"; | ||
for (var i = 0; i < R; i++) { | ||
debug(i, src[i]); | ||
if (!re[i]) { | ||
re[i] = new RegExp(src[i]); | ||
} | ||
} | ||
exports2.parse = parse; | ||
function parse(version, options) { | ||
if (!options || typeof options !== "object") { | ||
options = { | ||
loose: !!options, | ||
includePrerelease: false | ||
}; | ||
} | ||
if (version instanceof SemVer) { | ||
return version; | ||
} | ||
if (typeof version !== "string") { | ||
return null; | ||
} | ||
if (version.length > MAX_LENGTH) { | ||
return null; | ||
} | ||
var r = options.loose ? re[t.LOOSE] : re[t.FULL]; | ||
if (!r.test(version)) { | ||
return null; | ||
} | ||
try { | ||
return new SemVer(version, options); | ||
} catch (er) { | ||
return null; | ||
} | ||
} | ||
exports2.valid = valid; | ||
function valid(version, options) { | ||
var v = parse(version, options); | ||
return v ? v.version : null; | ||
} | ||
exports2.clean = clean; | ||
function clean(version, options) { | ||
var s = parse(version.trim().replace(/^[=v]+/, ""), options); | ||
return s ? s.version : null; | ||
} | ||
exports2.SemVer = SemVer; | ||
function SemVer(version, options) { | ||
if (!options || typeof options !== "object") { | ||
options = { | ||
loose: !!options, | ||
includePrerelease: false | ||
}; | ||
} | ||
if (version instanceof SemVer) { | ||
if (version.loose === options.loose) { | ||
return version; | ||
} else { | ||
version = version.version; | ||
} | ||
} else if (typeof version !== "string") { | ||
throw new TypeError("Invalid Version: " + version); | ||
} | ||
if (version.length > MAX_LENGTH) { | ||
throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); | ||
} | ||
if (!(this instanceof SemVer)) { | ||
return new SemVer(version, options); | ||
} | ||
debug("SemVer", version, options); | ||
this.options = options; | ||
this.loose = !!options.loose; | ||
var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); | ||
if (!m) { | ||
throw new TypeError("Invalid Version: " + version); | ||
} | ||
this.raw = version; | ||
this.major = +m[1]; | ||
this.minor = +m[2]; | ||
this.patch = +m[3]; | ||
if (this.major > MAX_SAFE_INTEGER || this.major < 0) { | ||
throw new TypeError("Invalid major version"); | ||
} | ||
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { | ||
throw new TypeError("Invalid minor version"); | ||
} | ||
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { | ||
throw new TypeError("Invalid patch version"); | ||
} | ||
if (!m[4]) { | ||
this.prerelease = []; | ||
} else { | ||
this.prerelease = m[4].split(".").map(function(id) { | ||
if (/^[0-9]+$/.test(id)) { | ||
var num = +id; | ||
if (num >= 0 && num < MAX_SAFE_INTEGER) { | ||
return num; | ||
} | ||
} | ||
return id; | ||
}); | ||
} | ||
this.build = m[5] ? m[5].split(".") : []; | ||
this.format(); | ||
} | ||
SemVer.prototype.format = function() { | ||
this.version = this.major + "." + this.minor + "." + this.patch; | ||
if (this.prerelease.length) { | ||
this.version += "-" + this.prerelease.join("."); | ||
} | ||
return this.version; | ||
}; | ||
SemVer.prototype.toString = function() { | ||
return this.version; | ||
}; | ||
SemVer.prototype.compare = function(other) { | ||
debug("SemVer.compare", this.version, this.options, other); | ||
if (!(other instanceof SemVer)) { | ||
other = new SemVer(other, this.options); | ||
} | ||
return this.compareMain(other) || this.comparePre(other); | ||
}; | ||
SemVer.prototype.compareMain = function(other) { | ||
if (!(other instanceof SemVer)) { | ||
other = new SemVer(other, this.options); | ||
} | ||
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); | ||
}; | ||
SemVer.prototype.comparePre = function(other) { | ||
if (!(other instanceof SemVer)) { | ||
other = new SemVer(other, this.options); | ||
} | ||
if (this.prerelease.length && !other.prerelease.length) { | ||
return -1; | ||
} else if (!this.prerelease.length && other.prerelease.length) { | ||
return 1; | ||
} else if (!this.prerelease.length && !other.prerelease.length) { | ||
return 0; | ||
} | ||
var i2 = 0; | ||
do { | ||
var a = this.prerelease[i2]; | ||
var b = other.prerelease[i2]; | ||
debug("prerelease compare", i2, a, b); | ||
if (a === void 0 && b === void 0) { | ||
return 0; | ||
} else if (b === void 0) { | ||
return 1; | ||
} else if (a === void 0) { | ||
return -1; | ||
} else if (a === b) { | ||
continue; | ||
} else { | ||
return compareIdentifiers(a, b); | ||
} | ||
} while (++i2); | ||
}; | ||
SemVer.prototype.compareBuild = function(other) { | ||
if (!(other instanceof SemVer)) { | ||
other = new SemVer(other, this.options); | ||
} | ||
var i2 = 0; | ||
do { | ||
var a = this.build[i2]; | ||
var b = other.build[i2]; | ||
debug("prerelease compare", i2, a, b); | ||
if (a === void 0 && b === void 0) { | ||
return 0; | ||
} else if (b === void 0) { | ||
return 1; | ||
} else if (a === void 0) { | ||
return -1; | ||
} else if (a === b) { | ||
continue; | ||
} else { | ||
return compareIdentifiers(a, b); | ||
} | ||
} while (++i2); | ||
}; | ||
SemVer.prototype.inc = function(release, identifier) { | ||
switch (release) { | ||
case "premajor": | ||
this.prerelease.length = 0; | ||
this.patch = 0; | ||
this.minor = 0; | ||
this.major++; | ||
this.inc("pre", identifier); | ||
break; | ||
case "preminor": | ||
this.prerelease.length = 0; | ||
this.patch = 0; | ||
this.minor++; | ||
this.inc("pre", identifier); | ||
break; | ||
case "prepatch": | ||
this.prerelease.length = 0; | ||
this.inc("patch", identifier); | ||
this.inc("pre", identifier); | ||
break; | ||
case "prerelease": | ||
if (this.prerelease.length === 0) { | ||
this.inc("patch", identifier); | ||
} | ||
this.inc("pre", identifier); | ||
break; | ||
case "major": | ||
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { | ||
this.major++; | ||
} | ||
this.minor = 0; | ||
this.patch = 0; | ||
this.prerelease = []; | ||
break; | ||
case "minor": | ||
if (this.patch !== 0 || this.prerelease.length === 0) { | ||
this.minor++; | ||
} | ||
this.patch = 0; | ||
this.prerelease = []; | ||
break; | ||
case "patch": | ||
if (this.prerelease.length === 0) { | ||
this.patch++; | ||
} | ||
this.prerelease = []; | ||
break; | ||
case "pre": | ||
if (this.prerelease.length === 0) { | ||
this.prerelease = [0]; | ||
} else { | ||
var i2 = this.prerelease.length; | ||
while (--i2 >= 0) { | ||
if (typeof this.prerelease[i2] === "number") { | ||
this.prerelease[i2]++; | ||
i2 = -2; | ||
} | ||
} | ||
if (i2 === -1) { | ||
this.prerelease.push(0); | ||
} | ||
} | ||
if (identifier) { | ||
if (this.prerelease[0] === identifier) { | ||
if (isNaN(this.prerelease[1])) { | ||
this.prerelease = [identifier, 0]; | ||
} | ||
} else { | ||
this.prerelease = [identifier, 0]; | ||
} | ||
} | ||
break; | ||
default: | ||
throw new Error("invalid increment argument: " + release); | ||
} | ||
this.format(); | ||
this.raw = this.version; | ||
return this; | ||
}; | ||
exports2.inc = inc; | ||
function inc(version, release, loose, identifier) { | ||
if (typeof loose === "string") { | ||
identifier = loose; | ||
loose = void 0; | ||
} | ||
try { | ||
return new SemVer(version, loose).inc(release, identifier).version; | ||
} catch (er) { | ||
return null; | ||
} | ||
} | ||
exports2.diff = diff; | ||
function diff(version1, version2) { | ||
if (eq(version1, version2)) { | ||
return null; | ||
} else { | ||
var v1 = parse(version1); | ||
var v2 = parse(version2); | ||
var prefix = ""; | ||
if (v1.prerelease.length || v2.prerelease.length) { | ||
prefix = "pre"; | ||
var defaultResult = "prerelease"; | ||
} | ||
for (var key in v1) { | ||
if (key === "major" || key === "minor" || key === "patch") { | ||
if (v1[key] !== v2[key]) { | ||
return prefix + key; | ||
} | ||
} | ||
} | ||
return defaultResult; | ||
} | ||
} | ||
exports2.compareIdentifiers = compareIdentifiers; | ||
var numeric = /^[0-9]+$/; | ||
function compareIdentifiers(a, b) { | ||
var anum = numeric.test(a); | ||
var bnum = numeric.test(b); | ||
if (anum && bnum) { | ||
a = +a; | ||
b = +b; | ||
} | ||
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; | ||
} | ||
exports2.rcompareIdentifiers = rcompareIdentifiers; | ||
function rcompareIdentifiers(a, b) { | ||
return compareIdentifiers(b, a); | ||
} | ||
exports2.major = major; | ||
function major(a, loose) { | ||
return new SemVer(a, loose).major; | ||
} | ||
exports2.minor = minor; | ||
function minor(a, loose) { | ||
return new SemVer(a, loose).minor; | ||
} | ||
exports2.patch = patch; | ||
function patch(a, loose) { | ||
return new SemVer(a, loose).patch; | ||
} | ||
exports2.compare = compare; | ||
function compare(a, b, loose) { | ||
return new SemVer(a, loose).compare(new SemVer(b, loose)); | ||
} | ||
exports2.compareLoose = compareLoose; | ||
function compareLoose(a, b) { | ||
return compare(a, b, true); | ||
} | ||
exports2.compareBuild = compareBuild; | ||
function compareBuild(a, b, loose) { | ||
var versionA = new SemVer(a, loose); | ||
var versionB = new SemVer(b, loose); | ||
return versionA.compare(versionB) || versionA.compareBuild(versionB); | ||
} | ||
exports2.rcompare = rcompare; | ||
function rcompare(a, b, loose) { | ||
return compare(b, a, loose); | ||
} | ||
exports2.sort = sort; | ||
function sort(list, loose) { | ||
return list.sort(function(a, b) { | ||
return exports2.compareBuild(a, b, loose); | ||
}); | ||
} | ||
exports2.rsort = rsort; | ||
function rsort(list, loose) { | ||
return list.sort(function(a, b) { | ||
return exports2.compareBuild(b, a, loose); | ||
}); | ||
} | ||
exports2.gt = gt; | ||
function gt(a, b, loose) { | ||
return compare(a, b, loose) > 0; | ||
} | ||
exports2.lt = lt; | ||
function lt(a, b, loose) { | ||
return compare(a, b, loose) < 0; | ||
} | ||
exports2.eq = eq; | ||
function eq(a, b, loose) { | ||
return compare(a, b, loose) === 0; | ||
} | ||
exports2.neq = neq; | ||
function neq(a, b, loose) { | ||
return compare(a, b, loose) !== 0; | ||
} | ||
exports2.gte = gte; | ||
function gte(a, b, loose) { | ||
return compare(a, b, loose) >= 0; | ||
} | ||
exports2.lte = lte; | ||
function lte(a, b, loose) { | ||
return compare(a, b, loose) <= 0; | ||
} | ||
exports2.cmp = cmp; | ||
function cmp(a, op, b, loose) { | ||
switch (op) { | ||
case "===": | ||
if (typeof a === "object") | ||
a = a.version; | ||
if (typeof b === "object") | ||
b = b.version; | ||
return a === b; | ||
case "!==": | ||
if (typeof a === "object") | ||
a = a.version; | ||
if (typeof b === "object") | ||
b = b.version; | ||
return a !== b; | ||
case "": | ||
case "=": | ||
case "==": | ||
return eq(a, b, loose); | ||
case "!=": | ||
return neq(a, b, loose); | ||
case ">": | ||
return gt(a, b, loose); | ||
case ">=": | ||
return gte(a, b, loose); | ||
case "<": | ||
return lt(a, b, loose); | ||
case "<=": | ||
return lte(a, b, loose); | ||
default: | ||
throw new TypeError("Invalid operator: " + op); | ||
} | ||
} | ||
exports2.Comparator = Comparator; | ||
function Comparator(comp, options) { | ||
if (!options || typeof options !== "object") { | ||
options = { | ||
loose: !!options, | ||
includePrerelease: false | ||
}; | ||
} | ||
if (comp instanceof Comparator) { | ||
if (comp.loose === !!options.loose) { | ||
return comp; | ||
} else { | ||
comp = comp.value; | ||
} | ||
} | ||
if (!(this instanceof Comparator)) { | ||
return new Comparator(comp, options); | ||
} | ||
debug("comparator", comp, options); | ||
this.options = options; | ||
this.loose = !!options.loose; | ||
this.parse(comp); | ||
if (this.semver === ANY) { | ||
this.value = ""; | ||
} else { | ||
this.value = this.operator + this.semver.version; | ||
} | ||
debug("comp", this); | ||
} | ||
var ANY = {}; | ||
Comparator.prototype.parse = function(comp) { | ||
var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; | ||
var m = comp.match(r); | ||
if (!m) { | ||
throw new TypeError("Invalid comparator: " + comp); | ||
} | ||
this.operator = m[1] !== void 0 ? m[1] : ""; | ||
if (this.operator === "=") { | ||
this.operator = ""; | ||
} | ||
if (!m[2]) { | ||
this.semver = ANY; | ||
} else { | ||
this.semver = new SemVer(m[2], this.options.loose); | ||
} | ||
}; | ||
Comparator.prototype.toString = function() { | ||
return this.value; | ||
}; | ||
Comparator.prototype.test = function(version) { | ||
debug("Comparator.test", version, this.options.loose); | ||
if (this.semver === ANY || version === ANY) { | ||
return true; | ||
} | ||
if (typeof version === "string") { | ||
try { | ||
version = new SemVer(version, this.options); | ||
} catch (er) { | ||
return false; | ||
} | ||
} | ||
return cmp(version, this.operator, this.semver, this.options); | ||
}; | ||
Comparator.prototype.intersects = function(comp, options) { | ||
if (!(comp instanceof Comparator)) { | ||
throw new TypeError("a Comparator is required"); | ||
} | ||
if (!options || typeof options !== "object") { | ||
options = { | ||
loose: !!options, | ||
includePrerelease: false | ||
}; | ||
} | ||
var rangeTmp; | ||
if (this.operator === "") { | ||
if (this.value === "") { | ||
return true; | ||
} | ||
rangeTmp = new Range(comp.value, options); | ||
return satisfies(this.value, rangeTmp, options); | ||
} else if (comp.operator === "") { | ||
if (comp.value === "") { | ||
return true; | ||
} | ||
rangeTmp = new Range(this.value, options); | ||
return satisfies(comp.semver, rangeTmp, options); | ||
} | ||
var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">"); | ||
var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<"); | ||
var sameSemVer = this.semver.version === comp.semver.version; | ||
var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<="); | ||
var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<")); | ||
var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">")); | ||
return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; | ||
}; | ||
exports2.Range = Range; | ||
function Range(range, options) { | ||
if (!options || typeof options !== "object") { | ||
options = { | ||
loose: !!options, | ||
includePrerelease: false | ||
}; | ||
} | ||
if (range instanceof Range) { | ||
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { | ||
return range; | ||
} else { | ||
return new Range(range.raw, options); | ||
} | ||
} | ||
if (range instanceof Comparator) { | ||
return new Range(range.value, options); | ||
} | ||
if (!(this instanceof Range)) { | ||
return new Range(range, options); | ||
} | ||
this.options = options; | ||
this.loose = !!options.loose; | ||
this.includePrerelease = !!options.includePrerelease; | ||
this.raw = range; | ||
this.set = range.split(/\s*\|\|\s*/).map(function(range2) { | ||
return this.parseRange(range2.trim()); | ||
}, this).filter(function(c) { | ||
return c.length; | ||
}); | ||
if (!this.set.length) { | ||
throw new TypeError("Invalid SemVer Range: " + range); | ||
} | ||
this.format(); | ||
} | ||
Range.prototype.format = function() { | ||
this.range = this.set.map(function(comps) { | ||
return comps.join(" ").trim(); | ||
}).join("||").trim(); | ||
return this.range; | ||
}; | ||
Range.prototype.toString = function() { | ||
return this.range; | ||
}; | ||
Range.prototype.parseRange = function(range) { | ||
var loose = this.options.loose; | ||
range = range.trim(); | ||
var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; | ||
range = range.replace(hr, hyphenReplace); | ||
debug("hyphen replace", range); | ||
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); | ||
debug("comparator trim", range, re[t.COMPARATORTRIM]); | ||
range = range.replace(re[t.TILDETRIM], tildeTrimReplace); | ||
range = range.replace(re[t.CARETTRIM], caretTrimReplace); | ||
range = range.split(/\s+/).join(" "); | ||
var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; | ||
var set = range.split(" ").map(function(comp) { | ||
return parseComparator(comp, this.options); | ||
}, this).join(" ").split(/\s+/); | ||
if (this.options.loose) { | ||
set = set.filter(function(comp) { | ||
return !!comp.match(compRe); | ||
}); | ||
} | ||
set = set.map(function(comp) { | ||
return new Comparator(comp, this.options); | ||
}, this); | ||
return set; | ||
}; | ||
Range.prototype.intersects = function(range, options) { | ||
if (!(range instanceof Range)) { | ||
throw new TypeError("a Range is required"); | ||
} | ||
return this.set.some(function(thisComparators) { | ||
return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { | ||
return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { | ||
return rangeComparators.every(function(rangeComparator) { | ||
return thisComparator.intersects(rangeComparator, options); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}; | ||
function isSatisfiable(comparators, options) { | ||
var result = true; | ||
var remainingComparators = comparators.slice(); | ||
var testComparator = remainingComparators.pop(); | ||
while (result && remainingComparators.length) { | ||
result = remainingComparators.every(function(otherComparator) { | ||
return testComparator.intersects(otherComparator, options); | ||
}); | ||
testComparator = remainingComparators.pop(); | ||
} | ||
return result; | ||
} | ||
exports2.toComparators = toComparators; | ||
function toComparators(range, options) { | ||
return new Range(range, options).set.map(function(comp) { | ||
return comp.map(function(c) { | ||
return c.value; | ||
}).join(" ").trim().split(" "); | ||
}); | ||
} | ||
function parseComparator(comp, options) { | ||
debug("comp", comp, options); | ||
comp = replaceCarets(comp, options); | ||
debug("caret", comp); | ||
comp = replaceTildes(comp, options); | ||
debug("tildes", comp); | ||
comp = replaceXRanges(comp, options); | ||
debug("xrange", comp); | ||
comp = replaceStars(comp, options); | ||
debug("stars", comp); | ||
return comp; | ||
} | ||
function isX(id) { | ||
return !id || id.toLowerCase() === "x" || id === "*"; | ||
} | ||
function replaceTildes(comp, options) { | ||
return comp.trim().split(/\s+/).map(function(comp2) { | ||
return replaceTilde(comp2, options); | ||
}).join(" "); | ||
} | ||
function replaceTilde(comp, options) { | ||
var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; | ||
return comp.replace(r, function(_, M, m, p, pr) { | ||
debug("tilde", comp, _, M, m, p, pr); | ||
var ret; | ||
if (isX(M)) { | ||
ret = ""; | ||
} else if (isX(m)) { | ||
ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; | ||
} else if (isX(p)) { | ||
ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; | ||
} else if (pr) { | ||
debug("replaceTilde pr", pr); | ||
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; | ||
} else { | ||
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; | ||
} | ||
debug("tilde return", ret); | ||
return ret; | ||
}); | ||
} | ||
function replaceCarets(comp, options) { | ||
return comp.trim().split(/\s+/).map(function(comp2) { | ||
return replaceCaret(comp2, options); | ||
}).join(" "); | ||
} | ||
function replaceCaret(comp, options) { | ||
debug("caret", comp, options); | ||
var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; | ||
return comp.replace(r, function(_, M, m, p, pr) { | ||
debug("caret", comp, _, M, m, p, pr); | ||
var ret; | ||
if (isX(M)) { | ||
ret = ""; | ||
} else if (isX(m)) { | ||
ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0"; | ||
} else if (isX(p)) { | ||
if (M === "0") { | ||
ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; | ||
} else { | ||
ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; | ||
} | ||
} else if (pr) { | ||
debug("replaceCaret pr", pr); | ||
if (M === "0") { | ||
if (m === "0") { | ||
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); | ||
} else { | ||
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; | ||
} | ||
} else { | ||
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; | ||
} | ||
} else { | ||
debug("no pr"); | ||
if (M === "0") { | ||
if (m === "0") { | ||
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); | ||
} else { | ||
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; | ||
} | ||
} else { | ||
ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; | ||
} | ||
} | ||
debug("caret return", ret); | ||
return ret; | ||
}); | ||
} | ||
function replaceXRanges(comp, options) { | ||
debug("replaceXRanges", comp, options); | ||
return comp.split(/\s+/).map(function(comp2) { | ||
return replaceXRange(comp2, options); | ||
}).join(" "); | ||
} | ||
function replaceXRange(comp, options) { | ||
comp = comp.trim(); | ||
var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; | ||
return comp.replace(r, function(ret, gtlt, M, m, p, pr) { | ||
debug("xRange", comp, ret, gtlt, M, m, p, pr); | ||
var xM = isX(M); | ||
var xm = xM || isX(m); | ||
var xp = xm || isX(p); | ||
var anyX = xp; | ||
if (gtlt === "=" && anyX) { | ||
gtlt = ""; | ||
} | ||
pr = options.includePrerelease ? "-0" : ""; | ||
if (xM) { | ||
if (gtlt === ">" || gtlt === "<") { | ||
ret = "<0.0.0-0"; | ||
} else { | ||
ret = "*"; | ||
} | ||
} else if (gtlt && anyX) { | ||
if (xm) { | ||
m = 0; | ||
} | ||
p = 0; | ||
if (gtlt === ">") { | ||
gtlt = ">="; | ||
if (xm) { | ||
M = +M + 1; | ||
m = 0; | ||
p = 0; | ||
} else { | ||
m = +m + 1; | ||
p = 0; | ||
} | ||
} else if (gtlt === "<=") { | ||
gtlt = "<"; | ||
if (xm) { | ||
M = +M + 1; | ||
} else { | ||
m = +m + 1; | ||
} | ||
} | ||
ret = gtlt + M + "." + m + "." + p + pr; | ||
} else if (xm) { | ||
ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr; | ||
} else if (xp) { | ||
ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; | ||
} | ||
debug("xRange return", ret); | ||
return ret; | ||
}); | ||
} | ||
function replaceStars(comp, options) { | ||
debug("replaceStars", comp, options); | ||
return comp.trim().replace(re[t.STAR], ""); | ||
} | ||
function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { | ||
if (isX(fM)) { | ||
from = ""; | ||
} else if (isX(fm)) { | ||
from = ">=" + fM + ".0.0"; | ||
} else if (isX(fp)) { | ||
from = ">=" + fM + "." + fm + ".0"; | ||
} else { | ||
from = ">=" + from; | ||
} | ||
if (isX(tM)) { | ||
to = ""; | ||
} else if (isX(tm)) { | ||
to = "<" + (+tM + 1) + ".0.0"; | ||
} else if (isX(tp)) { | ||
to = "<" + tM + "." + (+tm + 1) + ".0"; | ||
} else if (tpr) { | ||
to = "<=" + tM + "." + tm + "." + tp + "-" + tpr; | ||
} else { | ||
to = "<=" + to; | ||
} | ||
return (from + " " + to).trim(); | ||
} | ||
Range.prototype.test = function(version) { | ||
if (!version) { | ||
return false; | ||
} | ||
if (typeof version === "string") { | ||
try { | ||
version = new SemVer(version, this.options); | ||
} catch (er) { | ||
return false; | ||
} | ||
} | ||
for (var i2 = 0; i2 < this.set.length; i2++) { | ||
if (testSet(this.set[i2], version, this.options)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
function testSet(set, version, options) { | ||
for (var i2 = 0; i2 < set.length; i2++) { | ||
if (!set[i2].test(version)) { | ||
return false; | ||
} | ||
} | ||
if (version.prerelease.length && !options.includePrerelease) { | ||
for (i2 = 0; i2 < set.length; i2++) { | ||
debug(set[i2].semver); | ||
if (set[i2].semver === ANY) { | ||
continue; | ||
} | ||
if (set[i2].semver.prerelease.length > 0) { | ||
var allowed = set[i2].semver; | ||
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
return true; | ||
} | ||
exports2.satisfies = satisfies; | ||
function satisfies(version, range, options) { | ||
try { | ||
range = new Range(range, options); | ||
} catch (er) { | ||
return false; | ||
} | ||
return range.test(version); | ||
} | ||
exports2.maxSatisfying = maxSatisfying; | ||
function maxSatisfying(versions, range, options) { | ||
var max = null; | ||
var maxSV = null; | ||
try { | ||
var rangeObj = new Range(range, options); | ||
} catch (er) { | ||
return null; | ||
} | ||
versions.forEach(function(v) { | ||
if (rangeObj.test(v)) { | ||
if (!max || maxSV.compare(v) === -1) { | ||
max = v; | ||
maxSV = new SemVer(max, options); | ||
} | ||
} | ||
}); | ||
return max; | ||
} | ||
exports2.minSatisfying = minSatisfying; | ||
function minSatisfying(versions, range, options) { | ||
var min = null; | ||
var minSV = null; | ||
try { | ||
var rangeObj = new Range(range, options); | ||
} catch (er) { | ||
return null; | ||
} | ||
versions.forEach(function(v) { | ||
if (rangeObj.test(v)) { | ||
if (!min || minSV.compare(v) === 1) { | ||
min = v; | ||
minSV = new SemVer(min, options); | ||
} | ||
} | ||
}); | ||
return min; | ||
} | ||
exports2.minVersion = minVersion; | ||
function minVersion(range, loose) { | ||
range = new Range(range, loose); | ||
var minver = new SemVer("0.0.0"); | ||
if (range.test(minver)) { | ||
return minver; | ||
} | ||
minver = new SemVer("0.0.0-0"); | ||
if (range.test(minver)) { | ||
return minver; | ||
} | ||
minver = null; | ||
for (var i2 = 0; i2 < range.set.length; ++i2) { | ||
var comparators = range.set[i2]; | ||
comparators.forEach(function(comparator) { | ||
var compver = new SemVer(comparator.semver.version); | ||
switch (comparator.operator) { | ||
case ">": | ||
if (compver.prerelease.length === 0) { | ||
compver.patch++; | ||
} else { | ||
compver.prerelease.push(0); | ||
} | ||
compver.raw = compver.format(); | ||
case "": | ||
case ">=": | ||
if (!minver || gt(minver, compver)) { | ||
minver = compver; | ||
} | ||
break; | ||
case "<": | ||
case "<=": | ||
break; | ||
default: | ||
throw new Error("Unexpected operation: " + comparator.operator); | ||
} | ||
}); | ||
} | ||
if (minver && range.test(minver)) { | ||
return minver; | ||
} | ||
return null; | ||
} | ||
exports2.validRange = validRange; | ||
function validRange(range, options) { | ||
try { | ||
return new Range(range, options).range || "*"; | ||
} catch (er) { | ||
return null; | ||
} | ||
} | ||
exports2.ltr = ltr; | ||
function ltr(version, range, options) { | ||
return outside(version, range, "<", options); | ||
} | ||
exports2.gtr = gtr; | ||
function gtr(version, range, options) { | ||
return outside(version, range, ">", options); | ||
} | ||
exports2.outside = outside; | ||
function outside(version, range, hilo, options) { | ||
version = new SemVer(version, options); | ||
range = new Range(range, options); | ||
var gtfn, ltefn, ltfn, comp, ecomp; | ||
switch (hilo) { | ||
case ">": | ||
gtfn = gt; | ||
ltefn = lte; | ||
ltfn = lt; | ||
comp = ">"; | ||
ecomp = ">="; | ||
break; | ||
case "<": | ||
gtfn = lt; | ||
ltefn = gte; | ||
ltfn = gt; | ||
comp = "<"; | ||
ecomp = "<="; | ||
break; | ||
default: | ||
throw new TypeError('Must provide a hilo val of "<" or ">"'); | ||
} | ||
if (satisfies(version, range, options)) { | ||
return false; | ||
} | ||
for (var i2 = 0; i2 < range.set.length; ++i2) { | ||
var comparators = range.set[i2]; | ||
var high = null; | ||
var low = null; | ||
comparators.forEach(function(comparator) { | ||
if (comparator.semver === ANY) { | ||
comparator = new Comparator(">=0.0.0"); | ||
} | ||
high = high || comparator; | ||
low = low || comparator; | ||
if (gtfn(comparator.semver, high.semver, options)) { | ||
high = comparator; | ||
} else if (ltfn(comparator.semver, low.semver, options)) { | ||
low = comparator; | ||
} | ||
}); | ||
if (high.operator === comp || high.operator === ecomp) { | ||
return false; | ||
} | ||
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { | ||
return false; | ||
} else if (low.operator === ecomp && ltfn(version, low.semver)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
exports2.prerelease = prerelease; | ||
function prerelease(version, options) { | ||
var parsed = parse(version, options); | ||
return parsed && parsed.prerelease.length ? parsed.prerelease : null; | ||
} | ||
exports2.intersects = intersects; | ||
function intersects(r1, r2, options) { | ||
r1 = new Range(r1, options); | ||
r2 = new Range(r2, options); | ||
return r1.intersects(r2); | ||
} | ||
exports2.coerce = coerce; | ||
function coerce(version, options) { | ||
if (version instanceof SemVer) { | ||
return version; | ||
} | ||
if (typeof version === "number") { | ||
version = String(version); | ||
} | ||
if (typeof version !== "string") { | ||
return null; | ||
} | ||
options = options || {}; | ||
var match = null; | ||
if (!options.rtl) { | ||
match = version.match(re[t.COERCE]); | ||
} else { | ||
var next; | ||
while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { | ||
if (!match || next.index + next[0].length !== match.index + match[0].length) { | ||
match = next; | ||
} | ||
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; | ||
} | ||
re[t.COERCERTL].lastIndex = -1; | ||
} | ||
if (match === null) { | ||
return null; | ||
} | ||
return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); | ||
} | ||
}); | ||
// ../../node_modules/make-dir/index.js | ||
var require_make_dir = __commonJS((exports2, module2) => { | ||
"use strict"; | ||
var fs2 = require("fs"); | ||
var path2 = require("path"); | ||
var {promisify: promisify2} = require("util"); | ||
var semver = require_semver(); | ||
var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0"); | ||
var checkPath = (pth) => { | ||
if (process.platform === "win32") { | ||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path2.parse(pth).root, "")); | ||
if (pathHasInvalidWinCharacters) { | ||
const error = new Error(`Path contains invalid characters: ${pth}`); | ||
error.code = "EINVAL"; | ||
throw error; | ||
} | ||
} | ||
}; | ||
var processOptions = (options) => { | ||
const defaults = { | ||
mode: 511, | ||
fs: fs2 | ||
}; | ||
return { | ||
...defaults, | ||
...options | ||
}; | ||
}; | ||
var permissionError = (pth) => { | ||
const error = new Error(`operation not permitted, mkdir '${pth}'`); | ||
error.code = "EPERM"; | ||
error.errno = -4048; | ||
error.path = pth; | ||
error.syscall = "mkdir"; | ||
return error; | ||
}; | ||
var makeDir2 = async (input, options) => { | ||
checkPath(input); | ||
options = processOptions(options); | ||
const mkdir = promisify2(options.fs.mkdir); | ||
const stat = promisify2(options.fs.stat); | ||
if (useNativeRecursiveOption && options.fs.mkdir === fs2.mkdir) { | ||
const pth = path2.resolve(input); | ||
await mkdir(pth, { | ||
mode: options.mode, | ||
recursive: true | ||
}); | ||
return pth; | ||
} | ||
const make = async (pth) => { | ||
try { | ||
await mkdir(pth, options.mode); | ||
return pth; | ||
} catch (error) { | ||
if (error.code === "EPERM") { | ||
throw error; | ||
} | ||
if (error.code === "ENOENT") { | ||
if (path2.dirname(pth) === pth) { | ||
throw permissionError(pth); | ||
} | ||
if (error.message.includes("null bytes")) { | ||
throw error; | ||
} | ||
await make(path2.dirname(pth)); | ||
return make(pth); | ||
} | ||
try { | ||
const stats = await stat(pth); | ||
if (!stats.isDirectory()) { | ||
throw new Error("The path is not a directory"); | ||
} | ||
} catch (_) { | ||
throw error; | ||
} | ||
return pth; | ||
} | ||
}; | ||
return make(path2.resolve(input)); | ||
}; | ||
module2.exports = makeDir2; | ||
module2.exports.sync = (input, options) => { | ||
checkPath(input); | ||
options = processOptions(options); | ||
if (useNativeRecursiveOption && options.fs.mkdirSync === fs2.mkdirSync) { | ||
const pth = path2.resolve(input); | ||
fs2.mkdirSync(pth, { | ||
mode: options.mode, | ||
recursive: true | ||
}); | ||
return pth; | ||
} | ||
const make = (pth) => { | ||
try { | ||
options.fs.mkdirSync(pth, options.mode); | ||
} catch (error) { | ||
if (error.code === "EPERM") { | ||
throw error; | ||
} | ||
if (error.code === "ENOENT") { | ||
if (path2.dirname(pth) === pth) { | ||
throw permissionError(pth); | ||
} | ||
if (error.message.includes("null bytes")) { | ||
throw error; | ||
} | ||
make(path2.dirname(pth)); | ||
return make(pth); | ||
} | ||
try { | ||
if (!options.fs.statSync(pth).isDirectory()) { | ||
throw new Error("The path is not a directory"); | ||
} | ||
} catch (_) { | ||
throw error; | ||
} | ||
} | ||
return pth; | ||
}; | ||
return make(path2.resolve(input)); | ||
}; | ||
}); | ||
// plugins/scss.ts | ||
__markAsModule(exports); | ||
__export(exports, { | ||
default: () => scss_default | ||
}); | ||
var fs = __toModule(require("fs")); | ||
var import_make_dir = __toModule(require_make_dir()); | ||
var path = __toModule(require("path")); | ||
var import_sass = __toModule(require("sass")); | ||
var util = __toModule(require("util")); | ||
var writeFile2 = util.promisify(fs.writeFile); | ||
var defaultOptions = { | ||
plugins: [], | ||
rootDir: process.cwd(), | ||
tempDir: `${process.cwd()}/.temp` | ||
}; | ||
var postcssPlugin = (userOptions = {}) => ({ | ||
name: "scss", | ||
setup: function(build) { | ||
const options = {...defaultOptions, ...userOptions}; | ||
const {rootDir, tempDir} = options; | ||
build.onResolve({filter: /.\.(scss)$/, namespace: "file"}, async (args) => { | ||
const sourceFullPath = path.resolve(args.resolveDir, args.path); | ||
const sourceExt = path.extname(sourceFullPath); | ||
const sourceBaseName = path.basename(sourceFullPath, sourceExt); | ||
const sourceDir = path.dirname(sourceFullPath); | ||
const sourceRelDir = path.relative(path.dirname(rootDir), sourceDir); | ||
const tmpDir = path.resolve(tempDir, sourceRelDir); | ||
const tmpFilePath = path.resolve(tmpDir, `${sourceBaseName}.css`); | ||
const result = import_sass.default.renderSync({ | ||
file: sourceFullPath, | ||
indentType: "tab" | ||
}); | ||
(0, import_make_dir.default)(path.dirname(tmpFilePath)); | ||
await writeFile2(tmpFilePath, result.css); | ||
return { | ||
namespace: "file", | ||
path: tmpFilePath | ||
}; | ||
}); | ||
} | ||
}); | ||
var scss_default = postcssPlugin; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
226891
2
8381863
7
+ Addeddebounce-promise@^3.1.2
+ Added@bazo/js-dev-overlay@0.0.26(transitive)
+ Added@bazo/js-dev-scripts-types@0.0.22(transitive)
+ Addeddebounce-promise@3.1.2(transitive)
- Removed@bazo/js-dev-overlay@0.0.25(transitive)
- Removed@bazo/js-dev-scripts-types@0.0.21(transitive)
Updated@bazo/js-dev-overlay@^0.0.26