@raclettejs/core 0.1.23 → 0.1.25
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/CHANGELOG.md +41 -0
- package/bin/cli.js +2 -2
- package/dist/cli.js +136 -155
- package/dist/cli.js.map +4 -4
- package/dist/index.js +15 -16
- package/dist/index.js.map +4 -4
- package/package.json +24 -22
- package/services/backend/.yarn/install-state.gz +0 -0
- package/services/backend/dist/core/eventBus/index.js +7 -0
- package/services/backend/dist/core/pluginSystem/configGenerator/index.js +346 -0
- package/services/backend/dist/core/sockets/index.js +95 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/events/index.js +31 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/index.js +48 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/routes/index.js +15 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/events/index.js +22 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/index.js +51 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/routes/index.js +19 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/events/index.js +22 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/index.js +48 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/index.js +19 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/events/index.js +31 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/index.js +49 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/routes/index.js +16 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/events/index.js +39 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/index.js +50 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/routes/index.js +19 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/events/index.js +31 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/index.js +51 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/routes/index.js +21 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/events/index.js +31 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/index.js +48 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/routes/index.js +15 -0
- package/services/backend/dist/corePlugins/raclette__core/backend/index.js +34 -0
- package/services/backend/dist/domains/index.js +11 -0
- package/services/backend/dist/domains/system/index.js +11 -0
- package/services/backend/dist/domains/system/routes/index.js +17 -0
- package/services/backend/dist/helpers/index.js +14 -0
- package/services/backend/dist/index.js +3 -0
- package/services/backend/dist/modules/authentication/index.js +253 -0
- package/services/backend/dist/shared/types/core/index.js +8 -0
- package/services/backend/dist/shared/types/dataTypes/index.js +6 -0
- package/services/backend/dist/shared/types/index.js +8 -0
- package/services/backend/dist/shared/types/plugins/index.js +8 -0
- package/services/backend/dist/types/index.js +12 -0
- package/services/backend/dist/utils/index.js +2 -0
- package/services/backend/package.json +20 -18
- package/services/backend/src/core/contracting/contractRegistrar.ts +1 -1
- package/services/backend/src/core/pluginSystem/configGenerator/generatorTypes.ts +1 -0
- package/services/backend/src/core/pluginSystem/configGenerator/index.ts +2 -2
- package/services/backend/src/core/pluginSystem/pluginLoader.ts +99 -44
- package/services/backend/src/core/pluginSystem/pluginTypes.ts +1 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/index.ts +2 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.patchOwn.ts +68 -0
- package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/user.model.ts +1 -1
- package/services/backend/src/corePlugins/raclette__core/frontend/generated-config.ts +12 -0
- package/services/backend/src/shared/schemas/core/Account.schema.ts +10 -10
- package/services/backend/src/shared/schemas/core/Composition.schema.ts +25 -22
- package/services/backend/src/shared/schemas/core/CompositionCreate.schema.ts +19 -16
- package/services/backend/src/shared/schemas/core/CompositionUpdate.schema.ts +19 -16
- package/services/backend/src/shared/schemas/core/InteractionLink.schema.ts +15 -15
- package/services/backend/src/shared/schemas/core/InteractionLinkCreate.schema.ts +9 -9
- package/services/backend/src/shared/schemas/core/InteractionLinkUpdate.schema.ts +9 -9
- package/services/backend/src/shared/schemas/core/Project.schema.ts +28 -6
- package/services/backend/src/shared/schemas/core/ProjectCreate.schema.ts +22 -0
- package/services/backend/src/shared/schemas/core/ProjectUpdate.schema.ts +25 -0
- package/services/backend/src/shared/schemas/core/Tag.schema.ts +11 -9
- package/services/backend/src/shared/schemas/core/TagCreate.schema.ts +1 -3
- package/services/backend/src/shared/schemas/core/TagUpdate.schema.ts +1 -0
- package/services/backend/src/shared/schemas/core/Trigger.schema.ts +3 -3
- package/services/backend/src/shared/schemas/core/User.schema.ts +18 -18
- package/services/backend/src/shared/schemas/core/UserCreate.schema.ts +9 -9
- package/services/backend/src/shared/schemas/core/Widget.schema.ts +5 -5
- package/services/backend/src/shared/schemas/core/WidgetLayout.schema.ts +9 -9
- package/services/backend/src/shared/types/core/Composition.types.ts +1 -0
- package/services/backend/src/shared/types/core/CompositionCreate.types.ts +1 -0
- package/services/backend/src/shared/types/core/CompositionUpdate.types.ts +1 -0
- package/services/backend/src/shared/types/core/Project.types.ts +4 -0
- package/services/backend/src/shared/types/core/ProjectCreate.types.ts +4 -0
- package/services/backend/src/shared/types/core/ProjectUpdate.types.ts +4 -1
- package/services/backend/src/shared/types/core/Tag.types.ts +1 -1
- package/services/backend/src/shared/types/core/TagCreate.types.ts +0 -1
- package/services/backend/src/shared/types/core/index.ts +4 -0
- package/services/backend/src/shared/types/plugins/index.ts +1 -1
- package/services/backend/tsconfig.json +1 -0
- package/services/backend/yarn.lock +797 -935
- package/services/frontend/.yarn/install-state.gz +0 -0
- package/services/frontend/eslint.config.js +9 -0
- package/services/frontend/index.html +3 -3
- package/services/frontend/package.json +30 -28
- package/services/frontend/src/core/setup/plugin-system/discovery/app-plugins.ts +43 -4
- package/services/frontend/src/orchestrator/ProductOrchestrator.vue +10 -11
- package/services/frontend/src/orchestrator/assets/styles/layers.css +11 -0
- package/services/frontend/src/orchestrator/assets/styles/tailwindStyles.css +5 -11
- package/services/frontend/src/orchestrator/assets/styles/vuetifyStyles.scss +0 -4
- package/services/frontend/src/orchestrator/components/composition/WidgetsLayoutLoader.vue +5 -18
- package/services/frontend/src/orchestrator/composables/useWidgets/helperFunctions.ts +54 -5
- package/services/frontend/src/orchestrator/helpers/index.ts +1 -0
- package/services/frontend/src/orchestrator/helpers/widgetVisuals.ts +71 -0
- package/services/frontend/src/orchestrator/setup/vuetify.ts +2 -0
- package/services/frontend/src/orchestrator/types/Widgets.ts +5 -1
- package/services/frontend/vite.config.ts +24 -10
- package/services/frontend/yarn.lock +0 -5224
package/dist/cli.js
CHANGED
|
@@ -1,88 +1,90 @@
|
|
|
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 _h=Object.create;var ao=Object.defineProperty;var Eh=Object.getOwnPropertyDescriptor;var xh=Object.getOwnPropertyNames;var kh=Object.getPrototypeOf,wh=Object.prototype.hasOwnProperty;var M=(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 gt=(e,t)=>()=>(e&&(t=e(e=0)),t);var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ch=(e,t)=>{for(var r in t)ao(e,r,{get:t[r],enumerable:!0})},Ah=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of xh(t))!wh.call(e,o)&&o!==r&&ao(e,o,{get:()=>t[o],enumerable:!(n=Eh(t,o))||n.enumerable});return e};var Mt=(e,t,r)=>(r=e!=null?_h(kh(e)):{},Ah(t||!e||!e.__esModule?ao(r,"default",{value:e,enumerable:!0}):r,e));var fr=x(mo=>{var Gr=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}},ho=class extends Gr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};mo.CommanderError=Gr;mo.InvalidArgumentError=ho});var Vr=x(yo=>{var{InvalidArgumentError:Gh}=fr(),go=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.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}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 Gh(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Vh(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}yo.Argument=go;yo.humanReadableArgName=Vh});var _o=x(bo=>{var{humanReadableArgName:Uh}=Vr(),vo=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=>Uh(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 y=p.map(g=>i(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(d,y,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 y=p.map(g=>i(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));s=s.concat(this.formatItemList(d,y,r))}),s.join(`
|
|
4
|
+
`)}displayWidth(t){return Ua(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
|
-
${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()],
|
|
7
|
-
`)}};function
|
|
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 Ua(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}bo.Help=vo;bo.stripColor=Ua});var wo=x(ko=>{var{InvalidArgumentError:Wh}=fr(),Eo=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=qh(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}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Wh(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Wa(this.name().replace(/^no-/,"")):Wa(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}},xo=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 Wa(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function qh(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}}ko.Option=Eo;ko.DualOptions=xo});var Ya=x(qa=>{function Yh(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 Kh(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=Yh(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._collectValue(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
|
|
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(
|
|
15
|
+
(Did you mean ${n[0]}?)`:""}qa.suggestSimilar=Kh});var Ja=x(Oo=>{var zh=M("node:events").EventEmitter,Co=M("node:child_process"),rt=M("node:path"),Ur=M("node:fs"),B=M("node:process"),{Argument:Xh,humanReadableArgName:Jh}=Vr(),{CommanderError:Ao}=fr(),{Help:Qh,stripColor:Zh}=_o(),{Option:Ka,DualOptions:em}=wo(),{suggestSimilar:za}=Ya(),So=class e extends zh{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=>B.stdout.write(r),writeErr:r=>B.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>B.stdout.isTTY?B.stdout.columns:void 0,getErrHelpWidth:()=>B.stderr.isTTY?B.stderr.columns:void 0,getOutHasColors:()=>Ro()??(B.stdout.isTTY&&B.stdout.hasColors?.()),getErrHasColors:()=>Ro()??(B.stderr.isTTY&&B.stderr.hasColors?.()),stripColor:r=>Zh(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 Qh,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...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 Xh(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?.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 Ao(t,r,n)),B.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 Ka(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._collectValue(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 Ka)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){B.versions?.electron&&(r.from="electron");let o=B.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=B.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":B.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
|
+
- 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(Ur.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(
|
|
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=rt.resolve(u,p);if(Ur.existsSync(d))return d;if(o.includes(rt.extname(p)))return;let y=o.find(g=>Ur.existsSync(`${d}${g}`));if(y)return`${d}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Ur.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=rt.resolve(rt.dirname(u),a)}if(a){let u=i(a,s);if(!u&&!t._executableFile&&this._scriptPath){let p=rt.basename(this._scriptPath,rt.extname(this._scriptPath));p!==this._name&&(u=i(a,`${p}-${t._name}`))}s=u||s}n=o.includes(rt.extname(s));let c;B.platform!=="win32"?n?(r.unshift(s),r=Xa(B.execArgv).concat(r),c=Co.spawn(B.argv[0],r,{stdio:"inherit"})):c=Co.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=Xa(B.execArgv).concat(r),c=Co.spawn(B.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{B.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 Ao(u,"commander.executeSubCommandAsync","(close)")):B.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)B.exit(1);else{let p=new Ao(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?.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?.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;function i(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(p=>p.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,a=null,c=null,l=0;for(;l<t.length||c;){let u=c??t[l++];if(c=null,u==="--"){o===n&&o.push(u),o.push(...t.slice(l));break}if(a&&(!i(u)||s(u))){this.emit(`option:${a.name()}`,u);continue}if(a=null,i(u)){let p=this._findOption(u);if(p){if(p.required){let d=t[l++];d===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,d)}else if(p.optional){let d=null;l<t.length&&(!i(t[l])||s(t[l]))&&(d=t[l++]),this.emit(`option:${p.name()}`,d)}else this.emit(`option:${p.name()}`);a=p.variadic?p:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let p=this._findOption(`-${u[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,u.slice(2)):(this.emit(`option:${p.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let p=u.indexOf("="),d=this._findOption(u.slice(0,p));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,u.slice(p+1));continue}}if(o===r&&i(u)&&!(this.commands.length===0&&s(u))&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...t.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...t.slice(l));break}else if(this._defaultCommandName){n.push(u,...t.slice(l));break}}if(this._passThroughOptions){o.push(u,...t.slice(l));break}o.push(u)}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
|
|
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 B.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()}`,B.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new em(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=za(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=za(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=>Jh(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=rt.basename(t,rt.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(B.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 Qg(e){e=e||{};let t=Gc(e);e.path=t;let r=ce.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=Vc(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=ey(r,a);i=ce.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return ce.parse(i)}function Zg(e){console.error(`[dotenv@${Fo}][WARN] ${e}`)}function mr(e){console.log(`[dotenv@${Fo}][DEBUG] ${e}`)}function Hc(e){console.log(`[dotenv@${Fo}] ${e}`)}function Vc(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 ey(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 Gc(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)jo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Xr.resolve(process.cwd(),".env.vault");return jo.existsSync(t)?t:null}function Bc(e){return e[0]==="~"?Xr.join(Ug.homedir(),e.slice(1)):e}function ty(e){let t=Ft(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Ft(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&Hc("Loading env from encrypted .env.vault");let n=ce._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),ce.populate(o,n,e),{parsed:n}}function ry(e){let t=Xr.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=Ft(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=Ft(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&mr("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[Bc(e.path)];else{s=[];for(let l of e.path)s.push(Bc(l))}let a,c={};for(let l of s)try{let p=ce.parse(jo.readFileSync(l,{encoding:r}));ce.populate(c,p,e)}catch(p){o&&mr(`Failed to load ${l} ${p.message}`),a=p}let u=ce.populate(n,c,e);if(o=Ft(n.DOTENV_CONFIG_DEBUG||o),i=Ft(n.DOTENV_CONFIG_QUIET||i),o||!i){let l=Object.keys(u).length,p=[];for(let d of s)try{let y=Xr.relative(process.cwd(),d);p.push(y)}catch(y){o&&mr(`Failed to load ${d} ${y.message}`),a=y}Hc(`injecting env (${l}) from ${p.join(",")} ${Xg(`-- tip: ${Yg()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function ny(e){if(Vc(e).length===0)return ce.configDotenv(e);let t=Gc(e);return t?ce._configVault(e):(Zg(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),ce.configDotenv(e))}function oy(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=Wg.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",u=s.message==="Unsupported state or unable to authenticate data";if(a||c){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(u){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function iy(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&&mr(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 ce={configDotenv:ry,_configVault:ty,_parseVault:Qg,config:ny,decrypt:oy,parse:Jg,populate:iy};Je.exports.configDotenv=ce.configDotenv;Je.exports._configVault=ce._configVault;Je.exports._parseVault=ce._parseVault;Je.exports.config=ce.config;Je.exports.decrypt=ce.decrypt;Je.exports.parse=ce.parse;Je.exports.populate=ce.populate;Je.exports=ce});var Mo=x((yC,sy)=>{sy.exports={name:"@raclettejs/core",version:"0.1.21",description:"racletteJS core package",repository:"https://gitlab.com/raclettejs/core",author:"Pacifico Digital Explorations GmbH <info@raclettejs.com>",license:"AGPL-3.0-only",type:"module",scripts:{build:"node build.mjs || true",dev:"node watch.mjs",watch:"node watch.mjs","format:check":"prettier --check .","format:fix":"prettier --write .",lint:"eslint","lint:grouped":"FILTER_RULE=$RULE eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --format ./dev/eslint/groupByRuleFormatter.cjs","lint:fix":"eslint --fix",prepare:"husky",prepublishOnly:"yarn run build && yarn run sync","publish:patch":"yarn version --patch && yarn publish",sync:"node ./scripts/sync-exports.js"},bin:{raclette:"./bin/cli.js"},main:"index.js",types:"./types/index.ts",files:["services","bin","dist","types","scripts","index.js","README.md","yarn.lock","src/types.ts","LICENSE.md","CONTRIBUTING.md","raclette.default.config.yaml"],exports:{".":{types:"./types/index.ts",import:"./dist/index.js"},"./backend":{types:"./services/backend/src/index.ts",import:"./services/backend/src/index.ts"},"./frontend":{types:"./services/frontend/src/core/index.ts",import:"./services/frontend/src/core/index.ts"},"./orchestrator":{types:"./services/frontend/src/orchestrator/index.ts",import:"./services/frontend/src/orchestrator/index.ts"}},config:{},dependencies:{"@inquirer/prompts":"8.2.0","@types/mustache":"4.2.6",chalk:"5.6.2",chokidar:"3.6.0","cli-highlight":"2.1.11",commander:"14.0.1",dotenv:"17.2.2",esbuild:"0.25.9","fs-extra":"11.3.2",globby:"14.1.0","js-yaml":"4.1.0",mustache:"4.2.0",ramda:"0.31.3","tsc-alias":"1.8.16"},devDependencies:{"@eslint/js":"9.35.0","@raclettejs/types":"workspace:^","@types/fs-extra":"11.0.4","@types/js-yaml":"4.0.9","@types/node":"24.5.1","@types/ramda":"0.31.1",eslint:"9.35.0","eslint-config-prettier":"10.1.8","eslint-flat-config-utils":"2.1.1","eslint-plugin-import":"2.32.0","eslint-plugin-prefer-arrow-functions":"3.8.1","eslint-plugin-prettier":"5.5.4","eslint-plugin-vue":"10.4.0",globals:"16.4.0",husky:"9.1.7",prettier:"3.6.2",typescript:"5.9.2","typescript-eslint":"8.44.0","vue-eslint-parser":"10.2.0"}}});import{on as zy,once as Jy}from"node:events";import{PassThrough as Qy}from"node:stream";import{finished as bl}from"node:stream/promises";function ei(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)Qo(o);let t=e.some(({readableObjectMode:o})=>o),r=Zy(e,t),n=new Jo({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return e.length===0&&xl(n),n}var Zy,Jo,ev,tv,rv,Qo,nv,_l,ov,iv,sv,El,xl,Zo,kl,av,cn,yl,vl,wl=ct(()=>{Zy=(e,t)=>{if(e.length===0)return 16384;let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Jo=class extends Qy{#e=new Set([]);#r=new Set([]);#n=new Set([]);#t;add(t){Qo(t),!this.#e.has(t)&&(this.#e.add(t),this.#t??=ev(this,this.#e),nv({passThroughStream:this,stream:t,streams:this.#e,ended:this.#r,aborted:this.#n,onFinished:this.#t}),t.pipe(this,{end:!1}))}remove(t){return Qo(t),this.#e.has(t)?(t.unpipe(this),!0):!1}},ev=async(e,t)=>{cn(e,yl);let r=new AbortController;try{await Promise.race([tv(e,r),rv(e,t,r)])}finally{r.abort(),cn(e,-yl)}},tv=async(e,{signal:t})=>{await bl(e,{signal:t,cleanup:!0})},rv=async(e,t,{signal:r})=>{for await(let[n]of zy(e,"unpipe",{signal:r}))t.has(n)&&n.emit(El)},Qo=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},nv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i})=>{cn(e,vl);let s=new AbortController;try{await Promise.race([ov(i,t),iv({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:s}),sv({stream:t,streams:r,ended:n,aborted:o,controller:s})])}finally{s.abort(),cn(e,-vl)}r.size===n.size+o.size&&(n.size===0&&o.size>0?Zo(e):xl(e))},_l=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",ov=async(e,t)=>{try{await e,Zo(t)}catch(r){_l(r)?Zo(t):kl(t,r)}},iv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await bl(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;_l(s)?o.add(t):kl(e,s)}},sv=async({stream:e,streams:t,ended:r,aborted:n,controller:{signal:o}})=>{await Jy(e,El,{signal:o}),t.delete(e),r.delete(e),n.delete(e)},El=Symbol("unpipe"),xl=e=>{e.writable&&e.end()},Zo=e=>{(e.readable||e.writable)&&e.destroy()},kl=(e,t)=>{e.destroyed||(e.once("error",av),e.destroy(t))},av=()=>{},cn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},yl=2,vl=1});var Cl=x(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.splitWhen=Ut.flatten=void 0;function cv(e){return e.reduce((t,r)=>[].concat(t,r),[])}Ut.flatten=cv;function lv(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Ut.splitWhen=lv});var Al=x(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.isEnoentCodeError=void 0;function uv(e){return e.code==="ENOENT"}ln.isEnoentCodeError=uv});var Sl=x(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.createDirentFromStats=void 0;var ti=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 pv(e,t){return new ti(e,t)}un.createDirentFromStats=pv});var Pl=x(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 dv=F("os"),fv=F("path"),Rl=dv.platform()==="win32",hv=2,mv=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,gv=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,yv=/^\\\\([.?])/,vv=/\\(?![!()+@[\]{}])/g;function bv(e){return e.replace(/\\/g,"/")}oe.unixify=bv;function _v(e,t){return fv.resolve(e,t)}oe.makeAbsolute=_v;function Ev(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(hv)}return e}oe.removeLeadingDotSegment=Ev;oe.escape=Rl?ri:ni;function ri(e){return e.replace(gv,"\\$2")}oe.escapeWindowsPath=ri;function ni(e){return e.replace(mv,"\\$2")}oe.escapePosixPath=ni;oe.convertPathToPattern=Rl?Ol:Tl;function Ol(e){return ri(e).replace(yv,"//$1").replace(vv,"/")}oe.convertWindowsPathToPattern=Ol;function Tl(e){return ni(e)}oe.convertPosixPathToPattern=Tl});var Dl=x((PA,$l)=>{$l.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 Il=x(($A,Ll)=>{var xv=Dl(),Nl={"{":"}","(":")","[":"]"},kv=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=Nl[a];if(c){var u=e.indexOf(c,t);u!==-1&&(t=u+1)}if(e[t]==="!")return!0}else t++}return!1},wv=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=Nl[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};Ll.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(xv(t))return!0;var n=kv;return r&&r.strict===!1&&(n=wv),n(t)}});var Fl=x((DA,jl)=>{"use strict";var Cv=Il(),Av=F("path").posix.dirname,Sv=F("os").platform()==="win32",oi="/",Rv=/\\/g,Ov=/[\{\[].*[\}\]]$/,Tv=/(^|[^\\])([\{\[]|\([^\)]+$)/,Pv=/\\([\!\*\?\|\[\]\(\)\{\}])/g;jl.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Sv&&t.indexOf(oi)<0&&(t=t.replace(Rv,oi)),Ov.test(t)&&(t+=oi),t+="a";do t=Av(t);while(Cv(t)||Tv.test(t));return t.replace(Pv,"$1")}});var pn=x(Te=>{"use strict";Te.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Te.find=(e,t)=>e.nodes.find(r=>r.type===t);Te.exceedsLimit=(e,t,r=1,n)=>n===!1||!Te.isInteger(e)||!Te.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Te.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)};Te.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;Te.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;Te.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Te.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Te.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 dn=x((LA,Bl)=>{"use strict";var Ml=pn();Bl.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&Ml.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&Ml.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 Vl=x((IA,Hl)=>{"use strict";Hl.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Jl=x((jA,zl)=>{"use strict";var Gl=Vl(),Ct=(e,t,r)=>{if(Gl(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Gl(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(Ct.cache.hasOwnProperty(c))return Ct.cache[c].result;let u=Math.min(e,t),l=Math.max(e,t);if(Math.abs(u-l)===1){let g=e+"|"+t;return n.capture?`(${g})`:n.wrap===!1?g:`(?:${g})`}let p=Xl(e)||Xl(t),d={min:e,max:t,a:u,b:l},y=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),u<0){let g=l<0?Math.abs(l):1;m=Ul(g,Math.abs(u),d,n),u=d.a=0}return l>=0&&(y=Ul(u,l,d,n)),d.negatives=m,d.positives=y,d.result=$v(m,y,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&y.length+m.length>1&&(d.result=`(?:${d.result})`),Ct.cache[c]=d,d.result};function $v(e,t,r){let n=ii(e,t,"-",!1,r)||[],o=ii(t,e,"",!1,r)||[],i=ii(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function Dv(e,t){let r=1,n=1,o=ql(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=ql(e,r);for(o=Yl(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=Yl(t+1,n)-1;return i=[...i],i.sort(Iv),i}function Nv(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Lv(e,t),o=n.length,i="",s=0;for(let a=0;a<o;a++){let[c,u]=n[a];c===u?i+=c:c!=="0"||u!=="9"?i+=jv(c,u,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function Ul(e,t,r,n){let o=Dv(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let u=o[c],l=Nv(String(s),String(u),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+Kl(a.count),s=u+1;continue}r.isPadded&&(p=Fv(u,r,n)),l.string=p+l.pattern+Kl(l.count),i.push(l),s=u+1,a=l}return i}function ii(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!Wl(t,"string",a)&&i.push(r+a),n&&Wl(t,"string",a)&&i.push(r+a)}return i}function Lv(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Iv(e,t){return e>t?1:t>e?-1:0}function Wl(e,t,r){return e.some(n=>n[t]===r)}function ql(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Yl(e,t){return e-e%Math.pow(10,t)}function Kl(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function jv(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Xl(e){return/^-?(0+)\d/.test(e)}function Fv(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}}`}}Ct.cache={};Ct.clearCache=()=>Ct.cache={};zl.exports=Ct});var ci=x((FA,ou)=>{"use strict";var Mv=F("util"),Zl=Jl(),Ql=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Bv=e=>t=>e===!0?Number(t):String(t),si=e=>typeof e=="number"||typeof e=="string"&&e!=="",_r=e=>Number.isInteger(+e),ai=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Hv=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Vv=(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},hn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Gv=(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=>hn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>hn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},eu=(e,t,r,n)=>{if(r)return Zl(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},tu=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return Zl(e,t,r)},ru=(...e)=>new RangeError("Invalid range arguments: "+Mv.inspect(...e)),nu=(e,t,r)=>{if(r.strictRanges===!0)throw ru([e,t]);return[]},Uv=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Wv=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw ru([e,t]);return[]}o===0&&(o=0),i===0&&(i=0);let s=o>i,a=String(e),c=String(t),u=String(r);r=Math.max(Math.abs(r),1);let l=ai(a)||ai(c)||ai(u),p=l?Math.max(a.length,c.length,u.length):0,d=l===!1&&Hv(e,t,n)===!1,y=n.transform||Bv(d);if(n.toRegex&&r===1)return eu(hn(e,p),hn(t,p),!0,n);let m={negatives:[],positives:[]},g=S=>m[S<0?"negatives":"positives"].push(Math.abs(S)),E=[],A=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?g(o):E.push(Vv(y(o,A),p,d)),o=s?o-r:o+r,A++;return n.toRegex===!0?r>1?Gv(m,n,p):tu(E,null,{wrap:!1,...n}):E},qv=(e,t,r=1,n={})=>{if(!_r(e)&&e.length>1||!_r(t)&&t.length>1)return nu(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),u=Math.max(i,s);if(n.toRegex&&r===1)return eu(c,u,!1,n);let l=[],p=0;for(;a?i>=s:i<=s;)l.push(o(i,p)),i=a?i-r:i+r,p++;return n.toRegex===!0?tu(l,null,{wrap:!1,options:n}):l},fn=(e,t,r,n={})=>{if(t==null&&si(e))return[e];if(!si(e)||!si(t))return nu(e,t,n);if(typeof r=="function")return fn(e,t,1,{transform:r});if(Ql(r))return fn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,_r(r)?_r(e)&&_r(t)?Wv(e,t,r,o):qv(e,t,Math.max(Math.abs(r),1),o):r!=null&&!Ql(r)?Uv(r,o):fn(e,t,1,r)};ou.exports=fn});var au=x((MA,su)=>{"use strict";var Yv=ci(),iu=pn(),Kv=(e,t={})=>{let r=(n,o={})=>{let i=iu.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a=i===!0||s===!0,c=t.escapeInvalid===!0?"\\":"",u="";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 l=iu.reduce(n.nodes),p=Yv(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)u+=r(l,n);return u};return r(e)};su.exports=Kv});var uu=x((BA,lu)=>{"use strict";var Xv=ci(),cu=dn(),Wt=pn(),At=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Wt.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(At(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?At(o,i,r):o+i);return Wt.flatten(n)},zv=(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(At(a.pop(),cu(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(At(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=Wt.reduce(o.nodes);if(Wt.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=Xv(...p,t);d.length===0&&(d=cu(o,t)),a.push(At(a.pop(),d)),o.nodes=[];return}let c=Wt.encloseBrace(o),u=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,u=l.queue;for(let p=0;p<o.nodes.length;p++){let d=o.nodes[p];if(d.type==="comma"&&o.type==="brace"){p===1&&u.push(""),u.push("");continue}if(d.type==="close"){a.push(At(a.pop(),u,c));continue}if(d.value&&d.type!=="open"){u.push(At(u.pop(),d.value));continue}d.nodes&&n(d,o)}return u};return Wt.flatten(n(e))};lu.exports=zv});var du=x((HA,pu)=>{"use strict";pu.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 yu=x((VA,gu)=>{"use strict";var Jv=dn(),{MAX_LENGTH:fu,CHAR_BACKSLASH:li,CHAR_BACKTICK:Qv,CHAR_COMMA:Zv,CHAR_DOT:eb,CHAR_LEFT_PARENTHESES:tb,CHAR_RIGHT_PARENTHESES:rb,CHAR_LEFT_CURLY_BRACE:nb,CHAR_RIGHT_CURLY_BRACE:ob,CHAR_LEFT_SQUARE_BRACKET:hu,CHAR_RIGHT_SQUARE_BRACKET:mu,CHAR_DOUBLE_QUOTE:ib,CHAR_SINGLE_QUOTE:sb,CHAR_NO_BREAK_SPACE:ab,CHAR_ZERO_WIDTH_NOBREAK_SPACE:cb}=du(),lb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(fu,r.maxLength):fu;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,u=e.length,l=0,p=0,d,y=()=>e[l++],m=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return s.nodes.push(g),g.parent=s,g.prev=a,a=g,g};for(m({type:"bos"});l<u;)if(s=i[i.length-1],d=y(),!(d===cb||d===ab)){if(d===li){m({type:"text",value:(t.keepEscaping?d:"")+y()});continue}if(d===mu){m({type:"text",value:"\\"+d});continue}if(d===hu){c++;let g;for(;l<u&&(g=y());){if(d+=g,g===hu){c++;continue}if(g===li){d+=y();continue}if(g===mu&&(c--,c===0))break}m({type:"text",value:d});continue}if(d===tb){s=m({type:"paren",nodes:[]}),i.push(s),m({type:"text",value:d});continue}if(d===rb){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===ib||d===sb||d===Qv){let g=d,E;for(t.keepQuotes!==!0&&(d="");l<u&&(E=y());){if(E===li){d+=E+y();continue}if(E===g){t.keepQuotes===!0&&(d+=E);break}d+=E}m({type:"text",value:d});continue}if(d===nb){p++;let E={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(E),i.push(s),m({type:"open",value:d});continue}if(d===ob){if(s.type!=="brace"){m({type:"text",value:d});continue}let g="close";s=i.pop(),s.close=!0,m({type:g,value:d}),p--,s=i[i.length-1];continue}if(d===Zv&&p>0){if(s.ranges>0){s.ranges=0;let g=s.nodes.shift();s.nodes=[g,{type:"text",value:Jv(s)}]}m({type:"comma",value:d}),s.commas++;continue}if(d===eb&&p>0&&s.commas===0){let g=s.nodes;if(p===0||g.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"){g.pop();let E=g[g.length-1];E.value+=a.value+d,a=E,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(A=>{A.nodes||(A.type==="open"&&(A.isOpen=!0),A.type==="close"&&(A.isClose=!0),A.nodes||(A.type="text"),A.invalid=!0)});let g=i[i.length-1],E=g.nodes.indexOf(s);g.nodes.splice(E,1,...s.nodes)}while(i.length>0);return m({type:"eos"}),o};gu.exports=lb});var _u=x((GA,bu)=>{"use strict";var vu=dn(),ub=au(),pb=uu(),db=yu(),Ae=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Ae.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Ae.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ae.parse=(e,t={})=>db(e,t);Ae.stringify=(e,t={})=>vu(typeof e=="string"?Ae.parse(e,t):e,t);Ae.compile=(e,t={})=>(typeof e=="string"&&(e=Ae.parse(e,t)),ub(e,t));Ae.expand=(e,t={})=>{typeof e=="string"&&(e=Ae.parse(e,t));let r=pb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ae.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ae.compile(e,t):Ae.expand(e,t);bu.exports=Ae});var Er=x((UA,Cu)=>{"use strict";var fb=F("path"),Ue="\\\\/",Eu=`[^${Ue}]`,Ze="\\.",hb="\\+",mb="\\?",mn="\\/",gb="(?=.)",xu="[^/]",ui=`(?:${mn}|$)`,ku=`(?:^|${mn})`,pi=`${Ze}{1,2}${ui}`,yb=`(?!${Ze})`,vb=`(?!${ku}${pi})`,bb=`(?!${Ze}{0,1}${ui})`,_b=`(?!${pi})`,Eb=`[^.${mn}]`,xb=`${xu}*?`,wu={DOT_LITERAL:Ze,PLUS_LITERAL:hb,QMARK_LITERAL:mb,SLASH_LITERAL:mn,ONE_CHAR:gb,QMARK:xu,END_ANCHOR:ui,DOTS_SLASH:pi,NO_DOT:yb,NO_DOTS:vb,NO_DOT_SLASH:bb,NO_DOTS_SLASH:_b,QMARK_NO_DOT:Eb,STAR:xb,START_ANCHOR:ku},kb={...wu,SLASH_LITERAL:`[${Ue}]`,QMARK:Eu,STAR:`${Eu}*?`,DOTS_SLASH:`${Ze}{1,2}(?:[${Ue}]|$)`,NO_DOT:`(?!${Ze})`,NO_DOTS:`(?!(?:^|[${Ue}])${Ze}{1,2}(?:[${Ue}]|$))`,NO_DOT_SLASH:`(?!${Ze}{0,1}(?:[${Ue}]|$))`,NO_DOTS_SLASH:`(?!${Ze}{1,2}(?:[${Ue}]|$))`,QMARK_NO_DOT:`[^.${Ue}]`,START_ANCHOR:`(?:^|[${Ue}])`,END_ANCHOR:`(?:[${Ue}]|$)`},wb={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"};Cu.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:wb,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:fb.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?kb:wu}}});var xr=x(xe=>{"use strict";var Cb=F("path"),Ab=process.platform==="win32",{REGEX_BACKSLASH:Sb,REGEX_REMOVE_BACKSLASH:Rb,REGEX_SPECIAL_CHARS:Ob,REGEX_SPECIAL_CHARS_GLOBAL:Tb}=Er();xe.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);xe.hasRegexChars=e=>Ob.test(e);xe.isRegexChar=e=>e.length===1&&xe.hasRegexChars(e);xe.escapeRegex=e=>e.replace(Tb,"\\$1");xe.toPosixSlashes=e=>e.replace(Sb,"/");xe.removeBackslashes=e=>e.replace(Rb,t=>t==="\\"?"":t);xe.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};xe.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Ab===!0||Cb.sep==="\\";xe.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?xe.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};xe.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};xe.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var Du=x((qA,$u)=>{"use strict";var Au=xr(),{CHAR_ASTERISK:di,CHAR_AT:Pb,CHAR_BACKWARD_SLASH:kr,CHAR_COMMA:$b,CHAR_DOT:fi,CHAR_EXCLAMATION_MARK:hi,CHAR_FORWARD_SLASH:Pu,CHAR_LEFT_CURLY_BRACE:mi,CHAR_LEFT_PARENTHESES:gi,CHAR_LEFT_SQUARE_BRACKET:Db,CHAR_PLUS:Nb,CHAR_QUESTION_MARK:Su,CHAR_RIGHT_CURLY_BRACE:Lb,CHAR_RIGHT_PARENTHESES:Ru,CHAR_RIGHT_SQUARE_BRACKET:Ib}=Er(),Ou=e=>e===Pu||e===kr,Tu=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},jb=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],s=[],a=[],c=e,u=-1,l=0,p=0,d=!1,y=!1,m=!1,g=!1,E=!1,A=!1,S=!1,B=!1,pe=!1,q=!1,T=0,L,k,I={value:"",depth:0,isGlob:!1},ie=()=>u>=n,_=()=>c.charCodeAt(u+1),J=()=>(L=k,c.charCodeAt(++u));for(;u<n;){k=J();let ge;if(k===kr){S=I.backslashes=!0,k=J(),k===mi&&(A=!0);continue}if(A===!0||k===mi){for(T++;ie()!==!0&&(k=J());){if(k===kr){S=I.backslashes=!0,J();continue}if(k===mi){T++;continue}if(A!==!0&&k===fi&&(k=J())===fi){if(d=I.isBrace=!0,m=I.isGlob=!0,q=!0,o===!0)continue;break}if(A!==!0&&k===$b){if(d=I.isBrace=!0,m=I.isGlob=!0,q=!0,o===!0)continue;break}if(k===Lb&&(T--,T===0)){A=!1,d=I.isBrace=!0,q=!0;break}}if(o===!0)continue;break}if(k===Pu){if(i.push(u),s.push(I),I={value:"",depth:0,isGlob:!1},q===!0)continue;if(L===fi&&u===l+1){l+=2;continue}p=u+1;continue}if(r.noext!==!0&&(k===Nb||k===Pb||k===di||k===Su||k===hi)===!0&&_()===gi){if(m=I.isGlob=!0,g=I.isExtglob=!0,q=!0,k===hi&&u===l&&(pe=!0),o===!0){for(;ie()!==!0&&(k=J());){if(k===kr){S=I.backslashes=!0,k=J();continue}if(k===Ru){m=I.isGlob=!0,q=!0;break}}continue}break}if(k===di){if(L===di&&(E=I.isGlobstar=!0),m=I.isGlob=!0,q=!0,o===!0)continue;break}if(k===Su){if(m=I.isGlob=!0,q=!0,o===!0)continue;break}if(k===Db){for(;ie()!==!0&&(ge=J());){if(ge===kr){S=I.backslashes=!0,J();continue}if(ge===Ib){y=I.isBracket=!0,m=I.isGlob=!0,q=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&k===hi&&u===l){B=I.negated=!0,l++;continue}if(r.noparen!==!0&&k===gi){if(m=I.isGlob=!0,o===!0){for(;ie()!==!0&&(k=J());){if(k===gi){S=I.backslashes=!0,k=J();continue}if(k===Ru){q=!0;break}}continue}break}if(m===!0){if(q=!0,o===!0)continue;break}}r.noext===!0&&(g=!1,m=!1);let K=c,at="",v="";l>0&&(at=c.slice(0,l),c=c.slice(l),p-=l),K&&m===!0&&p>0?(K=c.slice(0,p),v=c.slice(p)):m===!0?(K="",v=c):K=c,K&&K!==""&&K!=="/"&&K!==c&&Ou(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),r.unescape===!0&&(v&&(v=Au.removeBackslashes(v)),K&&S===!0&&(K=Au.removeBackslashes(K)));let b={prefix:at,input:e,start:l,base:K,glob:v,isBrace:d,isBracket:y,isGlob:m,isExtglob:g,isGlobstar:E,negated:B,negatedExtglob:pe};if(r.tokens===!0&&(b.maxDepth=0,Ou(k)||s.push(I),b.tokens=s),r.parts===!0||r.tokens===!0){let ge;for(let j=0;j<i.length;j++){let Fe=ge?ge+1:l,Me=i[j],we=e.slice(Fe,Me);r.tokens&&(j===0&&l!==0?(s[j].isPrefix=!0,s[j].value=at):s[j].value=we,Tu(s[j]),b.maxDepth+=s[j].depth),(j!==0||we!=="")&&a.push(we),ge=Me}if(ge&&ge+1<e.length){let j=e.slice(ge+1);a.push(j),r.tokens&&(s[s.length-1].value=j,Tu(s[s.length-1]),b.maxDepth+=s[s.length-1].depth)}b.slashes=i,b.parts=a}return b};$u.exports=jb});var Iu=x((YA,Lu)=>{"use strict";var gn=Er(),Se=xr(),{MAX_LENGTH:yn,POSIX_REGEX_SOURCE:Fb,REGEX_NON_SPECIAL_CHARS:Mb,REGEX_SPECIAL_CHARS_BACKREF:Bb,REPLACEMENTS:Nu}=gn,Hb=(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=>Se.escapeRegex(o)).join("..")}return r},qt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,yi=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Nu[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(yn,r.maxLength):yn,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=Se.isWindows(t),u=gn.globChars(c),l=gn.extglobChars(u),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:y,ONE_CHAR:m,DOTS_SLASH:g,NO_DOT:E,NO_DOT_SLASH:A,NO_DOTS_SLASH:S,QMARK:B,QMARK_NO_DOT:pe,STAR:q,START_ANCHOR:T}=u,L=C=>`(${a}(?:(?!${T}${C.dot?g:p}).)*?)`,k=r.dot?"":E,I=r.dot?B:pe,ie=r.bash===!0?L(r):q;r.capture&&(ie=`(${ie})`),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=Se.removePrefix(e,_),o=e.length;let J=[],K=[],at=[],v=i,b,ge=()=>_.index===o-1,j=_.peek=(C=1)=>e[_.index+C],Fe=_.advance=()=>e[++_.index]||"",Me=()=>e.slice(_.index+1),we=(C="",X=0)=>{_.consumed+=C,_.index+=X},$r=C=>{_.output+=C.output!=null?C.output:C.value,we(C.value)},Lf=()=>{let C=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Fe(),_.start++,C++;return C%2===0?!1:(_.negated=!0,_.start++,!0)},Dr=C=>{_[C]++,at.push(C)},Et=C=>{_[C]--,at.pop()},N=C=>{if(v.type==="globstar"){let X=_.braces>0&&(C.type==="comma"||C.type==="brace"),w=C.extglob===!0||J.length&&(C.type==="pipe"||C.type==="paren");C.type!=="slash"&&C.type!=="paren"&&!X&&!w&&(_.output=_.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=ie,_.output+=v.output)}if(J.length&&C.type!=="paren"&&(J[J.length-1].inner+=C.value),(C.value||C.output)&&$r(C),v&&v.type==="text"&&C.type==="text"){v.value+=C.value,v.output=(v.output||"")+C.value;return}C.prev=v,s.push(C),v=C},Nr=(C,X)=>{let w={...l[X],conditions:1,inner:""};w.prev=v,w.parens=_.parens,w.output=_.output;let $=(r.capture?"(":"")+w.open;Dr("parens"),N({type:C,value:X,output:_.output?"":m}),N({type:"paren",extglob:!0,value:Fe(),output:$}),J.push(w)},If=C=>{let X=C.close+(r.capture?")":""),w;if(C.type==="negate"){let $=ie;if(C.inner&&C.inner.length>1&&C.inner.includes("/")&&($=L(r)),($!==ie||ge()||/^\)+$/.test(Me()))&&(X=C.close=`)$))${$}`),C.inner.includes("*")&&(w=Me())&&/^\.[^\\/.]+$/.test(w)){let ee=yi(w,{...t,fastpaths:!1}).output;X=C.close=`)${ee})${$})`}C.prev.type==="bos"&&(_.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:b,output:X}),Et("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let C=!1,X=e.replace(Bb,(w,$,ee,ye,se,Qn)=>ye==="\\"?(C=!0,w):ye==="?"?$?$+ye+(se?B.repeat(se.length):""):Qn===0?I+(se?B.repeat(se.length):""):B.repeat(ee.length):ye==="."?p.repeat(ee.length):ye==="*"?$?$+ye+(se?ie:""):ie:$?w:`\\${w}`);return C===!0&&(r.unescape===!0?X=X.replace(/\\/g,""):X=X.replace(/\\+/g,w=>w.length%2===0?"\\\\":w?"\\":"")),X===e&&r.contains===!0?(_.output=e,_):(_.output=Se.wrapOutput(X,_,t),_)}for(;!ge();){if(b=Fe(),b==="\0")continue;if(b==="\\"){let w=j();if(w==="/"&&r.bash!==!0||w==="."||w===";")continue;if(!w){b+="\\",N({type:"text",value:b});continue}let $=/^\\+/.exec(Me()),ee=0;if($&&$[0].length>2&&(ee=$[0].length,_.index+=ee,ee%2!==0&&(b+="\\")),r.unescape===!0?b=Fe():b+=Fe(),_.brackets===0){N({type:"text",value:b});continue}}if(_.brackets>0&&(b!=="]"||v.value==="["||v.value==="[^")){if(r.posix!==!1&&b===":"){let w=v.value.slice(1);if(w.includes("[")&&(v.posix=!0,w.includes(":"))){let $=v.value.lastIndexOf("["),ee=v.value.slice(0,$),ye=v.value.slice($+2),se=Fb[ye];if(se){v.value=ee+se,_.backtrack=!0,Fe(),!i.output&&s.indexOf(v)===1&&(i.output=m);continue}}}(b==="["&&j()!==":"||b==="-"&&j()==="]")&&(b=`\\${b}`),b==="]"&&(v.value==="["||v.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&v.value==="["&&(b="^"),v.value+=b,$r({value:b});continue}if(_.quotes===1&&b!=='"'){b=Se.escapeRegex(b),v.value+=b,$r({value:b});continue}if(b==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&N({type:"text",value:b});continue}if(b==="("){Dr("parens"),N({type:"paren",value:b});continue}if(b===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(qt("opening","("));let w=J[J.length-1];if(w&&_.parens===w.parens+1){If(J.pop());continue}N({type:"paren",value:b,output:_.parens?")":"\\)"}),Et("parens");continue}if(b==="["){if(r.nobracket===!0||!Me().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(qt("closing","]"));b=`\\${b}`}else Dr("brackets");N({type:"bracket",value:b});continue}if(b==="]"){if(r.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){N({type:"text",value:b,output:`\\${b}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(qt("opening","["));N({type:"text",value:b,output:`\\${b}`});continue}Et("brackets");let w=v.value.slice(1);if(v.posix!==!0&&w[0]==="^"&&!w.includes("/")&&(b=`/${b}`),v.value+=b,$r({value:b}),r.literalBrackets===!1||Se.hasRegexChars(w))continue;let $=Se.escapeRegex(v.value);if(_.output=_.output.slice(0,-v.value.length),r.literalBrackets===!0){_.output+=$,v.value=$;continue}v.value=`(${a}${$}|${v.value})`,_.output+=v.value;continue}if(b==="{"&&r.nobrace!==!0){Dr("braces");let w={type:"brace",value:b,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};K.push(w),N(w);continue}if(b==="}"){let w=K[K.length-1];if(r.nobrace===!0||!w){N({type:"text",value:b,output:b});continue}let $=")";if(w.dots===!0){let ee=s.slice(),ye=[];for(let se=ee.length-1;se>=0&&(s.pop(),ee[se].type!=="brace");se--)ee[se].type!=="dots"&&ye.unshift(ee[se].value);$=Hb(ye,r),_.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){let ee=_.output.slice(0,w.outputIndex),ye=_.tokens.slice(w.tokensIndex);w.value=w.output="\\{",b=$="\\}",_.output=ee;for(let se of ye)_.output+=se.output||se.value}N({type:"brace",value:b,output:$}),Et("braces"),K.pop();continue}if(b==="|"){J.length>0&&J[J.length-1].conditions++,N({type:"text",value:b});continue}if(b===","){let w=b,$=K[K.length-1];$&&at[at.length-1]==="braces"&&($.comma=!0,w="|"),N({type:"comma",value:b,output:w});continue}if(b==="/"){if(v.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),v=i;continue}N({type:"slash",value:b,output:y});continue}if(b==="."){if(_.braces>0&&v.type==="dot"){v.value==="."&&(v.output=p);let w=K[K.length-1];v.type="dots",v.output+=b,v.value+=b,w.dots=!0;continue}if(_.braces+_.parens===0&&v.type!=="bos"&&v.type!=="slash"){N({type:"text",value:b,output:p});continue}N({type:"dot",value:b,output:p});continue}if(b==="?"){if(!(v&&v.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Nr("qmark",b);continue}if(v&&v.type==="paren"){let $=j(),ee=b;if($==="<"&&!Se.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test($)||$==="<"&&!/<([!=]|\w+>)/.test(Me()))&&(ee=`\\${b}`),N({type:"text",value:b,output:ee});continue}if(r.dot!==!0&&(v.type==="slash"||v.type==="bos")){N({type:"qmark",value:b,output:pe});continue}N({type:"qmark",value:b,output:B});continue}if(b==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){Nr("negate",b);continue}if(r.nonegate!==!0&&_.index===0){Lf();continue}}if(b==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){Nr("plus",b);continue}if(v&&v.value==="("||r.regex===!1){N({type:"plus",value:b,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||_.parens>0){N({type:"plus",value:b});continue}N({type:"plus",value:d});continue}if(b==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){N({type:"at",extglob:!0,value:b,output:""});continue}N({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);let w=Mb.exec(Me());w&&(b+=w[0],_.index+=w[0].length),N({type:"text",value:b});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=b,v.output=ie,_.backtrack=!0,_.globstar=!0,we(b);continue}let C=Me();if(r.noextglob!==!0&&/^\([^?]/.test(C)){Nr("star",b);continue}if(v.type==="star"){if(r.noglobstar===!0){we(b);continue}let w=v.prev,$=w.prev,ee=w.type==="slash"||w.type==="bos",ye=$&&($.type==="star"||$.type==="globstar");if(r.bash===!0&&(!ee||C[0]&&C[0]!=="/")){N({type:"star",value:b,output:""});continue}let se=_.braces>0&&(w.type==="comma"||w.type==="brace"),Qn=J.length&&(w.type==="pipe"||w.type==="paren");if(!ee&&w.type!=="paren"&&!se&&!Qn){N({type:"star",value:b,output:""});continue}for(;C.slice(0,3)==="/**";){let Lr=e[_.index+4];if(Lr&&Lr!=="/")break;C=C.slice(3),we("/**",3)}if(w.type==="bos"&&ge()){v.type="globstar",v.value+=b,v.output=L(r),_.output=v.output,_.globstar=!0,we(b);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!ye&&ge()){_.output=_.output.slice(0,-(w.output+v.output).length),w.output=`(?:${w.output}`,v.type="globstar",v.output=L(r)+(r.strictSlashes?")":"|$)"),v.value+=b,_.globstar=!0,_.output+=w.output+v.output,we(b);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&C[0]==="/"){let Lr=C[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(w.output+v.output).length),w.output=`(?:${w.output}`,v.type="globstar",v.output=`${L(r)}${y}|${y}${Lr})`,v.value+=b,_.output+=w.output+v.output,_.globstar=!0,we(b+Fe()),N({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&C[0]==="/"){v.type="globstar",v.value+=b,v.output=`(?:^|${y}|${L(r)}${y})`,_.output=v.output,_.globstar=!0,we(b+Fe()),N({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-v.output.length),v.type="globstar",v.output=L(r),v.value+=b,_.output+=v.output,_.globstar=!0,we(b);continue}let X={type:"star",value:b,output:ie};if(r.bash===!0){X.output=".*?",(v.type==="bos"||v.type==="slash")&&(X.output=k+X.output),N(X);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&r.regex===!0){X.output=b,N(X);continue}(_.index===_.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(_.output+=A,v.output+=A):r.dot===!0?(_.output+=S,v.output+=S):(_.output+=k,v.output+=k),j()!=="*"&&(_.output+=m,v.output+=m)),N(X)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(qt("closing","]"));_.output=Se.escapeLast(_.output,"["),Et("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(qt("closing",")"));_.output=Se.escapeLast(_.output,"("),Et("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(qt("closing","}"));_.output=Se.escapeLast(_.output,"{"),Et("braces")}if(r.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let C of _.tokens)_.output+=C.output!=null?C.output:C.value,C.suffix&&(_.output+=C.suffix)}return _};yi.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(yn,r.maxLength):yn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=Nu[e]||e;let i=Se.isWindows(t),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:y,START_ANCHOR:m}=gn.globChars(i),g=r.dot?p:l,E=r.dot?d:l,A=r.capture?"":"?:",S={negated:!1,prefix:""},B=r.bash===!0?".*?":y;r.capture&&(B=`(${B})`);let pe=k=>k.noglobstar===!0?B:`(${A}(?:(?!${m}${k.dot?u:s}).)*?)`,q=k=>{switch(k){case"*":return`${g}${c}${B}`;case".*":return`${s}${c}${B}`;case"*.*":return`${g}${B}${s}${c}${B}`;case"*/*":return`${g}${B}${a}${c}${E}${B}`;case"**":return g+pe(r);case"**/*":return`(?:${g}${pe(r)}${a})?${E}${c}${B}`;case"**/*.*":return`(?:${g}${pe(r)}${a})?${E}${B}${s}${c}${B}`;case"**/.*":return`(?:${g}${pe(r)}${a})?${s}${c}${B}`;default:{let I=/^(.*?)\.(\w+)$/.exec(k);if(!I)return;let ie=q(I[1]);return ie?ie+s+I[2]:void 0}}},T=Se.removePrefix(e,S),L=q(T);return L&&r.strictSlashes!==!0&&(L+=`${a}?`),L};Lu.exports=yi});var Fu=x((KA,ju)=>{"use strict";var Vb=F("path"),Gb=Du(),vi=Iu(),bi=xr(),Ub=Er(),Wb=e=>e&&typeof e=="object"&&!Array.isArray(e),te=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>te(d,t,r));return d=>{for(let y of l){let m=y(d);if(m)return m}return!1}}let n=Wb(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=bi.isWindows(t),s=n?te.compileRe(e,t):te.makeRe(e,t,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};c=te(o.ignore,l,r)}let u=(l,p=!1)=>{let{isMatch:d,match:y,output:m}=te.test(l,s,t,{glob:e,posix:i}),g={glob:e,state:a,regex:s,posix:i,input:l,output:m,match:y,isMatch:d};return typeof o.onResult=="function"&&o.onResult(g),d===!1?(g.isMatch=!1,p?g:!1):c(l)?(typeof o.onIgnore=="function"&&o.onIgnore(g),g.isMatch=!1,p?g:!1):(typeof o.onMatch=="function"&&o.onMatch(g),p?g:!0)};return r&&(u.state=a),u};te.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?bi.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=te.matchBase(e,t,r,o):a=t.exec(c)),{isMatch:!!a,match:a,output:c}};te.matchBase=(e,t,r,n=bi.isWindows(r))=>(t instanceof RegExp?t:te.makeRe(t,r)).test(Vb.basename(e));te.isMatch=(e,t,r)=>te(t,r)(e);te.parse=(e,t)=>Array.isArray(e)?e.map(r=>te.parse(r,t)):vi(e,{...t,fastpaths:!1});te.scan=(e,t)=>Gb(e,t);te.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=te.toRegex(a,t);return n===!0&&(c.state=e),c};te.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=vi.fastpaths(e,t)),o.output||(o=vi(e,t)),te.compileRe(o,t,r,n)};te.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/$^/}};te.constants=Ub;ju.exports=te});var Bu=x((XA,Mu)=>{"use strict";Mu.exports=Fu()});var qu=x((zA,Wu)=>{"use strict";var Vu=F("util"),Gu=_u(),We=Bu(),_i=xr(),Hu=e=>e===""||e==="./",Uu=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},z=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,o=new Set,i=new Set,s=0,a=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=We(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let y of e){let m=p(y,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let u=(s===t.length?[...i]:[...o]).filter(l=>!n.has(l));if(r&&u.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(l=>l.replace(/\\/g,"")):t}return u};z.match=z;z.matcher=(e,t)=>We(e,t);z.isMatch=(e,t,r)=>We(t,r)(e);z.any=z.isMatch;z.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(z(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};z.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Vu.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>z.contains(e,n,r));if(typeof t=="string"){if(Hu(e)||Hu(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return z.isMatch(e,t,{...r,contains:!0})};z.matchKeys=(e,t,r)=>{if(!_i.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=z(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};z.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=We(String(o),r);if(n.some(s=>i(s)))return!0}return!1};z.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=We(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};z.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Vu.inspect(e)}"`);return[].concat(t).every(n=>We(n,r)(e))};z.capture=(e,t,r)=>{let n=_i.isWindows(r),i=We.makeRe(String(e),{...r,capture:!0}).exec(n?_i.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};z.makeRe=(...e)=>We.makeRe(...e);z.scan=(...e)=>We.scan(...e);z.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of Gu(String(n),t))r.push(We.parse(o,t));return r};z.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Uu(e)?[e]:Gu(e,t)};z.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return z.braces(e,{...t,expand:!0})};z.hasBraces=Uu;Wu.exports=z});var rp=x(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 Yu=F("path"),qb=Fl(),Ei=qu(),Ku="**",Yb="\\",Kb=/[*?]|^!/,Xb=/\[[^[]*]/,zb=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Jb=/[!*+?@]\([^(]*\)/,Qb=/,|\.\./,Zb=/(?!^)\/{2,}/g;function Xu(e,t={}){return!zu(e,t)}O.isStaticPattern=Xu;function zu(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(Yb)||Kb.test(e)||Xb.test(e)||zb.test(e)||t.extglob!==!1&&Jb.test(e)||t.braceExpansion!==!1&&e_(e))}O.isDynamicPattern=zu;function e_(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 Qb.test(n)}function t_(e){return vn(e)?e.slice(1):e}O.convertToPositivePattern=t_;function r_(e){return"!"+e}O.convertToNegativePattern=r_;function vn(e){return e.startsWith("!")&&e[1]!=="("}O.isNegativePattern=vn;function Ju(e){return!vn(e)}O.isPositivePattern=Ju;function n_(e){return e.filter(vn)}O.getNegativePatterns=n_;function o_(e){return e.filter(Ju)}O.getPositivePatterns=o_;function i_(e){return e.filter(t=>!xi(t))}O.getPatternsInsideCurrentDirectory=i_;function s_(e){return e.filter(xi)}O.getPatternsOutsideCurrentDirectory=s_;function xi(e){return e.startsWith("..")||e.startsWith("./..")}O.isPatternRelatedToParentDirectory=xi;function a_(e){return qb(e,{flipBackslashes:!1})}O.getBaseDirectory=a_;function c_(e){return e.includes(Ku)}O.hasGlobStar=c_;function Qu(e){return e.endsWith("/"+Ku)}O.endsWithSlashGlobStar=Qu;function l_(e){let t=Yu.basename(e);return Qu(e)||Xu(t)}O.isAffectDepthOfReadingPattern=l_;function u_(e){return e.reduce((t,r)=>t.concat(Zu(r)),[])}O.expandPatternsWithBraceExpansion=u_;function Zu(e){let t=Ei.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}O.expandBraceExpansion=Zu;function p_(e,t){let{parts:r}=Ei.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=p_;function ep(e,t){return Ei.makeRe(e,t)}O.makeRe=ep;function d_(e,t){return e.map(r=>ep(r,t))}O.convertPatternsToRe=d_;function f_(e,t){return t.some(r=>r.test(e))}O.matchAny=f_;function h_(e){return e.replace(Zb,"/")}O.removeDuplicateSlashes=h_;function m_(e){let t=[],r=[];for(let n of e)tp(n)?t.push(n):r.push(n);return[t,r]}O.partitionAbsoluteAndRelative=m_;function tp(e){return Yu.isAbsolute(e)}O.isAbsolute=tp});var sp=x((QA,ip)=>{"use strict";var g_=F("stream"),np=g_.PassThrough,y_=Array.prototype.slice;ip.exports=v_;function v_(){let e=[],t=y_.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=np(n);function a(){for(let l=0,p=arguments.length;l<p;l++)e.push(op(arguments[l],n));return c(),this}function c(){if(r)return;r=!0;let l=e.shift();if(!l){process.nextTick(u);return}Array.isArray(l)||(l=[l]);let p=l.length+1;function d(){--p>0||(r=!1,c())}function y(m){function g(){m.removeListener("merge2UnpipeEnd",g),m.removeListener("end",g),i&&m.removeListener("error",E),d()}function E(A){s.emit("error",A)}if(m._readableState.endEmitted)return d();m.on("merge2UnpipeEnd",g),m.on("end",g),i&&m.on("error",E),m.pipe(s,{end:!1}),m.resume()}for(let m=0;m<l.length;m++)y(l[m]);d()}function u(){r=!1,s.emit("queueDrain"),o&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),s}function op(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=op(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(np(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var cp=x(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.merge=void 0;var b_=sp();function __(e){let t=b_(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>ap(e)),t.once("end",()=>ap(e)),t}bn.merge=__;function ap(e){e.forEach(t=>t.emit("close"))}});var lp=x(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.isEmpty=Yt.isString=void 0;function E_(e){return typeof e=="string"}Yt.isString=E_;function x_(e){return e===""}Yt.isEmpty=x_});var et=x(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.string=he.stream=he.pattern=he.path=he.fs=he.errno=he.array=void 0;var k_=Cl();he.array=k_;var w_=Al();he.errno=w_;var C_=Sl();he.fs=C_;var A_=Pl();he.path=A_;var S_=rp();he.pattern=S_;var R_=cp();he.stream=R_;var O_=lp();he.string=O_});var fp=x(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.convertPatternGroupToTask=me.convertPatternGroupsToTasks=me.groupPatternsByBaseDirectory=me.getNegativePatternsAsPositive=me.getPositivePatterns=me.convertPatternsToTasks=me.generate=void 0;var Ie=et();function T_(e,t){let r=up(e,t),n=up(t.ignore,t),o=pp(r),i=dp(r,n),s=o.filter(l=>Ie.pattern.isStaticPattern(l,t)),a=o.filter(l=>Ie.pattern.isDynamicPattern(l,t)),c=ki(s,i,!1),u=ki(a,i,!0);return c.concat(u)}me.generate=T_;function up(e,t){let r=e;return t.braceExpansion&&(r=Ie.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Ie.pattern.removeDuplicateSlashes(n))}function ki(e,t,r){let n=[],o=Ie.pattern.getPatternsOutsideCurrentDirectory(e),i=Ie.pattern.getPatternsInsideCurrentDirectory(e),s=wi(o),a=wi(i);return n.push(...Ci(s,t,r)),"."in a?n.push(Ai(".",i,t,r)):n.push(...Ci(a,t,r)),n}me.convertPatternsToTasks=ki;function pp(e){return Ie.pattern.getPositivePatterns(e)}me.getPositivePatterns=pp;function dp(e,t){return Ie.pattern.getNegativePatterns(e).concat(t).map(Ie.pattern.convertToPositivePattern)}me.getNegativePatternsAsPositive=dp;function wi(e){let t={};return e.reduce((r,n)=>{let o=Ie.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}me.groupPatternsByBaseDirectory=wi;function Ci(e,t,r){return Object.keys(e).map(n=>Ai(n,e[n],t,r))}me.convertPatternGroupsToTasks=Ci;function Ai(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(Ie.pattern.convertToNegativePattern))}}me.convertPatternGroupToTask=Ai});var mp=x(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.read=void 0;function P_(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){hp(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){Si(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){hp(r,i);return}Si(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),Si(r,s)})})}_n.read=P_;function hp(e,t){e(t)}function Si(e,t){e(null,t)}});var gp=x(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.read=void 0;function $_(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}}En.read=$_});var yp=x(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.createFileSystemAdapter=ft.FILE_SYSTEM_ADAPTER=void 0;var xn=F("fs");ft.FILE_SYSTEM_ADAPTER={lstat:xn.lstat,stat:xn.stat,lstatSync:xn.lstatSync,statSync:xn.statSync};function D_(e){return e===void 0?ft.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ft.FILE_SYSTEM_ADAPTER),e)}ft.createFileSystemAdapter=D_});var vp=x(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var N_=yp(),Ri=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=N_.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}};Oi.default=Ri});var St=x(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.statSync=ht.stat=ht.Settings=void 0;var bp=mp(),L_=gp(),Ti=vp();ht.Settings=Ti.default;function I_(e,t,r){if(typeof t=="function"){bp.read(e,Pi(),t);return}bp.read(e,Pi(t),r)}ht.stat=I_;function j_(e,t){let r=Pi(t);return L_.read(e,r)}ht.statSync=j_;function Pi(e={}){return e instanceof Ti.default?e:new Ti.default(e)}});var xp=x((cS,Ep)=>{var _p;Ep.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(_p||(_p=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var wp=x((lS,kp)=>{kp.exports=M_;var F_=xp();function M_(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 u(){t&&t(c,r),t=null}i?F_(u):u()}function a(c,u,l){r[c]=l,(--n===0||u)&&s(u)}n?o?o.forEach(function(c){e[c](function(u,l){a(c,u,l)})}):e.forEach(function(c,u){c(function(l,p){a(u,l,p)})}):s(null),i=!1}});var $i=x(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var kn=process.versions.node.split(".");if(kn[0]===void 0||kn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Cp=Number.parseInt(kn[0],10),B_=Number.parseInt(kn[1],10),Ap=10,H_=10,V_=Cp>Ap,G_=Cp===Ap&&B_>=H_;wn.IS_SUPPORT_READDIR_WITH_FILE_TYPES=V_||G_});var Sp=x(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.createDirentFromStats=void 0;var Di=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 U_(e,t){return new Di(e,t)}Cn.createDirentFromStats=U_});var Ni=x(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.fs=void 0;var W_=Sp();An.fs=W_});var Li=x(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.joinPathSegments=void 0;function q_(e,t,r){return e.endsWith(r)?e+t:e+r+t}Sn.joinPathSegments=q_});var Dp=x(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.readdir=mt.readdirWithFileTypes=mt.read=void 0;var Y_=St(),Rp=wp(),K_=$i(),Op=Ni(),Tp=Li();function X_(e,t,r){if(!t.stats&&K_.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Pp(e,t,r);return}$p(e,t,r)}mt.read=X_;function Pp(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){Rn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:Tp.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){Ii(r,i);return}let s=i.map(a=>z_(a,t));Rp(s,(a,c)=>{if(a!==null){Rn(r,a);return}Ii(r,c)})})}mt.readdirWithFileTypes=Pp;function z_(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=Op.fs.createDirentFromStats(e.name,o),r(null,e)})}}function $p(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){Rn(r,n);return}let i=o.map(s=>{let a=Tp.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{Y_.stat(a,t.fsStatSettings,(u,l)=>{if(u!==null){c(u);return}let p={name:s,path:a,dirent:Op.fs.createDirentFromStats(s,l)};t.stats&&(p.stats=l),c(null,p)})}});Rp(i,(s,a)=>{if(s!==null){Rn(r,s);return}Ii(r,a)})})}mt.readdir=$p;function Rn(e,t){e(t)}function Ii(e,t){e(null,t)}});var Fp=x(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.readdir=gt.readdirWithFileTypes=gt.read=void 0;var J_=St(),Q_=$i(),Np=Ni(),Lp=Li();function Z_(e,t){return!t.stats&&Q_.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Ip(e,t):jp(e,t)}gt.read=Z_;function Ip(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:Lp.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=Np.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}gt.readdirWithFileTypes=Ip;function jp(e,t){return t.fs.readdirSync(e).map(n=>{let o=Lp.joinPathSegments(e,n,t.pathSegmentSeparator),i=J_.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:Np.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}gt.readdir=jp});var Mp=x(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.createFileSystemAdapter=yt.FILE_SYSTEM_ADAPTER=void 0;var Kt=F("fs");yt.FILE_SYSTEM_ADAPTER={lstat:Kt.lstat,stat:Kt.stat,lstatSync:Kt.lstatSync,statSync:Kt.statSync,readdir:Kt.readdir,readdirSync:Kt.readdirSync};function eE(e){return e===void 0?yt.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},yt.FILE_SYSTEM_ADAPTER),e)}yt.createFileSystemAdapter=eE});var Bp=x(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var tE=F("path"),rE=St(),nE=Mp(),ji=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=nE.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,tE.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new rE.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Fi.default=ji});var On=x(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.Settings=vt.scandirSync=vt.scandir=void 0;var Hp=Dp(),oE=Fp(),Mi=Bp();vt.Settings=Mi.default;function iE(e,t,r){if(typeof t=="function"){Hp.read(e,Bi(),t);return}Hp.read(e,Bi(t),r)}vt.scandir=iE;function sE(e,t){let r=Bi(t);return oE.read(e,r)}vt.scandirSync=sE;function Bi(e={}){return e instanceof Mi.default?e:new Mi.default(e)}});var Gp=x((bS,Vp)=>{"use strict";function aE(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}}Vp.exports=aE});var Wp=x((_S,Hi)=>{"use strict";var cE=Gp();function Up(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=cE(lE),o=null,i=null,s=0,a=null,c={push:g,drain:ke,saturated:ke,pause:l,paused:!1,get concurrency(){return r},set concurrency(T){if(!(T>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=T,!c.paused)for(;o&&s<r;)s++,A()},running:u,resume:y,idle:m,length:p,getQueue:d,unshift:E,empty:ke,kill:S,killAndDrain:B,error:q,abort:pe};return c;function u(){return s}function l(){c.paused=!0}function p(){for(var T=o,L=0;T;)T=T.next,L++;return L}function d(){for(var T=o,L=[];T;)L.push(T.value),T=T.next;return L}function y(){if(c.paused){if(c.paused=!1,o===null){s++,A();return}for(;o&&s<r;)s++,A()}}function m(){return s===0&&c.length()===0}function g(T,L){var k=n.get();k.context=e,k.release=A,k.value=T,k.callback=L||ke,k.errorHandler=a,s>=r||c.paused?i?(i.next=k,i=k):(o=k,i=k,c.saturated()):(s++,t.call(e,k.value,k.worked))}function E(T,L){var k=n.get();k.context=e,k.release=A,k.value=T,k.callback=L||ke,k.errorHandler=a,s>=r||c.paused?o?(k.next=o,o=k):(o=k,i=k,c.saturated()):(s++,t.call(e,k.value,k.worked))}function A(T){T&&n.release(T);var L=o;L&&s<=r?c.paused?s--:(i===o&&(i=null),o=L.next,L.next=null,t.call(e,L.value,L.worked),i===null&&c.empty()):--s===0&&c.drain()}function S(){o=null,i=null,c.drain=ke}function B(){o=null,i=null,c.drain(),c.drain=ke}function pe(){var T=o;for(o=null,i=null;T;){var L=T.next,k=T.callback,I=T.errorHandler,ie=T.value,_=T.context;T.value=null,T.callback=ke,T.errorHandler=null,I&&I(new Error("abort"),ie),k.call(_,new Error("abort")),T.release(T),T=L}c.drain=ke}function q(T){a=T}}function ke(){}function lE(){this.value=null,this.callback=ke,this.next=null,this.release=ke,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=ke,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function uE(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,p){t.call(this,l).then(function(d){p(null,d)},p)}var o=Up(e,n,r),i=o.push,s=o.unshift;return o.push=a,o.unshift=c,o.drained=u,o;function a(l){var p=new Promise(function(d,y){i(l,function(m,g){if(m){y(m);return}d(g)})});return p.catch(ke),p}function c(l){var p=new Promise(function(d,y){s(l,function(m,g){if(m){y(m);return}d(g)})});return p.catch(ke),p}function u(){var l=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 l}}Hi.exports=Up;Hi.exports.promise=uE});var Tn=x(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.joinPathSegments=qe.replacePathSegmentSeparator=qe.isAppliedFilter=qe.isFatalError=void 0;function pE(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}qe.isFatalError=pE;function dE(e,t){return e===null||e(t)}qe.isAppliedFilter=dE;function fE(e,t){return e.split(/[/\\]/).join(t)}qe.replacePathSegmentSeparator=fE;function hE(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}qe.joinPathSegments=hE});var Ui=x(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var mE=Tn(),Vi=class{constructor(t,r){this._root=t,this._settings=r,this._root=mE.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Gi.default=Vi});var Yi=x(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var gE=F("events"),yE=On(),vE=Wp(),Pn=Tn(),bE=Ui(),Wi=class extends bE.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=yE.scandir,this._emitter=new gE.EventEmitter,this._queue=vE(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||!Pn.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=Pn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Pn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Pn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};qi.default=Wi});var qp=x(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});var _E=Yi(),Ki=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new _E.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{EE(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{xE(t,this._storage)}),this._reader.read()}};Xi.default=Ki;function EE(e,t){e(t)}function xE(e,t){e(null,t)}});var Yp=x(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var kE=F("stream"),wE=Yi(),zi=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new wE.default(this._root,this._settings),this._stream=new kE.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}};Ji.default=zi});var Kp=x(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var CE=On(),$n=Tn(),AE=Ui(),Qi=class extends AE.default{constructor(){super(...arguments),this._scandir=CE.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($n.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=$n.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),$n.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&$n.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};Zi.default=Qi});var Xp=x(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var SE=Kp(),es=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new SE.default(this._root,this._settings)}read(){return this._reader.read()}};ts.default=es});var zp=x(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var RE=F("path"),OE=On(),rs=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,RE.sep),this.fsScandirSettings=new OE.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}};ns.default=rs});var Nn=x(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Settings=Ye.walkStream=Ye.walkSync=Ye.walk=void 0;var Jp=qp(),TE=Yp(),PE=Xp(),os=zp();Ye.Settings=os.default;function $E(e,t,r){if(typeof t=="function"){new Jp.default(e,Dn()).read(t);return}new Jp.default(e,Dn(t)).read(r)}Ye.walk=$E;function DE(e,t){let r=Dn(t);return new PE.default(e,r).read()}Ye.walkSync=DE;function NE(e,t){let r=Dn(t);return new TE.default(e,r).read()}Ye.walkStream=NE;function Dn(e={}){return e instanceof os.default?e:new os.default(e)}});var Ln=x(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var LE=F("path"),IE=St(),Qp=et(),is=class{constructor(t){this._settings=t,this._fsStatSettings=new IE.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return LE.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Qp.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Qp.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};ss.default=is});var ls=x(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var jE=F("stream"),FE=St(),ME=Nn(),BE=Ln(),as=class extends BE.default{constructor(){super(...arguments),this._walkStream=ME.walkStream,this._stat=FE.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new jE.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))})}};cs.default=as});var Zp=x(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var HE=Nn(),VE=Ln(),GE=ls(),us=class extends VE.default{constructor(){super(...arguments),this._walkAsync=HE.walk,this._readerStream=new GE.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))})}};ps.default=us});var ed=x(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var wr=et(),ds=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 wr.pattern.getPatternParts(t,this._micromatchOptions).map(n=>wr.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:wr.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return wr.array.splitWhen(t,r=>r.dynamic&&wr.pattern.hasGlobStar(r.pattern))}};fs.default=ds});var td=x(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var UE=ed(),hs=class extends UE.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,u)=>{let l=i.segments[u];return!!(l.dynamic&&l.patternRe.test(c)||!l.dynamic&&l.pattern===c)}))return!0}return!1}};ms.default=hs});var rd=x(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});var In=et(),WE=td(),gs=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 WE.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(In.pattern.isAffectDepthOfReadingPattern);return In.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=In.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!In.pattern.matchAny(t,r)}};ys.default=gs});var nd=x(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var bt=et(),vs=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=bt.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:bt.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:bt.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:bt.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=bt.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=bt.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=bt.pattern.matchAny(t,r);return!o&&n?bt.pattern.matchAny(t+"/",r):o}};bs.default=vs});var od=x(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});var qE=et(),_s=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return qE.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};Es.default=_s});var sd=x(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var id=et(),xs=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=id.path.makeAbsolute(this._settings.cwd,r),r=id.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};ks.default=xs});var jn=x(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});var YE=F("path"),KE=rd(),XE=nd(),zE=od(),JE=sd(),ws=class{constructor(t){this._settings=t,this.errorFilter=new zE.default(this._settings),this.entryFilter=new XE.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new KE.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new JE.default(this._settings)}_getRootDirectory(t){return YE.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}}};Cs.default=ws});var ad=x(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});var QE=Zp(),ZE=jn(),As=class extends ZE.default{constructor(){super(...arguments),this._reader=new QE.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)}};Ss.default=As});var cd=x(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var ex=F("stream"),tx=ls(),rx=jn(),Rs=class extends rx.default{constructor(){super(...arguments),this._reader=new tx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new ex.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)}};Os.default=Rs});var ld=x(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var nx=St(),ox=Nn(),ix=Ln(),Ts=class extends ix.default{constructor(){super(...arguments),this._walkSync=ox.walkSync,this._statSync=nx.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)}};Ps.default=Ts});var ud=x(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});var sx=ld(),ax=jn(),$s=class extends ax.default{constructor(){super(...arguments),this._reader=new sx.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)}};Ds.default=$s});var pd=x(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var Xt=F("fs"),cx=F("os"),lx=Math.max(cx.cpus().length,1);zt.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:Xt.lstat,lstatSync:Xt.lstatSync,stat:Xt.stat,statSync:Xt.statSync,readdir:Xt.readdir,readdirSync:Xt.readdirSync};var Ns=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,lx),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({},zt.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};zt.default=Ns});var Fs=x((WS,fd)=>{"use strict";var dd=fp(),ux=ad(),px=cd(),dx=ud(),Ls=pd(),Pe=et();async function Is(e,t){je(e);let r=js(e,ux.default,t),n=await Promise.all(r);return Pe.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(u,l){je(u);let p=js(u,dx.default,l);return Pe.array.flatten(p)}e.sync=t;function r(u,l){je(u);let p=js(u,px.default,l);return Pe.stream.merge(p)}e.stream=r;function n(u,l){je(u);let p=[].concat(u),d=new Ls.default(l);return dd.generate(p,d)}e.generateTasks=n;function o(u,l){je(u);let p=new Ls.default(l);return Pe.pattern.isDynamicPattern(u,p)}e.isDynamicPattern=o;function i(u){return je(u),Pe.path.escape(u)}e.escapePath=i;function s(u){return je(u),Pe.path.convertPathToPattern(u)}e.convertPathToPattern=s;let a;(function(u){function l(d){return je(d),Pe.path.escapePosixPath(d)}u.escapePath=l;function p(d){return je(d),Pe.path.convertPosixPathToPattern(d)}u.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(u){function l(d){return je(d),Pe.path.escapeWindowsPath(d)}u.escapePath=l;function p(d){return je(d),Pe.path.convertWindowsPathToPattern(d)}u.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(Is||(Is={}));function js(e,t,r){let n=[].concat(e),o=new Ls.default(r),i=dd.generate(n,o),s=new t(o);return i.map(s.read,s)}function je(e){if(![].concat(e).every(n=>Pe.string.isString(n)&&!Pe.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}fd.exports=Is});import fx from"node:fs";import hx from"node:fs/promises";async function Ms(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await hx[e](r))[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Bs(e,t,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return fx[e](r)[t]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var KS,hd,XS,zS,md,JS,gd=ct(()=>{KS=Ms.bind(void 0,"stat","isFile"),hd=Ms.bind(void 0,"stat","isDirectory"),XS=Ms.bind(void 0,"lstat","isSymbolicLink"),zS=Bs.bind(void 0,"statSync","isFile"),md=Bs.bind(void 0,"statSync","isDirectory"),JS=Bs.bind(void 0,"lstatSync","isSymbolicLink")});var yd=ct(()=>{});import{promisify as mx}from"node:util";import{execFile as gx,execFileSync as r0}from"node:child_process";import{fileURLToPath as yx}from"node:url";function Cr(e){return e instanceof URL?yx(e):e}var o0,i0,Hs=ct(()=>{yd();o0=mx(gx);i0=10*1024*1024});var Ad=x((c0,Bn)=>{function _d(e){return Array.isArray(e)?e:[e]}var vx=void 0,Gs="",vd=" ",Vs="\\",bx=/^\s+$/,_x=/(?:[^\\]|^)\\$/,Ex=/^\\!/,xx=/^\\#/,kx=/\r?\n/g,wx=/^\.{0,2}\/|^\.{1,2}$/,Cx=/\/$/,Jt="/",Ed="node-ignore";typeof Symbol<"u"&&(Ed=Symbol.for("node-ignore"));var xd=Ed,Qt=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),Ax=/([0-z])-([0-z])/g,kd=()=>!1,Sx=e=>e.replace(Ax,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:Gs),Rx=e=>{let{length:t}=e;return e.slice(0,t-t%2)},Ox=[[/^\uFEFF/,()=>Gs],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?vd:Gs)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+vd}],[/[\\$.|*+(){^]/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,()=>Vs],[/\\\\/g,()=>Vs],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===Vs?`\\[${r}${Rx(n)}${o}`:o==="]"&&n.length%2===0?`[${Sx(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],Tx=/(^|\\\/)?\\\*$/,Ar="regex",Fn="checkRegex",bd="_",Px={[Ar](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Fn](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},$x=e=>Ox.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Mn=e=>typeof e=="string",Dx=e=>e&&Mn(e)&&!bx.test(e)&&!_x.test(e)&&e.indexOf("#")!==0,Nx=e=>e.split(kx).filter(Boolean),Us=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,Qt(this,"body",n),Qt(this,"ignoreCase",o),Qt(this,"regexPrefix",s)}get regex(){let t=bd+Ar;return this[t]?this[t]:this._make(Ar,t)}get checkRegex(){let t=bd+Fn;return this[t]?this[t]:this._make(Fn,t)}_make(t,r){let n=this.regexPrefix.replace(Tx,Px[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return Qt(this,r,o)}},Lx=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(Ex,"!").replace(xx,"#");let i=$x(o);return new Us(e,t,o,r,n,i)},Ws=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[xd]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Mn(t)&&(t={pattern:t}),Dx(t.pattern)){let r=Lx(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,_d(Mn(t)?Nx(t):t).forEach(this._add,this),this._added}test(t,r,n){let o=!1,i=!1,s;this._rules.forEach(c=>{let{negative:u}=c;i===u&&o!==i||u&&!o&&!i&&!r||!c[n].test(t)||(o=!u,i=u,s=u?vx:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},Ix=(e,t)=>{throw new t(e)},tt=(e,t,r)=>Mn(e)?e?tt.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),wd=e=>wx.test(e);tt.isNotRelative=wd;tt.convert=e=>e;var qs=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){Qt(this,xd,!0),this._rules=new Ws(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&&tt.convert(t);return tt(i,t,this._strictPathCheck?Ix:kd),this._t(i,r,n,o)}checkIgnore(t){if(!Cx.test(t))return this.test(t);let r=t.split(Jt).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(Jt)+Jt,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Fn)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(Jt).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,Ar);let i=this._t(o.join(Jt)+Jt,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,Ar)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return _d(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Ys=e=>new qs(e),jx=e=>tt(e&&tt.convert(e),e,kd),Cd=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");tt.convert=e;let t=/^[a-z]:\//i;tt.isNotRelative=r=>t.test(r)||wd(r)};typeof process<"u"&&process.platform==="win32"&&Cd();Bn.exports=Ys;Ys.default=Ys;Bn.exports.isPathValid=jx;Qt(Bn.exports,Symbol.for("setupWindows"),Cd)});function Zt(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var Sd=ct(()=>{});var Sr,Ks=ct(()=>{Sr=e=>e[0]==="!"});import Fx from"node:process";import Mx from"node:fs";import Bx from"node:fs/promises";import er from"node:path";var Xs,Rd,Hx,Od,Hn,Vx,Gx,Ux,Td,Pd,Rr,Or,$d,Dd,zs=ct(()=>{Xs=ir(Fs(),1),Rd=ir(Ad(),1);Sd();Hs();Ks();Hx=["**/node_modules","**/flow-typed","**/coverage","**/.git"],Od={absolute:!0,dot:!0},Hn="**/.gitignore",Vx=(e,t)=>Sr(e)?"!"+er.posix.join(t,e.slice(1)):er.posix.join(t,e),Gx=(e,t)=>{let r=Zt(er.relative(t,er.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>Vx(n,r))},Ux=(e,t)=>{if(t=Zt(t),er.isAbsolute(e)){if(Zt(e).startsWith(t))return er.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},Td=(e,t)=>{let r=e.flatMap(o=>Gx(o,t)),n=(0,Rd.default)().add(r);return o=>(o=Cr(o),o=Ux(o,t),o?n.ignores(Zt(o)):!1)},Pd=(e={})=>({cwd:Cr(e.cwd)??Fx.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY,ignore:[...e.ignore??[],...Hx]}),Rr=async(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=Pd(t),s=await(0,Xs.default)(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...Od}),a=await Promise.all(s.map(async c=>({filePath:c,content:await Bx.readFile(c,"utf8")})));return Td(a,r)},Or=(e,t)=>{let{cwd:r,suppressErrors:n,deep:o,ignore:i}=Pd(t),a=Xs.default.sync(e,{cwd:r,suppressErrors:n,deep:o,ignore:i,...Od}).map(c=>({filePath:c,content:Mx.readFileSync(c,"utf8")}));return Td(a,r)},$d=e=>Rr(Hn,e),Dd=e=>Or(Hn,e)});var Kd={};Vf(Kd,{convertPathToPattern:()=>tk,generateGlobTasks:()=>Zx,generateGlobTasksSync:()=>ek,globby:()=>Xx,globbyStream:()=>Jx,globbySync:()=>zx,isDynamicPattern:()=>Qx,isGitIgnored:()=>$d,isGitIgnoredSync:()=>Dd,isIgnoredByIgnoreFiles:()=>Rr,isIgnoredByIgnoreFilesSync:()=>Or});import Id from"node:process";import Wx from"node:fs";import tr from"node:path";var rr,qx,jd,Fd,Nd,Ld,Js,Yx,Md,Bd,Vn,Hd,Kx,Vd,Gd,Ud,Wd,qd,Yd,Qs,Xx,zx,Jx,Qx,Zx,ek,tk,Xd=ct(()=>{wl();rr=ir(Fs(),1);gd();Hs();zs();Ks();zs();qx=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},jd=(e,t)=>{let r=Sr(e)?e.slice(1):e;return tr.isAbsolute(r)?r:tr.join(t,r)},Fd=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>tr.posix.join(e,`**/${tr.extname(o)?o:`${o}${n}`}`)):[tr.posix.join(e,`**${n?`/*${n}`:""}`)]},Nd=async(e,{cwd:t=Id.cwd(),files:r,extensions:n}={})=>(await Promise.all(e.map(async i=>await hd(jd(i,t))?Fd({directoryPath:i,files:r,extensions:n}):i))).flat(),Ld=(e,{cwd:t=Id.cwd(),files:r,extensions:n}={})=>e.flatMap(o=>md(jd(o,t))?Fd({directoryPath:o,files:r,extensions:n}):o),Js=e=>(e=[...new Set([e].flat())],qx(e),e),Yx=e=>{if(!e)return;let t;try{t=Wx.statSync(e)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},Md=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:Cr(e.cwd)},Yx(e.cwd),e),Bd=e=>async(t,r)=>e(Js(t),Md(r)),Vn=e=>(t,r)=>e(Js(t),Md(r)),Hd=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?Js(t):[];return r&&n.push(Hn),n},Kx=async e=>{let t=Hd(e);return Gd(t.length>0&&await Rr(t,e))},Vd=e=>{let t=Hd(e);return Gd(t.length>0&&Or(t,e))},Gd=e=>{let t=new Set;return r=>{let n=tr.normalize(r.path??r);return t.has(n)||e&&e(n)?!1:(t.add(n),!0)}},Ud=(e,t)=>e.flat().filter(r=>t(r)),Wd=(e,t)=>{let r=[];for(;e.length>0;){let n=e.findIndex(i=>Sr(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},qd=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Yd=async(e,t)=>{let r=Wd(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=qd(o,n);return Promise.all(r.map(async s=>{let{patterns:a,options:c}=s;return[a,c.ignore]=await Promise.all([Nd(a,i),Nd(c.ignore,{cwd:n})]),{patterns:a,options:c}}))},Qs=(e,t)=>{let r=Wd(e,t),{cwd:n,expandDirectories:o}=t;if(!o)return r;let i=qd(o,n);return r.map(s=>{let{patterns:a,options:c}=s;return a=Ld(a,i),c.ignore=Ld(c.ignore,{cwd:n}),{patterns:a,options:c}})},Xx=Bd(async(e,t)=>{let[r,n]=await Promise.all([Yd(e,t),Kx(t)]),o=await Promise.all(r.map(i=>(0,rr.default)(i.patterns,i.options)));return Ud(o,n)}),zx=Vn((e,t)=>{let r=Qs(e,t),n=Vd(t),o=r.map(i=>rr.default.sync(i.patterns,i.options));return Ud(o,n)}),Jx=Vn((e,t)=>{let r=Qs(e,t),n=Vd(t),o=r.map(s=>rr.default.stream(s.patterns,s.options));return ei(o).filter(s=>n(s))}),Qx=Vn((e,t)=>e.some(r=>rr.default.isDynamicPattern(r,t))),Zx=Bd(Yd),ek=Vn(Qs),{convertPathToPattern:tk}=rr.default});var Be=["frontend","backend"],eo=["workbench.frontend","workbench.backend"],Ir=[...Be,...eo];var la=(e=0)=>t=>`\x1B[${t+e}m`,ua=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,pa=(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]}},fw=Object.keys(Q.modifier),Uf=Object.keys(Q.color),Wf=Object.keys(Q.bgColor),hw=[...Uf,...Wf];function qf(){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=la(),Q.color.ansi256=ua(),Q.color.ansi16m=pa(),Q.bgColor.ansi=la(10),Q.bgColor.ansi256=ua(10),Q.bgColor.ansi16m=pa(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 Yf=qf(),Ne=Yf;import to from"node:process";import Kf from"node:os";import da from"node:tty";function Re(e,t=globalThis.Deno?globalThis.Deno.args:to.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:Z}=to,jr;Re("no-color")||Re("no-colors")||Re("color=false")||Re("color=never")?jr=0:(Re("color")||Re("colors")||Re("color=true")||Re("color=always"))&&(jr=1);function Xf(){if("FORCE_COLOR"in Z)return Z.FORCE_COLOR==="true"?1:Z.FORCE_COLOR==="false"?0:Z.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Z.FORCE_COLOR,10),3)}function zf(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Jf(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Xf();n!==void 0&&(jr=n);let o=r?jr:n;if(o===0)return 0;if(r){if(Re("color=16m")||Re("color=full")||Re("color=truecolor"))return 3;if(Re("color=256"))return 2}if("TF_BUILD"in Z&&"AGENT_NAME"in Z)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(Z.TERM==="dumb")return i;if(to.platform==="win32"){let s=Kf.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Z)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Z)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Z)||Z.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor"||Z.TERM==="xterm-kitty"||Z.TERM==="xterm-ghostty"||Z.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Z){let s=Number.parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:i}function fa(e,t={}){let r=Jf(e,{streamIsTTY:e&&e.isTTY,...t});return zf(r)}var Qf={stdout:fa({isTTY:da.isatty(1)}),stderr:fa({isTTY:da.isatty(2)})},ha=Qf;function ma(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 ga(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 Xa(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 Ro(){if(B.env.NO_COLOR||B.env.FORCE_COLOR==="0"||B.env.FORCE_COLOR==="false")return!1;if(B.env.FORCE_COLOR||B.env.CLICOLOR_FORCE!==void 0)return!0}Oo.Command=So;Oo.useColor=Ro});var tc=x($e=>{var{Argument:Qa}=Vr(),{Command:To}=Ja(),{CommanderError:tm,InvalidArgumentError:Za}=fr(),{Help:rm}=_o(),{Option:ec}=wo();$e.program=new To;$e.createCommand=e=>new To(e);$e.createOption=(e,t)=>new ec(e,t);$e.createArgument=(e,t)=>new Qa(e,t);$e.Command=To;$e.Option=ec;$e.Argument=Qa;$e.Help=rm;$e.CommanderError=tm;$e.InvalidArgumentError=Za;$e.InvalidOptionArgumentError=Za});var ll=x((CA,Cy)=>{Cy.exports={name:"dotenv",version:"17.3.1",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 tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run tests/**/*.js --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 ml=x((AA,ot)=>{var Wo=M("fs"),Qr=M("path"),Ay=M("os"),Sy=M("crypto"),Ry=ll(),qo=Ry.version,ul=["\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{1F916} agentic secret storage: https://dotenvx.com/as2","\u26A1\uFE0F secrets for agents: https://dotenvx.com/as2","\u{1F6E1}\uFE0F auth for agents: https://vestauth.com","\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 Oy(){return ul[Math.floor(Math.random()*ul.length)]}function Yt(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function Ty(){return process.stdout.isTTY}function Py(e){return Ty()?`\x1B[2m${e}\x1B[0m`:e}var $y=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Dy(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
29
|
+
`);let n;for(;(n=$y.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 Ny(e){e=e||{};let t=hl(e);e.path=t;let r=le.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=fl(e).split(","),o=n.length,i;for(let s=0;s<o;s++)try{let a=n[s].trim(),c=Iy(r,a);i=le.decrypt(c.ciphertext,c.key);break}catch(a){if(s+1>=o)throw a}return le.parse(i)}function Ly(e){console.error(`[dotenv@${qo}][WARN] ${e}`)}function _r(e){console.log(`[dotenv@${qo}][DEBUG] ${e}`)}function dl(e){console.log(`[dotenv@${qo}] ${e}`)}function fl(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 Iy(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 hl(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Wo.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Qr.resolve(process.cwd(),".env.vault");return Wo.existsSync(t)?t:null}function pl(e){return e[0]==="~"?Qr.join(Ay.homedir(),e.slice(1)):e}function Fy(e){let t=Yt(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Yt(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&dl("Loading env from encrypted .env.vault");let n=le._parseVault(e),o=process.env;return e&&e.processEnv!=null&&(o=e.processEnv),le.populate(o,n,e),{parsed:n}}function jy(e){let t=Qr.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let o=Yt(n.DOTENV_CONFIG_DEBUG||e&&e.debug),i=Yt(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:o&&_r("No encoding is specified. UTF-8 is used by default");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[pl(e.path)];else{s=[];for(let u of e.path)s.push(pl(u))}let a,c={};for(let u of s)try{let p=le.parse(Wo.readFileSync(u,{encoding:r}));le.populate(c,p,e)}catch(p){o&&_r(`Failed to load ${u} ${p.message}`),a=p}let l=le.populate(n,c,e);if(o=Yt(n.DOTENV_CONFIG_DEBUG||o),i=Yt(n.DOTENV_CONFIG_QUIET||i),o||!i){let u=Object.keys(l).length,p=[];for(let d of s)try{let y=Qr.relative(process.cwd(),d);p.push(y)}catch(y){o&&_r(`Failed to load ${d} ${y.message}`),a=y}dl(`injecting env (${u}) from ${p.join(",")} ${Py(`-- tip: ${Oy()}`)}`)}return a?{parsed:c,error:a}:{parsed:c}}function My(e){if(fl(e).length===0)return le.configDotenv(e);let t=hl(e);return t?le._configVault(e):(Ly(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),le.configDotenv(e))}function By(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=Sy.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 Hy(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&&_r(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 le={configDotenv:jy,_configVault:Fy,_parseVault:Ny,config:My,decrypt:By,parse:Dy,populate:Hy};ot.exports.configDotenv=le.configDotenv;ot.exports._configVault=le._configVault;ot.exports._parseVault=le._parseVault;ot.exports.config=le.config;ot.exports.decrypt=le.decrypt;ot.exports.parse=le.parse;ot.exports.populate=le.populate;ot.exports=le});var Yo=x((SA,Gy)=>{Gy.exports={name:"@raclettejs/core",version:"0.1.24",description:"racletteJS core package",repository:"https://gitlab.com/raclettejs/core",author:"Pacifico Digital Explorations GmbH <info@raclettejs.com>",license:"AGPL-3.0-only",type:"module",scripts:{build:"node build.mjs || true",dev:"node watch.mjs",watch:"node watch.mjs","format:check":"prettier --check .","format:fix":"prettier --write .",lint:"eslint","lint:grouped":"FILTER_RULE=$RULE eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --format ./dev/eslint/groupByRuleFormatter.cjs","lint:fix":"eslint --fix",prepare:"husky",prepublishOnly:"yarn run build && yarn run sync","publish:patch":"yarn version --patch && yarn publish",sync:"node ./scripts/sync-exports.js"},bin:{raclette:"./bin/cli.js"},main:"index.js",types:"./types/index.ts",files:["services","bin","dist","types","scripts","index.js","README.md","yarn.lock","src/types.ts","LICENSE.md","CONTRIBUTING.md","raclette.default.config.yaml"],exports:{".":{types:"./types/index.ts",import:"./dist/index.js"},"./backend":{types:"./services/backend/src/index.ts",import:"./services/backend/src/index.ts"},"./frontend":{types:"./services/frontend/src/core/index.ts",import:"./services/frontend/src/core/index.ts"},"./orchestrator":{types:"./services/frontend/src/orchestrator/index.ts",import:"./services/frontend/src/orchestrator/index.ts"}},config:{},dependencies:{"@inquirer/prompts":"8.3.2","@types/mustache":"4.2.6",chalk:"5.6.2",chokidar:"5.0.0","cli-highlight":"2.1.11",commander:"14.0.3",dotenv:"17.3.1",esbuild:"0.27.4","fs-extra":"11.3.4",globby:"16.1.1","js-yaml":"4.1.1",mustache:"4.2.0",ramda:"0.32.0","tsc-alias":"1.8.16"},devDependencies:{"@emnapi/core":"1.9.2","@emnapi/runtime":"1.9.2","@eslint/js":"9.35.0","@raclettejs/types":"workspace:^","@types/fs-extra":"11.0.4","@types/js-yaml":"4.0.9","@types/node":"25.5.0","@types/ramda":"0.31.1",eslint:"9.35.0","eslint-config-prettier":"9.1.2","eslint-flat-config-utils":"3.0.2","eslint-plugin-import":"2.32.0","eslint-plugin-prefer-arrow-functions":"3.9.1","eslint-plugin-prettier":"5.5.5","eslint-plugin-vue":"9.33.0",globals:"17.4.0",husky:"9.1.7",prettier:"3.8.1",typescript:"5.9.3","typescript-eslint":"8.57.1","vue-eslint-parser":"9.4.3"}}});import{on as Ov,once as Hl}from"node:events";import{PassThrough as Tv,getDefaultHighWaterMark as Pv}from"node:stream";import{finished as Ul}from"node:stream/promises";function fi(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)di(o);let t=e.some(({readableObjectMode:o})=>o),r=$v(e,t),n=new pi({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var $v,pi,Dv,Nv,Lv,di,Iv,Fv,jv,Mv,Bv,Wl,ql,hi,Yl,Hv,pn,Gl,Vl,Kl=gt(()=>{$v=(e,t)=>{if(e.length===0)return Pv(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},pi=class extends Tv{#e=new Set([]);#o=new Set([]);#i=new Set([]);#r;#n=Symbol("unpipe");#t=new WeakMap;add(t){if(di(t),this.#e.has(t))return;this.#e.add(t),this.#r??=Dv(this,this.#e,this.#n);let r=Iv({passThroughStream:this,stream:t,streams:this.#e,ended:this.#o,aborted:this.#i,onFinished:this.#r,unpipeEvent:this.#n});this.#t.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(di(t),!this.#e.has(t))return!1;let r=this.#t.get(t);return r===void 0?!1:(this.#t.delete(t),t.unpipe(this),await r,!0)}},Dv=async(e,t,r)=>{pn(e,Gl);let n=new AbortController;try{await Promise.race([Nv(e,n),Lv(e,t,r,n)])}finally{n.abort(),pn(e,-Gl)}},Nv=async(e,{signal:t})=>{try{await Ul(e,{signal:t,cleanup:!0})}catch(r){throw Wl(e,r),r}},Lv=async(e,t,r,{signal:n})=>{for await(let[o]of Ov(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},di=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Iv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{pn(e,Vl);let a=new AbortController;try{await Promise.race([Fv(i,t,a),jv({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),Mv({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),pn(e,-Vl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?hi(e):Bv(e))},Fv=async(e,t,{signal:r})=>{try{await e,r.aborted||hi(t)}catch(n){r.aborted||Wl(t,n)}},jv=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await Ul(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;ql(s)?o.add(t):Yl(e,s)}},Mv=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await Hl(e,o,{signal:i}),!e.readable)return Hl(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},Bv=e=>{e.writable&&e.end()},Wl=(e,t)=>{ql(t)?hi(e):Yl(e,t)},ql=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",hi=e=>{(e.readable||e.writable)&&e.destroy()},Yl=(e,t)=>{e.destroyed||(e.once("error",Hv),e.destroy(t))},Hv=()=>{},pn=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Gl=2,Vl=1});var zl=x(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.splitWhen=Zt.flatten=void 0;function Gv(e){return e.reduce((t,r)=>[].concat(t,r),[])}Zt.flatten=Gv;function Vv(e,t){let r=[[]],n=0;for(let o of e)t(o)?(n++,r[n]=[]):r[n].push(o);return r}Zt.splitWhen=Vv});var Xl=x(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.isEnoentCodeError=void 0;function Uv(e){return e.code==="ENOENT"}dn.isEnoentCodeError=Uv});var Jl=x(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.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 Wv(e,t){return new mi(e,t)}fn.createDirentFromStats=Wv});var tu=x(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.convertPosixPathToPattern=ie.convertWindowsPathToPattern=ie.convertPathToPattern=ie.escapePosixPath=ie.escapeWindowsPath=ie.escape=ie.removeLeadingDotSegment=ie.makeAbsolute=ie.unixify=void 0;var qv=M("os"),Yv=M("path"),Ql=qv.platform()==="win32",Kv=2,zv=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Xv=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Jv=/^\\\\([.?])/,Qv=/\\(?![!()+@[\]{}])/g;function Zv(e){return e.replace(/\\/g,"/")}ie.unixify=Zv;function eb(e,t){return Yv.resolve(e,t)}ie.makeAbsolute=eb;function tb(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\")return e.slice(Kv)}return e}ie.removeLeadingDotSegment=tb;ie.escape=Ql?gi:yi;function gi(e){return e.replace(Xv,"\\$2")}ie.escapeWindowsPath=gi;function yi(e){return e.replace(zv,"\\$2")}ie.escapePosixPath=yi;ie.convertPathToPattern=Ql?Zl:eu;function Zl(e){return gi(e).replace(Jv,"//$1").replace(Qv,"/")}ie.convertWindowsPathToPattern=Zl;function eu(e){return yi(e)}ie.convertPosixPathToPattern=eu});var nu=x((YS,ru)=>{ru.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 su=x((KS,iu)=>{var rb=nu(),ou={"{":"}","(":")","[":"]"},nb=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=ou[a];if(c){var l=e.indexOf(c,t);l!==-1&&(t=l+1)}if(e[t]==="!")return!0}else t++}return!1},ob=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=ou[r];if(n){var o=e.indexOf(n,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1};iu.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(rb(t))return!0;var n=nb;return r&&r.strict===!1&&(n=ob),n(t)}});var cu=x((zS,au)=>{"use strict";var ib=su(),sb=M("path").posix.dirname,ab=M("os").platform()==="win32",vi="/",cb=/\\/g,lb=/[\{\[].*[\}\]]$/,ub=/(^|[^\\])([\{\[]|\([^\)]+$)/,pb=/\\([\!\*\?\|\[\]\(\)\{\}])/g;au.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&ab&&t.indexOf(vi)<0&&(t=t.replace(cb,vi)),lb.test(t)&&(t+=vi),t+="a";do t=sb(t);while(ib(t)||ub.test(t));return t.replace(pb,"$1")}});var hn=x(De=>{"use strict";De.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;De.find=(e,t)=>e.nodes.find(r=>r.type===t);De.exceedsLimit=(e,t,r=1,n)=>n===!1||!De.isInteger(e)||!De.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;De.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)};De.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;De.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;De.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;De.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);De.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 mn=x((JS,uu)=>{"use strict";var lu=hn();uu.exports=(e,t={})=>{let r=(n,o={})=>{let i=t.escapeInvalid&&lu.isInvalidBrace(o),s=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(i||s)&&lu.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 du=x((QS,pu)=>{"use strict";pu.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Eu=x((ZS,_u)=>{"use strict";var fu=du(),Dt=(e,t,r)=>{if(fu(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(fu(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(Dt.cache.hasOwnProperty(c))return Dt.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(Math.abs(l-u)===1){let m=e+"|"+t;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let p=bu(e)||bu(t),d={min:e,max:t,a:l,b:u},y=[],g=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),l<0){let m=u<0?Math.abs(u):1;g=hu(m,Math.abs(l),d,n),l=d.a=0}return u>=0&&(y=hu(l,u,d,n)),d.negatives=g,d.positives=y,d.result=db(g,y,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&y.length+g.length>1&&(d.result=`(?:${d.result})`),Dt.cache[c]=d,d.result};function db(e,t,r){let n=bi(e,t,"-",!1,r)||[],o=bi(t,e,"",!1,r)||[],i=bi(e,t,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function fb(e,t){let r=1,n=1,o=gu(e,r),i=new Set([t]);for(;e<=o&&o<=t;)i.add(o),r+=1,o=gu(e,r);for(o=yu(t+1,n)-1;e<o&&o<=t;)i.add(o),n+=1,o=yu(t+1,n)-1;return i=[...i],i.sort(gb),i}function hb(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=mb(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+=yb(c,l,r):s++}return s&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[s],digits:o}}function hu(e,t,r,n){let o=fb(e,t),i=[],s=e,a;for(let c=0;c<o.length;c++){let l=o[c],u=hb(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+vu(a.count),s=l+1;continue}r.isPadded&&(p=vb(l,r,n)),u.string=p+u.pattern+vu(u.count),i.push(u),s=l+1,a=u}return i}function bi(e,t,r,n,o){let i=[];for(let s of e){let{string:a}=s;!n&&!mu(t,"string",a)&&i.push(r+a),n&&mu(t,"string",a)&&i.push(r+a)}return i}function mb(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function gb(e,t){return e>t?1:t>e?-1:0}function mu(e,t,r){return e.some(n=>n[t]===r)}function gu(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function yu(e,t){return e-e%Math.pow(10,t)}function vu(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function yb(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function bu(e){return/^-?(0+)\d/.test(e)}function vb(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}}`}}Dt.cache={};Dt.clearCache=()=>Dt.cache={};_u.exports=Dt});var xi=x((e0,Ru)=>{"use strict";var bb=M("util"),ku=Eu(),xu=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),_b=e=>t=>e===!0?Number(t):String(t),_i=e=>typeof e=="number"||typeof e=="string"&&e!=="",Cr=e=>Number.isInteger(+e),Ei=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Eb=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,xb=(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},yn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},kb=(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=>yn(String(a),r)).join("|")),e.negatives.length&&(i=`-(${n}${e.negatives.map(a=>yn(String(a),r)).join("|")})`),o&&i?s=`${o}|${i}`:s=o||i,t.wrap?`(${n}${s})`:s},wu=(e,t,r,n)=>{if(r)return ku(e,t,{wrap:!1,...n});let o=String.fromCharCode(e);if(e===t)return o;let i=String.fromCharCode(t);return`[${o}-${i}]`},Cu=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${e.join("|")})`:e.join("|")}return ku(e,t,r)},Au=(...e)=>new RangeError("Invalid range arguments: "+bb.inspect(...e)),Su=(e,t,r)=>{if(r.strictRanges===!0)throw Au([e,t]);return[]},wb=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Cb=(e,t,r=1,n={})=>{let o=Number(e),i=Number(t);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw Au([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=Ei(a)||Ei(c)||Ei(l),p=u?Math.max(a.length,c.length,l.length):0,d=u===!1&&Eb(e,t,n)===!1,y=n.transform||_b(d);if(n.toRegex&&r===1)return wu(yn(e,p),yn(t,p),!0,n);let g={negatives:[],positives:[]},m=S=>g[S<0?"negatives":"positives"].push(Math.abs(S)),E=[],k=0;for(;s?o>=i:o<=i;)n.toRegex===!0&&r>1?m(o):E.push(xb(y(o,k),p,d)),o=s?o-r:o+r,k++;return n.toRegex===!0?r>1?kb(g,n,p):Cu(E,null,{wrap:!1,...n}):E},Ab=(e,t,r=1,n={})=>{if(!Cr(e)&&e.length>1||!Cr(t)&&t.length>1)return Su(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 wu(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?Cu(u,null,{wrap:!1,options:n}):u},gn=(e,t,r,n={})=>{if(t==null&&_i(e))return[e];if(!_i(e)||!_i(t))return Su(e,t,n);if(typeof r=="function")return gn(e,t,1,{transform:r});if(xu(r))return gn(e,t,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,Cr(r)?Cr(e)&&Cr(t)?Cb(e,t,r,o):Ab(e,t,Math.max(Math.abs(r),1),o):r!=null&&!xu(r)?wb(r,o):gn(e,t,1,r)};Ru.exports=gn});var Pu=x((t0,Tu)=>{"use strict";var Sb=xi(),Ou=hn(),Rb=(e,t={})=>{let r=(n,o={})=>{let i=Ou.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=Ou.reduce(n.nodes),p=Sb(...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)};Tu.exports=Rb});var Nu=x((r0,Du)=>{"use strict";var Ob=xi(),$u=mn(),er=hn(),Nt=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?er.flatten(t).map(o=>`{${o}}`):t;for(let o of e)if(Array.isArray(o))for(let i of o)n.push(Nt(i,t,r));else for(let i of t)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Nt(o,i,r):o+i);return er.flatten(n)},Tb=(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(Nt(a.pop(),$u(o,t)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){a.push(Nt(a.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let p=er.reduce(o.nodes);if(er.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=Ob(...p,t);d.length===0&&(d=$u(o,t)),a.push(Nt(a.pop(),d)),o.nodes=[];return}let c=er.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(Nt(a.pop(),l,c));continue}if(d.value&&d.type!=="open"){l.push(Nt(l.pop(),d.value));continue}d.nodes&&n(d,o)}return l};return er.flatten(n(e))};Du.exports=Tb});var Iu=x((n0,Lu)=>{"use strict";Lu.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 Hu=x((o0,Bu)=>{"use strict";var Pb=mn(),{MAX_LENGTH:Fu,CHAR_BACKSLASH:ki,CHAR_BACKTICK:$b,CHAR_COMMA:Db,CHAR_DOT:Nb,CHAR_LEFT_PARENTHESES:Lb,CHAR_RIGHT_PARENTHESES:Ib,CHAR_LEFT_CURLY_BRACE:Fb,CHAR_RIGHT_CURLY_BRACE:jb,CHAR_LEFT_SQUARE_BRACKET:ju,CHAR_RIGHT_SQUARE_BRACKET:Mu,CHAR_DOUBLE_QUOTE:Mb,CHAR_SINGLE_QUOTE:Bb,CHAR_NO_BREAK_SPACE:Hb,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Gb}=Iu(),Vb=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Fu,r.maxLength):Fu;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,y=()=>e[u++],g=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(g({type:"bos"});u<l;)if(s=i[i.length-1],d=y(),!(d===Gb||d===Hb)){if(d===ki){g({type:"text",value:(t.keepEscaping?d:"")+y()});continue}if(d===Mu){g({type:"text",value:"\\"+d});continue}if(d===ju){c++;let m;for(;u<l&&(m=y());){if(d+=m,m===ju){c++;continue}if(m===ki){d+=y();continue}if(m===Mu&&(c--,c===0))break}g({type:"text",value:d});continue}if(d===Lb){s=g({type:"paren",nodes:[]}),i.push(s),g({type:"text",value:d});continue}if(d===Ib){if(s.type!=="paren"){g({type:"text",value:d});continue}s=i.pop(),g({type:"text",value:d}),s=i[i.length-1];continue}if(d===Mb||d===Bb||d===$b){let m=d,E;for(t.keepQuotes!==!0&&(d="");u<l&&(E=y());){if(E===ki){d+=E+y();continue}if(E===m){t.keepQuotes===!0&&(d+=E);break}d+=E}g({type:"text",value:d});continue}if(d===Fb){p++;let E={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};s=g(E),i.push(s),g({type:"open",value:d});continue}if(d===jb){if(s.type!=="brace"){g({type:"text",value:d});continue}let m="close";s=i.pop(),s.close=!0,g({type:m,value:d}),p--,s=i[i.length-1];continue}if(d===Db&&p>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Pb(s)}]}g({type:"comma",value:d}),s.commas++;continue}if(d===Nb&&p>0&&s.commas===0){let m=s.nodes;if(p===0||m.length===0){g({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"){m.pop();let E=m[m.length-1];E.value+=a.value+d,a=E,s.ranges--;continue}g({type:"dot",value:d});continue}g({type:"text",value:d})}do if(s=i.pop(),s.type!=="root"){s.nodes.forEach(k=>{k.nodes||(k.type==="open"&&(k.isOpen=!0),k.type==="close"&&(k.isClose=!0),k.nodes||(k.type="text"),k.invalid=!0)});let m=i[i.length-1],E=m.nodes.indexOf(s);m.nodes.splice(E,1,...s.nodes)}while(i.length>0);return g({type:"eos"}),o};Bu.exports=Vb});var Uu=x((i0,Vu)=>{"use strict";var Gu=mn(),Ub=Pu(),Wb=Nu(),qb=Hu(),Re=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let o=Re.create(n,t);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Re.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Re.parse=(e,t={})=>qb(e,t);Re.stringify=(e,t={})=>Gu(typeof e=="string"?Re.parse(e,t):e,t);Re.compile=(e,t={})=>(typeof e=="string"&&(e=Re.parse(e,t)),Ub(e,t));Re.expand=(e,t={})=>{typeof e=="string"&&(e=Re.parse(e,t));let r=Wb(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Re.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Re.compile(e,t):Re.expand(e,t);Vu.exports=Re});var Ar=x((s0,zu)=>{"use strict";var Yb=M("path"),Je="\\\\/",Wu=`[^${Je}]`,Kb=0,st="\\.",zb="\\+",Xb="\\?",vn="\\/",Jb="(?=.)",qu="[^/]",wi=`(?:${vn}|$)`,Yu=`(?:^|${vn})`,Ci=`${st}{1,2}${wi}`,Qb=`(?!${st})`,Zb=`(?!${Yu}${Ci})`,e_=`(?!${st}{0,1}${wi})`,t_=`(?!${Ci})`,r_=`[^.${vn}]`,n_=`${qu}*?`,Ku={DOT_LITERAL:st,PLUS_LITERAL:zb,QMARK_LITERAL:Xb,SLASH_LITERAL:vn,ONE_CHAR:Jb,QMARK:qu,END_ANCHOR:wi,DOTS_SLASH:Ci,NO_DOT:Qb,NO_DOTS:Zb,NO_DOT_SLASH:e_,NO_DOTS_SLASH:t_,QMARK_NO_DOT:r_,STAR:n_,START_ANCHOR:Yu},o_={...Ku,SLASH_LITERAL:`[${Je}]`,QMARK:Wu,STAR:`${Wu}*?`,DOTS_SLASH:`${st}{1,2}(?:[${Je}]|$)`,NO_DOT:`(?!${st})`,NO_DOTS:`(?!(?:^|[${Je}])${st}{1,2}(?:[${Je}]|$))`,NO_DOT_SLASH:`(?!${st}{0,1}(?:[${Je}]|$))`,NO_DOTS_SLASH:`(?!${st}{1,2}(?:[${Je}]|$))`,QMARK_NO_DOT:`[^.${Je}]`,START_ANCHOR:`(?:^|[${Je}])`,END_ANCHOR:`(?:[${Je}]|$)`},i_={__proto__:null,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"};zu.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Kb,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:i_,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:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},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:Yb.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?o_:Ku}}});var Sr=x(ke=>{"use strict";var s_=M("path"),a_=process.platform==="win32",{REGEX_BACKSLASH:c_,REGEX_REMOVE_BACKSLASH:l_,REGEX_SPECIAL_CHARS:u_,REGEX_SPECIAL_CHARS_GLOBAL:p_}=Ar();ke.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ke.hasRegexChars=e=>u_.test(e);ke.isRegexChar=e=>e.length===1&&ke.hasRegexChars(e);ke.escapeRegex=e=>e.replace(p_,"\\$1");ke.toPosixSlashes=e=>e.replace(c_,"/");ke.removeBackslashes=e=>e.replace(l_,t=>t==="\\"?"":t);ke.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ke.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:a_===!0||s_.sep==="\\";ke.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?ke.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};ke.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ke.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${e})${o}`;return t.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var np=x((c0,rp)=>{"use strict";var Xu=Sr(),{CHAR_ASTERISK:Ai,CHAR_AT:d_,CHAR_BACKWARD_SLASH:Rr,CHAR_COMMA:f_,CHAR_DOT:Si,CHAR_EXCLAMATION_MARK:Ri,CHAR_FORWARD_SLASH:tp,CHAR_LEFT_CURLY_BRACE:Oi,CHAR_LEFT_PARENTHESES:Ti,CHAR_LEFT_SQUARE_BRACKET:h_,CHAR_PLUS:m_,CHAR_QUESTION_MARK:Ju,CHAR_RIGHT_CURLY_BRACE:g_,CHAR_RIGHT_PARENTHESES:Qu,CHAR_RIGHT_SQUARE_BRACKET:y_}=Ar(),Zu=e=>e===tp||e===Rr,ep=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},v_=(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,y=!1,g=!1,m=!1,E=!1,k=!1,S=!1,I=!1,de=!1,q=!1,T=0,L,w,F={value:"",depth:0,isGlob:!1},se=()=>l>=n,_=()=>c.charCodeAt(l+1),Q=()=>(L=w,c.charCodeAt(++l));for(;l<n;){w=Q();let ve;if(w===Rr){S=F.backslashes=!0,w=Q(),w===Oi&&(k=!0);continue}if(k===!0||w===Oi){for(T++;se()!==!0&&(w=Q());){if(w===Rr){S=F.backslashes=!0,Q();continue}if(w===Oi){T++;continue}if(k!==!0&&w===Si&&(w=Q())===Si){if(d=F.isBrace=!0,g=F.isGlob=!0,q=!0,o===!0)continue;break}if(k!==!0&&w===f_){if(d=F.isBrace=!0,g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===g_&&(T--,T===0)){k=!1,d=F.isBrace=!0,q=!0;break}}if(o===!0)continue;break}if(w===tp){if(i.push(l),s.push(F),F={value:"",depth:0,isGlob:!1},q===!0)continue;if(L===Si&&l===u+1){u+=2;continue}p=l+1;continue}if(r.noext!==!0&&(w===m_||w===d_||w===Ai||w===Ju||w===Ri)===!0&&_()===Ti){if(g=F.isGlob=!0,m=F.isExtglob=!0,q=!0,w===Ri&&l===u&&(de=!0),o===!0){for(;se()!==!0&&(w=Q());){if(w===Rr){S=F.backslashes=!0,w=Q();continue}if(w===Qu){g=F.isGlob=!0,q=!0;break}}continue}break}if(w===Ai){if(L===Ai&&(E=F.isGlobstar=!0),g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===Ju){if(g=F.isGlob=!0,q=!0,o===!0)continue;break}if(w===h_){for(;se()!==!0&&(ve=Q());){if(ve===Rr){S=F.backslashes=!0,Q();continue}if(ve===y_){y=F.isBracket=!0,g=F.isGlob=!0,q=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&w===Ri&&l===u){I=F.negated=!0,u++;continue}if(r.noparen!==!0&&w===Ti){if(g=F.isGlob=!0,o===!0){for(;se()!==!0&&(w=Q());){if(w===Ti){S=F.backslashes=!0,w=Q();continue}if(w===Qu){q=!0;break}}continue}break}if(g===!0){if(q=!0,o===!0)continue;break}}r.noext===!0&&(m=!1,g=!1);let z=c,ht="",v="";u>0&&(ht=c.slice(0,u),c=c.slice(u),p-=u),z&&g===!0&&p>0?(z=c.slice(0,p),v=c.slice(p)):g===!0?(z="",v=c):z=c,z&&z!==""&&z!=="/"&&z!==c&&Zu(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),r.unescape===!0&&(v&&(v=Xu.removeBackslashes(v)),z&&S===!0&&(z=Xu.removeBackslashes(z)));let b={prefix:ht,input:e,start:u,base:z,glob:v,isBrace:d,isBracket:y,isGlob:g,isExtglob:m,isGlobstar:E,negated:I,negatedExtglob:de};if(r.tokens===!0&&(b.maxDepth=0,Zu(w)||s.push(F),b.tokens=s),r.parts===!0||r.tokens===!0){let ve;for(let j=0;j<i.length;j++){let Ve=ve?ve+1:u,Ue=i[j],Ae=e.slice(Ve,Ue);r.tokens&&(j===0&&u!==0?(s[j].isPrefix=!0,s[j].value=ht):s[j].value=Ae,ep(s[j]),b.maxDepth+=s[j].depth),(j!==0||Ae!=="")&&a.push(Ae),ve=Ue}if(ve&&ve+1<e.length){let j=e.slice(ve+1);a.push(j),r.tokens&&(s[s.length-1].value=j,ep(s[s.length-1]),b.maxDepth+=s[s.length-1].depth)}b.slashes=i,b.parts=a}return b};rp.exports=v_});var cp=x((l0,ap)=>{"use strict";var Or=Ar(),me=Sr(),{MAX_LENGTH:bn,POSIX_REGEX_SOURCE:b_,REGEX_NON_SPECIAL_CHARS:__,REGEX_SPECIAL_CHARS_BACKREF:E_,REPLACEMENTS:op}=Or,x_=(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=>me.escapeRegex(o)).join("..")}return r},tr=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,ip=e=>{let t=[],r=0,n=0,o=0,i="",s=!1;for(let a of e){if(s===!0){i+=a,s=!1;continue}if(a==="\\"){i+=a,s=!0;continue}if(a==='"'){o=o===1?0:1,i+=a;continue}if(o===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){t.push(i),i="";continue}}}i+=a}return t.push(i),t},k_=e=>{let t=!1;for(let r of e){if(t===!0){t=!1;continue}if(r==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},sp=e=>{let t=e.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),r=!0);if(k_(t))return t.replace(/\\(.)/g,"$1")},w_=e=>{let t=e.map(sp).filter(Boolean);for(let r=0;r<t.length;r++)for(let n=r+1;n<t.length;n++){let o=t[r],i=t[n],s=o[0];if(!(!s||o!==s.repeat(o.length)||i!==s.repeat(i.length))&&(o===i||o.startsWith(i)||i.startsWith(o)))return!0}return!1},Pi=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let r=0,n=0,o=0,i=!1;for(let s=1;s<e.length;s++){let a=e[s];if(i===!0){i=!1;continue}if(a==="\\"){i=!0;continue}if(a==='"'){o=o===1?0:1;continue}if(o!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return t===!0&&s!==e.length-1?void 0:{type:e[0],body:e.slice(2,s),end:s}}}}},C_=e=>{let t=0,r=[];for(;t<e.length;){let o=Pi(e.slice(t),!1);if(!o||o.type!=="*")return;let i=ip(o.body).map(a=>a.trim());if(i.length!==1)return;let s=sp(i[0]);if(!s||s.length!==1)return;r.push(s),t+=o.end+1}return r.length<1?void 0:`${r.length===1?me.escapeRegex(r[0]):`[${r.map(o=>me.escapeRegex(o)).join("")}]`}*`},A_=e=>{let t=0,r=e.trim(),n=Pi(r);for(;n;)t++,r=n.body.trim(),n=Pi(r);return t},S_=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion=="number"?t.maxExtglobRecursion:Or.DEFAULT_MAX_EXTGLOB_RECURSION,n=ip(e).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||w_(n)))return{risky:!0};for(let o of n){let i=C_(o);if(i)return{risky:!0,safeOutput:i};if(A_(o)>r)return{risky:!0}}return{risky:!1}},$i=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=op[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(bn,r.maxLength):bn,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=me.isWindows(t),l=Or.globChars(c),u=Or.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:y,ONE_CHAR:g,DOTS_SLASH:m,NO_DOT:E,NO_DOT_SLASH:k,NO_DOTS_SLASH:S,QMARK:I,QMARK_NO_DOT:de,STAR:q,START_ANCHOR:T}=l,L=A=>`(${a}(?:(?!${T}${A.dot?m:p}).)*?)`,w=r.dot?"":E,F=r.dot?I:de,se=r.bash===!0?L(r):q;r.capture&&(se=`(${se})`),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=me.removePrefix(e,_),o=e.length;let Q=[],z=[],ht=[],v=i,b,ve=()=>_.index===o-1,j=_.peek=(A=1)=>e[_.index+A],Ve=_.advance=()=>e[++_.index]||"",Ue=()=>e.slice(_.index+1),Ae=(A="",Z=0)=>{_.consumed+=A,_.index+=Z},Ir=A=>{_.output+=A.output!=null?A.output:A.value,Ae(A.value)},vh=()=>{let A=1;for(;j()==="!"&&(j(2)!=="("||j(3)==="?");)Ve(),_.start++,A++;return A%2===0?!1:(_.negated=!0,_.start++,!0)},Fr=A=>{_[A]++,ht.push(A)},mt=A=>{_[A]--,ht.pop()},D=A=>{if(v.type==="globstar"){let Z=_.braces>0&&(A.type==="comma"||A.type==="brace"),C=A.extglob===!0||Q.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!Z&&!C&&(_.output=_.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=se,_.output+=v.output)}if(Q.length&&A.type!=="paren"&&(Q[Q.length-1].inner+=A.value),(A.value||A.output)&&Ir(A),v&&v.type==="text"&&A.type==="text"){v.value+=A.value,v.output=(v.output||"")+A.value;return}A.prev=v,s.push(A),v=A},jr=(A,Z)=>{let C={...u[Z],conditions:1,inner:""};C.prev=v,C.parens=_.parens,C.output=_.output,C.startIndex=_.index,C.tokensIndex=s.length;let $=(r.capture?"(":"")+C.open;Fr("parens"),D({type:A,value:Z,output:_.output?"":g}),D({type:"paren",extglob:!0,value:Ve(),output:$}),Q.push(C)},bh=A=>{let Z=e.slice(A.startIndex,_.index+1),C=e.slice(A.startIndex+2,_.index),$=S_(C,r);if((A.type==="plus"||A.type==="star")&&$.risky){let Y=$.safeOutput?(A.output?"":g)+(r.capture?`(${$.safeOutput})`:$.safeOutput):void 0,We=s[A.tokensIndex];We.type="text",We.value=Z,We.output=Y||me.escapeRegex(Z);for(let qe=A.tokensIndex+1;qe<s.length;qe++)s[qe].value="",s[qe].output="",delete s[qe].suffix;_.output=A.output+We.output,_.backtrack=!0,D({type:"paren",extglob:!0,value:b,output:""}),mt("parens");return}let X=A.close+(r.capture?")":""),ae;if(A.type==="negate"){let Y=se;if(A.inner&&A.inner.length>1&&A.inner.includes("/")&&(Y=L(r)),(Y!==se||ve()||/^\)+$/.test(Ue()))&&(X=A.close=`)$))${Y}`),A.inner.includes("*")&&(ae=Ue())&&/^\.[^\\/.]+$/.test(ae)){let We=$i(ae,{...t,fastpaths:!1}).output;X=A.close=`)${We})${Y})`}A.prev.type==="bos"&&(_.negatedExtglob=!0)}D({type:"paren",extglob:!0,value:b,output:X}),mt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let A=!1,Z=e.replace(E_,(C,$,X,ae,Y,We)=>ae==="\\"?(A=!0,C):ae==="?"?$?$+ae+(Y?I.repeat(Y.length):""):We===0?F+(Y?I.repeat(Y.length):""):I.repeat(X.length):ae==="."?p.repeat(X.length):ae==="*"?$?$+ae+(Y?se:""):se:$?C:`\\${C}`);return A===!0&&(r.unescape===!0?Z=Z.replace(/\\/g,""):Z=Z.replace(/\\+/g,C=>C.length%2===0?"\\\\":C?"\\":"")),Z===e&&r.contains===!0?(_.output=e,_):(_.output=me.wrapOutput(Z,_,t),_)}for(;!ve();){if(b=Ve(),b==="\0")continue;if(b==="\\"){let C=j();if(C==="/"&&r.bash!==!0||C==="."||C===";")continue;if(!C){b+="\\",D({type:"text",value:b});continue}let $=/^\\+/.exec(Ue()),X=0;if($&&$[0].length>2&&(X=$[0].length,_.index+=X,X%2!==0&&(b+="\\")),r.unescape===!0?b=Ve():b+=Ve(),_.brackets===0){D({type:"text",value:b});continue}}if(_.brackets>0&&(b!=="]"||v.value==="["||v.value==="[^")){if(r.posix!==!1&&b===":"){let C=v.value.slice(1);if(C.includes("[")&&(v.posix=!0,C.includes(":"))){let $=v.value.lastIndexOf("["),X=v.value.slice(0,$),ae=v.value.slice($+2),Y=b_[ae];if(Y){v.value=X+Y,_.backtrack=!0,Ve(),!i.output&&s.indexOf(v)===1&&(i.output=g);continue}}}(b==="["&&j()!==":"||b==="-"&&j()==="]")&&(b=`\\${b}`),b==="]"&&(v.value==="["||v.value==="[^")&&(b=`\\${b}`),r.posix===!0&&b==="!"&&v.value==="["&&(b="^"),v.value+=b,Ir({value:b});continue}if(_.quotes===1&&b!=='"'){b=me.escapeRegex(b),v.value+=b,Ir({value:b});continue}if(b==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&D({type:"text",value:b});continue}if(b==="("){Fr("parens"),D({type:"paren",value:b});continue}if(b===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(tr("opening","("));let C=Q[Q.length-1];if(C&&_.parens===C.parens+1){bh(Q.pop());continue}D({type:"paren",value:b,output:_.parens?")":"\\)"}),mt("parens");continue}if(b==="["){if(r.nobracket===!0||!Ue().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(tr("closing","]"));b=`\\${b}`}else Fr("brackets");D({type:"bracket",value:b});continue}if(b==="]"){if(r.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){D({type:"text",value:b,output:`\\${b}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(tr("opening","["));D({type:"text",value:b,output:`\\${b}`});continue}mt("brackets");let C=v.value.slice(1);if(v.posix!==!0&&C[0]==="^"&&!C.includes("/")&&(b=`/${b}`),v.value+=b,Ir({value:b}),r.literalBrackets===!1||me.hasRegexChars(C))continue;let $=me.escapeRegex(v.value);if(_.output=_.output.slice(0,-v.value.length),r.literalBrackets===!0){_.output+=$,v.value=$;continue}v.value=`(${a}${$}|${v.value})`,_.output+=v.value;continue}if(b==="{"&&r.nobrace!==!0){Fr("braces");let C={type:"brace",value:b,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};z.push(C),D(C);continue}if(b==="}"){let C=z[z.length-1];if(r.nobrace===!0||!C){D({type:"text",value:b,output:b});continue}let $=")";if(C.dots===!0){let X=s.slice(),ae=[];for(let Y=X.length-1;Y>=0&&(s.pop(),X[Y].type!=="brace");Y--)X[Y].type!=="dots"&&ae.unshift(X[Y].value);$=x_(ae,r),_.backtrack=!0}if(C.comma!==!0&&C.dots!==!0){let X=_.output.slice(0,C.outputIndex),ae=_.tokens.slice(C.tokensIndex);C.value=C.output="\\{",b=$="\\}",_.output=X;for(let Y of ae)_.output+=Y.output||Y.value}D({type:"brace",value:b,output:$}),mt("braces"),z.pop();continue}if(b==="|"){Q.length>0&&Q[Q.length-1].conditions++,D({type:"text",value:b});continue}if(b===","){let C=b,$=z[z.length-1];$&&ht[ht.length-1]==="braces"&&($.comma=!0,C="|"),D({type:"comma",value:b,output:C});continue}if(b==="/"){if(v.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",s.pop(),v=i;continue}D({type:"slash",value:b,output:y});continue}if(b==="."){if(_.braces>0&&v.type==="dot"){v.value==="."&&(v.output=p);let C=z[z.length-1];v.type="dots",v.output+=b,v.value+=b,C.dots=!0;continue}if(_.braces+_.parens===0&&v.type!=="bos"&&v.type!=="slash"){D({type:"text",value:b,output:p});continue}D({type:"dot",value:b,output:p});continue}if(b==="?"){if(!(v&&v.value==="(")&&r.noextglob!==!0&&j()==="("&&j(2)!=="?"){jr("qmark",b);continue}if(v&&v.type==="paren"){let $=j(),X=b;if($==="<"&&!me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test($)||$==="<"&&!/<([!=]|\w+>)/.test(Ue()))&&(X=`\\${b}`),D({type:"text",value:b,output:X});continue}if(r.dot!==!0&&(v.type==="slash"||v.type==="bos")){D({type:"qmark",value:b,output:de});continue}D({type:"qmark",value:b,output:I});continue}if(b==="!"){if(r.noextglob!==!0&&j()==="("&&(j(2)!=="?"||!/[!=<:]/.test(j(3)))){jr("negate",b);continue}if(r.nonegate!==!0&&_.index===0){vh();continue}}if(b==="+"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){jr("plus",b);continue}if(v&&v.value==="("||r.regex===!1){D({type:"plus",value:b,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||_.parens>0){D({type:"plus",value:b});continue}D({type:"plus",value:d});continue}if(b==="@"){if(r.noextglob!==!0&&j()==="("&&j(2)!=="?"){D({type:"at",extglob:!0,value:b,output:""});continue}D({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);let C=__.exec(Ue());C&&(b+=C[0],_.index+=C[0].length),D({type:"text",value:b});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=b,v.output=se,_.backtrack=!0,_.globstar=!0,Ae(b);continue}let A=Ue();if(r.noextglob!==!0&&/^\([^?]/.test(A)){jr("star",b);continue}if(v.type==="star"){if(r.noglobstar===!0){Ae(b);continue}let C=v.prev,$=C.prev,X=C.type==="slash"||C.type==="bos",ae=$&&($.type==="star"||$.type==="globstar");if(r.bash===!0&&(!X||A[0]&&A[0]!=="/")){D({type:"star",value:b,output:""});continue}let Y=_.braces>0&&(C.type==="comma"||C.type==="brace"),We=Q.length&&(C.type==="pipe"||C.type==="paren");if(!X&&C.type!=="paren"&&!Y&&!We){D({type:"star",value:b,output:""});continue}for(;A.slice(0,3)==="/**";){let qe=e[_.index+4];if(qe&&qe!=="/")break;A=A.slice(3),Ae("/**",3)}if(C.type==="bos"&&ve()){v.type="globstar",v.value+=b,v.output=L(r),_.output=v.output,_.globstar=!0,Ae(b);continue}if(C.type==="slash"&&C.prev.type!=="bos"&&!ae&&ve()){_.output=_.output.slice(0,-(C.output+v.output).length),C.output=`(?:${C.output}`,v.type="globstar",v.output=L(r)+(r.strictSlashes?")":"|$)"),v.value+=b,_.globstar=!0,_.output+=C.output+v.output,Ae(b);continue}if(C.type==="slash"&&C.prev.type!=="bos"&&A[0]==="/"){let qe=A[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(C.output+v.output).length),C.output=`(?:${C.output}`,v.type="globstar",v.output=`${L(r)}${y}|${y}${qe})`,v.value+=b,_.output+=C.output+v.output,_.globstar=!0,Ae(b+Ve()),D({type:"slash",value:"/",output:""});continue}if(C.type==="bos"&&A[0]==="/"){v.type="globstar",v.value+=b,v.output=`(?:^|${y}|${L(r)}${y})`,_.output=v.output,_.globstar=!0,Ae(b+Ve()),D({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-v.output.length),v.type="globstar",v.output=L(r),v.value+=b,_.output+=v.output,_.globstar=!0,Ae(b);continue}let Z={type:"star",value:b,output:se};if(r.bash===!0){Z.output=".*?",(v.type==="bos"||v.type==="slash")&&(Z.output=w+Z.output),D(Z);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&r.regex===!0){Z.output=b,D(Z);continue}(_.index===_.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(_.output+=k,v.output+=k):r.dot===!0?(_.output+=S,v.output+=S):(_.output+=w,v.output+=w),j()!=="*"&&(_.output+=g,v.output+=g)),D(Z)}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing","]"));_.output=me.escapeLast(_.output,"["),mt("brackets")}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing",")"));_.output=me.escapeLast(_.output,"("),mt("parens")}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(tr("closing","}"));_.output=me.escapeLast(_.output,"{"),mt("braces")}if(r.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&D({type:"maybe_slash",value:"",output:`${y}?`}),_.backtrack===!0){_.output="";for(let A of _.tokens)_.output+=A.output!=null?A.output:A.value,A.suffix&&(_.output+=A.suffix)}return _};$i.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(bn,r.maxLength):bn,o=e.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=op[e]||e;let i=me.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:y,START_ANCHOR:g}=Or.globChars(i),m=r.dot?p:u,E=r.dot?d:u,k=r.capture?"":"?:",S={negated:!1,prefix:""},I=r.bash===!0?".*?":y;r.capture&&(I=`(${I})`);let de=w=>w.noglobstar===!0?I:`(${k}(?:(?!${g}${w.dot?l:s}).)*?)`,q=w=>{switch(w){case"*":return`${m}${c}${I}`;case".*":return`${s}${c}${I}`;case"*.*":return`${m}${I}${s}${c}${I}`;case"*/*":return`${m}${I}${a}${c}${E}${I}`;case"**":return m+de(r);case"**/*":return`(?:${m}${de(r)}${a})?${E}${c}${I}`;case"**/*.*":return`(?:${m}${de(r)}${a})?${E}${I}${s}${c}${I}`;case"**/.*":return`(?:${m}${de(r)}${a})?${s}${c}${I}`;default:{let F=/^(.*?)\.(\w+)$/.exec(w);if(!F)return;let se=q(F[1]);return se?se+s+F[2]:void 0}}},T=me.removePrefix(e,S),L=q(T);return L&&r.strictSlashes!==!0&&(L+=`${a}?`),L};ap.exports=$i});var up=x((u0,lp)=>{"use strict";var R_=M("path"),O_=np(),Di=cp(),Ni=Sr(),T_=Ar(),P_=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 y of u){let g=y(d);if(g)return g}return!1}}let n=P_(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=Ni.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:y,output:g}=re.test(u,s,t,{glob:e,posix:i}),m={glob:e,state:a,regex:s,posix:i,input:u,output:g,match:y,isMatch:d};return typeof o.onResult=="function"&&o.onResult(m),d===!1?(m.isMatch=!1,p?m:!1):c(u)?(typeof o.onIgnore=="function"&&o.onIgnore(m),m.isMatch=!1,p?m:!1):(typeof o.onMatch=="function"&&o.onMatch(m),p?m:!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?Ni.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=Ni.isWindows(r))=>(t instanceof RegExp?t:re.makeRe(t,r)).test(R_.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)):Di(e,{...t,fastpaths:!1});re.scan=(e,t)=>O_(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=Di.fastpaths(e,t)),o.output||(o=Di(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=T_;lp.exports=re});var dp=x((p0,pp)=>{"use strict";pp.exports=up()});var vp=x((d0,yp)=>{"use strict";var hp=M("util"),mp=Uu(),Qe=dp(),Li=Sr(),fp=e=>e===""||e==="./",gp=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(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=Qe(String(t[u]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&s++;for(let y of e){let g=p(y,!0);(d?!g.isMatch:g.isMatch)&&(d?n.add(g.output):(n.delete(g.output),o.add(g.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};J.match=J;J.matcher=(e,t)=>Qe(e,t);J.isMatch=(e,t,r)=>Qe(t,r)(e);J.any=J.isMatch;J.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(J(e,t,{...r,onResult:i}));for(let a of o)s.has(a)||n.add(a);return[...n]};J.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${hp.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>J.contains(e,n,r));if(typeof t=="string"){if(fp(e)||fp(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...r,contains:!0})};J.matchKeys=(e,t,r)=>{if(!Li.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=J(Object.keys(e),t,r),o={};for(let i of n)o[i]=e[i];return o};J.some=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(n.some(s=>i(s)))return!0}return!1};J.every=(e,t,r)=>{let n=[].concat(e);for(let o of[].concat(t)){let i=Qe(String(o),r);if(!n.every(s=>i(s)))return!1}return!0};J.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${hp.inspect(e)}"`);return[].concat(t).every(n=>Qe(n,r)(e))};J.capture=(e,t,r)=>{let n=Li.isWindows(r),i=Qe.makeRe(String(e),{...r,capture:!0}).exec(n?Li.toPosixSlashes(t):t);if(i)return i.slice(1).map(s=>s===void 0?"":s)};J.makeRe=(...e)=>Qe.makeRe(...e);J.scan=(...e)=>Qe.scan(...e);J.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let o of mp(String(n),t))r.push(Qe.parse(o,t));return r};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!gp(e)?[e]:mp(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=gp;yp.exports=J});var Rp=x(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 bp=M("path"),$_=cu(),Ii=vp(),_p="**",D_="\\",N_=/[*?]|^!/,L_=/\[[^[]*]/,I_=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,F_=/[!*+?@]\([^(]*\)/,j_=/,|\.\./,M_=/(?!^)\/{2,}/g;function Ep(e,t={}){return!xp(e,t)}O.isStaticPattern=Ep;function xp(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(D_)||N_.test(e)||L_.test(e)||I_.test(e)||t.extglob!==!1&&F_.test(e)||t.braceExpansion!==!1&&B_(e))}O.isDynamicPattern=xp;function B_(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 j_.test(n)}function H_(e){return _n(e)?e.slice(1):e}O.convertToPositivePattern=H_;function G_(e){return"!"+e}O.convertToNegativePattern=G_;function _n(e){return e.startsWith("!")&&e[1]!=="("}O.isNegativePattern=_n;function kp(e){return!_n(e)}O.isPositivePattern=kp;function V_(e){return e.filter(_n)}O.getNegativePatterns=V_;function U_(e){return e.filter(kp)}O.getPositivePatterns=U_;function W_(e){return e.filter(t=>!Fi(t))}O.getPatternsInsideCurrentDirectory=W_;function q_(e){return e.filter(Fi)}O.getPatternsOutsideCurrentDirectory=q_;function Fi(e){return e.startsWith("..")||e.startsWith("./..")}O.isPatternRelatedToParentDirectory=Fi;function Y_(e){return $_(e,{flipBackslashes:!1})}O.getBaseDirectory=Y_;function K_(e){return e.includes(_p)}O.hasGlobStar=K_;function wp(e){return e.endsWith("/"+_p)}O.endsWithSlashGlobStar=wp;function z_(e){let t=bp.basename(e);return wp(e)||Ep(t)}O.isAffectDepthOfReadingPattern=z_;function X_(e){return e.reduce((t,r)=>t.concat(Cp(r)),[])}O.expandPatternsWithBraceExpansion=X_;function Cp(e){let t=Ii.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}O.expandBraceExpansion=Cp;function J_(e,t){let{parts:r}=Ii.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=J_;function Ap(e,t){return Ii.makeRe(e,t)}O.makeRe=Ap;function Q_(e,t){return e.map(r=>Ap(r,t))}O.convertPatternsToRe=Q_;function Z_(e,t){return t.some(r=>r.test(e))}O.matchAny=Z_;function eE(e){return e.replace(M_,"/")}O.removeDuplicateSlashes=eE;function tE(e){let t=[],r=[];for(let n of e)Sp(n)?t.push(n):r.push(n);return[t,r]}O.partitionAbsoluteAndRelative=tE;function Sp(e){return bp.isAbsolute(e)}O.isAbsolute=Sp});var $p=x((h0,Pp)=>{"use strict";var rE=M("stream"),Op=rE.PassThrough,nE=Array.prototype.slice;Pp.exports=oE;function oE(){let e=[],t=nE.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=Op(n);function a(){for(let u=0,p=arguments.length;u<p;u++)e.push(Tp(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 y(g){function m(){g.removeListener("merge2UnpipeEnd",m),g.removeListener("end",m),i&&g.removeListener("error",E),d()}function E(k){s.emit("error",k)}if(g._readableState.endEmitted)return d();g.on("merge2UnpipeEnd",m),g.on("end",m),i&&g.on("error",E),g.pipe(s,{end:!1}),g.resume()}for(let g=0;g<u.length;g++)y(u[g]);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 Tp(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=Tp(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(Op(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var Np=x(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.merge=void 0;var iE=$p();function sE(e){let t=iE(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>Dp(e)),t.once("end",()=>Dp(e)),t}En.merge=sE;function Dp(e){e.forEach(t=>t.emit("close"))}});var Lp=x(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.isEmpty=rr.isString=void 0;function aE(e){return typeof e=="string"}rr.isString=aE;function cE(e){return e===""}rr.isEmpty=cE});var at=x(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.string=ge.stream=ge.pattern=ge.path=ge.fs=ge.errno=ge.array=void 0;var lE=zl();ge.array=lE;var uE=Xl();ge.errno=uE;var pE=Jl();ge.fs=pE;var dE=tu();ge.path=dE;var fE=Rp();ge.pattern=fE;var hE=Np();ge.stream=hE;var mE=Lp();ge.string=mE});var Mp=x(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.convertPatternGroupToTask=ye.convertPatternGroupsToTasks=ye.groupPatternsByBaseDirectory=ye.getNegativePatternsAsPositive=ye.getPositivePatterns=ye.convertPatternsToTasks=ye.generate=void 0;var Me=at();function gE(e,t){let r=Ip(e,t),n=Ip(t.ignore,t),o=Fp(r),i=jp(r,n),s=o.filter(u=>Me.pattern.isStaticPattern(u,t)),a=o.filter(u=>Me.pattern.isDynamicPattern(u,t)),c=ji(s,i,!1),l=ji(a,i,!0);return c.concat(l)}ye.generate=gE;function Ip(e,t){let r=e;return t.braceExpansion&&(r=Me.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>Me.pattern.removeDuplicateSlashes(n))}function ji(e,t,r){let n=[],o=Me.pattern.getPatternsOutsideCurrentDirectory(e),i=Me.pattern.getPatternsInsideCurrentDirectory(e),s=Mi(o),a=Mi(i);return n.push(...Bi(s,t,r)),"."in a?n.push(Hi(".",i,t,r)):n.push(...Bi(a,t,r)),n}ye.convertPatternsToTasks=ji;function Fp(e){return Me.pattern.getPositivePatterns(e)}ye.getPositivePatterns=Fp;function jp(e,t){return Me.pattern.getNegativePatterns(e).concat(t).map(Me.pattern.convertToPositivePattern)}ye.getNegativePatternsAsPositive=jp;function Mi(e){let t={};return e.reduce((r,n)=>{let o=Me.pattern.getBaseDirectory(n);return o in r?r[o].push(n):r[o]=[n],r},t)}ye.groupPatternsByBaseDirectory=Mi;function Bi(e,t,r){return Object.keys(e).map(n=>Hi(n,e[n],t,r))}ye.convertPatternGroupsToTasks=Bi;function Hi(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(Me.pattern.convertToNegativePattern))}}ye.convertPatternGroupToTask=Hi});var Hp=x(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.read=void 0;function yE(e,t,r){t.fs.lstat(e,(n,o)=>{if(n!==null){Bp(r,n);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){Gi(r,o);return}t.fs.stat(e,(i,s)=>{if(i!==null){if(t.throwErrorOnBrokenSymbolicLink){Bp(r,i);return}Gi(r,o);return}t.markSymbolicLink&&(s.isSymbolicLink=()=>!0),Gi(r,s)})})}xn.read=yE;function Bp(e,t){e(t)}function Gi(e,t){e(null,t)}});var Gp=x(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.read=void 0;function vE(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}}kn.read=vE});var Vp=x(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.createFileSystemAdapter=Et.FILE_SYSTEM_ADAPTER=void 0;var wn=M("fs");Et.FILE_SYSTEM_ADAPTER={lstat:wn.lstat,stat:wn.stat,lstatSync:wn.lstatSync,statSync:wn.statSync};function bE(e){return e===void 0?Et.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Et.FILE_SYSTEM_ADAPTER),e)}Et.createFileSystemAdapter=bE});var Up=x(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});var _E=Vp(),Vi=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=_E.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=Vi});var Lt=x(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.statSync=xt.stat=xt.Settings=void 0;var Wp=Hp(),EE=Gp(),Wi=Up();xt.Settings=Wi.default;function xE(e,t,r){if(typeof t=="function"){Wp.read(e,qi(),t);return}Wp.read(e,qi(t),r)}xt.stat=xE;function kE(e,t){let r=qi(t);return EE.read(e,r)}xt.statSync=kE;function qi(e={}){return e instanceof Wi.default?e:new Wi.default(e)}});var Kp=x((w0,Yp)=>{var qp;Yp.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(qp||(qp=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var Xp=x((C0,zp)=>{zp.exports=CE;var wE=Kp();function CE(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?wE(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 Yi=x(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Cn=process.versions.node.split(".");if(Cn[0]===void 0||Cn[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Jp=Number.parseInt(Cn[0],10),AE=Number.parseInt(Cn[1],10),Qp=10,SE=10,RE=Jp>Qp,OE=Jp===Qp&&AE>=SE;An.IS_SUPPORT_READDIR_WITH_FILE_TYPES=RE||OE});var Zp=x(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.createDirentFromStats=void 0;var Ki=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 TE(e,t){return new Ki(e,t)}Sn.createDirentFromStats=TE});var zi=x(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.fs=void 0;var PE=Zp();Rn.fs=PE});var Xi=x(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.joinPathSegments=void 0;function $E(e,t,r){return e.endsWith(r)?e+t:e+r+t}On.joinPathSegments=$E});var id=x(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.readdir=kt.readdirWithFileTypes=kt.read=void 0;var DE=Lt(),ed=Xp(),NE=Yi(),td=zi(),rd=Xi();function LE(e,t,r){if(!t.stats&&NE.IS_SUPPORT_READDIR_WITH_FILE_TYPES){nd(e,t,r);return}od(e,t,r)}kt.read=LE;function nd(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,o)=>{if(n!==null){Tn(r,n);return}let i=o.map(a=>({dirent:a,name:a.name,path:rd.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){Ji(r,i);return}let s=i.map(a=>IE(a,t));ed(s,(a,c)=>{if(a!==null){Tn(r,a);return}Ji(r,c)})})}kt.readdirWithFileTypes=nd;function IE(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=td.fs.createDirentFromStats(e.name,o),r(null,e)})}}function od(e,t,r){t.fs.readdir(e,(n,o)=>{if(n!==null){Tn(r,n);return}let i=o.map(s=>{let a=rd.joinPathSegments(e,s,t.pathSegmentSeparator);return c=>{DE.stat(a,t.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let p={name:s,path:a,dirent:td.fs.createDirentFromStats(s,u)};t.stats&&(p.stats=u),c(null,p)})}});ed(i,(s,a)=>{if(s!==null){Tn(r,s);return}Ji(r,a)})})}kt.readdir=od;function Tn(e,t){e(t)}function Ji(e,t){e(null,t)}});var ud=x(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.readdir=wt.readdirWithFileTypes=wt.read=void 0;var FE=Lt(),jE=Yi(),sd=zi(),ad=Xi();function ME(e,t){return!t.stats&&jE.IS_SUPPORT_READDIR_WITH_FILE_TYPES?cd(e,t):ld(e,t)}wt.read=ME;function cd(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let o={dirent:n,name:n.name,path:ad.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let i=t.fs.statSync(o.path);o.dirent=sd.fs.createDirentFromStats(o.name,i)}catch(i){if(t.throwErrorOnBrokenSymbolicLink)throw i}return o})}wt.readdirWithFileTypes=cd;function ld(e,t){return t.fs.readdirSync(e).map(n=>{let o=ad.joinPathSegments(e,n,t.pathSegmentSeparator),i=FE.statSync(o,t.fsStatSettings),s={name:n,path:o,dirent:sd.fs.createDirentFromStats(n,i)};return t.stats&&(s.stats=i),s})}wt.readdir=ld});var pd=x(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.createFileSystemAdapter=Ct.FILE_SYSTEM_ADAPTER=void 0;var nr=M("fs");Ct.FILE_SYSTEM_ADAPTER={lstat:nr.lstat,stat:nr.stat,lstatSync:nr.lstatSync,statSync:nr.statSync,readdir:nr.readdir,readdirSync:nr.readdirSync};function BE(e){return e===void 0?Ct.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ct.FILE_SYSTEM_ADAPTER),e)}Ct.createFileSystemAdapter=BE});var dd=x(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});var HE=M("path"),GE=Lt(),VE=pd(),Qi=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=VE.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,HE.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new GE.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Zi.default=Qi});var Pn=x(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.Settings=At.scandirSync=At.scandir=void 0;var fd=id(),UE=ud(),es=dd();At.Settings=es.default;function WE(e,t,r){if(typeof t=="function"){fd.read(e,ts(),t);return}fd.read(e,ts(t),r)}At.scandir=WE;function qE(e,t){let r=ts(t);return UE.read(e,r)}At.scandirSync=qE;function ts(e={}){return e instanceof es.default?e:new es.default(e)}});var md=x((L0,hd)=>{"use strict";function YE(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}}hd.exports=YE});var yd=x((I0,rs)=>{"use strict";var KE=md();function gd(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=KE(zE),o=null,i=null,s=0,a=null,c={push:m,drain:we,saturated:we,pause:u,paused:!1,get concurrency(){return r},set concurrency(T){if(!(T>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=T,!c.paused)for(;o&&s<r;)s++,k()},running:l,resume:y,idle:g,length:p,getQueue:d,unshift:E,empty:we,kill:S,killAndDrain:I,error:q,abort:de};return c;function l(){return s}function u(){c.paused=!0}function p(){for(var T=o,L=0;T;)T=T.next,L++;return L}function d(){for(var T=o,L=[];T;)L.push(T.value),T=T.next;return L}function y(){if(c.paused){if(c.paused=!1,o===null){s++,k();return}for(;o&&s<r;)s++,k()}}function g(){return s===0&&c.length()===0}function m(T,L){var w=n.get();w.context=e,w.release=k,w.value=T,w.callback=L||we,w.errorHandler=a,s>=r||c.paused?i?(i.next=w,i=w):(o=w,i=w,c.saturated()):(s++,t.call(e,w.value,w.worked))}function E(T,L){var w=n.get();w.context=e,w.release=k,w.value=T,w.callback=L||we,w.errorHandler=a,s>=r||c.paused?o?(w.next=o,o=w):(o=w,i=w,c.saturated()):(s++,t.call(e,w.value,w.worked))}function k(T){T&&n.release(T);var L=o;L&&s<=r?c.paused?s--:(i===o&&(i=null),o=L.next,L.next=null,t.call(e,L.value,L.worked),i===null&&c.empty()):--s===0&&c.drain()}function S(){o=null,i=null,c.drain=we}function I(){o=null,i=null,c.drain(),c.drain=we}function de(){var T=o;for(o=null,i=null;T;){var L=T.next,w=T.callback,F=T.errorHandler,se=T.value,_=T.context;T.value=null,T.callback=we,T.errorHandler=null,F&&F(new Error("abort"),se),w.call(_,new Error("abort")),T.release(T),T=L}c.drain=we}function q(T){a=T}}function we(){}function zE(){this.value=null,this.callback=we,this.next=null,this.release=we,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=we,e.errorHandler&&i(r,s),o.call(e.context,r,n),e.release(e)}}function XE(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=gd(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,y){i(u,function(g,m){if(g){y(g);return}d(m)})});return p.catch(we),p}function c(u){var p=new Promise(function(d,y){s(u,function(g,m){if(g){y(g);return}d(m)})});return p.catch(we),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}}rs.exports=gd;rs.exports.promise=XE});var $n=x(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.joinPathSegments=Ze.replacePathSegmentSeparator=Ze.isAppliedFilter=Ze.isFatalError=void 0;function JE(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}Ze.isFatalError=JE;function QE(e,t){return e===null||e(t)}Ze.isAppliedFilter=QE;function ZE(e,t){return e.split(/[/\\]/).join(t)}Ze.replacePathSegmentSeparator=ZE;function ex(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}Ze.joinPathSegments=ex});var is=x(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var tx=$n(),ns=class{constructor(t,r){this._root=t,this._settings=r,this._root=tx.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};os.default=ns});var cs=x(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var rx=M("events"),nx=Pn(),ox=yd(),Dn=$n(),ix=is(),ss=class extends ix.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=nx.scandir,this._emitter=new rx.EventEmitter,this._queue=ox(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||!Dn.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=Dn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Dn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Dn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};as.default=ss});var vd=x(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var sx=cs(),ls=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new sx.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{ax(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{cx(t,this._storage)}),this._reader.read()}};us.default=ls;function ax(e,t){e(t)}function cx(e,t){e(null,t)}});var bd=x(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var lx=M("stream"),ux=cs(),ps=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new ux.default(this._root,this._settings),this._stream=new lx.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}};ds.default=ps});var _d=x(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var px=Pn(),Nn=$n(),dx=is(),fs=class extends dx.default{constructor(){super(...arguments),this._scandir=px.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(Nn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=Nn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Nn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&Nn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};hs.default=fs});var Ed=x(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var fx=_d(),ms=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new fx.default(this._root,this._settings)}read(){return this._reader.read()}};gs.default=ms});var xd=x(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var hx=M("path"),mx=Pn(),ys=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,hx.sep),this.fsScandirSettings=new mx.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}};vs.default=ys});var In=x(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.Settings=et.walkStream=et.walkSync=et.walk=void 0;var kd=vd(),gx=bd(),yx=Ed(),bs=xd();et.Settings=bs.default;function vx(e,t,r){if(typeof t=="function"){new kd.default(e,Ln()).read(t);return}new kd.default(e,Ln(t)).read(r)}et.walk=vx;function bx(e,t){let r=Ln(t);return new yx.default(e,r).read()}et.walkSync=bx;function _x(e,t){let r=Ln(t);return new gx.default(e,r).read()}et.walkStream=_x;function Ln(e={}){return e instanceof bs.default?e:new bs.default(e)}});var Fn=x(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});var Ex=M("path"),xx=Lt(),wd=at(),_s=class{constructor(t){this._settings=t,this._fsStatSettings=new xx.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return Ex.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:wd.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!wd.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};Es.default=_s});var ws=x(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var kx=M("stream"),wx=Lt(),Cx=In(),Ax=Fn(),xs=class extends Ax.default{constructor(){super(...arguments),this._walkStream=Cx.walkStream,this._stat=wx.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),o=new kx.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))})}};ks.default=xs});var Cd=x(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var Sx=In(),Rx=Fn(),Ox=ws(),Cs=class extends Rx.default{constructor(){super(...arguments),this._walkAsync=Sx.walk,this._readerStream=new Ox.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))})}};As.default=Cs});var Ad=x(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});var Tr=at(),Ss=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 Tr.pattern.getPatternParts(t,this._micromatchOptions).map(n=>Tr.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Tr.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return Tr.array.splitWhen(t,r=>r.dynamic&&Tr.pattern.hasGlobStar(r.pattern))}};Rs.default=Ss});var Sd=x(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});var Tx=Ad(),Os=class extends Tx.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}};Ts.default=Os});var Rd=x($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var jn=at(),Px=Sd(),Ps=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 Px.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(jn.pattern.isAffectDepthOfReadingPattern);return jn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,o){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let i=jn.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!jn.pattern.matchAny(t,r)}};$s.default=Ps});var Od=x(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var St=at(),Ds=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,o]=St.pattern.partitionAbsoluteAndRelative(r),i={positive:{all:St.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:St.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:St.pattern.convertPatternsToRe(o,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,i)}_filter(t,r){let n=St.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=St.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(o,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let o=St.pattern.matchAny(t,r);return!o&&n?St.pattern.matchAny(t+"/",r):o}};Ns.default=Ds});var Td=x(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});var $x=at(),Ls=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return $x.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};Is.default=Ls});var $d=x(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var Pd=at(),Fs=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=Pd.path.makeAbsolute(this._settings.cwd,r),r=Pd.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};js.default=Fs});var Mn=x(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});var Dx=M("path"),Nx=Rd(),Lx=Od(),Ix=Td(),Fx=$d(),Ms=class{constructor(t){this._settings=t,this.errorFilter=new Ix.default(this._settings),this.entryFilter=new Lx.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Nx.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Fx.default(this._settings)}_getRootDirectory(t){return Dx.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}}};Bs.default=Ms});var Dd=x(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});var jx=Cd(),Mx=Mn(),Hs=class extends Mx.default{constructor(){super(...arguments),this._reader=new jx.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)}};Gs.default=Hs});var Nd=x(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var Bx=M("stream"),Hx=ws(),Gx=Mn(),Vs=class extends Gx.default{constructor(){super(...arguments),this._reader=new Hx.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),o=this.api(r,t,n),i=new Bx.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=Vs});var Ld=x(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});var Vx=Lt(),Ux=In(),Wx=Fn(),Ws=class extends Wx.default{constructor(){super(...arguments),this._walkSync=Ux.walkSync,this._statSync=Vx.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)}};qs.default=Ws});var Id=x(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});var qx=Ld(),Yx=Mn(),Ys=class extends Yx.default{constructor(){super(...arguments),this._reader=new qx.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)}};Ks.default=Ys});var Fd=x(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var or=M("fs"),Kx=M("os"),zx=Math.max(Kx.cpus().length,1);ir.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:or.lstat,lstatSync:or.lstatSync,stat:or.stat,statSync:or.statSync,readdir:or.readdir,readdirSync:or.readdirSync};var zs=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,zx),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({},ir.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};ir.default=zs});var Bn=x((aR,Md)=>{"use strict";var jd=Mp(),Xx=Dd(),Jx=Nd(),Qx=Id(),Xs=Fd(),Ne=at();async function Js(e,t){Be(e);let r=Qs(e,Xx.default,t),n=await Promise.all(r);return Ne.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(l,u){Be(l);let p=Qs(l,Qx.default,u);return Ne.array.flatten(p)}e.sync=t;function r(l,u){Be(l);let p=Qs(l,Jx.default,u);return Ne.stream.merge(p)}e.stream=r;function n(l,u){Be(l);let p=[].concat(l),d=new Xs.default(u);return jd.generate(p,d)}e.generateTasks=n;function o(l,u){Be(l);let p=new Xs.default(u);return Ne.pattern.isDynamicPattern(l,p)}e.isDynamicPattern=o;function i(l){return Be(l),Ne.path.escape(l)}e.escapePath=i;function s(l){return Be(l),Ne.path.convertPathToPattern(l)}e.convertPathToPattern=s;let a;(function(l){function u(d){return Be(d),Ne.path.escapePosixPath(d)}l.escapePath=u;function p(d){return Be(d),Ne.path.convertPosixPathToPattern(d)}l.convertPathToPattern=p})(a=e.posix||(e.posix={}));let c;(function(l){function u(d){return Be(d),Ne.path.escapeWindowsPath(d)}l.escapePath=u;function p(d){return Be(d),Ne.path.convertWindowsPathToPattern(d)}l.convertPathToPattern=p})(c=e.win32||(e.win32={}))})(Js||(Js={}));function Qs(e,t,r){let n=[].concat(e),o=new Xs.default(r),i=jd.generate(n,o),s=new t(o);return i.map(s.read,s)}function Be(e){if(![].concat(e).every(n=>Ne.string.isString(n)&&!Ne.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}Md.exports=Js});var Bd=gt(()=>{});import{promisify as Zx}from"node:util";import{execFile as ek,execFileSync as pR}from"node:child_process";import{fileURLToPath as tk}from"node:url";function Pr(e){return e instanceof URL?tk(e):e}var fR,hR,Zs=gt(()=>{Bd();fR=Zx(ek);hR=10*1024*1024});var zd=x((yR,Vn)=>{function Vd(e){return Array.isArray(e)?e:[e]}var rk=void 0,ta="",Hd=" ",ea="\\",nk=/^\s+$/,ok=/(?:[^\\]|^)\\$/,ik=/^\\!/,sk=/^\\#/,ak=/\r?\n/g,ck=/^\.{0,2}\/|^\.{1,2}$/,lk=/\/$/,sr="/",Ud="node-ignore";typeof Symbol<"u"&&(Ud=Symbol.for("node-ignore"));var Wd=Ud,ar=(e,t,r)=>(Object.defineProperty(e,t,{value:r}),r),uk=/([0-z])-([0-z])/g,qd=()=>!1,pk=e=>e.replace(uk,(t,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?t:ta),dk=e=>{let{length:t}=e;return e.slice(0,t-t%2)},fk=[[/^\uFEFF/,()=>ta],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,r)=>t+(r.indexOf("\\")===0?Hd:ta)],[/(\\+?)\s/g,(e,t)=>{let{length:r}=t;return t.slice(0,r-r%2)+Hd}],[/[\\$.|*+(){^]/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,()=>ea],[/\\\\/g,()=>ea],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,r,n,o)=>t===ea?`\\[${r}${dk(n)}${o}`:o==="]"&&n.length%2===0?`[${pk(r)}${n}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],hk=/(^|\\\/)?\\\*$/,$r="regex",Hn="checkRegex",Gd="_",mk={[$r](e,t){return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Hn](e,t){return`${t?`${t}[^/]*`:"[^/]*"}(?=$|\\/$)`}},gk=e=>fk.reduce((t,[r,n])=>t.replace(r,n.bind(e)),e),Gn=e=>typeof e=="string",yk=e=>e&&Gn(e)&&!nk.test(e)&&!ok.test(e)&&e.indexOf("#")!==0,vk=e=>e.split(ak).filter(Boolean),ra=class{constructor(t,r,n,o,i,s){this.pattern=t,this.mark=r,this.negative=i,ar(this,"body",n),ar(this,"ignoreCase",o),ar(this,"regexPrefix",s)}get regex(){let t=Gd+$r;return this[t]?this[t]:this._make($r,t)}get checkRegex(){let t=Gd+Hn;return this[t]?this[t]:this._make(Hn,t)}_make(t,r){let n=this.regexPrefix.replace(hk,mk[t]),o=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return ar(this,r,o)}},bk=({pattern:e,mark:t},r)=>{let n=!1,o=e;o.indexOf("!")===0&&(n=!0,o=o.substr(1)),o=o.replace(ik,"!").replace(sk,"#");let i=gk(o);return new ra(e,t,o,r,n,i)},na=class{constructor(t){this._ignoreCase=t,this._rules=[]}_add(t){if(t&&t[Wd]){this._rules=this._rules.concat(t._rules._rules),this._added=!0;return}if(Gn(t)&&(t={pattern:t}),yk(t.pattern)){let r=bk(t,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(t){return this._added=!1,Vd(Gn(t)?vk(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?rk:c)});let a={ignored:o,unignored:i};return s&&(a.rule=s),a}},_k=(e,t)=>{throw new t(e)},ct=(e,t,r)=>Gn(e)?e?ct.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),Yd=e=>ck.test(e);ct.isNotRelative=Yd;ct.convert=e=>e;var oa=class{constructor({ignorecase:t=!0,ignoreCase:r=t,allowRelativePaths:n=!1}={}){ar(this,Wd,!0),this._rules=new na(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&&ct.convert(t);return ct(i,t,this._strictPathCheck?_k:qd),this._t(i,r,n,o)}checkIgnore(t){if(!lk.test(t))return this.test(t);let r=t.split(sr).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(sr)+sr,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(t,!1,Hn)}_t(t,r,n,o){if(t in r)return r[t];if(o||(o=t.split(sr).filter(Boolean)),o.pop(),!o.length)return r[t]=this._rules.test(t,n,$r);let i=this._t(o.join(sr)+sr,r,n,o);return r[t]=i.ignored?i:this._rules.test(t,n,$r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return Vd(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},ia=e=>new oa(e),Ek=e=>ct(e&&ct.convert(e),e,qd),Kd=()=>{let e=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");ct.convert=e;let t=/^[a-z]:\//i;ct.isNotRelative=r=>t.test(r)||Yd(r)};typeof process<"u"&&process.platform==="win32"&&Kd();Vn.exports=ia;ia.default=ia;Vn.exports.isPathValid=Ek;ar(Vn.exports,Symbol.for("setupWindows"),Kd)});import sa from"node:path";function Dr(e,t){let r=sa.relative(t,e);return!!(r&&r!==".."&&!r.startsWith(`..${sa.sep}`)&&r!==sa.resolve(e))}var aa=gt(()=>{});function Un(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}var Xd=gt(()=>{});import Jd from"node:fs";import Oe from"node:path";import{promisify as xk}from"node:util";var ca,He,kk,wk,la,Qd,Ce,Wn,ua,Ck,qn,Ak,Sk,Zd,pa,Rk,Ok,da,Tk,ef,Pk,tf,fa,ha=gt(()=>{ca=Mt(Bn(),1);aa();He=e=>e[0]==="!",kk=e=>{if(!e.startsWith("/"))return e;let t=e.slice(1),r=t.indexOf("/"),n=r>0?t.slice(0,r):t;return r>0&&!ca.default.isDynamicPattern(n)?e:t},wk=(e,t)=>t===e,la=e=>{if(!Oe.isAbsolute(e))return;let t=[];for(let r of e.split("/"))if(r){if(ca.default.isDynamicPattern(r))break;t.push(r)}return t.length===0?void 0:`/${t.join("/")}`},Qd=(e,t=[],r=!1)=>{if(!e.startsWith("/"))return e;let n=kk(e);if(n!==e)return n;if(r)return e.slice(1);let o=la(e);return o!==void 0&&t.some(s=>wk(s,o))?e:e.slice(1)},Ce=(e,t)=>{let r=e?.[t];return typeof r=="function"?r.bind(e):void 0},Wn=(e,t)=>{let r=e?.[t];if(typeof r=="function")return xk(r.bind(e))},ua=e=>{if(!e.endsWith("/"))return e;let t=e.replace(/\/+$/u,"");if(!t)return"/**";if(t==="**")return"**/**";let r=t.startsWith("/"),o=(r?t.slice(1):t).includes("/");return`${!r&&!o&&!t.startsWith("**/")?"**/":""}${t}/**`},Ck=e=>{let r=(He(e)?e.slice(1):e).match(/^(\.\.\/)+/);return r?r[0]:""},qn=(e,t)=>{if(e.length===0||t.length===0)return t;let r=e.map(i=>Ck(i)),n=r[0];return!n||!r.every(i=>i===n)?t:t.map(i=>i.startsWith("**/")&&!i.startsWith("../")?n+i:i)},Ak=e=>Ce(e?.promises,"stat")??Ce(Jd.promises,"stat"),Sk=e=>Ce(e||Jd,"statSync"),Zd=e=>!!(e?.isDirectory?.()||e?.isFile?.()),pa=(e,t)=>{let r=[],n=e;for(r.push(n);n!==t;){let o=Oe.dirname(n);if(o===n)break;n=o,r.push(n)}return r},Rk=async(e,t)=>{for(let r of e){let n=Oe.join(r,".git");try{let o=await t(n);if(Zd(o))return r}catch{}}},Ok=(e,t)=>{let r=Sk(t);if(!r)return;let n=Oe.resolve(e),{root:o}=Oe.parse(n),i=pa(n,o);for(let s of i){let a=Oe.join(s,".git");try{let c=r(a);if(Zd(c))return s}catch{}}},da=(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return Ok(e,t)},Tk=async(e,t)=>{let r=Ak(t);if(!r)return da(e,t);let n=Oe.resolve(e),{root:o}=Oe.parse(n),i=pa(n,o);return Rk(i,r)},ef=async(e,t)=>{if(typeof e!="string")throw new TypeError("cwd must be a string");return Tk(e,t)},Pk=(e,t)=>{let r=Oe.resolve(e),n=Oe.resolve(t);return n===r||Dr(n,r)},tf=(e,t)=>{if(e&&typeof e!="string")throw new TypeError("gitRoot must be a string or undefined");if(typeof t!="string")throw new TypeError("cwd must be a string");return e?Pk(e,t)?[...pa(Oe.resolve(t),Oe.resolve(e))].reverse().map(n=>Oe.join(n,".gitignore")):[]:[]},fa=(e,t,r)=>{if(t)return[];let n=[],o=!1;for(let i of e){if(He(i)){o=!0;break}n.push(r(i))}return o?[]:n}});import $k from"node:process";import Dk from"node:fs";import Nk from"node:fs/promises";import Te from"node:path";var ma,rf,Lk,Ik,Yn,Fk,jk,nf,of,Mk,Bk,Hk,Gk,sf,Vk,af,Kn,Uk,Wk,qk,Yk,cf,lf,uf,ga,ya,Kk,pf,df,ff,hf,va=gt(()=>{ma=Mt(Bn(),1),rf=Mt(zd(),1);aa();Xd();Zs();ha();Lk=["**/node_modules","**/flow-typed","**/coverage","**/.git"],Ik={absolute:!0,dot:!0},Yn="**/.gitignore",Fk=e=>Ce(e?.promises,"readFile")??Ce(Nk,"readFile")??Wn(e,"readFile"),jk=e=>Ce(e,"readFileSync")??Ce(Dk,"readFileSync"),nf=(e,t)=>e&&(e.code==="ENOENT"||e.code==="ENOTDIR")?!0:!!t,of=(e,t)=>t instanceof Error?(t.message=`Failed to read ignore file at ${e}: ${t.message}`,t):new Error(`Failed to read ignore file at ${e}: ${String(t)}`),Mk=(e,t,r)=>{try{let n=t(e,"utf8");return{filePath:e,content:n}}catch(n){if(nf(n,r))return;throw of(e,n)}},Bk=async(e,t,r)=>(await Promise.all(e.map(async o=>{try{let i=await t(o,"utf8");return{filePath:o,content:i}}catch(i){if(nf(i,r))return;throw of(o,i)}}))).filter(Boolean),Hk=(e,t,r)=>e.map(n=>Mk(n,t,r)).filter(Boolean),Gk=e=>{let t=new Set;return e.filter(r=>t.has(r)?!1:(t.add(r),!0))},sf=(e,t,r)=>e(t,{...r,...Ik}),Vk=(e,t)=>e?tf(e,t.cwd):[],af=(e,t,r)=>Gk([...Vk(e,t),...r]),Kn=(e,t,r)=>{let n=r||t.cwd,o=Kk(e,n);return{patterns:o,predicate:Yk(o,t.cwd,n),usingGitRoot:!!(r&&r!==t.cwd)}},Uk=(e,t)=>{if(!t)return e;let r=He(e),n=r?e.slice(1):e,o=n.indexOf("/"),i=o!==-1&&o!==n.length-1,s;return i?n.startsWith("/")?s=Te.posix.join(t,n.slice(1)):s=Te.posix.join(t,n):s=Te.posix.join(t,"**",n),r?"!"+s:s},Wk=(e,t)=>{let r=Un(Te.relative(t,Te.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(n=>n&&!n.startsWith("#")).map(n=>Uk(n,r))},qk=(e,t)=>{if(Te.isAbsolute(e)){let r=Te.relative(t,e);return r&&!Dr(e,t)?void 0:r}if(e.startsWith("./"))return e.slice(2);if(!e.startsWith("../"))return e},Yk=(e,t,r)=>{let n=(0,rf.default)().add(e),o=Te.normalize(Te.resolve(t)),i=Te.normalize(Te.resolve(r));return s=>{if(s=Pr(s),Te.normalize(Te.resolve(s))===o)return!1;let c=qk(s,i);return c===void 0?!1:c?n.ignores(Un(c)):!1}},cf=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[],r=Pr(e.cwd)??$k.cwd(),n=typeof e.deep=="number"?Math.max(0,e.deep)+1:Number.POSITIVE_INFINITY;return{cwd:r,suppressErrors:e.suppressErrors??!1,deep:n,ignore:[...t,...Lk],followSymbolicLinks:e.followSymbolicLinks??!0,concurrency:e.concurrency,throwErrorOnBrokenSymbolicLink:e.throwErrorOnBrokenSymbolicLink??!1,fs:e.fs}},lf=async(e,t,r)=>{let n=cf(t),o=await sf(ma.default,e,n),i=r?await ef(n.cwd,n.fs):void 0,s=af(i,n,o),a=Fk(n.fs);return{files:await Bk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},uf=(e,t,r)=>{let n=cf(t),o=sf(ma.default.sync,e,n),i=r?da(n.cwd,n.fs):void 0,s=af(i,n,o),a=jk(n.fs);return{files:Hk(s,a,n.suppressErrors),normalizedOptions:n,gitRoot:i}},ga=async(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=await lf(e,t,!1);return Kn(r,n,o).predicate},ya=(e,t)=>{let{files:r,normalizedOptions:n,gitRoot:o}=uf(e,t,!1);return Kn(r,n,o).predicate},Kk=(e,t)=>e.flatMap(r=>Wk(r,t)),pf=async(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=await lf(e,t,r);return Kn(n,o,i)},df=(e,t,r=!1)=>{let{files:n,normalizedOptions:o,gitRoot:i}=uf(e,t,r);return Kn(n,o,i)},ff=e=>ga(Yn,e),hf=e=>ya(Yn,e)});var Rf={};Ch(Rf,{convertPathToPattern:()=>lw,generateGlobTasks:()=>aw,generateGlobTasksSync:()=>cw,globby:()=>nw,globbyStream:()=>iw,globbySync:()=>ow,isDynamicPattern:()=>sw,isGitIgnored:()=>ff,isGitIgnoredSync:()=>hf,isIgnoredByIgnoreFiles:()=>ga,isIgnoredByIgnoreFilesSync:()=>ya});import ba from"node:process";import _a from"node:fs";import lt from"node:path";import{Readable as zk}from"node:stream";var cr,Xk,Jk,Qk,Zk,ew,yf,vf,zn,mf,gf,Ea,tw,bf,_f,Jn,Ef,rw,xf,Xn,kf,wf,Cf,Af,Sf,xa,nw,ow,iw,sw,aw,cw,lw,Of=gt(()=>{Kl();cr=Mt(Bn(),1);Zs();va();ha();va();Xk=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},Jk=e=>Ce(e?.promises,"stat")??Ce(_a.promises,"stat")??Wn(e,"stat"),Qk=e=>Ce(e,"statSync")??Ce(_a,"statSync"),Zk=async(e,t)=>{try{return(await Jk(t)(e)).isDirectory()}catch{return!1}},ew=(e,t)=>{try{return Qk(t)(e).isDirectory()}catch{return!1}},yf=(e,t)=>{let r=He(e)?e.slice(1):e;return lt.isAbsolute(r)?r:lt.join(t,r)},vf=e=>{let t=e?.match(/\*\*\/([^/]+)$/);if(!t)return!1;let r=t[1],n=/[*?[\]{}]/.test(r),o=lt.extname(r)&&!r.startsWith(".");return!n&&!o},zn=({directoryPath:e,files:t,extensions:r})=>{let n=r?.length>0?`.${r.length>1?`{${r.join(",")}}`:r[0]}`:"";return t?t.map(o=>lt.posix.join(e,`**/${lt.extname(o)?o:`${o}${n}`}`)):[lt.posix.join(e,`**${n?`/*${n}`:""}`)]},mf=async(e,{cwd:t=ba.cwd(),files:r,extensions:n,fs:o}={})=>(await Promise.all(e.map(async s=>{let a=He(s)?s.slice(1):s;if(vf(a))return zn({directoryPath:s,files:r,extensions:n});let c=yf(s,t);return await Zk(c,o)?zn({directoryPath:s,files:r,extensions:n}):s}))).flat(),gf=(e,{cwd:t=ba.cwd(),files:r,extensions:n,fs:o}={})=>e.flatMap(i=>{let s=He(i)?i.slice(1):i;if(vf(s))return zn({directoryPath:i,files:r,extensions:n});let a=yf(i,t);return ew(a,o)?zn({directoryPath:i,files:r,extensions:n}):i}),Ea=e=>(e=[...new Set([e].flat())],Xk(e),e),tw=(e,t=_a)=>{if(!e||!t.statSync)return;let r;try{r=t.statSync(e)}catch{return}if(!r.isDirectory())throw new Error(`The \`cwd\` option must be a path to a directory, got: ${e}`)},bf=(e={})=>{let t=e.ignore?Array.isArray(e.ignore)?e.ignore:[e.ignore]:[];return e={...e,ignore:t,expandDirectories:e.expandDirectories??!0,cwd:Pr(e.cwd)},tw(e.cwd,e.fs),e},_f=e=>async(t,r)=>e(Ea(t),bf(r)),Jn=e=>(t,r)=>e(Ea(t),bf(r)),Ef=e=>{let{ignoreFiles:t,gitignore:r}=e,n=t?Ea(t):[];return r&&n.push(Yn),n},rw=async e=>{let t=Ef(e);if(t.length===0)return{options:e,filter:Xn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=await pf(t,e,r),s=fa(n,i,ua);return{options:{...e,ignore:[...e.ignore,...s]},filter:Xn(o,e.cwd)}},xf=e=>{let t=Ef(e);if(t.length===0)return{options:e,filter:Xn(!1,e.cwd)};let r=e.gitignore===!0,{patterns:n,predicate:o,usingGitRoot:i}=df(t,e,r),s=fa(n,i,ua);return{options:{...e,ignore:[...e.ignore,...s]},filter:Xn(o,e.cwd)}},Xn=(e,t)=>{let r=new Set,n=t||ba.cwd(),o=new Map;return i=>{let s=lt.normalize(i.path??i);if(r.has(s))return!1;if(e){let a=o.get(s);if(a===void 0&&(a=lt.isAbsolute(s)?s:lt.resolve(n,s),o.set(s,a),o.size>1e4&&o.clear()),e(a))return!1}return r.add(s),!0}},kf=(e,t)=>e.flat().filter(r=>t(r)),wf=(e,t)=>{if(e.length>0&&e.every(s=>He(s))){if(t.expandNegationOnlyPatterns===!1)return[];e=["**/*",...e]}let r=[],n=!1,o=[];for(let s of e){if(He(s)){o.push(`!${Qd(s.slice(1),r,n)}`);continue}o.push(s);let a=la(s);if(a===void 0){n=!0;continue}r.push(a)}e=o;let i=[];for(;e.length>0;){let s=e.findIndex(c=>He(c));if(s===-1){i.push({patterns:e,options:t});break}let a=e[s].slice(1);for(let c of i)c.options.ignore.push(a);s!==0&&i.push({patterns:e.slice(0,s),options:{...t,ignore:[...t.ignore,a]}}),e=e.slice(s+1)}return i},Cf=e=>e.map(t=>({patterns:t.patterns,options:{...t.options,ignore:qn(t.patterns,t.options.ignore)}})),Af=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),Sf=async(e,t)=>{let r=wf(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return Cf(r);let s={...Af(o,n),fs:i};return Promise.all(r.map(async a=>{let{patterns:c,options:l}=a;return[c,l.ignore]=await Promise.all([mf(c,s),mf(l.ignore,{cwd:n,fs:i})]),l.ignore=qn(c,l.ignore),{patterns:c,options:l}}))},xa=(e,t)=>{let r=wf(e,t),{cwd:n,expandDirectories:o,fs:i}=t;if(!o)return Cf(r);let s={...Af(o,n),fs:i};return r.map(a=>{let{patterns:c,options:l}=a;return c=gf(c,s),l.ignore=gf(l.ignore,{cwd:n,fs:i}),l.ignore=qn(c,l.ignore),{patterns:c,options:l}})},nw=_f(async(e,t)=>{let{options:r,filter:n}=await rw(t),o=await Sf(e,r),i=await Promise.all(o.map(s=>(0,cr.default)(s.patterns,s.options)));return kf(i,n)}),ow=Jn((e,t)=>{let{options:r,filter:n}=xf(t),i=xa(e,r).map(s=>cr.default.sync(s.patterns,s.options));return kf(i,n)}),iw=Jn((e,t)=>{let{options:r,filter:n}=xf(t),i=xa(e,r).map(a=>cr.default.stream(a.patterns,a.options));return i.length===0?zk.from([]):fi(i).filter(a=>n(a))}),sw=Jn((e,t)=>e.some(r=>cr.default.isDynamicPattern(r,t))),aw=_f(Sf),cw=Jn(xa),{convertPathToPattern:lw}=cr.default});var Ye=["frontend","backend"],co=["workbench.frontend","workbench.backend"],Mr=[...Ye,...co];var Da=(e=0)=>t=>`\x1B[${t+e}m`,Na=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,La=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ee={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]}},kC=Object.keys(ee.modifier),Sh=Object.keys(ee.color),Rh=Object.keys(ee.bgColor),wC=[...Sh,...Rh];function Oh(){let e=new Map;for(let[t,r]of Object.entries(ee)){for(let[n,o]of Object.entries(r))ee[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ee[n],e.set(o[0],o[1]);Object.defineProperty(ee,t,{value:r,enumerable:!1})}return Object.defineProperty(ee,"codes",{value:e,enumerable:!1}),ee.color.close="\x1B[39m",ee.bgColor.close="\x1B[49m",ee.color.ansi=Da(),ee.color.ansi256=Na(),ee.color.ansi16m=La(),ee.bgColor.ansi=Da(10),ee.bgColor.ansi256=Na(10),ee.bgColor.ansi16m=La(10),Object.defineProperties(ee,{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=>ee.rgbToAnsi256(...ee.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)=>ee.ansi256ToAnsi(ee.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ee.ansi256ToAnsi(ee.hexToAnsi256(t)),enumerable:!1}}),ee}var Th=Oh(),Fe=Th;import lo from"node:process";import Ph from"node:os";import Ia from"node:tty";function Pe(e,t=globalThis.Deno?globalThis.Deno.args:lo.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:te}=lo,Br;Pe("no-color")||Pe("no-colors")||Pe("color=false")||Pe("color=never")?Br=0:(Pe("color")||Pe("colors")||Pe("color=true")||Pe("color=always"))&&(Br=1);function $h(){if("FORCE_COLOR"in te)return te.FORCE_COLOR==="true"?1:te.FORCE_COLOR==="false"?0:te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(te.FORCE_COLOR,10),3)}function Dh(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Nh(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=$h();n!==void 0&&(Br=n);let o=r?Br:n;if(o===0)return 0;if(r){if(Pe("color=16m")||Pe("color=full")||Pe("color=truecolor"))return 3;if(Pe("color=256"))return 2}if("TF_BUILD"in te&&"AGENT_NAME"in te)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(te.TERM==="dumb")return i;if(lo.platform==="win32"){let s=Ph.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in te)||te.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(te.TEAMCITY_VERSION)?1:0;if(te.COLORTERM==="truecolor"||te.TERM==="xterm-kitty"||te.TERM==="xterm-ghostty"||te.TERM==="wezterm")return 3;if("TERM_PROGRAM"in te){let s=Number.parseInt((te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(te.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(te.TERM)||"COLORTERM"in te?1:i}function Fa(e,t={}){let r=Nh(e,{streamIsTTY:e&&e.isTTY,...t});return Dh(r)}var Lh={stdout:Fa({isTTY:Ia.isatty(1)}),stderr:Fa({isTTY:Ia.isatty(2)})},ja=Lh;function Ma(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 Ba(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=
|
|
36
|
-
|
|
37
|
-
`+e.mark.snippet),n+" "+r):n}function
|
|
38
|
-
`+a;for(
|
|
39
|
-
`,a+=
|
|
40
|
-
`,c=1;c<=t.linesAfter&&!(s+c>=o.length);c++)
|
|
41
|
-
`;return a.replace(/\n$/,"")}var
|
|
42
|
-
\r`;function
|
|
43
|
-
`: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
|
|
44
|
-
`,t-1))}function
|
|
45
|
-
`,i?1+c:c):o===
|
|
46
|
-
`);break}for(n?
|
|
47
|
-
`,i?1+c:c)):
|
|
48
|
-
`,c+1)):c===0?i&&(e.result+=" "):e.result+=
|
|
49
|
-
`,c):e.result+=
|
|
50
|
-
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!
|
|
51
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
34
|
+
`,o)}while(n!==-1);return i+=e.slice(o),i}var{stdout:Ha,stderr:Ga}=ja,uo=Symbol("GENERATOR"),Bt=Symbol("STYLER"),pr=Symbol("IS_EMPTY"),Va=["ansi","ansi","ansi256","ansi16m"],Ht=Object.create(null),Ih=(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=Ha?Ha.level:0;e.level=t.level===void 0?r:t.level};var Fh=e=>{let t=(...r)=>r.join(" ");return Ih(t,e),Object.setPrototypeOf(t,dr.prototype),t};function dr(e){return Fh(e)}Object.setPrototypeOf(dr.prototype,Function.prototype);for(let[e,t]of Object.entries(Fe))Ht[e]={get(){let r=Hr(this,fo(t.open,t.close,this[Bt]),this[pr]);return Object.defineProperty(this,e,{value:r}),r}};Ht.visible={get(){let e=Hr(this,this[Bt],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var po=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?Fe[r].ansi16m(...n):t==="ansi256"?Fe[r].ansi256(Fe.rgbToAnsi256(...n)):Fe[r].ansi(Fe.rgbToAnsi(...n)):e==="hex"?po("rgb",t,r,...Fe.hexToRgb(...n)):Fe[r][e](...n),jh=["rgb","hex","ansi256"];for(let e of jh){Ht[e]={get(){let{level:r}=this;return function(...n){let o=fo(po(e,Va[r],"color",...n),Fe.color.close,this[Bt]);return Hr(this,o,this[pr])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Ht[t]={get(){let{level:r}=this;return function(...n){let o=fo(po(e,Va[r],"bgColor",...n),Fe.bgColor.close,this[Bt]);return Hr(this,o,this[pr])}}}}var Mh=Object.defineProperties(()=>{},{...Ht,level:{enumerable:!0,get(){return this[uo].level},set(e){this[uo].level=e}}}),fo=(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}},Hr=(e,t,r)=>{let n=(...o)=>Bh(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Mh),n[uo]=e,n[Bt]=t,n[pr]=r,n},Bh=(e,t)=>{if(e.level<=0||!t)return e[pr]?"":t;let r=e[Bt];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Ma(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
35
|
+
`);return i!==-1&&(t=Ba(t,o,n,i)),n+t+o};Object.defineProperties(dr.prototype,Ht);var Hh=dr(),NC=dr({level:Ga?Ga.level:0});var h=Hh;var rc=Mt(tc(),1),{program:VC,createCommand:UC,createArgument:WC,createOption:qC,CommanderError:YC,InvalidArgumentError:KC,InvalidOptionArgumentError:zC,Command:nc,Argument:XC,Option:JC,Help:QC}=rc.default;function U(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ke(e){return function t(r){return arguments.length===0||U(r)?t:e.apply(this,arguments)}}function ze(e){return function t(r,n){switch(arguments.length){case 0:return t;case 1:return U(r)?t:Ke(function(o){return e(r,o)});default:return U(r)&&U(n)?t:U(r)?Ke(function(o){return e(o,n)}):U(n)?Ke(function(o){return e(r,o)}):e(r,n)}}}function hr(e){return function t(r,n,o){switch(arguments.length){case 0:return t;case 1:return U(r)?t:ze(function(i,s){return e(r,i,s)});case 2:return U(r)&&U(n)?t:U(r)?ze(function(i,s){return e(i,n,s)}):U(n)?ze(function(i,s){return e(r,i,s)}):Ke(function(i){return e(r,n,i)});default:return U(r)&&U(n)&&U(o)?t:U(r)&&U(n)?ze(function(i,s){return e(i,s,o)}):U(r)&&U(o)?ze(function(i,s){return e(i,n,s)}):U(n)&&U(o)?ze(function(i,s){return e(r,i,s)}):U(r)?Ke(function(i){return e(i,n,o)}):U(n)?Ke(function(i){return e(r,i,o)}):U(o)?Ke(function(i){return e(r,n,i)}):e(r,n,o)}}}function Gt(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Wr(e){return Object.prototype.toString.call(e)==="[object Object]"}var nm=hr(function(t,r,n){var o={},i;r=r||{},n=n||{};for(i in r)Gt(i,r)&&(o[i]=Gt(i,n)?t(i,r[i],n[i]):r[i]);for(i in n)Gt(i,n)&&!Gt(i,o)&&(o[i]=n[i]);return o}),oc=nm;var om=hr(function e(t,r,n){return oc(function(o,i,s){return Wr(i)&&Wr(s)?e(t,i,s):t(o,i,s)},r,n)}),ic=om;var im=ze(function(t,r){return ic(function(n,o,i){return i},t,r)}),yt=im;import Ot from"fs-extra";import ur from"path";function Ec(e){return typeof e>"u"||e===null}function sm(e){return typeof e=="object"&&e!==null}function am(e){return Array.isArray(e)?e:Ec(e)?[]:[e]}function cm(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 lm(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function um(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var pm=Ec,dm=sm,fm=am,hm=lm,mm=um,gm=cm,ce={isNothing:pm,isObject:dm,toArray:fm,repeat:hm,isNegativeZero:mm,extend:gm};function xc(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+=`
|
|
36
|
+
|
|
37
|
+
`+e.mark.snippet),n+" "+r):n}function gr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=xc(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}gr.prototype=Object.create(Error.prototype);gr.prototype.constructor=gr;gr.prototype.toString=function(t){return this.name+": "+xc(this,t)};var be=gr;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 $o(e,t){return ce.repeat(" ",t-e.length)+e}function ym(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=ce.repeat(" ",t.indent)+$o((e.line-c+1).toString(),u)+" | "+l.str+`
|
|
38
|
+
`+a;for(l=Po(e.buffer,n[s],o[s],e.position,p),a+=ce.repeat(" ",t.indent)+$o((e.line+1).toString(),u)+" | "+l.str+`
|
|
39
|
+
`,a+=ce.repeat("-",t.indent+u+3+l.pos)+`^
|
|
40
|
+
`,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+=ce.repeat(" ",t.indent)+$o((e.line+c+1).toString(),u)+" | "+l.str+`
|
|
41
|
+
`;return a.replace(/\n$/,"")}var vm=ym,bm=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_m=["scalar","sequence","mapping"];function Em(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function xm(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(bm.indexOf(r)===-1)throw new be('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=Em(t.styleAliases||null),_m.indexOf(this.kind)===-1)throw new be('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var fe=xm;function sc(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 km(){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 No(e){return this.extend(e)}No.prototype.extend=function(t){var r=[],n=[];if(t instanceof fe)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 be("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(i){if(!(i instanceof fe))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new be("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 be("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 fe))throw new be("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(No.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(n),o.compiledImplicit=sc(o,"implicit"),o.compiledExplicit=sc(o,"explicit"),o.compiledTypeMap=km(o.compiledImplicit,o.compiledExplicit),o};var kc=No,wc=new fe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Cc=new fe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ac=new fe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Sc=new kc({explicit:[wc,Cc,Ac]});function wm(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Cm(){return null}function Am(e){return e===null}var Rc=new fe("tag:yaml.org,2002:null",{kind:"scalar",resolve:wm,construct:Cm,predicate:Am,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Sm(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 Rm(e){return e==="true"||e==="True"||e==="TRUE"}function Om(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Oc=new fe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Sm,construct:Rm,predicate:Om,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 Tm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Pm(e){return 48<=e&&e<=55}function $m(e){return 48<=e&&e<=57}function Dm(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(!Tm(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Pm(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!$m(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function Nm(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 Lm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ce.isNegativeZero(e)}var Tc=new fe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Dm,construct:Nm,predicate:Lm,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"]}}),Im=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fm(e){return!(e===null||!Im.test(e)||e[e.length-1]==="_")}function jm(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 Mm=/^[-+]?[0-9]+e/;function Bm(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(ce.isNegativeZero(e))return"-0.0";return r=e.toString(10),Mm.test(r)?r.replace("e",".e"):r}function Hm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ce.isNegativeZero(e))}var Pc=new fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fm,construct:jm,predicate:Hm,represent:Bm,defaultStyle:"lowercase"}),$c=Sc.extend({implicit:[Rc,Oc,Tc,Pc]}),Dc=$c,Nc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Lc=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 Gm(e){return e===null?!1:Nc.exec(e)!==null||Lc.exec(e)!==null}function Vm(e){var t,r,n,o,i,s,a,c=0,l=null,u,p,d;if(t=Nc.exec(e),t===null&&(t=Lc.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 Um(e){return e.toISOString()}var Ic=new fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Gm,construct:Vm,instanceOf:Date,represent:Um});function Wm(e){return e==="<<"||e===null}var Fc=new fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Wm}),Mo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
42
|
+
\r`;function qm(e){if(e===null)return!1;var t,r,n=0,o=e.length,i=Mo;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 Ym(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,i=Mo,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 Km(e){var t="",r=0,n,o,i=e.length,s=Mo;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 zm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var jc=new fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:qm,construct:Ym,predicate:zm,represent:Km}),Xm=Object.prototype.hasOwnProperty,Jm=Object.prototype.toString;function Qm(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,Jm.call(o)!=="[object Object]")return!1;for(i in o)if(Xm.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 Zm(e){return e!==null?e:[]}var Mc=new fe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Qm,construct:Zm}),eg=Object.prototype.toString;function tg(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],eg.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;i[t]=[o[0],n[o[0]]]}return!0}function rg(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 Bc=new fe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:tg,construct:rg}),ng=Object.prototype.hasOwnProperty;function og(e){if(e===null)return!0;var t,r=e;for(t in r)if(ng.call(r,t)&&r[t]!==null)return!1;return!0}function ig(e){return e!==null?e:{}}var Hc=new fe("tag:yaml.org,2002:set",{kind:"mapping",resolve:og,construct:ig}),Bo=Dc.extend({implicit:[Ic,Fc],explicit:[jc,Mc,Bc,Hc]}),bt=Object.prototype.hasOwnProperty,qr=1,Gc=2,Vc=3,Yr=4,Do=1,sg=2,ac=3,ag=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,cg=/[\x85\u2028\u2029]/,lg=/[,\[\]\{\}]/,Uc=/^(?:!|!!|![a-z\-]+!)$/i,Wc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function cc(e){return Object.prototype.toString.call(e)}function Xe(e){return e===10||e===13}function Pt(e){return e===9||e===32}function xe(e){return e===9||e===32||e===10||e===13}function Ut(e){return e===44||e===91||e===93||e===123||e===125}function ug(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function pg(e){return e===120?2:e===117?4:e===85?8:0}function dg(e){return 48<=e&&e<=57?e-48:-1}function lc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
43
|
+
`: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 fg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function qc(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}var Yc=new Array(256),Kc=new Array(256);for(Tt=0;Tt<256;Tt++)Yc[Tt]=lc(Tt)?1:0,Kc[Tt]=lc(Tt);var Tt;function hg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Bo,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 zc(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=vm(r),new be(t,r)}function R(e,t){throw zc(e,t)}function Kr(e,t){e.onWarning&&e.onWarning.call(null,zc(e,t))}var uc={YAML:function(t,r,n){var o,i,s;t.version!==null&&R(t,"duplication of %YAML directive"),n.length!==1&&R(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&R(t,"ill-formed argument of the YAML directive"),i=parseInt(o[1],10),s=parseInt(o[2],10),i!==1&&R(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Kr(t,"unsupported YAML version of the document")},TAG:function(t,r,n){var o,i;n.length!==2&&R(t,"TAG directive accepts exactly two arguments"),o=n[0],i=n[1],Uc.test(o)||R(t,"ill-formed tag handle (first argument) of the TAG directive"),bt.call(t.tagMap,o)&&R(t,'there is a previously declared suffix for "'+o+'" tag handle'),Wc.test(i)||R(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{R(t,"tag prefix is malformed: "+i)}t.tagMap[o]=i}};function vt(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||R(e,"expected valid JSON character");else ag.test(a)&&R(e,"the stream contains non-printable characters");e.result+=a}}function pc(e,t,r,n){var o,i,s,a;for(ce.isObject(r)||R(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],bt.call(t,i)||(qc(t,i,r[i]),n[i]=!0)}function Wt(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])&&R(e,"nested arrays are not supported inside keys"),typeof o=="object"&&cc(o[l])==="[object Object]"&&(o[l]="[object Object]");if(typeof o=="object"&&cc(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)pc(e,t,i[l],r);else pc(e,t,i,r);else!e.json&&!bt.call(r,o)&&bt.call(t,o)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,R(e,"duplicated mapping key")),qc(t,o,i),delete r[o];return t}function Ho(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++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function oe(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;Pt(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(Xe(o))for(Ho(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&&Kr(e,"deficient indentation"),n}function Jr(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||xe(r)))}function Go(e,t){t===1?e.result+=" ":t>1&&(e.result+=ce.repeat(`
|
|
44
|
+
`,t-1))}function mg(e,t,r){var n,o,i,s,a,c,l,u,p=e.kind,d=e.result,y;if(y=e.input.charCodeAt(e.position),xe(y)||Ut(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(o=e.input.charCodeAt(e.position+1),xe(o)||r&&Ut(o)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,a=!1;y!==0;){if(y===58){if(o=e.input.charCodeAt(e.position+1),xe(o)||r&&Ut(o))break}else if(y===35){if(n=e.input.charCodeAt(e.position-1),xe(n))break}else{if(e.position===e.lineStart&&Jr(e)||r&&Ut(y))break;if(Xe(y))if(c=e.line,l=e.lineStart,u=e.lineIndent,oe(e,!1,-1),e.lineIndent>=t){a=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=c,e.lineStart=l,e.lineIndent=u;break}}a&&(vt(e,i,s,!1),Go(e,e.line-c),i=s=e.position,a=!1),Pt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return vt(e,i,s,!1),e.result?!0:(e.kind=p,e.result=d,!1)}function gg(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(vt(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 Xe(r)?(vt(e,n,o,!0),Go(e,oe(e,!1,t)),n=o=e.position):e.position===e.lineStart&&Jr(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}function yg(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 vt(e,r,e.position,!0),e.position++,!0;if(a===92){if(vt(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),Xe(a))oe(e,!1,t);else if(a<256&&Yc[a])e.result+=Kc[a],e.position++;else if((s=pg(a))>0){for(o=s,i=0;o>0;o--)a=e.input.charCodeAt(++e.position),(s=ug(a))>=0?i=(i<<4)+s:R(e,"expected hexadecimal character");e.result+=fg(i),e.position++}else R(e,"unknown escape sequence");r=n=e.position}else Xe(a)?(vt(e,r,n,!0),Go(e,oe(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Jr(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}function vg(e,t){var r=!0,n,o,i,s=e.tag,a,c=e.anchor,l,u,p,d,y,g=Object.create(null),m,E,k,S;if(S=e.input.charCodeAt(e.position),S===91)u=93,y=!1,a=[];else if(S===123)u=125,y=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),S=e.input.charCodeAt(++e.position);S!==0;){if(oe(e,!0,t),S=e.input.charCodeAt(e.position),S===u)return e.position++,e.tag=s,e.anchor=c,e.kind=y?"mapping":"sequence",e.result=a,!0;r?S===44&&R(e,"expected the node content, but found ','"):R(e,"missed comma between flow collection entries"),E=m=k=null,p=d=!1,S===63&&(l=e.input.charCodeAt(e.position+1),xe(l)&&(p=d=!0,e.position++,oe(e,!0,t))),n=e.line,o=e.lineStart,i=e.position,qt(e,t,qr,!1,!0),E=e.tag,m=e.result,oe(e,!0,t),S=e.input.charCodeAt(e.position),(d||e.line===n)&&S===58&&(p=!0,S=e.input.charCodeAt(++e.position),oe(e,!0,t),qt(e,t,qr,!1,!0),k=e.result),y?Wt(e,a,g,E,m,k,n,o,i):p?a.push(Wt(e,null,g,E,m,k,n,o,i)):a.push(m),oe(e,!0,t),S=e.input.charCodeAt(e.position),S===44?(r=!0,S=e.input.charCodeAt(++e.position)):r=!1}R(e,"unexpected end of the stream within a flow collection")}function bg(e,t){var r,n,o=Do,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)Do===o?o=p===43?ac:sg:R(e,"repeat of a chomping mode identifier");else if((u=dg(p))>=0)u===0?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?R(e,"repeat of an indentation width identifier"):(a=t+u-1,s=!0);else break;if(Pt(p)){do p=e.input.charCodeAt(++e.position);while(Pt(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Xe(p)&&p!==0)}for(;p!==0;){for(Ho(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),Xe(p)){c++;continue}if(e.lineIndent<a){o===ac?e.result+=ce.repeat(`
|
|
45
|
+
`,i?1+c:c):o===Do&&i&&(e.result+=`
|
|
46
|
+
`);break}for(n?Pt(p)?(l=!0,e.result+=ce.repeat(`
|
|
47
|
+
`,i?1+c:c)):l?(l=!1,e.result+=ce.repeat(`
|
|
48
|
+
`,c+1)):c===0?i&&(e.result+=" "):e.result+=ce.repeat(`
|
|
49
|
+
`,c):e.result+=ce.repeat(`
|
|
50
|
+
`,i?1+c:c),i=!0,s=!0,c=0,r=e.position;!Xe(p)&&p!==0;)p=e.input.charCodeAt(++e.position);vt(e,r,e.position,!1)}return!0}function dc(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,R(e,"tab characters must not be used in indentation")),!(c!==45||(s=e.input.charCodeAt(e.position+1),!xe(s))));){if(a=!0,e.position++,oe(e,!0,-1)&&e.lineIndent<=t){i.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,qt(e,t,Vc,!1,!0),i.push(e.result),oe(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)R(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 _g(e,t,r){var n,o,i,s,a,c,l=e.tag,u=e.anchor,p={},d=Object.create(null),y=null,g=null,m=null,E=!1,k=!1,S;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),S=e.input.charCodeAt(e.position);S!==0;){if(!E&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),i=e.line,(S===63||S===58)&&xe(n))S===63?(E&&(Wt(e,p,d,y,g,null,s,a,c),y=g=m=null),k=!0,E=!0,o=!0):E?(E=!1,o=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,S=n;else{if(s=e.line,a=e.lineStart,c=e.position,!qt(e,r,Gc,!1,!0))break;if(e.line===i){for(S=e.input.charCodeAt(e.position);Pt(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),xe(S)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Wt(e,p,d,y,g,null,s,a,c),y=g=m=null),k=!0,E=!1,o=!1,y=e.tag,g=e.result;else if(k)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=l,e.anchor=u,!0}else if(k)R(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)&&(E&&(s=e.line,a=e.lineStart,c=e.position),qt(e,t,Yr,!0,o)&&(E?g=e.result:m=e.result),E||(Wt(e,p,d,y,g,m,s,a,c),y=g=m=null),oe(e,!0,-1),S=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>t)&&S!==0)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return E&&Wt(e,p,d,y,g,null,s,a,c),k&&(e.tag=l,e.anchor=u,e.kind="mapping",e.result=p),k}function Eg(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&&R(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)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!xe(s);)s===33&&(n?R(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Uc.test(o)||R(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),lg.test(i)&&R(e,"tag suffix cannot contain flow indicator characters")}i&&!Wc.test(i)&&R(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{R(e,"tag name is malformed: "+i)}return r?e.tag=i:bt.call(e.tagMap,o)?e.tag=e.tagMap[o]+i:o==="!"?e.tag="!"+i:o==="!!"?e.tag="tag:yaml.org,2002:"+i:R(e,'undeclared tag handle "'+o+'"'),!0}function xg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&R(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!xe(r)&&!Ut(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function kg(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&&!xe(n)&&!Ut(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),bt.call(e.anchorMap,r)||R(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],oe(e,!0,-1),!0}function qt(e,t,r,n,o){var i,s,a,c=1,l=!1,u=!1,p,d,y,g,m,E;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Yr===r||Vc===r,n&&oe(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Eg(e)||xg(e);)oe(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||Yr===r)&&(qr===r||Gc===r?m=t:m=t+1,E=e.position-e.lineStart,c===1?a&&(dc(e,E)||_g(e,E,m))||vg(e,m)?u=!0:(s&&bg(e,m)||gg(e,m)||yg(e,m)?u=!0:kg(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):mg(e,m,qr===r)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=a&&dc(e,E))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,d=e.implicitTypes.length;p<d;p+=1)if(g=e.implicitTypes[p],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(bt.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,y=e.typeMap.multi[e.kind||"fallback"],p=0,d=y.length;p<d;p+=1)if(e.tag.slice(0,y[p].tag.length)===y[p].tag){g=y[p];break}g||R(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):R(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 wg(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&&(oe(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&&!xe(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&R(e,"directive name must not be less than one character in length");s!==0;){for(;Pt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Xe(s));break}if(Xe(s))break;for(r=e.position;s!==0&&!xe(s);)s=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}s!==0&&Ho(e),bt.call(uc,n)?uc[n](e,n,o):Kr(e,'unknown document directive "'+n+'"')}if(oe(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,oe(e,!0,-1)):i&&R(e,"directives end mark is expected"),qt(e,e.lineIndent-1,Yr,!1,!0),oe(e,!0,-1),e.checkLineBreaks&&cg.test(e.input.slice(t,e.position))&&Kr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Jr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,oe(e,!0,-1));return}if(e.position<e.length-1)R(e,"end of the stream or a document separator is expected");else return}function Xc(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
51
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new hg(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,R(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;)wg(r);return r.documents}function Cg(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=Xc(e,r);if(typeof t!="function")return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function Ag(e,t){var r=Xc(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new be("expected a single document in the stream, but found more")}}var Sg=Cg,Rg=Ag,Jc={loadAll:Sg,load:Rg},Qc=Object.prototype.toString,Zc=Object.prototype.hasOwnProperty,Vo=65279,Og=9,yr=10,Tg=13,Pg=32,$g=33,Dg=34,Lo=35,Ng=37,Lg=38,Ig=39,Fg=42,el=44,jg=45,zr=58,Mg=61,Bg=62,Hg=63,Gg=64,tl=91,rl=93,Vg=96,nl=123,Ug=124,ol=125,he={};he[0]="\\0";he[7]="\\a";he[8]="\\b";he[9]="\\t";he[10]="\\n";he[11]="\\v";he[12]="\\f";he[13]="\\r";he[27]="\\e";he[34]='\\"';he[92]="\\\\";he[133]="\\N";he[160]="\\_";he[8232]="\\L";he[8233]="\\P";var Wg=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],qg=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Yg(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&&Zc.call(c.styleAliases,a)&&(a=c.styleAliases[a]),r[s]=a;return r}function Kg(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 be("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ce.repeat("0",n-t.length)+t}var zg=1,vr=2;function Xg(e){this.schema=e.schema||Bo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ce.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Yg(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==='"'?vr:zg,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 fc(e,t){for(var r=ce.repeat(" ",t),n=0,o=-1,i="",s,a=e.length;n<a;)o=e.indexOf(`
|
|
52
52
|
`,n),o===-1?(s=e.slice(n),n=a):(s=e.slice(n,o+1),n=o+1),s.length&&s!==`
|
|
53
|
-
`&&(i+=r),i+=s;return i}function
|
|
54
|
-
`+
|
|
53
|
+
`&&(i+=r),i+=s;return i}function Io(e,t){return`
|
|
54
|
+
`+ce.repeat(" ",e.indent*t)}function Jg(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 Xr(e){return e===Pg||e===Og}function br(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Vo||65536<=e&&e<=1114111}function hc(e){return br(e)&&e!==Vo&&e!==Tg&&e!==yr}function mc(e,t,r){var n=hc(e),o=n&&!Xr(e);return(r?n:n&&e!==el&&e!==tl&&e!==rl&&e!==nl&&e!==ol)&&e!==Lo&&!(t===zr&&!o)||hc(t)&&!Xr(t)&&e===Lo||t===zr&&o}function Qg(e){return br(e)&&e!==Vo&&!Xr(e)&&e!==jg&&e!==Hg&&e!==zr&&e!==el&&e!==tl&&e!==rl&&e!==nl&&e!==ol&&e!==Lo&&e!==Lg&&e!==Fg&&e!==$g&&e!==Ug&&e!==Mg&&e!==Bg&&e!==Ig&&e!==Dg&&e!==Ng&&e!==Gg&&e!==Vg}function Zg(e){return!Xr(e)&&e!==zr}function mr(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 il(e){var t=/^\n* /;return t.test(e)}var sl=1,Fo=2,al=3,cl=4,Vt=5;function ey(e,t,r,n,o,i,s,a){var c,l=0,u=null,p=!1,d=!1,y=n!==-1,g=-1,m=Qg(mr(e,0))&&Zg(mr(e,e.length-1));if(t||s)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=mr(e,c),!br(l))return Vt;m=m&&mc(l,u,a),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=mr(e,c),l===yr)p=!0,y&&(d=d||c-g-1>n&&e[g+1]!==" ",g=c);else if(!br(l))return Vt;m=m&&mc(l,u,a),u=l}d=d||y&&c-g-1>n&&e[g+1]!==" "}return!p&&!d?m&&!s&&!o(e)?sl:i===vr?Vt:Fo:r>9&&il(e)?Vt:s?i===vr?Vt:Fo:d?cl:al}function ty(e,t,r,n,o){e.dump=(function(){if(t.length===0)return e.quotingType===vr?'""':"''";if(!e.noCompatMode&&(Wg.indexOf(t)!==-1||qg.test(t)))return e.quotingType===vr?'"'+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 Jg(e,l)}switch(ey(t,a,e.indent,s,c,e.quotingType,e.forceQuotes&&!n,o)){case sl:return t;case Fo:return"'"+t.replace(/'/g,"''")+"'";case al:return"|"+gc(t,e.indent)+yc(fc(t,i));case cl:return">"+gc(t,e.indent)+yc(fc(ry(t,s),i));case Vt:return'"'+ny(t)+'"';default:throw new be("impossible error: invalid scalar style")}})()}function gc(e,t){var r=il(e)?String(t):"",n=e[e.length-1]===`
|
|
55
55
|
`,o=n&&(e[e.length-2]===`
|
|
56
56
|
`||e===`
|
|
57
57
|
`),i=o?"+":n?"":"-";return r+i+`
|
|
58
|
-
`}function
|
|
59
|
-
`?e.slice(0,-1):e}function
|
|
60
|
-
`);return
|
|
58
|
+
`}function yc(e){return e[e.length-1]===`
|
|
59
|
+
`?e.slice(0,-1):e}function ry(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var l=e.indexOf(`
|
|
60
|
+
`);return l=l!==-1?l:e.length,r.lastIndex=l,vc(e.slice(0,l),t)})(),o=e[0]===`
|
|
61
61
|
`||e[0]===" ",i,s;s=r.exec(e);){var a=s[1],c=s[2];i=c[0]===" ",n+=a+(!o&&!i&&c!==""?`
|
|
62
|
-
`:"")+
|
|
62
|
+
`:"")+vc(c,t),o=i}return n}function vc(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+=`
|
|
63
63
|
`+e.slice(o,i),o=i+1),s=a;return c+=`
|
|
64
64
|
`,e.length-o>t&&s>o?c+=e.slice(o,s)+`
|
|
65
|
-
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function
|
|
66
|
-
`:""}var
|
|
67
|
-
`&&(
|
|
65
|
+
`+e.slice(s+1):c+=e.slice(o),c.slice(1)}function ny(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=mr(e,o),n=he[r],!n&&br(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||Kg(r);return t}function oy(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)),(nt(e,t,a,!1,!1)||typeof a>"u"&&nt(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function bc(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)),(nt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&nt(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=Io(e,t)),e.dump&&yr===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=i,e.dump=o||"[]"}function iy(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)),nt(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),nt(e,t,l,!1,!1)&&(u+=e.dump,n+=u));e.tag=o,e.dump="{"+n+"}"}function sy(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 be("sortKeys must be a boolean or a function");for(a=0,c=s.length;a<c;a+=1)d="",(!n||o!=="")&&(d+=Io(e,t)),l=s[a],u=r[l],e.replacer&&(u=e.replacer.call(r,l,u)),nt(e,t+1,l,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&yr===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,p&&(d+=Io(e,t)),nt(e,t+1,u,!0,p)&&(e.dump&&yr===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,o+=d));e.tag=i,e.dump=o||"{}"}function _c(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,Qc.call(a.represent)==="[object Function]")n=a.represent(t,c);else if(Zc.call(a.represent,c))n=a.represent[c](t,c);else throw new be("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function nt(e,t,r,n,o,i,s){e.tag=null,e.dump=r,_c(e,r,!1)||_c(e,r,!0);var a=Qc.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?(sy(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(iy(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?bc(e,t-1,e.dump,o):bc(e,t,e.dump,o),d&&(e.dump="&ref_"+p+e.dump)):(oy(e,t,e.dump),d&&(e.dump="&ref_"+p+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&ty(e,e.dump,t,i,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new be("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 ay(e,t){var r=[],n=[],o,i;for(jo(e,r,n),o=0,i=n.length;o<i;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(i)}function jo(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)jo(e[o],t,r);else for(n=Object.keys(e),o=0,i=n.length;o<i;o+=1)jo(e[n[o]],t,r)}function cy(e,t){t=t||{};var r=new Xg(t);r.noRefs||ay(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),nt(r,0,n,!0,!0)?r.dump+`
|
|
66
|
+
`:""}var ly=cy,uy={dump:ly};function Uo(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 py=fe,dy=kc,fy=Sc,hy=$c,my=Dc,gy=Bo,yy=Jc.load,vy=Jc.loadAll,by=uy.dump,_y=be,Ey={binary:jc,float:Pc,map:Ac,null:Rc,pairs:Bc,set:Hc,timestamp:Ic,bool:Oc,int:Tc,merge:Fc,omap:Mc,seq:Cc,str:wc},xy=Uo("safeLoad","load"),ky=Uo("safeLoadAll","loadAll"),wy=Uo("safeDump","dump"),Se={Type:py,Schema:dy,FAILSAFE_SCHEMA:fy,JSON_SCHEMA:hy,CORE_SCHEMA:my,DEFAULT_SCHEMA:gy,load:yy,loadAll:vy,dump:by,YAMLException:_y,types:Ey,safeLoad:xy,safeLoadAll:ky,safeDump:wy};import Zr from"fs-extra";import kr from"path";import{extname as av,resolve as cv,join as lv}from"path";var El=Mt(ml(),1);import uv from"chokidar";import{pathToFileURL as pv}from"url";import Vy from"fs-extra";var OA=Yo().name,gl=(e,t=["js","yaml","yml"])=>{for(let r of t){let n=e+"."+r;if(Vy.existsSync(n))return n}throw new Error(`Could not find any of ${e+"{"+t.join(",")+"}"}`)};import NA from"fs-extra";import bl from"path";var Uy=Object.prototype.toString,zt=Array.isArray||function(t){return Uy.call(t)==="[object Array]"};function zo(e){return typeof e=="function"}function Wy(e){return zt(e)?"array":typeof e}function Ko(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yl(e,t){return e!=null&&typeof e=="object"&&t in e}function qy(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var Yy=RegExp.prototype.test;function Ky(e,t){return Yy.call(e,t)}var zy=/\S/;function Xy(e){return!Ky(zy,e)}var Jy={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Qy(e){return String(e).replace(/[&<>"'`=\/]/g,function(r){return Jy[r]})}var Zy=/\s*/,ev=/\s+/,vl=/\s*=/,tv=/\s*\}/,rv=/#|\^|\/|>|\{|&|=|!/;function nv(e,t){if(!e)return[];var r=!1,n=[],o=[],i=[],s=!1,a=!1,c="",l=0;function u(){if(s&&!a)for(;i.length;)delete o[i.pop()];else i=[];s=!1,a=!1}var p,d,y;function g(w){if(typeof w=="string"&&(w=w.split(ev,2)),!zt(w)||w.length!==2)throw new Error("Invalid tags: "+w);p=new RegExp(Ko(w[0])+"\\s*"),d=new RegExp("\\s*"+Ko(w[1])),y=new RegExp("\\s*"+Ko("}"+w[1]))}g(t||je.tags);for(var m=new xr(e),E,k,S,I,de,q;!m.eos();){if(E=m.pos,S=m.scanUntil(p),S)for(var T=0,L=S.length;T<L;++T)I=S.charAt(T),Xy(I)?(i.push(o.length),c+=I):(a=!0,r=!0,c+=" "),o.push(["text",I,E,E+1]),E+=1,I===`
|
|
67
|
+
`&&(u(),c="",l=0,r=!1);if(!m.scan(p))break;if(s=!0,k=m.scan(rv)||"name",m.scan(Zy),k==="="?(S=m.scanUntil(vl),m.scan(vl),m.scanUntil(d)):k==="{"?(S=m.scanUntil(y),m.scan(tv),m.scanUntil(d),k="&"):S=m.scanUntil(d),!m.scan(d))throw new Error("Unclosed tag at "+m.pos);if(k==">"?de=[k,S,E,m.pos,c,l,r]:de=[k,S,E,m.pos],l++,o.push(de),k==="#"||k==="^")n.push(de);else if(k==="/"){if(q=n.pop(),!q)throw new Error('Unopened section "'+S+'" at '+E);if(q[1]!==S)throw new Error('Unclosed section "'+q[1]+'" at '+E)}else k==="name"||k==="{"||k==="&"?a=!0:k==="="&&g(S)}if(u(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+m.pos);return iv(ov(o))}function ov(e){for(var t=[],r,n,o=0,i=e.length;o<i;++o)r=e[o],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(t.push(r),n=r));return t}function iv(e){for(var t=[],r=t,n=[],o,i,s=0,a=e.length;s<a;++s)switch(o=e[s],o[0]){case"#":case"^":r.push(o),n.push(o),r=o[4]=[];break;case"/":i=n.pop(),i[5]=o[2],r=n.length>0?n[n.length-1][4]:t;break;default:r.push(o)}return t}function xr(e){this.string=e,this.tail=e,this.pos=0}xr.prototype.eos=function(){return this.tail===""};xr.prototype.scan=function(t){var r=this.tail.match(t);if(!r||r.index!==0)return"";var n=r[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};xr.prototype.scanUntil=function(t){var r=this.tail.search(t),n;switch(r){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=n.length,n};function Kt(e,t){this.view=e,this.cache={".":this.view},this.parent=t}Kt.prototype.push=function(t){return new Kt(t,this)};Kt.prototype.lookup=function(t){var r=this.cache,n;if(r.hasOwnProperty(t))n=r[t];else{for(var o=this,i,s,a,c=!1;o;){if(t.indexOf(".")>0)for(i=o.view,s=t.split("."),a=0;i!=null&&a<s.length;)a===s.length-1&&(c=yl(i,s[a])||qy(i,s[a])),i=i[s[a++]];else i=o.view[t],c=yl(o.view,t);if(c){n=i;break}o=o.parent}r[t]=n}return zo(n)&&(n=n.call(this.view)),n};function _e(){this.templateCache={_cache:{},set:function(t,r){this._cache[t]=r},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}_e.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};_e.prototype.parse=function(t,r){var n=this.templateCache,o=t+":"+(r||je.tags).join(":"),i=typeof n<"u",s=i?n.get(o):void 0;return s==null&&(s=nv(t,r),i&&n.set(o,s)),s};_e.prototype.render=function(t,r,n,o){var i=this.getConfigTags(o),s=this.parse(t,i),a=r instanceof Kt?r:new Kt(r,void 0);return this.renderTokens(s,a,n,t,o)};_e.prototype.renderTokens=function(t,r,n,o,i){for(var s="",a,c,l,u=0,p=t.length;u<p;++u)l=void 0,a=t[u],c=a[0],c==="#"?l=this.renderSection(a,r,n,o,i):c==="^"?l=this.renderInverted(a,r,n,o,i):c===">"?l=this.renderPartial(a,r,n,i):c==="&"?l=this.unescapedValue(a,r):c==="name"?l=this.escapedValue(a,r,i):c==="text"&&(l=this.rawValue(a)),l!==void 0&&(s+=l);return s};_e.prototype.renderSection=function(t,r,n,o,i){var s=this,a="",c=r.lookup(t[1]);function l(d){return s.render(d,r,n,i)}if(c){if(zt(c))for(var u=0,p=c.length;u<p;++u)a+=this.renderTokens(t[4],r.push(c[u]),n,o,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")a+=this.renderTokens(t[4],r.push(c),n,o,i);else if(zo(c)){if(typeof o!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(r.view,o.slice(t[3],t[5]),l),c!=null&&(a+=c)}else a+=this.renderTokens(t[4],r,n,o,i);return a}};_e.prototype.renderInverted=function(t,r,n,o,i){var s=r.lookup(t[1]);if(!s||zt(s)&&s.length===0)return this.renderTokens(t[4],r,n,o,i)};_e.prototype.indentPartial=function(t,r,n){for(var o=r.replace(/[^ \t]/g,""),i=t.split(`
|
|
68
68
|
`),s=0;s<i.length;s++)i[s].length&&(s>0||!n)&&(i[s]=o+i[s]);return i.join(`
|
|
69
|
-
`)};
|
|
69
|
+
`)};_e.prototype.renderPartial=function(t,r,n,o){if(n){var i=this.getConfigTags(o),s=zo(n)?n(t[1]):n[t[1]];if(s!=null){var a=t[6],c=t[5],l=t[4],u=s;c==0&&l&&(u=this.indentPartial(s,l,a));var p=this.parse(u,i);return this.renderTokens(p,r,n,u,o)}}};_e.prototype.unescapedValue=function(t,r){var n=r.lookup(t[1]);if(n!=null)return n};_e.prototype.escapedValue=function(t,r,n){var o=this.getConfigEscape(n)||je.escape,i=r.lookup(t[1]);if(i!=null)return typeof i=="number"&&o===je.escape?String(i):o(i)};_e.prototype.rawValue=function(t){return t[1]};_e.prototype.getConfigTags=function(t){return zt(t)?t:t&&typeof t=="object"?t.tags:void 0};_e.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!zt(t))return t.escape};var je={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){Er.templateCache=e},get templateCache(){return Er.templateCache}},Er=new _e;je.clearCache=function(){return Er.clearCache()};je.parse=function(t,r){return Er.parse(t,r)};je.render=function(t,r,n,o){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Wy(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Er.render(t,r,n,o)};je.escape=Qy;je.Scanner=xr;je.Context=Kt;je.Writer=_e;import{fileURLToPath as sv}from"url";var _l=()=>bl.resolve(bl.dirname(sv(import.meta.url)),"../package.json");var Xo=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 h.green;case"error":return h.red;case"warning":return h.yellow;case"info":return h.blue;case"instruction":return h.cyan;case"progress":return h.reset;case"debug":return h.gray;case"raclette":return h.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):h.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)}},f=new Xo;var dv=["js","mjs","ts","yaml","yml"],xl=async()=>{function e(r){if(typeof r=="string"){if(r==="true")return!0;if(r==="false")return!1;if(/^\d+$/.test(r)){let n=Number(r);if(!isNaN(n))return n}if(/^\d+\.\d+$/.test(r)){let n=Number(r);if(!isNaN(n))return n}return r}if(Array.isArray(r))return r.map(n=>e(n));if(r&&typeof r=="object"){let n={};for(let[o,i]of Object.entries(r))n[o]=e(i);return n}return r}let t=(0,El.config)({path:lv(process.cwd(),".env")}).parsed;return e(t)},fv=kr.join(kr.dirname(_l()),"raclette.default.config.yaml"),$t=async(e=fv,t={})=>{let n={env:{[process.env?.environment||"development"]:t}},o=cv(e),i=o,s;try{switch(av(e)){case".*":let a=e.slice(0,-1);s=await $t(a+dv.find(c=>Zr.existsSync(a+c)));break;case".yaml":case".yml":s=Se.load(Zr.readFileSync(o,"utf8"),{filename:e});break;case".ts":case".mjs":case".js":s=(await import(`${pv(o).href}?t=${Date.now()}`)).default;break;default:throw new TypeError(`config.load() does not support ${e} file extension.`)}}catch(a){throw new Error(`Failed to load config ${o}: ${a?.message}`)}return yt(s,n)},Jo=(...e)=>{let t=e[0];for(let r of e.slice(1))t=yt(t,r);return t},Qo=async(e,t)=>{f.debug("Generating service configuration files...");let r={name:e.name,env:e.env,modules:e.modules,plugins:e.plugins,global:e.global};for(let n of Ye){let o=kr.join(t,n);Zr.ensureDirSync(o);let i={...r,service:n,...e[n]},s=`// Generated Raclette ${n} Configuration
|
|
70
70
|
// This file is auto-generated, do not edit directly
|
|
71
71
|
|
|
72
72
|
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
73
73
|
|
|
74
74
|
export default racletteConfig;
|
|
75
|
-
`;
|
|
76
|
-
`)[0]:e=
|
|
75
|
+
`;Zr.writeFileSync(kr.join(o,"raclette.config.js"),s)}},kl=(e,t)=>{let r=gl(kr.join(e,"raclette.config"));f.progress(`\u{1F50D} Watching for changes in original config: ${r}`);let n=uv.watch(r,{ignored:/(^|[/\\])\../,persistent:!0});return n.on("change",async o=>{f.progress(`\u{1F4DD} Original config file changed: ${o}`);try{await $t(r,t)}catch(i){f.error("Error reloading configuration: "+i.message)}}),()=>n.close()};import{spawn as wa}from"child_process";import Rt,{pathExists as Ow}from"fs-extra";import Ge from"path";import nn from"fs-extra";import Jt from"path";import{execSync as it}from"child_process";import mv from"fs-extra";var en=null,Zo=()=>{if(en)return en;let e=gv(),t=yv(e),r=e,n=!0,o=vv(t);return en={dockerPath:e,composeCommand:r,isModernCompose:n,version:t,isDocker28Plus:o},en};var gv=()=>{try{let e;process.platform==="win32"?e=it("where docker",{stdio:"pipe",encoding:"utf8"}).trim().split(`
|
|
76
|
+
`)[0]:e=it("which docker",{stdio:"pipe",encoding:"utf8"}).trim();try{return it(`"${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(mv.existsSync(r))try{return it(`"${r}" --version`,{stdio:"pipe"}),f.debug(h.yellow(`Found Docker at: ${r}`)),r}catch{}throw new Error("Docker not found in PATH or common installation locations")}},yv=e=>{try{return it(`"${e}" --version`,{stdio:"pipe",encoding:"utf8"}).trim()}catch{return console.warn(h.yellow("Could not determine Docker version")),"unknown"}},vv=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},tn=()=>{f.raw(h.blue("\u{1F433} Checking Docker installation..."));try{let e=Zo();f.debug(`\u2705 Docker found at: ${e.dockerPath}`),f.debug(`Docker version: ${e.version}`);try{it(`"${e.dockerPath}" compose version`,{stdio:"pipe"}),f.debug("\u2705 Docker Compose (modern) is available")}catch{throw console.error(h.red(`
|
|
77
77
|
\u274C Modern Docker Compose is not available`)),console.warn(h.yellow(`
|
|
78
|
-
\u{1F4CB} Raclette requires Docker with integrated 'compose' command`)),console.warn(h.yellow("Please update to Docker version 20.10.13+ or Docker Desktop 4.1.0+")),new Error("Modern Docker Compose is required")}e.isDocker28Plus&&f.debug("\u26A0\uFE0F Detected Docker 28+, using enhanced path resolution");try{
|
|
78
|
+
\u{1F4CB} Raclette requires Docker with integrated 'compose' command`)),console.warn(h.yellow("Please update to Docker version 20.10.13+ or Docker Desktop 4.1.0+")),new Error("Modern Docker Compose is required")}e.isDocker28Plus&&f.debug("\u26A0\uFE0F Detected Docker 28+, using enhanced path resolution");try{it(`"${e.dockerPath}" info`,{stdio:"pipe",encoding:"utf8"}),f.success(" Docker daemon is running")}catch{throw f.error("Docker daemon is not running"),f.warn("Please start Docker Desktop or the Docker daemon and try again."),process.platform==="darwin"?console.log(h.yellow(`
|
|
79
79
|
macOS: Start Docker Desktop from the Applications folder`)):process.platform==="win32"?console.log(h.yellow(`
|
|
80
80
|
Windows: Start Docker Desktop from the Start menu`)):console.log(h.yellow(`
|
|
81
81
|
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:(f.error("Docker installation issue: "+e.message),console.log(h.yellow(`
|
|
82
|
-
\u{1F4E5} Installation guide:`)),console.log(h.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(h.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(h.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},
|
|
83
|
-
Error: ${o.message}`)}},
|
|
84
|
-
Error: ${o.message}`)}},
|
|
85
|
-
`).
|
|
82
|
+
\u{1F4E5} Installation guide:`)),console.log(h.yellow(" \u2022 Mac: https://docs.docker.com/desktop/install/mac/")),console.log(h.yellow(" \u2022 Windows: https://docs.docker.com/desktop/install/windows/")),console.log(h.yellow(" \u2022 Linux: https://docs.docker.com/engine/install/")),new Error("Docker is not installed or not accessible"))}},ue=(e,t={})=>{let n=`"${Zo().dockerPath}" ${e.join(" ")}`;try{let o=it(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}
|
|
83
|
+
Error: ${o.message}`)}},Ee=(e,t={})=>{let n=`"${Zo().composeCommand}" compose ${e.join(" ")}`;f.debug(`Execute Docker Command: ${n}`);try{let o=it(n,{stdio:"pipe",encoding:"utf8",shell:!0,...t});return typeof o=="string"?o:""}catch(o){throw new Error(`Docker Compose command failed: ${n}
|
|
84
|
+
Error: ${o.message}`)}},wr=e=>{try{return ue(["ps","-a","--filter",`name=^${e}$`,"--format",'"{{.Names}}"']).trim().split(`
|
|
85
|
+
`).some(r=>r.trim()===e)}catch{return!1}},Xt=e=>{try{return ue(["ps","--filter",`name=^${e}$`,"--format",'"{{.Names}}"']).trim().split(`
|
|
86
|
+
`).some(r=>r.trim()===e)}catch{return!1}},rn=e=>{f.debug(`\u{1F310} Checking for Docker network '${e}'...`);try{ue(["network","inspect",e]),f.debug(`\u2705 Network '${e}' already exists`);return}catch{f.debug(`\u{1F310} Creating Docker network '${e}'...`);try{ue(["network","create",e],{stdio:"inherit"}),f.debug(`\u2705 Network '${e}' created`)}catch(r){if(r.message?.includes("already exists")){f.debug(`\u2705 Network '${e}' already exists`);return}throw f.error("Failed to create network: "+r.message),r}}},ei=(e,t,r={})=>ue(["exec",e,"sh","-c",`"${t}"`],r),bv=e=>{try{let t=ue(["ps","-a","--filter",`name=^${e}`,"--format",'"{{.Names}}"']);return t.trim()?t.trim().split(`
|
|
87
|
+
`).filter(r=>r.trim().length>0):[]}catch{return[]}},wl=e=>{let t=bv(e);if(t.length===0){f.debug(`\u26A0\uFE0F No containers found with prefix '${e}'`);return}f.debug(`\u26A0\uFE0F Found ${t.length} container(s) with prefix '${e}':`),t.forEach(r=>{f.debug(` - ${r}`)});try{f.debug("Stopping containers..."),ue(["stop",...t],{stdio:"inherit"}),f.debug("Removing containers..."),ue(["rm",...t],{stdio:"inherit"}),f.success(`Successfully stopped and removed ${t.length} container(s)`)}catch(r){throw f.error(`Failed to stop containers with prefix '${e}': ${r.message}`),r}};var _v="raclette-public-shared",Ev=e=>e&&(e.startsWith("./")?"../"+e.substring(2):e.startsWith("../")?"../../"+e.substring(3):e),ti=(e,t)=>Jt.isAbsolute(e)||!e.includes("/")&&!e.includes("\\")?e:e.startsWith("./")||e.startsWith("../")?Jt.resolve(t,e):Jt.resolve(t,e),on=(e,t)=>{if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>on(n,t));let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(n==="source"||n==="device")?r[n]=ti(o,t):typeof o=="string"&&(n==="context"||n==="dockerfile"||n.endsWith("Path")||n.endsWith("Dir")||n.includes("path")||n.includes("Path"))?r[n]=Ev(o):o&&typeof o=="object"?r[n]=on(o,t):r[n]=o;return r},_t=(e,t)=>{let r=on(e,t);if(r.source&&r.source.includes("/")&&(r.source=ti(r.source,t)),r.mustExist&&!nn.existsSync(r.source))return f.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},xv=(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=ti(n,t);return i?`${s}:${o}:${i}`:`${s}:${o}`},sn=(e,t)=>e.map(r=>typeof r=="string"?xv(r,t):r).map(r=>r),ri=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[_v]=null,e.volumes&&Object.entries(e.volumes).forEach(([p,d])=>{d===null?a.volumes[p]=null:a.volumes[p]=on(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;wr(p)&&(f.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;wr(p)&&(f.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`,y=e.services.mongodb.volume?e.services.mongodb.volume:`${e.name}-mongodb-data`,g=e.services.mongodb.volumeConfig?e.services.mongodb.volumeConfig:`${e.name}-mongodb-config`;a.services.mongodb={container_name:`\${RACLETTE_MONGODB_CONTAINERNAME:-${d}}`,image:"mongo:8.2",restart:"unless-stopped",ports:[`127.0.0.1:\${RACLETTE_MONGODB_PORT:-${e.services.mongodb.port}}:27017`],volumes:[`\${RACLETTE_MONGODB_VOLUME:-${y}}:/data/db`,`\${RACLETTE_MONGODB_CONFIG_VOLUME:-${g}}:/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(m=>{let E=_t(m,t);E&&a.services.mongodb.volumes.push(E)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=null),!g.startsWith("/")&&!g.startsWith("./")&&(a.volumes[g]=null)}if(e.services.cache?.enabled&&!u){let d=!!e.services.cache.name?e.services.cache.name:`${e.name}-cache`,y=e.services.cache.volume?e.services.cache.volume:`${e.name}-cache-data`;a.services.cache={container_name:`\${RACLETTE_CACHE_CONTAINERNAME:-${d}}`,image:"valkey/valkey:9.0-alpine",ports:[`127.0.0.1:\${RACLETTE_CACHE_PORT:-${e.services.cache.port}}:6379`],volumes:[`\${RACLETTE_CACHE_VOLUME:-${y}}:/data`],networks:["raclette_shared"],healthcheck:{test:["CMD","valkey-cli","ping"],interval:"10s",timeout:"5s",retries:3}};let g=e?.backend?.cache?.RDB_OPTIONS??"3600 1 300 100 60 10000",m=e?.backend?.cache?.persistence||"none";m==="none"&&(a.services.cache.command='valkey-server --save ""'),m==="aof"&&(a.services.cache.command="valkey-server --appendonly yes"),m==="rdb"&&(a.services.cache.command="valkey-server --save "+g),m==="rdb+aof"&&(a.services.cache.command="valkey-server --appendonly yes --save "+g),e.services.cache.volumes&&e.services.cache.volumes.length>0&&e.services.cache.volumes.forEach(E=>{let k=_t(E,t);k&&a.services.cache.volumes.push(k)}),!y.startsWith("/")&&!y.startsWith("./")&&(a.volumes[y]=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`,y=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(([g,m])=>`${g}=${m}`)],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",`${Qt("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(g=>{let m=_t(g,t);m&&a.services.backend.volumes.push(m)}),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 d=e.services.frontend.name??`${e.name}-frontend`,y=e.services.frontend.nodeModulesVolume||`${e.name}-frontend_node_modules`,g=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(([m,E])=>`${m}=${E}`)],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",`${Qt("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(m=>{let E=_t(m,t);E&&a.services.frontend.volumes.push(E)}),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 d=e.env?.development?.RACLETTE_CORE_ABSOLUTE_PATH,y=d&&!d.endsWith("/")?d+"/":d;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=sn(p.volumes,t))}),await nn.writeFile(r,Se.dump(a)),await an(e,Jt.dirname(r),o)},Qt=(e,t)=>{let r=t.lockFiles?.[e];return r||`./${e}.yarn.lock`},Cl=async(e,t,r,n="development")=>{await ri(e,t,r,!1,n,!1,!1)},an=async(e,t,r)=>{let n=Jt.join(t,"backend.Dockerfile"),o=`FROM node:24.4-alpine3.21
|
|
86
88
|
WORKDIR /app
|
|
87
89
|
|
|
88
90
|
# add bash since alpine doesn't come with a shell
|
|
@@ -118,7 +120,7 @@ EXPOSE 9229
|
|
|
118
120
|
|
|
119
121
|
# default command
|
|
120
122
|
CMD ["yarn", "run", "${r==="production"?"build":"dev"}"]
|
|
121
|
-
`;await
|
|
123
|
+
`;await nn.writeFile(n,o);let i=Jt.join(t,"frontend.Dockerfile"),s=`FROM node:24-alpine3.21 AS build
|
|
122
124
|
WORKDIR /app
|
|
123
125
|
|
|
124
126
|
RUN apk update && apk add bash curl ${(e.services.frontend?.installPackages||[]).join(" ")}
|
|
@@ -173,7 +175,7 @@ RUN chmod +x /docker-entrypoint.d/entrypoint.sh
|
|
|
173
175
|
ENV PORT 80
|
|
174
176
|
EXPOSE 80
|
|
175
177
|
|
|
176
|
-
CMD ["nginx", "-g", "daemon off;"]`;await
|
|
178
|
+
CMD ["nginx", "-g", "daemon off;"]`;await nn.writeFile(i,s)};import Al from"path";var cn=async(e,t,r)=>Ye.filter(n=>r||e.services[n]?.enabled),ln=async(e,t,r,n={})=>{if(r.length===0)return;console.log(h.blue(`\u{1F504} Rebuilding services: ${r.join(", ")}`));let o=Al.join(t,"docker-compose.yml"),s=["-p",e.name??Al.basename(process.cwd()),"-f",o,"build"];n.noCache&&s.push("--no-cache");for(let a of r)try{console.log(h.blue(`\u{1F504} Rebuilding ${a} service...`)),Ee([...s,a],{stdio:"inherit"}),f.success(` Service ${a} rebuilt successfully`)}catch(c){f.error(`Error rebuilding service ${a}: ${c.message}`)}};import Ml from"fs-extra";import Bl from"path";var Sl=(e=!1)=>["eslint","@eslint/js","globals","eslint-config-prettier","prettier","eslint-plugin-prettier",...e?ni():[]],ni=()=>[],Rl=()=>["import globals from 'globals';","import eslintConfigPrettier from 'eslint-config-prettier';"],Ol=(e=!1)=>{let t=` // JavaScript config
|
|
177
179
|
{
|
|
178
180
|
files: ["**/*.{js,mjs,cjs}"],
|
|
179
181
|
languageOptions: {
|
|
@@ -218,7 +220,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
218
220
|
}
|
|
219
221
|
}`;return e?t+`,
|
|
220
222
|
|
|
221
|
-
`+
|
|
223
|
+
`+kv():t},kv=()=>` // Style recommended config
|
|
222
224
|
{
|
|
223
225
|
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
|
|
224
226
|
rules: {
|
|
@@ -241,7 +243,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
241
243
|
{ min: 3, exceptions: ["i", "j", "a", "b", "fs", "id"], properties: "never" },
|
|
242
244
|
],
|
|
243
245
|
}
|
|
244
|
-
}`;var
|
|
246
|
+
}`;var oi=(e=!1)=>["eslint-plugin-react","eslint-plugin-react-hooks",...e?ii():[]],ii=()=>[],Tl=()=>["import react from 'eslint-plugin-react';","import reactHooks from 'eslint-plugin-react-hooks';"],Pl=(e=!1)=>{let t=` // React config
|
|
245
247
|
{
|
|
246
248
|
files: ["**/*.{jsx,tsx}"],
|
|
247
249
|
plugins: {
|
|
@@ -265,7 +267,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
265
267
|
}
|
|
266
268
|
}`;return e?t+`,
|
|
267
269
|
|
|
268
|
-
`+
|
|
270
|
+
`+wv():t},wv=()=>"";var $l=(e=!1)=>["typescript-eslint",...e?si():[]],si=()=>["eslint-plugin-import","eslint-plugin-prefer-arrow-functions"],Dl=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},Nl=(e=!1)=>{let r=` // TypeScript config
|
|
269
271
|
{
|
|
270
272
|
files: ["**/*.{ts,tsx}"],
|
|
271
273
|
plugins: ${e?`{
|
|
@@ -294,7 +296,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
294
296
|
}
|
|
295
297
|
}`;return e?r+`,
|
|
296
298
|
|
|
297
|
-
`+
|
|
299
|
+
`+Cv():r},Cv=()=>` // TypeScript recommended config
|
|
298
300
|
{
|
|
299
301
|
files: ["**/*.{ts,tsx}"],
|
|
300
302
|
rules: {
|
|
@@ -377,7 +379,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
377
379
|
}
|
|
378
380
|
]
|
|
379
381
|
}
|
|
380
|
-
}`;var
|
|
382
|
+
}`;var ai=(e=!1)=>["eslint-plugin-vue","vue-eslint-parser",...e?ci():[]],ci=()=>[],Ll=()=>["import vue from 'eslint-plugin-vue';","import vueEslintParser from 'vue-eslint-parser';"],Il=(e=!1)=>{let t=` // Vue config
|
|
381
383
|
{
|
|
382
384
|
files: ["**/*.vue"],
|
|
383
385
|
// Manually add Vue plugin
|
|
@@ -415,11 +417,10 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
415
417
|
"vue/valid-v-show": "error",
|
|
416
418
|
"vue/valid-v-slot": "error",
|
|
417
419
|
"vue/valid-v-text": "error",
|
|
418
|
-
...tailwindcss.configs.recommended.rules
|
|
419
420
|
}
|
|
420
421
|
}`;return e?t+`,
|
|
421
422
|
|
|
422
|
-
`+
|
|
423
|
+
`+Av():t},Av=()=>` // Vue recommended config
|
|
423
424
|
{
|
|
424
425
|
files: ["**/*.vue"],
|
|
425
426
|
rules: {
|
|
@@ -462,7 +463,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
462
463
|
"vue/v-on-style": "error",
|
|
463
464
|
"vue/v-slot-style": "error"
|
|
464
465
|
}
|
|
465
|
-
}`;
|
|
466
|
+
}`;var Fl=e=>{let t=e.eslint?.useRecommended!==!1,r=[...Sl(),...$l()];return e.frontend?.framework==="vue"?r.push(...ai()):e.frontend?.framework==="react"&&r.push(...oi()),t&&(r.push(...ni(),...si()),e.frontend?.framework==="vue"?r.push(...ci()):e.frontend?.framework==="react"&&r.push(...ii())),[...new Set(r)]};import{existsSync as li}from"fs";import ui from"path";var jl=e=>{let t=[...e].sort(),r=li(ui.join(process.cwd(),"yarn.lock")),n=li(ui.join(process.cwd(),"pnpm-lock.yaml")),o=li(ui.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 un=async(e,t,r=!0)=>{let n=Bl.join(t,"eslint.config.mjs");f.debug(`Generating eslint.config.mjs in ${t}`);let o=e.eslint?.useRecommended!==!1,i=Sv(e,o),s=[];if(s.push(` // TS ESLint base rules
|
|
466
467
|
{
|
|
467
468
|
files: ["**/*.{ts,tsx}"],
|
|
468
469
|
plugins: {
|
|
@@ -493,7 +494,7 @@ CMD ["nginx", "-g", "daemon off;"]`;await en.writeFile(i,s)};import el from"path
|
|
|
493
494
|
".raclette/**",
|
|
494
495
|
".gitignore"
|
|
495
496
|
]
|
|
496
|
-
}`),s.push(
|
|
497
|
+
}`),s.push(Ol(o)),s.push(Nl(o)),e.frontend?.framework==="vue"&&s.push(Il(o)),e.frontend?.framework==="react"&&s.push(Pl(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
|
|
497
498
|
{
|
|
498
499
|
rules: ${c}
|
|
499
500
|
}`)}if(e.eslint?.ignores&&e.eslint.ignores.length>0){let c=JSON.stringify(e.eslint.ignores).replace(/^\[|\]$/g,"");s.push(` // User custom ignores
|
|
@@ -531,7 +532,7 @@ export const withRaclette = (...userConfigs) => {
|
|
|
531
532
|
|
|
532
533
|
// Default export for direct usage
|
|
533
534
|
export default racletteEslintConfig
|
|
534
|
-
`;await
|
|
535
|
+
`;await Ml.writeFile(n,a),r&&await Rv(t,e),f.debug(`Generated eslint.config.mjs in ${t}`)},Sv=(e,t)=>{let r=[];return r.push(...Rl()),r.push(...Dl(t)),e.frontend?.framework==="vue"?r.push(...Ll()):e.frontend?.framework==="react"&&r.push(...Tl()),r},Rv=async(e,t)=>{let r=Bl.join(e,"ESLINT-README.md"),n=Fl(t),i=`# racletteJS ESLint Configuration
|
|
535
536
|
|
|
536
537
|
This directory contains an auto-generated ESLint configuration for your racletteJS project.
|
|
537
538
|
|
|
@@ -540,7 +541,7 @@ This directory contains an auto-generated ESLint configuration for your raclette
|
|
|
540
541
|
To use this ESLint configuration, you need to install the following dependencies:
|
|
541
542
|
|
|
542
543
|
\`\`\`bash
|
|
543
|
-
${
|
|
544
|
+
${jl(n)}
|
|
544
545
|
\`\`\`
|
|
545
546
|
|
|
546
547
|
## How to Use
|
|
@@ -617,49 +618,49 @@ export default {
|
|
|
617
618
|
}
|
|
618
619
|
}
|
|
619
620
|
\`\`\`
|
|
620
|
-
`;await ml.writeFile(r,u)};import{execSync as tf}from"child_process";import Y from"fs-extra";import re from"path";import rk from"chokidar";import D from"fs-extra";import P from"path";var Rt=Mo().name,zd=[".prettierrc","eslint.config.js"],nk=["bin/check-dependencies.sh"],Zd=async()=>{let e=P.join(process.cwd(),".raclette");return await D.ensureDir(e),e},Gn=async(e,t,r)=>{let n=process.cwd(),o=P.join(n,".raclette"),i=P.join(o,"virtual"),s=Un();f.debug(`\u{1F4E6} Using core package at: ${s}`),await lk(o,s,nk),f.debug("[VFS] Cleaning virtual file system directory..."),await D.pathExists(i)&&await D.rm(i,{recursive:!0}),await D.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,u={backend:["/"],frontend:["/"]},l=[...a].sort((g,E)=>E.priority-g.priority).map(g=>{let E=g.path.startsWith(".")?P.join(process.cwd(),g.path):g.path;return{...g,path:E}});await ak(l,c,i,u,zd,o);let p=[],d=g=>{let E=P.relative(n,g);return c.get(E)||g},y=()=>{p.forEach(E=>E.close()),p.length=0,ok(l,u,i).forEach(E=>{if(D.existsSync(E.sourcePath)){let A=ik(E,l,c,zd);p.push(A)}})},m=()=>p.forEach(g=>g.close());return r||y(),{resolveFile:d,watchFiles:y,close:m}},ok=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",u=P.join(o.path,c,i,a);n.push({sourcePath:u,sourceDir:o,targetResolver:l=>P.join(r,i,a,l),mappingKeyResolver:l=>P.join(i,a,l)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=P.join(o.path,i);D.existsSync(a)&&D.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(l=>{n.push({sourcePath:P.dirname(a),sourceDir:o,targetResolver:p=>P.basename(a)===p?P.join(r,l):P.join(r,l,p),mappingKeyResolver:p=>P.basename(a)===p?i:P.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:u=>P.join(r,i,u),mappingKeyResolver:u=>P.join(i,u)})})}),n},ik=(e,t,r,n)=>{f.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=rk.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(ck(a,n))return;let u=e.mappingKeyResolver(a),l=e.targetResolver(a);await sk(t,r,u,l,a,c)};return i.on("add",a=>s(a)),i.on("change",a=>s(a)),i.on("unlink",a=>s(a,!0)),i},sk=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=Jd(s,r,o);a?(await D.ensureDir(P.dirname(n)),await D.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await D.pathExists(n)&&await D.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`))}else{let a=Jd(s,r,o);a&&(await D.ensureDir(P.dirname(n)),await D.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},Jd=(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(P.join(i,a,r)===t){let u=n.servicePathMap?.[i]||"",l=P.join(n.path,u,i,a,r);if(D.existsSync(l))return{sourceDir:n,fullPath:l}}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 u,l;if(i===t){if(l=P.join(n.path,i),D.existsSync(l))return{sourceDir:n,fullPath:l}}else if(u=P.join(i,r),u===t&&(l=P.join(n.path,i,r),D.existsSync(l)))return{sourceDir:n,fullPath:l}}}}return null},Qd=async(e,t,r,n,o,i)=>{if(!D.pathExistsSync(t))return;await D.ensureDir(P.dirname(r));let s=e.name==="generated-service-files";await D.copy(t,r,{overwrite:!0,filter:u=>{let l=P.basename(u);if(i.includes(l))return!1;if(s&&(l==="package.json"||l==="yarn.lock"))return!0;if(!s&&(l==="package.json"||l==="yarn.lock"))return!1;let p=P.relative(t,u);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")}});let c=await uk(t,s?["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss","**/package.json","**/yarn.lock"]:["**/*.vue","**/*.ts","**/*.js","**/*.json","**/*.css","**/*.scss"]);for(let u of c){let l=P.basename(u);if(i.includes(l))continue;if(!(s&&(l==="package.json"||l==="yarn.lock"))){if(!s&&(l==="package.json"||l==="yarn.lock"))continue}let p=P.relative(t,u),d=P.join(o,p),y=P.join(r,p);n.set(d,y)}f.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},ak=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await D.pathExists(s.path)){console.warn(h.yellow(`[VFS] Source directory not found: ${s.path}`));continue}for(let[a,c]of Object.entries(n))for(let u of c){let l=s.servicePathMap?.[a]||"";if(!l)continue;let p=P.join(s.path,l,a,u),d=P.join(r,a,u),y=P.join(a,u);await Qd(s,p,d,t,y,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let u=P.join(s.path,a),l=(Array.isArray(c)?c:[c]).map(d=>P.join(r,d)),p=await D.pathExists(u)&&(await D.stat(u)).isFile();if(!p&&s.clear)for(let d of l)await D.rm(d,{recursive:!0,force:!0}),await D.ensureDir(d);if(p)for(let d of l)await D.ensureDir(P.dirname(d)),await D.copy(u,d),t.set(a,d),f.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of l)await Qd(s,u,d,t,d,o)}}f.debug("[VFS] Built virtual file system")},ck=(e,t)=>t.includes(P.basename(e));var lk=async(e,t,r)=>{let n=P.join(e,"dist");await D.ensureDir(n);for(let o of r){let i=P.join(t,o),s=P.basename(o),a=P.join(n,s);await D.pathExists(a)&&await D.remove(a),await D.pathExists(i)&&(await D.ensureDir(P.dirname(a)),await D.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await D.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}},uk=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(Xd(),Kd));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Un=()=>{let e=process.cwd(),r=(e.includes("node_modules")?[[e.match(/(.*node_modules)/)?.[1]||"",Rt],[e,"node_modules",Rt],[e,"../../..",Rt]]:[[e,"node_modules",Rt],[e,"../..","raclette"],[e,"../..",Rt],[e,"../..","core"],[e,"..","raclette"],[e,"..",Rt],[e,"..","core"]]).map(o=>P.resolve(...o,"package.json")).find(o=>D.readJsonSync(o,{throws:!1})?.name===Rt);if(r)return r.slice(0,-12);let n="Could not determine core package path to set up VFS. Canceling...";throw f.error(n),new Error(n)},ef=async(e,t)=>await D.pathExists(e)?(await D.ensureDir(P.dirname(t)),await D.copy(e,t),f.debug(`\u2705 Copied ${P.basename(e)} to ${t}`),!0):(f.warn(h.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var pk=async(e,t,r=!1)=>{r&&f.progress(`Loading merged packages for ${e}...`);let n=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],o={},i={};for(let s of n)try{let a=await dk(s);if(a.dependencies){o={...o,...a.dependencies};let c=Object.keys(a.dependencies).length;c>0&&r&&f.success(`Merged ${c} dependencies from ${s.file}:${s.key}`)}if(a.devDependencies){i={...i,...a.devDependencies};let c=Object.keys(a.devDependencies).length;c>0&&r&&f.success(`Merged ${c} devDependencies from ${s.file}:${s.key}`)}}catch(a){throw f.error(`Error loading package source ${s.file}:${s.key} - ${a.message}`),f.error(`Aborting package setup for ${e}`),a}return r&&f.raw(h.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(o).length} deps, ${Object.keys(i).length} devDeps`)),{dependencies:o,devDependencies:i}},dk=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await Y.pathExists(e.file))return f.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await Y.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 f.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(f.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}`)}},Wn=(e,t)=>{let r=t.lockFiles?.[e];if(r)return f.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=re.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},Zs=async(e,t)=>{let r=await Zd();if(!t)try{t=await import(re.join(process.cwd(),"raclette.config.js")).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Be.includes(e)&&await rf(`services/${e}/package.json`,re.join(r,e),e,t,!1),eo.includes(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},fk=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=re.join(process.cwd(),"package.json");if(!await Y.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await Y.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],f.debug(`Found plugin ${s}@${n[s]}`)):f.warn(`Plugin ${s} is enabled in config but not found in package.json`);return i}catch(r){return f.warn(`Error reading app package.json: ${r.message}`),{}}},rf=async(e,t,r,n,o=!1)=>{let i=Un();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await Y.ensureDir(t);let s=re.join(i,e),a=re.dirname(s),c=re.join(t,"package.json");if(!Y.pathExistsSync(s))return f.warn(`Warning: Could not find package.json at ${s}`);o&&f.debug("Reading source package.json...");try{let u=await Y.readJson(s),l=["frontend","backend"].includes(r)?await pk(r,n,o):{dependencies:{},devDependencies:{}},p=await fk(n),d={...u.dependencies,...l.dependencies,...p},y={...u.devDependencies,...l.devDependencies},m=lt(u,{dependencies:d,devDependencies:y});o&&f.debug("Writing merged package.json..."),await Y.writeJson(c,m,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await vk(a,t,r,n)}catch(u){throw f.error(`Error setting up package.json for ${r}: ${u.message}`),u}},qn=async e=>{let t=re.join(process.cwd(),e.root);f.progress("Setting up node packages for services...");for(let r of Be){if(!e.services[r]?.enabled)continue;let n=re.join(t,r);await rf(`services/${r}/package.json`,n,r,e,!0),await ef(Wn(r,e),re.join(n,"yarn.lock"))}},hk=async()=>{let e=re.join(process.cwd(),"packages.json");if(await Y.pathExists(e))try{return await Y.readJson(e)}catch(t){f.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},mk=async e=>{let t=re.join(process.cwd(),"packages.json");await Y.writeJson(t,e,{spaces:2})};var gk=async(e,t,r=!1)=>{let n=re.join(process.cwd(),"package.json");if(!await Y.pathExists(n))throw new Error("No package.json found in project root");try{tf("yarn --version",{stdio:"pipe"})}catch{throw new Error("Yarn is not available in PATH")}let o=e;t&&(o=`${e}@${t}`);let s=`yarn add ${o} ${r?"--dev":""}`.trim();f.progress(`Running: ${s}`);try{tf(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await Y.readJson(n),c=r?"devDependencies":"dependencies",u=a[c]?.[e];if(!u)throw new Error(`Package ${e} was not found in ${c} after installation`);return f.success(`Added ${e}@${u} to app package.json ${c}`),u}catch(a){throw new Error(`Failed to add ${e}${t?`@${t}`:""}: ${a.message}`)}},yk=e=>{let t=e.match(/^(@[^/]+\/[^@]+)(?:@(.+))?$/);if(t)return{name:t[1],version:t[2]};let r=e.match(/^([^@]+)(?:@(.+))?$/);return r?{name:r[1],version:r[2]}:{name:e}},nf=async(e,t,r=!1)=>{let{name:n,version:o}=yk(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await gk(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await hk(),a=[...e.split("."),r?"devDependencies":"dependencies"],c=s;for(let u of a)c[u]||(c[u]={}),c=c[u];c[n]=i,f.success(`Added ${n}@${i} to ${a.join(".")}`),a.length==3&&f.instruction("Note: Workbench packages are stored in packages.json but package.json files are not updated"),await mk(s),f.success("Updated packages.json in project root")},Yn=async e=>{let t=Un();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=Wn("frontend",e);if(await Y.pathExists(r))f.debug(`\u{1F512} ${re.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=re.join(t,"services","frontend","yarn.lock");await Y.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await Y.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await Y.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
621
|
+
`;await Ml.writeFile(r,i)};import{execSync as Lf}from"child_process";import K from"fs-extra";import ne from"path";import{pathToFileURL as bw}from"url";import uw from"chokidar";import N from"fs-extra";import P from"path";var It=Yo().name,Tf=[".prettierrc","eslint.config.js"],pw=["bin/check-dependencies.sh"],Df=async()=>{let e=P.join(process.cwd(),".raclette");return await N.ensureDir(e),e},Qn=async(e,t,r)=>{let n=process.cwd(),o=P.join(n,".raclette"),i=P.join(o,"virtual"),s=Zn();f.debug(`\u{1F4E6} Using core package at: ${s}`),await yw(o,s,pw),f.debug("[VFS] Cleaning virtual file system directory..."),await N.pathExists(i)&&await N.rm(i,{recursive:!0}),await N.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((m,E)=>E.priority-m.priority).map(m=>{let E=m.path.startsWith(".")?P.join(process.cwd(),m.path):m.path;return{...m,path:E}});await mw(u,c,i,l,Tf,o);let p=[],d=m=>{let E=P.relative(n,m);return c.get(E)||m},y=()=>{p.forEach(E=>E.close()),p.length=0,dw(u,l,i).forEach(E=>{if(N.existsSync(E.sourcePath)){let k=fw(E,u,c,Tf);p.push(k)}})},g=()=>p.forEach(m=>m.close());return r||y(),{resolveFile:d,watchFiles:y,close:g}},dw=(e,t,r)=>{let n=[];return e.forEach(o=>{Object.entries(t).forEach(([i,s])=>{s.forEach(a=>{let c=o.servicePathMap?.[i]||"",l=P.join(o.path,c,i,a);n.push({sourcePath:l,sourceDir:o,targetResolver:u=>P.join(r,i,a,u),mappingKeyResolver:u=>P.join(i,a,u)})})}),o.folderMappings&&Object.entries(o.folderMappings).forEach(([i,s])=>{let a=P.join(o.path,i);N.existsSync(a)&&N.statSync(a).isFile()?(Array.isArray(s)?s:[s]).forEach(u=>{n.push({sourcePath:P.dirname(a),sourceDir:o,targetResolver:p=>P.basename(a)===p?P.join(r,u):P.join(r,u,p),mappingKeyResolver:p=>P.basename(a)===p?i:P.join(i,p)})}):n.push({sourcePath:a,sourceDir:o,targetResolver:l=>P.join(r,i,l),mappingKeyResolver:l=>P.join(i,l)})})}),n},fw=(e,t,r,n)=>{f.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=uw.watch(o,{cwd:e.sourcePath,ignoreInitial:!0,ignored:["**/node_modules/**","**/.git/**","**/dist/**"]}),s=async(a,c=!1)=>{if(gw(a,n))return;let l=e.mappingKeyResolver(a),u=e.targetResolver(a);await hw(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},hw=async(e,t,r,n,o,i)=>{let s=[...e].sort((a,c)=>a.priority-c.priority);if(i){let a=Pf(s,r,o);a?(await N.ensureDir(P.dirname(n)),await N.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`)):(await N.pathExists(n)&&await N.remove(n),t.delete(r),f.debug(`[VFS] Removed ${r}`))}else{let a=Pf(s,r,o);a&&(await N.ensureDir(P.dirname(n)),await N.copy(a.fullPath,n),t.set(r,n),f.debug(`[VFS] Updated ${r} from ${a.sourceDir.name}`))}},Pf=(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(P.join(i,a,r)===t){let l=n.servicePathMap?.[i]||"",u=P.join(n.path,l,i,a,r);if(N.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=P.join(n.path,i),N.existsSync(u))return{sourceDir:n,fullPath:u}}else if(l=P.join(i,r),l===t&&(u=P.join(n.path,i,r),N.existsSync(u)))return{sourceDir:n,fullPath:u}}}}return null},$f=async(e,t,r,n,o,i)=>{if(!N.pathExistsSync(t))return;await N.ensureDir(P.dirname(r));let s=e.name==="generated-service-files";await N.copy(t,r,{overwrite:!0,filter:l=>{let u=P.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=P.relative(t,l);return!p.startsWith("node_modules")&&!p.startsWith(".git")&&!p.startsWith("dist")}});let c=await vw(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=P.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=P.relative(t,l),d=P.join(o,p),y=P.join(r,p);n.set(d,y)}f.debug(`[VFS] Processed ${e.name}: ${t} -> ${r}`)},mw=async(e,t,r,n,o,i)=>{t.clear();for(let s of e){if(!await N.pathExists(s.path)){console.warn(h.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=P.join(s.path,u,a,l),d=P.join(r,a,l),y=P.join(a,l);await $f(s,p,d,t,y,o)}if(s.folderMappings)for(let[a,c]of Object.entries(s.folderMappings)){let l=P.join(s.path,a),u=(Array.isArray(c)?c:[c]).map(d=>P.join(r,d)),p=await N.pathExists(l)&&(await N.stat(l)).isFile();if(!p&&s.clear)for(let d of u)await N.rm(d,{recursive:!0,force:!0}),await N.ensureDir(d);if(p)for(let d of u)await N.ensureDir(P.dirname(d)),await N.copy(l,d),t.set(a,d),f.debug(`[VFS] Mapped individual file ${a} -> ${d}`);else for(let d of u)await $f(s,l,d,t,d,o)}}f.debug("[VFS] Built virtual file system")},gw=(e,t)=>t.includes(P.basename(e));var yw=async(e,t,r)=>{let n=P.join(e,"dist");await N.ensureDir(n);for(let o of r){let i=P.join(t,o),s=P.basename(o),a=P.join(n,s);await N.pathExists(a)&&await N.remove(a),await N.pathExists(i)&&(await N.ensureDir(P.dirname(a)),await N.copy(i,a,{overwrite:!0,preserveTimestamps:!1}),s.endsWith(".sh")&&await N.chmod(a,493),f.debug(`[VFS] Copied ${s} to dist directory`))}},vw=async(e,t)=>{let{globby:r}=await Promise.resolve().then(()=>(Of(),Rf));return r(t,{cwd:e,absolute:!0,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]})},Zn=()=>{let e=process.cwd(),r=(e.includes("node_modules")?[[e.match(/(.*node_modules)/)?.[1]||"",It],[e,"node_modules",It],[e,"../../..",It]]:[[e,"node_modules",It],[e,"../..","raclette"],[e,"../..",It],[e,"../..","core"],[e,"..","raclette"],[e,"..",It],[e,"..","core"]]).map(o=>P.resolve(...o,"package.json")).find(o=>N.readJsonSync(o,{throws:!1})?.name===It);if(r)return r.slice(0,-12);let n="Could not determine core package path to set up VFS. Canceling...";throw f.error(n),new Error(n)},Nf=async(e,t)=>await N.pathExists(e)?(await N.ensureDir(P.dirname(t)),await N.copy(e,t),f.debug(`\u2705 Copied ${P.basename(e)} to ${t}`),!0):(f.warn(h.yellow(`[VFS]: Specified source file not found for merging process: ${e}`)),!1);var _w=async(e,t,r=!1)=>{r&&f.progress(`Loading merged packages for ${e}...`);let n=t.packageMerging?.[e]||[{file:"./packages.json",key:e}],o={},i={};for(let s of n)try{let a=await Ew(s);if(a.dependencies){o={...o,...a.dependencies};let c=Object.keys(a.dependencies).length;c>0&&r&&f.success(`Merged ${c} dependencies from ${s.file}:${s.key}`)}if(a.devDependencies){i={...i,...a.devDependencies};let c=Object.keys(a.devDependencies).length;c>0&&r&&f.success(`Merged ${c} devDependencies from ${s.file}:${s.key}`)}}catch(a){throw f.error(`Error loading package source ${s.file}:${s.key} - ${a.message}`),f.error(`Aborting package setup for ${e}`),a}return r&&f.raw(h.blue(`\u{1F4CA} Final ${e} package count: ${Object.keys(o).length} deps, ${Object.keys(i).length} devDeps`)),{dependencies:o,devDependencies:i}},Ew=async e=>{if(f.progress(`Loading ${e.file}:${e.key}...`),!await K.pathExists(e.file))return f.debug("packages.json file does not yet exist, no packages will be added."),Promise.resolve({dependencies:{},devDependencies:{}});try{let t=await K.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 f.debug(`\u26A0\uFE0F Key '${e.key}' not found in ${e.file}, skipping`),{};return!n||typeof n!="object"?(f.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}`)}},eo=(e,t)=>{let r=t.lockFiles?.[e];if(r)return f.debug(`\u{1F512} Using custom lock file path for ${e}: ${r}`),r;let n=ne.join(process.cwd(),`${e}.yarn.lock`);return f.debug(`\u{1F512} Using default lock file path for ${e}: ${n}`),n},ka=async(e,t)=>{let r=await Df();if(!t)try{t=await import(bw(ne.join(process.cwd(),"raclette.config.js")).href).then(n=>n.default||n)}catch(n){f.warn(`Could not load raclette.config.js: ${n.message}`),t={name:"raclette-app"}}Ye.includes(e)&&await If(`services/${e}/package.json`,ne.join(r,e),e,t,!1),co.includes(e)&&f.instruction(`Workbench target ${e} - packages.json updated. You need to restart your workbench service manually.`)},xw=async e=>{if(!e.plugins||e.plugins.length===0)return{};let t=ne.join(process.cwd(),"package.json");if(!await K.pathExists(t))return f.warn("No package.json found in app directory"),{};try{let r=await K.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],f.debug(`Found plugin ${s}@${n[s]}`)):f.warn(`Plugin ${s} is enabled in config but not found in package.json`);return i}catch(r){return f.warn(`Error reading app package.json: ${r.message}`),{}}},If=async(e,t,r,n,o=!1)=>{let i=Zn();o&&(f.progress(`Setting up package.json for ${r}`),f.debug(`Source: ${e}`),f.debug(`Target dir: ${t}`)),await K.ensureDir(t);let s=ne.join(i,e),a=ne.dirname(s),c=ne.join(t,"package.json");if(!K.pathExistsSync(s))return f.warn(`Warning: Could not find package.json at ${s}`);o&&f.debug("Reading source package.json...");try{let l=await K.readJson(s),u=["frontend","backend"].includes(r)?await _w(r,n,o):{dependencies:{},devDependencies:{}},p=await xw(n),d={...l.dependencies,...u.dependencies,...p},y={...l.devDependencies,...u.devDependencies},g=yt(l,{dependencies:d,devDependencies:y});o&&f.debug("Writing merged package.json..."),await K.writeJson(c,g,{spaces:2}),o&&f.success(`Created package.json for ${r}`),await Sw(a,t,r,n)}catch(l){throw f.error(`Error setting up package.json for ${r}: ${l.message}`),l}},to=async e=>{let t=ne.join(process.cwd(),e.root);f.progress("Setting up node packages for services...");for(let r of Ye){if(!e.services[r]?.enabled)continue;let n=ne.join(t,r);await If(`services/${r}/package.json`,n,r,e,!0),await Nf(eo(r,e),ne.join(n,"yarn.lock"))}},kw=async()=>{let e=ne.join(process.cwd(),"packages.json");if(await K.pathExists(e))try{return await K.readJson(e)}catch(t){f.warn(`Error reading packages.json: ${t.message}`)}return{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}},workbench:{frontend:{dependencies:{},devDependencies:{}},backend:{dependencies:{},devDependencies:{}}}}},ww=async e=>{let t=ne.join(process.cwd(),"packages.json");await K.writeJson(t,e,{spaces:2})};var Cw=async(e,t,r=!1)=>{let n=ne.join(process.cwd(),"package.json");if(!await K.pathExists(n))throw new Error("No package.json found in project root");try{Lf("yarn --version",{stdio:"pipe"})}catch{throw new Error("Yarn is not available in PATH")}let o=e;t&&(o=`${e}@${t}`);let s=`yarn add ${o} ${r?"--dev":""}`.trim();f.progress(`Running: ${s}`);try{Lf(s,{cwd:process.cwd(),stdio:"pipe",encoding:"utf8"});let a=await K.readJson(n),c=r?"devDependencies":"dependencies",l=a[c]?.[e];if(!l)throw new Error(`Package ${e} was not found in ${c} after installation`);return f.success(`Added ${e}@${l} to app package.json ${c}`),l}catch(a){throw new Error(`Failed to add ${e}${t?`@${t}`:""}: ${a.message}`)}},Aw=e=>{let t=e.match(/^(@[^/]+\/[^@]+)(?:@(.+))?$/);if(t)return{name:t[1],version:t[2]};let r=e.match(/^([^@]+)(?:@(.+))?$/);return r?{name:r[1],version:r[2]}:{name:e}},Ff=async(e,t,r=!1)=>{let{name:n,version:o}=Aw(t);f.raw(h.blue(`\u{1F4E6} Adding package ${n} for ${e}...`));let i=await Cw(n,o,r);f.success(`Package ${n}@${i} validated and installed`);let s=await kw(),a=[...e.split("."),r?"devDependencies":"dependencies"],c=s;for(let l of a)c[l]||(c[l]={}),c=c[l];c[n]=i,f.success(`Added ${n}@${i} to ${a.join(".")}`),a.length==3&&f.instruction("Note: Workbench packages are stored in packages.json but package.json files are not updated"),await ww(s),f.success("Updated packages.json in project root")},ro=async e=>{let t=Zn();if(f.debug("\u{1F512} Ensuring lock files exist for volume mounting..."),e.services.frontend?.enabled){let r=eo("frontend",e);if(await K.pathExists(r))f.debug(`\u{1F512} ${ne.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=ne.join(t,"services","frontend","yarn.lock");await K.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for frontend"),await K.copy(n,r)):(f.debug("\u{1F512} No core frontend yarn.lock found, creating minimal lock file"),await K.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
621
622
|
# yarn lockfile v1
|
|
622
623
|
|
|
623
|
-
`)),f.debug(`\u{1F512}\u2705 Created ${
|
|
624
|
+
`)),f.debug(`\u{1F512}\u2705 Created ${ne.basename(r)}`)}}if(e.services.backend?.enabled){let r=eo("backend",e);if(await K.pathExists(r))f.debug(`\u{1F512} ${ne.basename(r)} already exists`);else{f.debug(`\u{1F512} Creating initial lock file: ${r}`);let n=ne.join(t,"services","backend","yarn.lock");await K.pathExists(n)?(f.debug("\u{1F512} Using core package yarn.lock as starting point for backend"),await K.copy(n,r)):(f.debug("\u{1F512} No core backend yarn.lock found, creating minimal lock file"),await K.writeFile(r,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
624
625
|
# yarn lockfile v1
|
|
625
626
|
|
|
626
|
-
`)),f.debug(`\u{1F512}\u2705 Created ${
|
|
627
|
+
`)),f.debug(`\u{1F512}\u2705 Created ${ne.basename(r)}`)}}f.success("Lock files ready for volume mounting")},Sw=async(e,t,r,n)=>{let o=ne.join(t,"yarn.lock");f.debug(`\u{1F512} Setting up yarn.lock for ${r} build context`);let i;if((r==="frontend"||r==="backend")&&(i=eo(r,n)),i&&await K.pathExists(i))f.debug(`\u{1F512} Copying configured lock file to build context: ${i}`),await K.copy(i,o);else{let s=ne.join(e,"yarn.lock");await K.pathExists(s)?(f.debug(`\u{1F512} Using core yarn.lock for ${r} build context`),await K.copy(s,o)):(f.debug(`\u{1F512} Creating minimal yarn.lock for ${r} build context`),await K.writeFile(o,`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
627
628
|
# yarn lockfile v1
|
|
628
629
|
|
|
629
|
-
`))}};import
|
|
630
|
+
`))}};import jf from"fs-extra";import Mf from"path";var no=async(e,t)=>{let r=Mf.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":["../services/frontend/src/app"],"@app/*":["../services/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"&&(Rw(t),n.include.push("shims.vue.d.ts")),await jf.writeFile(r,JSON.stringify(n,null,2)),f.debug(`Generated tsconfig.json in ${t}`)},Rw=async e=>{await jf.writeFile(Mf.join(e,"shims.vue.d.ts"),`declare module "*.vue" {
|
|
630
631
|
import { DefineComponent } from "vue"
|
|
631
632
|
const component: DefineComponent<{}, {}, any>
|
|
632
633
|
export default component
|
|
633
|
-
}`)};import
|
|
634
|
+
}`)};import ut from"fs-extra";import Ft from"path";var Bf=async(e,t)=>{try{await ut.ensureDir(Ft.dirname(e)),await ut.pathExists(e)&&(await ut.stat(e)).isDirectory()&&(console.warn(h.yellow(`\u26A0\uFE0F Removing directory at ${e} to create file`)),await ut.remove(e)),await ut.writeFile(e,t)}catch(r){throw f.error(` Error writing file ${e}: ${r.message}`),r}},Hf=async(e,t)=>{f.debug("Generating service configuration files...");let r=Ft.join(t,"backend"),n=Ft.join(t,"frontend");await ut.ensureDir(r),await ut.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=`
|
|
634
635
|
// Generated racletteJS Backend Configuration
|
|
635
636
|
// This file is auto-generated, do not edit directly
|
|
636
637
|
|
|
637
638
|
export const racletteConfig = ${JSON.stringify(i,null,2)};
|
|
638
639
|
|
|
639
640
|
export default racletteConfig;
|
|
640
|
-
`;await
|
|
641
|
+
`;await Bf(Ft.join(r,"raclette.config.js"),s);let a={...o,service:"frontend",...e.frontend},c=`
|
|
641
642
|
// Generated racletteJS Frontend Configuration
|
|
642
643
|
// This file is auto-generated, do not edit directly
|
|
643
644
|
|
|
644
645
|
export const racletteConfig = ${JSON.stringify(a,null,2)};
|
|
645
646
|
|
|
646
647
|
export default racletteConfig;
|
|
647
|
-
`;await
|
|
648
|
+
`;await Bf(Ft.join(n,"raclette.config.js"),c),f.success("Service configuration files generated")};var oo=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},io=async(e,t=process.cwd())=>{let r=Ft.join(t,".raclette"),n=Ft.join(r,"raclette.config.workbench.js");await ut.mkdir(r,{recursive:!0});let o=`import { defineRacletteConfig } from "@raclettejs/core"
|
|
648
649
|
|
|
649
650
|
export default defineRacletteConfig(${JSON.stringify(e,null,2)})
|
|
650
|
-
`;return await
|
|
651
|
-
\u2705 Development environment is ready!`)),
|
|
652
|
-
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await
|
|
651
|
+
`;return await ut.writeFile(n,o,"utf8"),n};var Nr=new Map,Gf="yarn",Vf=process.platform==="win32",Uf=async e=>{let t=Ge.join(e,".yarnrc.yml");if(!await Rt.pathExists(t))return!1;let n=(await Rt.readFile(t,"utf8")).match(/^\s*yarnPath\s*:\s*(.+)\s*$/m);if(!n)return!1;let i=n[1].trim().replace(/^['"]|['"]$/g,"");if(!i)return!1;let s=Ge.resolve(e,i);return await Rt.pathExists(s)?!1:(f.warn(`Configured yarnPath is missing (${s}). Falling back to global Yarn.`),!0)},Wf=async(e,t,r,n)=>{f.raclette("Starting development environment...");let o=Ge.dirname(n.dockerComposePath),i=r.name??Ge.basename(e),s=kl(e,t),a={kill:()=>(s(),!0)};Nr.set("originalConfigWatcher",a),await ro(r),await to(r),await Qn(r),rn("raclette_shared"),await ri(r,n.workingDir,n.dockerComposePath,!1,"development",!0),await no(r,o),await un(r,o);let c=await cn(r,o,n.forceRebuild??!1);c.length>0&&await ln(r,o,c,{noCache:n.noCache});let l=Tw(r),u=Pw(l);u.length>0&&f.info(`Found existing services: ${u.join(", ")}`);let p=$w(r,i,n.dockerComposePath);["SIGINT","SIGTERM"].forEach(d=>{process.removeAllListeners(d),process.on(d,()=>p(d))}),n.quiet?(await qf(r,i,n.dockerComposePath,l,u,n.verbose??!1),console.log(h.green(`
|
|
652
|
+
\u2705 Development environment is ready!`)),l.frontend.enabled&&console.log(h.blue(`\u{1F30D} Frontend running at: http://localhost:${l.frontend.port}`)),l.backend.enabled&&console.log(h.blue(`\u{1F680} Server running at: http://localhost:${l.backend.port}`)),console.log(h.yellow(`
|
|
653
|
+
\u2139\uFE0F Services are running in detached mode (quiet)`)),console.log(h.yellow('Use "raclette down" to stop the services when finished'))):await Dw(r,i,n.dockerComposePath,l,u,n.logFilter,n.verbose??!1)},Tw=e=>{let t=e.name??Ge.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}}},Pw=e=>{let t=[];return Object.entries(e).forEach(([r,n])=>{n.enabled&&wr(n.containerName)&&t.push(r)}),t},$w=(e,t,r)=>n=>{console.log(`
|
|
653
654
|
`+"=".repeat(80)),console.log(h.bold.yellow(` CLEANUP: Shutting down services after ${n}...`)),console.log("=".repeat(80)+`
|
|
654
|
-
`);for(let[o,i]of
|
|
655
|
-
`+"=".repeat(80)),console.log(h.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(h.red("Error stopping Docker services:"),o)}process.exit(0)},
|
|
656
|
-
Log process ended with code ${d??0}`)),p()}),
|
|
657
|
-
`).forEach(
|
|
658
|
-
`).forEach(
|
|
655
|
+
`);for(let[o,i]of Nr.entries())i&&!i.killed&&typeof i.kill=="function"&&(console.log(h.yellow(`Stopping ${o} process...`)),i.kill("SIGTERM"));try{Yf(e),Ee(["-p",t,"-f",r,"down"],{stdio:"inherit"}),console.log(`
|
|
656
|
+
`+"=".repeat(80)),console.log(h.bold.green(" \u2705 CLEANUP COMPLETE: All services stopped successfully")),console.log("=".repeat(80))}catch(o){console.error(h.red("Error stopping Docker services:"),o)}process.exit(0)},qf=async(e,t,r,n,o,i)=>{if(console.log(h.blue("\u{1F433} Starting Docker services...")),!await Rt.pathExists(r)){let a=`Docker compose file not found: ${r}`;throw f.error(a),new Error(a)}let s=[];if(Object.entries(n).forEach(([a,c])=>{let l=a;if(c.enabled){if(o.includes(l)){f.info(`Skipping existing service: ${l}`);return}s.push(l)}}),s.length===0){f.warn("No Docker services to start! All services either exist or are not enabled.");return}f.raw(h.blue(`\u{1F680} Starting following services: ${s.join(", ")}`));try{Ee(["-p",t,"-f",r,"up","-d",...s],{stdio:"inherit"}),f.success(`Docker services started: ${s.join(", ")}`)}catch(a){throw f.error(`Error starting Docker services: ${a.message}`),a}try{await Nw(e,i)}catch(a){f.error(`Error starting Workbench: ${a.message}`)}},Dw=async(e,t,r,n,o,i=["frontend","backend"],s)=>{await qf(e,t,r,n,o,s);let a=i.filter(u=>o.includes(u)?!1:n[u]?.enabled);if(a.length===0){f.warn("No services to show logs for");return}f.raw(h.blue(`\u{1F4CB} Showing logs for: ${a.join(", ")} (press Ctrl+C to stop)...`));let c=Ge.resolve(r),l=["-p",t,"-f",c,"logs","--follow",...a];try{f.debug("Running Docker Compose logs...");let u=wa("docker",["compose",...l],{stdio:"inherit",shell:!0,cwd:Ge.dirname(c)});return Nr.set("dockerLogs",u),new Promise(p=>{u.on("close",d=>{u.killed||console.log(h.yellow(`
|
|
657
|
+
Log process ended with code ${d??0}`)),p()}),u.on("error",d=>{f.error(` Error with log process: ${d.message}`),p()})})}catch(u){throw f.error(`Error setting up log following: ${u.message}`),u}},so=async e=>{if(!e.services?.workbench?.enabled)return;let t=Ge.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await Rt.pathExists(t))throw f.error("Workbench package not found. Install with: yarn add @raclettejs/workbench"),new Error("Workbench package not found");let r=Ge.join(t,"package.json");if(!await Rt.pathExists(r))throw f.error(" Workbench package.json not found"),new Error("Workbench package.json not found");return t},Nw=async(e,t)=>{if(!e.services?.workbench?.enabled)return;let r=await so(e);if(!r)return;let n=r;try{n=await Rt.realpath(r)}catch{}let o=Ge.join(process.cwd(),"workbenchPlugins");await Ow(o)||(o=void 0);let i;if(e.workbench)try{oo(e.workbench),i=await io(e.workbench)}catch(l){throw console.error(h.red("Workbench configuration error:"),l.message),l}let s=Object.fromEntries(Object.entries(e.env.development||{}).filter(([l])=>l.startsWith("RACLETTE_")).flatMap(([l,u])=>{let p=[[l,u]];if(l.startsWith("RACLETTE_WORKBENCH_")){let d=l.replace("RACLETTE_WORKBENCH_","RACLETTE_");p.push([d,u])}return p}));e.services?.workbench?.debugPort&&(s.ENABLE_DEBUG=!0,s.RACLETTE_DEBUG_PORT=e.services.workbench.debugPort);let a={...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),...s};return await Uf(process.cwd())&&(a.YARN_IGNORE_PATH="1"),new Promise((l,u)=>{let p=`${e.name}-workbench`;f.progress("Starting workbench as "+p);let d=["dev",t?"-v":"","-p",p,...i?["-f",i]:[]].filter(k=>k!==""),y=["--cwd",n,...d],g=e.services?.workbench?.withLogs||t,m=wa(Gf,y,{cwd:process.cwd(),env:a,stdio:g?"pipe":"ignore",shell:Vf});Nr.set("workbench",m),g&&(m.stdout?.on("data",k=>{k.toString().trim().split(`
|
|
658
|
+
`).forEach(I=>{console.log(h.magenta(`[Workbench] ${I}`))})}),m.stderr?.on("data",k=>{k.toString().trim().split(`
|
|
659
|
+
`).forEach(I=>{console.error(h.red(`[Workbench] ${I}`))})}),m.stdout?.on("data",k=>{k.toString().includes("VITE v")&&(clearTimeout(E),l())}));let E=setTimeout(()=>{l()},g?1e3*60*5:5e3);m.on("close",k=>{clearTimeout(E),k!==0&&k!==null?(console.error(h.red(`Workbench process exited with code ${k}`)),u(new Error(`Workbench process exited with code ${k}`))):l()}),m.on("error",k=>{clearTimeout(E),console.error(h.red("Workbench process error:"),k),u(k)}),g||setTimeout(l,1e3)})},Yf=async e=>{if(e.services?.workbench?.enabled)try{let t=await so(e);if(!t)return;let r=t;try{r=await Rt.realpath(t)}catch{}let n={...process.env};await Uf(process.cwd())&&(n.YARN_IGNORE_PATH="1"),wa(Gf,["--cwd",r,"down","-p",`${e.name}-workbench`],{cwd:process.cwd(),env:n,stdio:"pipe",shell:Vf})}catch{f.debug("Workbench down command failed, forcing process termination");let r=Nr.get("workbench");if(r&&!r.killed)r.kill("SIGTERM");else{let n=`${e.name}-workbench`;try{wl(n)}catch(o){f.warn(`Could not stop workbench containers: ${o.message}`)}}}},Ca=(e,t)=>{let r=t?.name??Ge.basename(process.cwd());f.debug(`\u{1F3F7}\uFE0F Using project name: ${r}`),f.raclette("Stopping all Docker services...");try{Yf(t),Ee(["-p",r,"-f",e,"down"],{stdio:"inherit"}),f.success("All Docker services stopped successfully")}catch(n){throw f.error("Error stopping Docker services:",n),n}};import zf from"fs-extra";import Xf from"path";var Lw=e=>Xt(e),Lr=async(e,t,r)=>{let o=`${t?.name??Xf.basename(process.cwd())}-${e}`;t?.services?.[e]?.name&&(o=t.services[e].name);try{let i=await zf.readFile(r,"utf8"),s=new RegExp(`\\$\\{RACLETTE_${e.toUpperCase()}_CONTAINERNAME:-([^}]+)\\}`).exec(i);s&&s[1]&&(o=s[1])}catch(i){console.warn(h.yellow(`Warning: Could not read docker-compose file to determine container name: ${i.message}`))}return o},Kf=async(e,t,r)=>{let n=await Lr(e,t,r);if(!Lw(n))return!1;try{console.log(h.blue(`\u{1F4E6} Updating dependencies for ${e}...`)),ei(n,"/app/check-dependencies.sh echo 'Dependency check completed'",{stdio:"inherit"});try{let o=ei(n,"cat /app/node_modules/.install-result",{stdio:"pipe"}).trim();return o==="0"?(console.log(h.green(`\u2705 Dependencies for ${e} updated successfully`)),!0):(console.error(h.red(`\u274C Dependency installation for ${e} failed with code ${o}`)),console.error(h.red("Some packages might be incompatible with your Node.js version or have other issues.")),console.error(h.yellow("Check the logs above for specific error messages.")),!1)}catch{return console.log(h.green(`\u2705 Dependencies for ${e} updated (status unknown)`)),!0}}catch(o){return console.error(h.red(`\u274C Error updating dependencies for ${e}: ${o.message}`)),!1}},Aa=async(e,t,r)=>{console.log(h.blue("\u{1F9C0} Updating package dependencies..."));let n=Xf.join(r,"docker-compose.yml");if(!await zf.pathExists(n))return console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running with racletteJS.")),!1;let o=!1,i=!0;if(e==="frontend"||e==="both"){let s=await Kf("frontend",t,n);o=s||o,i=i&&s}if(e==="backend"||e==="both"){let s=await Kf("backend",t,n);o=s||o,i=i&&s}return o&&!i&&(console.log(h.yellow("\u26A0\uFE0F Some services encountered errors during dependency installation.")),console.log(h.yellow("You may need to address compatibility issues in your package.json."))),o&&i};import{spawn as Zf}from"child_process";import Jf from"path";var eh=async(e,t,r,n)=>{if(e.includes("workbench")){await jw(r,t);return}let o=[];if(e.length===0)o=Qf(r),console.log(h.blue(`\u{1F4CB} No services specified, showing logs for all enabled services: ${o.join(", ")}`));else{let s=Qf(r),a=e.filter(c=>!s.includes(c));if(a.length>0)throw console.error(h.red(`\u274C Invalid services specified: ${a.join(", ")}`)),console.log(h.yellow(`Available services: ${s.join(", ")}`)),new Error("Invalid services specified");o=e,console.log(h.blue(`\u{1F4CB} Showing logs for: ${o.join(", ")}`))}let i=await Iw(o,r,n);if(i.length===0)throw console.error(h.red("\u274C None of the specified services appear to be running.")),console.log(h.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(h.yellow(`\u26A0\uFE0F Some services are not running: ${s.join(", ")}`)),console.log(h.blue(`\u{1F4CB} Showing logs for running services: ${i.join(", ")}`)),o=i}await Fw(r,n,o,t)};function Qf(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 Iw(e,t,r){let n=[];for(let o of e)try{let i=await Lr(o,t,r);Xt(i)&&n.push(o)}catch(i){console.warn(h.yellow(`\u26A0\uFE0F Could not check status of service '${o}': ${i.message}`))}return n}async function Fw(e,t,r,n){let o=e?.name??Jf.basename(process.cwd());console.log(h.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=Zf("docker",["compose",...i],{stdio:"inherit",shell:!0,cwd:Jf.dirname(t)});s.on("close",a=>{s.killed||console.log(h.yellow(`
|
|
659
660
|
Log process ended with code ${a??0}`))}),s.on("error",a=>{console.error(h.red(`\u274C Error with log process: ${a.message}`))}),process.on("SIGINT",()=>{console.log(h.yellow(`
|
|
660
|
-
\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(h.red(`\u274C Error following logs: ${s.message}`)),s}}async function
|
|
661
|
+
\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(h.red(`\u274C Error following logs: ${s.message}`)),s}}async function jw(e,t){console.log(h.blue("\u{1F527} Handling workbench logs..."));let r=so(e);f.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=Zf("yarn",n,{cwd:r,stdio:"inherit",shell:!0,env:{...process.env,NODE_ENV:"development"}});o.on("close",i=>{o.killed||console.log(h.yellow(`
|
|
661
662
|
Workbench log process ended with code ${i??0}`))}),o.on("error",i=>{console.error(h.red(`\u274C Error with workbench log process: ${i.message}`)),console.log(h.yellow("\u{1F4A1} Make sure the workbench package has the 'log' script in its package.json"))}),process.on("SIGINT",()=>{console.log(h.yellow(`
|
|
662
|
-
\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(h.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as
|
|
663
|
+
\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(h.red(`\u274C Error calling workbench logs: ${n.message}`)),n}}import{spawn as Xw}from"child_process";import V from"fs-extra";import G from"path";import{execSync as Mw}from"child_process";import H from"fs-extra";import W from"path";var Sa=async(e,t,r)=>{console.log(h.blue("\u{1F4E6} Creating production artifacts...")),await Gw(t,e,r);let n=W.join(t,"docker-compose.yml");return await Vw(e,t,n,r),await Uw(e,t,r),await Ww(t,r,e),console.log(h.green("\u2705 Production artifacts created")),n},th=async(e,t,r,n)=>{let{makeExecutable:o=!1,required:i=!1,logPrefix:s=""}=n||{};for(let a of e){let c=W.join(t,a),l=W.basename(a),u=W.join(r,l);if(await H.ensureDir(W.dirname(u)),await H.pathExists(c))await H.copy(c,u),o&&await H.chmod(u,493),console.log(h.gray(`${s} \u2705 Copied ${a}`));else{let p=`${a} not found in ${t}`;if(i)throw new Error(`Required file ${p}`);console.log(h.gray(`${s} \u26A0\uFE0F Skipped ${a} (not found)`))}}},Bw=async(e,t,r)=>th(e,process.cwd(),t,{...r,logPrefix:r?.logPrefix||" "}),Hw=async(e,t,r,n)=>th(e,t,r,{...n,logPrefix:n?.logPrefix||" "}),Gw=async(e,t,r)=>{let n=t.services.frontend?.port||8081,o=t.services.workbench?.frontendPort||8083,i=`
|
|
663
664
|
FROM nginx:alpine
|
|
664
665
|
COPY service/frontend /usr/share/nginx/html
|
|
665
666
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
@@ -768,7 +769,7 @@ server {
|
|
|
768
769
|
proxy_set_header Host $host;
|
|
769
770
|
}
|
|
770
771
|
}
|
|
771
|
-
`;if(await H.writeFile(W.join(e,"Dockerfile.frontend"),i),await H.writeFile(W.join(e,"Dockerfile.backend"),s),await H.writeFile(W.join(e,"nginx.conf"),a),await
|
|
772
|
+
`;if(await H.writeFile(W.join(e,"Dockerfile.frontend"),i),await H.writeFile(W.join(e,"Dockerfile.backend"),s),await H.writeFile(W.join(e,"nginx.conf"),a),await Bw(["node_modules/@raclettejs/core/services/frontend/provision/entrypoint.sh"],e,{makeExecutable:!0,required:!1}),r){let l=`
|
|
772
773
|
FROM nginx:alpine
|
|
773
774
|
COPY workbench/frontend /usr/share/nginx/html
|
|
774
775
|
COPY nginx.workbench.conf /etc/nginx/conf.d/default.conf
|
|
@@ -785,7 +786,7 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
|
|
|
785
786
|
|
|
786
787
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
787
788
|
CMD ["nginx", "-g", "daemon off;"]
|
|
788
|
-
`,
|
|
789
|
+
`,u=`
|
|
789
790
|
FROM node:24.4-alpine
|
|
790
791
|
WORKDIR /app
|
|
791
792
|
|
|
@@ -846,7 +847,7 @@ server {
|
|
|
846
847
|
proxy_set_header Authorization $http_authorization;
|
|
847
848
|
}
|
|
848
849
|
}
|
|
849
|
-
`;await H.writeFile(W.join(e,"Dockerfile.workbench-frontend"),
|
|
850
|
+
`;await H.writeFile(W.join(e,"Dockerfile.workbench-frontend"),l),await H.writeFile(W.join(e,"Dockerfile.workbench-backend"),u),await H.writeFile(W.join(e,"nginx.workbench.conf"),p)}},Vw=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:8.2",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:9.0-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 H.writeFile(r,Se.dump(a))},Uw=async(e,t,r)=>{let n=Ra(e,r);await H.writeFile(W.join(t,".env.example"),n)},Ra=(e,t)=>{let r=e.services.frontend?.port||8081,n=e.services.workbench?.frontendPort||8083;return`# Production Environment Variables
|
|
850
851
|
# Copy this file to .env and fill in your values
|
|
851
852
|
|
|
852
853
|
# Required - Generate a secure random string for this
|
|
@@ -884,7 +885,7 @@ ${Object.keys(e.env.production||{}).map(i=>`# ${i}=`).join(`
|
|
|
884
885
|
|
|
885
886
|
# Cache specific overrides (uncomment if using external Valkey/Redis)
|
|
886
887
|
# RACLETTE_CACHE_URL=valkey://your-external-cache:6379
|
|
887
|
-
`},
|
|
888
|
+
`},Ww=async(e,t,r)=>{let n=r.services.frontend?.port||8081,o=r.services.workbench?.frontendPort||8083,i=`#!/bin/bash
|
|
888
889
|
# racletteJS Production Deployment Script
|
|
889
890
|
|
|
890
891
|
set -e
|
|
@@ -937,7 +938,7 @@ echo " - Built with TypeScript and compiled to dist/src/server.js"
|
|
|
937
938
|
echo " - Runs on Node.js 24 Alpine with production dependencies only"
|
|
938
939
|
echo " - Should listen on 0.0.0.0:3000 for proper container networking"
|
|
939
940
|
echo " - Accessible via /api proxy on port ${n}"
|
|
940
|
-
`,s=W.join(e,"deploy.sh");await H.writeFile(s,i),await H.chmod(s,493)},
|
|
941
|
+
`,s=W.join(e,"deploy.sh");await H.writeFile(s,i),await H.chmod(s,493)},rh=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:8.2",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",`${Qt("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=_t(i,t);s&&n.services.backend.volumes.push(s)}),Object.values(n.services).forEach(i=>{i.volumes&&(i.volumes=sn(i.volumes,t))}),await H.writeFile(r,Se.dump(n))},nh=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",`${Qt("frontend",e)}:/app/yarn.lock`,`${W.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=_t(a,t);c&&o.services.frontend.volumes.push(c)})}catch{console.error(h.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",`${Qt("backend",e)}:/app/yarn.lock`,"./.raclette/virtual/backend/types:/app/types",`${W.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=_t(a,t);c&&o.services.backend.volumes.push(c)})}catch{console.error(h.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=sn(s.volumes,t))}),await H.writeFile(r,Se.dump(o))},qw=async(e,t,r,n)=>{let o=n.services.frontend?.port||8081,i=n.services.workbench?.frontendPort||8083,s=`#!/bin/bash
|
|
941
942
|
# racletteJS Production Deployment Script with Image Loading
|
|
942
943
|
|
|
943
944
|
set -e
|
|
@@ -992,7 +993,7 @@ echo " View logs: docker compose logs -f"
|
|
|
992
993
|
echo " Stop: docker compose down"
|
|
993
994
|
echo " Restart: docker compose restart"
|
|
994
995
|
echo " Update images: ./load-images.sh && docker compose up -d"
|
|
995
|
-
`;await H.writeFile(W.join(e,"deploy.sh"),s),await H.chmod(W.join(e,"deploy.sh"),493)},
|
|
996
|
+
`;await H.writeFile(W.join(e,"deploy.sh"),s),await H.chmod(W.join(e,"deploy.sh"),493)},Yw=async(e,t)=>{let r=`#!/bin/bash
|
|
996
997
|
# Load Docker Images Script
|
|
997
998
|
|
|
998
999
|
set -e
|
|
@@ -1024,7 +1025,7 @@ echo "\u2705 All images loaded successfully!"
|
|
|
1024
1025
|
echo ""
|
|
1025
1026
|
echo "\u{1F433} Available images:"
|
|
1026
1027
|
docker images | grep -E "${t.map(n=>n.split(":")[0]).join("|")}" || echo "No images found (this might be expected if tags changed)"
|
|
1027
|
-
`;await H.writeFile(W.join(e,"load-images.sh"),r),await H.chmod(W.join(e,"load-images.sh"),493)},
|
|
1028
|
+
`;await H.writeFile(W.join(e,"load-images.sh"),r),await H.chmod(W.join(e,"load-images.sh"),493)},Kw=async(e,t,r,n)=>{let o=t.services.frontend?.port||8081,i=t.services.workbench?.frontendPort||8083,s=`# ${t.name} - Deployment Package
|
|
1028
1029
|
|
|
1029
1030
|
This package contains everything needed to deploy your racletteJS application.
|
|
1030
1031
|
|
|
@@ -1111,7 +1112,7 @@ ${n?`- Workbench: http://localhost:${i}`:""}
|
|
|
1111
1112
|
- Ports ${o}${n?`, ${i}`:""} available
|
|
1112
1113
|
|
|
1113
1114
|
Generated on: ${new Date().toISOString()}
|
|
1114
|
-
`;await H.writeFile(W.join(e,"README.md"),s)},
|
|
1115
|
+
`;await H.writeFile(W.join(e,"README.md"),s)},oh=async(e,t,r,n,o)=>{console.log(h.blue("\u{1F4E6} Packaging images for distribution..."));let i=W.join(t,"..","package"),s=`${e.name}-deployment-${n}`,a=W.join(i,`${s}.tar.gz`);await H.ensureDir(i),await H.emptyDir(i);let c=W.join(i,s);await H.ensureDir(c);try{console.log(h.gray(" \u{1F4BE} Exporting Docker images..."));let l=W.join(c,"images");await H.ensureDir(l);for(let p of r){let d=`${p.replace(/[:/]/g,"_")}.tar`,y=W.join(l,d);console.log(h.gray(` \u{1F4E6} Exporting ${p}...`)),ue(["save","-o",y,p],{stdio:"pipe"});let g=await H.stat(y);if(g.size===0)throw new Error(`Failed to export image ${p}`);console.log(h.gray(` \u2705 Exported ${p} (${(g.size/1024/1024).toFixed(1)}MB)`))}console.log(h.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 Hw(u,t,c,{required:!1,logPrefix:" "}),await qw(c,r,o,e),await Yw(c,r),await Kw(c,e,r,o),console.log(h.gray(" \u{1F5DC}\uFE0F Creating deployment package...")),await zw(c,a),await H.remove(c),console.log(h.green(` \u2705 Deployment package created: ${s}.tar.gz`)),{packagePath:a,imageNames:r}}catch(l){throw await H.remove(c).catch(()=>{}),l}},zw=async(e,t)=>{let r=W.dirname(e),n=W.basename(e);Mw(`tar -czf "${t}" -C "${r}" "${n}"`,{stdio:"pipe"});let o=await H.stat(t);console.log(h.gray(` \u{1F4E6} Package size: ${(o.size/1024/1024).toFixed(1)}MB`))};var ih=60,Oa=7200,Jw=()=>{let e=process.env.RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS,t,r;if(e===void 0||e==="")t=ih,r="default (env unset)";else{let n=Number.parseInt(e,10);!Number.isFinite(n)||n<1?(t=ih,r=`invalid env "${e}", using default`):(t=Math.min(n,Oa),r=n>Oa?`capped from ${n}s to max ${Oa}s`:`from env RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS=${e}`)}return console.log(h.gray(` \u23F1\uFE0F Generation mode wait: ${t}s (${r})`)),t},sh=async(e,t,r={})=>{let n=Date.now(),o=Qw(r);console.log(h.blue(`\u{1F9C0} Starting racletteJS ${o} build...`)),tn();let i=G.join(process.cwd(),".raclette"),s=G.resolve(r.outputDir||G.join(i,".build"));await V.ensureDir(s),await V.emptyDir(s);try{await sC(e,t,i),await aC(e,t,i);let a={mode:o,buildDir:s,artifacts:{}};switch(o){case"artifacts":a=await Zw(e,i,s,r);break;case"images":a=await ah(e,i,s,r);break;case"package":a=await eC(e,i,s,r);break}let c=(Date.now()-n)/1e3;return f.success(` ${o} build completed in ${c}s`),iC(a,e),a}catch(a){throw f.error(`${o} build failed: ${a.message}`),a}},Qw=e=>e.mode?e.mode:e.packageImages?"package":e.buildImages?"images":(e.buildOnly,"artifacts"),Zw=async(e,t,r,n)=>{if(n.buildOnly){console.log(h.blue("\u{1F4C1} Building application files only...")),await Ta(e,t,r,n);let i=await Pa(e,r,n);return console.log(h.green("\u2705 Build files ready")),{mode:"artifacts",buildDir:r,artifacts:{}}}else{console.log(h.blue("\u{1F4C1} Building local deployment artifacts..."));let i=G.join(r,"service");await Ta(e,t,i,n);let s=await Pa(e,r,n),a=await Sa(e,r,s),c=await oC(e,r,s);return console.log(h.green("\u2705 Local deployment artifacts ready")),{mode:"artifacts",buildDir:r,artifacts:{composeFile:a,deployScript:G.join(r,"deploy.sh"),readmeFile:c,envExampleFile:G.join(r,".env.example")}}}},ah=async(e,t,r,n)=>{console.log(h.blue("\u{1F433} Building Docker images for CI/CD..."));let o=G.join(r,"service");await Ta(e,t,o,n);let i=await Pa(e,r,n);await Sa(e,r,i);let s=await tC(e,r,i,n);return console.log(h.green("\u2705 Docker images ready for registry push")),{mode:"images",buildDir:r,images:s,artifacts:{}}},eC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4E6} Building offline deployment package..."));let o=await ah(e,t,r,n),i=ch(),s=await oh(e,r,o.images.names,i,o.images.names.some(a=>a.includes("workbench")));return console.log(h.green("\u2705 Offline deployment package ready")),{...o,mode:"package",deploymentPackage:s.packagePath}},tC=async(e,t,r,n)=>{let o=n.imagePrefix||e.name,i=n.imageTag||ch(),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 rC(),console.log(h.blue(`\u{1F3D7}\uFE0F Building multi-architecture images for: ${s}`))}catch(u){console.warn(h.yellow("\u26A0\uFE0F Buildx not available, falling back to single-architecture builds")),console.warn(h.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}`,y=G.join(t,`Dockerfile.${p}`);if(!await V.pathExists(y))throw new Error(`Dockerfile not found: ${y}`);let g=l.map(m=>`${d}:${m}`);c.push(...g),await nC({context:t,dockerfile:y,tags:g,platforms:s,push:!1,noCache:n.noCache,verbose:n.verbose}),console.log(h.gray(` \u2705 Built ${p} for ${s}`)),g.forEach(m=>{console.log(h.gray(` ${m}`))})}}else{console.log(h.gray(" \u{1F528} Building single-architecture images..."));let p=["-f",G.join(t,"docker-compose.yml"),"build"];n.noCache&&p.push("--no-cache"),Ee(p,{stdio:n.verbose?"inherit":"pipe",cwd:t});let d=["frontend","backend"];r&&d.push("workbench-frontend","workbench-backend");for(let y of d){let g=`${G.basename(t)}-${y}`.replace(/\./,""),m=`${o}/${y}`;l.forEach(E=>{let k=`${m}:${E}`;ue(["tag",g,k],{stdio:"pipe"}),c.push(k)}),console.log(h.gray(` \u2705 Tagged ${y}`))}}return console.log(h.green(" \u2705 Docker images built and tagged")),{names:c,tags:l}},rC=async()=>{try{ue(["buildx","version"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Setting up QEMU for cross-platform emulation...")),ue(["run","--rm","--privileged","multiarch/qemu-user-static","--reset","-p","yes"],{stdio:"pipe"}),console.log(h.gray(" \u{1F4E6} Creating buildx builder...")),ue(["buildx","create","--name","multiarch","--use"],{stdio:"pipe"}),ue(["buildx","inspect","--bootstrap"],{stdio:"pipe"}),console.log(h.gray(" \u2705 Buildx builder ready with QEMU emulation"))}catch(e){throw console.warn(h.yellow(" \u26A0\uFE0F Buildx setup failed, falling back to single-architecture builds")),console.warn(h.yellow(` ${e.message}`)),new Error("Buildx not available - use single-architecture builds instead")}},nC=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(h.yellow(" \u26A0\uFE0F Multi-platform images cannot be loaded locally")),console.log(h.yellow(" \u2139\uFE0F Images built but not loaded to local Docker"))),e.noCache&&t.push("--no-cache"),t.push(e.context);try{ue(t,{stdio:e.verbose?"inherit":"pipe",cwd:e.context})}catch(n){throw new Error(`Failed to build multi-architecture image: ${n}`)}},oC=async(e,t,r)=>{let n=G.join(t,"README.md"),o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Deployment
|
|
1115
1116
|
|
|
1116
1117
|
This build contains everything needed to deploy ${e.name} locally using Docker.
|
|
1117
1118
|
|
|
@@ -1176,7 +1177,7 @@ Edit \`docker-compose.yml\` to:
|
|
|
1176
1177
|
|
|
1177
1178
|
Built on: ${new Date().toISOString()}
|
|
1178
1179
|
Build type: Local deployment artifacts
|
|
1179
|
-
`;return await
|
|
1180
|
+
`;return await V.writeFile(n,s),console.log(h.gray(" \u2705 Created local deployment README")),n},iC=(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(h.blue("\u{1F4E6} Build Summary:")),console.log(` Mode: ${h.cyan(e.mode)}`),console.log(` Build Directory: ${h.cyan(e.buildDir)}`),e.mode==="artifacts"&&(console.log(` Docker Compose: ${h.cyan(e.artifacts.composeFile||"N/A")}`),console.log(` Deploy Script: ${h.cyan(e.artifacts.deployScript||"N/A")}`),console.log(` README: ${h.cyan(e.artifacts.readmeFile||"N/A")}`)),e.images&&e.images.names.length>0&&(console.log(` Docker Images: ${h.cyan(e.images.names.length)} built`),e.images.names.forEach(i=>{console.log(` - ${h.gray(i)}`)})),e.deploymentPackage&&console.log(` Deployment Package: ${h.cyan(e.deploymentPackage)}`),console.log(""),console.log(h.blue("\u{1F680} Next steps:")),e.mode){case"artifacts":console.log(h.yellow(" 1. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 2. Deploy: chmod +x deploy.sh && ./deploy.sh")),console.log(h.yellow(` \u2192 App will be at http://localhost:${r}`)),o&&console.log(h.yellow(` \u2192 Workbench at http://localhost:${n}`));break;case"images":console.log(h.yellow(" Images ready for registry push:")),e.images?.names.forEach(i=>{console.log(h.yellow(` docker push ${i}`))}),console.log(""),console.log(h.gray(" \u{1F4A1} Example pipeline usage:")),console.log(h.gray(" docker push myregistry.com/myproject/frontend:v1.0.0")),console.log(h.gray(" docker push myregistry.com/myproject/backend:v1.0.0"));break;case"package":console.log(h.yellow(" 1. Transfer package to target system")),console.log(h.yellow(" 2. Extract: tar -xzf deployment-package.tar.gz")),console.log(h.yellow(" 3. Configure: cp .env.example .env && edit .env")),console.log(h.yellow(" 4. Deploy: ./deploy.sh"));break}},ch=()=>new Date().toISOString().slice(0,10).replace(/-/g,""),sC=async(e,t,r)=>{console.log(h.blue("\u{1F4C1} Setting up build environment...")),await ro(e),await to(e),await Qn(e),await no(e,r),await un(e,r),await Hf(e,r),console.log(h.green("\u2705 Build environment ready"))},aC=async(e,t,r)=>{console.log(h.blue("\u26A1 Running generation mode..."));let n=`${e.name}-build`,o=G.join(r,"docker-compose.generate.yml");await an(e,r,"build"),await rh(e,t,o),rn("raclette_shared");try{console.log(h.gray(" \u{1F433} Starting generation services...")),Ee(["-p",n,"-f",o,"up","-d"],{stdio:"pipe"}),console.log(h.gray(" \u23F3 Waiting for file generation to complete..."));let i=0,s=Jw();for(;i<s;)try{if(!(await Ee(["-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 after ${s}s (set RACLETTE_GENERATION_MODE_TIMEOUT_SECONDS to increase)`);console.log(h.green(" \u2705 File generation completed"))}finally{try{Ee(["-p",n,"-f",o,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup generation services"))}}},Ta=async(e,t,r,n)=>{console.log(h.blue("\u{1F3A8} Building main application...")),await V.ensureDir(r),await an(e,t,"build"),await cC(e,t,r,n)},cC=async(e,t,r,n)=>{console.log(h.gray(" \u{1F680} Building frontend and backend..."));let o=`${e.name}-app-build`,i=G.join(t,"docker-compose.app-build.yml"),s=G.join(t,".temp-build");await V.ensureDir(s),await V.ensureDir(G.join(s,"frontend")),await V.ensureDir(G.join(s,"backend"));try{await nh(e,process.cwd(),i,s);let a=["-p",o,"-f",i,"up"];if(n.noCache&&a.push("--build","--force-recreate"),console.log(h.gray(" \u{1F528} Starting parallel build process...")),Ee(a,{stdio:n.verbose?"inherit":"pipe",cwd:process.cwd()}),e.services.frontend?.enabled){let c=G.join(r,"frontend");await V.ensureDir(c);let l=G.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(h.green(" \u2705 Frontend build complete"))}else throw new Error("Frontend build did not produce expected output directory")}if(e.services.backend?.enabled){let c=G.join(r,"backend");await V.ensureDir(c);let l=G.join(s,"backend");if(!await V.pathExists(l))throw new Error("Backend build did not produce expected output directory");await lC(e,t,c,s),console.log(h.green(" \u2705 Backend build complete"))}console.log(h.green(" \u2705 Application build completed"))}finally{try{Ee(["-p",o,"-f",i,"down"],{stdio:"pipe"})}catch{console.warn(h.yellow("Warning: Could not cleanup build services"))}await V.remove(s),await V.remove(i)}},lC=async(e,t,r,n)=>{console.log(h.gray(" \u{1F4E6} Creating backend Node.js application..."));let o=G.join(n,"backend");await V.ensureDir(r),await V.pathExists(o)&&(await V.copy(o,r),console.log(h.gray(" \u2705 Copied backend build artifacts")));let i=G.join(r,"dist");if(!await V.pathExists(i))throw new Error("Backend build did not produce expected dist/ folder");let s=G.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=G.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(h.gray(" \u2705 Updated package.json for production"))}else throw new Error("Backend build did not include package.json");let c=G.join(r,"yarn.lock");await V.pathExists(c)||console.warn(h.yellow(" \u26A0\uFE0F No yarn.lock found in backend build")),console.log(h.gray(" \u2705 Backend Node.js application structure created")),console.log(h.gray(" \u{1F4C1} Entry point: dist/src/server.js")),await uC(r)},uC=async e=>{let t=["package.json","yarn.lock","dist/src/server.js"],r=[];for(let i of t){let s=G.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=G.join(e,"package.json"),o=await V.readJson(n);(!o.scripts?.start||!o.scripts.start.includes("dist/src/server.js"))&&console.warn(h.yellow(" \u26A0\uFE0F package.json start script may not point to dist/src/server.js")),console.log(h.gray(" \u2705 Backend structure verified successfully"))},Pa=async(e,t,r)=>!e.services.workbench?.enabled||r.skipWorkbench?!1:(await pC(e,t,r),!0),pC=async(e,t,r)=>{console.log(h.blue("\u{1F527} Building workbench..."));let n=G.join(process.cwd(),"node_modules","@raclettejs","workbench");if(!await V.pathExists(n)){f.warn("Workbench package not found, skipping workbench build");return}let o=G.join(t,"workbench"),i;if(e.workbench)try{oo(e.workbench),i=await io(e.workbench)}catch(s){throw console.error(h.red("Workbench configuration error:"),s.message),s}try{let s={...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},a=`${e.name}-workbench`;console.log(h.gray(" \u{1F527} Running workbench build process as "+a)),await new Promise((c,l)=>{let u=["build","--output-dir",o,"--build-only",r.verbose?"-v":"","-p",a,...i?["-f",i]:[]].filter(d=>d!==""),p=Xw("yarn",u,{cwd:n,stdio:r.verbose?"inherit":"ignore",env:s});p.on("close",d=>{f.raw(h.gray(` \u{1F3C1} Workbench build process exited with code ${d}`)),d===0?c():l(new Error(`Workbench build failed with exit code ${d}`))}),p.on("error",d=>{f.raw(h.red(` \u274C Workbench build process error: ${d.message}`)),l(d)})}),f.raw(h.green(" \u2705 Workbench build complete"))}catch(s){throw f.error("Workbench build failed: "+s.message),s}};import dt from"fs-extra";import pt from"path";var $a=()=>[{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 lh=async(e,t={})=>{console.log(h.blue("\u{1F4CB} Generating deployment guide..."));let r=pt.resolve(t.outputDir||process.cwd()),n=t.imagePrefix||e.name,o=t.imageTag||"latest",i=t.registry||"",s=dh(e,n,o,i);return t.generateFiles?await hC(e,s,r,i):await mC(e,s,r,i)},uh=async(e,t={})=>{let r=t.imagePrefix||e.name,n=t.imageTag||"latest",o=t.registry||"",i=dh(e,r,n,o);return await dC(e,i,n,o)},dC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=await hh(e,t,r,n),a=await mh(),c=fC(e.name,r);return`# Deploy ${e.name} with Docker
|
|
1180
1181
|
|
|
1181
1182
|
Deploy ${e.name} using pre-built Docker images.
|
|
1182
1183
|
|
|
@@ -1244,8 +1245,8 @@ docker compose down -v
|
|
|
1244
1245
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1245
1246
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1246
1247
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1247
|
-
`},
|
|
1248
|
-
`),
|
|
1248
|
+
`},fC=(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(`
|
|
1249
|
+
`),ph=async(e,t,r)=>{let n=e.services.frontend?.port||8081,o=e.services.workbench?.frontendPort||8083,i=await hh(e,t,"latest",r),s=await mh();return`# Deploy ${e.name} with Docker
|
|
1249
1250
|
|
|
1250
1251
|
Deploy ${e.name} using pre-built Docker images.
|
|
1251
1252
|
|
|
@@ -1353,7 +1354,7 @@ docker compose down -v
|
|
|
1353
1354
|
- **502 errors:** Check backend logs with \`docker compose logs backend\`
|
|
1354
1355
|
- **Database connection:** Verify MongoDB is healthy with \`docker compose ps\`
|
|
1355
1356
|
- **Image pull errors:** Check registry access and IMAGE_TAG value
|
|
1356
|
-
`},
|
|
1357
|
+
`},dh=(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}},hC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4C1} Generating deployment files..."));let o=pt.join(r,"deploy-guide");await dt.ensureDir(o);let i=pt.join(o,"docker-compose.yml");await fh(e,t,i,"latest",n);let s=pt.join(o,"docker-compose.override.yml.example");await gC(e,s);let a=pt.join(o,".env.example");await yC(e,a,t.hasWorkbench);let c=pt.join(o,"README.md");await vC(e,t,c,n);let l=pt.join(o,"DEPLOY.md");return await bC(e,t,l,n),console.log(h.green("\u2705 Deployment files generated")),console.log(h.gray(` \u{1F4C1} Files created in: ${o}`)),{outputPath:o,mode:"files",deployGuideFile:l,additionalFiles:[i,s,a,c]}},mC=async(e,t,r,n)=>{console.log(h.blue("\u{1F4CB} Generating embedded deployment guide..."));let o=pt.join(r,"DEPLOY.md");return await _C(e,t,o,n),console.log(h.green("\u2705 Deployment guide generated")),console.log(h.gray(` \u{1F4C4} Guide: ${o}`)),{outputPath:r,mode:"embedded",deployGuideFile:o}},fh=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:8.2",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:9.0-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 dt.writeFile(r,Se.dump(c))},gC=async(e,t)=>{let r=$a(),n=r.filter(s=>s.service==="frontend"),o=r.filter(s=>s.service==="backend"),i=`# docker-compose.override.yml
|
|
1357
1358
|
# Copy this file to docker-compose.override.yml and customize as needed
|
|
1358
1359
|
# This file allows you to extend the main docker-compose.yml without modifying it
|
|
1359
1360
|
|
|
@@ -1391,7 +1392,7 @@ ${o.map(s=>` # ${s.description}
|
|
|
1391
1392
|
# Add custom networks if needed
|
|
1392
1393
|
# networks:
|
|
1393
1394
|
# custom-network:
|
|
1394
|
-
`;await
|
|
1395
|
+
`;await dt.writeFile(t,i)},yC=async(e,t,r)=>{let n=Ra(e,r);await dt.writeFile(t,n)},vC=async(e,t,r,n)=>{let o=e.services.frontend?.port||8081,i=e.services.workbench?.frontendPort||8083,s=`# ${e.name} - Local Registry Testing
|
|
1395
1396
|
|
|
1396
1397
|
This folder contains deployment files for testing registry-based deployment locally.
|
|
1397
1398
|
|
|
@@ -1480,7 +1481,7 @@ you can adjust these registry examples based on where your images will be hosted
|
|
|
1480
1481
|
\`\`\`
|
|
1481
1482
|
|
|
1482
1483
|
Generated on: ${new Date().toISOString()}
|
|
1483
|
-
`;await
|
|
1484
|
+
`;await dt.writeFile(r,s)},bC=async(e,t,r,n)=>{let o=await ph(e,t,n);await dt.writeFile(r,o)},_C=async(e,t,r,n)=>{let o=await ph(e,t,n),i=`# ${e.name} - Registry Deployment Guide
|
|
1484
1485
|
|
|
1485
1486
|
## For Developers
|
|
1486
1487
|
|
|
@@ -1504,7 +1505,7 @@ ${t.names.map(s=>`- \`${s}\``).join(`
|
|
|
1504
1505
|
*Copy everything below this line to your project README or documentation*
|
|
1505
1506
|
|
|
1506
1507
|
${o}
|
|
1507
|
-
`;await
|
|
1508
|
+
`;await dt.writeFile(r,i)},hh=async(e,t,r,n)=>{let o=pt.join(process.cwd(),"temp-compose.yml");await fh(e,t,o,r,n);let i=await dt.readFile(o,"utf8");return await dt.remove(o),i},mh=async()=>{let e=$a(),t=e.filter(n=>n.service==="frontend").slice(0,3),r=e.filter(n=>n.service==="backend").slice(0,3);return`services:
|
|
1508
1509
|
frontend:
|
|
1509
1510
|
volumes:
|
|
1510
1511
|
${t.map(n=>` # ${n.description}
|
|
@@ -1519,62 +1520,42 @@ ${r.map(n=>` # ${n.description}
|
|
|
1519
1520
|
# - ${n.source}:${n.target}`).join(`
|
|
1520
1521
|
`)}
|
|
1521
1522
|
environment:
|
|
1522
|
-
# - CUSTOM_API_KEY=your-key`};var Tt=process.cwd();process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=Tt);var nr=await zc(),Df=Object.keys(nr).length&&h.blue(`\u{1F4C4} Loaded ${Object.keys(nr).length} environment variables from ${Tt}/.env`);nr.RACLETTE_APP_PATH=process.env.RACLETTE_APP_PATH;var ue=Go(await wt(),await wt("raclette.config.*",nr)),Nf=nr.RACLETTE_ROOT||ue.root||".raclette",$e=or.join(Tt,Nf),st=or.join($e,"docker-compose.yml");ue.root=Nf;var De=new Da,Ke=(e,t)=>{Df&&f.raclette(Df),_t.ensureDirSync($e)};De.version("0.1.0");De.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("-r, --root <root>","Raclette tools root directory",".raclette").option("--no-cache","Force rebuild Docker images without using cache").hook("preAction",Ke).action(async e=>{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment...");try{Qr();let t=Go(ue,e.configFile?await wt(e.configFile):{});_t.writeFileSync(or.join($e,"raclette.config.yaml"),Ce.dump(t)),e.projectName&&(f.raclette("Setting project name to "+e.projectName),t.name=e.projectName),Uo(t,$e),await lf($e,nr,t,{workingDir:Tt,dockerComposePath:st,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):Be,forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});De.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").hook("preAction",Ke).action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs..."),await _t.pathExists(st)||(f.error("No docker-compose.yml found. Services may not be running."),f.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await vf(e,t,ue,st)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});De.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").hook("preAction",Ke).action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=Tt;e.projectName&&(f.raclette("Setting project name to "+e.projectName),ue.name=e.projectName);let r=or.join($e,"docker-compose.full.yml");if(!await _t.pathExists(st)){console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(f.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await ra(st,ue)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Zc(ue,t,r,"development"),await ra(r,ue),await _t.remove(r)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});De.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").hook("preAction",Ke).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Restarting Raclette services..."),e.length===0){f.warn("No services specified. Please specify which services to restart."),f.instruction("Usage: raclette restart <service1> <service2> ..."),f.instruction("Common services: frontend, backend, mongodb, cache");return}let r=ue?.name??or.basename(Tt);if(!await _t.pathExists(st)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let n of e)try{let o=await Pr(n,ue,st);if(!Ht(o)){f.warn(`Service '${n}' (container: ${o}) doesn't appear to be running.`),f.instruction(" If you're sure it's running, it might have a different container name than expected."),f.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await _t.pathExists(st)?(f.progress(`Restarting service: ${n}...`),_e(["-p",r,"-f",st,"restart",n],{stdio:"inherit"})):(f.progress(` Restarting container: ${o}...`),le(["restart",o],{stdio:"inherit"})),f.success(`Service '${n}' restarted successfully`)}catch(o){f.error(`Error restarting service '${n}': ${o.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});De.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").hook("preAction",Ke).action(async(e="both",t)=>{try{f.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(f.error("Target must be one of: frontend, backend, both"),process.exit(1)),await Zs(e,ue),await na(e,ue,$e)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});De.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").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").hook("preAction",Ke).action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=Tt,r=lt(ue,e.configFile?await wt(e.configFile):{});_t.writeFileSync(or.join($e,"raclette.config.yaml"),Ce.dump(r)),Uo(r,$e),e.projectName&&(f.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 kf(r,t,n);switch(f.success("Build complete!"),o.mode){case"artifacts":f.success(`Build files are in ${o.buildDir}!`),f.raw(h.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":f.success("Docker images built and tagged"),f.raw(h.green("\u{1F680} Ready for registry push"));break;case"package":f.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&f.raw(h.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){f.error("Error building application: "+t?.message),process.exit(1)}});De.command("add-package <target> <package...>").description(`Add a package to the project (target: ${Ir.join(", ")})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").hook("preAction",Ke).action(async(e,t,r)=>{f.setVerbose(r.verbose);try{Ir.includes(e)||(f.error(`Target must be one of: ${Ir.join(", ")}}`),process.exit(1)),f.raclette(`Adding package(s) to ${e}...`);for(let n of t)await nf(e,n,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder..."),await Zs(e,ue),await na(e,ue,$e)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});De.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").hook("preAction",Ke).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images..."),e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let n=await on(ue,$e);if(n.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=n}let r=e.filter(n=>n==="frontend"||n==="backend"||n==="workbench");r.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await sn(ue,$e,r,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${r.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});De.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").hook("preAction",Ke).action(async e=>{try{if(f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),e.returnOnly){let n={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},o=await Sf(ue,n);console.log(o),process.exit(0)}let t={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},r=await Af(ue,t);f.success("Deployment guide generated!"),r.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${r.outputPath}`)),f.raw(h.yellow("\u{1F4A1} Use these files for local testing")),f.raw(h.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(f.raw(h.cyan(`\u{1F4C4} Guide created: ${r.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch(t){f.error("Error generating deployment guide: "+t.message),process.exit(1)}});De.command("config").description("(Re)Configure Raclette Application").option("-c, --config <config>","configuration file","raclette.config.yaml").hook("preAction",Ke).action(async e=>{console.log(h.bold.green("YO!")+h.bold.red(":"))});De.parse(process.argv);
|
|
1523
|
-
/*!
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
.
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
.
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
*
|
|
1561
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
1562
|
-
* Licensed under the MIT License.
|
|
1563
|
-
*)
|
|
1564
|
-
|
|
1565
|
-
.store/queue-microtask-npm-1.2.3-fcc98e4e2d/package/index.js:
|
|
1566
|
-
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
1567
|
-
|
|
1568
|
-
.store/run-parallel-npm-1.2.0-3f47ff2034/package/index.js:
|
|
1569
|
-
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
1570
|
-
|
|
1571
|
-
.store/js-yaml-npm-4.1.0-3606f32312/package/dist/js-yaml.mjs:
|
|
1572
|
-
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
1573
|
-
|
|
1574
|
-
.store/mustache-npm-4.2.0-1fe3d6d77a/package/mustache.mjs:
|
|
1575
|
-
(*!
|
|
1576
|
-
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
1577
|
-
* http://github.com/janl/mustache.js
|
|
1578
|
-
*)
|
|
1579
|
-
*/
|
|
1523
|
+
# - CUSTOM_API_KEY=your-key`};var jt=process.cwd();process.env.RACLETTE_APP_PATH||(process.env.RACLETTE_APP_PATH=jt);var lr=await xl(),gh=Object.keys(lr).length&&h.blue(`\u{1F4C4} Loaded ${Object.keys(lr).length} environment variables from ${jt}/.env`);lr.RACLETTE_APP_PATH=process.env.RACLETTE_APP_PATH;var pe=Jo(await $t(),await $t("raclette.config.*",lr)),yh=lr.RACLETTE_ROOT||pe.root||".raclette",Le=ur.join(jt,yh),ft=ur.join(Le,"docker-compose.yml");pe.root=yh;var Ie=new nc,tt=(e,t)=>{gh&&f.raclette(gh),Ot.ensureDirSync(Le)};Ie.version("0.1.0");Ie.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("-r, --root <root>","Raclette tools root directory",".raclette").option("--no-cache","Force rebuild Docker images without using cache").hook("preAction",tt).action(async e=>{f.setVerbose(e.verbose),f.raclette("Starting raclette development environment...");try{tn();let t=Jo(pe,e.configFile?await $t(e.configFile):{});Ot.writeFileSync(ur.join(Le,"raclette.config.yaml"),Se.dump(t)),e.projectName&&(f.raclette("Setting project name to "+e.projectName),t.name=e.projectName),Qo(t,Le),await Wf(Le,lr,t,{workingDir:jt,dockerComposePath:ft,quiet:e.quiet,verbose:e.verbose,logFilter:e.filter?e.filter.split(","):Ye,forceRebuild:e.forceRebuild||e.rebuild,noCache:e.noCache})}catch(t){f.error("Error starting development environment: "+t?.message),process.exit(1)}});Ie.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").hook("preAction",tt).action(async(e,t)=>{try{f.setVerbose(t.verbose),f.raclette("Attaching to service logs..."),await Ot.pathExists(ft)||(f.error("No docker-compose.yml found. Services may not be running."),f.instruction("Try running 'raclette dev' first to start the services."),process.exit(1)),await eh(e,t,pe,ft)}catch(r){f.error("Error following logs: "+r.message),process.exit(1)}});Ie.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").hook("preAction",tt).action(async e=>{try{f.setVerbose(e.verbose),console.log(h.blue("\u{1F9C0} Stopping Raclette Docker services..."));let t=jt;e.projectName&&(f.raclette("Setting project name to "+e.projectName),pe.name=e.projectName);let r=ur.join(Le,"docker-compose.full.yml");if(!await Ot.pathExists(ft)){console.error(h.yellow("\u26A0\uFE0F No docker-compose.yml found. Services may not be running."));return}e.keepShared?(f.debug("\u2139\uFE0F Using standard docker-compose file (keeping shared services)"),await Ca(ft,pe)):(f.debug("\u2139Generating full docker-compose file including shared services"),await Cl(pe,t,r,"development"),await Ca(r,pe),await Ot.remove(r)),f.success("Docker services stopped successfully")}catch(t){f.error("Error stopping Docker services: "+t.message),process.exit(1)}});Ie.command("restart [services...]").option("-v, --verbose","Verbose output").description("Restart specified Docker Compose services (frontend, backend, etc.)").hook("preAction",tt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Restarting Raclette services..."),e.length===0){f.warn("No services specified. Please specify which services to restart."),f.instruction("Usage: raclette restart <service1> <service2> ..."),f.instruction("Common services: frontend, backend, mongodb, cache");return}let r=pe?.name??ur.basename(jt);if(!await Ot.pathExists(ft)){f.warn("No docker-compose.yml found. Services may not be running with raclette.");return}for(let n of e)try{let o=await Lr(n,pe,ft);if(!Xt(o)){f.warn(`Service '${n}' (container: ${o}) doesn't appear to be running.`),f.instruction(" If you're sure it's running, it might have a different container name than expected."),f.instruction(" To restart by container name directly, use: docker restart <container_name>");continue}await Ot.pathExists(ft)?(f.progress(`Restarting service: ${n}...`),Ee(["-p",r,"-f",ft,"restart",n],{stdio:"inherit"})):(f.progress(` Restarting container: ${o}...`),ue(["restart",o],{stdio:"inherit"})),f.success(`Service '${n}' restarted successfully`)}catch(o){f.error(`Error restarting service '${n}': ${o.message}`)}}catch(r){f.error("Error restarting services: "+r.message),process.exit(1)}});Ie.command("update [target]").description("Update dependencies for frontend, backend, or both by running dependency check script").option("-v, --verbose","Verbose output").hook("preAction",tt).action(async(e="both",t)=>{try{f.setVerbose(t.verbose),["frontend","backend","both"].includes(e)||(f.error("Target must be one of: frontend, backend, both"),process.exit(1)),await ka(e,pe),await Aa(e,pe,Le)||(f.warn("\u26A0\uFE0F Dependencies update completed with errors"),process.exit(1))}catch(r){f.error("Error updating dependencies: "+r.message),process.exit(1)}});Ie.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").option("-f, --config-file <configFile>","Additionally add a raclette.config file to merge on top of the default").hook("preAction",tt).action(async e=>{try{f.setVerbose(e.verbose),f.raclette("Building raclette application...");let t=jt,r=yt(pe,e.configFile?await $t(e.configFile):{});Ot.writeFileSync(ur.join(Le,"raclette.config.yaml"),Se.dump(r)),Qo(r,Le),e.projectName&&(f.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 sh(r,t,n);switch(f.success("Build complete!"),o.mode){case"artifacts":f.success(`Build files are in ${o.buildDir}!`),f.raw(h.green("\u{1F680} Ready for deployment with deploy.sh"));break;case"images":f.success("Docker images built and tagged"),f.raw(h.green("\u{1F680} Ready for registry push"));break;case"package":f.success(`Build files are in ${o.buildDir}!`),o.deploymentPackage&&f.raw(h.green(`\u{1F680} Deployment package ready: ${o.deploymentPackage}`));break}process.exit(0)}catch(t){f.error("Error building application: "+t?.message),process.exit(1)}});Ie.command("add-package <target> <package...>").description(`Add a package to the project (target: ${Mr.join(", ")})`).option("--dev","Add as a development dependency").option("--no-update","Skip updating dependencies after adding packages",!0).option("-v, --verbose","Verbose output").hook("preAction",tt).action(async(e,t,r)=>{f.setVerbose(r.verbose);try{Mr.includes(e)||(f.error(`Target must be one of: ${Mr.join(", ")}}`),process.exit(1)),f.raclette(`Adding package(s) to ${e}...`);for(let n of t)await Ff(e,n,r.dev);f.info("Now updating auto-generated package.json file(s) in .raclette folder..."),await ka(e,pe),await Aa(e,pe,Le)}catch(n){f.error("Error adding package: "+n.message),process.exit(1)}});Ie.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").hook("preAction",tt).action(async(e,t)=>{try{if(f.setVerbose(t.verbose),f.raclette("Rebuilding Raclette Docker images..."),e.length===0){f.debug("\u{1F50D} Detecting services with changes...");let n=await cn(pe,Le);if(n.length===0){f.warn("No service file changes detected. Use service names to force rebuild.");return}e=n}let r=e.filter(n=>n==="frontend"||n==="backend"||n==="workbench");r.length===0&&(f.error("No valid services specified for rebuild"),f.warn("Valid services are: frontend, backend, workbench"),process.exit(1)),await ln(pe,Le,r,{noCache:t.noCache}),f.success(`Rebuild complete for services: ${r.join(", ")}`)}catch(r){f.error("Error rebuilding Docker images: "+r.message),process.exit(1)}});Ie.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").hook("preAction",tt).action(async e=>{try{if(f.setVerbose(e.verbose),f.raclette("Generating raclette deployment guide..."),e.returnOnly){let n={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:void 0,generateFiles:!1,returnOnly:!0},o=await uh(pe,n);console.log(o),process.exit(0)}let t={imagePrefix:e.imagePrefix,imageTag:e.imageTag,registry:e.registry,outputDir:e.outputDir,generateFiles:e.generateFiles},r=await lh(pe,t);f.success("Deployment guide generated!"),r.mode==="files"?(f.raw(h.cyan(`\u{1F4C1} Files created in: ${r.outputPath}`)),f.raw(h.yellow("\u{1F4A1} Use these files for local testing")),f.raw(h.yellow("\u{1F4A1} Copy DEPLOY.md content to your project README"))):(f.raw(h.cyan(`\u{1F4C4} Guide created: ${r.deployGuideFile}`)),f.raw(h.yellow("\u{1F4A1} Copy the user section to your project README"))),process.exit(0)}catch(t){f.error("Error generating deployment guide: "+t.message),process.exit(1)}});Ie.command("config").description("(Re)Configure Raclette Application").option("-c, --config <config>","configuration file","raclette.config.yaml").hook("preAction",tt).action(async e=>{console.log(h.bold.green("YO!")+h.bold.red(":"))});Ie.parse(process.argv);
|
|
1524
|
+
/*!
|
|
1525
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
1526
|
+
*
|
|
1527
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
1528
|
+
* Licensed under the MIT License.
|
|
1529
|
+
*/
|
|
1530
|
+
/*!
|
|
1531
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
1532
|
+
*
|
|
1533
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
1534
|
+
* Released under the MIT License.
|
|
1535
|
+
*/
|
|
1536
|
+
/*!
|
|
1537
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
1538
|
+
*
|
|
1539
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
1540
|
+
* Released under the MIT License.
|
|
1541
|
+
*/
|
|
1542
|
+
/*!
|
|
1543
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
1544
|
+
*
|
|
1545
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
1546
|
+
* Released under the MIT License.
|
|
1547
|
+
*/
|
|
1548
|
+
/*!
|
|
1549
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
1550
|
+
*
|
|
1551
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
1552
|
+
* Licensed under the MIT License.
|
|
1553
|
+
*/
|
|
1554
|
+
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1555
|
+
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1556
|
+
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
1557
|
+
/*!
|
|
1558
|
+
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
1559
|
+
* http://github.com/janl/mustache.js
|
|
1560
|
+
*/
|
|
1580
1561
|
//# sourceMappingURL=cli.js.map
|