@raclettejs/core 0.0.1 → 0.0.2
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.
- package/dist/cli.js +82 -82
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/services/backend/Dockerfile +1 -1
- package/services/frontend/Dockerfile +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
3
|
-
var
|
|
4
|
-
`)}displayWidth(t){return
|
|
3
|
+
var ff=Object.create;var Bn=Object.defineProperty;var hf=Object.getOwnPropertyDescriptor;var mf=Object.getOwnPropertyNames;var gf=Object.getPrototypeOf,yf=Object.prototype.hasOwnProperty;var I=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var tt=(e,t)=>()=>(e&&(t=e(e=0)),t);var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bf=(e,t)=>{for(var r in t)Bn(e,r,{get:t[r],enumerable:!0})},vf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mf(t))!yf.call(e,o)&&o!==r&&Bn(e,o,{get:()=>t[o],enumerable:!(n=hf(t,o))||n.enumerable});return e};var qt=(e,t,r)=>(r=e!=null?ff(gf(e)):{},vf(t||!e||!e.__esModule?Bn(r,"default",{value:e,enumerable:!0}):r,e));var Xt=E(qn=>{var Sr=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Wn=class extends Sr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};qn.CommanderError=Sr;qn.InvalidArgumentError=Wn});var Rr=E(Kn=>{var{InvalidArgumentError:Lf}=Xt(),Yn=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Lf(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function If(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Kn.Argument=Yn;Kn.humanReadableArgName=If});var Qn=E(zn=>{var{humanReadableArgName:jf}=Rr(),Xn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(o=>!o._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,i)=>o.name().localeCompare(i.name())),r}compareOptions(t,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(o=>!o.hidden),n=t._getHelpOption();if(n&&!n.hidden){let o=n.short&&t._findOption(n.short),i=n.long&&t._findOption(n.long);!o&&!i?r.push(n):n.long&&!i?r.push(t.createOption(n.long,n.description)):n.short&&!o&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);r.push(...o)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>jf(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let o=t.parent;o;o=o.parent)n=o.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let o=new Map;return t.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[])}),r.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[]),o.get(s).push(i)}),o}formatHelp(t,r){let n=r.padWidth(t,r),o=r.helpWidth??80;function i(p,d){return r.formatItem(p,n,d,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let c=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,d)=>{let g=p.map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(d,g,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(d=>i(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));s=s.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,d)=>{let g=p.map(m=>i(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(d,g,r))}),s.join(`
|
|
4
|
+
`)}displayWidth(t){return na(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,o){let s=" ".repeat(2);if(!n)return s+t;let a=t.padEnd(r+t.length-o.displayWidth(t)),c=2,u=(this.helpWidth??80)-r-c-2,p;return u<this.minWidthToWrap||o.preformatted(n)?p=n:p=o.boxWrap(n,u).replace(/\n/g,`
|
|
5
5
|
`+" ".repeat(r+c)),s+a+" ".repeat(c)+p.replace(/\n/g,`
|
|
6
6
|
${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,i=[];return n.forEach(s=>{let a=s.match(o);if(a===null){i.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let p=this.displayWidth(u);if(l+p<=r){c.push(u),l+=p;return}i.push(c.join(""));let d=u.trimStart();c=[d],l=this.displayWidth(d)}),i.push(c.join(""))}),i.join(`
|
|
7
|
-
`)}};function
|
|
7
|
+
`)}};function na(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}zn.Help=Xn;zn.stripColor=na});var to=E(eo=>{var{InvalidArgumentError:Ff}=Xt(),Jn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=Mf(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Ff(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?oa(this.name().replace(/^no-/,"")):oa(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Zn=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return r.negate===(i===t)}};function oa(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Mf(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(t=i.shift()),o.test(i[0])&&(r=i.shift()),!t&&n.test(i[0])&&(t=i.shift()),!t&&o.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let s=i[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
8
8
|
- a short flag is a single dash and a single character
|
|
9
9
|
- either use a single dash and a single character (for a short flag)
|
|
10
10
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
11
11
|
- too many short flags`):o.test(s)?new Error(`${a}
|
|
12
12
|
- too many long flags`):new Error(`${a}
|
|
13
|
-
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}
|
|
13
|
+
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}eo.Option=Jn;eo.DualOptions=Zn});var sa=E(ia=>{function Bf(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;e[o-1]===t[n-1]?i=0:i=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}function Hf(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let n=[],o=3,i=.4;return t.forEach(s=>{if(s.length<=1)return;let a=Bf(e,s),c=Math.max(e.length,s.length);(c-a)/c>i&&(a<o?(o=a,n=[s]):a===o&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
14
14
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
15
|
-
(Did you mean ${n[0]}?)`:""}
|
|
16
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new
|
|
17
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new
|
|
18
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=o=>[o.name()].concat(o.aliases()),n=r(t).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let o=(i,s,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,s):i!==null&&t.variadic&&(i=t._concatValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${t.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(t,r,n,o,i){if(typeof r=="object"&&r instanceof
|
|
15
|
+
(Did you mean ${n[0]}?)`:""}ia.suggestSimilar=Hf});var ua=E(so=>{var Vf=I("node:events").EventEmitter,ro=I("node:child_process"),We=I("node:path"),Or=I("node:fs"),F=I("node:process"),{Argument:Gf,humanReadableArgName:Uf}=Rr(),{CommanderError:no}=Xt(),{Help:Wf,stripColor:qf}=Qn(),{Option:aa,DualOptions:Yf}=to(),{suggestSimilar:ca}=sa(),oo=class e extends Vf{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>F.stdout.write(r),writeErr:r=>F.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>F.stdout.isTTY?F.stdout.columns:void 0,getErrHelpWidth:()=>F.stderr.isTTY?F.stderr.columns:void 0,getOutHasColors:()=>io()??(F.stdout.isTTY&&F.stdout.hasColors?.()),getErrHasColors:()=>io()??(F.stderr.isTTY&&F.stderr.hasColors?.()),stripColor:r=>qf(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let o=r,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return o&&(c.description(o),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),o?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Wf,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
16
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Gf(t,r)}argument(t,r,n,o){let i=this.createArgument(t,r);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,o,i]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(o);return a.helpOption(!1),i&&a.arguments(i),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
17
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new no(t,r,n)),F.exit(t)}action(t){let r=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new aa(t,r)}_callParseArg(t,r,n,o){try{return t.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
18
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=o=>[o.name()].concat(o.aliases()),n=r(t).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let o=(i,s,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,s):i!==null&&t.variadic&&(i=t._concatValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${t.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(t,r,n,o,i){if(typeof r=="object"&&r instanceof aa)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let a=o;o=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(t,r,n,o){return this._optionEx({},t,r,n,o)}requiredOption(t,r,n,o){return this._optionEx({mandatory:!0},t,r,n,o)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){F.versions?.electron&&(r.from="electron");let o=F.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=F.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":F.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
19
19
|
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,n){if(Or.existsSync(t))return;let o=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
|
|
20
20
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
21
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(u,p){let d=We.resolve(u,p);if(Or.existsSync(d))return d;if(o.includes(We.extname(p)))return;let g=o.find(m=>Or.existsSync(`${d}${m}`));if(g)return`${d}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Or.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=We.resolve(We.dirname(u),a)}if(a){let u=i(a,s);if(!u&&!t._executableFile&&this._scriptPath){let p=We.basename(this._scriptPath,We.extname(this._scriptPath));p!==this._name&&(u=i(a,`${p}-${t._name}`))}s=u||s}n=o.includes(We.extname(s));let c;F.platform!=="win32"?n?(r.unshift(s),r=
|
|
22
|
+
- ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(u,p){let d=We.resolve(u,p);if(Or.existsSync(d))return d;if(o.includes(We.extname(p)))return;let g=o.find(m=>Or.existsSync(`${d}${m}`));if(g)return`${d}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Or.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=We.resolve(We.dirname(u),a)}if(a){let u=i(a,s);if(!u&&!t._executableFile&&this._scriptPath){let p=We.basename(this._scriptPath,We.extname(this._scriptPath));p!==this._name&&(u=i(a,`${p}-${t._name}`))}s=u||s}n=o.includes(We.extname(s));let c;F.platform!=="win32"?n?(r.unshift(s),r=la(F.execArgv).concat(r),c=ro.spawn(F.argv[0],r,{stdio:"inherit"})):c=ro.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=la(F.execArgv).concat(r),c=ro.spawn(F.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{F.on(p,()=>{c.killed===!1&&c.exitCode===null&&c.kill(p)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new no(u,"commander.executeSubCommandAsync","(close)")):F.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)F.exit(1);else{let p=new no(1,"commander.executeSubCommandAsync","(error)");p.nestedError=u,l(p)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let o=this._findCommand(t);o||this.help({error:!0}),o._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,a)=>t(n,a,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=t(n,i,n.defaultValue))),r[o]=i}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),r==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let o=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,r))}),o}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=t.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],o=r,i=t.slice();function s(l){return l.length>1&&l[0]==="-"}let a=l=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(u=>u.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,c=null;for(;i.length;){let l=i.shift();if(l==="--"){o===n&&o.push(l),o.push(...i);break}if(c&&(!s(l)||a(l))){this.emit(`option:${c.name()}`,l);continue}if(c=null,s(l)){let u=this._findOption(l);if(u){if(u.required){let p=i.shift();p===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,p)}else if(u.optional){let p=null;i.length>0&&(!s(i[0])||a(i[0]))&&(p=i.shift()),this.emit(`option:${u.name()}`,p)}else this.emit(`option:${u.name()}`);c=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),i.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),p=this._findOption(l.slice(0,u));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,l.slice(u+1));continue}}if(o===r&&s(l)&&!(this.commands.length===0&&a(l))&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){n.push(l),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){o.push(l),i.length>0&&o.push(...i);break}o.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();t[o]=o===this._versionOptionName?this._version:this[o]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
|
|
23
23
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
24
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in F.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,F.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new
|
|
26
|
-
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>
|
|
25
|
+
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in F.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,F.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Yf(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(p=>p.negate&&a===p.attributeName()),u=this.options.find(p=>!p.negate&&a===p.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},o=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${o(t)} cannot be used with ${o(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);r=ca(t,o)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),r=ca(t,o)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
26
|
+
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Uf(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=We.basename(t,We.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(t){t=t||{};let r=!!t.error,n,o,i;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let i=this.helpInformation({error:n.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",o))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(F.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
27
27
|
Expecting one of '${n.join("', '")}'`);let o=`${t}Help`;return this.on(o,i=>{let s;typeof r=="function"?s=r({error:i.error,command:i.command}):s=r,s&&i.write(`${s}
|
|
28
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
29
|
-
`);let n;for(;(n=
|
|
30
|
-
`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}function sh(e){e=e||{};let t=xa(e);e.path=t;let r=se.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=ka(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=ch(r,a);i=se.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return se.parse(i)}function ah(e){console.error(`[dotenv@${uo}][WARN] ${e}`)}function zt(e){console.log(`[dotenv@${uo}][DEBUG] ${e}`)}function Ea(e){console.log(`[dotenv@${uo}] ${e}`)}function ka(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function ch(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let o=r.searchParams.get("environment");if(!o){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let i=`DOTENV_VAULT_${o.toUpperCase()}`,s=e.parsed[i];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function xa(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)lo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Tr.resolve(process.cwd(),".env.vault");return lo.existsSync(t)?t:null}function _a(e){return e[0]==="~"?Tr.join(Jf.homedir(),e.slice(1)):e}function lh(e){let t=xt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=xt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&Ea("Loading env from encrypted .env.vault");let n=se._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),se.populate(o,n,e),{parsed:n}}function uh(e){let t=Tr.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=xt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=xt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&zt("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[_a(e.path)];else{s=[];for(let u of e.path)s.push(_a(u))}let a,c={};for(let u of s)try{let p=se.parse(lo.readFileSync(u,{encoding:r}));se.populate(c,p,e)}catch(p){o&&zt(`Failed to load ${u} ${p.message}`),a=p}let l=se.populate(n,c,e);if(o=xt(n.DOTENV_CONFIG_DEBUG||o),i=xt(n.DOTENV_CONFIG_QUIET||i),o||!i){let u=Object.keys(l).length,p=[];for(let d of s)try{let g=Tr.relative(process.cwd(),d);p.push(g)}catch(g){o&&zt(`Failed to load ${d} ${g.message}`),a=g}Ea(`injecting env (${u}) from ${p.join(",")} ${nh(`(tip: ${th()})`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function ph(e){if(ka(e).length===0)return se.configDotenv(e);let t=xa(e);return t?se._configVault(e):(ah(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),se.configDotenv(e))}function dh(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{let s=Zf.createDecipheriv("aes-256-gcm",r,o);return s.setAuthTag(i),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",l=s.message==="Unsupported state or unable to authenticate data";if(a||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw s}}function fh(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override),i={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s],i[s]=t[s]),n&&zt(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],i[s]=t[s]);return i}var se={configDotenv:uh,_configVault:lh,_parseVault:sh,config:ph,decrypt:dh,parse:ih,populate:fh};qe.exports.configDotenv=se.configDotenv;qe.exports._configVault=se._configVault;qe.exports._parseVault=se._parseVault;qe.exports.config=se.config;qe.exports.decrypt=se.decrypt;qe.exports.parse=se.parse;qe.exports.populate=se.populate;qe.exports=se});import{on as oy,once as iy}from"node:events";import{PassThrough as sy}from"node:stream";import{finished as tl}from"node:stream/promises";function Io(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)No(o);let t=e.some(({readableObjectMode:o})=>o),r=ay(e,t),n=new Do({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&ol(n),n}var ay,Do,cy,ly,uy,No,py,rl,dy,fy,hy,nl,ol,Lo,il,my,Jr,Zc,el,sl=tt(()=>{ay=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Do=class extends sy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){No(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=cy(this,this.#e),py({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return No(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},cy=async(e,t)=>{Jr(e,Zc);let r=new AbortController;try{await Promise.race([ly(e,r),uy(e,t,r)])}finally{r.abort(),Jr(e,-Zc)}},ly=async(e,{signal:t})=>{await tl(e,{signal:t,cleanup:!0})},uy=async(e,t,{signal:r})=>{for await(let[n]of oy(e,"unpipe",{signal:r}))t.has(n)&&n.emit(nl)},No=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},py=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{Jr(e,el);let s=new AbortController;try{await Promise.race([dy(i,t),fy({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),hy({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),Jr(e,-el)}r.size===n.size+o.size&&(n.size===0&&o.size>0?Lo(e):ol(e))},rl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",dy=async(e,t)=>{try{await e,Lo(t)}catch(r){rl(r)?Lo(t):il(t,r)}},fy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await tl(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;rl(s)?o.add(t):il(e,s)}},hy=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await iy(e,nl,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},nl=Symbol("unpipe"),ol=e=>{e.writable&&e.end()},Lo=e=>{(e.readable||e.writable)&&e.destroy()},il=(e,t)=>{e.destroyed||(e.once("error",my),e.destroy(t))},my=()=>{},Jr=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Zc=2,el=1});var al=E($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.splitWhen=$t.flatten=void 0;function gy(e){return e.reduce((t,r)=>[].concat(t,r),[])}$t.flatten=gy;function yy(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}$t.splitWhen=yy});var cl=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isEnoentCodeError=void 0;function by(e){return e.code==="ENOENT"}Zr.isEnoentCodeError=by});var ll=E(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.createDirentFromStats=void 0;var jo=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function vy(e,t){return new jo(e,t)}en.createDirentFromStats=vy});var fl=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.convertPosixPathToPattern=oe.convertWindowsPathToPattern=oe.convertPathToPattern=oe.escapePosixPath=oe.escapeWindowsPath=oe.escape=oe.removeLeadingDotSegment=oe.makeAbsolute=oe.unixify=void 0;var _y=I("os"),Ey=I("path"),ul=_y.platform()==="win32",ky=2,xy=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,wy=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Cy=/^\\\\([.?])/,Ay=/\\(?![!()+@[\]{}])/g;function Sy(e){return e.replace(/\\/g,"/")}oe.unixify=Sy;function Ry(e,t){return Ey.resolve(e,t)}oe.makeAbsolute=Ry;function Oy(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(ky)}return e}oe.removeLeadingDotSegment=Oy;oe.escape=ul?Fo:Mo;function Fo(e){return e.replace(wy,"\\$2")}oe.escapeWindowsPath=Fo;function Mo(e){return e.replace(xy,"\\$2")}oe.escapePosixPath=Mo;oe.convertPathToPattern=ul?pl:dl;function pl(e){return Fo(e).replace(Cy,"//$1").replace(Ay,"/")}oe.convertWindowsPathToPattern=pl;function dl(e){return Mo(e)}oe.convertPosixPathToPattern=dl});var ml=E((PC,hl)=>{hl.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var bl=E(($C,yl)=>{var Ty=ml(),gl={"{":"}","(":")","[":"]"},Py=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,o=-2,i=-2,s=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(s===-1||s>n||(s=e.indexOf("\\",t),s===-1||s>n)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(s=e.indexOf("\\",t),s===-1||s>o))||i!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(i=e.indexOf(")",t),i>t&&(s=e.indexOf("\\",t),s===-1||s>i))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(i=e.indexOf(")",r),i>r&&(s=e.indexOf("\\",r),s===-1||s>i))))return!0;if(e[t]==="\\"){var a=e[t+1];t+=2;var c=gl[a];if(c){var l=e.indexOf(c,t);l!==-1&&(t=l+1)}if(e[t]==="!")return!0}else t++}return!1},$y=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=gl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};yl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Ty(t))return!0;var n=Py;return r&&r.strict===!1&&(n=$y),n(t)}});var _l=E((DC,vl)=>{"use strict";var Dy=bl(),Ny=I("path").posix.dirname,Ly=I("os").platform()==="win32",Bo="/",Iy=/\\/g,jy=/[\{\[].*[\}\]]$/,Fy=/(^|[^\\])([\{\[]|\([^\)]+$)/,My=/\\([\!\*\?\|\[\]\(\)\{\}])/g;vl.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Ly&&t.indexOf(Bo)<0&&(t=t.replace(Iy,Bo)),jy.test(t)&&(t+=Bo),t+="a";do t=Ny(t);while(Dy(t)||Fy.test(t));return t.replace(My,"$1")}});var tn=E(Ae=>{"use strict";Ae.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Ae.find=(e,t)=>e.nodes.find(r=>r.type===t);Ae.exceedsLimit=(e,t,r=1,n)=>n===!1||!Ae.isInteger(e)||!Ae.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Ae.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Ae.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Ae.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;Ae.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Ae.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Ae.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let i=n[o];if(Array.isArray(i)){r(i);continue}i!==void 0&&t.push(i)}return t};return r(e),t}});var rn=E((LC,kl)=>{"use strict";var El=tn();kl.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&El.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&El.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(e)}});var wl=E((IC,xl)=>{"use strict";xl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Dl=E((jC,$l)=>{"use strict";var Cl=wl(),bt=(e,t,r)=>{if(Cl(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Cl(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),i=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=e+":"+t+"="+o+i+s+a;if(bt.cache.hasOwnProperty(c))return bt.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(Math.abs(l-u)===1){let y=e+"|"+t;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let p=Pl(e)||Pl(t),d={min:e,max:t,a:l,b:u},g=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),l<0){let y=u<0?Math.abs(u):1;m=Al(y,Math.abs(l),d,n),l=d.a=0}return u>=0&&(g=Al(l,u,d,n)),d.negatives=m,d.positives=g,d.result=By(m,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+m.length>1&&(d.result=`(?:${d.result})`),bt.cache[c]=d,d.result};function By(e,t,r){let n=Ho(e,t,"-",!1,r)||[],o=Ho(t,e,"",!1,r)||[],i=Ho(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Hy(e,t){let r=1,n=1,o=Rl(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=Rl(e,r);for(o=Ol(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Ol(t+1,n)-1;return i=[...i],i.sort(Uy),i}function Vy(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Gy(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,l]=n[a];c===l?i+=c:c!=="0"||l!=="9"?i+=Wy(c,l,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Al(e,t,r,n){let o=Hy(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let l=o[c],u=Vy(String(s),String(l),n),p="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+Tl(a.count),s=l+1;continue}r.isPadded&&(p=qy(l,r,n)),u.string=p+u.pattern+Tl(u.count),i.push(u),s=l+1,a=u}return i}function Ho(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Sl(t,"string",a)&&i.push(r+a),n&&Sl(t,"string",a)&&i.push(r+a)}return i}function Gy(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Uy(e,t){return e>t?1:t>e?-1:0}function Sl(e,t,r){return e.some(n=>n[t]===r)}function Rl(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Ol(e,t){return e-e%Math.pow(10,t)}function Tl(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Wy(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Pl(e){return/^-?(0+)\d/.test(e)}function qy(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}bt.cache={};bt.clearCache=()=>bt.cache={};$l.exports=bt});var Uo=E((FC,Bl)=>{"use strict";var Yy=I("util"),Ll=Dl(),Nl=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Ky=e=>t=>e===!0?Number(t):String(t),Vo=e=>typeof e=="number"||typeof e=="string"&&e!=="",sr=e=>Number.isInteger(+e),Go=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Xy=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,zy=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},on=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Qy=(e,t,r)=>{e.negatives.sort((a,c)=>a<c?-1:a>c?1:0),e.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=t.capture?"":"?:",o="",i="",s;return e.positives.length&&(o=e.positives.map(a=>on(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>on(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},Il=(e,t,r,n)=>{if(r)return Ll(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},jl=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Ll(e,t,r)},Fl=(...e)=>new RangeError("Invalid range arguments: "+Yy.inspect(...e)),Ml=(e,t,r)=>{if(r.strictRanges===!0)throw Fl([e,t]);return[]},Jy=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Zy=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw Fl([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),l=String(r);r=Math.max(Math.abs(r),1);let u=Go(a)||Go(c)||Go(l),p=u?Math.max(a.length,c.length,l.length):0,d=u===!1&&Xy(e,t,n)===!1,g=n.transform||Ky(d);if(n.toRegex&&r===1)return Il(on(e,p),on(t,p),!0,n);let m={negatives:[],positives:[]},y=R=>m[R<0?"negatives":"positives"].push(Math.abs(R)),k=[],C=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?y(o):k.push(zy(g(o,C),p,d)),o=s?o-r:o+r,C++;return n.toRegex===!0?r>1?Qy(m,n,p):jl(k,null,{wrap:!1,...n}):k},eb=(e,t,r=1,n={})=>{if(!sr(e)&&e.length>1||!sr(t)&&t.length>1)return Ml(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),i=`${e}`.charCodeAt(0),s=`${t}`.charCodeAt(0),a=i>s,c=Math.min(i,s),l=Math.max(i,s);if(n.toRegex&&r===1)return Il(c,l,!1,n);let u=[],p=0;for(;a?i>=s:i<=s;)u.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?jl(u,null,{wrap:!1,options:n}):u},nn=(e,t,r,n={})=>{if(t==null&&Vo(e))return[e];if(!Vo(e)||!Vo(t))return Ml(e,t,n);if(typeof r=="function")return nn(e,t,1,{transform:r});if(Nl(r))return nn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,sr(r)?sr(e)&&sr(t)?Zy(e,t,r,o):eb(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Nl(r)?Jy(r,o):nn(e,t,1,r)};Bl.exports=nn});var Gl=E((MC,Vl)=>{"use strict";var tb=Uo(),Hl=tn(),rb=(e,t={})=>{let r=(n,o={})=>{let i=Hl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=Hl.reduce(n.nodes),p=tb(...u,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return u.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let u of n.nodes)l+=r(u,n);return l};return r(e)};Vl.exports=rb});var ql=E((BC,Wl)=>{"use strict";var nb=Uo(),Ul=rn(),Dt=tn(),vt=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Dt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(vt(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?vt(o,i,r):o+i);return Dt.flatten(n)},ob=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,i={})=>{o.queue=[];let s=i,a=i.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(o.invalid||o.dollar){a.push(vt(a.pop(),Ul(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(vt(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Dt.reduce(o.nodes);if(Dt.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=nb(...p,t);d.length===0&&(d=Ul(o,t)),a.push(vt(a.pop(),d)),o.nodes=[];return}let c=Dt.encloseBrace(o),l=o.queue,u=o;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&l.push(""),l.push("");continue}if(d.type==="close"){a.push(vt(a.pop(),l,c));continue}if(d.value&&d.type!=="open"){l.push(vt(l.pop(),d.value));continue}d.nodes&&n(d,o)}return l};return Dt.flatten(n(e))};Wl.exports=ob});var Kl=E((HC,Yl)=>{"use strict";Yl.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
31
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Zl=E((VC,Jl)=>{"use strict";var ib=rn(),{MAX_LENGTH:Xl,CHAR_BACKSLASH:Wo,CHAR_BACKTICK:sb,CHAR_COMMA:ab,CHAR_DOT:cb,CHAR_LEFT_PARENTHESES:lb,CHAR_RIGHT_PARENTHESES:ub,CHAR_LEFT_CURLY_BRACE:pb,CHAR_RIGHT_CURLY_BRACE:db,CHAR_LEFT_SQUARE_BRACKET:zl,CHAR_RIGHT_SQUARE_BRACKET:Ql,CHAR_DOUBLE_QUOTE:fb,CHAR_SINGLE_QUOTE:hb,CHAR_NO_BREAK_SPACE:mb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:gb}=Kl(),yb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Xl,r.maxLength):Xl;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},i=[o],s=o,a=o,c=0,l=e.length,u=0,p=0,d,g=()=>e[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return s.nodes.push(y),y.parent=s,y.prev=a,a=y,y};for(m({type:"bos"});u<l;)if(s=i[i.length-1],d=g(),!(d===gb||d===mb)){if(d===Wo){m({type:"text",value:(t.keepEscaping?d:"")+g()});continue}if(d===Ql){m({type:"text",value:"\\"+d});continue}if(d===zl){c++;let y;for(;u<l&&(y=g());){if(d+=y,y===zl){c++;continue}if(y===Wo){d+=g();continue}if(y===Ql&&(c--,c===0))break}m({type:"text",value:d});continue}if(d===lb){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:d});continue}if(d===ub){if(s.type!=="paren"){m({type:"text",value:d});continue}s=i.pop(),m({type:"text",value:d}),s=i[i.length-1];continue}if(d===fb||d===hb||d===sb){let y=d,k;for(t.keepQuotes!==!0&&(d="");u<l&&(k=g());){if(k===Wo){d+=k+g();continue}if(k===y){t.keepQuotes===!0&&(d+=k);break}d+=k}m({type:"text",value:d});continue}if(d===pb){p++;let k={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=m(k),i.push(s),m({type:"open",value:d});continue}if(d===db){if(s.type!=="brace"){m({type:"text",value:d});continue}let y="close";s=i.pop(),s.close=!0,m({type:y,value:d}),p--,s=i[i.length-1];continue}if(d===ab&&p>0){if(s.ranges>0){s.ranges=0;let y=s.nodes.shift();s.nodes=[y,{type:"text",value:ib(s)}]}m({type:"comma",value:d}),s.commas++;continue}if(d===cb&&p>0&&s.commas===0){let y=s.nodes;if(p===0||y.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){y.pop();let k=y[y.length-1];k.value+=a.value+d,a=k,s.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(C=>{C.nodes||(C.type==="open"&&(C.isOpen=!0),C.type==="close"&&(C.isClose=!0),C.nodes||(C.type="text"),C.invalid=!0)});let y=i[i.length-1],k=y.nodes.indexOf(s);y.nodes.splice(k,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};Jl.exports=yb});var ru=E((GC,tu)=>{"use strict";var eu=rn(),bb=Gl(),vb=ql(),_b=Zl(),Ee=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ee.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ee.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.parse=(e,t={})=>_b(e,t);Ee.stringify=(e,t={})=>eu(typeof e=="string"?Ee.parse(e,t):e,t);Ee.compile=(e,t={})=>(typeof e=="string"&&(e=Ee.parse(e,t)),bb(e,t));Ee.expand=(e,t={})=>{typeof e=="string"&&(e=Ee.parse(e,t));let r=vb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ee.compile(e,t):Ee.expand(e,t);tu.exports=Ee});var ar=E((UC,au)=>{"use strict";var Eb=I("path"),He="\\\\/",nu=`[^${He}]`,Xe="\\.",kb="\\+",xb="\\?",sn="\\/",wb="(?=.)",ou="[^/]",qo=`(?:${sn}|$)`,iu=`(?:^|${sn})`,Yo=`${Xe}{1,2}${qo}`,Cb=`(?!${Xe})`,Ab=`(?!${iu}${Yo})`,Sb=`(?!${Xe}{0,1}${qo})`,Rb=`(?!${Yo})`,Ob=`[^.${sn}]`,Tb=`${ou}*?`,su={DOT_LITERAL:Xe,PLUS_LITERAL:kb,QMARK_LITERAL:xb,SLASH_LITERAL:sn,ONE_CHAR:wb,QMARK:ou,END_ANCHOR:qo,DOTS_SLASH:Yo,NO_DOT:Cb,NO_DOTS:Ab,NO_DOT_SLASH:Sb,NO_DOTS_SLASH:Rb,QMARK_NO_DOT:Ob,STAR:Tb,START_ANCHOR:iu},Pb={...su,SLASH_LITERAL:`[${He}]`,QMARK:nu,STAR:`${nu}*?`,DOTS_SLASH:`${Xe}{1,2}(?:[${He}]|$)`,NO_DOT:`(?!${Xe})`,NO_DOTS:`(?!(?:^|[${He}])${Xe}{1,2}(?:[${He}]|$))`,NO_DOT_SLASH:`(?!${Xe}{0,1}(?:[${He}]|$))`,NO_DOTS_SLASH:`(?!${Xe}{1,2}(?:[${He}]|$))`,QMARK_NO_DOT:`[^.${He}]`,START_ANCHOR:`(?:^|[${He}])`,END_ANCHOR:`(?:[${He}]|$)`},$b={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};au.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$b,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Eb.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Pb:su}}});var cr=E(ve=>{"use strict";var Db=I("path"),Nb=process.platform==="win32",{REGEX_BACKSLASH:Lb,REGEX_REMOVE_BACKSLASH:Ib,REGEX_SPECIAL_CHARS:jb,REGEX_SPECIAL_CHARS_GLOBAL:Fb}=ar();ve.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ve.hasRegexChars=e=>jb.test(e);ve.isRegexChar=e=>e.length===1&&ve.hasRegexChars(e);ve.escapeRegex=e=>e.replace(Fb,"\\$1");ve.toPosixSlashes=e=>e.replace(Lb,"/");ve.removeBackslashes=e=>e.replace(Ib,t=>t==="\\"?"":t);ve.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ve.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Nb===!0||Db.sep==="\\";ve.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ve.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ve.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ve.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var mu=E((qC,hu)=>{"use strict";var cu=cr(),{CHAR_ASTERISK:Ko,CHAR_AT:Mb,CHAR_BACKWARD_SLASH:lr,CHAR_COMMA:Bb,CHAR_DOT:Xo,CHAR_EXCLAMATION_MARK:zo,CHAR_FORWARD_SLASH:fu,CHAR_LEFT_CURLY_BRACE:Qo,CHAR_LEFT_PARENTHESES:Jo,CHAR_LEFT_SQUARE_BRACKET:Hb,CHAR_PLUS:Vb,CHAR_QUESTION_MARK:lu,CHAR_RIGHT_CURLY_BRACE:Gb,CHAR_RIGHT_PARENTHESES:uu,CHAR_RIGHT_SQUARE_BRACKET:Ub}=ar(),pu=e=>e===fu||e===lr,du=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Wb=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,l=-1,u=0,p=0,d=!1,g=!1,m=!1,y=!1,k=!1,C=!1,R=!1,K=!1,xe=!1,N=!1,X=0,P,T,M={value:"",depth:0,isGlob:!1},le=()=>l>=n,_=()=>c.charCodeAt(l+1),z=()=>(P=T,c.charCodeAt(++l));for(;l<n;){T=z();let he;if(T===lr){R=M.backslashes=!0,T=z(),T===Qo&&(C=!0);continue}if(C===!0||T===Qo){for(X++;le()!==!0&&(T=z());){if(T===lr){R=M.backslashes=!0,z();continue}if(T===Qo){X++;continue}if(C!==!0&&T===Xo&&(T=z())===Xo){if(d=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(C!==!0&&T===Bb){if(d=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Gb&&(X--,X===0)){C=!1,d=M.isBrace=!0,N=!0;break}}if(o===!0)continue;break}if(T===fu){if(i.push(l),s.push(M),M={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===Xo&&l===u+1){u+=2;continue}p=l+1;continue}if(r.noext!==!0&&(T===Vb||T===Mb||T===Ko||T===lu||T===zo)===!0&&_()===Jo){if(m=M.isGlob=!0,y=M.isExtglob=!0,N=!0,T===zo&&l===u&&(xe=!0),o===!0){for(;le()!==!0&&(T=z());){if(T===lr){R=M.backslashes=!0,T=z();continue}if(T===uu){m=M.isGlob=!0,N=!0;break}}continue}break}if(T===Ko){if(P===Ko&&(k=M.isGlobstar=!0),m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===lu){if(m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Hb){for(;le()!==!0&&(he=z());){if(he===lr){R=M.backslashes=!0,z();continue}if(he===Ub){g=M.isBracket=!0,m=M.isGlob=!0,N=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&T===zo&&l===u){K=M.negated=!0,u++;continue}if(r.noparen!==!0&&T===Jo){if(m=M.isGlob=!0,o===!0){for(;le()!==!0&&(T=z());){if(T===Jo){R=M.backslashes=!0,T=z();continue}if(T===uu){N=!0;break}}continue}break}if(m===!0){if(N=!0,o===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let W=c,et="",b="";u>0&&(et=c.slice(0,u),c=c.slice(u),p-=u),W&&m===!0&&p>0?(W=c.slice(0,p),b=c.slice(p)):m===!0?(W="",b=c):W=c,W&&W!==""&&W!=="/"&&W!==c&&pu(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),r.unescape===!0&&(b&&(b=cu.removeBackslashes(b)),W&&R===!0&&(W=cu.removeBackslashes(W)));let v={prefix:et,input:e,start:u,base:W,glob:b,isBrace:d,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:k,negated:K,negatedExtglob:xe};if(r.tokens===!0&&(v.maxDepth=0,pu(T)||s.push(M),v.tokens=s),r.parts===!0||r.tokens===!0){let he;for(let j=0;j<i.length;j++){let Ie=he?he+1:u,je=i[j],_e=e.slice(Ie,je);r.tokens&&(j===0&&u!==0?(s[j].isPrefix=!0,s[j].value=et):s[j].value=_e,du(s[j]),v.maxDepth+=s[j].depth),(j!==0||_e!=="")&&a.push(_e),he=je}if(he&&he+1<e.length){let j=e.slice(he+1);a.push(j),r.tokens&&(s[s.length-1].value=j,du(s[s.length-1]),v.maxDepth+=s[s.length-1].depth)}v.slashes=i,v.parts=a}return v};hu.exports=Wb});var bu=E((YC,yu)=>{"use strict";var an=ar(),ke=cr(),{MAX_LENGTH:cn,POSIX_REGEX_SOURCE:qb,REGEX_NON_SPECIAL_CHARS:Yb,REGEX_SPECIAL_CHARS_BACKREF:Kb,REPLACEMENTS:gu}=an,Xb=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>ke.escapeRegex(o)).join("..")}return r},Nt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Zo=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=gu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(cn,r.maxLength):cn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},s=[i],a=r.capture?"":"?:",c=ke.isWindows(t),l=an.globChars(c),u=an.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:k,NO_DOT_SLASH:C,NO_DOTS_SLASH:R,QMARK:K,QMARK_NO_DOT:xe,STAR:N,START_ANCHOR:X}=l,P=w=>`(${a}(?:(?!${X}${w.dot?y:p}).)*?)`,T=r.dot?"":k,M=r.dot?K:xe,le=r.bash===!0?P(r):N;r.capture&&(le=`(${le})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};e=ke.removePrefix(e,_),o=e.length;let z=[],W=[],et=[],b=i,v,he=()=>_.index===o-1,j=_.peek=(w=1)=>e[_.index+w],Ie=_.advance=()=>e[++_.index]||"",je=()=>e.slice(_.index+1),_e=(w="",q=0)=>{_.consumed+=w,_.index+=q},Er=w=>{_.output+=w.output!=null?w.output:w.value,_e(w.value)},df=()=>{let w=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Ie(),_.start++,w++;return w%2===0?!1:(_.negated=!0,_.start++,!0)},kr=w=>{_[w]++,et.push(w)},ft=w=>{_[w]--,et.pop()},L=w=>{if(b.type==="globstar"){let q=_.braces>0&&(w.type==="comma"||w.type==="brace"),x=w.extglob===!0||z.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!q&&!x&&(_.output=_.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=le,_.output+=b.output)}if(z.length&&w.type!=="paren"&&(z[z.length-1].inner+=w.value),(w.value||w.output)&&Er(w),b&&b.type==="text"&&w.type==="text"){b.value+=w.value,b.output=(b.output||"")+w.value;return}w.prev=b,s.push(w),b=w},xr=(w,q)=>{let x={...u[q],conditions:1,inner:""};x.prev=b,x.parens=_.parens,x.output=_.output;let D=(r.capture?"(":"")+x.open;kr("parens"),L({type:w,value:q,output:_.output?"":m}),L({type:"paren",extglob:!0,value:Ie(),output:D}),z.push(x)},ff=w=>{let q=w.close+(r.capture?")":""),x;if(w.type==="negate"){let D=le;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(D=P(r)),(D!==le||he()||/^\)+$/.test(je()))&&(q=w.close=`)$))${D}`),w.inner.includes("*")&&(x=je())&&/^\.[^\\/.]+$/.test(x)){let Z=Zo(x,{...t,fastpaths:!1}).output;q=w.close=`)${Z})${D})`}w.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:v,output:q}),ft("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let w=!1,q=e.replace(Kb,(x,D,Z,me,ie,Bn)=>me==="\\"?(w=!0,x):me==="?"?D?D+me+(ie?K.repeat(ie.length):""):Bn===0?M+(ie?K.repeat(ie.length):""):K.repeat(Z.length):me==="."?p.repeat(Z.length):me==="*"?D?D+me+(ie?le:""):le:D?x:`\\${x}`);return w===!0&&(r.unescape===!0?q=q.replace(/\\/g,""):q=q.replace(/\\+/g,x=>x.length%2===0?"\\\\":x?"\\":"")),q===e&&r.contains===!0?(_.output=e,_):(_.output=ke.wrapOutput(q,_,t),_)}for(;!he();){if(v=Ie(),v==="\0")continue;if(v==="\\"){let x=j();if(x==="/"&&r.bash!==!0||x==="."||x===";")continue;if(!x){v+="\\",L({type:"text",value:v});continue}let D=/^\\+/.exec(je()),Z=0;if(D&&D[0].length>2&&(Z=D[0].length,_.index+=Z,Z%2!==0&&(v+="\\")),r.unescape===!0?v=Ie():v+=Ie(),_.brackets===0){L({type:"text",value:v});continue}}if(_.brackets>0&&(v!=="]"||b.value==="["||b.value==="[^")){if(r.posix!==!1&&v===":"){let x=b.value.slice(1);if(x.includes("[")&&(b.posix=!0,x.includes(":"))){let D=b.value.lastIndexOf("["),Z=b.value.slice(0,D),me=b.value.slice(D+2),ie=qb[me];if(ie){b.value=Z+ie,_.backtrack=!0,Ie(),!i.output&&s.indexOf(b)===1&&(i.output=m);continue}}}(v==="["&&j()!==":"||v==="-"&&j()==="]")&&(v=`\\${v}`),v==="]"&&(b.value==="["||b.value==="[^")&&(v=`\\${v}`),r.posix===!0&&v==="!"&&b.value==="["&&(v="^"),b.value+=v,Er({value:v});continue}if(_.quotes===1&&v!=='"'){v=ke.escapeRegex(v),b.value+=v,Er({value:v});continue}if(v==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:v});continue}if(v==="("){kr("parens"),L({type:"paren",value:v});continue}if(v===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Nt("opening","("));let x=z[z.length-1];if(x&&_.parens===x.parens+1){ff(z.pop());continue}L({type:"paren",value:v,output:_.parens?")":"\\)"}),ft("parens");continue}if(v==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Nt("closing","]"));v=`\\${v}`}else kr("brackets");L({type:"bracket",value:v});continue}if(v==="]"){if(r.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){L({type:"text",value:v,output:`\\${v}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Nt("opening","["));L({type:"text",value:v,output:`\\${v}`});continue}ft("brackets");let x=b.value.slice(1);if(b.posix!==!0&&x[0]==="^"&&!x.includes("/")&&(v=`/${v}`),b.value+=v,Er({value:v}),r.literalBrackets===!1||ke.hasRegexChars(x))continue;let D=ke.escapeRegex(b.value);if(_.output=_.output.slice(0,-b.value.length),r.literalBrackets===!0){_.output+=D,b.value=D;continue}b.value=`(${a}${D}|${b.value})`,_.output+=b.value;continue}if(v==="{"&&r.nobrace!==!0){kr("braces");let x={type:"brace",value:v,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};W.push(x),L(x);continue}if(v==="}"){let x=W[W.length-1];if(r.nobrace===!0||!x){L({type:"text",value:v,output:v});continue}let D=")";if(x.dots===!0){let Z=s.slice(),me=[];for(let ie=Z.length-1;ie>=0&&(s.pop(),Z[ie].type!=="brace");ie--)Z[ie].type!=="dots"&&me.unshift(Z[ie].value);D=Xb(me,r),_.backtrack=!0}if(x.comma!==!0&&x.dots!==!0){let Z=_.output.slice(0,x.outputIndex),me=_.tokens.slice(x.tokensIndex);x.value=x.output="\\{",v=D="\\}",_.output=Z;for(let ie of me)_.output+=ie.output||ie.value}L({type:"brace",value:v,output:D}),ft("braces"),W.pop();continue}if(v==="|"){z.length>0&&z[z.length-1].conditions++,L({type:"text",value:v});continue}if(v===","){let x=v,D=W[W.length-1];D&&et[et.length-1]==="braces"&&(D.comma=!0,x="|"),L({type:"comma",value:v,output:x});continue}if(v==="/"){if(b.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),b=i;continue}L({type:"slash",value:v,output:g});continue}if(v==="."){if(_.braces>0&&b.type==="dot"){b.value==="."&&(b.output=p);let x=W[W.length-1];b.type="dots",b.output+=v,b.value+=v,x.dots=!0;continue}if(_.braces+_.parens===0&&b.type!=="bos"&&b.type!=="slash"){L({type:"text",value:v,output:p});continue}L({type:"dot",value:v,output:p});continue}if(v==="?"){if(!(b&&b.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){xr("qmark",v);continue}if(b&&b.type==="paren"){let D=j(),Z=v;if(D==="<"&&!ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(je()))&&(Z=`\\${v}`),L({type:"text",value:v,output:Z});continue}if(r.dot!==!0&&(b.type==="slash"||b.type==="bos")){L({type:"qmark",value:v,output:xe});continue}L({type:"qmark",value:v,output:K});continue}if(v==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){xr("negate",v);continue}if(r.nonegate!==!0&&_.index===0){df();continue}}if(v==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){xr("plus",v);continue}if(b&&b.value==="("||r.regex===!1){L({type:"plus",value:v,output:d});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||_.parens>0){L({type:"plus",value:v});continue}L({type:"plus",value:d});continue}if(v==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){L({type:"at",extglob:!0,value:v,output:""});continue}L({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let x=Yb.exec(je());x&&(v+=x[0],_.index+=x[0].length),L({type:"text",value:v});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=v,b.output=le,_.backtrack=!0,_.globstar=!0,_e(v);continue}let w=je();if(r.noextglob!==!0&&/^\([^?]/.test(w)){xr("star",v);continue}if(b.type==="star"){if(r.noglobstar===!0){_e(v);continue}let x=b.prev,D=x.prev,Z=x.type==="slash"||x.type==="bos",me=D&&(D.type==="star"||D.type==="globstar");if(r.bash===!0&&(!Z||w[0]&&w[0]!=="/")){L({type:"star",value:v,output:""});continue}let ie=_.braces>0&&(x.type==="comma"||x.type==="brace"),Bn=z.length&&(x.type==="pipe"||x.type==="paren");if(!Z&&x.type!=="paren"&&!ie&&!Bn){L({type:"star",value:v,output:""});continue}for(;w.slice(0,3)==="/**";){let wr=e[_.index+4];if(wr&&wr!=="/")break;w=w.slice(3),_e("/**",3)}if(x.type==="bos"&&he()){b.type="globstar",b.value+=v,b.output=P(r),_.output=b.output,_.globstar=!0,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&!me&&he()){_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=P(r)+(r.strictSlashes?")":"|$)"),b.value+=v,_.globstar=!0,_.output+=x.output+b.output,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&w[0]==="/"){let wr=w[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=`${P(r)}${g}|${g}${wr})`,b.value+=v,_.output+=x.output+b.output,_.globstar=!0,_e(v+Ie()),L({type:"slash",value:"/",output:""});continue}if(x.type==="bos"&&w[0]==="/"){b.type="globstar",b.value+=v,b.output=`(?:^|${g}|${P(r)}${g})`,_.output=b.output,_.globstar=!0,_e(v+Ie()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-b.output.length),b.type="globstar",b.output=P(r),b.value+=v,_.output+=b.output,_.globstar=!0,_e(v);continue}let q={type:"star",value:v,output:le};if(r.bash===!0){q.output=".*?",(b.type==="bos"||b.type==="slash")&&(q.output=T+q.output),L(q);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&r.regex===!0){q.output=v,L(q);continue}(_.index===_.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(_.output+=C,b.output+=C):r.dot===!0?(_.output+=R,b.output+=R):(_.output+=T,b.output+=T),j()!=="*"&&(_.output+=m,b.output+=m)),L(q)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing","]"));_.output=ke.escapeLast(_.output,"["),ft("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing",")"));_.output=ke.escapeLast(_.output,"("),ft("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing","}"));_.output=ke.escapeLast(_.output,"{"),ft("braces")}if(r.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${g}?`}),_.backtrack===!0){_.output="";for(let w of _.tokens)_.output+=w.output!=null?w.output:w.value,w.suffix&&(_.output+=w.suffix)}return _};Zo.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(cn,r.maxLength):cn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=gu[e]||e;let i=ke.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:m}=an.globChars(i),y=r.dot?p:u,k=r.dot?d:u,C=r.capture?"":"?:",R={negated:!1,prefix:""},K=r.bash===!0?".*?":g;r.capture&&(K=`(${K})`);let xe=T=>T.noglobstar===!0?K:`(${C}(?:(?!${m}${T.dot?l:s}).)*?)`,N=T=>{switch(T){case"*":return`${y}${c}${K}`;case".*":return`${s}${c}${K}`;case"*.*":return`${y}${K}${s}${c}${K}`;case"*/*":return`${y}${K}${a}${c}${k}${K}`;case"**":return y+xe(r);case"**/*":return`(?:${y}${xe(r)}${a})?${k}${c}${K}`;case"**/*.*":return`(?:${y}${xe(r)}${a})?${k}${K}${s}${c}${K}`;case"**/.*":return`(?:${y}${xe(r)}${a})?${s}${c}${K}`;default:{let M=/^(.*?)\.(\w+)$/.exec(T);if(!M)return;let le=N(M[1]);return le?le+s+M[2]:void 0}}},X=ke.removePrefix(e,R),P=N(X);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};yu.exports=Zo});var _u=E((KC,vu)=>{"use strict";var zb=I("path"),Qb=mu(),ei=bu(),ti=cr(),Jb=ar(),Zb=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let u=e.map(d=>re(d,t,r));return d=>{for(let g of u){let m=g(d);if(m)return m}return!1}}let n=Zb(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},i=ti.isWindows(t),s=n?re.compileRe(e,t):re.makeRe(e,t,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(o.ignore){let u={...t,ignore:null,onMatch:null,onResult:null};c=re(o.ignore,u,r)}let l=(u,p=!1)=>{let{isMatch:d,match:g,output:m}=re.test(u,s,t,{glob:e,posix:i}),y={glob:e,state:a,regex:s,posix:i,input:u,output:m,match:g,isMatch:d};return typeof o.onResult=="function"&&o.onResult(y),d===!1?(y.isMatch=!1,p?y:!1):c(u)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,p?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),p?y:!0)};return r&&(l.state=a),l};re.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=r||{},s=i.format||(o?ti.toPosixSlashes:null),a=e===n,c=a&&s?s(e):e;return a===!1&&(c=s?s(e):e,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=re.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};re.matchBase=(e,t,r,n=ti.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(zb.basename(e));re.isMatch=(e,t,r)=>re(t,r)(e);re.parse=(e,t)=>Array.isArray(e)?e.map(r=>re.parse(r,t)):ei(e,{...t,fastpaths:!1});re.scan=(e,t)=>Qb(e,t);re.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},i=o.contains?"":"^",s=o.contains?"":"$",a=`${i}(?:${e.output})${s}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let c=re.toRegex(a,t);return n===!0&&(c.state=e),c};re.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=ei.fastpaths(e,t)),o.output||(o=ei(e,t)),re.compileRe(o,t,r,n)};re.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};re.constants=Jb;vu.exports=re});var ku=E((XC,Eu)=>{"use strict";Eu.exports=_u()});var Ru=E((zC,Su)=>{"use strict";var wu=I("util"),Cu=ru(),Ve=ku(),ri=cr(),xu=e=>e===""||e==="./",Au=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Y=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=u=>{i.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<t.length;u++){let p=Ve(String(t[u]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let g of e){let m=p(g,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let l=(s===t.length?[...i]:[...o]).filter(u=>!n.has(u));if(r&&l.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(u=>u.replace(/\\/g,"")):t}return l};Y.match=Y;Y.matcher=(e,t)=>Ve(e,t);Y.isMatch=(e,t,r)=>Ve(t,r)(e);Y.any=Y.isMatch;Y.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],i=a=>{r.onResult&&r.onResult(a),o.push(a.output)},s=new Set(Y(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};Y.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${wu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>Y.contains(e,n,r));if(typeof t=="string"){if(xu(e)||xu(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Y.isMatch(e,t,{...r,contains:!0})};Y.matchKeys=(e,t,r)=>{if(!ri.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=Y(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};Y.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Ve(String(o),r);if(n.some(s=>i(s)))return!0}return!1};Y.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Ve(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};Y.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${wu.inspect(e)}"`);return[].concat(t).every(n=>Ve(n,r)(e))};Y.capture=(e,t,r)=>{let n=ri.isWindows(r),i=Ve.makeRe(String(e),{...r,capture:!0}).exec(n?ri.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};Y.makeRe=(...e)=>Ve.makeRe(...e);Y.scan=(...e)=>Ve.scan(...e);Y.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of Cu(String(n),t))r.push(Ve.parse(o,t));return r};Y.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Au(e)?[e]:Cu(e,t)};Y.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Y.braces(e,{...t,expand:!0})};Y.hasBraces=Au;Su.exports=Y});var Fu=E(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.isAbsolute=O.partitionAbsoluteAndRelative=O.removeDuplicateSlashes=O.matchAny=O.convertPatternsToRe=O.makeRe=O.getPatternParts=O.expandBraceExpansion=O.expandPatternsWithBraceExpansion=O.isAffectDepthOfReadingPattern=O.endsWithSlashGlobStar=O.hasGlobStar=O.getBaseDirectory=O.isPatternRelatedToParentDirectory=O.getPatternsOutsideCurrentDirectory=O.getPatternsInsideCurrentDirectory=O.getPositivePatterns=O.getNegativePatterns=O.isPositivePattern=O.isNegativePattern=O.convertToNegativePattern=O.convertToPositivePattern=O.isDynamicPattern=O.isStaticPattern=void 0;var Ou=I("path"),ev=_l(),ni=Ru(),Tu="**",tv="\\",rv=/[*?]|^!/,nv=/\[[^[]*]/,ov=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,iv=/[!*+?@]\([^(]*\)/,sv=/,|\.\./,av=/(?!^)\/{2,}/g;function Pu(e,t={}){return!$u(e,t)}O.isStaticPattern=Pu;function $u(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(tv)||rv.test(e)||nv.test(e)||ov.test(e)||t.extglob!==!1&&iv.test(e)||t.braceExpansion!==!1&&cv(e))}O.isDynamicPattern=$u;function cv(e){let t=e.indexOf("{");if(t===-1)return!1;let r=e.indexOf("}",t+1);if(r===-1)return!1;let n=e.slice(t,r);return sv.test(n)}function lv(e){return ln(e)?e.slice(1):e}O.convertToPositivePattern=lv;function uv(e){return"!"+e}O.convertToNegativePattern=uv;function ln(e){return e.startsWith("!")&&e[1]!=="("}O.isNegativePattern=ln;function Du(e){return!ln(e)}O.isPositivePattern=Du;function pv(e){return e.filter(ln)}O.getNegativePatterns=pv;function dv(e){return e.filter(Du)}O.getPositivePatterns=dv;function fv(e){return e.filter(t=>!oi(t))}O.getPatternsInsideCurrentDirectory=fv;function hv(e){return e.filter(oi)}O.getPatternsOutsideCurrentDirectory=hv;function oi(e){return e.startsWith("..")||e.startsWith("./..")}O.isPatternRelatedToParentDirectory=oi;function mv(e){return ev(e,{flipBackslashes:!1})}O.getBaseDirectory=mv;function gv(e){return e.includes(Tu)}O.hasGlobStar=gv;function Nu(e){return e.endsWith("/"+Tu)}O.endsWithSlashGlobStar=Nu;function yv(e){let t=Ou.basename(e);return Nu(e)||Pu(t)}O.isAffectDepthOfReadingPattern=yv;function bv(e){return e.reduce((t,r)=>t.concat(Lu(r)),[])}O.expandPatternsWithBraceExpansion=bv;function Lu(e){let t=ni.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}O.expandBraceExpansion=Lu;function vv(e,t){let{parts:r}=ni.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return r.length===0&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}O.getPatternParts=vv;function Iu(e,t){return ni.makeRe(e,t)}O.makeRe=Iu;function _v(e,t){return e.map(r=>Iu(r,t))}O.convertPatternsToRe=_v;function Ev(e,t){return t.some(r=>r.test(e))}O.matchAny=Ev;function kv(e){return e.replace(av,"/")}O.removeDuplicateSlashes=kv;function xv(e){let t=[],r=[];for(let n of e)ju(n)?t.push(n):r.push(n);return[t,r]}O.partitionAbsoluteAndRelative=xv;function ju(e){return Ou.isAbsolute(e)}O.isAbsolute=ju});var Vu=E((JC,Hu)=>{"use strict";var wv=I("stream"),Mu=wv.PassThrough,Cv=Array.prototype.slice;Hu.exports=Av;function Av(){let e=[],t=Cv.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let o=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=Mu(n);function a(){for(let u=0,p=arguments.length;u<p;u++)e.push(Bu(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=e.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let p=u.length+1;function d(){--p>0||(r=!1,c())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",k),d()}function k(C){s.emit("error",C)}if(m._readableState.endEmitted)return d();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",k),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<u.length;m++)g(u[m]);d()}function l(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function Bu(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=Bu(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Mu(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var Uu=E(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.merge=void 0;var Sv=Vu();function Rv(e){let t=Sv(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Gu(e)),t.once("end",()=>Gu(e)),t}un.merge=Rv;function Gu(e){e.forEach(t=>t.emit("close"))}});var Wu=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.isEmpty=Lt.isString=void 0;function Ov(e){return typeof e=="string"}Lt.isString=Ov;function Tv(e){return e===""}Lt.isEmpty=Tv});var ze=E(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.string=de.stream=de.pattern=de.path=de.fs=de.errno=de.array=void 0;var Pv=al();de.array=Pv;var $v=cl();de.errno=$v;var Dv=ll();de.fs=Dv;var Nv=fl();de.path=Nv;var Lv=Fu();de.pattern=Lv;var Iv=Uu();de.stream=Iv;var jv=Wu();de.string=jv});var Xu=E(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.convertPatternGroupToTask=fe.convertPatternGroupsToTasks=fe.groupPatternsByBaseDirectory=fe.getNegativePatternsAsPositive=fe.getPositivePatterns=fe.convertPatternsToTasks=fe.generate=void 0;var $e=ze();function Fv(e,t){let r=qu(e,t),n=qu(t.ignore,t),o=Yu(r),i=Ku(r,n),s=o.filter(u=>$e.pattern.isStaticPattern(u,t)),a=o.filter(u=>$e.pattern.isDynamicPattern(u,t)),c=ii(s,i,!1),l=ii(a,i,!0);return c.concat(l)}fe.generate=Fv;function qu(e,t){let r=e;return t.braceExpansion&&(r=$e.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>$e.pattern.removeDuplicateSlashes(n))}function ii(e,t,r){let n=[],o=$e.pattern.getPatternsOutsideCurrentDirectory(e),i=$e.pattern.getPatternsInsideCurrentDirectory(e),s=si(o),a=si(i);return n.push(...ai(s,t,r)),"."in a?n.push(ci(".",i,t,r)):n.push(...ai(a,t,r)),n}fe.convertPatternsToTasks=ii;function Yu(e){return $e.pattern.getPositivePatterns(e)}fe.getPositivePatterns=Yu;function Ku(e,t){return $e.pattern.getNegativePatterns(e).concat(t).map($e.pattern.convertToPositivePattern)}fe.getNegativePatternsAsPositive=Ku;function si(e){let t={};return e.reduce((r,n)=>{let o=$e.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}fe.groupPatternsByBaseDirectory=si;function ai(e,t,r){return Object.keys(e).map(n=>ci(n,e[n],t,r))}fe.convertPatternGroupsToTasks=ai;function ci(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map($e.pattern.convertToNegativePattern))}}fe.convertPatternGroupToTask=ci});var Qu=E(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.read=void 0;function Mv(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){zu(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){li(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){zu(r,i);return}li(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),li(r,s)})})}pn.read=Mv;function zu(e,t){e(t)}function li(e,t){e(null,t)}});var Ju=E(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.read=void 0;function Bv(e,t){let r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw n}}dn.read=Bv});var Zu=E(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.createFileSystemAdapter=st.FILE_SYSTEM_ADAPTER=void 0;var fn=I("fs");st.FILE_SYSTEM_ADAPTER={lstat:fn.lstat,stat:fn.stat,lstatSync:fn.lstatSync,statSync:fn.statSync};function Hv(e){return e===void 0?st.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},st.FILE_SYSTEM_ADAPTER),e)}st.createFileSystemAdapter=Hv});var ep=E(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});var Vv=Zu(),ui=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=Vv.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,r){return t??r}};pi.default=ui});var _t=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.statSync=at.stat=at.Settings=void 0;var tp=Qu(),Gv=Ju(),di=ep();at.Settings=di.default;function Uv(e,t,r){if(typeof t=="function"){tp.read(e,fi(),t);return}tp.read(e,fi(t),r)}at.stat=Uv;function Wv(e,t){let r=fi(t);return Gv.read(e,r)}at.statSync=Wv;function fi(e={}){return e instanceof di.default?e:new di.default(e)}});var op=E((cA,np)=>{var rp;np.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(rp||(rp=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var sp=E((lA,ip)=>{ip.exports=Yv;var qv=op();function Yv(e,t){let r,n,o,i=!0;Array.isArray(e)?(r=[],n=e.length):(o=Object.keys(e),r={},n=o.length);function s(c){function l(){t&&t(c,r),t=null}i?qv(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(l)}n?o?o.forEach(function(c){e[c](function(l,u){a(c,l,u)})}):e.forEach(function(c,l){c(function(u,p){a(l,u,p)})}):s(null),i=!1}});var hi=E(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var hn=process.versions.node.split(".");if(hn[0]===void 0||hn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var ap=Number.parseInt(hn[0],10),Kv=Number.parseInt(hn[1],10),cp=10,Xv=10,zv=ap>cp,Qv=ap===cp&&Kv>=Xv;mn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=zv||Qv});var lp=E(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.createDirentFromStats=void 0;var mi=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Jv(e,t){return new mi(e,t)}gn.createDirentFromStats=Jv});var gi=E(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.fs=void 0;var Zv=lp();yn.fs=Zv});var yi=E(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.joinPathSegments=void 0;function e_(e,t,r){return e.endsWith(r)?e+t:e+r+t}bn.joinPathSegments=e_});var mp=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.readdir=ct.readdirWithFileTypes=ct.read=void 0;var t_=_t(),up=sp(),r_=hi(),pp=gi(),dp=yi();function n_(e,t,r){if(!t.stats&&r_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){fp(e,t,r);return}hp(e,t,r)}ct.read=n_;function fp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){vn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:dp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){bi(r,i);return}let s=i.map(a=>o_(a,t));up(s,(a,c)=>{if(a!==null){vn(r,a);return}bi(r,c)})})}ct.readdirWithFileTypes=fp;function o_(e,t){return r=>{if(!e.dirent.isSymbolicLink()){r(null,e);return}t.fs.stat(e.path,(n,o)=>{if(n!==null){if(t.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,e);return}e.dirent=pp.fs.createDirentFromStats(e.name,o),r(null,e)})}}function hp(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){vn(r,n);return}let i=o.map(s=>{let a=dp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{t_.stat(a,t.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let p={name:s,path:a,dirent:pp.fs.createDirentFromStats(s,u)};t.stats&&(p.stats=u),c(null,p)})}});up(i,(s,a)=>{if(s!==null){vn(r,s);return}bi(r,a)})})}ct.readdir=hp;function vn(e,t){e(t)}function bi(e,t){e(null,t)}});var _p=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.readdir=lt.readdirWithFileTypes=lt.read=void 0;var i_=_t(),s_=hi(),gp=gi(),yp=yi();function a_(e,t){return!t.stats&&s_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?bp(e,t):vp(e,t)}lt.read=a_;function bp(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:yp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=gp.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}lt.readdirWithFileTypes=bp;function vp(e,t){return t.fs.readdirSync(e).map(n=>{let o=yp.joinPathSegments(e,n,t.pathSegmentSeparator),i=i_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:gp.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}lt.readdir=vp});var Ep=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.createFileSystemAdapter=ut.FILE_SYSTEM_ADAPTER=void 0;var It=I("fs");ut.FILE_SYSTEM_ADAPTER={lstat:It.lstat,stat:It.stat,lstatSync:It.lstatSync,statSync:It.statSync,readdir:It.readdir,readdirSync:It.readdirSync};function c_(e){return e===void 0?ut.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ut.FILE_SYSTEM_ADAPTER),e)}ut.createFileSystemAdapter=c_});var kp=E(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var l_=I("path"),u_=_t(),p_=Ep(),vi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=p_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,l_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new u_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};_i.default=vi});var _n=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.Settings=pt.scandirSync=pt.scandir=void 0;var xp=mp(),d_=_p(),Ei=kp();pt.Settings=Ei.default;function f_(e,t,r){if(typeof t=="function"){xp.read(e,ki(),t);return}xp.read(e,ki(t),r)}pt.scandir=f_;function h_(e,t){let r=ki(t);return d_.read(e,r)}pt.scandirSync=h_;function ki(e={}){return e instanceof Ei.default?e:new Ei.default(e)}});var Cp=E((vA,wp)=>{"use strict";function m_(e){var t=new e,r=t;function n(){var i=t;return i.next?t=i.next:(t=new e,r=t),i.next=null,i}function o(i){r.next=i,r=i}return{get:n,release:o}}wp.exports=m_});var Sp=E((_A,xi)=>{"use strict";var g_=Cp();function Ap(e,t,r){if(typeof e=="function"&&(r=t,t=e,e=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=g_(y_),o=null,i=null,s=0,a=null,c={push:y,drain:Se,saturated:Se,pause:u,paused:!1,get concurrency(){return r},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=N,!c.paused)for(;o&&s<r;)s++,C()},running:l,resume:g,idle:m,length:p,getQueue:d,unshift:k,empty:Se,kill:R,killAndDrain:K,error:xe};return c;function l(){return s}function u(){c.paused=!0}function p(){for(var N=o,X=0;N;)N=N.next,X++;return X}function d(){for(var N=o,X=[];N;)X.push(N.value),N=N.next;return X}function g(){if(c.paused){if(c.paused=!1,o===null){s++,C();return}for(;o&&s<r;)s++,C()}}function m(){return s===0&&c.length()===0}function y(N,X){var P=n.get();P.context=e,P.release=C,P.value=N,P.callback=X||Se,P.errorHandler=a,s>=r||c.paused?i?(i.next=P,i=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function k(N,X){var P=n.get();P.context=e,P.release=C,P.value=N,P.callback=X||Se,P.errorHandler=a,s>=r||c.paused?o?(P.next=o,o=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function C(N){N&&n.release(N);var X=o;X&&s<=r?c.paused?s--:(i===o&&(i=null),o=X.next,X.next=null,t.call(e,X.value,X.worked),i===null&&c.empty()):--s===0&&c.drain()}function R(){o=null,i=null,c.drain=Se}function K(){o=null,i=null,c.drain(),c.drain=Se}function xe(N){a=N}}function Se(){}function y_(){this.value=null,this.callback=Se,this.next=null,this.release=Se,this.context=null,this.errorHandler=null;var e=this;this.worked=function(r,n){var o=e.callback,i=e.errorHandler,s=e.value;e.value=null,e.callback=Se,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function b_(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(u,p){t.call(this,u).then(function(d){p(null,d)},p)}var o=Ap(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=l,o;function a(u){var p=new Promise(function(d,g){i(u,function(m,y){if(m){g(m);return}d(y)})});return p.catch(Se),p}function c(u){var p=new Promise(function(d,g){s(u,function(m,y){if(m){g(m);return}d(y)})});return p.catch(Se),p}function l(){var u=new Promise(function(p){process.nextTick(function(){if(o.idle())p();else{var d=o.drain;o.drain=function(){typeof d=="function"&&d(),p(),o.drain=d}}})});return u}}xi.exports=Ap;xi.exports.promise=b_});var En=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.joinPathSegments=Ge.replacePathSegmentSeparator=Ge.isAppliedFilter=Ge.isFatalError=void 0;function v_(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ge.isFatalError=v_;function __(e,t){return e===null||e(t)}Ge.isAppliedFilter=__;function E_(e,t){return e.split(/[/\\]/).join(t)}Ge.replacePathSegmentSeparator=E_;function k_(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ge.joinPathSegments=k_});var Ai=E(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});var x_=En(),wi=class{constructor(t,r){this._root=t,this._settings=r,this._root=x_.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Ci.default=wi});var Oi=E(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});var w_=I("events"),C_=_n(),A_=Sp(),kn=En(),S_=Ai(),Si=class extends S_.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=C_.scandir,this._emitter=new w_.EventEmitter,this._queue=A_(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){let n={directory:t,base:r};this._queue.push(n,o=>{o!==null&&this._handleError(o)})}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,(n,o)=>{if(n!==null){r(n,void 0);return}for(let i of o)this._handleEntry(i,t.base);r(null,void 0)})}_handleError(t){this._isDestroyed||!kn.isFatalError(this._settings,t)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError)return;let n=t.path;r!==void 0&&(t.path=kn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),kn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&kn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};Ri.default=Si});var Rp=E(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});var R_=Oi(),Ti=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new R_.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{O_(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{T_(t,this._storage)}),this._reader.read()}};Pi.default=Ti;function O_(e,t){e(t)}function T_(e,t){e(null,t)}});var Op=E(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});var P_=I("stream"),$_=Oi(),$i=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new $_.default(this._root,this._settings),this._stream=new P_.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};Di.default=$i});var Tp=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var D_=_n(),xn=En(),N_=Ai(),Ni=class extends N_.default{constructor(){super(...arguments),this._scandir=D_.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(let t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,r){try{let n=this._scandir(t,this._settings.fsScandirSettings);for(let o of n)this._handleEntry(o,r)}catch(n){this._handleError(n)}}_handleError(t){if(xn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=xn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),xn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&xn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Li.default=Ni});var Pp=E(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});var L_=Tp(),Ii=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new L_.default(this._root,this._settings)}read(){return this._reader.read()}};ji.default=Ii});var $p=E(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});var I_=I("path"),j_=_n(),Fi=class{constructor(t={}){this._options=t,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,I_.sep),this.fsScandirSettings=new j_.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Mi.default=Fi});var Cn=E(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Settings=Ue.walkStream=Ue.walkSync=Ue.walk=void 0;var Dp=Rp(),F_=Op(),M_=Pp(),Bi=$p();Ue.Settings=Bi.default;function B_(e,t,r){if(typeof t=="function"){new Dp.default(e,wn()).read(t);return}new Dp.default(e,wn(t)).read(r)}Ue.walk=B_;function H_(e,t){let r=wn(t);return new M_.default(e,r).read()}Ue.walkSync=H_;function V_(e,t){let r=wn(t);return new F_.default(e,r).read()}Ue.walkStream=V_;function wn(e={}){return e instanceof Bi.default?e:new Bi.default(e)}});var An=E(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});var G_=I("path"),U_=_t(),Np=ze(),Hi=class{constructor(t){this._settings=t,this._fsStatSettings=new U_.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return G_.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Np.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Np.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};Vi.default=Hi});var Wi=E(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});var W_=I("stream"),q_=_t(),Y_=Cn(),K_=An(),Gi=class extends K_.default{constructor(){super(...arguments),this._walkStream=Y_.walkStream,this._stat=q_.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new W_.PassThrough({objectMode:!0});o._write=(i,s,a)=>this._getEntry(n[i],t[i],r).then(c=>{c!==null&&r.entryFilter(c)&&o.push(c),i===n.length-1&&o.end(),a()}).catch(a);for(let i=0;i<n.length;i++)o.write(i);return o}_getEntry(t,r,n){return this._getStat(t).then(o=>this._makeEntry(o,r)).catch(o=>{if(n.errorFilter(o))return null;throw o})}_getStat(t){return new Promise((r,n)=>{this._stat(t,this._fsStatSettings,(o,i)=>o===null?r(i):n(o))})}};Ui.default=Gi});var Lp=E(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});var X_=Cn(),z_=An(),Q_=Wi(),qi=class extends z_.default{constructor(){super(...arguments),this._walkAsync=X_.walk,this._readerStream=new Q_.default(this._settings)}dynamic(t,r){return new Promise((n,o)=>{this._walkAsync(t,r,(i,s)=>{i===null?n(s):o(i)})})}async static(t,r){let n=[],o=this._readerStream.static(t,r);return new Promise((i,s)=>{o.once("error",s),o.on("data",a=>n.push(a)),o.once("end",()=>i(n))})}};Yi.default=qi});var Ip=E(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var ur=ze(),Ki=class{constructor(t,r,n){this._patterns=t,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let t of this._patterns){let r=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:t,segments:r,sections:n})}}_getPatternSegments(t){return ur.pattern.getPatternParts(t,this._micromatchOptions).map(n=>ur.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:ur.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return ur.array.splitWhen(t,r=>r.dynamic&&ur.pattern.hasGlobStar(r.pattern))}};Xi.default=Ki});var jp=E(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var J_=Ip(),zi=class extends J_.default{match(t){let r=t.split("/"),n=r.length,o=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of o){let s=i.sections[0];if(!i.complete&&n>s.length||r.every((c,l)=>{let u=i.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};Qi.default=zi});var Fp=E(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var Sn=ze(),Z_=jp(),Ji=class{constructor(t,r){this._settings=t,this._micromatchOptions=r}getFilter(t,r,n){let o=this._getMatcher(r),i=this._getNegativePatternsRe(n);return s=>this._filter(t,s,o,i)}_getMatcher(t){return new Z_.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(Sn.pattern.isAffectDepthOfReadingPattern);return Sn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=Sn.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,o)}_isSkippedByDeep(t,r){return this._settings.deep===1/0?!1:this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){let n=r.split("/").length;if(t==="")return n;let o=t.split("/").length;return n-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!Sn.pattern.matchAny(t,r)}};Zi.default=Ji});var Mp=E(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var dt=ze(),es=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=dt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:dt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:dt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:dt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=dt.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;let o=this._isMatchToPatternsSet(n,r,t.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(n),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,r,n){return!(!this._isMatchToPatterns(t,r.positive.all,n)||this._isMatchToPatterns(t,r.negative.relative,n)||this._isMatchToAbsoluteNegative(t,r.negative.absolute,n))}_isMatchToAbsoluteNegative(t,r,n){if(r.length===0)return!1;let o=dt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=dt.pattern.matchAny(t,r);return!o&&n?dt.pattern.matchAny(t+"/",r):o}};ts.default=es});var Bp=E(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var eE=ze(),rs=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return eE.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};ns.default=rs});var Vp=E(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var Hp=ze(),os=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=Hp.path.makeAbsolute(this._settings.cwd,r),r=Hp.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};is.default=os});var Rn=E(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var tE=I("path"),rE=Fp(),nE=Mp(),oE=Bp(),iE=Vp(),ss=class{constructor(t){this._settings=t,this.errorFilter=new oE.default(this._settings),this.entryFilter=new nE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new rE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new iE.default(this._settings)}_getRootDirectory(t){return tE.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){let r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};as.default=ss});var Gp=E(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var sE=Lp(),aE=Rn(),cs=class extends aE.default{constructor(){super(...arguments),this._reader=new sE.default(this._settings)}async read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(r,t,n)).map(i=>n.transform(i))}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};ls.default=cs});var Up=E(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var cE=I("stream"),lE=Wi(),uE=Rn(),us=class extends uE.default{constructor(){super(...arguments),this._reader=new lE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new cE.Readable({objectMode:!0,read:()=>{}});return o.once("error",s=>i.emit("error",s)).on("data",s=>i.emit("data",n.transform(s))).once("end",()=>i.emit("end")),i.once("close",()=>o.destroy()),i}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};ps.default=us});var Wp=E(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var pE=_t(),dE=Cn(),fE=An(),ds=class extends fE.default{constructor(){super(...arguments),this._walkSync=dE.walkSync,this._statSync=pE.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){let n=[];for(let o of t){let i=this._getFullEntryPath(o),s=this._getEntry(i,o,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(t,r,n){try{let o=this._getStat(t);return this._makeEntry(o,r)}catch(o){if(n.errorFilter(o))return null;throw o}}_getStat(t){return this._statSync(t,this._fsStatSettings)}};fs.default=ds});var qp=E(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var hE=Wp(),mE=Rn(),hs=class extends mE.default{constructor(){super(...arguments),this._reader=new hE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(r,t,n).map(n.transform)}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};ms.default=hs});var Yp=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var jt=I("fs"),gE=I("os"),yE=Math.max(gE.cpus().length,1);Ft.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:jt.lstat,lstatSync:jt.lstatSync,stat:jt.stat,statSync:jt.statSync,readdir:jt.readdir,readdirSync:jt.readdirSync};var gs=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,yE),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===void 0?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},Ft.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};Ft.default=gs});var _s=E((WA,Xp)=>{"use strict";var Kp=Xu(),bE=Gp(),vE=Up(),_E=qp(),ys=Yp(),Re=ze();async function bs(e,t){De(e);let r=vs(e,bE.default,t),n=await Promise.all(r);return Re.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(l,u){De(l);let p=vs(l,_E.default,u);return Re.array.flatten(p)}e.sync=t;function r(l,u){De(l);let p=vs(l,vE.default,u);return Re.stream.merge(p)}e.stream=r;function n(l,u){De(l);let p=[].concat(l),d=new ys.default(u);return Kp.generate(p,d)}e.generateTasks=n;function o(l,u){De(l);let p=new ys.default(u);return Re.pattern.isDynamicPattern(l,p)}e.isDynamicPattern=o;function i(l){return De(l),Re.path.escape(l)}e.escapePath=i;function s(l){return De(l),Re.path.convertPathToPattern(l)}e.convertPathToPattern=s;let a;(function(l){function u(d){return De(d),Re.path.escapePosixPath(d)}l.escapePath=u;function p(d){return De(d),Re.path.convertPosixPathToPattern(d)}l.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(l){function u(d){return De(d),Re.path.escapeWindowsPath(d)}l.escapePath=u;function p(d){return De(d),Re.path.convertWindowsPathToPattern(d)}l.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(bs||(bs={}));function vs(e,t,r){let n=[].concat(e),o=new ys.default(r),i=Kp.generate(n,o),s=new t(o);return i.map(s.read,s)}function De(e){if(![].concat(e).every(n=>Re.string.isString(n)&&!Re.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Xp.exports=bs});import EE from"node:fs";import kE from"node:fs/promises";async function Es(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await kE[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function ks(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return EE[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var KA,zp,XA,zA,Qp,QA,Jp=tt(()=>{KA=Es.bind(void 0,"stat","isFile"),zp=Es.bind(void 0,"stat","isDirectory"),XA=Es.bind(void 0,"lstat","isSymbolicLink"),zA=ks.bind(void 0,"statSync","isFile"),Qp=ks.bind(void 0,"statSync","isDirectory"),QA=ks.bind(void 0,"lstatSync","isSymbolicLink")});var Zp=tt(()=>{});import{promisify as xE}from"node:util";import{execFile as wE,execFileSync as r0}from"node:child_process";import{fileURLToPath as CE}from"node:url";function pr(e){return e instanceof URL?CE(e):e}var o0,i0,xs=tt(()=>{Zp();o0=xE(wE);i0=10*1024*1024});var cd=E((c0,Pn)=>{function rd(e){return Array.isArray(e)?e:[e]}var AE=void 0,Cs="",ed=" ",ws="\\",SE=/^\s+$/,RE=/(?:[^\\]|^)\\$/,OE=/^\\!/,TE=/^\\#/,PE=/\r?\n/g,$E=/^\.{0,2}\/|^\.{1,2}$/,DE=/\/$/,Mt="/",nd="node-ignore";typeof Symbol<"u"&&(nd=Symbol.for("node-ignore"));var od=nd,Bt=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),NE=/([0-z])-([0-z])/g,id=()=>!1,LE=e=>e.replace(NE,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Cs),IE=e=>{let{length:t}=e;return e.slice(0,t-t%2)},jE=[[/^\uFEFF/,()=>Cs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?ed:Cs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+ed}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>ws],[/\\\\/g,()=>ws],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===ws?`\\[${r}${IE(n)}${o}`:o==="]"&&n.length%2===0?`[${LE(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],FE=/(^|\\\/)?\\\*$/,dr="regex",On="checkRegex",td="_",ME={[dr](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[On](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},BE=e=>jE.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Tn=e=>typeof e=="string",HE=e=>e&&Tn(e)&&!SE.test(e)&&!RE.test(e)&&e.indexOf("#")!==0,VE=e=>e.split(PE).filter(Boolean),As=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Bt(this,"body",n),Bt(this,"ignoreCase",o),Bt(this,"regexPrefix",s)}get regex(){let t=td+dr;return this[t]?this[t]:this._make(dr,t)}get checkRegex(){let t=td+On;return this[t]?this[t]:this._make(On,t)}_make(t,r){let n=this.regexPrefix.replace(FE,ME[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Bt(this,r,o)}},GE=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(OE,"!").replace(TE,"#");let i=BE(o);return new As(e,t,o,r,n,i)},Ss=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[od]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Tn(t)&&(t={pattern:t}),HE(t.pattern)){let r=GE(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,rd(Tn(t)?VE(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:l}=c;i===l&&o!==i||l&&!o&&!i&&!r||!c[n].test(t)||(o=!l,i=l,s=l?AE:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},UE=(e,t)=>{throw new t(e)},Qe=(e,t,r)=>Tn(e)?e?Qe.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),sd=e=>$E.test(e);Qe.isNotRelative=sd;Qe.convert=e=>e;var Rs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Bt(this,od,!0),this._rules=new Ss(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,r,n,o){let i=t&&Qe.convert(t);return Qe(i,t,this._strictPathCheck?UE:id),this._t(i,r,n,o)}checkIgnore(t){if(!DE.test(t))return this.test(t);let r=t.split(Mt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Mt)+Mt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,On)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Mt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,dr);let i=this._t(o.join(Mt)+Mt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,dr)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return rd(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Os=e=>new Rs(e),WE=e=>Qe(e&&Qe.convert(e),e,id),ad=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qe.convert=e;let t=/^[a-z]:\//i;Qe.isNotRelative=r=>t.test(r)||sd(r)};typeof process<"u"&&process.platform==="win32"&&ad();Pn.exports=Os;Os.default=Os;Pn.exports.isPathValid=WE;Bt(Pn.exports,Symbol.for("setupWindows"),ad)});function Ht(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var ld=tt(()=>{});var fr,Ts=tt(()=>{fr=e=>e[0]==="!"});import qE from"node:process";import YE from"node:fs";import KE from"node:fs/promises";import Vt from"node:path";var Ps,ud,XE,pd,$n,zE,QE,JE,dd,fd,hr,mr,hd,md,$s=tt(()=>{Ps=qt(_s(),1),ud=qt(cd(),1);ld();xs();Ts();XE=["**/node_modules","**/flow-typed","**/coverage","**/.git"],pd={absolute:!0,dot:!0},$n="**/.gitignore",zE=(e,t)=>fr(e)?"!"+Vt.posix.join(t,e.slice(1)):Vt.posix.join(t,e),QE=(e,t)=>{let r=Ht(Vt.relative(t,Vt.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>zE(n,r))},JE=(e,t)=>{if(t=Ht(t),Vt.isAbsolute(e)){if(Ht(e).startsWith(t))return Vt.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},dd=(e,t)=>{let r=e.flatMap(o=>QE(o,t)),n=(0,ud.default)().add(r);return o=>(o=pr(o),o=JE(o,t),o?n.ignores(Ht(o)):!1)},fd=(e={})=>({cwd:pr(e.cwd)??qE.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...XE]}),hr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=fd(t),s=await(0,Ps.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...pd}),a=await Promise.all(s.map(async c=>({filePath:c,content:await KE.readFile(c,"utf8")})));return dd(a,r)},mr=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=fd(t),a=Ps.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...pd}).map(c=>({filePath:c,content:YE.readFileSync(c,"utf8")}));return dd(a,r)},hd=e=>hr($n,e),md=e=>mr($n,e)});var Td={};vf(Td,{convertPathToPattern:()=>lk,generateGlobTasks:()=>ak,generateGlobTasksSync:()=>ck,globby:()=>nk,globbyStream:()=>ik,globbySync:()=>ok,isDynamicPattern:()=>sk,isGitIgnored:()=>hd,isGitIgnoredSync:()=>md,isIgnoredByIgnoreFiles:()=>hr,isIgnoredByIgnoreFilesSync:()=>mr});import bd from"node:process";import ZE from"node:fs";import Gt from"node:path";var Ut,ek,vd,_d,gd,yd,Ds,tk,Ed,kd,Dn,xd,rk,wd,Cd,Ad,Sd,Rd,Od,Ns,nk,ok,ik,sk,ak,ck,lk,Pd=tt(()=>{sl();Ut=qt(_s(),1);Jp();xs();$s();Ts();$s();ek=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},vd=(e,t)=>{let r=fr(e)?e.slice(1):e;return Gt.isAbsolute(r)?r:Gt.join(t,r)},_d=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>Gt.posix.join(e,`**/${Gt.extname(o)?o:`${o}${n}`}`)):[Gt.posix.join(e,`**${n?`/*${n}`:""}`)]},gd=async(e,{cwd:t=bd.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await zp(vd(i,t))?_d({directoryPath:i,files:r,extensions:n}):i))).flat(),yd=(e,{cwd:t=bd.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>Qp(vd(o,t))?_d({directoryPath:o,files:r,extensions:n}):o),Ds=e=>(e=[...new Set([e].flat())],ek(e),e),tk=e=>{if(!e)return;let t;try{t=ZE.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},Ed=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:pr(e.cwd)},tk(e.cwd),e),kd=e=>async(t,r)=>e(Ds(t),Ed(r)),Dn=e=>(t,r)=>e(Ds(t),Ed(r)),xd=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?Ds(t):[];return r&&n.push($n),n},rk=async e=>{let t=xd(e);return Cd(t.length>0&&await hr(t,e))},wd=e=>{let t=xd(e);return Cd(t.length>0&&mr(t,e))},Cd=e=>{let t=new Set;return r=>{let n=Gt.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Ad=(e,t)=>e.flat().filter(r=>t(r)),Sd=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>fr(i));if(n===-1){r.push({patterns:e,options:t});break}let o=e[n].slice(1);for(let i of r)i.options.ignore.push(o);n!==0&&r.push({patterns:e.slice(0,n),options:{...t,ignore:[...t.ignore,o]}}),e=e.slice(n+1)}return r},Rd=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Od=async(e,t)=>{let r=Sd(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Rd(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([gd(a,i),gd(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Ns=(e,t)=>{let r=Sd(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Rd(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=yd(a,i),c.ignore=yd(c.ignore,{cwd:n}),{patterns:a,options:c}})},nk=kd(async(e,t)=>{let[r,n]=await Promise.all([Od(e,t),rk(t)]),o=await Promise.all(r.map(i=>(0,Ut.default)(i.patterns,i.options)));return Ad(o,n)}),ok=Dn((e,t)=>{let r=Ns(e,t),n=wd(t),o=r.map(i=>Ut.default.sync(i.patterns,i.options));return Ad(o,n)}),ik=Dn((e,t)=>{let r=Ns(e,t),n=wd(t),o=r.map(s=>Ut.default.stream(s.patterns,s.options));return Io(o).filter(s=>n(s))}),sk=Dn((e,t)=>e.some(r=>Ut.default.isDynamicPattern(r,t))),ak=kd(Od),ck=Dn(Ns),{convertPathToPattern:lk}=Ut.default});var Ys=(e=0)=>t=>`\x1B[${t+e}m`,Ks=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Xs=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},xx=Object.keys(Q.modifier),Ef=Object.keys(Q.color),kf=Object.keys(Q.bgColor),wx=[...Ef,...kf];function xf(){let e=new Map;for(let[t,r]of Object.entries(Q)){for(let[n,o]of Object.entries(r))Q[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Q[n],e.set(o[0],o[1]);Object.defineProperty(Q,t,{value:r,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:e,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=Ys(),Q.color.ansi256=Ks(),Q.color.ansi16m=Xs(),Q.bgColor.ansi=Ys(10),Q.bgColor.ansi256=Ks(10),Q.bgColor.ansi16m=Xs(10),Object.defineProperties(Q,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>Q.rgbToAnsi256(...Q.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>Q.ansi256ToAnsi(Q.hexToAnsi256(t)),enumerable:!1}}),Q}var wf=xf(),Te=wf;import Vn from"node:process";import Cf from"node:os";import zs from"node:tty";function we(e,t=globalThis.Deno?globalThis.Deno.args:Vn.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:ee}=Vn,Cr;we("no-color")||we("no-colors")||we("color=false")||we("color=never")?Cr=0:(we("color")||we("colors")||we("color=true")||we("color=always"))&&(Cr=1);function Af(){if("FORCE_COLOR"in ee)return ee.FORCE_COLOR==="true"?1:ee.FORCE_COLOR==="false"?0:ee.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ee.FORCE_COLOR,10),3)}function Sf(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Rf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Af();n!==void 0&&(Cr=n);let o=r?Cr:n;if(o===0)return 0;if(r){if(we("color=16m")||we("color=full")||we("color=truecolor"))return 3;if(we("color=256"))return 2}if("TF_BUILD"in ee&&"AGENT_NAME"in ee)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(ee.TERM==="dumb")return i;if(Vn.platform==="win32"){let s=Cf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in ee)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in ee)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in ee)||ee.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in ee)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ee.TEAMCITY_VERSION)?1:0;if(ee.COLORTERM==="truecolor"||ee.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in ee){let s=Number.parseInt((ee.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ee.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ee.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ee.TERM)||"COLORTERM"in ee?1:i}function Qs(e,t={}){let r=Rf(e,{streamIsTTY:e&&e.isTTY,...t});return Sf(r)}var Of={stdout:Qs({isTTY:zs.isatty(1)}),stderr:Qs({isTTY:zs.isatty(2)})},Js=Of;function Zs(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function ea(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
|
|
28
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function la(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],o=i[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:t})}function io(){if(F.env.NO_COLOR||F.env.FORCE_COLOR==="0"||F.env.FORCE_COLOR==="false")return!1;if(F.env.FORCE_COLOR||F.env.CLICOLOR_FORCE!==void 0)return!0}so.Command=oo;so.useColor=io});var ha=E(Ce=>{var{Argument:pa}=Rr(),{Command:ao}=ua(),{CommanderError:Kf,InvalidArgumentError:da}=Xt(),{Help:Xf}=Qn(),{Option:fa}=to();Ce.program=new ao;Ce.createCommand=e=>new ao(e);Ce.createOption=(e,t)=>new fa(e,t);Ce.createArgument=(e,t)=>new pa(e,t);Ce.Command=ao;Ce.Option=fa;Ce.Argument=pa;Ce.Help=Xf;Ce.CommanderError=Kf;Ce.InvalidArgumentError=da;Ce.InvalidOptionArgumentError=da});var ya=E((Zx,zf)=>{zf.exports={name:"dotenv",version:"17.2.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var xa=E((ew,qe)=>{var co=I("fs"),Tr=I("path"),Qf=I("os"),Jf=I("crypto"),Zf=ya(),lo=Zf.version,ba=["\u{1F510} encrypt with dotenvx: https://dotenvx.com","\u{1F510} prevent committing .env to code: https://dotenvx.com/precommit","\u{1F510} prevent building .env in docker: https://dotenvx.com/prebuild","\u{1F6E0}\uFE0F run anywhere with `dotenvx run -- yourcommand`","\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }","\u2699\uFE0F enable debug logging with { debug: true }","\u2699\uFE0F override existing env vars with { override: true }","\u2699\uFE0F suppress all logs with { quiet: true }","\u2699\uFE0F write to custom object with { processEnv: myObject }","\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"];function eh(){return ba[Math.floor(Math.random()*ba.length)]}function xt(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function th(){return process.stdout.isTTY}function rh(e){return th()?`\x1B[2m${e}\x1B[0m`:e}var nh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function oh(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
29
|
+
`);let n;for(;(n=nh.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let s=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(i=i.replace(/\\n/g,`
|
|
30
|
+
`),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}function ih(e){e=e||{};let t=ka(e);e.path=t;let r=se.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=Ea(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=ah(r,a);i=se.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return se.parse(i)}function sh(e){console.error(`[dotenv@${lo}][WARN] ${e}`)}function zt(e){console.log(`[dotenv@${lo}][DEBUG] ${e}`)}function _a(e){console.log(`[dotenv@${lo}] ${e}`)}function Ea(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function ah(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let o=r.searchParams.get("environment");if(!o){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let i=`DOTENV_VAULT_${o.toUpperCase()}`,s=e.parsed[i];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function ka(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)co.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Tr.resolve(process.cwd(),".env.vault");return co.existsSync(t)?t:null}function va(e){return e[0]==="~"?Tr.join(Qf.homedir(),e.slice(1)):e}function ch(e){let t=xt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=xt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&_a("Loading env from encrypted .env.vault");let n=se._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),se.populate(o,n,e),{parsed:n}}function lh(e){let t=Tr.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=xt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=xt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&zt("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[va(e.path)];else{s=[];for(let u of e.path)s.push(va(u))}let a,c={};for(let u of s)try{let p=se.parse(co.readFileSync(u,{encoding:r}));se.populate(c,p,e)}catch(p){o&&zt(`Failed to load ${u} ${p.message}`),a=p}let l=se.populate(n,c,e);if(o=xt(n.DOTENV_CONFIG_DEBUG||o),i=xt(n.DOTENV_CONFIG_QUIET||i),o||!i){let u=Object.keys(l).length,p=[];for(let d of s)try{let g=Tr.relative(process.cwd(),d);p.push(g)}catch(g){o&&zt(`Failed to load ${d} ${g.message}`),a=g}_a(`injecting env (${u}) from ${p.join(",")} ${rh(`(tip: ${eh()})`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function uh(e){if(Ea(e).length===0)return se.configDotenv(e);let t=ka(e);return t?se._configVault(e):(sh(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),se.configDotenv(e))}function ph(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{let s=Jf.createDecipheriv("aes-256-gcm",r,o);return s.setAuthTag(i),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,c=s.message==="Invalid key length",l=s.message==="Unsupported state or unable to authenticate data";if(a||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw s}}function dh(e,t,r={}){let n=!!(r&&r.debug),o=!!(r&&r.override),i={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(o===!0&&(e[s]=t[s],i[s]=t[s]),n&&zt(o===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],i[s]=t[s]);return i}var se={configDotenv:lh,_configVault:ch,_parseVault:ih,config:uh,decrypt:ph,parse:oh,populate:dh};qe.exports.configDotenv=se.configDotenv;qe.exports._configVault=se._configVault;qe.exports._parseVault=se._parseVault;qe.exports.config=se.config;qe.exports.decrypt=se.decrypt;qe.exports.parse=se.parse;qe.exports.populate=se.populate;qe.exports=se});import{on as ny,once as oy}from"node:events";import{PassThrough as iy}from"node:stream";import{finished as el}from"node:stream/promises";function Lo(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Do(o);let t=e.some(({readableObjectMode:o})=>o),r=sy(e,t),n=new $o({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&nl(n),n}var sy,$o,ay,cy,ly,Do,uy,tl,py,dy,fy,rl,nl,No,ol,hy,Qr,Jc,Zc,il=tt(()=>{sy=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},$o=class extends iy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){Do(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=ay(this,this.#e),uy({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return Do(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},ay=async(e,t)=>{Qr(e,Jc);let r=new AbortController;try{await Promise.race([cy(e,r),ly(e,t,r)])}finally{r.abort(),Qr(e,-Jc)}},cy=async(e,{signal:t})=>{await el(e,{signal:t,cleanup:!0})},ly=async(e,t,{signal:r})=>{for await(let[n]of ny(e,"unpipe",{signal:r}))t.has(n)&&n.emit(rl)},Do=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},uy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{Qr(e,Zc);let s=new AbortController;try{await Promise.race([py(i,t),dy({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),fy({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),Qr(e,-Zc)}r.size===n.size+o.size&&(n.size===0&&o.size>0?No(e):nl(e))},tl=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",py=async(e,t)=>{try{await e,No(t)}catch(r){tl(r)?No(t):ol(t,r)}},dy=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await el(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;tl(s)?o.add(t):ol(e,s)}},fy=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await oy(e,rl,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},rl=Symbol("unpipe"),nl=e=>{e.writable&&e.end()},No=e=>{(e.readable||e.writable)&&e.destroy()},ol=(e,t)=>{e.destroyed||(e.once("error",hy),e.destroy(t))},hy=()=>{},Qr=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Jc=2,Zc=1});var sl=E($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.splitWhen=$t.flatten=void 0;function my(e){return e.reduce((t,r)=>[].concat(t,r),[])}$t.flatten=my;function gy(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}$t.splitWhen=gy});var al=E(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isEnoentCodeError=void 0;function yy(e){return e.code==="ENOENT"}Jr.isEnoentCodeError=yy});var cl=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.createDirentFromStats=void 0;var Io=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function by(e,t){return new Io(e,t)}Zr.createDirentFromStats=by});var dl=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.convertPosixPathToPattern=oe.convertWindowsPathToPattern=oe.convertPathToPattern=oe.escapePosixPath=oe.escapeWindowsPath=oe.escape=oe.removeLeadingDotSegment=oe.makeAbsolute=oe.unixify=void 0;var vy=I("os"),_y=I("path"),ll=vy.platform()==="win32",Ey=2,ky=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,xy=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,wy=/^\\\\([.?])/,Cy=/\\(?![!()+@[\]{}])/g;function Ay(e){return e.replace(/\\/g,"/")}oe.unixify=Ay;function Sy(e,t){return _y.resolve(e,t)}oe.makeAbsolute=Sy;function Ry(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(Ey)}return e}oe.removeLeadingDotSegment=Ry;oe.escape=ll?jo:Fo;function jo(e){return e.replace(xy,"\\$2")}oe.escapeWindowsPath=jo;function Fo(e){return e.replace(ky,"\\$2")}oe.escapePosixPath=Fo;oe.convertPathToPattern=ll?ul:pl;function ul(e){return jo(e).replace(wy,"//$1").replace(Cy,"/")}oe.convertWindowsPathToPattern=ul;function pl(e){return Fo(e)}oe.convertPosixPathToPattern=pl});var hl=E((TC,fl)=>{fl.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var yl=E((PC,gl)=>{var Oy=hl(),ml={"{":"}","(":")","[":"]"},Ty=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,o=-2,i=-2,s=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(s===-1||s>n||(s=e.indexOf("\\",t),s===-1||s>n)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(s=e.indexOf("\\",t),s===-1||s>o))||i!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(i=e.indexOf(")",t),i>t&&(s=e.indexOf("\\",t),s===-1||s>i))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(i=e.indexOf(")",r),i>r&&(s=e.indexOf("\\",r),s===-1||s>i))))return!0;if(e[t]==="\\"){var a=e[t+1];t+=2;var c=ml[a];if(c){var l=e.indexOf(c,t);l!==-1&&(t=l+1)}if(e[t]==="!")return!0}else t++}return!1},Py=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=ml[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};gl.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Oy(t))return!0;var n=Ty;return r&&r.strict===!1&&(n=Py),n(t)}});var vl=E(($C,bl)=>{"use strict";var $y=yl(),Dy=I("path").posix.dirname,Ny=I("os").platform()==="win32",Mo="/",Ly=/\\/g,Iy=/[\{\[].*[\}\]]$/,jy=/(^|[^\\])([\{\[]|\([^\)]+$)/,Fy=/\\([\!\*\?\|\[\]\(\)\{\}])/g;bl.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Ny&&t.indexOf(Mo)<0&&(t=t.replace(Ly,Mo)),Iy.test(t)&&(t+=Mo),t+="a";do t=Dy(t);while($y(t)||jy.test(t));return t.replace(Fy,"$1")}});var en=E(Ae=>{"use strict";Ae.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Ae.find=(e,t)=>e.nodes.find(r=>r.type===t);Ae.exceedsLimit=(e,t,r=1,n)=>n===!1||!Ae.isInteger(e)||!Ae.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Ae.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Ae.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Ae.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;Ae.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Ae.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Ae.flatten=(...e)=>{let t=[],r=n=>{for(let o=0;o<n.length;o++){let i=n[o];if(Array.isArray(i)){r(i);continue}i!==void 0&&t.push(i)}return t};return r(e),t}});var tn=E((NC,El)=>{"use strict";var _l=en();El.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&_l.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&_l.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(e)}});var xl=E((LC,kl)=>{"use strict";kl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var $l=E((IC,Pl)=>{"use strict";var wl=xl(),bt=(e,t,r)=>{if(wl(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(wl(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),i=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=e+":"+t+"="+o+i+s+a;if(bt.cache.hasOwnProperty(c))return bt.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(Math.abs(l-u)===1){let y=e+"|"+t;return n.capture?`(${y})`:n.wrap===!1?y:`(?:${y})`}let p=Tl(e)||Tl(t),d={min:e,max:t,a:l,b:u},g=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),l<0){let y=u<0?Math.abs(u):1;m=Cl(y,Math.abs(l),d,n),l=d.a=0}return u>=0&&(g=Cl(l,u,d,n)),d.negatives=m,d.positives=g,d.result=My(m,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+m.length>1&&(d.result=`(?:${d.result})`),bt.cache[c]=d,d.result};function My(e,t,r){let n=Bo(e,t,"-",!1,r)||[],o=Bo(t,e,"",!1,r)||[],i=Bo(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function By(e,t){let r=1,n=1,o=Sl(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=Sl(e,r);for(o=Rl(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Rl(t+1,n)-1;return i=[...i],i.sort(Gy),i}function Hy(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Vy(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,l]=n[a];c===l?i+=c:c!=="0"||l!=="9"?i+=Uy(c,l,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Cl(e,t,r,n){let o=By(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let l=o[c],u=Hy(String(s),String(l),n),p="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+Ol(a.count),s=l+1;continue}r.isPadded&&(p=Wy(l,r,n)),u.string=p+u.pattern+Ol(u.count),i.push(u),s=l+1,a=u}return i}function Bo(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Al(t,"string",a)&&i.push(r+a),n&&Al(t,"string",a)&&i.push(r+a)}return i}function Vy(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Gy(e,t){return e>t?1:t>e?-1:0}function Al(e,t,r){return e.some(n=>n[t]===r)}function Sl(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Rl(e,t){return e-e%Math.pow(10,t)}function Ol(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Uy(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Tl(e){return/^-?(0+)\d/.test(e)}function Wy(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}bt.cache={};bt.clearCache=()=>bt.cache={};Pl.exports=bt});var Go=E((jC,Ml)=>{"use strict";var qy=I("util"),Nl=$l(),Dl=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yy=e=>t=>e===!0?Number(t):String(t),Ho=e=>typeof e=="number"||typeof e=="string"&&e!=="",sr=e=>Number.isInteger(+e),Vo=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Ky=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Xy=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},nn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},zy=(e,t,r)=>{e.negatives.sort((a,c)=>a<c?-1:a>c?1:0),e.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=t.capture?"":"?:",o="",i="",s;return e.positives.length&&(o=e.positives.map(a=>nn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>nn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},Ll=(e,t,r,n)=>{if(r)return Nl(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},Il=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Nl(e,t,r)},jl=(...e)=>new RangeError("Invalid range arguments: "+qy.inspect(...e)),Fl=(e,t,r)=>{if(r.strictRanges===!0)throw jl([e,t]);return[]},Qy=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Jy=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw jl([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),l=String(r);r=Math.max(Math.abs(r),1);let u=Vo(a)||Vo(c)||Vo(l),p=u?Math.max(a.length,c.length,l.length):0,d=u===!1&&Ky(e,t,n)===!1,g=n.transform||Yy(d);if(n.toRegex&&r===1)return Ll(nn(e,p),nn(t,p),!0,n);let m={negatives:[],positives:[]},y=O=>m[O<0?"negatives":"positives"].push(Math.abs(O)),k=[],R=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?y(o):k.push(Xy(g(o,R),p,d)),o=s?o-r:o+r,R++;return n.toRegex===!0?r>1?zy(m,n,p):Il(k,null,{wrap:!1,...n}):k},Zy=(e,t,r=1,n={})=>{if(!sr(e)&&e.length>1||!sr(t)&&t.length>1)return Fl(e,t,n);let o=n.transform||(d=>String.fromCharCode(d)),i=`${e}`.charCodeAt(0),s=`${t}`.charCodeAt(0),a=i>s,c=Math.min(i,s),l=Math.max(i,s);if(n.toRegex&&r===1)return Ll(c,l,!1,n);let u=[],p=0;for(;a?i>=s:i<=s;)u.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?Il(u,null,{wrap:!1,options:n}):u},rn=(e,t,r,n={})=>{if(t==null&&Ho(e))return[e];if(!Ho(e)||!Ho(t))return Fl(e,t,n);if(typeof r=="function")return rn(e,t,1,{transform:r});if(Dl(r))return rn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,sr(r)?sr(e)&&sr(t)?Jy(e,t,r,o):Zy(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Dl(r)?Qy(r,o):rn(e,t,1,r)};Ml.exports=rn});var Vl=E((FC,Hl)=>{"use strict";var eb=Go(),Bl=en(),tb=(e,t={})=>{let r=(n,o={})=>{let i=Bl.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=Bl.reduce(n.nodes),p=eb(...u,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return u.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let u of n.nodes)l+=r(u,n);return l};return r(e)};Hl.exports=tb});var Wl=E((MC,Ul)=>{"use strict";var rb=Go(),Gl=tn(),Dt=en(),vt=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Dt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(vt(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?vt(o,i,r):o+i);return Dt.flatten(n)},nb=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(o,i={})=>{o.queue=[];let s=i,a=i.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(o.invalid||o.dollar){a.push(vt(a.pop(),Gl(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(vt(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Dt.reduce(o.nodes);if(Dt.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=rb(...p,t);d.length===0&&(d=Gl(o,t)),a.push(vt(a.pop(),d)),o.nodes=[];return}let c=Dt.encloseBrace(o),l=o.queue,u=o;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&l.push(""),l.push("");continue}if(d.type==="close"){a.push(vt(a.pop(),l,c));continue}if(d.value&&d.type!=="open"){l.push(vt(l.pop(),d.value));continue}d.nodes&&n(d,o)}return l};return Dt.flatten(n(e))};Ul.exports=nb});var Yl=E((BC,ql)=>{"use strict";ql.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
31
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Jl=E((HC,Ql)=>{"use strict";var ob=tn(),{MAX_LENGTH:Kl,CHAR_BACKSLASH:Uo,CHAR_BACKTICK:ib,CHAR_COMMA:sb,CHAR_DOT:ab,CHAR_LEFT_PARENTHESES:cb,CHAR_RIGHT_PARENTHESES:lb,CHAR_LEFT_CURLY_BRACE:ub,CHAR_RIGHT_CURLY_BRACE:pb,CHAR_LEFT_SQUARE_BRACKET:Xl,CHAR_RIGHT_SQUARE_BRACKET:zl,CHAR_DOUBLE_QUOTE:db,CHAR_SINGLE_QUOTE:fb,CHAR_NO_BREAK_SPACE:hb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:mb}=Yl(),gb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Kl,r.maxLength):Kl;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let o={type:"root",input:e,nodes:[]},i=[o],s=o,a=o,c=0,l=e.length,u=0,p=0,d,g=()=>e[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return s.nodes.push(y),y.parent=s,y.prev=a,a=y,y};for(m({type:"bos"});u<l;)if(s=i[i.length-1],d=g(),!(d===mb||d===hb)){if(d===Uo){m({type:"text",value:(t.keepEscaping?d:"")+g()});continue}if(d===zl){m({type:"text",value:"\\"+d});continue}if(d===Xl){c++;let y;for(;u<l&&(y=g());){if(d+=y,y===Xl){c++;continue}if(y===Uo){d+=g();continue}if(y===zl&&(c--,c===0))break}m({type:"text",value:d});continue}if(d===cb){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:d});continue}if(d===lb){if(s.type!=="paren"){m({type:"text",value:d});continue}s=i.pop(),m({type:"text",value:d}),s=i[i.length-1];continue}if(d===db||d===fb||d===ib){let y=d,k;for(t.keepQuotes!==!0&&(d="");u<l&&(k=g());){if(k===Uo){d+=k+g();continue}if(k===y){t.keepQuotes===!0&&(d+=k);break}d+=k}m({type:"text",value:d});continue}if(d===ub){p++;let k={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=m(k),i.push(s),m({type:"open",value:d});continue}if(d===pb){if(s.type!=="brace"){m({type:"text",value:d});continue}let y="close";s=i.pop(),s.close=!0,m({type:y,value:d}),p--,s=i[i.length-1];continue}if(d===sb&&p>0){if(s.ranges>0){s.ranges=0;let y=s.nodes.shift();s.nodes=[y,{type:"text",value:ob(s)}]}m({type:"comma",value:d}),s.commas++;continue}if(d===ab&&p>0&&s.commas===0){let y=s.nodes;if(p===0||y.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(s.range=[],a.value+=d,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){y.pop();let k=y[y.length-1];k.value+=a.value+d,a=k,s.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let y=i[i.length-1],k=y.nodes.indexOf(s);y.nodes.splice(k,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};Ql.exports=gb});var tu=E((VC,eu)=>{"use strict";var Zl=tn(),yb=Vl(),bb=Wl(),vb=Jl(),Ee=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ee.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ee.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.parse=(e,t={})=>vb(e,t);Ee.stringify=(e,t={})=>Zl(typeof e=="string"?Ee.parse(e,t):e,t);Ee.compile=(e,t={})=>(typeof e=="string"&&(e=Ee.parse(e,t)),yb(e,t));Ee.expand=(e,t={})=>{typeof e=="string"&&(e=Ee.parse(e,t));let r=bb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ee.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ee.compile(e,t):Ee.expand(e,t);eu.exports=Ee});var ar=E((GC,su)=>{"use strict";var _b=I("path"),He="\\\\/",ru=`[^${He}]`,Xe="\\.",Eb="\\+",kb="\\?",on="\\/",xb="(?=.)",nu="[^/]",Wo=`(?:${on}|$)`,ou=`(?:^|${on})`,qo=`${Xe}{1,2}${Wo}`,wb=`(?!${Xe})`,Cb=`(?!${ou}${qo})`,Ab=`(?!${Xe}{0,1}${Wo})`,Sb=`(?!${qo})`,Rb=`[^.${on}]`,Ob=`${nu}*?`,iu={DOT_LITERAL:Xe,PLUS_LITERAL:Eb,QMARK_LITERAL:kb,SLASH_LITERAL:on,ONE_CHAR:xb,QMARK:nu,END_ANCHOR:Wo,DOTS_SLASH:qo,NO_DOT:wb,NO_DOTS:Cb,NO_DOT_SLASH:Ab,NO_DOTS_SLASH:Sb,QMARK_NO_DOT:Rb,STAR:Ob,START_ANCHOR:ou},Tb={...iu,SLASH_LITERAL:`[${He}]`,QMARK:ru,STAR:`${ru}*?`,DOTS_SLASH:`${Xe}{1,2}(?:[${He}]|$)`,NO_DOT:`(?!${Xe})`,NO_DOTS:`(?!(?:^|[${He}])${Xe}{1,2}(?:[${He}]|$))`,NO_DOT_SLASH:`(?!${Xe}{0,1}(?:[${He}]|$))`,NO_DOTS_SLASH:`(?!${Xe}{1,2}(?:[${He}]|$))`,QMARK_NO_DOT:`[^.${He}]`,START_ANCHOR:`(?:^|[${He}])`,END_ANCHOR:`(?:[${He}]|$)`},Pb={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};su.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Pb,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:_b.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Tb:iu}}});var cr=E(ve=>{"use strict";var $b=I("path"),Db=process.platform==="win32",{REGEX_BACKSLASH:Nb,REGEX_REMOVE_BACKSLASH:Lb,REGEX_SPECIAL_CHARS:Ib,REGEX_SPECIAL_CHARS_GLOBAL:jb}=ar();ve.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ve.hasRegexChars=e=>Ib.test(e);ve.isRegexChar=e=>e.length===1&&ve.hasRegexChars(e);ve.escapeRegex=e=>e.replace(jb,"\\$1");ve.toPosixSlashes=e=>e.replace(Nb,"/");ve.removeBackslashes=e=>e.replace(Lb,t=>t==="\\"?"":t);ve.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ve.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Db===!0||$b.sep==="\\";ve.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ve.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ve.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ve.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var hu=E((WC,fu)=>{"use strict";var au=cr(),{CHAR_ASTERISK:Yo,CHAR_AT:Fb,CHAR_BACKWARD_SLASH:lr,CHAR_COMMA:Mb,CHAR_DOT:Ko,CHAR_EXCLAMATION_MARK:Xo,CHAR_FORWARD_SLASH:du,CHAR_LEFT_CURLY_BRACE:zo,CHAR_LEFT_PARENTHESES:Qo,CHAR_LEFT_SQUARE_BRACKET:Bb,CHAR_PLUS:Hb,CHAR_QUESTION_MARK:cu,CHAR_RIGHT_CURLY_BRACE:Vb,CHAR_RIGHT_PARENTHESES:lu,CHAR_RIGHT_SQUARE_BRACKET:Gb}=ar(),uu=e=>e===du||e===lr,pu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},Ub=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,l=-1,u=0,p=0,d=!1,g=!1,m=!1,y=!1,k=!1,R=!1,O=!1,K=!1,xe=!1,N=!1,X=0,P,T,M={value:"",depth:0,isGlob:!1},le=()=>l>=n,_=()=>c.charCodeAt(l+1),z=()=>(P=T,c.charCodeAt(++l));for(;l<n;){T=z();let he;if(T===lr){O=M.backslashes=!0,T=z(),T===zo&&(R=!0);continue}if(R===!0||T===zo){for(X++;le()!==!0&&(T=z());){if(T===lr){O=M.backslashes=!0,z();continue}if(T===zo){X++;continue}if(R!==!0&&T===Ko&&(T=z())===Ko){if(d=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(R!==!0&&T===Mb){if(d=M.isBrace=!0,m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Vb&&(X--,X===0)){R=!1,d=M.isBrace=!0,N=!0;break}}if(o===!0)continue;break}if(T===du){if(i.push(l),s.push(M),M={value:"",depth:0,isGlob:!1},N===!0)continue;if(P===Ko&&l===u+1){u+=2;continue}p=l+1;continue}if(r.noext!==!0&&(T===Hb||T===Fb||T===Yo||T===cu||T===Xo)===!0&&_()===Qo){if(m=M.isGlob=!0,y=M.isExtglob=!0,N=!0,T===Xo&&l===u&&(xe=!0),o===!0){for(;le()!==!0&&(T=z());){if(T===lr){O=M.backslashes=!0,T=z();continue}if(T===lu){m=M.isGlob=!0,N=!0;break}}continue}break}if(T===Yo){if(P===Yo&&(k=M.isGlobstar=!0),m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===cu){if(m=M.isGlob=!0,N=!0,o===!0)continue;break}if(T===Bb){for(;le()!==!0&&(he=z());){if(he===lr){O=M.backslashes=!0,z();continue}if(he===Gb){g=M.isBracket=!0,m=M.isGlob=!0,N=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&T===Xo&&l===u){K=M.negated=!0,u++;continue}if(r.noparen!==!0&&T===Qo){if(m=M.isGlob=!0,o===!0){for(;le()!==!0&&(T=z());){if(T===Qo){O=M.backslashes=!0,T=z();continue}if(T===lu){N=!0;break}}continue}break}if(m===!0){if(N=!0,o===!0)continue;break}}r.noext===!0&&(y=!1,m=!1);let W=c,et="",b="";u>0&&(et=c.slice(0,u),c=c.slice(u),p-=u),W&&m===!0&&p>0?(W=c.slice(0,p),b=c.slice(p)):m===!0?(W="",b=c):W=c,W&&W!==""&&W!=="/"&&W!==c&&uu(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),r.unescape===!0&&(b&&(b=au.removeBackslashes(b)),W&&O===!0&&(W=au.removeBackslashes(W)));let v={prefix:et,input:e,start:u,base:W,glob:b,isBrace:d,isBracket:g,isGlob:m,isExtglob:y,isGlobstar:k,negated:K,negatedExtglob:xe};if(r.tokens===!0&&(v.maxDepth=0,uu(T)||s.push(M),v.tokens=s),r.parts===!0||r.tokens===!0){let he;for(let j=0;j<i.length;j++){let Ie=he?he+1:u,je=i[j],_e=e.slice(Ie,je);r.tokens&&(j===0&&u!==0?(s[j].isPrefix=!0,s[j].value=et):s[j].value=_e,pu(s[j]),v.maxDepth+=s[j].depth),(j!==0||_e!=="")&&a.push(_e),he=je}if(he&&he+1<e.length){let j=e.slice(he+1);a.push(j),r.tokens&&(s[s.length-1].value=j,pu(s[s.length-1]),v.maxDepth+=s[s.length-1].depth)}v.slashes=i,v.parts=a}return v};fu.exports=Ub});var yu=E((qC,gu)=>{"use strict";var sn=ar(),ke=cr(),{MAX_LENGTH:an,POSIX_REGEX_SOURCE:Wb,REGEX_NON_SPECIAL_CHARS:qb,REGEX_SPECIAL_CHARS_BACKREF:Yb,REPLACEMENTS:mu}=sn,Kb=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(o=>ke.escapeRegex(o)).join("..")}return r},Nt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Jo=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=mu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(an,r.maxLength):an,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},s=[i],a=r.capture?"":"?:",c=ke.isWindows(t),l=sn.globChars(c),u=sn.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:y,NO_DOT:k,NO_DOT_SLASH:R,NO_DOTS_SLASH:O,QMARK:K,QMARK_NO_DOT:xe,STAR:N,START_ANCHOR:X}=l,P=w=>`(${a}(?:(?!${X}${w.dot?y:p}).)*?)`,T=r.dot?"":k,M=r.dot?K:xe,le=r.bash===!0?P(r):N;r.capture&&(le=`(${le})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};e=ke.removePrefix(e,_),o=e.length;let z=[],W=[],et=[],b=i,v,he=()=>_.index===o-1,j=_.peek=(w=1)=>e[_.index+w],Ie=_.advance=()=>e[++_.index]||"",je=()=>e.slice(_.index+1),_e=(w="",q=0)=>{_.consumed+=w,_.index+=q},Er=w=>{_.output+=w.output!=null?w.output:w.value,_e(w.value)},pf=()=>{let w=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Ie(),_.start++,w++;return w%2===0?!1:(_.negated=!0,_.start++,!0)},kr=w=>{_[w]++,et.push(w)},ft=w=>{_[w]--,et.pop()},L=w=>{if(b.type==="globstar"){let q=_.braces>0&&(w.type==="comma"||w.type==="brace"),x=w.extglob===!0||z.length&&(w.type==="pipe"||w.type==="paren");w.type!=="slash"&&w.type!=="paren"&&!q&&!x&&(_.output=_.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=le,_.output+=b.output)}if(z.length&&w.type!=="paren"&&(z[z.length-1].inner+=w.value),(w.value||w.output)&&Er(w),b&&b.type==="text"&&w.type==="text"){b.value+=w.value,b.output=(b.output||"")+w.value;return}w.prev=b,s.push(w),b=w},xr=(w,q)=>{let x={...u[q],conditions:1,inner:""};x.prev=b,x.parens=_.parens,x.output=_.output;let D=(r.capture?"(":"")+x.open;kr("parens"),L({type:w,value:q,output:_.output?"":m}),L({type:"paren",extglob:!0,value:Ie(),output:D}),z.push(x)},df=w=>{let q=w.close+(r.capture?")":""),x;if(w.type==="negate"){let D=le;if(w.inner&&w.inner.length>1&&w.inner.includes("/")&&(D=P(r)),(D!==le||he()||/^\)+$/.test(je()))&&(q=w.close=`)$))${D}`),w.inner.includes("*")&&(x=je())&&/^\.[^\\/.]+$/.test(x)){let ee=Jo(x,{...t,fastpaths:!1}).output;q=w.close=`)${ee})${D})`}w.prev.type==="bos"&&(_.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:v,output:q}),ft("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let w=!1,q=e.replace(Yb,(x,D,ee,me,ie,Mn)=>me==="\\"?(w=!0,x):me==="?"?D?D+me+(ie?K.repeat(ie.length):""):Mn===0?M+(ie?K.repeat(ie.length):""):K.repeat(ee.length):me==="."?p.repeat(ee.length):me==="*"?D?D+me+(ie?le:""):le:D?x:`\\${x}`);return w===!0&&(r.unescape===!0?q=q.replace(/\\/g,""):q=q.replace(/\\+/g,x=>x.length%2===0?"\\\\":x?"\\":"")),q===e&&r.contains===!0?(_.output=e,_):(_.output=ke.wrapOutput(q,_,t),_)}for(;!he();){if(v=Ie(),v==="\0")continue;if(v==="\\"){let x=j();if(x==="/"&&r.bash!==!0||x==="."||x===";")continue;if(!x){v+="\\",L({type:"text",value:v});continue}let D=/^\\+/.exec(je()),ee=0;if(D&&D[0].length>2&&(ee=D[0].length,_.index+=ee,ee%2!==0&&(v+="\\")),r.unescape===!0?v=Ie():v+=Ie(),_.brackets===0){L({type:"text",value:v});continue}}if(_.brackets>0&&(v!=="]"||b.value==="["||b.value==="[^")){if(r.posix!==!1&&v===":"){let x=b.value.slice(1);if(x.includes("[")&&(b.posix=!0,x.includes(":"))){let D=b.value.lastIndexOf("["),ee=b.value.slice(0,D),me=b.value.slice(D+2),ie=Wb[me];if(ie){b.value=ee+ie,_.backtrack=!0,Ie(),!i.output&&s.indexOf(b)===1&&(i.output=m);continue}}}(v==="["&&j()!==":"||v==="-"&&j()==="]")&&(v=`\\${v}`),v==="]"&&(b.value==="["||b.value==="[^")&&(v=`\\${v}`),r.posix===!0&&v==="!"&&b.value==="["&&(v="^"),b.value+=v,Er({value:v});continue}if(_.quotes===1&&v!=='"'){v=ke.escapeRegex(v),b.value+=v,Er({value:v});continue}if(v==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:v});continue}if(v==="("){kr("parens"),L({type:"paren",value:v});continue}if(v===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Nt("opening","("));let x=z[z.length-1];if(x&&_.parens===x.parens+1){df(z.pop());continue}L({type:"paren",value:v,output:_.parens?")":"\\)"}),ft("parens");continue}if(v==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Nt("closing","]"));v=`\\${v}`}else kr("brackets");L({type:"bracket",value:v});continue}if(v==="]"){if(r.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){L({type:"text",value:v,output:`\\${v}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Nt("opening","["));L({type:"text",value:v,output:`\\${v}`});continue}ft("brackets");let x=b.value.slice(1);if(b.posix!==!0&&x[0]==="^"&&!x.includes("/")&&(v=`/${v}`),b.value+=v,Er({value:v}),r.literalBrackets===!1||ke.hasRegexChars(x))continue;let D=ke.escapeRegex(b.value);if(_.output=_.output.slice(0,-b.value.length),r.literalBrackets===!0){_.output+=D,b.value=D;continue}b.value=`(${a}${D}|${b.value})`,_.output+=b.value;continue}if(v==="{"&&r.nobrace!==!0){kr("braces");let x={type:"brace",value:v,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};W.push(x),L(x);continue}if(v==="}"){let x=W[W.length-1];if(r.nobrace===!0||!x){L({type:"text",value:v,output:v});continue}let D=")";if(x.dots===!0){let ee=s.slice(),me=[];for(let ie=ee.length-1;ie>=0&&(s.pop(),ee[ie].type!=="brace");ie--)ee[ie].type!=="dots"&&me.unshift(ee[ie].value);D=Kb(me,r),_.backtrack=!0}if(x.comma!==!0&&x.dots!==!0){let ee=_.output.slice(0,x.outputIndex),me=_.tokens.slice(x.tokensIndex);x.value=x.output="\\{",v=D="\\}",_.output=ee;for(let ie of me)_.output+=ie.output||ie.value}L({type:"brace",value:v,output:D}),ft("braces"),W.pop();continue}if(v==="|"){z.length>0&&z[z.length-1].conditions++,L({type:"text",value:v});continue}if(v===","){let x=v,D=W[W.length-1];D&&et[et.length-1]==="braces"&&(D.comma=!0,x="|"),L({type:"comma",value:v,output:x});continue}if(v==="/"){if(b.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),b=i;continue}L({type:"slash",value:v,output:g});continue}if(v==="."){if(_.braces>0&&b.type==="dot"){b.value==="."&&(b.output=p);let x=W[W.length-1];b.type="dots",b.output+=v,b.value+=v,x.dots=!0;continue}if(_.braces+_.parens===0&&b.type!=="bos"&&b.type!=="slash"){L({type:"text",value:v,output:p});continue}L({type:"dot",value:v,output:p});continue}if(v==="?"){if(!(b&&b.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){xr("qmark",v);continue}if(b&&b.type==="paren"){let D=j(),ee=v;if(D==="<"&&!ke.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(je()))&&(ee=`\\${v}`),L({type:"text",value:v,output:ee});continue}if(r.dot!==!0&&(b.type==="slash"||b.type==="bos")){L({type:"qmark",value:v,output:xe});continue}L({type:"qmark",value:v,output:K});continue}if(v==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){xr("negate",v);continue}if(r.nonegate!==!0&&_.index===0){pf();continue}}if(v==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){xr("plus",v);continue}if(b&&b.value==="("||r.regex===!1){L({type:"plus",value:v,output:d});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||_.parens>0){L({type:"plus",value:v});continue}L({type:"plus",value:d});continue}if(v==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){L({type:"at",extglob:!0,value:v,output:""});continue}L({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let x=qb.exec(je());x&&(v+=x[0],_.index+=x[0].length),L({type:"text",value:v});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=v,b.output=le,_.backtrack=!0,_.globstar=!0,_e(v);continue}let w=je();if(r.noextglob!==!0&&/^\([^?]/.test(w)){xr("star",v);continue}if(b.type==="star"){if(r.noglobstar===!0){_e(v);continue}let x=b.prev,D=x.prev,ee=x.type==="slash"||x.type==="bos",me=D&&(D.type==="star"||D.type==="globstar");if(r.bash===!0&&(!ee||w[0]&&w[0]!=="/")){L({type:"star",value:v,output:""});continue}let ie=_.braces>0&&(x.type==="comma"||x.type==="brace"),Mn=z.length&&(x.type==="pipe"||x.type==="paren");if(!ee&&x.type!=="paren"&&!ie&&!Mn){L({type:"star",value:v,output:""});continue}for(;w.slice(0,3)==="/**";){let wr=e[_.index+4];if(wr&&wr!=="/")break;w=w.slice(3),_e("/**",3)}if(x.type==="bos"&&he()){b.type="globstar",b.value+=v,b.output=P(r),_.output=b.output,_.globstar=!0,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&!me&&he()){_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=P(r)+(r.strictSlashes?")":"|$)"),b.value+=v,_.globstar=!0,_.output+=x.output+b.output,_e(v);continue}if(x.type==="slash"&&x.prev.type!=="bos"&&w[0]==="/"){let wr=w[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(x.output+b.output).length),x.output=`(?:${x.output}`,b.type="globstar",b.output=`${P(r)}${g}|${g}${wr})`,b.value+=v,_.output+=x.output+b.output,_.globstar=!0,_e(v+Ie()),L({type:"slash",value:"/",output:""});continue}if(x.type==="bos"&&w[0]==="/"){b.type="globstar",b.value+=v,b.output=`(?:^|${g}|${P(r)}${g})`,_.output=b.output,_.globstar=!0,_e(v+Ie()),L({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-b.output.length),b.type="globstar",b.output=P(r),b.value+=v,_.output+=b.output,_.globstar=!0,_e(v);continue}let q={type:"star",value:v,output:le};if(r.bash===!0){q.output=".*?",(b.type==="bos"||b.type==="slash")&&(q.output=T+q.output),L(q);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&r.regex===!0){q.output=v,L(q);continue}(_.index===_.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(_.output+=R,b.output+=R):r.dot===!0?(_.output+=O,b.output+=O):(_.output+=T,b.output+=T),j()!=="*"&&(_.output+=m,b.output+=m)),L(q)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing","]"));_.output=ke.escapeLast(_.output,"["),ft("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing",")"));_.output=ke.escapeLast(_.output,"("),ft("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Nt("closing","}"));_.output=ke.escapeLast(_.output,"{"),ft("braces")}if(r.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${g}?`}),_.backtrack===!0){_.output="";for(let w of _.tokens)_.output+=w.output!=null?w.output:w.value,w.suffix&&(_.output+=w.suffix)}return _};Jo.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(an,r.maxLength):an,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=mu[e]||e;let i=ke.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:m}=sn.globChars(i),y=r.dot?p:u,k=r.dot?d:u,R=r.capture?"":"?:",O={negated:!1,prefix:""},K=r.bash===!0?".*?":g;r.capture&&(K=`(${K})`);let xe=T=>T.noglobstar===!0?K:`(${R}(?:(?!${m}${T.dot?l:s}).)*?)`,N=T=>{switch(T){case"*":return`${y}${c}${K}`;case".*":return`${s}${c}${K}`;case"*.*":return`${y}${K}${s}${c}${K}`;case"*/*":return`${y}${K}${a}${c}${k}${K}`;case"**":return y+xe(r);case"**/*":return`(?:${y}${xe(r)}${a})?${k}${c}${K}`;case"**/*.*":return`(?:${y}${xe(r)}${a})?${k}${K}${s}${c}${K}`;case"**/.*":return`(?:${y}${xe(r)}${a})?${s}${c}${K}`;default:{let M=/^(.*?)\.(\w+)$/.exec(T);if(!M)return;let le=N(M[1]);return le?le+s+M[2]:void 0}}},X=ke.removePrefix(e,O),P=N(X);return P&&r.strictSlashes!==!0&&(P+=`${a}?`),P};gu.exports=Jo});var vu=E((YC,bu)=>{"use strict";var Xb=I("path"),zb=hu(),Zo=yu(),ei=cr(),Qb=ar(),Jb=e=>e&&typeof e=="object"&&!Array.isArray(e),re=(e,t,r=!1)=>{if(Array.isArray(e)){let u=e.map(d=>re(d,t,r));return d=>{for(let g of u){let m=g(d);if(m)return m}return!1}}let n=Jb(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=t||{},i=ei.isWindows(t),s=n?re.compileRe(e,t):re.makeRe(e,t,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(o.ignore){let u={...t,ignore:null,onMatch:null,onResult:null};c=re(o.ignore,u,r)}let l=(u,p=!1)=>{let{isMatch:d,match:g,output:m}=re.test(u,s,t,{glob:e,posix:i}),y={glob:e,state:a,regex:s,posix:i,input:u,output:m,match:g,isMatch:d};return typeof o.onResult=="function"&&o.onResult(y),d===!1?(y.isMatch=!1,p?y:!1):c(u)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,p?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),p?y:!0)};return r&&(l.state=a),l};re.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let i=r||{},s=i.format||(o?ei.toPosixSlashes:null),a=e===n,c=a&&s?s(e):e;return a===!1&&(c=s?s(e):e,a=c===n),(a===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?a=re.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};re.matchBase=(e,t,r,n=ei.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(Xb.basename(e));re.isMatch=(e,t,r)=>re(t,r)(e);re.parse=(e,t)=>Array.isArray(e)?e.map(r=>re.parse(r,t)):Zo(e,{...t,fastpaths:!1});re.scan=(e,t)=>zb(e,t);re.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},i=o.contains?"":"^",s=o.contains?"":"$",a=`${i}(?:${e.output})${s}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let c=re.toRegex(a,t);return n===!0&&(c.state=e),c};re.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(o.output=Zo.fastpaths(e,t)),o.output||(o=Zo(e,t)),re.compileRe(o,t,r,n)};re.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};re.constants=Qb;bu.exports=re});var Eu=E((KC,_u)=>{"use strict";_u.exports=vu()});var Su=E((XC,Au)=>{"use strict";var xu=I("util"),wu=tu(),Ve=Eu(),ti=cr(),ku=e=>e===""||e==="./",Cu=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Y=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=u=>{i.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<t.length;u++){let p=Ve(String(t[u]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let g of e){let m=p(g,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let l=(s===t.length?[...i]:[...o]).filter(u=>!n.has(u));if(r&&l.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(u=>u.replace(/\\/g,"")):t}return l};Y.match=Y;Y.matcher=(e,t)=>Ve(e,t);Y.isMatch=(e,t,r)=>Ve(t,r)(e);Y.any=Y.isMatch;Y.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,o=[],i=a=>{r.onResult&&r.onResult(a),o.push(a.output)},s=new Set(Y(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};Y.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${xu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>Y.contains(e,n,r));if(typeof t=="string"){if(ku(e)||ku(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Y.isMatch(e,t,{...r,contains:!0})};Y.matchKeys=(e,t,r)=>{if(!ti.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=Y(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};Y.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Ve(String(o),r);if(n.some(s=>i(s)))return!0}return!1};Y.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Ve(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};Y.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${xu.inspect(e)}"`);return[].concat(t).every(n=>Ve(n,r)(e))};Y.capture=(e,t,r)=>{let n=ti.isWindows(r),i=Ve.makeRe(String(e),{...r,capture:!0}).exec(n?ti.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};Y.makeRe=(...e)=>Ve.makeRe(...e);Y.scan=(...e)=>Ve.scan(...e);Y.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of wu(String(n),t))r.push(Ve.parse(o,t));return r};Y.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Cu(e)?[e]:wu(e,t)};Y.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Y.braces(e,{...t,expand:!0})};Y.hasBraces=Cu;Au.exports=Y});var ju=E(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.isAbsolute=S.partitionAbsoluteAndRelative=S.removeDuplicateSlashes=S.matchAny=S.convertPatternsToRe=S.makeRe=S.getPatternParts=S.expandBraceExpansion=S.expandPatternsWithBraceExpansion=S.isAffectDepthOfReadingPattern=S.endsWithSlashGlobStar=S.hasGlobStar=S.getBaseDirectory=S.isPatternRelatedToParentDirectory=S.getPatternsOutsideCurrentDirectory=S.getPatternsInsideCurrentDirectory=S.getPositivePatterns=S.getNegativePatterns=S.isPositivePattern=S.isNegativePattern=S.convertToNegativePattern=S.convertToPositivePattern=S.isDynamicPattern=S.isStaticPattern=void 0;var Ru=I("path"),Zb=vl(),ri=Su(),Ou="**",ev="\\",tv=/[*?]|^!/,rv=/\[[^[]*]/,nv=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,ov=/[!*+?@]\([^(]*\)/,iv=/,|\.\./,sv=/(?!^)\/{2,}/g;function Tu(e,t={}){return!Pu(e,t)}S.isStaticPattern=Tu;function Pu(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(ev)||tv.test(e)||rv.test(e)||nv.test(e)||t.extglob!==!1&&ov.test(e)||t.braceExpansion!==!1&&av(e))}S.isDynamicPattern=Pu;function av(e){let t=e.indexOf("{");if(t===-1)return!1;let r=e.indexOf("}",t+1);if(r===-1)return!1;let n=e.slice(t,r);return iv.test(n)}function cv(e){return cn(e)?e.slice(1):e}S.convertToPositivePattern=cv;function lv(e){return"!"+e}S.convertToNegativePattern=lv;function cn(e){return e.startsWith("!")&&e[1]!=="("}S.isNegativePattern=cn;function $u(e){return!cn(e)}S.isPositivePattern=$u;function uv(e){return e.filter(cn)}S.getNegativePatterns=uv;function pv(e){return e.filter($u)}S.getPositivePatterns=pv;function dv(e){return e.filter(t=>!ni(t))}S.getPatternsInsideCurrentDirectory=dv;function fv(e){return e.filter(ni)}S.getPatternsOutsideCurrentDirectory=fv;function ni(e){return e.startsWith("..")||e.startsWith("./..")}S.isPatternRelatedToParentDirectory=ni;function hv(e){return Zb(e,{flipBackslashes:!1})}S.getBaseDirectory=hv;function mv(e){return e.includes(Ou)}S.hasGlobStar=mv;function Du(e){return e.endsWith("/"+Ou)}S.endsWithSlashGlobStar=Du;function gv(e){let t=Ru.basename(e);return Du(e)||Tu(t)}S.isAffectDepthOfReadingPattern=gv;function yv(e){return e.reduce((t,r)=>t.concat(Nu(r)),[])}S.expandPatternsWithBraceExpansion=yv;function Nu(e){let t=ri.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}S.expandBraceExpansion=Nu;function bv(e,t){let{parts:r}=ri.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return r.length===0&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}S.getPatternParts=bv;function Lu(e,t){return ri.makeRe(e,t)}S.makeRe=Lu;function vv(e,t){return e.map(r=>Lu(r,t))}S.convertPatternsToRe=vv;function _v(e,t){return t.some(r=>r.test(e))}S.matchAny=_v;function Ev(e){return e.replace(sv,"/")}S.removeDuplicateSlashes=Ev;function kv(e){let t=[],r=[];for(let n of e)Iu(n)?t.push(n):r.push(n);return[t,r]}S.partitionAbsoluteAndRelative=kv;function Iu(e){return Ru.isAbsolute(e)}S.isAbsolute=Iu});var Hu=E((QC,Bu)=>{"use strict";var xv=I("stream"),Fu=xv.PassThrough,wv=Array.prototype.slice;Bu.exports=Cv;function Cv(){let e=[],t=wv.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let o=n.end!==!1,i=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=Fu(n);function a(){for(let u=0,p=arguments.length;u<p;u++)e.push(Mu(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=e.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let p=u.length+1;function d(){--p>0||(r=!1,c())}function g(m){function y(){m.removeListener("merge2UnpipeEnd",y),m.removeListener("end",y),i&&m.removeListener("error",k),d()}function k(R){s.emit("error",R)}if(m._readableState.endEmitted)return d();m.on("merge2UnpipeEnd",y),m.on("end",y),i&&m.on("error",k),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<u.length;m++)g(u[m]);d()}function l(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function Mu(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=Mu(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Fu(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var Gu=E(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.merge=void 0;var Av=Hu();function Sv(e){let t=Av(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Vu(e)),t.once("end",()=>Vu(e)),t}ln.merge=Sv;function Vu(e){e.forEach(t=>t.emit("close"))}});var Uu=E(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.isEmpty=Lt.isString=void 0;function Rv(e){return typeof e=="string"}Lt.isString=Rv;function Ov(e){return e===""}Lt.isEmpty=Ov});var ze=E(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.string=de.stream=de.pattern=de.path=de.fs=de.errno=de.array=void 0;var Tv=sl();de.array=Tv;var Pv=al();de.errno=Pv;var $v=cl();de.fs=$v;var Dv=dl();de.path=Dv;var Nv=ju();de.pattern=Nv;var Lv=Gu();de.stream=Lv;var Iv=Uu();de.string=Iv});var Ku=E(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.convertPatternGroupToTask=fe.convertPatternGroupsToTasks=fe.groupPatternsByBaseDirectory=fe.getNegativePatternsAsPositive=fe.getPositivePatterns=fe.convertPatternsToTasks=fe.generate=void 0;var $e=ze();function jv(e,t){let r=Wu(e,t),n=Wu(t.ignore,t),o=qu(r),i=Yu(r,n),s=o.filter(u=>$e.pattern.isStaticPattern(u,t)),a=o.filter(u=>$e.pattern.isDynamicPattern(u,t)),c=oi(s,i,!1),l=oi(a,i,!0);return c.concat(l)}fe.generate=jv;function Wu(e,t){let r=e;return t.braceExpansion&&(r=$e.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>$e.pattern.removeDuplicateSlashes(n))}function oi(e,t,r){let n=[],o=$e.pattern.getPatternsOutsideCurrentDirectory(e),i=$e.pattern.getPatternsInsideCurrentDirectory(e),s=ii(o),a=ii(i);return n.push(...si(s,t,r)),"."in a?n.push(ai(".",i,t,r)):n.push(...si(a,t,r)),n}fe.convertPatternsToTasks=oi;function qu(e){return $e.pattern.getPositivePatterns(e)}fe.getPositivePatterns=qu;function Yu(e,t){return $e.pattern.getNegativePatterns(e).concat(t).map($e.pattern.convertToPositivePattern)}fe.getNegativePatternsAsPositive=Yu;function ii(e){let t={};return e.reduce((r,n)=>{let o=$e.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}fe.groupPatternsByBaseDirectory=ii;function si(e,t,r){return Object.keys(e).map(n=>ai(n,e[n],t,r))}fe.convertPatternGroupsToTasks=si;function ai(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map($e.pattern.convertToNegativePattern))}}fe.convertPatternGroupToTask=ai});var zu=E(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.read=void 0;function Fv(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Xu(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){ci(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Xu(r,i);return}ci(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),ci(r,s)})})}un.read=Fv;function Xu(e,t){e(t)}function ci(e,t){e(null,t)}});var Qu=E(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.read=void 0;function Mv(e,t){let r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw n}}pn.read=Mv});var Ju=E(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.createFileSystemAdapter=st.FILE_SYSTEM_ADAPTER=void 0;var dn=I("fs");st.FILE_SYSTEM_ADAPTER={lstat:dn.lstat,stat:dn.stat,lstatSync:dn.lstatSync,statSync:dn.statSync};function Bv(e){return e===void 0?st.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},st.FILE_SYSTEM_ADAPTER),e)}st.createFileSystemAdapter=Bv});var Zu=E(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});var Hv=Ju(),li=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=Hv.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,r){return t??r}};ui.default=li});var _t=E(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.statSync=at.stat=at.Settings=void 0;var ep=zu(),Vv=Qu(),pi=Zu();at.Settings=pi.default;function Gv(e,t,r){if(typeof t=="function"){ep.read(e,di(),t);return}ep.read(e,di(t),r)}at.stat=Gv;function Uv(e,t){let r=di(t);return Vv.read(e,r)}at.statSync=Uv;function di(e={}){return e instanceof pi.default?e:new pi.default(e)}});var np=E((aA,rp)=>{var tp;rp.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(tp||(tp=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var ip=E((cA,op)=>{op.exports=qv;var Wv=np();function qv(e,t){let r,n,o,i=!0;Array.isArray(e)?(r=[],n=e.length):(o=Object.keys(e),r={},n=o.length);function s(c){function l(){t&&t(c,r),t=null}i?Wv(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(l)}n?o?o.forEach(function(c){e[c](function(l,u){a(c,l,u)})}):e.forEach(function(c,l){c(function(u,p){a(l,u,p)})}):s(null),i=!1}});var fi=E(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var fn=process.versions.node.split(".");if(fn[0]===void 0||fn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var sp=Number.parseInt(fn[0],10),Yv=Number.parseInt(fn[1],10),ap=10,Kv=10,Xv=sp>ap,zv=sp===ap&&Yv>=Kv;hn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Xv||zv});var cp=E(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.createDirentFromStats=void 0;var hi=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Qv(e,t){return new hi(e,t)}mn.createDirentFromStats=Qv});var mi=E(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.fs=void 0;var Jv=cp();gn.fs=Jv});var gi=E(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.joinPathSegments=void 0;function Zv(e,t,r){return e.endsWith(r)?e+t:e+r+t}yn.joinPathSegments=Zv});var hp=E(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.readdir=ct.readdirWithFileTypes=ct.read=void 0;var e_=_t(),lp=ip(),t_=fi(),up=mi(),pp=gi();function r_(e,t,r){if(!t.stats&&t_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){dp(e,t,r);return}fp(e,t,r)}ct.read=r_;function dp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){bn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:pp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){yi(r,i);return}let s=i.map(a=>n_(a,t));lp(s,(a,c)=>{if(a!==null){bn(r,a);return}yi(r,c)})})}ct.readdirWithFileTypes=dp;function n_(e,t){return r=>{if(!e.dirent.isSymbolicLink()){r(null,e);return}t.fs.stat(e.path,(n,o)=>{if(n!==null){if(t.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,e);return}e.dirent=up.fs.createDirentFromStats(e.name,o),r(null,e)})}}function fp(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){bn(r,n);return}let i=o.map(s=>{let a=pp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{e_.stat(a,t.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let p={name:s,path:a,dirent:up.fs.createDirentFromStats(s,u)};t.stats&&(p.stats=u),c(null,p)})}});lp(i,(s,a)=>{if(s!==null){bn(r,s);return}yi(r,a)})})}ct.readdir=fp;function bn(e,t){e(t)}function yi(e,t){e(null,t)}});var vp=E(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.readdir=lt.readdirWithFileTypes=lt.read=void 0;var o_=_t(),i_=fi(),mp=mi(),gp=gi();function s_(e,t){return!t.stats&&i_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?yp(e,t):bp(e,t)}lt.read=s_;function yp(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:gp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=mp.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}lt.readdirWithFileTypes=yp;function bp(e,t){return t.fs.readdirSync(e).map(n=>{let o=gp.joinPathSegments(e,n,t.pathSegmentSeparator),i=o_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:mp.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}lt.readdir=bp});var _p=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.createFileSystemAdapter=ut.FILE_SYSTEM_ADAPTER=void 0;var It=I("fs");ut.FILE_SYSTEM_ADAPTER={lstat:It.lstat,stat:It.stat,lstatSync:It.lstatSync,statSync:It.statSync,readdir:It.readdir,readdirSync:It.readdirSync};function a_(e){return e===void 0?ut.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ut.FILE_SYSTEM_ADAPTER),e)}ut.createFileSystemAdapter=a_});var Ep=E(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});var c_=I("path"),l_=_t(),u_=_p(),bi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=u_.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,c_.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new l_.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};vi.default=bi});var vn=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.Settings=pt.scandirSync=pt.scandir=void 0;var kp=hp(),p_=vp(),_i=Ep();pt.Settings=_i.default;function d_(e,t,r){if(typeof t=="function"){kp.read(e,Ei(),t);return}kp.read(e,Ei(t),r)}pt.scandir=d_;function f_(e,t){let r=Ei(t);return p_.read(e,r)}pt.scandirSync=f_;function Ei(e={}){return e instanceof _i.default?e:new _i.default(e)}});var wp=E((bA,xp)=>{"use strict";function h_(e){var t=new e,r=t;function n(){var i=t;return i.next?t=i.next:(t=new e,r=t),i.next=null,i}function o(i){r.next=i,r=i}return{get:n,release:o}}xp.exports=h_});var Ap=E((vA,ki)=>{"use strict";var m_=wp();function Cp(e,t,r){if(typeof e=="function"&&(r=t,t=e,e=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=m_(g_),o=null,i=null,s=0,a=null,c={push:y,drain:Se,saturated:Se,pause:u,paused:!1,get concurrency(){return r},set concurrency(N){if(!(N>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=N,!c.paused)for(;o&&s<r;)s++,R()},running:l,resume:g,idle:m,length:p,getQueue:d,unshift:k,empty:Se,kill:O,killAndDrain:K,error:xe};return c;function l(){return s}function u(){c.paused=!0}function p(){for(var N=o,X=0;N;)N=N.next,X++;return X}function d(){for(var N=o,X=[];N;)X.push(N.value),N=N.next;return X}function g(){if(c.paused){if(c.paused=!1,o===null){s++,R();return}for(;o&&s<r;)s++,R()}}function m(){return s===0&&c.length()===0}function y(N,X){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=X||Se,P.errorHandler=a,s>=r||c.paused?i?(i.next=P,i=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function k(N,X){var P=n.get();P.context=e,P.release=R,P.value=N,P.callback=X||Se,P.errorHandler=a,s>=r||c.paused?o?(P.next=o,o=P):(o=P,i=P,c.saturated()):(s++,t.call(e,P.value,P.worked))}function R(N){N&&n.release(N);var X=o;X&&s<=r?c.paused?s--:(i===o&&(i=null),o=X.next,X.next=null,t.call(e,X.value,X.worked),i===null&&c.empty()):--s===0&&c.drain()}function O(){o=null,i=null,c.drain=Se}function K(){o=null,i=null,c.drain(),c.drain=Se}function xe(N){a=N}}function Se(){}function g_(){this.value=null,this.callback=Se,this.next=null,this.release=Se,this.context=null,this.errorHandler=null;var e=this;this.worked=function(r,n){var o=e.callback,i=e.errorHandler,s=e.value;e.value=null,e.callback=Se,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function y_(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(u,p){t.call(this,u).then(function(d){p(null,d)},p)}var o=Cp(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=l,o;function a(u){var p=new Promise(function(d,g){i(u,function(m,y){if(m){g(m);return}d(y)})});return p.catch(Se),p}function c(u){var p=new Promise(function(d,g){s(u,function(m,y){if(m){g(m);return}d(y)})});return p.catch(Se),p}function l(){var u=new Promise(function(p){process.nextTick(function(){if(o.idle())p();else{var d=o.drain;o.drain=function(){typeof d=="function"&&d(),p(),o.drain=d}}})});return u}}ki.exports=Cp;ki.exports.promise=y_});var _n=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.joinPathSegments=Ge.replacePathSegmentSeparator=Ge.isAppliedFilter=Ge.isFatalError=void 0;function b_(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ge.isFatalError=b_;function v_(e,t){return e===null||e(t)}Ge.isAppliedFilter=v_;function __(e,t){return e.split(/[/\\]/).join(t)}Ge.replacePathSegmentSeparator=__;function E_(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ge.joinPathSegments=E_});var Ci=E(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});var k_=_n(),xi=class{constructor(t,r){this._root=t,this._settings=r,this._root=k_.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};wi.default=xi});var Ri=E(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var x_=I("events"),w_=vn(),C_=Ap(),En=_n(),A_=Ci(),Ai=class extends A_.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=w_.scandir,this._emitter=new x_.EventEmitter,this._queue=C_(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){let n={directory:t,base:r};this._queue.push(n,o=>{o!==null&&this._handleError(o)})}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,(n,o)=>{if(n!==null){r(n,void 0);return}for(let i of o)this._handleEntry(i,t.base);r(null,void 0)})}_handleError(t){this._isDestroyed||!En.isFatalError(this._settings,t)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError)return;let n=t.path;r!==void 0&&(t.path=En.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),En.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&En.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};Si.default=Ai});var Sp=E(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var S_=Ri(),Oi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new S_.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{R_(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{O_(t,this._storage)}),this._reader.read()}};Ti.default=Oi;function R_(e,t){e(t)}function O_(e,t){e(null,t)}});var Rp=E($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});var T_=I("stream"),P_=Ri(),Pi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new P_.default(this._root,this._settings),this._stream=new T_.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};$i.default=Pi});var Op=E(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});var $_=vn(),kn=_n(),D_=Ci(),Di=class extends D_.default{constructor(){super(...arguments),this._scandir=$_.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(let t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,r){try{let n=this._scandir(t,this._settings.fsScandirSettings);for(let o of n)this._handleEntry(o,r)}catch(n){this._handleError(n)}}_handleError(t){if(kn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=kn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),kn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&kn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Ni.default=Di});var Tp=E(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});var N_=Op(),Li=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new N_.default(this._root,this._settings)}read(){return this._reader.read()}};Ii.default=Li});var Pp=E(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var L_=I("path"),I_=vn(),ji=class{constructor(t={}){this._options=t,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,L_.sep),this.fsScandirSettings=new I_.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Fi.default=ji});var wn=E(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Settings=Ue.walkStream=Ue.walkSync=Ue.walk=void 0;var $p=Sp(),j_=Rp(),F_=Tp(),Mi=Pp();Ue.Settings=Mi.default;function M_(e,t,r){if(typeof t=="function"){new $p.default(e,xn()).read(t);return}new $p.default(e,xn(t)).read(r)}Ue.walk=M_;function B_(e,t){let r=xn(t);return new F_.default(e,r).read()}Ue.walkSync=B_;function H_(e,t){let r=xn(t);return new j_.default(e,r).read()}Ue.walkStream=H_;function xn(e={}){return e instanceof Mi.default?e:new Mi.default(e)}});var Cn=E(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var V_=I("path"),G_=_t(),Dp=ze(),Bi=class{constructor(t){this._settings=t,this._fsStatSettings=new G_.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return V_.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Dp.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Dp.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};Hi.default=Bi});var Ui=E(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var U_=I("stream"),W_=_t(),q_=wn(),Y_=Cn(),Vi=class extends Y_.default{constructor(){super(...arguments),this._walkStream=q_.walkStream,this._stat=W_.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new U_.PassThrough({objectMode:!0});o._write=(i,s,a)=>this._getEntry(n[i],t[i],r).then(c=>{c!==null&&r.entryFilter(c)&&o.push(c),i===n.length-1&&o.end(),a()}).catch(a);for(let i=0;i<n.length;i++)o.write(i);return o}_getEntry(t,r,n){return this._getStat(t).then(o=>this._makeEntry(o,r)).catch(o=>{if(n.errorFilter(o))return null;throw o})}_getStat(t){return new Promise((r,n)=>{this._stat(t,this._fsStatSettings,(o,i)=>o===null?r(i):n(o))})}};Gi.default=Vi});var Np=E(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var K_=wn(),X_=Cn(),z_=Ui(),Wi=class extends X_.default{constructor(){super(...arguments),this._walkAsync=K_.walk,this._readerStream=new z_.default(this._settings)}dynamic(t,r){return new Promise((n,o)=>{this._walkAsync(t,r,(i,s)=>{i===null?n(s):o(i)})})}async static(t,r){let n=[],o=this._readerStream.static(t,r);return new Promise((i,s)=>{o.once("error",s),o.on("data",a=>n.push(a)),o.once("end",()=>i(n))})}};qi.default=Wi});var Lp=E(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});var ur=ze(),Yi=class{constructor(t,r,n){this._patterns=t,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let t of this._patterns){let r=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:t,segments:r,sections:n})}}_getPatternSegments(t){return ur.pattern.getPatternParts(t,this._micromatchOptions).map(n=>ur.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:ur.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return ur.array.splitWhen(t,r=>r.dynamic&&ur.pattern.hasGlobStar(r.pattern))}};Ki.default=Yi});var Ip=E(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});var Q_=Lp(),Xi=class extends Q_.default{match(t){let r=t.split("/"),n=r.length,o=this._storage.filter(i=>!i.complete||i.segments.length>n);for(let i of o){let s=i.sections[0];if(!i.complete&&n>s.length||r.every((c,l)=>{let u=i.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};zi.default=Xi});var jp=E(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var An=ze(),J_=Ip(),Qi=class{constructor(t,r){this._settings=t,this._micromatchOptions=r}getFilter(t,r,n){let o=this._getMatcher(r),i=this._getNegativePatternsRe(n);return s=>this._filter(t,s,o,i)}_getMatcher(t){return new J_.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(An.pattern.isAffectDepthOfReadingPattern);return An.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=An.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(i,n)?!1:this._isSkippedByNegativePatterns(i,o)}_isSkippedByDeep(t,r){return this._settings.deep===1/0?!1:this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){let n=r.split("/").length;if(t==="")return n;let o=t.split("/").length;return n-o}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!An.pattern.matchAny(t,r)}};Ji.default=Qi});var Fp=E(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var dt=ze(),Zi=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=dt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:dt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:dt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:dt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=dt.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;let o=this._isMatchToPatternsSet(n,r,t.dirent.isDirectory());return this._settings.unique&&o&&this._createIndexRecord(n),o}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,r,n){return!(!this._isMatchToPatterns(t,r.positive.all,n)||this._isMatchToPatterns(t,r.negative.relative,n)||this._isMatchToAbsoluteNegative(t,r.negative.absolute,n))}_isMatchToAbsoluteNegative(t,r,n){if(r.length===0)return!1;let o=dt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=dt.pattern.matchAny(t,r);return!o&&n?dt.pattern.matchAny(t+"/",r):o}};es.default=Zi});var Mp=E(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var Z_=ze(),ts=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return Z_.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};rs.default=ts});var Hp=E(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var Bp=ze(),ns=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=Bp.path.makeAbsolute(this._settings.cwd,r),r=Bp.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};os.default=ns});var Sn=E(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var eE=I("path"),tE=jp(),rE=Fp(),nE=Mp(),oE=Hp(),is=class{constructor(t){this._settings=t,this.errorFilter=new nE.default(this._settings),this.entryFilter=new rE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new tE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new oE.default(this._settings)}_getRootDirectory(t){return eE.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){let r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};ss.default=is});var Vp=E(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var iE=Np(),sE=Sn(),as=class extends sE.default{constructor(){super(...arguments),this._reader=new iE.default(this._settings)}async read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(r,t,n)).map(i=>n.transform(i))}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};cs.default=as});var Gp=E(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var aE=I("stream"),cE=Ui(),lE=Sn(),ls=class extends lE.default{constructor(){super(...arguments),this._reader=new cE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new aE.Readable({objectMode:!0,read:()=>{}});return o.once("error",s=>i.emit("error",s)).on("data",s=>i.emit("data",n.transform(s))).once("end",()=>i.emit("end")),i.once("close",()=>o.destroy()),i}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};us.default=ls});var Up=E(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var uE=_t(),pE=wn(),dE=Cn(),ps=class extends dE.default{constructor(){super(...arguments),this._walkSync=pE.walkSync,this._statSync=uE.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){let n=[];for(let o of t){let i=this._getFullEntryPath(o),s=this._getEntry(i,o,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(t,r,n){try{let o=this._getStat(t);return this._makeEntry(o,r)}catch(o){if(n.errorFilter(o))return null;throw o}}_getStat(t){return this._statSync(t,this._fsStatSettings)}};ds.default=ps});var Wp=E(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var fE=Up(),hE=Sn(),fs=class extends hE.default{constructor(){super(...arguments),this._reader=new fE.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(r,t,n).map(n.transform)}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};hs.default=fs});var qp=E(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var jt=I("fs"),mE=I("os"),gE=Math.max(mE.cpus().length,1);Ft.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:jt.lstat,lstatSync:jt.lstatSync,stat:jt.stat,statSync:jt.statSync,readdir:jt.readdir,readdirSync:jt.readdirSync};var ms=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,gE),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===void 0?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},Ft.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};Ft.default=ms});var vs=E((UA,Kp)=>{"use strict";var Yp=Ku(),yE=Vp(),bE=Gp(),vE=Wp(),gs=qp(),Re=ze();async function ys(e,t){De(e);let r=bs(e,yE.default,t),n=await Promise.all(r);return Re.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(l,u){De(l);let p=bs(l,vE.default,u);return Re.array.flatten(p)}e.sync=t;function r(l,u){De(l);let p=bs(l,bE.default,u);return Re.stream.merge(p)}e.stream=r;function n(l,u){De(l);let p=[].concat(l),d=new gs.default(u);return Yp.generate(p,d)}e.generateTasks=n;function o(l,u){De(l);let p=new gs.default(u);return Re.pattern.isDynamicPattern(l,p)}e.isDynamicPattern=o;function i(l){return De(l),Re.path.escape(l)}e.escapePath=i;function s(l){return De(l),Re.path.convertPathToPattern(l)}e.convertPathToPattern=s;let a;(function(l){function u(d){return De(d),Re.path.escapePosixPath(d)}l.escapePath=u;function p(d){return De(d),Re.path.convertPosixPathToPattern(d)}l.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(l){function u(d){return De(d),Re.path.escapeWindowsPath(d)}l.escapePath=u;function p(d){return De(d),Re.path.convertWindowsPathToPattern(d)}l.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(ys||(ys={}));function bs(e,t,r){let n=[].concat(e),o=new gs.default(r),i=Yp.generate(n,o),s=new t(o);return i.map(s.read,s)}function De(e){if(![].concat(e).every(n=>Re.string.isString(n)&&!Re.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Kp.exports=ys});import _E from"node:fs";import EE from"node:fs/promises";async function _s(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await EE[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Es(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return _E[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var YA,Xp,KA,XA,zp,zA,Qp=tt(()=>{YA=_s.bind(void 0,"stat","isFile"),Xp=_s.bind(void 0,"stat","isDirectory"),KA=_s.bind(void 0,"lstat","isSymbolicLink"),XA=Es.bind(void 0,"statSync","isFile"),zp=Es.bind(void 0,"statSync","isDirectory"),zA=Es.bind(void 0,"lstatSync","isSymbolicLink")});var Jp=tt(()=>{});import{promisify as kE}from"node:util";import{execFile as xE,execFileSync as t0}from"node:child_process";import{fileURLToPath as wE}from"node:url";function pr(e){return e instanceof URL?wE(e):e}var n0,o0,ks=tt(()=>{Jp();n0=kE(xE);o0=10*1024*1024});var ad=E((a0,Tn)=>{function td(e){return Array.isArray(e)?e:[e]}var CE=void 0,ws="",Zp=" ",xs="\\",AE=/^\s+$/,SE=/(?:[^\\]|^)\\$/,RE=/^\\!/,OE=/^\\#/,TE=/\r?\n/g,PE=/^\.{0,2}\/|^\.{1,2}$/,$E=/\/$/,Mt="/",rd="node-ignore";typeof Symbol<"u"&&(rd=Symbol.for("node-ignore"));var nd=rd,Bt=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),DE=/([0-z])-([0-z])/g,od=()=>!1,NE=e=>e.replace(DE,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:ws),LE=e=>{let{length:t}=e;return e.slice(0,t-t%2)},IE=[[/^\uFEFF/,()=>ws],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?Zp:ws)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+Zp}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return t+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>xs],[/\\\\/g,()=>xs],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===xs?`\\[${r}${LE(n)}${o}`:o==="]"&&n.length%2===0?`[${NE(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],jE=/(^|\\\/)?\\\*$/,dr="regex",Rn="checkRegex",ed="_",FE={[dr](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Rn](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},ME=e=>IE.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),On=e=>typeof e=="string",BE=e=>e&&On(e)&&!AE.test(e)&&!SE.test(e)&&e.indexOf("#")!==0,HE=e=>e.split(TE).filter(Boolean),Cs=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Bt(this,"body",n),Bt(this,"ignoreCase",o),Bt(this,"regexPrefix",s)}get regex(){let t=ed+dr;return this[t]?this[t]:this._make(dr,t)}get checkRegex(){let t=ed+Rn;return this[t]?this[t]:this._make(Rn,t)}_make(t,r){let n=this.regexPrefix.replace(jE,FE[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Bt(this,r,o)}},VE=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(RE,"!").replace(OE,"#");let i=ME(o);return new Cs(e,t,o,r,n,i)},As=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[nd]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(On(t)&&(t={pattern:t}),BE(t.pattern)){let r=VE(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,td(On(t)?HE(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:l}=c;i===l&&o!==i||l&&!o&&!i&&!r||!c[n].test(t)||(o=!l,i=l,s=l?CE:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},GE=(e,t)=>{throw new t(e)},Qe=(e,t,r)=>On(e)?e?Qe.isNotRelative(e)?r(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${t}\``,TypeError),id=e=>PE.test(e);Qe.isNotRelative=id;Qe.convert=e=>e;var Ss=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Bt(this,nd,!0),this._rules=new As(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(t){return this._rules.add(t)&&this._initCache(),this}addPattern(t){return this.add(t)}_test(t,r,n,o){let i=t&&Qe.convert(t);return Qe(i,t,this._strictPathCheck?GE:od),this._t(i,r,n,o)}checkIgnore(t){if(!$E.test(t))return this.test(t);let r=t.split(Mt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Mt)+Mt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Rn)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Mt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,dr);let i=this._t(o.join(Mt)+Mt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,dr)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return td(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Rs=e=>new Ss(e),UE=e=>Qe(e&&Qe.convert(e),e,od),sd=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qe.convert=e;let t=/^[a-z]:\//i;Qe.isNotRelative=r=>t.test(r)||id(r)};typeof process<"u"&&process.platform==="win32"&&sd();Tn.exports=Rs;Rs.default=Rs;Tn.exports.isPathValid=UE;Bt(Tn.exports,Symbol.for("setupWindows"),sd)});function Ht(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var cd=tt(()=>{});var fr,Os=tt(()=>{fr=e=>e[0]==="!"});import WE from"node:process";import qE from"node:fs";import YE from"node:fs/promises";import Vt from"node:path";var Ts,ld,KE,ud,Pn,XE,zE,QE,pd,dd,hr,mr,fd,hd,Ps=tt(()=>{Ts=qt(vs(),1),ld=qt(ad(),1);cd();ks();Os();KE=["**/node_modules","**/flow-typed","**/coverage","**/.git"],ud={absolute:!0,dot:!0},Pn="**/.gitignore",XE=(e,t)=>fr(e)?"!"+Vt.posix.join(t,e.slice(1)):Vt.posix.join(t,e),zE=(e,t)=>{let r=Ht(Vt.relative(t,Vt.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>XE(n,r))},QE=(e,t)=>{if(t=Ht(t),Vt.isAbsolute(e)){if(Ht(e).startsWith(t))return Vt.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},pd=(e,t)=>{let r=e.flatMap(o=>zE(o,t)),n=(0,ld.default)().add(r);return o=>(o=pr(o),o=QE(o,t),o?n.ignores(Ht(o)):!1)},dd=(e={})=>({cwd:pr(e.cwd)??WE.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...KE]}),hr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=dd(t),s=await(0,Ts.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...ud}),a=await Promise.all(s.map(async c=>({filePath:c,content:await YE.readFile(c,"utf8")})));return pd(a,r)},mr=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=dd(t),a=Ts.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...ud}).map(c=>({filePath:c,content:qE.readFileSync(c,"utf8")}));return pd(a,r)},fd=e=>hr(Pn,e),hd=e=>mr(Pn,e)});var Od={};bf(Od,{convertPathToPattern:()=>ck,generateGlobTasks:()=>sk,generateGlobTasksSync:()=>ak,globby:()=>rk,globbyStream:()=>ok,globbySync:()=>nk,isDynamicPattern:()=>ik,isGitIgnored:()=>fd,isGitIgnoredSync:()=>hd,isIgnoredByIgnoreFiles:()=>hr,isIgnoredByIgnoreFilesSync:()=>mr});import yd from"node:process";import JE from"node:fs";import Gt from"node:path";var Ut,ZE,bd,vd,md,gd,$s,ek,_d,Ed,$n,kd,tk,xd,wd,Cd,Ad,Sd,Rd,Ds,rk,nk,ok,ik,sk,ak,ck,Td=tt(()=>{il();Ut=qt(vs(),1);Qp();ks();Ps();Os();Ps();ZE=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},bd=(e,t)=>{let r=fr(e)?e.slice(1):e;return Gt.isAbsolute(r)?r:Gt.join(t,r)},vd=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>Gt.posix.join(e,`**/${Gt.extname(o)?o:`${o}${n}`}`)):[Gt.posix.join(e,`**${n?`/*${n}`:""}`)]},md=async(e,{cwd:t=yd.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await Xp(bd(i,t))?vd({directoryPath:i,files:r,extensions:n}):i))).flat(),gd=(e,{cwd:t=yd.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>zp(bd(o,t))?vd({directoryPath:o,files:r,extensions:n}):o),$s=e=>(e=[...new Set([e].flat())],ZE(e),e),ek=e=>{if(!e)return;let t;try{t=JE.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},_d=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:pr(e.cwd)},ek(e.cwd),e),Ed=e=>async(t,r)=>e($s(t),_d(r)),$n=e=>(t,r)=>e($s(t),_d(r)),kd=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?$s(t):[];return r&&n.push(Pn),n},tk=async e=>{let t=kd(e);return wd(t.length>0&&await hr(t,e))},xd=e=>{let t=kd(e);return wd(t.length>0&&mr(t,e))},wd=e=>{let t=new Set;return r=>{let n=Gt.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Cd=(e,t)=>e.flat().filter(r=>t(r)),Ad=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>fr(i));if(n===-1){r.push({patterns:e,options:t});break}let o=e[n].slice(1);for(let i of r)i.options.ignore.push(o);n!==0&&r.push({patterns:e.slice(0,n),options:{...t,ignore:[...t.ignore,o]}}),e=e.slice(n+1)}return r},Sd=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Rd=async(e,t)=>{let r=Ad(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Sd(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([md(a,i),md(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Ds=(e,t)=>{let r=Ad(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=Sd(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=gd(a,i),c.ignore=gd(c.ignore,{cwd:n}),{patterns:a,options:c}})},rk=Ed(async(e,t)=>{let[r,n]=await Promise.all([Rd(e,t),tk(t)]),o=await Promise.all(r.map(i=>(0,Ut.default)(i.patterns,i.options)));return Cd(o,n)}),nk=$n((e,t)=>{let r=Ds(e,t),n=xd(t),o=r.map(i=>Ut.default.sync(i.patterns,i.options));return Cd(o,n)}),ok=$n((e,t)=>{let r=Ds(e,t),n=xd(t),o=r.map(s=>Ut.default.stream(s.patterns,s.options));return Lo(o).filter(s=>n(s))}),ik=$n((e,t)=>e.some(r=>Ut.default.isDynamicPattern(r,t))),sk=Ed(Rd),ak=$n(Ds),{convertPathToPattern:ck}=Ut.default});var qs=(e=0)=>t=>`\x1B[${t+e}m`,Ys=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Ks=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,Q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},kx=Object.keys(Q.modifier),_f=Object.keys(Q.color),Ef=Object.keys(Q.bgColor),xx=[..._f,...Ef];function kf(){let e=new Map;for(let[t,r]of Object.entries(Q)){for(let[n,o]of Object.entries(r))Q[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Q[n],e.set(o[0],o[1]);Object.defineProperty(Q,t,{value:r,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:e,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=qs(),Q.color.ansi256=Ys(),Q.color.ansi16m=Ks(),Q.bgColor.ansi=qs(10),Q.bgColor.ansi256=Ys(10),Q.bgColor.ansi16m=Ks(10),Object.defineProperties(Q,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>Q.rgbToAnsi256(...Q.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>Q.ansi256ToAnsi(Q.hexToAnsi256(t)),enumerable:!1}}),Q}var xf=kf(),Te=xf;import Hn from"node:process";import wf from"node:os";import Xs from"node:tty";function we(e,t=globalThis.Deno?globalThis.Deno.args:Hn.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}var{env:J}=Hn,Cr;we("no-color")||we("no-colors")||we("color=false")||we("color=never")?Cr=0:(we("color")||we("colors")||we("color=true")||we("color=always"))&&(Cr=1);function Cf(){if("FORCE_COLOR"in J)return J.FORCE_COLOR==="true"?1:J.FORCE_COLOR==="false"?0:J.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(J.FORCE_COLOR,10),3)}function Af(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Sf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Cf();n!==void 0&&(Cr=n);let o=r?Cr:n;if(o===0)return 0;if(r){if(we("color=16m")||we("color=full")||we("color=truecolor"))return 3;if(we("color=256"))return 2}if("TF_BUILD"in J&&"AGENT_NAME"in J)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(J.TERM==="dumb")return i;if(Hn.platform==="win32"){let s=wf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in J)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in J)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in J)||J.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in J)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(J.TEAMCITY_VERSION)?1:0;if(J.COLORTERM==="truecolor"||J.TERM==="xterm-kitty"||J.TERM==="xterm-ghostty"||J.TERM==="wezterm")return 3;if("TERM_PROGRAM"in J){let s=Number.parseInt((J.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(J.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(J.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(J.TERM)||"COLORTERM"in J?1:i}function zs(e,t={}){let r=Sf(e,{streamIsTTY:e&&e.isTTY,...t});return Af(r)}var Rf={stdout:zs({isTTY:Xs.isatty(1)}),stderr:zs({isTTY:Xs.isatty(2)})},Qs=Rf;function Js(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function Zs(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
|
|
32
32
|
`:`
|
|
33
33
|
`)+r,o=n+1,n=e.indexOf(`
|
|
34
|
-
`,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:
|
|
35
|
-
`);return i!==-1&&(t=
|
|
34
|
+
`,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:ea,stderr:ta}=Qs,Vn=Symbol("GENERATOR"),Et=Symbol("STYLER"),Yt=Symbol("IS_EMPTY"),ra=["ansi","ansi","ansi256","ansi16m"],kt=Object.create(null),Of=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=ea?ea.level:0;e.level=t.level===void 0?r:t.level};var Tf=e=>{let t=(...r)=>r.join(" ");return Of(t,e),Object.setPrototypeOf(t,Kt.prototype),t};function Kt(e){return Tf(e)}Object.setPrototypeOf(Kt.prototype,Function.prototype);for(let[e,t]of Object.entries(Te))kt[e]={get(){let r=Ar(this,Un(t.open,t.close,this[Et]),this[Yt]);return Object.defineProperty(this,e,{value:r}),r}};kt.visible={get(){let e=Ar(this,this[Et],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Gn=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Te[r].ansi16m(...n):t==="ansi256"?Te[r].ansi256(Te.rgbToAnsi256(...n)):Te[r].ansi(Te.rgbToAnsi(...n)):e==="hex"?Gn("rgb",t,r,...Te.hexToRgb(...n)):Te[r][e](...n),Pf=["rgb","hex","ansi256"];for(let e of Pf){kt[e]={get(){let{level:r}=this;return function(...n){let o=Un(Gn(e,ra[r],"color",...n),Te.color.close,this[Et]);return Ar(this,o,this[Yt])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);kt[t]={get(){let{level:r}=this;return function(...n){let o=Un(Gn(e,ra[r],"bgColor",...n),Te.bgColor.close,this[Et]);return Ar(this,o,this[Yt])}}}}var $f=Object.defineProperties(()=>{},{...kt,level:{enumerable:!0,get(){return this[Vn].level},set(e){this[Vn].level=e}}}),Un=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},Ar=(e,t,r)=>{let n=(...o)=>Df(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,$f),n[Vn]=e,n[Et]=t,n[Yt]=r,n},Df=(e,t)=>{if(e.level<=0||!t)return e[Yt]?"":t;let r=e[Et];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Js(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
35
|
+
`);return i!==-1&&(t=Zs(t,o,n,i)),n+t+o};Object.defineProperties(Kt.prototype,kt);var Nf=Kt(),Dx=Kt({level:ta?ta.level:0});var f=Nf;var ma=qt(ha(),1),{program:Vx,createCommand:Gx,createArgument:Ux,createOption:Wx,CommanderError:qx,InvalidArgumentError:Yx,InvalidOptionArgumentError:Kx,Command:ga,Argument:Xx,Option:zx,Help:Qx}=ma.default;import _r from"fs-extra";import Wt from"path";var Oa=qt(xa(),1);import gh from"chokidar";import Dr from"fs-extra";import Zt from"path";import ht from"fs-extra";import Qt from"path";var uo=class{constructor(){this.level="info";this.verbose=!1}setLevel(t){this.level=t}setVerbose(t){this.verbose=t}shouldLog(t){let r={error:0,warn:1,info:2,debug:3};return t==="debug"&&this.verbose?!0:r[t]<=r[this.level]}getTypeStyle(t){switch(t){case"success":return f.green;case"error":return f.red;case"warning":return f.yellow;case"info":return f.blue;case"instruction":return f.cyan;case"progress":return f.reset;case"debug":return f.gray;case"raclette":return f.rgb(221,139,64);default:return r=>r}}getTypeIcon(t){switch(t){case"success":return"\u2705";case"error":return"\u274C";case"warning":return"\u26A0\uFE0F";case"info":return"\u2139\uFE0F";case"instruction":return"\u{1F4A1}";case"progress":return"\u{1F504}";case"debug":return"";case"raclette":return"\u{1F9C0}";default:return""}}log(t,r,n){if(!this.shouldLog(t))return;let o=n?this.getTypeStyle(n):f.reset,i=n?this.getTypeIcon(n):"",s=i?`${i} `:"";console.log(o(`${s}${r}`))}logError(t,r){if(!this.shouldLog("error"))return;let n=this.getTypeStyle("error"),o=this.getTypeIcon("error"),i=o?`${o} `:"";r?console.error(n(`${i}${t}`),r):console.error(n(`${i}${t}`))}error(t,r){this.logError(t,r)}warn(t){this.log("warn",t,"warning")}info(t){this.log("info",t,"info")}debug(t){this.log("debug",t,"debug")}success(t){this.log("info",t,"success")}instruction(t){this.log("info",t,"instruction")}progress(t){this.log("info",t,"progress")}raclette(t){this.log("info",t,"raclette")}raw(t,r="info"){this.shouldLog(r)&&console.log(t)}},h=new uo;var wa=async(e,t)=>{try{await ht.ensureDir(Qt.dirname(e)),await ht.pathExists(e)&&(await ht.stat(e)).isDirectory()&&(console.warn(f.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await ht.remove(e)),await ht.writeFile(e,t)}catch(r){throw h.error(` Error writing file ${e}: ${r.message}`),r}},Pr=async(e,t)=>{h.debug("Generating service configuration files...");let r=Qt.join(t,"backend"),n=Qt.join(t,"frontend");await ht.ensureDir(r),await ht.ensureDir(n);let o={name:e.name,env:e.env,modules:e.modules,plugins:e.plugins,global:e.global},i={...o,service:"backend",...e.backend},s=`
|
|
36
36
|
// Generated Raclette Backend Configuration
|
|
37
37
|
// This file is auto-generated, do not edit directly
|
|
38
38
|
|
|
39
39
|
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
40
40
|
|
|
41
41
|
export default racletteConfig;
|
|
42
|
-
`;await
|
|
42
|
+
`;await wa(Qt.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
|
|
43
43
|
// Generated Raclette Frontend Configuration
|
|
44
44
|
// This file is auto-generated, do not edit directly
|
|
45
45
|
|
|
46
46
|
export const racletteConfig = ${JSON.stringify(a,null,2)};
|
|
47
47
|
|
|
48
48
|
export default racletteConfig;
|
|
49
|
-
`;await
|
|
49
|
+
`;await wa(Qt.join(n,"raclette.config.js"),c),console.log(f.green("\u2705 Service configuration files generated"))};function G(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Fe(e){return function t(r){return arguments.length===0||G(r)?t:e.apply(this,arguments)}}function Me(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return G(r)?t:Fe(function(o){return e(r,o)});default:return G(r)&&G(n)?t:G(r)?Fe(function(o){return e(o,n)}):G(n)?Fe(function(o){return e(r,o)}):e(r,n)}}}function Jt(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return G(r)?t:Me(function(i,s){return e(r,i,s)});case 2:return G(r)&&G(n)?t:G(r)?Me(function(i,s){return e(i,n,s)}):G(n)?Me(function(i,s){return e(r,i,s)}):Fe(function(i){return e(r,n,i)});default:return G(r)&&G(n)&&G(o)?t:G(r)&&G(n)?Me(function(i,s){return e(i,s,o)}):G(r)&&G(o)?Me(function(i,s){return e(i,n,s)}):G(n)&&G(o)?Me(function(i,s){return e(r,i,s)}):G(r)?Fe(function(i){return e(i,n,o)}):G(n)?Fe(function(i){return e(r,i,o)}):G(o)?Fe(function(i){return e(r,n,i)}):e(r,n,o)}}}function wt(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function $r(e){return Object.prototype.toString.call(e)==="[object Object]"}var fh=Jt(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)wt(i,r)&&(o[i]=wt(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)wt(i,n)&&!wt(i,o)&&(o[i]=n[i]);return o}),Ca=fh;var hh=Jt(function e(t,r,n){return Ca(function(o,i,s){return $r(i)&&$r(s)?e(t,i,s):t(o,i,s)},r,n)}),Aa=hh;var mh=Me(function(t,r){return Aa(function(n,o,i){return i},t,r)}),mt=mh;var Sa={name:"raclette-app",services:{frontend:{enabled:!0,port:8081,installPackages:[]},backend:{enabled:!0,port:8082,enableDebug:!1,installPackages:[]},mongodb:{enabled:!0,port:27017},cache:{enabled:!0,port:6379},workbench:{enabled:!1,frontendPort:8083,backendPort:8084}},modules:[],plugins:[],env:{development:{},production:{NODE_ENV:"production"}},global:{requireAuthentication:!0},frontend:{framework:"vue",i18n:{locales:["en-EU"],priorities:{app:10,".":30}},vue:{plugins:[]}},backend:{sockets:{autoSend:{compositions:!0,interactionLinks:!0,projectConfig:!0},security:{requireAuth:!0,tokenValidation:"jwt"},options:{adapter:"memory",connectionTimeout:3e3,pingInterval:1500,pingTimeout:1e3}}},sourceDirectories:[],packageMerging:{frontend:[{file:"./packages.json",key:"frontend"}],backend:[{file:"./packages.json",key:"backend"}]},lockFiles:{frontend:"./app.frontend.yarn.lock",backend:"./app.backend.yarn.lock"}},yh=async e=>{let t=e==="production"?".env.production":".env",r=Zt.join(process.cwd(),t);if(process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=process.cwd()),await Dr.pathExists(r)){let n=await Dr.readFile(r,"utf-8"),o=Oa.parse(n);return Object.entries(o).forEach(([i,s])=>{process.env[i]=s}),console.log(f.blue(`\u{1F4C4} Loaded ${Object.keys(o).length} environment variables from ${t}`)),{...o,RACLETTE_APP_PATH:process.env.RACLETTE_APP_PATH}}return{}},Ra=async e=>{try{let{pathToFileURL:t}=await import("url"),n=`${t(e).href}?t=${Date.now()}`;I.cache[e]&&delete I.cache[e];let o=await import(n);return o.default||o}catch(t){throw console.error(f.red(`Error loading config from ${e}:`),t),t}},Nr=e=>{if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e)){let t=Number(e);if(!isNaN(t))return t}if(/^\d+\.\d+$/.test(e)){let t=Number(e);if(!isNaN(t))return t}return e}if(Array.isArray(e))return e.map(t=>Nr(t));if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=Nr(n);return t}return e},Pe=async(e="",t="development")=>{let r=Zt.join(process.cwd(),"raclette.config.js"),n=Zt.join(process.cwd(),".raclette");if(!await Dr.pathExists(r))return console.warn("No raclette.config.js found, using default configuration"),Sa;let o=await yh(t),i=await Ra(r),s=Nr(i),a={env:{}};if(e){let l=await Ra(e);a=Nr(l)}let c=mt(mt(Sa,s),mt(a,{env:{[t]:o}}));return await bh(c,n),await Pr(c,n),c},bh=async(e,t)=>{let r=`// Generated Raclette Configuration
|
|
50
50
|
// This file is auto-generated from the merged configuration
|
|
51
51
|
// Do not edit directly
|
|
52
52
|
|
|
53
53
|
export default ${JSON.stringify(e,null,2)};
|
|
54
|
-
`;await Dr.writeFile(Zt.join(t,"raclette.config.js"),r),console.log(f.green("\u2705 Raclette Configuration file generated"))},
|
|
54
|
+
`;await Dr.writeFile(Zt.join(t,"raclette.config.js"),r),console.log(f.green("\u2705 Raclette Configuration file generated"))},Ta=()=>{let e=Zt.join(process.cwd(),"raclette.config.js");h.progress(`\u{1F50D} Watching for changes in original config: ${e}`);let t=gh.watch(e,{ignored:/(^|[/\\])\../,persistent:!0});return t.on("change",async r=>{h.progress(`\u{1F4DD} Original config file changed: ${r}`);try{await Pe()}catch(n){h.error("Error reloading configuration: "+n.message)}}),()=>t.close()};import{spawn as js}from"child_process";import yr,{pathExists as Sk}from"fs-extra";import Ne from"path";import Ur from"fs-extra";function qa(e){return typeof e>"u"||e===null}function vh(e){return typeof e=="object"&&e!==null}function _h(e){return Array.isArray(e)?e:qa(e)?[]:[e]}function Eh(e,t){var r,n,o,i;if(t)for(i=Object.keys(t),r=0,n=i.length;r<n;r+=1)o=i[r],e[o]=t[o];return e}function kh(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function xh(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var wh=qa,Ch=vh,Ah=_h,Sh=kh,Rh=xh,Oh=Eh,ae={isNothing:wh,isObject:Ch,toArray:Ah,repeat:Sh,isNegativeZero:Rh,extend:Oh};function Ya(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
55
55
|
|
|
56
|
-
`+e.mark.snippet),n+" "+r):n}function tr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=
|
|
57
|
-
`+a;for(l=
|
|
56
|
+
`+e.mark.snippet),n+" "+r):n}function tr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ya(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}tr.prototype=Object.create(Error.prototype);tr.prototype.constructor=tr;tr.prototype.toString=function(t){return this.name+": "+Ya(this,t)};var ge=tr;function po(e,t,r,n,o){var i="",s="",a=Math.floor(o/2)-1;return n-t>a&&(i=" ... ",t=n-a+i.length),r-n>a&&(s=" ...",r=n+a-s.length),{str:i+e.slice(t,r).replace(/\t/g,"\u2192")+s,pos:n-t+i.length}}function fo(e,t){return ae.repeat(" ",t-e.length)+e}function Th(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],i,s=-1;i=r.exec(e.buffer);)o.push(i.index),n.push(i.index+i[0].length),e.position<=i.index&&s<0&&(s=n.length-2);s<0&&(s=n.length-1);var a="",c,l,u=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(s-c<0);c++)l=po(e.buffer,n[s-c],o[s-c],e.position-(n[s]-n[s-c]),p),a=ae.repeat(" ",t.indent)+fo((e.line-c+1).toString(),u)+" | "+l.str+`
|
|
57
|
+
`+a;for(l=po(e.buffer,n[s],o[s],e.position,p),a+=ae.repeat(" ",t.indent)+fo((e.line+1).toString(),u)+" | "+l.str+`
|
|
58
58
|
`,a+=ae.repeat("-",t.indent+u+3+l.pos)+`^
|
|
59
|
-
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)l=
|
|
60
|
-
`;return a.replace(/\n$/,"")}var
|
|
61
|
-
\r`;function
|
|
62
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function
|
|
63
|
-
`,t-1))}function
|
|
64
|
-
`,i?1+c:c):o===
|
|
59
|
+
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)l=po(e.buffer,n[s+c],o[s+c],e.position-(n[s]-n[s+c]),p),a+=ae.repeat(" ",t.indent)+fo((e.line+c+1).toString(),u)+" | "+l.str+`
|
|
60
|
+
`;return a.replace(/\n$/,"")}var Ph=Th,$h=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Dh=["scalar","sequence","mapping"];function Nh(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function Lh(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if($h.indexOf(r)===-1)throw new ge('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Nh(t.styleAliases||null),Dh.indexOf(this.kind)===-1)throw new ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ue=Lh;function Pa(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(i,s){i.tag===n.tag&&i.kind===n.kind&&i.multi===n.multi&&(o=s)}),r[o]=n}),r}function Ih(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}function mo(e){return this.extend(e)}mo.prototype.extend=function(t){var r=[],n=[];if(t instanceof ue)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof ue))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new ge("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new ge("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(i){if(!(i instanceof ue))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(mo.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=Pa(o,"implicit"),o.compiledExplicit=Pa(o,"explicit"),o.compiledTypeMap=Ih(o.compiledImplicit,o.compiledExplicit),o};var Ka=mo,Xa=new ue("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),za=new ue("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Qa=new ue("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ja=new Ka({explicit:[Xa,za,Qa]});function jh(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Fh(){return null}function Mh(e){return e===null}var Za=new ue("tag:yaml.org,2002:null",{kind:"scalar",resolve:jh,construct:Fh,predicate:Mh,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Bh(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Hh(e){return e==="true"||e==="True"||e==="TRUE"}function Vh(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ec=new ue("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Bh,construct:Hh,predicate:Vh,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Gh(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Uh(e){return 48<=e&&e<=55}function Wh(e){return 48<=e&&e<=57}function qh(e){if(e===null)return!1;var t=e.length,r=0,n=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Gh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Uh(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Wh(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function Yh(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function Kh(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ae.isNegativeZero(e)}var tc=new ue("tag:yaml.org,2002:int",{kind:"scalar",resolve:qh,construct:Yh,predicate:Kh,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Xh=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function zh(e){return!(e===null||!Xh.test(e)||e[e.length-1]==="_")}function Qh(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var Jh=/^[-+]?[0-9]+e/;function Zh(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ae.isNegativeZero(e))return"-0.0";return r=e.toString(10),Jh.test(r)?r.replace("e",".e"):r}function em(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ae.isNegativeZero(e))}var rc=new ue("tag:yaml.org,2002:float",{kind:"scalar",resolve:zh,construct:Qh,predicate:em,represent:Zh,defaultStyle:"lowercase"}),nc=Ja.extend({implicit:[Za,ec,tc,rc]}),oc=nc,ic=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),sc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function tm(e){return e===null?!1:ic.exec(e)!==null||sc.exec(e)!==null}function rm(e){var t,r,n,o,i,s,a,c=0,l=null,u,p,d;if(t=ic.exec(e),t===null&&(t=sc.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(i=+t[4],s=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=+t[10],p=+(t[11]||0),l=(u*60+p)*6e4,t[9]==="-"&&(l=-l)),d=new Date(Date.UTC(r,n,o,i,s,a,c)),l&&d.setTime(d.getTime()-l),d}function nm(e){return e.toISOString()}var ac=new ue("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:tm,construct:rm,instanceOf:Date,represent:nm});function om(e){return e==="<<"||e===null}var cc=new ue("tag:yaml.org,2002:merge",{kind:"scalar",resolve:om}),_o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
61
|
+
\r`;function im(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=_o;for(r=0;r<o;r++)if(t=i.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function sm(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=_o,s=0,a=[];for(t=0;t<o;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|i.indexOf(n.charAt(t));return r=o%4*6,r===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):r===18?(a.push(s>>10&255),a.push(s>>2&255)):r===12&&a.push(s>>4&255),new Uint8Array(a)}function am(e){var t="",r=0,n,o,i=e.length,s=_o;for(n=0;n<i;n++)n%3===0&&n&&(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]),r=(r<<8)+e[n];return o=i%3,o===0?(t+=s[r>>18&63],t+=s[r>>12&63],t+=s[r>>6&63],t+=s[r&63]):o===2?(t+=s[r>>10&63],t+=s[r>>4&63],t+=s[r<<2&63],t+=s[64]):o===1&&(t+=s[r>>2&63],t+=s[r<<4&63],t+=s[64],t+=s[64]),t}function cm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var lc=new ue("tag:yaml.org,2002:binary",{kind:"scalar",resolve:im,construct:sm,predicate:cm,represent:am}),lm=Object.prototype.hasOwnProperty,um=Object.prototype.toString;function pm(e){if(e===null)return!0;var t=[],r,n,o,i,s,a=e;for(r=0,n=a.length;r<n;r+=1){if(o=a[r],s=!1,um.call(o)!=="[object Object]")return!1;for(i in o)if(lm.call(o,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function dm(e){return e!==null?e:[]}var uc=new ue("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pm,construct:dm}),fm=Object.prototype.toString;function hm(e){if(e===null)return!0;var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],fm.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function mm(e){if(e===null)return[];var t,r,n,o,i,s=e;for(i=new Array(s.length),t=0,r=s.length;t<r;t+=1)n=s[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}var pc=new ue("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:hm,construct:mm}),gm=Object.prototype.hasOwnProperty;function ym(e){if(e===null)return!0;var t,r=e;for(t in r)if(gm.call(r,t)&&r[t]!==null)return!1;return!0}function bm(e){return e!==null?e:{}}var dc=new ue("tag:yaml.org,2002:set",{kind:"mapping",resolve:ym,construct:bm}),Eo=oc.extend({implicit:[ac,cc],explicit:[lc,uc,pc,dc]}),nt=Object.prototype.hasOwnProperty,Lr=1,fc=2,hc=3,Ir=4,ho=1,vm=2,$a=3,_m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Em=/[\x85\u2028\u2029]/,km=/[,\[\]\{\}]/,mc=/^(?:!|!!|![a-z\-]+!)$/i,gc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Da(e){return Object.prototype.toString.call(e)}function Be(e){return e===10||e===13}function yt(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function At(e){return e===44||e===91||e===93||e===123||e===125}function xm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function wm(e){return e===120?2:e===117?4:e===85?8:0}function Cm(e){return 48<=e&&e<=57?e-48:-1}function Na(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
62
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Am(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var yc=new Array(256),bc=new Array(256);for(gt=0;gt<256;gt++)yc[gt]=Na(gt)?1:0,bc[gt]=Na(gt);var gt;function Sm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Eo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function vc(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Ph(r),new ge(t,r)}function C(e,t){throw vc(e,t)}function jr(e,t){e.onWarning&&e.onWarning.call(null,vc(e,t))}var La={YAML:function(t,r,n){var o,i,s;t.version!==null&&C(t,"duplication of %YAML directive"),n.length!==1&&C(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&C(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&C(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&jr(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&C(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],mc.test(o)||C(t,"ill-formed tag handle (first argument) of the TAG directive"),nt.call(t.tagMap,o)&&C(t,'there is a previously declared suffix for "'+o+'" tag handle'),gc.test(i)||C(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{C(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};function rt(e,t,r,n){var o,i,s,a;if(t<r){if(a=e.input.slice(t,r),n)for(o=0,i=a.length;o<i;o+=1)s=a.charCodeAt(o),s===9||32<=s&&s<=1114111||C(e,"expected valid JSON character");else _m.test(a)&&C(e,"the stream contains non-printable characters");e.result+=a}}function Ia(e,t,r,n){var o,i,s,a;for(ae.isObject(r)||C(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),s=0,a=o.length;s<a;s+=1)i=o[s],nt.call(t,i)||(t[i]=r[i],n[i]=!0)}function St(e,t,r,n,o,i,s,a,c){var l,u;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),l=0,u=o.length;l<u;l+=1)Array.isArray(o[l])&&C(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Da(o[l])==="[object Object]"&&(o[l]="[object Object]");if(typeof o=="object"&&Da(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(l=0,u=i.length;l<u;l+=1)Ia(e,t,i[l],r);else Ia(e,t,i,r);else!e.json&&!nt.call(r,o)&&nt.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,C(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:i}):t[o]=i,delete r[o];return t}function ko(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):C(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ne(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;yt(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Be(o))for(ko(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&jr(e,"deficient indentation"),n}function Br(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||be(r)))}function xo(e,t){t===1?e.result+=" ":t>1&&(e.result+=ae.repeat(`
|
|
63
|
+
`,t-1))}function Rm(e,t,r){var n,o,i,s,a,c,l,u,p=e.kind,d=e.result,g;if(g=e.input.charCodeAt(e.position),be(g)||At(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(o=e.input.charCodeAt(e.position+1),be(o)||r&&At(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;g!==0;){if(g===58){if(o=e.input.charCodeAt(e.position+1),be(o)||r&&At(o))break}else if(g===35){if(n=e.input.charCodeAt(e.position-1),be(n))break}else{if(e.position===e.lineStart&&Br(e)||r&&At(g))break;if(Be(g))if(c=e.line,l=e.lineStart,u=e.lineIndent,ne(e,!1,-1),e.lineIndent>=t){a=!0,g=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=l,e.lineIndent=u;break}}a&&(rt(e,i,s,!1),xo(e,e.line-c),i=s=e.position,a=!1),yt(g)||(s=e.position+1),g=e.input.charCodeAt(++e.position)}return rt(e,i,s,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function Om(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(rt(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else Be(r)?(rt(e,n,o,!0),xo(e,ne(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Br(e)?C(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);C(e,"unexpected end of the stream within a single quoted scalar")}function Tm(e,t){var r,n,o,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return rt(e,r,e.position,!0),e.position++,!0;if(a===92){if(rt(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Be(a))ne(e,!1,t);else if(a<256&&yc[a])e.result+=bc[a],e.position++;else if((s=wm(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=xm(a))>=0?i=(i<<4)+s:C(e,"expected hexadecimal character");e.result+=Am(i),e.position++}else C(e,"unknown escape sequence");r=n=e.position}else Be(a)?(rt(e,r,n,!0),xo(e,ne(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Br(e)?C(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}C(e,"unexpected end of the stream within a double quoted scalar")}function Pm(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,l,u,p,d,g,m=Object.create(null),y,k,R,O;if(O=e.input.charCodeAt(e.position),O===91)u=93,g=!1,a=[];else if(O===123)u=125,g=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(ne(e,!0,t),O=e.input.charCodeAt(e.position),O===u)return e.position++,e.tag=s,e.anchor=c,e.kind=g?"mapping":"sequence",e.result=a,!0;r?O===44&&C(e,"expected the node content, but found ','"):C(e,"missed comma between flow collection entries"),k=y=R=null,p=d=!1,O===63&&(l=e.input.charCodeAt(e.position+1),be(l)&&(p=d=!0,e.position++,ne(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,Rt(e,t,Lr,!1,!0),k=e.tag,y=e.result,ne(e,!0,t),O=e.input.charCodeAt(e.position),(d||e.line===n)&&O===58&&(p=!0,O=e.input.charCodeAt(++e.position),ne(e,!0,t),Rt(e,t,Lr,!1,!0),R=e.result),g?St(e,a,m,k,y,R,n,o,i):p?a.push(St(e,null,m,k,y,R,n,o,i)):a.push(y),ne(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(r=!0,O=e.input.charCodeAt(++e.position)):r=!1}C(e,"unexpected end of the stream within a flow collection")}function $m(e,t){var r,n,o=ho,i=!1,s=!1,a=t,c=0,l=!1,u,p;if(p=e.input.charCodeAt(e.position),p===124)n=!1;else if(p===62)n=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)ho===o?o=p===43?$a:vm:C(e,"repeat of a chomping mode identifier");else if((u=Cm(p))>=0)u===0?C(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?C(e,"repeat of an indentation width identifier"):(a=t+u-1,s=!0);else break;if(yt(p)){do p=e.input.charCodeAt(++e.position);while(yt(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Be(p)&&p!==0)}for(;p!==0;){for(ko(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Be(p)){c++;continue}if(e.lineIndent<a){o===$a?e.result+=ae.repeat(`
|
|
64
|
+
`,i?1+c:c):o===ho&&i&&(e.result+=`
|
|
65
65
|
`);break}for(n?yt(p)?(l=!0,e.result+=ae.repeat(`
|
|
66
66
|
`,i?1+c:c)):l?(l=!1,e.result+=ae.repeat(`
|
|
67
67
|
`,c+1)):c===0?i&&(e.result+=" "):e.result+=ae.repeat(`
|
|
68
68
|
`,c):e.result+=ae.repeat(`
|
|
69
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Be(p)&&p!==0;)p=e.input.charCodeAt(++e.position);rt(e,r,e.position,!1)}return!0}function
|
|
70
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
69
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Be(p)&&p!==0;)p=e.input.charCodeAt(++e.position);rt(e,r,e.position,!1)}return!0}function ja(e,t){var r,n=e.tag,o=e.anchor,i=[],s,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!be(s))));){if(a=!0,e.position++,ne(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Rt(e,t,hc,!1,!0),i.push(e.result),ne(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)C(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=i,!0):!1}function Dm(e,t,r){var n,o,i,s,a,c,l=e.tag,u=e.anchor,p={},d=Object.create(null),g=null,m=null,y=null,k=!1,R=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),O=e.input.charCodeAt(e.position);O!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(O===63||O===58)&&be(n))O===63?(k&&(St(e,p,d,g,m,null,s,a,c),g=m=y=null),R=!0,k=!0,o=!0):k?(k=!1,o=!0):C(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=n;else{if(s=e.line,a=e.lineStart,c=e.position,!Rt(e,r,fc,!1,!0))break;if(e.line===i){for(O=e.input.charCodeAt(e.position);yt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),be(O)||C(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(St(e,p,d,g,m,null,s,a,c),g=m=y=null),R=!0,k=!1,o=!1,g=e.tag,m=e.result;else if(R)C(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=l,e.anchor=u,!0}else if(R)C(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=l,e.anchor=u,!0}if((e.line===i||e.lineIndent>t)&&(k&&(s=e.line,a=e.lineStart,c=e.position),Rt(e,t,Ir,!0,o)&&(k?m=e.result:y=e.result),k||(St(e,p,d,g,m,y,s,a,c),g=m=y=null),ne(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&O!==0)C(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&St(e,p,d,g,m,null,s,a,c),R&&(e.tag=l,e.anchor=u,e.kind="mapping",e.result=p),R}function Nm(e){var t,r=!1,n=!1,o,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&C(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(r=!0,s=e.input.charCodeAt(++e.position)):s===33?(n=!0,o="!!",s=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):C(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!be(s);)s===33&&(n?C(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),mc.test(o)||C(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),km.test(i)&&C(e,"tag suffix cannot contain flow indicator characters")}i&&!gc.test(i)&&C(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{C(e,"tag name is malformed: "+i)}return r?e.tag=i:nt.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:C(e,'undeclared tag handle "'+o+'"'),!0}function Lm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&C(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!At(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Im(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!be(n)&&!At(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),nt.call(e.anchorMap,r)||C(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ne(e,!0,-1),!0}function Rt(e,t,r,n,o){var i,s,a,c=1,l=!1,u=!1,p,d,g,m,y,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Ir===r||hc===r,n&&ne(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Nm(e)||Lm(e);)ne(e,!0,-1)?(l=!0,a=i,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=l||o),(c===1||Ir===r)&&(Lr===r||fc===r?y=t:y=t+1,k=e.position-e.lineStart,c===1?a&&(ja(e,k)||Dm(e,k,y))||Pm(e,y)?u=!0:(s&&$m(e,y)||Om(e,y)||Tm(e,y)?u=!0:Im(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&C(e,"alias node should not have any properties")):Rm(e,y,Lr===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=a&&ja(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&C(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,d=e.implicitTypes.length;p<d;p+=1)if(m=e.implicitTypes[p],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(nt.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,g=e.typeMap.multi[e.kind||"fallback"],p=0,d=g.length;p<d;p+=1)if(e.tag.slice(0,g[p].tag.length)===g[p].tag){m=g[p];break}m||C(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&C(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):C(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function jm(e){var t=e.position,r,n,o,i=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(ne(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(i=!0,s=e.input.charCodeAt(++e.position),r=e.position;s!==0&&!be(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&C(e,"directive name must not be less than one character in length");s!==0;){for(;yt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Be(s));break}if(Be(s))break;for(r=e.position;s!==0&&!be(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&ko(e),nt.call(La,n)?La[n](e,n,o):jr(e,'unknown document directive "'+n+'"')}if(ne(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ne(e,!0,-1)):i&&C(e,"directives end mark is expected"),Rt(e,e.lineIndent-1,Ir,!1,!0),ne(e,!0,-1),e.checkLineBreaks&&Em.test(e.input.slice(t,e.position))&&jr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Br(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ne(e,!0,-1));return}if(e.position<e.length-1)C(e,"end of the stream or a document separator is expected");else return}function _c(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
70
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Sm(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,C(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)jm(r);return r.documents}function Fm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=_c(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Mm(e,t){var r=_c(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ge("expected a single document in the stream, but found more")}}var Bm=Fm,Hm=Mm,Ec={loadAll:Bm,load:Hm},kc=Object.prototype.toString,xc=Object.prototype.hasOwnProperty,wo=65279,Vm=9,rr=10,Gm=13,Um=32,Wm=33,qm=34,go=35,Ym=37,Km=38,Xm=39,zm=42,wc=44,Qm=45,Fr=58,Jm=61,Zm=62,eg=63,tg=64,Cc=91,Ac=93,rg=96,Sc=123,ng=124,Rc=125,pe={};pe[0]="\\0";pe[7]="\\a";pe[8]="\\b";pe[9]="\\t";pe[10]="\\n";pe[11]="\\v";pe[12]="\\f";pe[13]="\\r";pe[27]="\\e";pe[34]='\\"';pe[92]="\\\\";pe[133]="\\N";pe[160]="\\_";pe[8232]="\\L";pe[8233]="\\P";var og=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ig=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function sg(e,t){var r,n,o,i,s,a,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,i=n.length;o<i;o+=1)s=n[o],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),c=e.compiledTypeMap.fallback[s],c&&xc.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function ag(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ae.repeat("0",n-t.length)+t}var cg=1,nr=2;function lg(e){this.schema=e.schema||Eo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ae.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=sg(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?nr:cg,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Fa(e,t){for(var r=ae.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
71
71
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
72
|
-
`&&(i+=r),i+=s;return i}function
|
|
73
|
-
`+ae.repeat(" ",e.indent*t)}function
|
|
72
|
+
`&&(i+=r),i+=s;return i}function yo(e,t){return`
|
|
73
|
+
`+ae.repeat(" ",e.indent*t)}function ug(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function Mr(e){return e===Um||e===Vm}function or(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==wo||65536<=e&&e<=1114111}function Ma(e){return or(e)&&e!==wo&&e!==Gm&&e!==rr}function Ba(e,t,r){var n=Ma(e),o=n&&!Mr(e);return(r?n:n&&e!==wc&&e!==Cc&&e!==Ac&&e!==Sc&&e!==Rc)&&e!==go&&!(t===Fr&&!o)||Ma(t)&&!Mr(t)&&e===go||t===Fr&&o}function pg(e){return or(e)&&e!==wo&&!Mr(e)&&e!==Qm&&e!==eg&&e!==Fr&&e!==wc&&e!==Cc&&e!==Ac&&e!==Sc&&e!==Rc&&e!==go&&e!==Km&&e!==zm&&e!==Wm&&e!==ng&&e!==Jm&&e!==Zm&&e!==Xm&&e!==qm&&e!==Ym&&e!==tg&&e!==rg}function dg(e){return!Mr(e)&&e!==Fr}function er(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function Oc(e){var t=/^\n* /;return t.test(e)}var Tc=1,bo=2,Pc=3,$c=4,Ct=5;function fg(e,t,r,n,o,i,s,a){var c,l=0,u=null,p=!1,d=!1,g=n!==-1,m=-1,y=pg(er(e,0))&&dg(er(e,e.length-1));if(t||s)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=er(e,c),!or(l))return Ct;y=y&&Ba(l,u,a),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=er(e,c),l===rr)p=!0,g&&(d=d||c-m-1>n&&e[m+1]!==" ",m=c);else if(!or(l))return Ct;y=y&&Ba(l,u,a),u=l}d=d||g&&c-m-1>n&&e[m+1]!==" "}return!p&&!d?y&&!s&&!o(e)?Tc:i===nr?Ct:bo:r>9&&Oc(e)?Ct:s?i===nr?Ct:bo:d?$c:Pc}function hg(e,t,r,n,o){e.dump=function(){if(t.length===0)return e.quotingType===nr?'""':"''";if(!e.noCompatMode&&(og.indexOf(t)!==-1||ig.test(t)))return e.quotingType===nr?'"'+t+'"':"'"+t+"'";var i=e.indent*Math.max(1,r),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=n||e.flowLevel>-1&&r>=e.flowLevel;function c(l){return ug(e,l)}switch(fg(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case Tc:return t;case bo:return"'"+t.replace(/'/g,"''")+"'";case Pc:return"|"+Ha(t,e.indent)+Va(Fa(t,i));case $c:return">"+Ha(t,e.indent)+Va(Fa(mg(t,s),i));case Ct:return'"'+gg(t)+'"';default:throw new ge("impossible error: invalid scalar style")}}()}function Ha(e,t){var r=Oc(e)?String(t):"",n=e[e.length-1]===`
|
|
74
74
|
`,o=n&&(e[e.length-2]===`
|
|
75
75
|
`||e===`
|
|
76
76
|
`),i=o?"+":n?"":"-";return r+i+`
|
|
77
|
-
`}function
|
|
78
|
-
`?e.slice(0,-1):e}function
|
|
79
|
-
`);return l=l!==-1?l:e.length,r.lastIndex=l,
|
|
77
|
+
`}function Va(e){return e[e.length-1]===`
|
|
78
|
+
`?e.slice(0,-1):e}function mg(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var l=e.indexOf(`
|
|
79
|
+
`);return l=l!==-1?l:e.length,r.lastIndex=l,Ga(e.slice(0,l),t)}(),o=e[0]===`
|
|
80
80
|
`||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
|
|
81
|
-
`:"")+
|
|
81
|
+
`:"")+Ga(c,t),o=i}return n}function Ga(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,i,s=0,a=0,c="";n=r.exec(e);)a=n.index,a-o>t&&(i=s>o?s:a,c+=`
|
|
82
82
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
83
83
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
84
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function
|
|
85
|
-
`:""}var
|
|
86
|
-
`)[0]:e=Ke("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return Ke(`"${e}" --version`,{stdio:"pipe"}),e}catch{throw new Error(`Docker found at ${e} but not executable`)}}catch{let t=["/Applications/Docker.app/Contents/Resources/bin/docker","/usr/local/bin/docker","C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe","C:\\Program Files\\Docker\\Docker\\resources\\docker.exe","/usr/bin/docker","/snap/docker/current/bin/docker"];for(let r of t)if(
|
|
84
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function gg(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=er(e,o),n=pe[r],!n&&or(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||ag(r);return t}function yg(e,t,r){var n="",o=e.tag,i,s,a;for(i=0,s=r.length;i<s;i+=1)a=r[i],e.replacer&&(a=e.replacer.call(r,String(i),a)),(Ye(e,t,a,!1,!1)||typeof a>"u"&&Ye(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function Ua(e,t,r,n){var o="",i=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(Ye(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ye(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=yo(e,t)),e.dump&&rr===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function bg(e,t,r){var n="",o=e.tag,i=Object.keys(r),s,a,c,l,u;for(s=0,a=i.length;s<a;s+=1)u="",n!==""&&(u+=", "),e.condenseFlow&&(u+='"'),c=i[s],l=r[c],e.replacer&&(l=e.replacer.call(r,c,l)),Ye(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ye(e,t,l,!1,!1)&&(u+=e.dump,n+=u));e.tag=o,e.dump="{"+n+"}"}function vg(e,t,r,n){var o="",i=e.tag,s=Object.keys(r),a,c,l,u,p,d;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ge("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=yo(e,t)),l=s[a],u=r[l],e.replacer&&(u=e.replacer.call(r,l,u)),Ye(e,t+1,l,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&rr===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=yo(e,t)),Ye(e,t+1,u,!0,p)&&(e.dump&&rr===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function Wa(e,t,r){var n,o,i,s,a,c;for(o=r?e.explicitTypes:e.implicitTypes,i=0,s=o.length;i<s;i+=1)if(a=o[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(r?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,kc.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(xc.call(a.represent,c))n=a.represent[c](t,c);else throw new ge("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function Ye(e,t,r,n,o,i,s){e.tag=null,e.dump=r,Wa(e,r,!1)||Wa(e,r,!0);var a=kc.call(e.dump),c=n,l;n&&(n=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",p,d;if(u&&(p=e.duplicates.indexOf(r),d=p!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(o=!1),d&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(u&&d&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),a==="[object Object]")n&&Object.keys(e.dump).length!==0?(vg(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(bg(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Ua(e,t-1,e.dump,o):Ua(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(yg(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&hg(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ge("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(l=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",e.dump=l+" "+e.dump)}return!0}function _g(e,t){var r=[],n=[],o,i;for(vo(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function vo(e,t,r){var n,o,i;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,i=e.length;o<i;o+=1)vo(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)vo(e[n[o]],t,r)}function Eg(e,t){t=t||{};var r=new lg(t);r.noRefs||_g(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ye(r,0,n,!0,!0)?r.dump+`
|
|
85
|
+
`:""}var kg=Eg,xg={dump:kg};function Co(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var wg=ue,Cg=Ka,Ag=Ja,Sg=nc,Rg=oc,Og=Eo,Tg=Ec.load,Pg=Ec.loadAll,$g=xg.dump,Dg=ge,Ng={binary:lc,float:rc,map:Qa,null:Za,pairs:pc,set:dc,timestamp:ac,bool:ec,int:tc,merge:cc,omap:uc,seq:za,str:Xa},Lg=Co("safeLoad","load"),Ig=Co("safeLoadAll","loadAll"),jg=Co("safeDump","dump"),Fg={Type:wg,Schema:Cg,FAILSAFE_SCHEMA:Ag,JSON_SCHEMA:Sg,CORE_SCHEMA:Rg,DEFAULT_SCHEMA:Og,load:Tg,loadAll:Pg,dump:$g,YAMLException:Dg,types:Ng,safeLoad:Lg,safeLoadAll:Ig,safeDump:jg},ot=Fg;import Tt from"path";import{execSync as Ke}from"child_process";import Mg from"fs-extra";var Hr=null,Ao=()=>{if(Hr)return Hr;let e=Bg(),t=Hg(e),r=e,n=!0,o=Vg(t);return Hr={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},Hr};var Bg=()=>{try{let e;process.platform==="win32"?e=Ke("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
|
|
86
|
+
`)[0]:e=Ke("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return Ke(`"${e}" --version`,{stdio:"pipe"}),e}catch{throw new Error(`Docker found at ${e} but not executable`)}}catch{let t=["/Applications/Docker.app/Contents/Resources/bin/docker","/usr/local/bin/docker","C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe","C:\\Program Files\\Docker\\Docker\\resources\\docker.exe","/usr/bin/docker","/snap/docker/current/bin/docker"];for(let r of t)if(Mg.existsSync(r))try{return Ke(`"${r}" --version`,{stdio:"pipe"}),h.debug(f.yellow(`Found Docker at: ${r}`)),r}catch{}throw new Error("Docker not found in PATH or common installation locations")}},Hg=e=>{try{return Ke(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(f.yellow("Could not determine Docker version")),"unknown"}},Vg=e=>{let t=e.match(/Docker version (\d+)\.(\d+)/);if(!t)return!1;let r=parseInt(t[1]),n=parseInt(t[2]);return r>28||r===28&&n>=0},Vr=()=>{h.raw(f.blue("\u{1F433} Checking Docker installation..."));try{let e=Ao();h.debug(`\u2705 Docker found at: ${e.dockerPath}`),h.debug(`Docker version: ${e.version}`);try{Ke(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),h.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(f.red(`
|
|
87
87
|
\u274C Modern Docker Compose is not available`)),console.warn(f.yellow(`
|
|
88
88
|
\u{1F4CB} Raclette requires Docker with integrated 'compose' command`)),console.warn(f.yellow("Please update to Docker version 20.10.13+ or Docker Desktop 4.1.0+")),new Error("Modern Docker Compose is required")}e.isDocker28Plus&&h.debug("\u26A0\uFE0F Detected Docker 28+, using enhanced path resolution");try{Ke(`"${e.dockerPath}" info`,{stdio:"pipe",encoding:"utf8"}),h.success(" Docker daemon is running")}catch{throw h.error("Docker daemon is not running"),h.warn("Please start Docker Desktop or the Docker daemon and try again."),process.platform==="darwin"?console.log(f.yellow(`
|
|
89
89
|
macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(f.yellow(`
|
|
90
90
|
Windows: Start Docker Desktop from the Start menu`)):console.log(f.yellow(`
|
|
91
91
|
Linux: Start Docker daemon with "systemctl start docker"`)),new Error("Docker daemon is not running")}return e}catch(e){throw e.message.includes("Docker daemon is not running")||e.message.includes("Modern Docker Compose is required")?e:(h.error("Docker installation issue: "+e.message),console.log(f.yellow(`
|
|
92
|
-
\u{1F4E5} Installation guide:`)),console.log(f.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(f.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(f.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},ce=(e,t={})=>{let n=`"${
|
|
93
|
-
Error: ${o.message}`)}},ye=(e,t={})=>{let n=`"${
|
|
94
|
-
Error: ${o.message}`)}},ir=e=>{try{return ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Ot=e=>{try{return ce(["ps","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Gr=e=>{h.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{if(ce(["network","ls","--format",'"{{.Name}}"',"|","grep",e]).trim()===e){h.debug(`\u2705 Network '${e}' already exists`);return}}catch{h.debug(`\u{1F310} Creating Docker network '${e}'...`);try{ce(["network","create",e],{stdio:"inherit"}),h.debug(`\u2705 Network '${e}' created`)}catch(r){throw h.error("Failed to create network: "+r.message),r}}},
|
|
95
|
-
`).filter(r=>r.trim().length>0):[]}catch{return[]}},Nc=e=>{let t=Ug(e);if(t.length===0){h.debug(`\u26A0\uFE0F No containers found with prefix '${e}'`);return}h.debug(`\u26A0\uFE0F Found ${t.length} container(s) with prefix '${e}':`),t.forEach(r=>{h.debug(` - ${r}`)});try{h.debug("Stopping containers..."),ce(["stop",...t],{stdio:"inherit"}),h.debug("Removing containers..."),ce(["rm",...t],{stdio:"inherit"}),h.success(`Successfully stopped and removed ${t.length} container(s)`)}catch(r){throw h.error(`Failed to stop containers with prefix '${e}': ${r.message}`),r}};var Wg="raclette-public-shared",qg=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),Oo=(e,t)=>Tt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Tt.resolve(t,e):Tt.resolve(t,e),Wr=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Wr(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=Oo(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=qg(o):o&&typeof o=="object"?r[n]=Wr(o,t):r[n]=o;return r},it=(e,t)=>{let r=Wr(e,t);if(r.source&&r.source.includes("/")&&(r.source=Oo(r.source,t)),r.mustExist&&!Ur.existsSync(r.source))return h.debug(`Skipping volume mount: ${r.source} does not exist`),null;if(!r.type&&!r.readonly&&!r.volumeOptions&&!r.bindOptions&&!r.tmpfsOptions)return`${r.source}:${r.target}${r.readonly?":ro":""}`;let n={type:r.type||"volume",source:r.source,target:r.target};return r.readonly&&(n.read_only=!0),r.volumeOptions&&(n.volume=r.volumeOptions),r.bindOptions&&(n.bind=r.bindOptions),r.tmpfsOptions&&(n.tmpfs=r.tmpfsOptions),n},Yg=(e,t)=>{if(!e.includes("/")||e.startsWith("${"))return e;let r=e.split(":");if(r.length<2)return e;let n=r[0],o=r[1],i=r.slice(2).join(":"),s=Oo(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},qr=(e,t)=>e.map(r=>typeof r=="string"?Yg(r,t):r).map(r=>r),Yr=(e="development")=>process.cwd().includes("node_modules")?{npmrcPath:"../../../.npmrc",yarnrcPath:"../../../.yarnrc"}:{npmrcPath:"./.npmrc",yarnrcPath:"./.yarnrc"},To=async(e,t,r,n=!1,o="development",i=!0,s=!0)=>{let a={services:{},volumes:{"yarn-cache":{driver:"local"}},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},c=e.env[o]||{};a.volumes[Wg]=null,e.volumes&&Object.entries(e.volumes).forEach(([p,d])=>{d===null?a.volumes[p]=null:a.volumes[p]=Wr(d,t)});let l=!1,u=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let p=e.services.mongodb.name;ir(p)&&(h.debug(`MongoDB container '${p}' already exists, will be skipped`),l=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let p=e.services.cache.name;ir(p)&&(h.debug(`Cache container '${p}' already exists, will be skipped`),u=!0)}}if(e.services.mongodb?.enabled&&!l){let d=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,g=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,m=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${d}}`,image:"mongo:5.0.6",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${g}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${m}}:/data/config`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},e.services.mongodb.volumes&&e.services.mongodb.volumes.length>0&&e.services.mongodb.volumes.forEach(y=>{let k=it(y,t);a.services.mongodb.volumes.push(k)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null),!m.startsWith("/")&&!m.startsWith("./")&&(a.volumes[m]=null)}if(e.services.cache?.enabled&&!u){let d=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,g=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${d}}`,image:"valkey/valkey:8.1-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${g}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let m=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",y=e?.backend?.cache?.persistence||"none";y==="none"&&(a.services.cache.command='valkey-server --save ""'),y==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),y==="rdb"&&(a.services.cache.command="valkey-server --save "+m),y==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+m),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(k=>{let C=it(k,t);a.services.cache.volumes.push(C)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(!n){let{npmrcPath:p,yarnrcPath:d}=Yr(),g=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let m=e.services.backend.name??`${e.name}-backend`,y=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${m}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:g?"yarn run dev:inspect":"yarn dev",environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${RACLETTE_SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}","RACLETTE_FRONTEND_URLS=${RACLETTE_FRONTEND_URLS:-}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://mongodb:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb?.port||27017}}/\${RACLETTE_MONGODB_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-redis://cache:\${RACLETTE_CACHE_PORT:-${e.services.cache?.port||6379}}}${e.services.cache?.db?`/${e.services.cache?.db}`:""}`,...Object.entries(c).map(([k,C])=>`${k}=${C}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${y}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${Pt("backend",e)}:/app/yarn.lock`]:[],`${p}:/app/.npmrc`,`${d}:/app/.yarnrc`],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...g?[`${g||"9229"}:9229`]:[]],networks:["raclette_shared"],depends_on:{},healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},e.services.backend.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(k=>{let C=it(k,t);C&&a.services.backend.volumes.push(C)}),e.services.mongodb?.enabled&&!l&&(a.services.backend.depends_on.mongodb={condition:"service_started"}),e.services.cache?.enabled&&!u&&(a.services.backend.depends_on.cache={condition:"service_healthy"}),Object.keys(a.services.backend.depends_on).length===0&&delete a.services.backend.depends_on,a.volumes[y]=null}if(e.services.frontend?.enabled){let m=e.services.frontend.name??`${e.name}-frontend`,y=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,k=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${m}}`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:`\${NODE_ENV:-${o}}`},target:`\${NODE_ENV:-${o}}`},command:"yarn dev",depends_on:{},environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-true}",`RACLETTE_SERVER_BASE_URL=\${RACLETTE_SERVER_BASE_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,`RACLETTE_SOCKET_URL=\${RACLETTE_SOCKET_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,...Object.entries(c).map(([C,R])=>`${C}=${R}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${y}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins",...o==="development"?["./.raclette/frontend/raclette.config.js:/app/raclette.config.js",`${Pt("frontend",e)}:/app/yarn.lock`]:[],`${p}:/app/.npmrc`,`${d}:/app/.yarnrc`],ports:[`\${RACLETTE_CLIENT_PORT:-${e.services.frontend.port}}:8081`],networks:["raclette_shared"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:8081/"],interval:"10s",timeout:"30s",retries:10}},o!=="production"&&(a.services.frontend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.frontend.volumes.push("./.raclette/frontend/package.json:/app/package.json"),a.services.frontend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.backend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/backend/package.json:/app/package.json")),e.services.frontend.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(C=>{let R=it(C,t);R&&a.services.frontend.volumes.push(R)}),e.services.backend?.enabled&&(a.services.frontend.depends_on.backend={condition:"service_healthy"}),Object.keys(a.services.frontend.depends_on).length===0&&delete a.services.frontend.depends_on,a.volumes[y]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let m=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,y=m&&!m.endsWith("/")?m+"/":m;a.services.backend?.volumes?.push(`${y}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${y}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(p=>{p.volumes&&(p.volumes=qr(p.volumes,t))}),await Ur.writeFile(r,ot.dump(a)),await Kr(e,Tt.dirname(r),o)},Pt=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Lc=async(e,t,r,n="development")=>{await To(e,t,r,!1,n,!1,!1)},Kr=async(e,t,r)=>{let n=Tt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
|
|
92
|
+
\u{1F4E5} Installation guide:`)),console.log(f.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(f.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(f.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},ce=(e,t={})=>{let n=`"${Ao().dockerPath}" ${e.join(" ")}`;try{let o=Ke(n,{...t,stdio:t.stdio||"pipe",encoding:t.stdio==="inherit"?void 0:t.encoding||"utf8",shell:!0});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker command failed: ${n}
|
|
93
|
+
Error: ${o.message}`)}},ye=(e,t={})=>{let n=`"${Ao().composeCommand}" compose ${e.join(" ")}`;h.debug(`Execute Docker Command: ${n}`);try{let o=Ke(n,{stdio:"pipe",encoding:"utf8",shell:!0,...t});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker Compose command failed: ${n}
|
|
94
|
+
Error: ${o.message}`)}},ir=e=>{try{return ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Ot=e=>{try{return ce(["ps","--format",'"{{.Names}}"',"|","grep",`"^${e}$"`]).trim()===e}catch{return!1}},Gr=e=>{h.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{if(ce(["network","ls","--format",'"{{.Name}}"',"|","grep",e]).trim()===e){h.debug(`\u2705 Network '${e}' already exists`);return}}catch{h.debug(`\u{1F310} Creating Docker network '${e}'...`);try{ce(["network","create",e],{stdio:"inherit"}),h.debug(`\u2705 Network '${e}' created`)}catch(r){throw h.error("Failed to create network: "+r.message),r}}},So=(e,t,r={})=>ce(["exec",e,"sh","-c",`"${t}"`],r),Gg=e=>{try{let t=ce(["ps","-a","--format",'"{{.Names}}"',"|","grep",`"^${e}"`]);return t.trim()?t.trim().split(`
|
|
95
|
+
`).filter(r=>r.trim().length>0):[]}catch{return[]}},Dc=e=>{let t=Gg(e);if(t.length===0){h.debug(`\u26A0\uFE0F No containers found with prefix '${e}'`);return}h.debug(`\u26A0\uFE0F Found ${t.length} container(s) with prefix '${e}':`),t.forEach(r=>{h.debug(` - ${r}`)});try{h.debug("Stopping containers..."),ce(["stop",...t],{stdio:"inherit"}),h.debug("Removing containers..."),ce(["rm",...t],{stdio:"inherit"}),h.success(`Successfully stopped and removed ${t.length} container(s)`)}catch(r){throw h.error(`Failed to stop containers with prefix '${e}': ${r.message}`),r}};var Ug="raclette-public-shared",Wg=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),Ro=(e,t)=>Tt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Tt.resolve(t,e):Tt.resolve(t,e),Wr=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Wr(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=Ro(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=Wg(o):o&&typeof o=="object"?r[n]=Wr(o,t):r[n]=o;return r},it=(e,t)=>{let r=Wr(e,t);if(r.source&&r.source.includes("/")&&(r.source=Ro(r.source,t)),r.mustExist&&!Ur.existsSync(r.source))return h.debug(`Skipping volume mount: ${r.source} does not exist`),null;if(!r.type&&!r.readonly&&!r.volumeOptions&&!r.bindOptions&&!r.tmpfsOptions)return`${r.source}:${r.target}${r.readonly?":ro":""}`;let n={type:r.type||"volume",source:r.source,target:r.target};return r.readonly&&(n.read_only=!0),r.volumeOptions&&(n.volume=r.volumeOptions),r.bindOptions&&(n.bind=r.bindOptions),r.tmpfsOptions&&(n.tmpfs=r.tmpfsOptions),n},qg=(e,t)=>{if(!e.includes("/")||e.startsWith("${"))return e;let r=e.split(":");if(r.length<2)return e;let n=r[0],o=r[1],i=r.slice(2).join(":"),s=Ro(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},qr=(e,t)=>e.map(r=>typeof r=="string"?qg(r,t):r).map(r=>r),Oo=async(e,t,r,n=!1,o="development",i=!0,s=!0)=>{let a={services:{},volumes:{"yarn-cache":{driver:"local"}},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},c=e.env[o]||{};a.volumes[Ug]=null,e.volumes&&Object.entries(e.volumes).forEach(([p,d])=>{d===null?a.volumes[p]=null:a.volumes[p]=Wr(d,t)});let l=!1,u=!1;if(i&&s){if(e.services.mongodb?.enabled&&e.services.mongodb.name){let p=e.services.mongodb.name;ir(p)&&(h.debug(`MongoDB container '${p}' already exists, will be skipped`),l=!0)}if(e.services.cache?.enabled&&e.services.cache.name){let p=e.services.cache.name;ir(p)&&(h.debug(`Cache container '${p}' already exists, will be skipped`),u=!0)}}if(e.services.mongodb?.enabled&&!l){let d=!!e.services.mongodb.name?e.services.mongodb.name:`${e.name}-mongodb`,g=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,m=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${d}}`,image:"mongo:5.0.6",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${g}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${m}}:/data/config`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},e.services.mongodb.volumes&&e.services.mongodb.volumes.length>0&&e.services.mongodb.volumes.forEach(y=>{let k=it(y,t);a.services.mongodb.volumes.push(k)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null),!m.startsWith("/")&&!m.startsWith("./")&&(a.volumes[m]=null)}if(e.services.cache?.enabled&&!u){let d=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,g=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${d}}`,image:"valkey/valkey:8.1-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${g}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let m=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",y=e?.backend?.cache?.persistence||"none";y==="none"&&(a.services.cache.command='valkey-server --save ""'),y==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),y==="rdb"&&(a.services.cache.command="valkey-server --save "+m),y==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+m),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(k=>{let R=it(k,t);a.services.cache.volumes.push(R)}),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(!n){let p=process.env.RACLETTE_DEBUG_PORT||(e.services?.backend?.enableDebug?9229:void 0);if(e.services.backend?.enabled){let d=e.services.backend.name??`${e.name}-backend`,g=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;a.services.backend={container_name:`\${RACLETTE_SERVER_CONTAINERNAME:-${d}}`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:o}},command:p?"yarn run dev:inspect":"yarn dev",environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${RACLETTE_SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}","RACLETTE_FRONTEND_URLS=${RACLETTE_FRONTEND_URLS:-}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://mongodb:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb?.port||27017}}/\${RACLETTE_MONGODB_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-redis://cache:\${RACLETTE_CACHE_PORT:-${e.services.cache?.port||6379}}}${e.services.cache?.db?`/${e.services.cache?.db}`:""}`,...Object.entries(c).map(([m,y])=>`${m}=${y}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn",`${g}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins",...o==="development"?["./.raclette/backend/raclette.config.js:/app/raclette.config.js",`${Pt("backend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_SERVER_PORT:-${e.services.backend.port}}:3000`,...p?[`${p||"9229"}:9229`]:[]],networks:["raclette_shared"],depends_on:{},healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},e.services.backend.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(m=>{let y=it(m,t);y&&a.services.backend.volumes.push(y)}),e.services.mongodb?.enabled&&!l&&(a.services.backend.depends_on.mongodb={condition:"service_started"}),e.services.cache?.enabled&&!u&&(a.services.backend.depends_on.cache={condition:"service_healthy"}),Object.keys(a.services.backend.depends_on).length===0&&delete a.services.backend.depends_on,a.volumes[g]=null}if(e.services.frontend?.enabled){let d=e.services.frontend.name??`${e.name}-frontend`,g=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,m=8081;a.services.frontend={container_name:`\${RACLETTE_CLIENT_CONTAINERNAME:-${d}}`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:`\${NODE_ENV:-${o}}`},target:`\${NODE_ENV:-${o}}`},command:"yarn dev",depends_on:{},environment:[`NODE_ENV=\${NODE_ENV:-${o}}`,"RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-true}",`RACLETTE_SERVER_BASE_URL=\${RACLETTE_SERVER_BASE_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,`RACLETTE_SOCKET_URL=\${RACLETTE_SOCKET_URL:-http://localhost:\${RACLETTE_SERVER_PORT:-${e.services.backend?.port||8082}}}`,...Object.entries(c).map(([y,k])=>`${y}=${k}`)],volumes:["yarn-cache:/usr/local/share/.cache/yarn","./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${g}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins",...o==="development"?["./.raclette/frontend/raclette.config.js:/app/raclette.config.js",`${Pt("frontend",e)}:/app/yarn.lock`]:[]],ports:[`\${RACLETTE_CLIENT_PORT:-${e.services.frontend.port}}:8081`],networks:["raclette_shared"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:8081/"],interval:"10s",timeout:"30s",retries:10}},o!=="production"&&(a.services.frontend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.frontend.volumes.push("./.raclette/frontend/package.json:/app/package.json"),a.services.frontend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh"),a.services.backend.entrypoint=["/app/check-dependencies.sh"],a.services.backend.volumes.push("./.raclette/backend/package.json:/app/package.json")),e.services.frontend.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(y=>{let k=it(y,t);k&&a.services.frontend.volumes.push(k)}),e.services.backend?.enabled&&(a.services.frontend.depends_on.backend={condition:"service_healthy"}),Object.keys(a.services.frontend.depends_on).length===0&&delete a.services.frontend.depends_on,a.volumes[g]=null}if(e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH){let d=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,g=d&&!d.endsWith("/")?d+"/":d;a.services.backend?.volumes?.push(`${g}services/backend/src/corePlugins:/app/src/corePlugins`),a.services.frontend?.volumes?.push(`${g}services/backend/src/corePlugins:/app/src/corePlugins`)}}Object.values(a.services).forEach(p=>{p.volumes&&(p.volumes=qr(p.volumes,t))}),await Ur.writeFile(r,ot.dump(a)),await Yr(e,Tt.dirname(r),o)},Pt=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Nc=async(e,t,r,n="development")=>{await Oo(e,t,r,!1,n,!1,!1)},Yr=async(e,t,r)=>{let n=Tt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
|
|
96
96
|
WORKDIR /app
|
|
97
97
|
|
|
98
98
|
# add bash since alpine doesn't come with a shell
|
|
@@ -183,7 +183,7 @@ RUN chmod +x /docker-entrypoint.d/entrypoint.sh
|
|
|
183
183
|
ENV PORT 80
|
|
184
184
|
EXPOSE 80
|
|
185
185
|
|
|
186
|
-
CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import
|
|
186
|
+
CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Lc from"path";var Kr=async(e,t,r)=>{let n=[];return r&&(console.log(f.blue("\u{1F504} Force rebuild enabled - rebuilding all services")),e.services.frontend?.enabled&&n.push("frontend"),e.services.backend?.enabled&&n.push("backend"),e.services.workbench?.enabled&&n.push("workbench")),n},Xr=async(e,t,r,n={})=>{if(r.length===0)return;console.log(f.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=Lc.join(t,"docker-compose.yml"),i=e.name??Lc.basename(process.cwd());for(let s of r)try{console.log(f.blue(`\u{1F504} Rebuilding ${s} service...`));let a=["-p",i,"-f",o,"build"];n.noCache&&a.push("--no-cache"),a.push(s),ye(a,{stdio:"inherit"}),h.success(` Service ${s} rebuilt successfully`)}catch(a){h.error(`Error rebuilding service ${s}: ${a.message}`)}};import zc from"fs-extra";import Qc from"path";var Ic=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?Yg():[]],Yg=()=>[],jc=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],Fc=(e=!1)=>{let t=` // JavaScript config
|
|
187
187
|
{
|
|
188
188
|
files: ["**/*.{js,mjs,cjs}"],
|
|
189
189
|
languageOptions: {
|
|
@@ -228,7 +228,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
228
228
|
}
|
|
229
229
|
}`;return e?t+`,
|
|
230
230
|
|
|
231
|
-
`+
|
|
231
|
+
`+Kg():t},Kg=()=>` // Style recommended config
|
|
232
232
|
{
|
|
233
233
|
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
|
|
234
234
|
rules: {
|
|
@@ -251,7 +251,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
251
251
|
{ min: 3, exceptions: ["i", "j", "a", "b", "fs", "id"], properties: "never" },
|
|
252
252
|
],
|
|
253
253
|
}
|
|
254
|
-
}`;var
|
|
254
|
+
}`;var Mc=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?Xg():[]],Xg=()=>[],Bc=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],Hc=(e=!1)=>{let t=` // React config
|
|
255
255
|
{
|
|
256
256
|
files: ["**/*.{jsx,tsx}"],
|
|
257
257
|
plugins: {
|
|
@@ -275,7 +275,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
275
275
|
}
|
|
276
276
|
}`;return e?t+`,
|
|
277
277
|
|
|
278
|
-
`+
|
|
278
|
+
`+zg():t},zg=()=>"";var Vc=(e=!1)=>["typescript-eslint",...e?Qg():[]],Qg=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],Gc=e=>{let t=["import tseslint from 'typescript-eslint';"];return e&&(t.push("import importPlugin from 'eslint-plugin-import';"),t.push("import preferArrow from 'eslint-plugin-prefer-arrow-functions';")),t},Uc=(e=!1)=>{let r=` // TypeScript config
|
|
279
279
|
{
|
|
280
280
|
files: ["**/*.{ts,tsx}"],
|
|
281
281
|
plugins: ${e?`{
|
|
@@ -304,7 +304,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
304
304
|
}
|
|
305
305
|
}`;return e?r+`,
|
|
306
306
|
|
|
307
|
-
`+
|
|
307
|
+
`+Jg():r},Jg=()=>` // TypeScript recommended config
|
|
308
308
|
{
|
|
309
309
|
files: ["**/*.{ts,tsx}"],
|
|
310
310
|
rules: {
|
|
@@ -387,7 +387,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
387
387
|
}
|
|
388
388
|
]
|
|
389
389
|
}
|
|
390
|
-
}`;var
|
|
390
|
+
}`;var Wc=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser","tailwindcss",...e?Zg():[]],Zg=()=>[],qc=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';","import tailwindcss from 'eslint-plugin-tailwindcss';"],Yc=(e=!1)=>{let t=` // Vue config
|
|
391
391
|
{
|
|
392
392
|
files: ["**/*.vue"],
|
|
393
393
|
// Manually add Vue plugin
|
|
@@ -429,7 +429,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
429
429
|
}
|
|
430
430
|
}`;return e?t+`,
|
|
431
431
|
|
|
432
|
-
`+
|
|
432
|
+
`+ey():t},ey=()=>` // Vue recommended config
|
|
433
433
|
{
|
|
434
434
|
files: ["**/*.vue"],
|
|
435
435
|
rules: {
|
|
@@ -472,7 +472,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
472
472
|
"vue/v-on-style": "error",
|
|
473
473
|
"vue/v-slot-style": "error"
|
|
474
474
|
}
|
|
475
|
-
}`;import{existsSync as
|
|
475
|
+
}`;import{existsSync as To}from"fs";import Po from"path";var Kc=e=>{let t=e?.eslint?.useRecommended;return e.frontend?.framework==="vue"?Wc(t):e.frontend?.framework==="react"?Mc(t):[]},Xc=e=>{let t=[...e].sort(),r=To(Po.join(process.cwd(),"yarn.lock")),n=To(Po.join(process.cwd(),"pnpm-lock.yaml")),o=To(Po.join(process.cwd(),"bun.lockb")),i="npm",s="install";return r?(i="yarn",s="add"):n?(i="pnpm",s="add"):o&&(i="bun",s="add"),`${i} ${s} -D ${t.join(" ")}`};var zr=async(e,t,r=!0)=>{let n=Qc.join(t,"eslint.config.mjs");h.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=ty(e,o),s=[];if(s.push(` // TS ESLint base rules
|
|
476
476
|
{
|
|
477
477
|
files: ["**/*.{ts,tsx}"],
|
|
478
478
|
plugins: {
|
|
@@ -503,7 +503,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await Ur.writeFile(i,s)};import Ic from"path
|
|
|
503
503
|
".raclette/**",
|
|
504
504
|
".gitignore"
|
|
505
505
|
]
|
|
506
|
-
}`),s.push(
|
|
506
|
+
}`),s.push(Fc(o)),s.push(Uc(o)),e.frontend?.framework==="vue"&&s.push(Yc(o)),e.frontend?.framework==="react"&&s.push(Hc(o)),e.eslint?.rules&&Object.keys(e.eslint.rules).length>0){let c=JSON.stringify(e.eslint.rules,null,2).replace(/"([^"]+)":/g,"$1:");s.push(` // User custom rules
|
|
507
507
|
{
|
|
508
508
|
rules: ${c}
|
|
509
509
|
}`)}if(e.eslint?.ignores&&e.eslint.ignores.length>0){let c=JSON.stringify(e.eslint.ignores).replace(/^\[|\]$/g,"");s.push(` // User custom ignores
|
|
@@ -541,7 +541,7 @@ export const withRaclette = (...userConfigs) => {
|
|
|
541
541
|
|
|
542
542
|
// Default export for direct usage
|
|
543
543
|
export default racletteEslintConfig
|
|
544
|
-
`;await
|
|
544
|
+
`;await zc.writeFile(n,a),r&&await ry(t,e),h.debug(`Generated eslint.config.mjs in ${t}`)},ty=(e,t)=>{let r=[];return r.push(...jc()),r.push(...Gc(t)),e.frontend?.framework==="vue"?r.push(...qc()):e.frontend?.framework==="react"&&r.push(...Bc()),r},ry=async(e,t)=>{let r=Qc.join(e,"ESLINT-README.md"),n=t.eslint?.useRecommended!==!1,o=Ic(n),i=Vc(n),s=Kc(t),a=[...o,...i,...s],l=`# Raclette ESLint Configuration
|
|
545
545
|
|
|
546
546
|
This directory contains an auto-generated ESLint configuration for your Raclette project.
|
|
547
547
|
|
|
@@ -550,7 +550,7 @@ This directory contains an auto-generated ESLint configuration for your Raclette
|
|
|
550
550
|
To use this ESLint configuration, you need to install the following dependencies:
|
|
551
551
|
|
|
552
552
|
\`\`\`bash
|
|
553
|
-
${
|
|
553
|
+
${Xc(a)}
|
|
554
554
|
\`\`\`
|
|
555
555
|
|
|
556
556
|
## How to Use
|
|
@@ -627,35 +627,35 @@ export default {
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
\`\`\`
|
|
630
|
-
`;await Qc.writeFile(r,l)};import{execSync as vk}from"child_process";import J from"fs-extra";import te from"path";import uk from"chokidar";import $ from"fs-extra";import S from"path";var $d=[".prettierrc","eslint.config.js"],pk=["bin/check-dependencies.sh"],Oe=async()=>{let e=S.join(process.cwd(),".raclette");return await $.ensureDir(e),e},Nn=async(e,t,r)=>{let n=process.cwd(),o=S.join(n,".raclette"),i=S.join(o,"virtual"),s=Ln();h.debug(`\u{1F4E6} Using core package at: ${s}`),await yk(o,s,pk),h.debug("[VFS] Cleaning virtual file system directory..."),await $.pathExists(i)&&await $.rm(i,{recursive:!0}),await $.ensureDir(i);let a=[{name:"generated-service-files",path:o,servicePathMap:{backend:".",frontend:"."},priority:1},{name:"app",path:n,servicePathMap:{backend:"services",frontend:"services"},folderMappings:{shared:"backend/src/shared/app",i18n:"frontend/src/orchestrator/i18n/app"},priority:10},{name:"core-types",path:s,servicePathMap:{backend:"",frontend:""},folderMappings:{"src/types.ts":["backend/types/index.ts","frontend/types/index.ts"]},priority:29},{name:"core",path:s,servicePathMap:{backend:"services",frontend:"services"},priority:30},...e?.sourceDirectories||[],...t??[]],c=new Map,l={backend:["/"],frontend:["/"]},u=[...a].sort((y,k)=>k.priority-y.priority).map(y=>{let k=y.path.startsWith(".")?S.join(process.cwd(),y.path):y.path;return{...y,path:k}});await mk(u,c,i,l,$d,o);let p=[],d=y=>{let k=S.relative(n,y);return c.get(k)||y},g=()=>{p.forEach(k=>k.close()),p.length=0,dk(u,l,i).forEach(k=>{if($.existsSync(k.sourcePath)){let C=fk(k,u,c,$d);p.push(C)}})},m=()=>p.forEach(y=>y.close());return r||g(),{resolveFile:d,watchFiles:g,close:m}},dk=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",l=S.join(o.path,c,i,a);n.push({sourcePath:l,sourceDir:o,targetResolver:u=>S.join(r,i,a,u),mappingKeyResolver:u=>S.join(i,a,u)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=S.join(o.path,i);$.existsSync(a)&&$.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(u=>{n.push({sourcePath:S.dirname(a),sourceDir:o,targetResolver:p=>S.basename(a)===p?S.join(r,u):S.join(r,u,p),mappingKeyResolver:p=>S.basename(a)===p?i:S.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:l=>S.join(r,i,l),mappingKeyResolver:l=>S.join(i,l)})})}),n},fk=(e,t,r,n)=>{h.debug(`[VFS] Setting up watcher for ${e.sourceDir.name}: ${e.sourcePath}`);let o=e.sourceDir.name==="generated-service-files"?["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss","**/package.json","**/yarn.lock","**/*.json"]:["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss"],i=uk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(gk(a,n))return;let l=e.mappingKeyResolver(a),u=e.targetResolver(a);await hk(t,r,l,u,a,c)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},hk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=Dd(s,r,o);a?(await $.ensureDir(S.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),h.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await $.pathExists(n)&&await $.remove(n),t.delete(r),h.debug(`[VFS] Removed ${r}`))}else{let a=Dd(s,r,o);a&&(await $.ensureDir(S.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),h.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},Dd=(e,t,r)=>{for(let n of e){let o={backend:["/"],frontend:["/"]};for(let[i,s]of Object.entries(o))for(let a of s)if(S.join(i,a,r)===t){let l=n.servicePathMap?.[i]||"",u=S.join(n.path,l,i,a,r);if($.existsSync(u))return{sourceDir:n,fullPath:u}}if(n.folderMappings)for(let[i,s]of Object.entries(n.folderMappings)){let a=Array.isArray(s)?s:[s];for(let c of a){let l,u;if(i===t){if(u=S.join(n.path,i),$.existsSync(u))return{sourceDir:n,fullPath:u}}else if(l=S.join(i,r),l===t&&(u=S.join(n.path,i,r),$.existsSync(u)))return{sourceDir:n,fullPath:u}}}}return null},Nd=async(e,t,r,n,o,i)=>{if(!await $.pathExists(t))return;await $.ensureDir(S.dirname(r));let s=e.name==="generated-service-files";await $.copy(t,r,{overwrite:!0,filter:l=>{let u=S.basename(l);if(i.includes(u))return!1;if(s&&(u==="package.json"||u==="yarn.lock"))return!0;if(!s&&(u==="package.json"||u==="yarn.lock"))return!1;let p=S.relative(t,l);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")}});let c=await bk(t,s?["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss","**/package.json","**/yarn.lock"]:["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss"]);for(let l of c){let u=S.basename(l);if(i.includes(u))continue;if(!(s&&(u==="package.json"||u==="yarn.lock"))){if(!s&&(u==="package.json"||u==="yarn.lock"))continue}let p=S.relative(t,l),d=S.join(o,p),g=S.join(r,p);n.set(d,g)}h.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},mk=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await $.pathExists(s.path)){console.warn(f.yellow(`[VFS] Source directory not found: ${s.path}`));continue}for(let[a,c]of Object.entries(n))for(let l of c){let u=s.servicePathMap?.[a]||"";if(!u)continue;let p=S.join(s.path,u,a,l),d=S.join(r,a,l),g=S.join(a,l);await Nd(s,p,d,t,g,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let l=S.join(s.path,a),u=(Array.isArray(c)?c:[c]).map(d=>S.join(r,d)),p=await $.pathExists(l)&&(await $.stat(l)).isFile();if(!p&&s.clear)for(let d of u)await $.rm(d,{recursive:!0,force:!0}),await $.ensureDir(d);if(p)for(let d of u)await $.ensureDir(S.dirname(d)),await $.copy(l,d),t.set(a,d),h.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of u)await Nd(s,l,d,t,d,o)}}h.debug("[VFS] Built virtual file system")},gk=(e,t)=>t.includes(S.basename(e));var yk=async(e,t,r)=>{let n=S.join(e,"dist");await $.ensureDir(n);for(let o of r){let i=S.join(t,o),s=S.basename(o),a=S.join(n,s);await $.pathExists(a)&&await $.remove(a),await $.pathExists(i)&&(await $.ensureDir(S.dirname(a)),await $.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await $.chmod(a,493),h.debug(`[VFS] Copied ${s} to dist directory`))}},bk=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(Pd(),Td));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Ln=()=>{let e=process.cwd();h.debug("process.cwd(): "+process.cwd());let r=e.includes("node_modules")?[S.join(e.match(/(.*node_modules)/)?.[1]||"","@raclettejs/core"),S.join(e,"node_modules","@raclettejs/core"),S.join(e,"..","..","..","@raclettejs/core")]:[S.join(e,"node_modules","@raclettejs/core"),S.resolve(e,"..","..","raclette"),S.resolve(e,"..","..","@raclettejs/core"),S.resolve(e,"..","..","core"),S.resolve(e,"..","raclette"),S.resolve(e,"..","@raclettejs/core"),S.resolve(e,"..","core")];for(let n of r)if($.existsSync(n)){let o=S.join(n,"package.json");if($.existsSync(o))try{if(JSON.parse($.readFileSync(o,"utf8")).name==="@raclettejs/core")return n}catch{}}throw h.error("Could not determine core package path to set up VFS. Canceling..."),new Error("Could not determine core package path to set up VFS. Canceling...")},Ls=async(e,t)=>await $.pathExists(e)?(await $.ensureDir(S.dirname(t)),await $.copy(e,t),h.debug(`\u2705 Copied ${S.basename(e)} to ${t}`),!0):(h.warn(f.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var Ld=e=>e==="frontend"||e==="backend",Id=e=>e==="workbench.frontend"||e==="workbench.backend",_k=async(e,t)=>{h.progress(`Loading merged packages for ${e}...`);let r=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],n={},o={};for(let i of r)try{let s=await Ek(i);if(s.dependencies){n={...n,...s.dependencies};let a=Object.keys(s.dependencies).length;a>0&&h.success(`Merged ${a} dependencies from ${i.file}:${i.key}`)}if(s.devDependencies){o={...o,...s.devDependencies};let a=Object.keys(s.devDependencies).length;a>0&&h.success(`Merged ${a} devDependencies from ${i.file}:${i.key}`)}}catch(s){throw h.error(`Error loading package source ${i.file}:${i.key} - ${s.message}`),h.error(`Aborting package setup for ${e}`),s}return h.raw(f.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(n).length} deps, ${Object.keys(o).length} devDeps`)),{dependencies:n,devDependencies:o}},Ek=async e=>{if(h.progress(`Loading ${e.file}:${e.key}...`),!await J.pathExists(e.file))return h.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await J.readJson(e.file),r=e.key.split("."),n=t;for(let o of r)if(n&&typeof n=="object"&&o in n)n=n[o];else return h.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(h.warn(`Invalid package data at '${e.key}' in ${e.file}, skipping`),{}):{dependencies:n.dependencies||{},devDependencies:n.devDependencies||{}}}catch(t){throw new Error(`Failed to parse ${e.file}: ${t.message}`)}},gr=(e,t)=>{let r=t.lockFiles?.[e];if(r)return h.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=te.join(process.cwd(),`${e}.yarn.lock`);return h.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},js=async(e,t)=>{let r=await Oe();if(!t)try{t=await import(te.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){h.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Ld(e)&&await Is(`app/${e}/package.json`,te.join(r,e),e,t),Id(e)&&h.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},kk=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=te.join(process.cwd(),"package.json");if(!await J.pathExists(t))return console.warn(f.yellow("Warning: No package.json found in app directory")),{};try{let r=await J.readJson(t),n={...r.dependencies||{},...r.devDependencies||{}},o=e.plugins.map(s=>typeof s=="string"?s:s[0]),i={};for(let s of o)n[s]?(i[s]=n[s],console.log(f.blue(`\u{1F4E6} Found plugin ${s}@${n[s]}`))):console.warn(f.yellow(`\u26A0\uFE0F Plugin ${s} is enabled in config but not found in package.json`));return i}catch(r){return console.warn(f.yellow(`Error reading app package.json: ${r.message}`)),{}}},Is=async(e,t,r,n)=>{let o=Ln();h.progress(`Setting up package.json for ${r}`),h.debug(`Source: ${e}`),h.debug(`Target dir: ${t}`),await J.ensureDir(t);let i=te.join(o,e),s=te.dirname(i),a=te.join(t,"package.json");if(await J.pathExists(i))try{h.debug("Reading source package.json...");let c=await J.readJson(i),l={dependencies:{},devDependencies:{}};(r==="frontend"||r==="backend")&&(l=await _k(r,n));let u=await kk(n),p={...c.dependencies,...l.dependencies,...u},d={...c.devDependencies,...l.devDependencies},g=mt(c,{dependencies:p,devDependencies:d});h.debug("Writing merged package.json..."),await J.writeJson(a,g,{spaces:2}),h.success(`Created package.json for ${r}`),await Ak(s,t,r,n)}catch(c){throw h.error(`Error setting up package.json for ${r}: ${c.message}`),c}else h.warn(`Warning: Could not find package.json at ${i}`)},In=async e=>{let t=te.join(process.cwd(),".raclette");if(h.progress("Setting up node packages for services..."),e.services.backend?.enabled){let r=te.join(t,"backend");await Is("services/backend/package.json",r,"backend",e);let n=gr("backend",e),o=te.join(r,"yarn.lock");await Ls(n,o)}if(e.services.frontend?.enabled){let r=te.join(t,"frontend");await Is("services/frontend/package.json",r,"frontend",e);let n=gr("frontend",e),o=te.join(r,"yarn.lock");await Ls(n,o)}},xk=async()=>{let e=te.join(process.cwd(),"packages.json");if(await J.pathExists(e))try{return await J.readJson(e)}catch(t){h.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},wk=async e=>{let t=te.join(process.cwd(),"packages.json");await J.writeJson(t,e,{spaces:2})},Ck=e=>{try{let t=vk(`yarn info ${e} version --json`,{stdio:"pipe",encoding:"utf8"});if(!t)throw new Error("No package found!");return JSON.parse(t).data}catch(t){return h.error(`Package verification failed for ${e}: ${t.message}`),null}},jd=async(e,t,r=!1)=>{h.raw(f.blue(`\u{1F4E6} Validating package ${t} for ${e}...`));let n=await Ck(t);if(!n)throw new Error(`Package ${t} not found or is not accessible`);h.success(`Found package ${t}@${n}`);let o=await xk(),i=r?"devDependencies":"dependencies";if(Ld(e))o[e]||(o[e]={}),o[e][i]||(o[e][i]={}),o[e][i][t]=n,console.log(f.green(`\u2705 Added ${t}@${n} to ${e} ${i}`));else if(Id(e)){let s=e==="workbench.frontend"?"frontend":"backend";o.workbench||(o.workbench={}),o.workbench[s]||(o.workbench[s]={}),o.workbench[s][i]||(o.workbench[s][i]={}),o.workbench[s][i][t]=n,console.log(f.green(`\u2705 Added ${t}@${n} to ${e} ${i}`)),console.log(f.yellow("\u2139\uFE0F Note: Workbench packages are stored in packages.json but package.json files are not updated"))}await wk(o),console.log(f.green("\u2705 Updated packages.json in project root"))},jn=async e=>{let t=Ln();if(h.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=gr("frontend",e);if(await J.pathExists(r))h.debug(`\u{1F512} ${te.basename(r)} already exists`);else{h.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"app","frontend","yarn.lock");await J.pathExists(n)?(h.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await J.copy(n,r)):(h.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await J.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
630
|
+
`;await zc.writeFile(r,l)};import{execSync as bk}from"child_process";import Z from"fs-extra";import te from"path";import lk from"chokidar";import $ from"fs-extra";import A from"path";var Pd=[".prettierrc","eslint.config.js"],uk=["bin/check-dependencies.sh"],Oe=async()=>{let e=A.join(process.cwd(),".raclette");return await $.ensureDir(e),e},Dn=async(e,t,r)=>{let n=process.cwd(),o=A.join(n,".raclette"),i=A.join(o,"virtual"),s=Nn();h.debug(`\u{1F4E6} Using core package at: ${s}`),await gk(o,s,uk),h.debug("[VFS] Cleaning virtual file system directory..."),await $.pathExists(i)&&await $.rm(i,{recursive:!0}),await $.ensureDir(i);let a=[{name:"generated-service-files",path:o,servicePathMap:{backend:".",frontend:"."},priority:1},{name:"app",path:n,servicePathMap:{backend:"services",frontend:"services"},folderMappings:{shared:"backend/src/shared/app",i18n:"frontend/src/orchestrator/i18n/app"},priority:10},{name:"core-types",path:s,servicePathMap:{backend:"",frontend:""},folderMappings:{"src/types.ts":["backend/types/index.ts","frontend/types/index.ts"]},priority:29},{name:"core",path:s,servicePathMap:{backend:"services",frontend:"services"},priority:30},...e?.sourceDirectories||[],...t??[]],c=new Map,l={backend:["/"],frontend:["/"]},u=[...a].sort((y,k)=>k.priority-y.priority).map(y=>{let k=y.path.startsWith(".")?A.join(process.cwd(),y.path):y.path;return{...y,path:k}});await hk(u,c,i,l,Pd,o);let p=[],d=y=>{let k=A.relative(n,y);return c.get(k)||y},g=()=>{p.forEach(k=>k.close()),p.length=0,pk(u,l,i).forEach(k=>{if($.existsSync(k.sourcePath)){let R=dk(k,u,c,Pd);p.push(R)}})},m=()=>p.forEach(y=>y.close());return r||g(),{resolveFile:d,watchFiles:g,close:m}},pk=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",l=A.join(o.path,c,i,a);n.push({sourcePath:l,sourceDir:o,targetResolver:u=>A.join(r,i,a,u),mappingKeyResolver:u=>A.join(i,a,u)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=A.join(o.path,i);$.existsSync(a)&&$.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(u=>{n.push({sourcePath:A.dirname(a),sourceDir:o,targetResolver:p=>A.basename(a)===p?A.join(r,u):A.join(r,u,p),mappingKeyResolver:p=>A.basename(a)===p?i:A.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:l=>A.join(r,i,l),mappingKeyResolver:l=>A.join(i,l)})})}),n},dk=(e,t,r,n)=>{h.debug(`[VFS] Setting up watcher for ${e.sourceDir.name}: ${e.sourcePath}`);let o=e.sourceDir.name==="generated-service-files"?["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss","**/package.json","**/yarn.lock","**/*.json"]:["**/*.vue","**/*.ts","**/*.js","**/*.css","**/*.scss"],i=lk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(mk(a,n))return;let l=e.mappingKeyResolver(a),u=e.targetResolver(a);await fk(t,r,l,u,a,c)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},fk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=$d(s,r,o);a?(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),h.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await $.pathExists(n)&&await $.remove(n),t.delete(r),h.debug(`[VFS] Removed ${r}`))}else{let a=$d(s,r,o);a&&(await $.ensureDir(A.dirname(n)),await $.copy(a.fullPath,n),t.set(r,n),h.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},$d=(e,t,r)=>{for(let n of e){let o={backend:["/"],frontend:["/"]};for(let[i,s]of Object.entries(o))for(let a of s)if(A.join(i,a,r)===t){let l=n.servicePathMap?.[i]||"",u=A.join(n.path,l,i,a,r);if($.existsSync(u))return{sourceDir:n,fullPath:u}}if(n.folderMappings)for(let[i,s]of Object.entries(n.folderMappings)){let a=Array.isArray(s)?s:[s];for(let c of a){let l,u;if(i===t){if(u=A.join(n.path,i),$.existsSync(u))return{sourceDir:n,fullPath:u}}else if(l=A.join(i,r),l===t&&(u=A.join(n.path,i,r),$.existsSync(u)))return{sourceDir:n,fullPath:u}}}}return null},Dd=async(e,t,r,n,o,i)=>{if(!await $.pathExists(t))return;await $.ensureDir(A.dirname(r));let s=e.name==="generated-service-files";await $.copy(t,r,{overwrite:!0,filter:l=>{let u=A.basename(l);if(i.includes(u))return!1;if(s&&(u==="package.json"||u==="yarn.lock"))return!0;if(!s&&(u==="package.json"||u==="yarn.lock"))return!1;let p=A.relative(t,l);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")}});let c=await yk(t,s?["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss","**/package.json","**/yarn.lock"]:["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss"]);for(let l of c){let u=A.basename(l);if(i.includes(u))continue;if(!(s&&(u==="package.json"||u==="yarn.lock"))){if(!s&&(u==="package.json"||u==="yarn.lock"))continue}let p=A.relative(t,l),d=A.join(o,p),g=A.join(r,p);n.set(d,g)}h.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},hk=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await $.pathExists(s.path)){console.warn(f.yellow(`[VFS] Source directory not found: ${s.path}`));continue}for(let[a,c]of Object.entries(n))for(let l of c){let u=s.servicePathMap?.[a]||"";if(!u)continue;let p=A.join(s.path,u,a,l),d=A.join(r,a,l),g=A.join(a,l);await Dd(s,p,d,t,g,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let l=A.join(s.path,a),u=(Array.isArray(c)?c:[c]).map(d=>A.join(r,d)),p=await $.pathExists(l)&&(await $.stat(l)).isFile();if(!p&&s.clear)for(let d of u)await $.rm(d,{recursive:!0,force:!0}),await $.ensureDir(d);if(p)for(let d of u)await $.ensureDir(A.dirname(d)),await $.copy(l,d),t.set(a,d),h.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of u)await Dd(s,l,d,t,d,o)}}h.debug("[VFS] Built virtual file system")},mk=(e,t)=>t.includes(A.basename(e));var gk=async(e,t,r)=>{let n=A.join(e,"dist");await $.ensureDir(n);for(let o of r){let i=A.join(t,o),s=A.basename(o),a=A.join(n,s);await $.pathExists(a)&&await $.remove(a),await $.pathExists(i)&&(await $.ensureDir(A.dirname(a)),await $.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await $.chmod(a,493),h.debug(`[VFS] Copied ${s} to dist directory`))}},yk=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(Td(),Od));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Nn=()=>{let e=process.cwd();h.debug("process.cwd(): "+process.cwd());let r=e.includes("node_modules")?[A.join(e.match(/(.*node_modules)/)?.[1]||"","@raclettejs/core"),A.join(e,"node_modules","@raclettejs/core"),A.join(e,"..","..","..","@raclettejs/core")]:[A.join(e,"node_modules","@raclettejs/core"),A.resolve(e,"..","..","raclette"),A.resolve(e,"..","..","@raclettejs/core"),A.resolve(e,"..","..","core"),A.resolve(e,"..","raclette"),A.resolve(e,"..","@raclettejs/core"),A.resolve(e,"..","core")];for(let n of r)if($.existsSync(n)){let o=A.join(n,"package.json");if($.existsSync(o))try{if(JSON.parse($.readFileSync(o,"utf8")).name==="@raclettejs/core")return n}catch{}}throw h.error("Could not determine core package path to set up VFS. Canceling..."),new Error("Could not determine core package path to set up VFS. Canceling...")},Ns=async(e,t)=>await $.pathExists(e)?(await $.ensureDir(A.dirname(t)),await $.copy(e,t),h.debug(`\u2705 Copied ${A.basename(e)} to ${t}`),!0):(h.warn(f.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var Nd=e=>e==="frontend"||e==="backend",Ld=e=>e==="workbench.frontend"||e==="workbench.backend",vk=async(e,t)=>{h.progress(`Loading merged packages for ${e}...`);let r=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],n={},o={};for(let i of r)try{let s=await _k(i);if(s.dependencies){n={...n,...s.dependencies};let a=Object.keys(s.dependencies).length;a>0&&h.success(`Merged ${a} dependencies from ${i.file}:${i.key}`)}if(s.devDependencies){o={...o,...s.devDependencies};let a=Object.keys(s.devDependencies).length;a>0&&h.success(`Merged ${a} devDependencies from ${i.file}:${i.key}`)}}catch(s){throw h.error(`Error loading package source ${i.file}:${i.key} - ${s.message}`),h.error(`Aborting package setup for ${e}`),s}return h.raw(f.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(n).length} deps, ${Object.keys(o).length} devDeps`)),{dependencies:n,devDependencies:o}},_k=async e=>{if(h.progress(`Loading ${e.file}:${e.key}...`),!await Z.pathExists(e.file))return h.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await Z.readJson(e.file),r=e.key.split("."),n=t;for(let o of r)if(n&&typeof n=="object"&&o in n)n=n[o];else return h.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(h.warn(`Invalid package data at '${e.key}' in ${e.file}, skipping`),{}):{dependencies:n.dependencies||{},devDependencies:n.devDependencies||{}}}catch(t){throw new Error(`Failed to parse ${e.file}: ${t.message}`)}},gr=(e,t)=>{let r=t.lockFiles?.[e];if(r)return h.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=te.join(process.cwd(),`${e}.yarn.lock`);return h.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},Is=async(e,t)=>{let r=await Oe();if(!t)try{t=await import(te.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){h.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Nd(e)&&await Ls(`app/${e}/package.json`,te.join(r,e),e,t),Ld(e)&&h.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},Ek=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=te.join(process.cwd(),"package.json");if(!await Z.pathExists(t))return console.warn(f.yellow("Warning: No package.json found in app directory")),{};try{let r=await Z.readJson(t),n={...r.dependencies||{},...r.devDependencies||{}},o=e.plugins.map(s=>typeof s=="string"?s:s[0]),i={};for(let s of o)n[s]?(i[s]=n[s],console.log(f.blue(`\u{1F4E6} Found plugin ${s}@${n[s]}`))):console.warn(f.yellow(`\u26A0\uFE0F Plugin ${s} is enabled in config but not found in package.json`));return i}catch(r){return console.warn(f.yellow(`Error reading app package.json: ${r.message}`)),{}}},Ls=async(e,t,r,n)=>{let o=Nn();h.progress(`Setting up package.json for ${r}`),h.debug(`Source: ${e}`),h.debug(`Target dir: ${t}`),await Z.ensureDir(t);let i=te.join(o,e),s=te.dirname(i),a=te.join(t,"package.json");if(await Z.pathExists(i))try{h.debug("Reading source package.json...");let c=await Z.readJson(i),l={dependencies:{},devDependencies:{}};(r==="frontend"||r==="backend")&&(l=await vk(r,n));let u=await Ek(n),p={...c.dependencies,...l.dependencies,...u},d={...c.devDependencies,...l.devDependencies},g=mt(c,{dependencies:p,devDependencies:d});h.debug("Writing merged package.json..."),await Z.writeJson(a,g,{spaces:2}),h.success(`Created package.json for ${r}`),await Ck(s,t,r,n)}catch(c){throw h.error(`Error setting up package.json for ${r}: ${c.message}`),c}else h.warn(`Warning: Could not find package.json at ${i}`)},Ln=async e=>{let t=te.join(process.cwd(),".raclette");if(h.progress("Setting up node packages for services..."),e.services.backend?.enabled){let r=te.join(t,"backend");await Ls("services/backend/package.json",r,"backend",e);let n=gr("backend",e),o=te.join(r,"yarn.lock");await Ns(n,o)}if(e.services.frontend?.enabled){let r=te.join(t,"frontend");await Ls("services/frontend/package.json",r,"frontend",e);let n=gr("frontend",e),o=te.join(r,"yarn.lock");await Ns(n,o)}},kk=async()=>{let e=te.join(process.cwd(),"packages.json");if(await Z.pathExists(e))try{return await Z.readJson(e)}catch(t){h.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},xk=async e=>{let t=te.join(process.cwd(),"packages.json");await Z.writeJson(t,e,{spaces:2})},wk=e=>{try{let t=bk(`yarn info ${e} version --json`,{stdio:"pipe",encoding:"utf8"});if(!t)throw new Error("No package found!");return JSON.parse(t).data}catch(t){return h.error(`Package verification failed for ${e}: ${t.message}`),null}},Id=async(e,t,r=!1)=>{h.raw(f.blue(`\u{1F4E6} Validating package ${t} for ${e}...`));let n=await wk(t);if(!n)throw new Error(`Package ${t} not found or is not accessible`);h.success(`Found package ${t}@${n}`);let o=await kk(),i=r?"devDependencies":"dependencies";if(Nd(e))o[e]||(o[e]={}),o[e][i]||(o[e][i]={}),o[e][i][t]=n,console.log(f.green(`\u2705 Added ${t}@${n} to ${e} ${i}`));else if(Ld(e)){let s=e==="workbench.frontend"?"frontend":"backend";o.workbench||(o.workbench={}),o.workbench[s]||(o.workbench[s]={}),o.workbench[s][i]||(o.workbench[s][i]={}),o.workbench[s][i][t]=n,console.log(f.green(`\u2705 Added ${t}@${n} to ${e} ${i}`)),console.log(f.yellow("\u2139\uFE0F Note: Workbench packages are stored in packages.json but package.json files are not updated"))}await xk(o),console.log(f.green("\u2705 Updated packages.json in project root"))},In=async e=>{let t=Nn();if(h.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=gr("frontend",e);if(await Z.pathExists(r))h.debug(`\u{1F512} ${te.basename(r)} already exists`);else{h.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"app","frontend","yarn.lock");await Z.pathExists(n)?(h.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await Z.copy(n,r)):(h.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await Z.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
631
631
|
# yarn lockfile v1
|
|
632
632
|
|
|
633
|
-
`)),h.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}if(e.services.backend?.enabled){let r=gr("backend",e);if(await
|
|
633
|
+
`)),h.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}if(e.services.backend?.enabled){let r=gr("backend",e);if(await Z.pathExists(r))h.debug(`\u{1F512} ${te.basename(r)} already exists`);else{h.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=te.join(t,"app","backend","yarn.lock");await Z.pathExists(n)?(h.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await Z.copy(n,r)):(h.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await Z.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
634
634
|
# yarn lockfile v1
|
|
635
635
|
|
|
636
|
-
`)),h.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}h.success("Lock files ready for volume mounting")},
|
|
636
|
+
`)),h.debug(`\u{1F512}\u2705 Created ${te.basename(r)}`)}}h.success("Lock files ready for volume mounting")},Ck=async(e,t,r,n)=>{let o=te.join(t,"yarn.lock");h.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=gr(r,n)),i&&await Z.pathExists(i))h.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await Z.copy(i,o);else{let s=te.join(e,"yarn.lock");await Z.pathExists(s)?(h.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await Z.copy(s,o)):(h.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await Z.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
637
637
|
# yarn lockfile v1
|
|
638
638
|
|
|
639
|
-
`))}};import
|
|
639
|
+
`))}};import jd from"fs-extra";import Fd from"path";var jn=async(e,t)=>{let r=Fd.join(t,"tsconfig.json"),n={compilerOptions:{target:"ES2020",module:"ESNext",moduleResolution:"node",esModuleInterop:!0,resolveJsonModule:!0,outDir:"dist",declaration:!0,emitDeclarationOnly:!0,strict:!0,paths:{"@app":["../frontend/src/app"],"@app/*":["../frontend/src/app/*"],"@shared/app/*":["../shared/*"],"@shared/*":["./virtual/backend/src/shared/*"],"@raclettejs/core/backend":["../node_modules/@raclettejs/core/services/backend/src"],"@raclettejs/core/backend/*":["../node_modules/@raclettejs/core/services/backend/src/*"],"@raclettejs/workbench/app/*":["../node_modules/@raclettejs/workbench/frontend/src/app/*"],"@raclettejs/workbench/*":["../node_modules/@raclettejs/workbench/*"],"@raclettejs/core/frontend":["../node_modules/@raclettejs/core/services/frontend/src/core"],"@raclettejs/core/frontend/*":["../node_modules/@raclettejs/core/services/frontend/src/core/*"],"@raclettejs/core/orchestrator":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator"],"@raclettejs/core/orchestrator/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/*"],"@raclettejs/core/orchestrator/components":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/components"],"@raclettejs/core/orchestrator/components/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/components/*"],"@raclettejs/core/orchestrator/composables":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/composables"],"@raclettejs/core/orchestrator/composables/*":["../node_modules/@raclettejs/core/services/frontend/src/orchestrator/composables/*"],"@raclettejs/core":["../node_modules/@raclettejs/core"]},typeRoots:["./node_modules/@types","./node_modules/@raclettejs/core/types"]},include:["./src/**/*","types/**/*","../**/*","../node_modules/@raclettejs/core/*"],exclude:["../node_modules","../dist","./**","../node_modules/@raclettejs/core/node_modules"]};e.typescript?.compilerOptions&&Object.assign(n.compilerOptions,e.typescript.compilerOptions),e?.frontend?.framework==="vue"&&(Ak(t),n.include.push("shims.vue.d.ts")),await jd.writeFile(r,JSON.stringify(n,null,2)),h.debug(`Generated tsconfig.json in ${t}`)},Ak=async e=>{await jd.writeFile(Fd.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
|
|
640
640
|
import { DefineComponent } from "vue"
|
|
641
641
|
const component: DefineComponent<{}, {}, any>
|
|
642
642
|
export default component
|
|
643
|
-
}`)};var br=new Map,
|
|
643
|
+
}`)};var br=new Map,Md=async(e,t)=>{h.raclette("Starting development environment...");let r=Ne.dirname(t.dockerComposePath),n=e.name??Ne.basename(process.cwd()),o=Ta(),i={kill:()=>(o(),!0)};br.set("originalConfigWatcher",i),await In(e),await Ln(e),await Dn(e),Gr("raclette_shared"),await Oo(e,t.workingDir,t.dockerComposePath,!1,"development",!0),await jn(e,r),await zr(e,r);let s=await Kr(e,r,t.forceRebuild??!1);s.length>0&&await Xr(e,r,s,{noCache:t.noCache});let a=Rk(e),c=Ok(a);c.length>0&&h.info(`Found existing services: ${c.join(", ")}`);let l=Tk(e,n,t.dockerComposePath);["SIGINT","SIGTERM"].forEach(u=>{process.removeAllListeners(u),process.on(u,()=>l(u))}),t.quiet?(await Bd(e,n,t.dockerComposePath,a,c),console.log(f.green(`
|
|
644
644
|
\u2705 Development environment is ready!`)),a.frontend.enabled&&console.log(f.blue(`\u{1F30D} Frontend running at: http://localhost:${a.frontend.port}`)),a.backend.enabled&&console.log(f.blue(`\u{1F680} Server running at: http://localhost:${a.backend.port}`)),console.log(f.yellow(`
|
|
645
|
-
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(f.yellow('Use "raclette down" to stop the services when finished'))):await
|
|
645
|
+
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(f.yellow('Use "raclette down" to stop the services when finished'))):await Pk(e,n,t.dockerComposePath,a,c,t.logFilter,t.verbose)},Rk=e=>{let t=e.name??Ne.basename(process.cwd());return{frontend:{name:"frontend",containerName:e.services.frontend?.name??`${t}-frontend`,port:e.services.frontend?.port??8081,enabled:e.services.frontend?.enabled??!1,isDatabaseService:!1},backend:{name:"backend",containerName:e.services.backend?.name??`${t}-backend`,port:e.services.backend?.port??8082,enabled:e.services.backend?.enabled??!1,isDatabaseService:!1},mongodb:{name:"mongodb",containerName:e.services.mongodb?.name??`${t}-mongodb`,port:e.services.mongodb?.port??27017,enabled:e.services.mongodb?.enabled??!1,volumeName:e.services.mongodb?.volume??`${t}-mongodb`,isDatabaseService:!0},cache:{name:"cache",containerName:e.services.cache?.name??`${t}-cache`,port:e.services.cache?.port??6379,enabled:e.services.cache?.enabled??!1,volumeName:e.services.cache?.volume??`${t}-cache`,isDatabaseService:!0}}},Ok=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&ir(n.containerName)&&t.push(r)}),t},Tk=(e,t,r)=>n=>{console.log(`
|
|
646
646
|
`+"=".repeat(80)),console.log(f.bold.yellow(` CLEANUP: Shutting down services after ${n}...`)),console.log("=".repeat(80)+`
|
|
647
|
-
`);for(let[o,i]of br.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(f.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{
|
|
648
|
-
`+"=".repeat(80)),console.log(f.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(f.red("Error stopping Docker services:"),o)}process.exit(0)},
|
|
649
|
-
Log process ended with code ${d??0}`)),p()}),u.on("error",d=>{h.error(` Error with log process: ${d.message}`),p()})})}catch(u){throw h.error(`Error setting up log following: ${u.message}`),u}},
|
|
647
|
+
`);for(let[o,i]of br.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(f.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{Hd(e),ye(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
|
|
648
|
+
`+"=".repeat(80)),console.log(f.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(f.red("Error stopping Docker services:"),o)}process.exit(0)},Bd=async(e,t,r,n,o,i)=>{if(console.log(f.blue("\u{1F433} Starting Docker services...")),!await yr.pathExists(r)){let a=`Docker compose file not found: ${r}`;throw h.error(a),new Error(a)}let s=[];if(Object.entries(n).forEach(([a,c])=>{let l=a;if(c.enabled){if(o.includes(l)){h.info(`Skipping existing service: ${l}`);return}s.push(l)}}),s.length===0){h.warn("No Docker services to start! All services either exist or are not enabled.");return}h.raw(f.blue(`\u{1F680} Starting following services: ${s.join(", ")}`));try{ye(["-p",t,"-f",r,"up","-d",...s],{stdio:"inherit"}),h.success(`Docker services started: ${s.join(", ")}`)}catch(a){throw h.error(`Error starting Docker services: ${a.message}`),a}try{await Nk(e,i)}catch(a){h.error(`Error starting Workbench: ${a.message}`)}},Pk=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await Bd(e,t,r,n,o,s);let a=i.filter(u=>o.includes(u)?!1:n[u]?.enabled);if(a.length===0){h.warn("No services to show logs for");return}h.raw(f.blue(`\u{1F4CB} Showing logs for: ${a.join(", ")} (press Ctrl+C to stop)...`));let c=Ne.resolve(r),l=["-p",t,"-f",c,"logs","--follow",...a];try{h.debug("Running Docker Compose logs...");let u=js("docker",["compose",...l],{stdio:"inherit",shell:!0,cwd:Ne.dirname(c)});return br.set("dockerLogs",u),new Promise(p=>{u.on("close",d=>{u.killed||console.log(f.yellow(`
|
|
649
|
+
Log process ended with code ${d??0}`)),p()}),u.on("error",d=>{h.error(` Error with log process: ${d.message}`),p()})})}catch(u){throw h.error(`Error setting up log following: ${u.message}`),u}},Fn=async e=>{if(!e.services?.workbench?.enabled)return;let t=Ne.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await yr.pathExists(t))throw h.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=Ne.join(t,"package.json");if(!await yr.pathExists(r))throw h.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},$k=e=>{if(!e||typeof e!="object")throw new Error("Workbench configuration must be an object");if(!e.frontend||typeof e.frontend!="object")throw new Error('Workbench configuration must have a "frontend" object');if(e.frontend.i18n!==void 0){if(typeof e.frontend.i18n!="object")throw new Error("frontend.i18n must be an object");if(e.frontend.i18n.locales!==void 0){if(!Array.isArray(e.frontend.i18n.locales))throw new Error("frontend.i18n.locales must be an array");if(!e.frontend.i18n.locales.every(t=>typeof t=="string"))throw new Error("All locales must be strings")}}return!0},Dk=async(e,t=process.cwd())=>{let r=Ne.join(t,".raclette"),n=Ne.join(r,"raclette.config.workbench.js");await yr.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
|
|
650
650
|
|
|
651
651
|
export default defineRacletteConfig(${JSON.stringify(e,null,2)})
|
|
652
|
-
`;return await yr.writeFile(n,o,"utf8"),n},
|
|
652
|
+
`;return await yr.writeFile(n,o,"utf8"),n},Nk=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await Fn(e);if(!r)return;let n=Ne.join(process.cwd(),"workbenchPlugins");await Sk(n)||(n=void 0);let o;if(e.workbench)try{$k(e.workbench),o=await Dk(e.workbench)}catch(a){throw console.error(f.red("Workbench configuration error:"),a.message),a}let i=Object.fromEntries(Object.entries(e.env.development||{}).filter(([a])=>a.startsWith("RACLETTE_")).flatMap(([a,c])=>{let l=[[a,c]];if(a.startsWith("RACLETTE_WORKBENCH_")){let u=a.replace("RACLETTE_WORKBENCH_","RACLETTE_");l.push([u,c])}return l}));e.services?.workbench?.debugPort&&(i.ENABLE_DEBUG=!0,i.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let s={...process.env,NODE_ENV:"development",MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:`raclette-cache://localhost:${e.services.cache?.port||6379}${e.services.cache?.db?`/${e.services.cache.db}`:""}`,RACLETTE_CLIENT_PORT:String(e.services.workbench?.frontendPort||8083),RACLETTE_SERVER_PORT:String(e.services.workbench?.backendPort||8084),...i};return new Promise((a,c)=>{let l=`${e.name}-workbench`;h.progress("Starting workbench as "+l);let u=["dev",t?"-v":"","-p",l,...o?["-f",o]:[]].filter(m=>m!==""),p=e.services?.workbench?.withLogs||t,d=js("yarn",u,{cwd:r,env:s,stdio:p?"pipe":"ignore"});br.set("workbench",d),p&&(d.stdout?.on("data",m=>{m.toString().trim().split(`
|
|
653
653
|
`).forEach(k=>{console.log(f.magenta(`[Workbench] ${k}`))})}),d.stderr?.on("data",m=>{m.toString().trim().split(`
|
|
654
|
-
`).forEach(k=>{console.error(f.red(`[Workbench] ${k}`))})}),d.stdout?.on("data",m=>{m.toString().includes("VITE v")&&(clearTimeout(g),a())}));let g=setTimeout(()=>{a()},p?1e3*60*5:5e3);d.on("close",m=>{clearTimeout(g),m!==0&&m!==null?(console.error(f.red(`Workbench process exited with code ${m}`)),c(new Error(`Workbench process exited with code ${m}`))):a()}),d.on("error",m=>{clearTimeout(g),console.error(f.red("Workbench process error:"),m),c(m)}),p||setTimeout(a,1e3)})},
|
|
654
|
+
`).forEach(k=>{console.error(f.red(`[Workbench] ${k}`))})}),d.stdout?.on("data",m=>{m.toString().includes("VITE v")&&(clearTimeout(g),a())}));let g=setTimeout(()=>{a()},p?1e3*60*5:5e3);d.on("close",m=>{clearTimeout(g),m!==0&&m!==null?(console.error(f.red(`Workbench process exited with code ${m}`)),c(new Error(`Workbench process exited with code ${m}`))):a()}),d.on("error",m=>{clearTimeout(g),console.error(f.red("Workbench process error:"),m),c(m)}),p||setTimeout(a,1e3)})},Hd=async e=>{if(e.services?.workbench?.enabled)try{let t=await Fn(e);if(!t)return;js("yarn",["down","-p",`${e.name}-workbench`],{cwd:t,stdio:"pipe"})}catch{h.debug("Workbench down command failed, forcing process termination");let r=br.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{Dc(n)}catch(o){h.warn(`Could not stop workbench containers: ${o.message}`)}}}},Fs=(e,t)=>{let r=t?.name??Ne.basename(process.cwd());h.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),h.raclette("Stopping all Docker services...");try{Hd(t),ye(["-p",r,"-f",e,"down"],{stdio:"inherit"}),h.success("All Docker services stopped successfully")}catch(n){throw h.error("Error stopping Docker services:",n),n}};import Gd from"fs-extra";import Ud from"path";var Lk=e=>Ot(e),vr=async(e,t,r)=>{let o=`${t?.name??Ud.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await Gd.readFile(r,"utf8"),s=new RegExp(`\\$\\{RACLETTE_${e.toUpperCase()}_CONTAINERNAME:-([^}]+)\\}`).exec(i);s&&s[1]&&(o=s[1])}catch(i){console.warn(f.yellow(`Warning: Could not read docker-compose file to determine container name: ${i.message}`))}return o},Vd=async(e,t,r)=>{let n=await vr(e,t,r);if(!Lk(n))return console.log(f.yellow(`\u26A0\uFE0F Service '${e}' (container: ${n}) doesn't appear to be running.`)),!1;try{console.log(f.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),So(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=So(n,"cat /app/node_modules/.install-result",{stdio:"pipe"}).trim();return o==="0"?(console.log(f.green(`\u2705 Dependencies for ${e} updated successfully`)),!0):(console.error(f.red(`\u274C Dependency installation for ${e} failed with code ${o}`)),console.error(f.red("Some packages might be incompatible with your Node.js version or have other issues.")),console.error(f.yellow("Check the logs above for specific error messages.")),!1)}catch{return console.log(f.green(`\u2705 Dependencies for ${e} updated (status unknown)`)),!0}}catch(o){return console.error(f.red(`\u274C Error updating dependencies for ${e}: ${o.message}`)),!1}},Ms=async(e,t,r)=>{console.log(f.blue("\u{1F9C0} Updating package dependencies..."));let n=Ud.join(r,"docker-compose.yml");if(!await Gd.pathExists(n))return console.error(f.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running with Raclette.")),!1;let o=!1,i=!0;if(e==="frontend"||e==="both"){let s=await Vd("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await Vd("backend",t,n);o=s||o,i=i&&s}return o?i||(console.log(f.yellow("\u26A0\uFE0F Some services encountered errors during dependency installation.")),console.log(f.yellow("You may need to address compatibility issues in your package.json."))):(console.log(f.yellow("No services were updated. Make sure the services are running.")),console.log(f.yellow("You may need to restart the services using 'raclette restart' after adding packages."))),o&&i};import{spawn as Yd}from"child_process";import Wd from"path";var Kd=async(e,t,r,n)=>{if(e.includes("workbench")){await Fk(r,t);return}let o=[];if(e.length===0)o=qd(r),console.log(f.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=qd(r),a=e.filter(c=>!s.includes(c));if(a.length>0)throw console.error(f.red(`\u274C Invalid services specified: ${a.join(", ")}`)),console.log(f.yellow(`Available services: ${s.join(", ")}`)),new Error("Invalid services specified");o=e,console.log(f.blue(`\u{1F4CB} Showing logs for: ${o.join(", ")}`))}let i=await Ik(o,r,n);if(i.length===0)throw console.error(f.red("\u274C None of the specified services appear to be running.")),console.log(f.yellow("\u{1F4A1} Try running 'raclette dev' first to start the services.")),new Error("No running services found");if(i.length<o.length){let s=o.filter(a=>!i.includes(a));console.warn(f.yellow(`\u26A0\uFE0F Some services are not running: ${s.join(", ")}`)),console.log(f.blue(`\u{1F4CB} Showing logs for running services: ${i.join(", ")}`)),o=i}await jk(r,n,o,t)};function qd(e){let t=[];return e.services?.frontend?.enabled&&t.push("frontend"),e.services?.backend?.enabled&&t.push("backend"),e.services?.mongodb?.enabled&&t.push("mongodb"),e.services?.cache?.enabled&&t.push("cache"),e.services?.workbench?.enabled&&t.push("workbench"),e.services?.workbench?.enabled&&t.push("workbench"),t}async function Ik(e,t,r){let n=[];for(let o of e)try{let i=await vr(o,t,r);Ot(i)&&n.push(o)}catch(i){console.warn(f.yellow(`\u26A0\uFE0F Could not check status of service '${o}': ${i.message}`))}return n}async function jk(e,t,r,n){let o=e?.name??Wd.basename(process.cwd());console.log(f.blue(`\u{1F4CB} Following logs for: ${r.join(", ")} ${n.follow?"(press Ctrl+C to stop)":""}`));let i=["-p",o,"-f",t,"logs"];n.follow&&i.push("--follow"),n.tail&&i.push("--tail",n.tail),i.push(...r);try{let s=Yd("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:Wd.dirname(t)});s.on("close",a=>{s.killed||console.log(f.yellow(`
|
|
655
655
|
Log process ended with code ${a??0}`))}),s.on("error",a=>{console.error(f.red(`\u274C Error with log process: ${a.message}`))}),process.on("SIGINT",()=>{console.log(f.yellow(`
|
|
656
|
-
\u{1F6D1} Stopping log following...`)),s.kill("SIGTERM"),process.exit(0)}),n.follow?await new Promise(()=>{}):await new Promise(a=>{s.on("close",()=>a())})}catch(s){throw console.error(f.red(`\u274C Error following logs: ${s.message}`)),s}}async function
|
|
656
|
+
\u{1F6D1} Stopping log following...`)),s.kill("SIGTERM"),process.exit(0)}),n.follow?await new Promise(()=>{}):await new Promise(a=>{s.on("close",()=>a())})}catch(s){throw console.error(f.red(`\u274C Error following logs: ${s.message}`)),s}}async function Fk(e,t){console.log(f.blue("\u{1F527} Handling workbench logs..."));let r=Fn(e);h.debug("Calling yarn log frontend backend on workbench instance...");try{let n=["log","frontend","backend"];t.follow||n.push("--no-follow"),t.tail&&n.push("--tail",t.tail);let o=Yd("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(f.yellow(`
|
|
657
657
|
Workbench log process ended with code ${i??0}`))}),o.on("error",i=>{console.error(f.red(`\u274C Error with workbench log process: ${i.message}`)),console.log(f.yellow("\u{1F4A1} Make sure the workbench package has the 'log' script in its package.json"))}),process.on("SIGINT",()=>{console.log(f.yellow(`
|
|
658
|
-
\u{1F6D1} Stopping workbench log following...`)),o.kill("SIGTERM"),process.exit(0)}),t.follow?await new Promise(()=>{}):await new Promise(i=>{o.on("close",()=>i())})}catch(n){throw console.error(f.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as
|
|
658
|
+
\u{1F6D1} Stopping workbench log following...`)),o.kill("SIGTERM"),process.exit(0)}),t.follow?await new Promise(()=>{}):await new Promise(i=>{o.on("close",()=>i())})}catch(n){throw console.error(f.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as zk}from"child_process";import V from"fs-extra";import H from"path";import{execSync as Mk}from"child_process";import B from"fs-extra";import U from"path";var Bs=async(e,t,r)=>{console.log(f.blue("\u{1F4E6} Creating production artifacts...")),await Vk(t,e,r);let n=U.join(t,"docker-compose.yml");return await Gk(e,t,n,r),await Uk(e,t,r),await Wk(t,r,e),console.log(f.green("\u2705 Production artifacts created")),n},Xd=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=U.join(t,a),l=U.basename(a),u=U.join(r,l);if(await B.ensureDir(U.dirname(u)),await B.pathExists(c))await B.copy(c,u),o&&await B.chmod(u,493),console.log(f.gray(`${s} \u2705 Copied ${a}`));else{let p=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${p}`);console.log(f.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},Bk=async(e,t,r)=>Xd(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),Hk=async(e,t,r,n)=>Xd(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),Vk=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
|
|
659
659
|
FROM nginx:alpine
|
|
660
660
|
COPY services/frontend /usr/share/nginx/html
|
|
661
661
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
@@ -764,7 +764,7 @@ server {
|
|
|
764
764
|
proxy_set_header Host $host;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
`;if(await B.writeFile(U.join(e,"Dockerfile.frontend"),i),await B.writeFile(U.join(e,"Dockerfile.backend"),s),await B.writeFile(U.join(e,"nginx.conf"),a),await
|
|
767
|
+
`;if(await B.writeFile(U.join(e,"Dockerfile.frontend"),i),await B.writeFile(U.join(e,"Dockerfile.backend"),s),await B.writeFile(U.join(e,"nginx.conf"),a),await Bk(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let l=`
|
|
768
768
|
FROM nginx:alpine
|
|
769
769
|
COPY workbench/frontend /usr/share/nginx/html
|
|
770
770
|
COPY nginx.workbench.conf /etc/nginx/conf.d/default.conf
|
|
@@ -842,7 +842,7 @@ server {
|
|
|
842
842
|
proxy_set_header Authorization $http_authorization;
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
`;await B.writeFile(U.join(e,"Dockerfile.workbench-frontend"),l),await B.writeFile(U.join(e,"Dockerfile.workbench-backend"),u),await B.writeFile(U.join(e,"nginx.workbench.conf"),p)}},
|
|
845
|
+
`;await B.writeFile(U.join(e,"Dockerfile.workbench-frontend"),l),await B.writeFile(U.join(e,"Dockerfile.workbench-backend"),u),await B.writeFile(U.join(e,"nginx.workbench.conf"),p)}},Gk=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=e.env.production||{},a={services:{frontend:{build:{context:".",dockerfile:"Dockerfile.frontend"},ports:[`\${PORT:-${o}}:${o}`],depends_on:["backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(s).map(([l,u])=>`${l}=${u}`)]},backend:{build:{context:".",dockerfile:"Dockerfile.backend"},depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-valkey://cache:6379${e.services.cache?.db?`/${e.services.cache?.db}`:""}}`,...Object.entries(s).map(([l,u])=>`${l}=${u}`)]},database:{image:"mongo:5.0.6",restart:"unless-stopped",volumes:["mongodb_data:/data/db","mongodb_config:/data/config"],networks:["app-network"],environment:["MONGO_INITDB_DATABASE=${MONGO_DATABASE:-"+(e.services.mongodb?.databaseName||e.name)+"}"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},volumes:{mongodb_data:{},mongodb_config:{},cache_data:{}},networks:{"app-network":{driver:"bridge"}}},c=e.backend?.cache;if(c?.persistence){let l=c.RDB_OPTIONS||"3600 1 300 100 60 10000";switch(c.persistence){case"none":a.services.cache.command='valkey-server --save ""';break;case"aof":a.services.cache.command="valkey-server --appendonly yes";break;case"rdb":a.services.cache.command="valkey-server --save "+l;break;case"rdb+aof":a.services.cache.command="valkey-server --appendonly yes --save "+l;break}}if(n){let l=e.env.production||{};a.services["workbench-frontend"]={build:{context:".",dockerfile:"Dockerfile.workbench-frontend"},ports:[`\${WORKBENCH_PORT:-${i}}:${i}`],depends_on:["workbench-backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}",`RACLETTE_SERVER_BASE_URL=\${RACLETTE_SERVER_BASE_URL:-http://localhost:${i}/api}`,"RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}",...Object.entries(l).map(([u,p])=>`${u}=${p}`)]},a.services["workbench-backend"]={build:{context:".",dockerfile:"Dockerfile.workbench-backend"},depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","DISABLE_PLUGIN_LOGS=${RACLETTE_DISABLE_PLUGIN_LOGS:-false}","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.services.mongodb?.databaseName||e.name}}}`,`CACHE_URL=\${RACLETTE_CACHE_URL:-valkey://cache:6379${e.services.cache?.db?`/${e.services.cache?.db}`:""}}`,...Object.entries(l).map(([u,p])=>`${u}=${p}`)]}}await B.writeFile(r,ot.dump(a))},Uk=async(e,t,r)=>{let n=Hs(e,r);await B.writeFile(U.join(t,".env.example"),n)},Hs=(e,t)=>{let r=e.services.frontend?.port||8081,n=e.services.workbench?.frontendPort||8083;return`# Production Environment Variables
|
|
846
846
|
# Copy this file to .env and fill in your values
|
|
847
847
|
|
|
848
848
|
# Required - Generate a secure random string for this
|
|
@@ -880,7 +880,7 @@ ${Object.keys(e.env.production||{}).map(i=>`# ${i}=`).join(`
|
|
|
880
880
|
|
|
881
881
|
# Cache specific overrides (uncomment if using external Valkey/Redis)
|
|
882
882
|
# RACLETTE_CACHE_URL=valkey://your-external-cache:6379
|
|
883
|
-
`},
|
|
883
|
+
`},Wk=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
|
|
884
884
|
# Raclette Production Deployment Script
|
|
885
885
|
|
|
886
886
|
set -e
|
|
@@ -933,7 +933,7 @@ echo " - Built with TypeScript and compiled to dist/src/server.js"
|
|
|
933
933
|
echo " - Runs on Node.js 24 Alpine with production dependencies only"
|
|
934
934
|
echo " - Should listen on 0.0.0.0:3000 for proper container networking"
|
|
935
935
|
echo " - Accessible via /api proxy on port ${n}"
|
|
936
|
-
`,s=U.join(e,"deploy.sh");await B.writeFile(s,i),await B.chmod(s,493)},
|
|
936
|
+
`,s=U.join(e,"deploy.sh");await B.writeFile(s,i),await B.chmod(s,493)},zd=async(e,t,r)=>{let n={services:{},volumes:{},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},o=`${e.name}-build`;if(e.services.mongodb?.enabled){let i=`${o}-mongodb-data`;n.services.mongodb={container_name:`${o}-mongodb`,image:"mongo:5.0.6",ports:[`127.0.0.1:${e.services.mongodb.port}:27017`],volumes:[`${i}:/data/db`],networks:["raclette_shared"],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},n.volumes[i]=null}if(e.services.redis?.enabled){let i=`${o}-redis-data`;n.services.redis={container_name:`${o}-redis`,image:"redis:7-alpine",ports:[`127.0.0.1:${e.services.redis.port}:6379`],command:"redis-server --appendonly yes",volumes:[`${i}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","redis-cli","ping"],interval:"10s",timeout:"5s",retries:3}},n.volumes[i]=null}if(e.services.backend?.enabled){let i=`${o}-backend_node_modules`;n.services.backend={container_name:`${o}-backend`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:"development"}},command:"yarn generate",environment:["NODE_ENV=development","RACLETTE_BUILD_MODE=generate",`MONGO_HOST=mongodb://mongodb:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,"SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET:-thisshouldbesetforproduction}",`CACHE_URL=redis://redis:${e.services.redis?.port||6379}`,...Object.entries(e.env.development||{}).map(([s,a])=>`${s}=${a}`)],volumes:[`${i}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./plugins:/app/src/appPlugins","./.raclette/backend/raclette.config.js:/app/raclette.config.js","./.raclette/backend/package.json:/app/package.json","./.raclette/dist/check-dependencies.sh:/app/check-dependencies.sh",`${Pt("backend",e)}:/app/yarn.lock`],networks:["raclette_shared"],depends_on:{...e.services.mongodb?.enabled&&{mongodb:{condition:"service_started"}},...e.services.redis?.enabled&&{redis:{condition:"service_healthy"}}},entrypoint:["/app/check-dependencies.sh"]},n.volumes[i]=null}e.services.backend?.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(i=>{let s=it(i,t);n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=qr(i.volumes,t))}),await B.writeFile(r,ot.dump(n))},Qd=async(e,t,r,n)=>{let o={services:{},volumes:{},networks:{raclette_shared:{external:!0,name:"raclette_shared"}}},i=`${e.name}-build`;if(e.services.frontend?.enabled){let s=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`;o.services.frontend={container_name:`${i}-frontend`,build:{context:".",dockerfile:"./frontend.Dockerfile",args:{NODE_ENV:"production"},target:"build"},command:["sh","-c","yarn install --production=false && yarn build && cp -r /app/dist/* /build-output/"],environment:[...Object.entries(e.env.production||{}).map(([a,c])=>`${a}=${c}`),"NODE_ENV=production"],volumes:["./.raclette/virtual/frontend/src:/app/src","./.raclette/virtual/backend/src/shared:/app/src/shared",`${s}:/app/node_modules`,"./plugins:/app/src/plugins","./.raclette/virtual/backend/src/corePlugins:/app/src/corePlugins","./.raclette/virtual/frontend/types:/app/types","./.raclette/frontend/raclette.config.js:/app/raclette.config.js","./.raclette/frontend/package.json:/app/package.json",`${Pt("frontend",e)}:/app/yarn.lock`,`${U.resolve(n,"frontend")}:/build-output`],networks:["raclette_shared"]},o.volumes[s]=null;try{e.services.frontend?.volumes&&e.services.frontend.volumes.length>0&&e.services.frontend.volumes.forEach(a=>{let c=it(a,t);o.services.frontend.volumes.push(c)})}catch{console.error(f.red("Could not add custom volumes to backend docker-compose file. This might lead to missing data."))}}if(e.services.backend?.enabled){let s=e.services.backend.nodeModulesVolume||`${e.name}-backend_node_modules`;o.services.backend={container_name:`${i}-backend`,build:{context:".",dockerfile:"./backend.Dockerfile",args:{NODE_ENV:"production"}},command:["sh","-c","yarn install --production=false && rm -rf ./dist && yarn build && cp -r /app/dist /build-output/ && cp /app/package.json /build-output/ && cp /app/yarn.lock /build-output/ || echo 'Backend build failed'"],environment:[...Object.entries(e.env.production||{}).map(([a,c])=>`${a}=${c}`),"NODE_ENV=production"],volumes:[`${s}:/app/node_modules`,"./.raclette/virtual/backend/src:/app/src","./.raclette/backend/raclette.config.js:/app/raclette.config.js","./plugins:/app/src/appPlugins","./.raclette/backend/package.json:/app/package.json",`${Pt("backend",e)}:/app/yarn.lock`,"./.raclette/virtual/backend/types:/app/types",`${U.resolve(n,"backend")}:/build-output`],networks:["raclette_shared"]},o.volumes[s]=null;try{e.services.backend?.volumes&&e.services.backend.volumes.length>0&&e.services.backend.volumes.forEach(a=>{let c=it(a,t);o.services.backend.volumes.push(c)})}catch{console.error(f.red("Could not add custom volumes to backend docker-compose file. This might lead to missing data."))}}Object.values(o.services).forEach(s=>{s.volumes&&(s.volumes=qr(s.volumes,t))}),await B.writeFile(r,ot.dump(o))},qk=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
|
|
937
937
|
# Raclette Production Deployment Script with Image Loading
|
|
938
938
|
|
|
939
939
|
set -e
|
|
@@ -988,7 +988,7 @@ echo " View logs: docker compose logs -f"
|
|
|
988
988
|
echo " Stop: docker compose down"
|
|
989
989
|
echo " Restart: docker compose restart"
|
|
990
990
|
echo " Update images: ./load-images.sh && docker compose up -d"
|
|
991
|
-
`;await B.writeFile(U.join(e,"deploy.sh"),s),await B.chmod(U.join(e,"deploy.sh"),493)},
|
|
991
|
+
`;await B.writeFile(U.join(e,"deploy.sh"),s),await B.chmod(U.join(e,"deploy.sh"),493)},Yk=async(e,t)=>{let r=`#!/bin/bash
|
|
992
992
|
# Load Docker Images Script
|
|
993
993
|
|
|
994
994
|
set -e
|
|
@@ -1020,7 +1020,7 @@ echo "\u2705 All images loaded successfully!"
|
|
|
1020
1020
|
echo ""
|
|
1021
1021
|
echo "\u{1F433} Available images:"
|
|
1022
1022
|
docker images | grep -E "${t.map(n=>n.split(":")[0]).join("|")}" || echo "No images found (this might be expected if tags changed)"
|
|
1023
|
-
`;await B.writeFile(U.join(e,"load-images.sh"),r),await B.chmod(U.join(e,"load-images.sh"),493)},
|
|
1023
|
+
`;await B.writeFile(U.join(e,"load-images.sh"),r),await B.chmod(U.join(e,"load-images.sh"),493)},Kk=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
|
|
1024
1024
|
|
|
1025
1025
|
This package contains everything needed to deploy your Raclette application.
|
|
1026
1026
|
|
|
@@ -1107,7 +1107,7 @@ ${n?`- Workbench: http://localhost:${i}`:""}
|
|
|
1107
1107
|
- Ports ${o}${n?`, ${i}`:""} available
|
|
1108
1108
|
|
|
1109
1109
|
Generated on: ${new Date().toISOString()}
|
|
1110
|
-
`;await B.writeFile(U.join(e,"README.md"),s)},
|
|
1110
|
+
`;await B.writeFile(U.join(e,"README.md"),s)},Jd=async(e,t,r,n,o)=>{console.log(f.blue("\u{1F4E6} Packaging images for distribution..."));let i=U.join(t,"..","package"),s=`${e.name}-deployment-${n}`,a=U.join(i,`${s}.tar.gz`);await B.ensureDir(i),await B.emptyDir(i);let c=U.join(i,s);await B.ensureDir(c);try{console.log(f.gray(" \u{1F4BE} Exporting Docker images..."));let l=U.join(c,"images");await B.ensureDir(l);for(let p of r){let d=`${p.replace(/[:/]/g,"_")}.tar`,g=U.join(l,d);console.log(f.gray(` \u{1F4E6} Exporting ${p}...`)),ce(["save","-o",g,p],{stdio:"pipe"});let m=await B.stat(g);if(m.size===0)throw new Error(`Failed to export image ${p}`);console.log(f.gray(` \u2705 Exported ${p} (${(m.size/1024/1024).toFixed(1)}MB)`))}console.log(f.gray(" \u{1F4C4} Copying deployment files..."));let u=["docker-compose.yml",".env.example","deploy.sh","nginx.conf"];return o&&u.push("nginx.workbench.conf"),await Hk(u,t,c,{required:!1,logPrefix:" "}),await qk(c,r,o,e),await Yk(c,r),await Kk(c,e,r,o),console.log(f.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await Xk(c,a),await B.remove(c),console.log(f.green(` \u2705 Deployment package created: ${s}.tar.gz`)),{packagePath:a,imageNames:r}}catch(l){throw await B.remove(c).catch(()=>{}),l}},Xk=async(e,t)=>{let r=U.dirname(e),n=U.basename(e);Mk(`tar -czf "${t}" -C "${r}" "${n}"`,{stdio:"pipe"});let o=await B.stat(t);console.log(f.gray(` \u{1F4E6} Package size: ${(o.size/1024/1024).toFixed(1)}MB`))};var Zd=async(e,t,r={})=>{let n=Date.now(),o=Qk(r);console.log(f.blue(`\u{1F9C0} Starting Raclette ${o} build...`)),Vr();let i=H.join(process.cwd(),".raclette"),s=H.resolve(r.outputDir||H.join(i,".build"));await V.ensureDir(s),await V.emptyDir(s);try{await ix(e,t,i),await sx(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await Jk(e,i,s,r);break;case"images":a=await ef(e,i,s,r);break;case"package":a=await Zk(e,i,s,r);break}let c=(Date.now()-n)/1e3;return h.success(` ${o} build completed in ${c}s`),ox(a,e),a}catch(a){throw h.error(`${o} build failed: ${a.message}`),a}},Qk=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),Jk=async(e,t,r,n)=>{if(n.buildOnly){console.log(f.blue("\u{1F4C1} Building application files only...")),await Vs(e,t,r,n);let i=await Gs(e,r,n);return console.log(f.green("\u2705 Build files ready")),{mode:"artifacts",buildDir:r,artifacts:{}}}else{console.log(f.blue("\u{1F4C1} Building local deployment artifacts..."));let i=H.join(r,"app");await Vs(e,t,i,n);let s=await Gs(e,r,n),a=await Bs(e,r,s),c=await nx(e,r,s);return console.log(f.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:H.join(r,"deploy.sh"),readmeFile:c,envExampleFile:H.join(r,".env.example")}}}},ef=async(e,t,r,n)=>{console.log(f.blue("\u{1F433} Building Docker images for CI/CD..."));let o=H.join(r,"app");await Vs(e,t,o,n);let i=await Gs(e,r,n);await Bs(e,r,i);let s=await ex(e,r,i,n);return console.log(f.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},Zk=async(e,t,r,n)=>{console.log(f.blue("\u{1F4E6} Building offline deployment package..."));let o=await ef(e,t,r,n),i=tf(),s=await Jd(e,r,o.images.names,i,o.images.names.some(a=>a.includes("workbench")));return console.log(f.green("\u2705 Offline deployment package ready")),{...o,mode:"package",deploymentPackage:s.packagePath}},ex=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||tf(),s=n.platforms||"linux/amd64,linux/arm64",a=n.buildx||!1,c=[],l=[i];if(n.generateLatest&&!l.includes("latest")&&l.push("latest"),a)try{await tx(),console.log(f.blue(`\u{1F3D7}\uFE0F Building multi-architecture images for: ${s}`))}catch(u){console.warn(f.yellow("\u26A0\uFE0F Buildx not available, falling back to single-architecture builds")),console.warn(f.yellow(` ${u.message}`)),a=!1}if(a){let u=["frontend","backend"];r&&u.push("workbench-frontend","workbench-backend");for(let p of u){let d=`${o}/${p}`,g=H.join(t,`Dockerfile.${p}`);if(!await V.pathExists(g))throw new Error(`Dockerfile not found: ${g}`);let m=l.map(y=>`${d}:${y}`);c.push(...m),await rx({context:t,dockerfile:g,tags:m,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(f.gray(` \u2705 Built ${p} for ${s}`)),m.forEach(y=>{console.log(f.gray(` ${y}`))})}}else{console.log(f.gray(" \u{1F528} Building single-architecture images..."));let p=["-f",H.join(t,"docker-compose.yml"),"build"];n.noCache&&p.push("--no-cache"),ye(p,{stdio:n.verbose?"inherit":"pipe",cwd:t});let d=["frontend","backend"];r&&d.push("workbench-frontend","workbench-backend");for(let g of d){let m=`${H.basename(t)}-${g}`.replace(/\./,""),y=`${o}/${g}`;l.forEach(k=>{let R=`${y}:${k}`;ce(["tag",m,R],{stdio:"pipe"}),c.push(R)}),console.log(f.gray(` \u2705 Tagged ${g}`))}}return console.log(f.green(" \u2705 Docker images built and tagged")),{names:c,tags:l}},tx=async()=>{try{ce(["buildx","version"],{stdio:"pipe"}),console.log(f.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),ce(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(f.gray(" \u{1F4E6} Creating buildx builder...")),ce(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),ce(["buildx","inspect","--bootstrap"],{stdio:"pipe"}),console.log(f.gray(" \u2705 Buildx builder ready with QEMU emulation"))}catch(e){throw console.warn(f.yellow(" \u26A0\uFE0F Buildx setup failed, falling back to single-architecture builds")),console.warn(f.yellow(` ${e.message}`)),new Error("Buildx not available - use single-architecture builds instead")}},rx=async e=>{let t=["buildx","build","--platform",e.platforms,"--file",e.dockerfile];e.tags.forEach(n=>{t.push("--tag",n)});let r=e.platforms.split(",").length;e.push?t.push("--push"):r===1?t.push("--load"):(console.log(f.yellow(" \u26A0\uFE0F Multi-platform images cannot be loaded locally")),console.log(f.yellow(" \u2139\uFE0F Images built but not loaded to local Docker"))),e.noCache&&t.push("--no-cache"),t.push(e.context);try{ce(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},nx=async(e,t,r)=>{let n=H.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
|
|
1111
1111
|
|
|
1112
1112
|
This build contains everything needed to deploy ${e.name} locally using Docker.
|
|
1113
1113
|
|
|
@@ -1172,7 +1172,7 @@ Edit \`docker-compose.yml\` to:
|
|
|
1172
1172
|
|
|
1173
1173
|
Built on: ${new Date().toISOString()}
|
|
1174
1174
|
Build type: Local deployment artifacts
|
|
1175
|
-
`;return await V.writeFile(n,s),console.log(f.gray(" \u2705 Created local deployment README")),n},
|
|
1175
|
+
`;return await V.writeFile(n,s),console.log(f.gray(" \u2705 Created local deployment README")),n},ox=(e,t)=>{let r=t.services.frontend?.port||8081,n=t.services.workbench?.frontendPort||8083,o=e.images?.names.some(i=>i.includes("workbench"))||!1;switch(console.log(""),console.log(f.blue("\u{1F4E6} Build Summary:")),console.log(` Mode: ${f.cyan(e.mode)}`),console.log(` Build Directory: ${f.cyan(e.buildDir)}`),e.mode==="artifacts"&&(console.log(` Docker Compose: ${f.cyan(e.artifacts.composeFile||"N/A")}`),console.log(` Deploy Script: ${f.cyan(e.artifacts.deployScript||"N/A")}`),console.log(` README: ${f.cyan(e.artifacts.readmeFile||"N/A")}`)),e.images&&e.images.names.length>0&&(console.log(` Docker Images: ${f.cyan(e.images.names.length)} built`),e.images.names.forEach(i=>{console.log(` - ${f.gray(i)}`)})),e.deploymentPackage&&console.log(` Deployment Package: ${f.cyan(e.deploymentPackage)}`),console.log(""),console.log(f.blue("\u{1F680} Next steps:")),e.mode){case"artifacts":console.log(f.yellow(" 1. Configure: cp .env.example .env && edit .env")),console.log(f.yellow(" 2. Deploy: chmod +x deploy.sh && ./deploy.sh")),console.log(f.yellow(` \u2192 App will be at http://localhost:${r}`)),o&&console.log(f.yellow(` \u2192 Workbench at http://localhost:${n}`));break;case"images":console.log(f.yellow(" Images ready for registry push:")),e.images?.names.forEach(i=>{console.log(f.yellow(` docker push ${i}`))}),console.log(""),console.log(f.gray(" \u{1F4A1} Example pipeline usage:")),console.log(f.gray(" docker push myregistry.com/myproject/frontend:v1.0.0")),console.log(f.gray(" docker push myregistry.com/myproject/backend:v1.0.0"));break;case"package":console.log(f.yellow(" 1. Transfer package to target system")),console.log(f.yellow(" 2. Extract: tar -xzf deployment-package.tar.gz")),console.log(f.yellow(" 3. Configure: cp .env.example .env && edit .env")),console.log(f.yellow(" 4. Deploy: ./deploy.sh"));break}},tf=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),ix=async(e,t,r)=>{console.log(f.blue("\u{1F4C1} Setting up build environment...")),await In(e),await Ln(e),await Dn(e),await jn(e,r),await zr(e,r),await Pr(e,r),console.log(f.green("\u2705 Build environment ready"))},sx=async(e,t,r)=>{console.log(f.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=H.join(r,"docker-compose.generate.yml");await Yr(e,r,"build"),await zd(e,t,o),Gr("raclette_shared");try{console.log(f.gray(" \u{1F433} Starting generation services...")),ye(["-p",n,"-f",o,"up","-d"],{stdio:"pipe"}),console.log(f.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=60;for(;i<s;)try{if(!(await ye(["-p",n,"-f",o,"ps","-q","backend"],{stdio:"pipe"})).trim())break;await new Promise(c=>setTimeout(c,1e3)),i++}catch{break}if(i>=s)throw new Error("Generation mode timed out");console.log(f.green(" \u2705 File generation completed"))}finally{try{ye(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(f.yellow("Warning: Could not cleanup generation services"))}}},Vs=async(e,t,r,n)=>{console.log(f.blue("\u{1F3A8} Building main application...")),await V.ensureDir(r),await Yr(e,t,"build"),await ax(e,t,r,n)},ax=async(e,t,r,n)=>{console.log(f.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=H.join(t,"docker-compose.app-build.yml"),s=H.join(t,".temp-build");await V.ensureDir(s),await V.ensureDir(H.join(s,"frontend")),await V.ensureDir(H.join(s,"backend"));try{await Qd(e,process.cwd(),i,s);let a=["-p",o,"-f",i,"up"];if(n.noCache&&a.push("--build","--force-recreate"),console.log(f.gray(" \u{1F528} Starting parallel build process...")),ye(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=H.join(r,"frontend");await V.ensureDir(c);let l=H.join(s,"frontend");if(await V.pathExists(l)){if((await V.readdir(l)).length===0)throw new Error("Frontend build produced no output files");await V.copy(l,c),console.log(f.green(" \u2705 Frontend build complete"))}else throw new Error("Frontend build did not produce expected output directory")}if(e.services.backend?.enabled){let c=H.join(r,"backend");await V.ensureDir(c);let l=H.join(s,"backend");if(!await V.pathExists(l))throw new Error("Backend build did not produce expected output directory");await cx(e,t,c,s),console.log(f.green(" \u2705 Backend build complete"))}console.log(f.green(" \u2705 Application build completed"))}finally{try{ye(["-p",o,"-f",i,"down"],{stdio:"pipe"})}catch{console.warn(f.yellow("Warning: Could not cleanup build services"))}await V.remove(s),await V.remove(i)}},cx=async(e,t,r,n)=>{console.log(f.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=H.join(n,"backend");await V.ensureDir(r),await V.pathExists(o)&&(await V.copy(o,r),console.log(f.gray(" \u2705 Copied backend build artifacts")));let i=H.join(r,"dist");if(!await V.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=H.join(i,"src","server.js");if(!await V.pathExists(s))throw new Error("Backend build did not produce expected dist/src/server.js entry point");let a=H.join(r,"package.json");if(await V.pathExists(a)){let l=await V.readJson(a),u={...l,scripts:{start:"node dist/src/server.js",...l.scripts},devDependencies:void 0};await V.writeJson(a,u,{spaces:2}),console.log(f.gray(" \u2705 Updated package.json for production"))}else throw new Error("Backend build did not include package.json");let c=H.join(r,"yarn.lock");await V.pathExists(c)||console.warn(f.yellow(" \u26A0\uFE0F No yarn.lock found in backend build")),console.log(f.gray(" \u2705 Backend Node.js application structure created")),console.log(f.gray(" \u{1F4C1} Entry point: dist/src/server.js")),await lx(r)},lx=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=H.join(e,i);await V.pathExists(s)||r.push(i)}if(r.length>0)throw new Error(`Backend application is missing required files: ${r.join(", ")}`);let n=H.join(e,"package.json"),o=await V.readJson(n);(!o.scripts?.start||!o.scripts.start.includes("dist/src/server.js"))&&console.warn(f.yellow(" \u26A0\uFE0F package.json start script may not point to dist/src/server.js")),console.log(f.gray(" \u2705 Backend structure verified successfully"))},Gs=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await ux(e,t,r),!0),ux=async(e,t,r)=>{console.log(f.blue("\u{1F527} Building workbench..."));let n=H.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await V.pathExists(n)){h.warn("Workbench package not found, skipping workbench build");return}let o=H.join(t,"workbench");try{let i={...process.env,MONGO_HOST:`mongodb://localhost:${e.services.mongodb?.port||27017}/${e.services.mongodb?.databaseName||e.name}`,CACHE_URL:`redis://localhost:${e.services.redis?.port||6379}`,...e.env.development},s=`${e.name}-workbench`;console.log(f.gray(" \u{1F527} Running workbench build process as "+s)),await new Promise((a,c)=>{let l=["build","--output-dir",o,"--build-only",r.verbose?"-v":"","-p",s].filter(p=>p!==""),u=zk("yarn",l,{cwd:n,stdio:r.verbose?"inherit":"ignore",env:i});u.on("close",p=>{h.raw(f.gray(` \u{1F3C1} Workbench build process exited with code ${p}`)),p===0?a():c(new Error(`Workbench build failed with exit code ${p}`))}),u.on("error",p=>{h.raw(f.red(` \u274C Workbench build process error: ${p.message}`)),c(p)})}),h.raw(f.green(" \u2705 Workbench build complete"))}catch(i){throw h.error("Workbench build failed: "+i.message),i}};import Ze from"fs-extra";import Je from"path";var Us=()=>[{description:"custom favicon",source:"./branding/favicon.png",target:"/usr/shared/nginx/html/favicon.png",service:"frontend"},{description:"custom logo in app",source:"./branding/custom-logo.png",target:"/usr/shared/nginx/html/logo.png",service:"frontend"},{description:"custom home icon (can be full logo or just an icon)",source:"./branding/custom-home-icon.png",target:"/usr/shared/nginx/html/home-icon.png",service:"frontend"},{description:"custom logo in login screen (not used, if not set)",source:"./branding/custom-login-logo.png",target:"/usr/shared/nginx/html/login-logo.png",service:"frontend"}];var rf=async(e,t={})=>{console.log(f.blue("\u{1F4CB} Generating deployment guide..."));let r=Je.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=sf(e,n,o,i);return t.generateFiles?await fx(e,s,r,i):await hx(e,s,r,i)},nf=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=sf(e,r,n,o);return await px(e,i,n,o)},px=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await cf(e,t,r,n),a=await lf(),c=dx(e.name,r);return`# Deploy ${e.name} with Docker
|
|
1176
1176
|
|
|
1177
1177
|
Deploy ${e.name} using pre-built Docker images.
|
|
1178
1178
|
|
|
@@ -1240,8 +1240,8 @@ docker compose down -v
|
|
|
1240
1240
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1241
1241
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1242
1242
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1243
|
-
`},
|
|
1244
|
-
`),
|
|
1243
|
+
`},dx=(e,t)=>["# Required","RACLETTE_SERVER_TOKEN_SECRET=your-secret-key-here","RACLETTE_FRONTEND_URLS=https://yourdomain.com,https://workbench.yourdomain.com # required to prevent CORS issues","","# Database Name",`RACLETTE_MONGO_DATABASE=${e}`,"","# Image Configuration",`IMAGE_TAG=${t}`,"","# Optional - Debug Mode","# RACLETTE_DEBUG_MODE=true # Uncomment to see frontend logs in console"].join(`
|
|
1244
|
+
`),of=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await cf(e,t,"latest",r),s=await lf();return`# Deploy ${e.name} with Docker
|
|
1245
1245
|
|
|
1246
1246
|
Deploy ${e.name} using pre-built Docker images.
|
|
1247
1247
|
|
|
@@ -1349,7 +1349,7 @@ docker compose down -v
|
|
|
1349
1349
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1350
1350
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1351
1351
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1352
|
-
`},
|
|
1352
|
+
`},sf=(e,t,r,n)=>{let o=["frontend","backend"],i=e.services.workbench?.enabled||!1;return i&&o.push("workbench-frontend","workbench-backend"),{names:o.map(a=>{let c=`${t}/${a}`;return`${n?`${n}${c}`:c}:${r}`}),hasWorkbench:i}},fx=async(e,t,r,n)=>{console.log(f.blue("\u{1F4C1} Generating deployment files..."));let o=Je.join(r,"deploy-guide");await Ze.ensureDir(o);let i=Je.join(o,"docker-compose.yml");await af(e,t,i,"latest",n);let s=Je.join(o,"docker-compose.override.yml.example");await mx(e,s);let a=Je.join(o,".env.example");await gx(e,a,t.hasWorkbench);let c=Je.join(o,"README.md");await yx(e,t,c,n);let l=Je.join(o,"DEPLOY.md");return await bx(e,t,l,n),console.log(f.green("\u2705 Deployment files generated")),console.log(f.gray(` \u{1F4C1} Files created in: ${o}`)),{outputPath:o,mode:"files",deployGuideFile:l,additionalFiles:[i,s,a,c]}},hx=async(e,t,r,n)=>{console.log(f.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=Je.join(r,"DEPLOY.md");return await vx(e,t,o,n),console.log(f.green("\u2705 Deployment guide generated")),console.log(f.gray(` \u{1F4C4} Guide: ${o}`)),{outputPath:r,mode:"embedded",deployGuideFile:o}},af=async(e,t,r,n,o)=>{let i=e.services.frontend?.port||8081,s=e.services.workbench?.frontendPort||8083,a=l=>{let d=l.split(":")[0].replace(o,"");return o?`${o}${d}:\${IMAGE_TAG:-${n}}`:`\${DOCKER_REGISTRY:-}${d}:\${IMAGE_TAG:-${n}}`},c={name:e.name,services:{frontend:{image:a(t.names[0]),ports:[`\${FRONTEND_PORT:-${i}}:${i}`],depends_on:["backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}"],healthcheck:{test:["CMD","curl","-f",`http://0.0.0.0:${i}/`],interval:"10s",timeout:"30s",retries:10}},backend:{image:a(t.names[1]),depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}},database:{image:"mongo:5.0.6",restart:"unless-stopped",volumes:["mongodb_data:/data/db"],networks:["app-network"],environment:[`MONGO_INITDB_DATABASE=\${MONGO_DATABASE:-${e.name}}`],healthcheck:{test:["CMD","mongosh","--eval","db.adminCommand('ping')"],interval:"10s",timeout:"30s",retries:20}},cache:{image:"valkey/valkey:8.1-alpine",restart:"unless-stopped",volumes:["cache_data:/data"],networks:["app-network"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}}},volumes:{mongodb_data:{},cache_data:{}},networks:{"app-network":{driver:"bridge"}}};t.hasWorkbench&&t.names.length>=4&&(c.services["workbench-frontend"]={image:a(t.names[2]),ports:[`\${WORKBENCH_FRONTEND_PORT:-${s}}:${s}`],depends_on:["workbench-backend"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","RACLETTE_DEBUG_MODE=${RACLETTE_DEBUG_MODE:-false}","RACLETTE_SERVER_BASE_URL=${RACLETTE_SERVER_BASE_URL:-/api}","RACLETTE_SOCKET_URL=${RACLETTE_SOCKET_URL:-}"],healthcheck:{test:["CMD","curl","-f",`http://0.0.0.0:${s}/`],interval:"10s",timeout:"30s",retries:10}},c.services["workbench-backend"]={image:a(t.names[3]),depends_on:["database","cache"],restart:"unless-stopped",networks:["app-network"],environment:["NODE_ENV=production","PORT=3000","SERVER_TOKEN_SECRET=${SERVER_TOKEN_SECRET}",`MONGO_HOST=\${RACLETTE_MONGODB_HOST:-mongodb://database:27017/\${MONGO_DATABASE:-${e.name}}}`,"CACHE_URL=${RACLETTE_CACHE_URL:-valkey://cache:6379}"],healthcheck:{test:["CMD","curl","-f","http://0.0.0.0:3000/health"],interval:"10s",timeout:"30s",retries:10}}),await Ze.writeFile(r,ot.dump(c))},mx=async(e,t)=>{let r=Us(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
|
|
1353
1353
|
# Copy this file to docker-compose.override.yml and customize as needed
|
|
1354
1354
|
# This file allows you to extend the main docker-compose.yml without modifying it
|
|
1355
1355
|
|
|
@@ -1387,7 +1387,7 @@ ${o.map(s=>` # ${s.description}
|
|
|
1387
1387
|
# Add custom networks if needed
|
|
1388
1388
|
# networks:
|
|
1389
1389
|
# custom-network:
|
|
1390
|
-
`;await Ze.writeFile(t,i)},
|
|
1390
|
+
`;await Ze.writeFile(t,i)},gx=async(e,t,r)=>{let n=Hs(e,r);await Ze.writeFile(t,n)},yx=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
|
|
1391
1391
|
|
|
1392
1392
|
This folder contains deployment files for testing registry-based deployment locally.
|
|
1393
1393
|
|
|
@@ -1476,7 +1476,7 @@ you can adjust these registry examples based on where your images will be hosted
|
|
|
1476
1476
|
\`\`\`
|
|
1477
1477
|
|
|
1478
1478
|
Generated on: ${new Date().toISOString()}
|
|
1479
|
-
`;await Ze.writeFile(r,s)},
|
|
1479
|
+
`;await Ze.writeFile(r,s)},bx=async(e,t,r,n)=>{let o=await of(e,t,n);await Ze.writeFile(r,o)},vx=async(e,t,r,n)=>{let o=await of(e,t,n),i=`# ${e.name} - Registry Deployment Guide
|
|
1480
1480
|
|
|
1481
1481
|
## For Developers
|
|
1482
1482
|
|
|
@@ -1500,7 +1500,7 @@ ${t.names.map(s=>`- \`${s}\``).join(`
|
|
|
1500
1500
|
*Copy everything below this line to your project README or documentation*
|
|
1501
1501
|
|
|
1502
1502
|
${o}
|
|
1503
|
-
`;await Ze.writeFile(r,i)},
|
|
1503
|
+
`;await Ze.writeFile(r,i)},cf=async(e,t,r,n)=>{let o=Je.join(process.cwd(),"temp-compose.yml");await af(e,t,o,r,n);let i=await Ze.readFile(o,"utf8");return await Ze.remove(o),i},lf=async()=>{let e=Us(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
|
|
1504
1504
|
frontend:
|
|
1505
1505
|
volumes:
|
|
1506
1506
|
${t.map(n=>` # ${n.description}
|
|
@@ -1515,7 +1515,7 @@ ${r.map(n=>` # ${n.description}
|
|
|
1515
1515
|
# - ${n.source}:${n.target}`).join(`
|
|
1516
1516
|
`)}
|
|
1517
1517
|
environment:
|
|
1518
|
-
# - CUSTOM_API_KEY=your-key`};var Le=new ya;Le.version("0.1.0");Le.command("dev").description("Start development environment").option("-q, --quiet","Run Docker Compose in detached mode without following logs").option("-v, --verbose","Get more information about what is happening").option("--filter <service>","Filter logs to specific services (comma-separated)","frontend,backend").option("--force-rebuild, --rebuild","Force rebuild of Docker images regardless of file changes").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").option("--no-cache","Force rebuild Docker images without using cache").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Starting raclette development environment..."),Vr();let t=await Oe(),r=process.cwd(),n;try{n=await Pe(e.configFile)}catch(i){h.error("Could not read raclette.config.js file. Please check your file for syntax errors! Canceling startup process."),h.error(`The following error occured on reading the file: "${i.message}"`),process.exit(1)}n||(h.error("No configuration loaded"),process.exit(1));let o=Wt.join(t,"docker-compose.yml");e.projectName&&(h.raclette("Setting project name to "+e.projectName),n.name=e.projectName),await Bd(n,{dockerComposePath:o,workingDir:r,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):["frontend","backend"],forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){h.error("Error starting development environment: "+t?.message),process.exit(1)}});Le.command("log [services...]").description("Follow logs for specified services (or all services if none specified)").option("-f, --follow","Follow log output (default: true)",!0).option("--no-follow","Don't follow log output").option("--tail <lines>","Number of lines to show from the end of the logs","100").option("-v, --verbose","Verbose output").action(async(e,t)=>{try{h.setVerbose(t.verbose),h.raclette("Attaching to service logs...");let r=await Oe(),n=await Pe(),o=Wt.join(r,"docker-compose.yml");await _r.pathExists(o)||(h.error("No docker-compose.yml found. Services may not be running."),h.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await Xd(e,t,n,o)}catch(r){h.error("Error following logs: "+r.message),process.exit(1)}});Le.command("down").description("Stop Docker Compose services").option("--keep-shared","Don't stop shared services like DB and Cache").option("-p, --project-name <projectName>","Applies a specific project name").option("-v, --verbose","Verbose output").action(async e=>{try{h.setVerbose(e.verbose),console.log(f.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=await Oe(),r=await Pe(),n=process.cwd();e.projectName&&(h.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let o=Wt.join(t,"docker-compose.yml"),i=Wt.join(t,"docker-compose.full.yml");if(!await _r.pathExists(o)){console.error(f.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(h.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Ms(o,r)):(h.debug("\u2139Generating full docker-compose file including shared services"),await Lc(r,n,i,"development"),await Ms(i,r),await _r.remove(i)),h.success("Docker services stopped successfully")}catch(t){h.error("Error stopping Docker services: "+t.message),process.exit(1)}});Le.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").action(async(e,t)=>{try{if(h.setVerbose(t.verbose),h.raclette("Restarting Raclette services..."),e.length===0){h.warn("No services specified. Please specify which services to restart."),h.instruction("Usage: raclette restart <service1> <service2> ..."),h.instruction("Common services: frontend, backend, mongodb, cache");return}let r=await Oe(),n=await Pe(),o=n?.name??Wt.basename(process.cwd()),i=Wt.join(r,"docker-compose.yml");if(!await _r.pathExists(i)){h.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let s of e)try{let a=await vr(s,n,i);if(!Ot(a)){h.warn(`Service '${s}' (container: ${a}) doesn't appear to be running.`),h.instruction(" If you're sure it's running, it might have a different container name than expected."),h.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await _r.pathExists(i)?(h.progress(`Restarting service: ${s}...`),ye(["-p",o,"-f",i,"restart",s],{stdio:"inherit"})):(h.progress(` Restarting container: ${a}...`),ce(["restart",a],{stdio:"inherit"})),h.success(`Service '${s}' restarted successfully`)}catch(a){h.error(`Error restarting service '${s}': ${a.message}`)}}catch(r){h.error("Error restarting services: "+r.message),process.exit(1)}});Le.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").action(async(e="both",t)=>{try{h.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(h.error("Target must be one of: frontend, backend, both"),process.exit(1));let r=await Oe(),n=await Pe();await js(e,n),await Bs(e,n,r)||(h.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){h.error("Error updating dependencies: "+r.message),process.exit(1)}});Le.command("build").description("Build application with different modes").option("--mode <mode>","Build mode: artifacts (local deployment), images (CI/CD), package (offline)","artifacts").option("--image-tag <tag>","Image tag for registry (e.g., v1.0.0)").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--generate-latest","Also tag images as :latest").option("--output-dir <dir>","Output directory").option("--skip-workbench","Skip workbench build").option("--no-cache","Build without cache").option("-v, --verbose","Verbose output").option("--buildx","Use Docker buildx for multi-architecture builds").option("--platforms <platforms>","Target platforms for buildx","linux/amd64,linux/arm64").option("--build-only","Legacy: same as --mode artifacts").option("--build-images","Legacy: same as --mode images").option("--package-images","Legacy: same as --mode package").option("-p, --project-name <projectName>","Applies a specific project name").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Building raclette application...");let t=process.cwd();await Oe();let r=await Pe();e.projectName&&(h.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let n={outputDir:e.outputDir,skipWorkbench:e.skipWorkbench,verbose:e.verbose,noCache:e.noCache,mode:e.mode,imageTag:e.imageTag,imagePrefix:e.imagePrefix,generateLatest:e.generateLatest,buildOnly:e.buildOnly,buildImages:e.buildImages,packageImages:e.packageImages,buildx:e.buildx,platforms:e.platforms},o=await ef(r,t,n);switch(h.success("Build complete!"),o.mode){case"artifacts":h.success(`Build files are in ${o.buildDir}!`),h.raw(f.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":h.success("Docker images built and tagged"),h.raw(f.green("\u{1F680} Ready for registry push"));break;case"package":h.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&h.raw(f.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){h.error("Error building application: "+t?.message),process.exit(1)}});var qs=()=>["frontend","backend","workbench.frontend","workbench.backend"],Ex=e=>qs().includes(e),pf=e=>e.join(", ");Le.command("add-package <target> <package...>").description(`Add a package to the project (target: ${pf(qs())})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").action(async(e,t,r)=>{try{if(h.setVerbose(r.verbose),!Ex(e)){let i=qs();h.error(`Target must be one of: ${pf(i)}`),process.exit(1)}h.raclette(`Adding package(s) to ${e}...`);for(let i of t)await jd(e,i,r.dev);let n=await Oe(),o=await Pe();await js(e,o),await Bs(e,o,n)}catch(n){h.error("Error adding package: "+n.message),process.exit(1)}});Le.command("rebuild [services...]").description("Rebuild Docker images for specified services or all services").option("--no-cache","Force rebuild Docker images without using cache").option("-v, --verbose","Verbose output").action(async(e,t)=>{try{h.setVerbose(t.verbose),h.raclette("Rebuilding Raclette Docker images...");let r=await Oe(),n=await Pe();if(e.length===0){h.debug("\u{1F50D} Detecting services with changes...");let i=await Xr(n,r);if(i.length===0){h.warn("No service file changes detected. Use service names to force rebuild.");return}e=i}let o=e.filter(i=>i==="frontend"||i==="backend"||i==="workbench");o.length===0&&(h.error("No valid services specified for rebuild"),h.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await zr(n,r,o,{noCache:t.noCache}),h.success(`Rebuild complete for services: ${o.join(", ")}`)}catch(r){h.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});Le.command("deploy-guide").description("Generate deployment guide and files for registry-based deployment").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--image-tag <tag>","Image tag (default: latest)").option("--registry <url>","Registry URL prefix (e.g., registry.gitlab.com/group/)").option("--output-dir <dir>","Output directory (default: current directory)").option("--generate-files","Generate separate files for local testing").option("--return-only","Output to stdout only (no file generation)").option("-v, --verbose","Verbose output").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Generating raclette deployment guide..."),await Oe();let t=await Pe();if(e.returnOnly){let o={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},i=await of(t,o);console.log(i),process.exit(0)}let r={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},n=await nf(t,r);h.success("Deployment guide generated!"),n.mode==="files"?(h.raw(f.cyan(`\u{1F4C1} Files created in: ${n.outputPath}`)),h.raw(f.yellow("\u{1F4A1} Use these files for local testing")),h.raw(f.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(h.raw(f.cyan(`\u{1F4C4} Guide created: ${n.deployGuideFile}`)),h.raw(f.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch{h.error("Error generating deployment guide: "+error.message),process.exit(1)}});Le.parse(process.argv);
|
|
1518
|
+
# - CUSTOM_API_KEY=your-key`};var Le=new ga;Le.version("0.1.0");Le.command("dev").description("Start development environment").option("-q, --quiet","Run Docker Compose in detached mode without following logs").option("-v, --verbose","Get more information about what is happening").option("--filter <service>","Filter logs to specific services (comma-separated)","frontend,backend").option("--force-rebuild, --rebuild","Force rebuild of Docker images regardless of file changes").option("-p, --project-name <projectName>","Applies a specific project name").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").option("--no-cache","Force rebuild Docker images without using cache").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Starting raclette development environment..."),Vr();let t=await Oe(),r=process.cwd(),n;try{n=await Pe(e.configFile)}catch(i){h.error("Could not read raclette.config.js file. Please check your file for syntax errors! Canceling startup process."),h.error(`The following error occured on reading the file: "${i.message}"`),process.exit(1)}n||(h.error("No configuration loaded"),process.exit(1));let o=Wt.join(t,"docker-compose.yml");e.projectName&&(h.raclette("Setting project name to "+e.projectName),n.name=e.projectName),await Md(n,{dockerComposePath:o,workingDir:r,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):["frontend","backend"],forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){h.error("Error starting development environment: "+t?.message),process.exit(1)}});Le.command("log [services...]").description("Follow logs for specified services (or all services if none specified)").option("-f, --follow","Follow log output (default: true)",!0).option("--no-follow","Don't follow log output").option("--tail <lines>","Number of lines to show from the end of the logs","100").option("-v, --verbose","Verbose output").action(async(e,t)=>{try{h.setVerbose(t.verbose),h.raclette("Attaching to service logs...");let r=await Oe(),n=await Pe(),o=Wt.join(r,"docker-compose.yml");await _r.pathExists(o)||(h.error("No docker-compose.yml found. Services may not be running."),h.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await Kd(e,t,n,o)}catch(r){h.error("Error following logs: "+r.message),process.exit(1)}});Le.command("down").description("Stop Docker Compose services").option("--keep-shared","Don't stop shared services like DB and Cache").option("-p, --project-name <projectName>","Applies a specific project name").option("-v, --verbose","Verbose output").action(async e=>{try{h.setVerbose(e.verbose),console.log(f.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=await Oe(),r=await Pe(),n=process.cwd();e.projectName&&(h.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let o=Wt.join(t,"docker-compose.yml"),i=Wt.join(t,"docker-compose.full.yml");if(!await _r.pathExists(o)){console.error(f.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(h.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Fs(o,r)):(h.debug("\u2139Generating full docker-compose file including shared services"),await Nc(r,n,i,"development"),await Fs(i,r),await _r.remove(i)),h.success("Docker services stopped successfully")}catch(t){h.error("Error stopping Docker services: "+t.message),process.exit(1)}});Le.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").action(async(e,t)=>{try{if(h.setVerbose(t.verbose),h.raclette("Restarting Raclette services..."),e.length===0){h.warn("No services specified. Please specify which services to restart."),h.instruction("Usage: raclette restart <service1> <service2> ..."),h.instruction("Common services: frontend, backend, mongodb, cache");return}let r=await Oe(),n=await Pe(),o=n?.name??Wt.basename(process.cwd()),i=Wt.join(r,"docker-compose.yml");if(!await _r.pathExists(i)){h.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let s of e)try{let a=await vr(s,n,i);if(!Ot(a)){h.warn(`Service '${s}' (container: ${a}) doesn't appear to be running.`),h.instruction(" If you're sure it's running, it might have a different container name than expected."),h.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await _r.pathExists(i)?(h.progress(`Restarting service: ${s}...`),ye(["-p",o,"-f",i,"restart",s],{stdio:"inherit"})):(h.progress(` Restarting container: ${a}...`),ce(["restart",a],{stdio:"inherit"})),h.success(`Service '${s}' restarted successfully`)}catch(a){h.error(`Error restarting service '${s}': ${a.message}`)}}catch(r){h.error("Error restarting services: "+r.message),process.exit(1)}});Le.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").action(async(e="both",t)=>{try{h.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(h.error("Target must be one of: frontend, backend, both"),process.exit(1));let r=await Oe(),n=await Pe();await Is(e,n),await Ms(e,n,r)||(h.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){h.error("Error updating dependencies: "+r.message),process.exit(1)}});Le.command("build").description("Build application with different modes").option("--mode <mode>","Build mode: artifacts (local deployment), images (CI/CD), package (offline)","artifacts").option("--image-tag <tag>","Image tag for registry (e.g., v1.0.0)").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--generate-latest","Also tag images as :latest").option("--output-dir <dir>","Output directory").option("--skip-workbench","Skip workbench build").option("--no-cache","Build without cache").option("-v, --verbose","Verbose output").option("--buildx","Use Docker buildx for multi-architecture builds").option("--platforms <platforms>","Target platforms for buildx","linux/amd64,linux/arm64").option("--build-only","Legacy: same as --mode artifacts").option("--build-images","Legacy: same as --mode images").option("--package-images","Legacy: same as --mode package").option("-p, --project-name <projectName>","Applies a specific project name").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Building raclette application...");let t=process.cwd();await Oe();let r=await Pe();e.projectName&&(h.raclette("Setting project name to "+e.projectName),r.name=e.projectName);let n={outputDir:e.outputDir,skipWorkbench:e.skipWorkbench,verbose:e.verbose,noCache:e.noCache,mode:e.mode,imageTag:e.imageTag,imagePrefix:e.imagePrefix,generateLatest:e.generateLatest,buildOnly:e.buildOnly,buildImages:e.buildImages,packageImages:e.packageImages,buildx:e.buildx,platforms:e.platforms},o=await Zd(r,t,n);switch(h.success("Build complete!"),o.mode){case"artifacts":h.success(`Build files are in ${o.buildDir}!`),h.raw(f.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":h.success("Docker images built and tagged"),h.raw(f.green("\u{1F680} Ready for registry push"));break;case"package":h.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&h.raw(f.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){h.error("Error building application: "+t?.message),process.exit(1)}});var Ws=()=>["frontend","backend","workbench.frontend","workbench.backend"],_x=e=>Ws().includes(e),uf=e=>e.join(", ");Le.command("add-package <target> <package...>").description(`Add a package to the project (target: ${uf(Ws())})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").action(async(e,t,r)=>{try{if(h.setVerbose(r.verbose),!_x(e)){let i=Ws();h.error(`Target must be one of: ${uf(i)}`),process.exit(1)}h.raclette(`Adding package(s) to ${e}...`);for(let i of t)await Id(e,i,r.dev);let n=await Oe(),o=await Pe();await Is(e,o),await Ms(e,o,n)}catch(n){h.error("Error adding package: "+n.message),process.exit(1)}});Le.command("rebuild [services...]").description("Rebuild Docker images for specified services or all services").option("--no-cache","Force rebuild Docker images without using cache").option("-v, --verbose","Verbose output").action(async(e,t)=>{try{h.setVerbose(t.verbose),h.raclette("Rebuilding Raclette Docker images...");let r=await Oe(),n=await Pe();if(e.length===0){h.debug("\u{1F50D} Detecting services with changes...");let i=await Kr(n,r);if(i.length===0){h.warn("No service file changes detected. Use service names to force rebuild.");return}e=i}let o=e.filter(i=>i==="frontend"||i==="backend"||i==="workbench");o.length===0&&(h.error("No valid services specified for rebuild"),h.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await Xr(n,r,o,{noCache:t.noCache}),h.success(`Rebuild complete for services: ${o.join(", ")}`)}catch(r){h.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});Le.command("deploy-guide").description("Generate deployment guide and files for registry-based deployment").option("--image-prefix <prefix>","Image name prefix (default: project name)").option("--image-tag <tag>","Image tag (default: latest)").option("--registry <url>","Registry URL prefix (e.g., registry.gitlab.com/group/)").option("--output-dir <dir>","Output directory (default: current directory)").option("--generate-files","Generate separate files for local testing").option("--return-only","Output to stdout only (no file generation)").option("-v, --verbose","Verbose output").action(async e=>{try{h.setVerbose(e.verbose),h.raclette("Generating raclette deployment guide..."),await Oe();let t=await Pe();if(e.returnOnly){let o={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},i=await nf(t,o);console.log(i),process.exit(0)}let r={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},n=await rf(t,r);h.success("Deployment guide generated!"),n.mode==="files"?(h.raw(f.cyan(`\u{1F4C1} Files created in: ${n.outputPath}`)),h.raw(f.yellow("\u{1F4A1} Use these files for local testing")),h.raw(f.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(h.raw(f.cyan(`\u{1F4C4} Guide created: ${n.deployGuideFile}`)),h.raw(f.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch{h.error("Error generating deployment guide: "+error.message),process.exit(1)}});Le.parse(process.argv);
|
|
1519
1519
|
/*! Bundled license information:
|
|
1520
1520
|
|
|
1521
1521
|
is-extglob/index.js:
|