@gjsify/cli 0.64.48-next.345 → 0.64.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.gjs.mjs CHANGED
@@ -146,7 +146,7 @@ fi
146
146
  `)}`:``;n.fail(N(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(C).length,Object.keys(C).join(`, `)+S))}},F.unknownArguments=function unknownArguments(S,C,I,H,W=!0){let q=t.getInternalMethods().getCommandInstance().getCommands(),Y=[],X=t.getInternalMethods().getContext();if(Object.keys(S).forEach(n=>{!zp.includes(n)&&!Object.prototype.hasOwnProperty.call(I,n)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),n)&&!F.isValidAndSomeAliasIsNotNew(n,C)&&Y.push(n)}),W&&(X.commands.length>0||q.length>0||H)&&S._.slice(X.commands.length).forEach(t=>{q.includes(``+t)||Y.push(``+t)}),W){let n=t.getDemandedCommands()._?.max||0,C=X.commands.length+n;C<S._.length&&S._.slice(C).forEach(t=>{t=String(t),!X.commands.includes(t)&&!Y.includes(t)&&Y.push(t)})}Y.length&&n.fail(N(`Unknown argument: %s`,`Unknown arguments: %s`,Y.length,Y.map(t=>t.trim()?t:`"${t}"`).join(`, `)))},F.unknownCommands=function unknownCommands(S){let C=t.getInternalMethods().getCommandInstance().getCommands(),F=[],I=t.getInternalMethods().getContext();return(I.commands.length>0||C.length>0)&&S._.slice(I.commands.length).forEach(t=>{C.includes(``+t)||F.push(``+t)}),F.length>0?(n.fail(N(`Unknown command: %s`,`Unknown commands: %s`,F.length,F.join(`, `))),!0):!1},F.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(n,S){if(!Object.prototype.hasOwnProperty.call(S,n))return!1;let C=t.parsed.newAliases;return[n,...S[n]].some(t=>!Object.prototype.hasOwnProperty.call(C,t)||!C[n])},F.limitedChoices=function limitedChoices(S){let N=t.getOptions(),F={};if(!Object.keys(N.choices).length)return;Object.keys(S).forEach(t=>{zp.indexOf(t)===-1&&Object.prototype.hasOwnProperty.call(N.choices,t)&&[].concat(S[t]).forEach(n=>{N.choices[t].indexOf(n)===-1&&n!==void 0&&(F[t]=(F[t]||[]).concat(n))})});let I=Object.keys(F);if(!I.length)return;let H=C(`Invalid values:`);I.forEach(t=>{H+=`\n ${C(`Argument: %s, Given: %s, Choices: %s`,t,n.stringifiedValues(F[t]),n.stringifiedValues(N.choices[t]))}`}),n.fail(H)};let I={};F.implies=function implies(n,C){argsert(`<string|object> [array|number|string]`,[n,C],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.implies(t,n[t])}):(t.global(n),I[n]||(I[n]=[]),Array.isArray(C)?C.forEach(t=>F.implies(n,t)):(assertNotStrictEqual(C,void 0,S),I[n].push(C)))},F.getImplied=function getImplied(){return I};function keyExists(t,n){let S=Number(n);return n=isNaN(S)?n:S,typeof n==`number`?n=t._.length>=n:n.match(/^--no-.+/)?(n=n.match(/^--no-(.+)/)[1],n=!Object.prototype.hasOwnProperty.call(t,n)):n=Object.prototype.hasOwnProperty.call(t,n),n}F.implications=function implications(t){let S=[];if(Object.keys(I).forEach(n=>{let C=n;(I[n]||[]).forEach(n=>{let N=C,F=n;N=keyExists(t,N),n=keyExists(t,n),N&&!n&&S.push(` ${C} -> ${F}`)})}),S.length){let t=`${C(`Implications failed:`)}\n`;S.forEach(n=>{t+=n}),n.fail(t)}};let H={};F.conflicts=function conflicts(n,S){argsert(`<string|object> [array|string]`,[n,S],arguments.length),typeof n==`object`?Object.keys(n).forEach(t=>{F.conflicts(t,n[t])}):(t.global(n),H[n]||(H[n]=[]),Array.isArray(S)?S.forEach(t=>F.conflicts(n,t)):H[n].push(S))},F.getConflicting=()=>H,F.conflicting=function conflictingFn(N){Object.keys(N).forEach(t=>{H[t]&&H[t].forEach(S=>{S&&N[t]!==void 0&&N[S]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,S))})}),t.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(H).forEach(t=>{H[t].forEach(F=>{F&&N[S.Parser.camelCase(t)]!==void 0&&N[S.Parser.camelCase(F)]!==void 0&&n.fail(C(`Arguments %s and %s are mutually exclusive`,t,F))})})},F.recommendCommands=function recommendCommands(t,S){S=S.sort((t,n)=>n.length-t.length);let N=null,F=1/0;for(let n=0,C;(C=S[n])!==void 0;n++){let n=levenshtein(t,C);n<=3&&n<F&&(F=n,N=C)}N&&n.fail(C(`Did you mean %s?`,N))},F.reset=function reset(t){return I=objFilter(I,n=>!t[n]),H=objFilter(H,n=>!t[n]),F};let W=[];return F.freeze=function freeze(){W.push({implied:I,conflicting:H})},F.unfreeze=function unfreeze(){let t=W.pop();assertNotStrictEqual(t,void 0,S),{implied:I,conflicting:H}=t},F}var zp,Bp=__esmMin(()=>{Ep(),Sp(),Rp(),jp(),zp=[`$0`,`--`,`_`]});function YargsFactory(t){return(n=[],S=t.process.cwd(),C)=>{let N=new YargsInstance(n,S,C,t);return Object.defineProperty(N,"argv",{get:()=>N.parse(),enumerable:!0}),N.help(),N.version(),N}}function isYargsInstance(t){return!!t&&typeof t.getInternalMethods==`function`}var __classPrivateFieldSet,__classPrivateFieldGet,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,YargsInstance,oh=__esmMin(()=>{_e(),Ap(),Sp(),Bl(),Np(),Ep(),Lp(),Bp(),jp(),Ul(),Dp(),Cp(),Op(),Mp(),__classPrivateFieldSet=function(t,n,S,C,N){if(C===`m`)throw TypeError(`Private method is not writable`);if(C===`a`&&!N)throw TypeError(`Private accessor was defined without a setter`);if(typeof n==`function`?t!==n||!N:!n.has(t))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return C===`a`?N.call(t,S):N?N.value=S:n.set(t,S),S},__classPrivateFieldGet=function(t,n,S,C){if(S===`a`&&!C)throw TypeError(`Private accessor was defined without a getter`);if(typeof n==`function`?t!==n||!C:!n.has(t))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return S===`m`?C:S===`a`?C.call(t):C?C.value:n.get(t)},Cm=Symbol(`copyDoubleDash`),wm=Symbol(`copyDoubleDash`),Tm=Symbol(`deleteFromParserHintObject`),Em=Symbol(`emitWarning`),Dm=Symbol(`freeze`),Om=Symbol(`getDollarZero`),km=Symbol(`getParserConfiguration`),Am=Symbol(`getUsageConfiguration`),jm=Symbol(`guessLocale`),Mm=Symbol(`guessVersion`),Nm=Symbol(`parsePositionalNumbers`),Pm=Symbol(`pkgUp`),Fm=Symbol(`populateParserHintArray`),Im=Symbol(`populateParserHintSingleValueDictionary`),Lm=Symbol(`populateParserHintArrayDictionary`),Rm=Symbol(`populateParserHintDictionary`),zm=Symbol(`sanitizeKey`),Bm=Symbol(`setKey`),Vm=Symbol(`unfreeze`),Hm=Symbol(`validateAsync`),Um=Symbol(`getCommandInstance`),Wm=Symbol(`getContext`),Gm=Symbol(`getHasOutput`),Km=Symbol(`getLoggerInstance`),qm=Symbol(`getParseContext`),Jm=Symbol(`getUsageInstance`),Ym=Symbol(`getValidationInstance`),Xm=Symbol(`hasParseCallback`),Zm=Symbol(`isGlobalContext`),Qm=Symbol(`postProcess`),$m=Symbol(`rebase`),eh=Symbol(`reset`),th=Symbol(`runYargsParserAndExecuteCommands`),nh=Symbol(`runValidation`),rh=Symbol(`setHasOutput`),ih=Symbol(`kTrackManuallySetKeys`),ah=`en_US`,YargsInstance=class{constructor(t=[],n,S,C){this.customScriptName=!1,this.parsed=!1,Vp.set(this,void 0),Hp.set(this,void 0),Up.set(this,{commands:[],fullCommands:[]}),Wp.set(this,null),Gp.set(this,null),Kp.set(this,`show-hidden`),qp.set(this,null),Jp.set(this,!0),Yp.set(this,{}),Xp.set(this,!0),Zp.set(this,[]),Qp.set(this,void 0),$p.set(this,{}),em.set(this,!1),tm.set(this,null),nm.set(this,!0),im.set(this,void 0),am.set(this,``),om.set(this,void 0),sm.set(this,void 0),cm.set(this,{}),lm.set(this,null),um.set(this,null),dm.set(this,{}),fm.set(this,{}),pm.set(this,void 0),mm.set(this,!1),hm.set(this,void 0),gm.set(this,!1),_m.set(this,!1),vm.set(this,!1),ym.set(this,void 0),bm.set(this,{}),xm.set(this,null),Sm.set(this,void 0),__classPrivateFieldSet(this,hm,C,`f`),__classPrivateFieldSet(this,pm,t,`f`),__classPrivateFieldSet(this,Hp,n,`f`),__classPrivateFieldSet(this,sm,S,`f`),__classPrivateFieldSet(this,Qp,new GlobalMiddleware(this),`f`),this.$0=this[Om](),this[eh](),__classPrivateFieldSet(this,Vp,__classPrivateFieldGet(this,Vp,`f`),`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`),`f`),__classPrivateFieldSet(this,Sm,__classPrivateFieldGet(this,Sm,`f`),`f`),__classPrivateFieldSet(this,om,__classPrivateFieldGet(this,om,`f`),`f`),__classPrivateFieldGet(this,om,`f`).showHiddenOpt=__classPrivateFieldGet(this,Kp,`f`),__classPrivateFieldSet(this,im,this[wm](),`f`),__classPrivateFieldGet(this,hm,`f`).y18n.setLocale(ah)}addHelpOpt(t,n){return argsert(`[string|boolean] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,tm,`f`)&&(this[Tm](__classPrivateFieldGet(this,tm,`f`)),__classPrivateFieldSet(this,tm,null,`f`)),t===!1&&n===void 0?this:(__classPrivateFieldSet(this,tm,typeof t==`string`?t:`help`,`f`),this.boolean(__classPrivateFieldGet(this,tm,`f`)),this.describe(__classPrivateFieldGet(this,tm,`f`),n||__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Show help`)),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(argsert(`[string|boolean] [string]`,[t,n],arguments.length),t===!1&&n===void 0)return this;let S=typeof t==`string`?t:__classPrivateFieldGet(this,Kp,`f`);return this.boolean(S),this.describe(S,n||__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Show hidden options`)),__classPrivateFieldGet(this,om,`f`).showHiddenOpt=S,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[Lm](this.alias.bind(this),`alias`,t,n),this}array(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`array`,t),this[ih](t),this}boolean(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`boolean`,t),this[ih](t),this}check(t,n){return argsert(`<function> [boolean]`,[t,n],arguments.length),this.middleware((n,S)=>maybeAsyncResult(()=>t(n,S.getOptions()),S=>(S?(typeof S==`string`||S instanceof Error)&&__classPrivateFieldGet(this,ym,`f`).fail(S.toString(),S):__classPrivateFieldGet(this,ym,`f`).fail(__classPrivateFieldGet(this,hm,`f`).y18n.__(`Argument check failed: %s`,t.toString())),n),t=>(__classPrivateFieldGet(this,ym,`f`).fail(t.message?t.message:t.toString(),t),n)),!1,n),this}choices(t,n){return argsert(`<object|string|array> [string|array]`,[t,n],arguments.length),this[Lm](this.choices.bind(this),`choices`,t,n),this}coerce(t,n){if(argsert(`<object|string|array> [function]`,[t,n],arguments.length),Array.isArray(t)){if(!n)throw new zl(`coerce callback must be provided`);for(let S of t)this.coerce(S,n);return this}else if(typeof t==`object`){for(let n of Object.keys(t))this.coerce(n,t[n]);return this}if(!n)throw new zl(`coerce callback must be provided`);let S=t;return __classPrivateFieldGet(this,om,`f`).key[S]=!0,__classPrivateFieldGet(this,Qp,`f`).addCoerceMiddleware((t,C)=>{let N=C.getAliases()[S]??[],F=[S,...N].filter(n=>Object.prototype.hasOwnProperty.call(t,n));return F.length===0?t:maybeAsyncResult(()=>n(t[F[0]]),n=>(F.forEach(S=>{t[S]=n}),t),t=>{throw new zl(t.message)})},S),this}conflicts(t,n){return argsert(`<string|object> [string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,Sm,`f`).conflicts(t,n),this}config(t=`config`,n,S){return argsert(`[object|string] [string|function] [function]`,[t,n,S],arguments.length),typeof t==`object`&&!Array.isArray(t)?(t=applyExtends(t,__classPrivateFieldGet(this,Hp,`f`),this[km]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).configObjects=(__classPrivateFieldGet(this,om,`f`).configObjects||[]).concat(t),this):(typeof n==`function`&&(S=n,n=void 0),this.describe(t,n||__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(t)?t:[t]).forEach(t=>{__classPrivateFieldGet(this,om,`f`).config[t]=S||!0}),this)}completion(t,n,S){return argsert(`[string] [string|boolean|function] [function]`,[t,n,S],arguments.length),typeof n==`function`&&(S=n,n=void 0),__classPrivateFieldSet(this,Gp,t||__classPrivateFieldGet(this,Gp,`f`)||`completion`,`f`),!n&&n!==!1&&(n=`generate completion script`),this.command(__classPrivateFieldGet(this,Gp,`f`),n),S&&__classPrivateFieldGet(this,Wp,`f`).registerFunction(S),this}command(t,n,S,C,N,F){return argsert(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[t,n,S,C,N,F],arguments.length),__classPrivateFieldGet(this,Vp,`f`).addHandler(t,n,S,C,N,F),this}commands(t,n,S,C,N,F){return this.command(t,n,S,C,N,F)}commandDir(t,n){argsert(`<string> [object]`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,sm,`f`)||__classPrivateFieldGet(this,hm,`f`).require;return __classPrivateFieldGet(this,Vp,`f`).addDirectory(t,S,__classPrivateFieldGet(this,hm,`f`).getCallerFile(),n),this}count(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`count`,t),this[ih](t),this}default(t,n,S){return argsert(`<object|string|array> [*] [string]`,[t,n,S],arguments.length),S&&(assertSingleKey(t,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).defaultDescription[t]=S),typeof n==`function`&&(assertSingleKey(t,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).defaultDescription[t]||(__classPrivateFieldGet(this,om,`f`).defaultDescription[t]=__classPrivateFieldGet(this,ym,`f`).functionDescription(n)),n=n.call()),this[Im](this.default.bind(this),`default`,t,n),this}defaults(t,n,S){return this.default(t,n,S)}demandCommand(t=1,n,S,C){return argsert(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[t,n,S,C],arguments.length),typeof n!=`number`&&(S=n,n=1/0),this.global(`_`,!1),__classPrivateFieldGet(this,om,`f`).demandedCommands._={min:t,max:n,minMsg:S,maxMsg:C},this}demand(t,n,S){return Array.isArray(n)?(n.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,hm,`f`)),this.demandOption(t,S)}),n=1/0):typeof n!=`number`&&(S=n,n=1/0),typeof t==`number`?(assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,hm,`f`)),this.demandCommand(t,n,S,S)):Array.isArray(t)?t.forEach(t=>{assertNotStrictEqual(S,!0,__classPrivateFieldGet(this,hm,`f`)),this.demandOption(t,S)}):typeof S==`string`?this.demandOption(t,S):(S===!0||S===void 0)&&this.demandOption(t),this}demandOption(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Im](this.demandOption.bind(this),`demandedOptions`,t,n),this}deprecateOption(t,n){return argsert(`<string> [string|boolean]`,[t,n],arguments.length),__classPrivateFieldGet(this,om,`f`).deprecatedOptions[t]=n,this}describe(t,n){return argsert(`<object|string|array> [string]`,[t,n],arguments.length),this[Bm](t,!0),__classPrivateFieldGet(this,ym,`f`).describe(t,n),this}detectLocale(t){return argsert(`<boolean>`,[t],arguments.length),__classPrivateFieldSet(this,Jp,t,`f`),this}env(t){return argsert(`[string|boolean]`,[t],arguments.length),t===!1?delete __classPrivateFieldGet(this,om,`f`).envPrefix:__classPrivateFieldGet(this,om,`f`).envPrefix=t||``,this}epilogue(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,ym,`f`).epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return argsert(`<string|array> [string]`,[t,n],arguments.length),Array.isArray(t)?t.forEach(t=>this.example(...t)):__classPrivateFieldGet(this,ym,`f`).example(t,n),this}exit(t,n){__classPrivateFieldSet(this,em,!0,`f`),__classPrivateFieldSet(this,qp,n,`f`),__classPrivateFieldGet(this,Xp,`f`)&&__classPrivateFieldGet(this,hm,`f`).process.exit(t)}exitProcess(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,Xp,t,`f`),this}fail(t){if(argsert(`<function|boolean>`,[t],arguments.length),typeof t==`boolean`&&t!==!1)throw new zl(`Invalid first argument. Expected function or boolean 'false'`);return __classPrivateFieldGet(this,ym,`f`).failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return argsert(`<array> [function]`,[t,n],arguments.length),n?__classPrivateFieldGet(this,Wp,`f`).getCompletion(t,n):new Promise((n,S)=>{__classPrivateFieldGet(this,Wp,`f`).getCompletion(t,(t,C)=>{t?S(t):n(C)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,om,`f`).demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,om,`f`).demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,om,`f`).deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,Jp,`f`)}getExitProcess(){return __classPrivateFieldGet(this,Xp,`f`)}getGroups(){return Object.assign({},__classPrivateFieldGet(this,$p,`f`),__classPrivateFieldGet(this,fm,`f`))}getHelp(){if(__classPrivateFieldSet(this,em,!0,`f`),!__classPrivateFieldGet(this,ym,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[th](__classPrivateFieldGet(this,pm,`f`),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,ym,`f`).help())}let t=__classPrivateFieldGet(this,Vp,`f`).runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,ym,`f`).help())}return Promise.resolve(__classPrivateFieldGet(this,ym,`f`).help())}getOptions(){return __classPrivateFieldGet(this,om,`f`)}getStrict(){return __classPrivateFieldGet(this,gm,`f`)}getStrictCommands(){return __classPrivateFieldGet(this,_m,`f`)}getStrictOptions(){return __classPrivateFieldGet(this,vm,`f`)}global(t,n){return argsert(`<string|array> [boolean]`,[t,n],arguments.length),t=[].concat(t),n===!1?t.forEach(t=>{__classPrivateFieldGet(this,om,`f`).local.includes(t)||__classPrivateFieldGet(this,om,`f`).local.push(t)}):__classPrivateFieldGet(this,om,`f`).local=__classPrivateFieldGet(this,om,`f`).local.filter(n=>t.indexOf(n)===-1),this}group(t,n){argsert(`<string|array> <string>`,[t,n],arguments.length);let S=__classPrivateFieldGet(this,fm,`f`)[n]||__classPrivateFieldGet(this,$p,`f`)[n];__classPrivateFieldGet(this,fm,`f`)[n]&&delete __classPrivateFieldGet(this,fm,`f`)[n];let C={};return __classPrivateFieldGet(this,$p,`f`)[n]=(S||[]).concat(t).filter(t=>C[t]?!1:C[t]=!0),this}hide(t){return argsert(`<string>`,[t],arguments.length),__classPrivateFieldGet(this,om,`f`).hiddenOptions.push(t),this}implies(t,n){return argsert(`<string|object> [number|string|array]`,[t,n],arguments.length),__classPrivateFieldGet(this,Sm,`f`).implies(t,n),this}locale(t){return argsert(`[string]`,[t],arguments.length),t===void 0?(this[jm](),__classPrivateFieldGet(this,hm,`f`).y18n.getLocale()):(__classPrivateFieldSet(this,Jp,!1,`f`),__classPrivateFieldGet(this,hm,`f`).y18n.setLocale(t),this)}middleware(t,n,S){return __classPrivateFieldGet(this,Qp,`f`).addMiddleware(t,!!n,S)}nargs(t,n){return argsert(`<string|object|array> [number]`,[t,n],arguments.length),this[Im](this.nargs.bind(this),`narg`,t,n),this}normalize(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`normalize`,t),this}number(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`number`,t),this[ih](t),this}option(t,n){if(argsert(`<string|object> [object]`,[t,n],arguments.length),typeof t==`object`)Object.keys(t).forEach(n=>{this.options(n,t[n])});else{typeof n!=`object`&&(n={}),this[ih](t),__classPrivateFieldGet(this,xm,`f`)&&(t===`version`||n?.alias===`version`)&&this[Em]([`"version" is a reserved word.`,`Please do one of the following:`,'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)",`- Use a different option key`,`https://yargs.js.org/docs/#api-reference-version`].join(`
147
147
  `),void 0,`versionWarning`),__classPrivateFieldGet(this,om,`f`).key[t]=!0,n.alias&&this.alias(t,n.alias);let S=n.deprecate||n.deprecated;S&&this.deprecateOption(t,S);let C=n.demand||n.required||n.require;C&&this.demand(t,C),n.demandOption&&this.demandOption(t,typeof n.demandOption==`string`?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),`default`in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type===`boolean`)&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type===`array`)&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type===`number`)&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type===`string`)&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type===`count`)&&this.count(t),typeof n.global==`boolean`&&this.global(t,n.global),n.defaultDescription&&(__classPrivateFieldGet(this,om,`f`).defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let N=n.describe||n.description||n.desc,F=__classPrivateFieldGet(this,ym,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(F,t)||typeof N==`string`)&&this.describe(t,N),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,S){argsert(`[string|array] [function|boolean|object] [function]`,[t,n,S],arguments.length),this[Dm](),t===void 0&&(t=__classPrivateFieldGet(this,pm,`f`)),typeof n==`object`&&(__classPrivateFieldSet(this,um,n,`f`),n=S),typeof n==`function`&&(__classPrivateFieldSet(this,lm,n,`f`),n=!1),n||__classPrivateFieldSet(this,pm,t,`f`),__classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldSet(this,Xp,!1,`f`);let C=this[th](t,!!n),N=this.parsed;return __classPrivateFieldGet(this,Wp,`f`).setParsed(this.parsed),isPromise(C)?C.then(t=>(__classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldGet(this,lm,`f`).call(this,__classPrivateFieldGet(this,qp,`f`),t,__classPrivateFieldGet(this,am,`f`)),t)).catch(t=>{throw __classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldGet(this,lm,`f`)(t,this.parsed.argv,__classPrivateFieldGet(this,am,`f`)),t}).finally(()=>{this[Vm](),this.parsed=N}):(__classPrivateFieldGet(this,lm,`f`)&&__classPrivateFieldGet(this,lm,`f`).call(this,__classPrivateFieldGet(this,qp,`f`),C,__classPrivateFieldGet(this,am,`f`)),this[Vm](),this.parsed=N,C)}parseAsync(t,n,S){let C=this.parse(t,n,S);return isPromise(C)?C:Promise.resolve(C)}parseSync(t,n,S){let C=this.parse(t,n,S);if(isPromise(C))throw new zl(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return C}parserConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,cm,t,`f`),this}pkgConf(t,n){argsert(`<string> [string]`,[t,n],arguments.length);let S=null,C=this[Pm](n||__classPrivateFieldGet(this,Hp,`f`));return C[t]&&typeof C[t]==`object`&&(S=applyExtends(C[t],n||__classPrivateFieldGet(this,Hp,`f`),this[km]()[`deep-merge-config`]||!1,__classPrivateFieldGet(this,hm,`f`)),__classPrivateFieldGet(this,om,`f`).configObjects=(__classPrivateFieldGet(this,om,`f`).configObjects||[]).concat(S)),this}positional(t,n){argsert(`<string> <object>`,[t,n],arguments.length);let S=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];n=objFilter(n,(t,n)=>t===`type`&&![`string`,`number`,`boolean`].includes(n)?!1:S.includes(t));let C=__classPrivateFieldGet(this,Up,`f`).fullCommands[__classPrivateFieldGet(this,Up,`f`).fullCommands.length-1],N=C?__classPrivateFieldGet(this,Vp,`f`).cmdToParseOptions(C):{array:[],alias:{},default:{},demand:{}};return objectKeys(N).forEach(S=>{let C=N[S];Array.isArray(C)?C.indexOf(t)!==-1&&(n[S]=!0):C[t]&&!(S in n)&&(n[S]=C[t])}),this.group(t,__classPrivateFieldGet(this,ym,`f`).getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,mm,t,`f`),this}required(t,n,S){return this.demand(t,n,S)}require(t,n,S){return this.demand(t,n,S)}requiresArg(t){return argsert(`<array|string|object> [number]`,[t],arguments.length),typeof t==`string`&&__classPrivateFieldGet(this,om,`f`).narg[t]||this[Im](this.requiresArg.bind(this),`narg`,t,NaN),this}showCompletionScript(t,n){return argsert(`[string] [string]`,[t,n],arguments.length),t||=this.$0,__classPrivateFieldGet(this,im,`f`).log(__classPrivateFieldGet(this,Wp,`f`).generateCompletionScript(t,n||__classPrivateFieldGet(this,Gp,`f`)||`completion`)),this}showHelp(t){if(argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldSet(this,em,!0,`f`),!__classPrivateFieldGet(this,ym,`f`).hasCachedHelpMessage()){if(!this.parsed){let n=this[th](__classPrivateFieldGet(this,pm,`f`),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,ym,`f`).showHelp(t)}),this}let n=__classPrivateFieldGet(this,Vp,`f`).runDefaultBuilderOn(this);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,ym,`f`).showHelp(t)}),this}return __classPrivateFieldGet(this,ym,`f`).showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return argsert(`[boolean|string] [string]`,[t,n],arguments.length),__classPrivateFieldGet(this,ym,`f`).showHelpOnFail(t,n),this}showVersion(t){return argsert(`[string|function]`,[t],arguments.length),__classPrivateFieldGet(this,ym,`f`).showVersion(t),this}skipValidation(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`skipValidation`,t),this}strict(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,gm,t!==!1,`f`),this}strictCommands(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,_m,t!==!1,`f`),this}strictOptions(t){return argsert(`[boolean]`,[t],arguments.length),__classPrivateFieldSet(this,vm,t!==!1,`f`),this}string(t){return argsert(`<array|string>`,[t],arguments.length),this[Fm](`string`,t),this[ih](t),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,hm,`f`).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,Jp,!1,`f`),__classPrivateFieldGet(this,hm,`f`).y18n.updateLocale(t),this}usage(t,n,S,C){if(argsert(`<string|null|undefined> [string|boolean] [function|object] [function]`,[t,n,S,C],arguments.length),n!==void 0){if(assertNotStrictEqual(t,null,__classPrivateFieldGet(this,hm,`f`)),(t||``).match(/^\$0( |$)/))return this.command(t,n,S,C);throw new zl(`.usage() description must start with $0 if being used as alias for .command()`)}else return __classPrivateFieldGet(this,ym,`f`).usage(t),this}usageConfiguration(t){return argsert(`<object>`,[t],arguments.length),__classPrivateFieldSet(this,bm,t,`f`),this}version(t,n,S){let C=`version`;if(argsert(`[boolean|string] [string] [string]`,[t,n,S],arguments.length),__classPrivateFieldGet(this,xm,`f`)&&(this[Tm](__classPrivateFieldGet(this,xm,`f`)),__classPrivateFieldGet(this,ym,`f`).version(void 0),__classPrivateFieldSet(this,xm,null,`f`)),arguments.length===0)S=this[Mm](),t=C;else if(arguments.length===1){if(t===!1)return this;S=t,t=C}else arguments.length===2&&(S=n,n=void 0);return __classPrivateFieldSet(this,xm,typeof t==`string`?t:C,`f`),n||=__classPrivateFieldGet(this,ym,`f`).deferY18nLookup(`Show version number`),__classPrivateFieldGet(this,ym,`f`).version(S||void 0),this.boolean(__classPrivateFieldGet(this,xm,`f`)),this.describe(__classPrivateFieldGet(this,xm,`f`),n),this}wrap(t){return argsert(`<number|null|undefined>`,[t],arguments.length),__classPrivateFieldGet(this,ym,`f`).wrap(t),this}[(Vp=new WeakMap,Hp=new WeakMap,Up=new WeakMap,Wp=new WeakMap,Gp=new WeakMap,Kp=new WeakMap,qp=new WeakMap,Jp=new WeakMap,Yp=new WeakMap,Xp=new WeakMap,Zp=new WeakMap,Qp=new WeakMap,$p=new WeakMap,em=new WeakMap,tm=new WeakMap,nm=new WeakMap,im=new WeakMap,am=new WeakMap,om=new WeakMap,sm=new WeakMap,cm=new WeakMap,lm=new WeakMap,um=new WeakMap,dm=new WeakMap,fm=new WeakMap,pm=new WeakMap,mm=new WeakMap,hm=new WeakMap,gm=new WeakMap,_m=new WeakMap,vm=new WeakMap,ym=new WeakMap,bm=new WeakMap,xm=new WeakMap,Sm=new WeakMap,Cm)](t){if(!t._||!t[`--`])return t;t._.push.apply(t._,t[`--`]);try{delete t[`--`]}catch{}return t}[wm](){return{log:(...t)=>{this[Xm]()||ge.log(...t),__classPrivateFieldSet(this,em,!0,`f`),__classPrivateFieldGet(this,am,`f`).length&&__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+`
148
148
  `,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+t.join(` `),`f`)},error:(...t)=>{this[Xm]()||ge.error(...t),__classPrivateFieldSet(this,em,!0,`f`),__classPrivateFieldGet(this,am,`f`).length&&__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+`
149
- `,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+t.join(` `),`f`)}}}[Tm](t){objectKeys(__classPrivateFieldGet(this,om,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,om,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,ym,`f`).getDescriptions()[t]}[Em](t,n,S){__classPrivateFieldGet(this,Yp,`f`)[S]||(__classPrivateFieldGet(this,hm,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Yp,`f`)[S]=!0)}[Dm](){__classPrivateFieldGet(this,Zp,`f`).push({options:__classPrivateFieldGet(this,om,`f`),configObjects:__classPrivateFieldGet(this,om,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Xp,`f`),groups:__classPrivateFieldGet(this,$p,`f`),strict:__classPrivateFieldGet(this,gm,`f`),strictCommands:__classPrivateFieldGet(this,_m,`f`),strictOptions:__classPrivateFieldGet(this,vm,`f`),completionCommand:__classPrivateFieldGet(this,Gp,`f`),output:__classPrivateFieldGet(this,am,`f`),exitError:__classPrivateFieldGet(this,qp,`f`),hasOutput:__classPrivateFieldGet(this,em,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,lm,`f`),parseContext:__classPrivateFieldGet(this,um,`f`)}),__classPrivateFieldGet(this,ym,`f`).freeze(),__classPrivateFieldGet(this,Sm,`f`).freeze(),__classPrivateFieldGet(this,Vp,`f`).freeze(),__classPrivateFieldGet(this,Qp,`f`).freeze()}[Om](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,hm,`f`).process.argv()[0])?__classPrivateFieldGet(this,hm,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,hm,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[$m](__classPrivateFieldGet(this,Hp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,hm,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,hm,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,hm,`f`).path.dirname(__classPrivateFieldGet(this,hm,`f`).process.execPath())}/`,``)),t}[km](){return __classPrivateFieldGet(this,cm,`f`)}[Am](){return __classPrivateFieldGet(this,bm,`f`)}[jm](){if(!__classPrivateFieldGet(this,Jp,`f`))return;let t=__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[Mm](){return this[Pm]().version||`unknown`}[Nm](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,hm,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[Pm](t){let n=t||`*`;if(__classPrivateFieldGet(this,dm,`f`)[n])return __classPrivateFieldGet(this,dm,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,hm,`f`).mainFilename;__classPrivateFieldGet(this,hm,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,hm,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,hm,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,hm,`f`)),S=JSON.parse(__classPrivateFieldGet(this,hm,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,dm,`f`)[n]=S||{},__classPrivateFieldGet(this,dm,`f`)[n]}[Fm](t,n){n=[].concat(n),n.forEach(n=>{n=this[zm](n),__classPrivateFieldGet(this,om,`f`)[t].push(n)})}[Im](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=S})}[Lm](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=(__classPrivateFieldGet(this,om,`f`)[t][n]||[]).concat(S)})}[Rm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[zm](S),C)}[zm](t){return t===`__proto__`?`___proto___`:t}[Bm](t,n){return this[Im](this[Bm].bind(this),`key`,t,n),this}[Vm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Zp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,hm,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,om,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Xp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,$p,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,am,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,qp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,em,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,gm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,_m,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,vm,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,Gp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,lm,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,um,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,om,`f`).configObjects=te,__classPrivateFieldGet(this,ym,`f`).unfreeze(),__classPrivateFieldGet(this,Sm,`f`).unfreeze(),__classPrivateFieldGet(this,Vp,`f`).unfreeze(),__classPrivateFieldGet(this,Qp,`f`).unfreeze()}[Hm](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Um].bind(this),getContext:this[Wm].bind(this),getHasOutput:this[Gm].bind(this),getLoggerInstance:this[Km].bind(this),getParseContext:this[qm].bind(this),getParserConfiguration:this[km].bind(this),getUsageConfiguration:this[Am].bind(this),getUsageInstance:this[Jm].bind(this),getValidationInstance:this[Ym].bind(this),hasParseCallback:this[Xm].bind(this),isGlobalContext:this[Zm].bind(this),postProcess:this[Qm].bind(this),reset:this[eh].bind(this),runValidation:this[nh].bind(this),runYargsParserAndExecuteCommands:this[th].bind(this),setHasOutput:this[rh].bind(this)}}[Um](){return __classPrivateFieldGet(this,Vp,`f`)}[Wm](){return __classPrivateFieldGet(this,Up,`f`)}[Gm](){return __classPrivateFieldGet(this,em,`f`)}[Km](){return __classPrivateFieldGet(this,im,`f`)}[qm](){return __classPrivateFieldGet(this,um,`f`)||{}}[Jm](){return __classPrivateFieldGet(this,ym,`f`)}[Ym](){return __classPrivateFieldGet(this,Sm,`f`)}[Xm](){return!!__classPrivateFieldGet(this,lm,`f`)}[Zm](){return __classPrivateFieldGet(this,nm,`f`)}[Qm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[Cm](t)),(this[km]()[`parse-positional-numbers`]||this[km]()[`parse-positional-numbers`]===void 0)&&(t=this[Nm](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)),t)}[eh](t={}){__classPrivateFieldSet(this,om,__classPrivateFieldGet(this,om,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,om,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,om,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,fm,`f`),Object.keys(__classPrivateFieldGet(this,$p,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,$p,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,$p,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,om,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,om,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,om,`f`).envPrefix,__classPrivateFieldSet(this,om,n,`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`)?__classPrivateFieldGet(this,ym,`f`).reset(S):usage(this,__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Sm,__classPrivateFieldGet(this,Sm,`f`)?__classPrivateFieldGet(this,Sm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Vp,__classPrivateFieldGet(this,Vp,`f`)?__classPrivateFieldGet(this,Vp,`f`).reset():command(__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Sm,`f`),__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Wp,`f`)||__classPrivateFieldSet(this,Wp,completion(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Vp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Qp,`f`).reset(),__classPrivateFieldSet(this,Gp,null,`f`),__classPrivateFieldSet(this,am,``,`f`),__classPrivateFieldSet(this,qp,null,`f`),__classPrivateFieldSet(this,em,!1,`f`),this.parsed=!1,this}[$m](t,n){return __classPrivateFieldGet(this,hm,`f`).path.relative(t,n)}[th](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,pm,`f`),__classPrivateFieldGet(this,om,`f`).__=__classPrivateFieldGet(this,hm,`f`).y18n.__,__classPrivateFieldGet(this,om,`f`).configuration=this[km]();let I=!!__classPrivateFieldGet(this,om,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,om,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,hm,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,om,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,um,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,tm,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,xm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,ym,`f`).clearCachedHelpMessage();try{if(this[jm](),n)return this[Qm](q,I,!!S,!1);__classPrivateFieldGet(this,tm,`f`)&&[__classPrivateFieldGet(this,tm,`f`)].concat(X[__classPrivateFieldGet(this,tm,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,nm,!1,`f`);let H=__classPrivateFieldGet(this,Vp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Wp,`f`)?.completionKey?[__classPrivateFieldGet(this,Wp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Wp,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,Gp,`f`)){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Qm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,Gp,`f`)){t=F;break}!__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,mm,`f`)&&t&&!re&&__classPrivateFieldGet(this,Sm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,Gp,`f`)&&q._.includes(__classPrivateFieldGet(this,Gp,`f`))&&!ne&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Qm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Wp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Wp,`f`).getCompletion(n,(t,n)=>{if(t)throw new zl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,im,`f`).log(t)}),this.exit(0)}),this[Qm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,em,`f`)||(Z?(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,im,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,ym,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,om,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,om,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new zl(W.error.message);if(!ne){let t=this[nh](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!0)),Y=this[Hm](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof zl)__classPrivateFieldGet(this,ym,`f`).fail(t.message,t);else throw t}return this[Qm](Y??q,I,!!S,!0)}[nh](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new zl(S.message);__classPrivateFieldGet(this,Sm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,Sm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,_m,`f`)&&(I=__classPrivateFieldGet(this,Sm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,gm,`f`)&&!I?__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,vm,`f`)&&__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,Sm,`f`).limitedChoices(F),__classPrivateFieldGet(this,Sm,`f`).implications(F),__classPrivateFieldGet(this,Sm,`f`).conflicting(F)}}[rh](){__classPrivateFieldSet(this,em,!0,`f`)}[ih](t){if(typeof t==`string`)__classPrivateFieldGet(this,om,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,om,`f`).key[n]=!0}}}),sh,ch=__esmMin(()=>{xp(),oh(),sh=YargsFactory(bp)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var lh=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.48-next.345`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var uh=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,dh=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):fh}function parseNpmrc(t){let n={registry:fh,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var fh,ph=__esmMin(()=>{fh=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var mh=__esmMin(()=>{dh(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var hh=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var gh=__esmMin(()=>{uh(),dh(),ph(),mh()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var vh=__esmMin(()=>{uh(),dh(),mh(),hh()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var yh=__esmMin(()=>{uh(),ph()}),bh=__esmMin(()=>{uh(),dh(),ph(),hh(),gh(),vh(),yh()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return xh===void 0&&(xh=`0.64.48-next.345`),xh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=Hn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=Hn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var xh,Sh=__esmMin(()=>{rf(),Xn(),cr(),bh()}),Ch,wh=__esmMin(()=>{Ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(Th.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${Th.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&Eh[t]===`external-link`}var Th,Eh,Dh,Oh=__esmMin(()=>{Th=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],Eh={flathub:`external-link`,web:`external-link`,"microsoft-store":`none`,"apple-app-store":`store-purchase`},Dh=`GJSIFY_CHANNEL`});function parseDeclaredPricing(t,n){if(!(t===void 0||t===``)){if(kh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a pricing tier. Known: ${kh.join(`, `)}.`)}}var kh,Ah,jh=__esmMin(()=>{kh=[`free`,`paid`],Ah=`GJSIFY_PRICING`}),Mh=__commonJSMin(((t,n)=>{let S=(Xn(),__toCommonJS(Pn)),C=($l(),__toCommonJS(Yl)),N=(rf(),__toCommonJS(tf)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),Nh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),Ph=__commonJSMin(((t,n)=>{let S=Nh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),Fh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(ru(),__toCommonJS(eu)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(Xn(),__toCommonJS(Pn)),H=Mh(),W=Ph();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),Ih=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),Lh=__commonJSMin(((t,n)=>{var S=(Hu(),__toCommonJS(Ru)),C=Ih(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
149
+ `,`f`),__classPrivateFieldSet(this,am,__classPrivateFieldGet(this,am,`f`)+t.join(` `),`f`)}}}[Tm](t){objectKeys(__classPrivateFieldGet(this,om,`f`)).forEach(n=>{if((t=>t===`configObjects`)(n))return;let S=__classPrivateFieldGet(this,om,`f`)[n];Array.isArray(S)?S.includes(t)&&S.splice(S.indexOf(t),1):typeof S==`object`&&delete S[t]}),delete __classPrivateFieldGet(this,ym,`f`).getDescriptions()[t]}[Em](t,n,S){__classPrivateFieldGet(this,Yp,`f`)[S]||(__classPrivateFieldGet(this,hm,`f`).process.emitWarning(t,n),__classPrivateFieldGet(this,Yp,`f`)[S]=!0)}[Dm](){__classPrivateFieldGet(this,Zp,`f`).push({options:__classPrivateFieldGet(this,om,`f`),configObjects:__classPrivateFieldGet(this,om,`f`).configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,Xp,`f`),groups:__classPrivateFieldGet(this,$p,`f`),strict:__classPrivateFieldGet(this,gm,`f`),strictCommands:__classPrivateFieldGet(this,_m,`f`),strictOptions:__classPrivateFieldGet(this,vm,`f`),completionCommand:__classPrivateFieldGet(this,Gp,`f`),output:__classPrivateFieldGet(this,am,`f`),exitError:__classPrivateFieldGet(this,qp,`f`),hasOutput:__classPrivateFieldGet(this,em,`f`),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,lm,`f`),parseContext:__classPrivateFieldGet(this,um,`f`)}),__classPrivateFieldGet(this,ym,`f`).freeze(),__classPrivateFieldGet(this,Sm,`f`).freeze(),__classPrivateFieldGet(this,Vp,`f`).freeze(),__classPrivateFieldGet(this,Qp,`f`).freeze()}[Om](){let t=``,n;return n=/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,hm,`f`).process.argv()[0])?__classPrivateFieldGet(this,hm,`f`).process.argv().slice(1,2):__classPrivateFieldGet(this,hm,`f`).process.argv().slice(0,1),t=n.map(t=>{let n=this[$m](__classPrivateFieldGet(this,Hp,`f`),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<t.length?n:t}).join(` `).trim(),__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&__classPrivateFieldGet(this,hm,`f`).getProcessArgvBin()===__classPrivateFieldGet(this,hm,`f`).getEnv(`_`)&&(t=__classPrivateFieldGet(this,hm,`f`).getEnv(`_`).replace(`${__classPrivateFieldGet(this,hm,`f`).path.dirname(__classPrivateFieldGet(this,hm,`f`).process.execPath())}/`,``)),t}[km](){return __classPrivateFieldGet(this,cm,`f`)}[Am](){return __classPrivateFieldGet(this,bm,`f`)}[jm](){if(!__classPrivateFieldGet(this,Jp,`f`))return;let t=__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_ALL`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LC_MESSAGES`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANG`)||__classPrivateFieldGet(this,hm,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(t.replace(/[.:].*/,``))}[Mm](){return this[Pm]().version||`unknown`}[Nm](t){let n=t[`--`]?t[`--`]:t._;for(let t=0,S;(S=n[t])!==void 0;t++)__classPrivateFieldGet(this,hm,`f`).Parser.looksLikeNumber(S)&&Number.isSafeInteger(Math.floor(parseFloat(`${S}`)))&&(n[t]=Number(S));return t}[Pm](t){let n=t||`*`;if(__classPrivateFieldGet(this,dm,`f`)[n])return __classPrivateFieldGet(this,dm,`f`)[n];let S={};try{let n=t||__classPrivateFieldGet(this,hm,`f`).mainFilename;__classPrivateFieldGet(this,hm,`f`).path.extname(n)&&(n=__classPrivateFieldGet(this,hm,`f`).path.dirname(n));let C=__classPrivateFieldGet(this,hm,`f`).findUp(n,(t,n)=>{if(n.includes(`package.json`))return`package.json`});assertNotStrictEqual(C,void 0,__classPrivateFieldGet(this,hm,`f`)),S=JSON.parse(__classPrivateFieldGet(this,hm,`f`).readFileSync(C,`utf8`))}catch{}return __classPrivateFieldGet(this,dm,`f`)[n]=S||{},__classPrivateFieldGet(this,dm,`f`)[n]}[Fm](t,n){n=[].concat(n),n.forEach(n=>{n=this[zm](n),__classPrivateFieldGet(this,om,`f`)[t].push(n)})}[Im](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=S})}[Lm](t,n,S,C){this[Rm](t,n,S,C,(t,n,S)=>{__classPrivateFieldGet(this,om,`f`)[t][n]=(__classPrivateFieldGet(this,om,`f`)[t][n]||[]).concat(S)})}[Rm](t,n,S,C,N){if(Array.isArray(S))S.forEach(n=>{t(n,C)});else if((t=>typeof t==`object`)(S))for(let n of objectKeys(S))t(n,S[n]);else N(n,this[zm](S),C)}[zm](t){return t===`__proto__`?`___proto___`:t}[Bm](t,n){return this[Im](this[Bm].bind(this),`key`,t,n),this}[Vm](){var t,n,S,C,N,F,I,H,W,q,Y,X;let Z=__classPrivateFieldGet(this,Zp,`f`).pop();assertNotStrictEqual(Z,void 0,__classPrivateFieldGet(this,hm,`f`));let te;t=this,n=this,S=this,C=this,N=this,F=this,I=this,H=this,W=this,q=this,Y=this,X=this,{options:{set value(n){__classPrivateFieldSet(t,om,n,`f`)}}.value,configObjects:te,exitProcess:{set value(t){__classPrivateFieldSet(n,Xp,t,`f`)}}.value,groups:{set value(t){__classPrivateFieldSet(S,$p,t,`f`)}}.value,output:{set value(t){__classPrivateFieldSet(C,am,t,`f`)}}.value,exitError:{set value(t){__classPrivateFieldSet(N,qp,t,`f`)}}.value,hasOutput:{set value(t){__classPrivateFieldSet(F,em,t,`f`)}}.value,parsed:this.parsed,strict:{set value(t){__classPrivateFieldSet(I,gm,t,`f`)}}.value,strictCommands:{set value(t){__classPrivateFieldSet(H,_m,t,`f`)}}.value,strictOptions:{set value(t){__classPrivateFieldSet(W,vm,t,`f`)}}.value,completionCommand:{set value(t){__classPrivateFieldSet(q,Gp,t,`f`)}}.value,parseFn:{set value(t){__classPrivateFieldSet(Y,lm,t,`f`)}}.value,parseContext:{set value(t){__classPrivateFieldSet(X,um,t,`f`)}}.value}=Z,__classPrivateFieldGet(this,om,`f`).configObjects=te,__classPrivateFieldGet(this,ym,`f`).unfreeze(),__classPrivateFieldGet(this,Sm,`f`).unfreeze(),__classPrivateFieldGet(this,Vp,`f`).unfreeze(),__classPrivateFieldGet(this,Qp,`f`).unfreeze()}[Hm](t,n){return maybeAsyncResult(n,n=>(t(n),n))}getInternalMethods(){return{getCommandInstance:this[Um].bind(this),getContext:this[Wm].bind(this),getHasOutput:this[Gm].bind(this),getLoggerInstance:this[Km].bind(this),getParseContext:this[qm].bind(this),getParserConfiguration:this[km].bind(this),getUsageConfiguration:this[Am].bind(this),getUsageInstance:this[Jm].bind(this),getValidationInstance:this[Ym].bind(this),hasParseCallback:this[Xm].bind(this),isGlobalContext:this[Zm].bind(this),postProcess:this[Qm].bind(this),reset:this[eh].bind(this),runValidation:this[nh].bind(this),runYargsParserAndExecuteCommands:this[th].bind(this),setHasOutput:this[rh].bind(this)}}[Um](){return __classPrivateFieldGet(this,Vp,`f`)}[Wm](){return __classPrivateFieldGet(this,Up,`f`)}[Gm](){return __classPrivateFieldGet(this,em,`f`)}[Km](){return __classPrivateFieldGet(this,im,`f`)}[qm](){return __classPrivateFieldGet(this,um,`f`)||{}}[Jm](){return __classPrivateFieldGet(this,ym,`f`)}[Ym](){return __classPrivateFieldGet(this,Sm,`f`)}[Xm](){return!!__classPrivateFieldGet(this,lm,`f`)}[Zm](){return __classPrivateFieldGet(this,nm,`f`)}[Qm](t,n,S,C){return S||isPromise(t)?t:(n||(t=this[Cm](t)),(this[km]()[`parse-positional-numbers`]||this[km]()[`parse-positional-numbers`]===void 0)&&(t=this[Nm](t)),C&&(t=applyMiddleware(t,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)),t)}[eh](t={}){__classPrivateFieldSet(this,om,__classPrivateFieldGet(this,om,`f`)||{},`f`);let n={};n.local=__classPrivateFieldGet(this,om,`f`).local||[],n.configObjects=__classPrivateFieldGet(this,om,`f`).configObjects||[];let S={};return n.local.forEach(n=>{S[n]=!0,(t[n]||[]).forEach(t=>{S[t]=!0})}),Object.assign(__classPrivateFieldGet(this,fm,`f`),Object.keys(__classPrivateFieldGet(this,$p,`f`)).reduce((t,n)=>{let C=__classPrivateFieldGet(this,$p,`f`)[n].filter(t=>!(t in S));return C.length>0&&(t[n]=C),t},{})),__classPrivateFieldSet(this,$p,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(t=>{n[t]=(__classPrivateFieldGet(this,om,`f`)[t]||[]).filter(t=>!S[t])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(t=>{n[t]=objFilter(__classPrivateFieldGet(this,om,`f`)[t],t=>!S[t])}),n.envPrefix=__classPrivateFieldGet(this,om,`f`).envPrefix,__classPrivateFieldSet(this,om,n,`f`),__classPrivateFieldSet(this,ym,__classPrivateFieldGet(this,ym,`f`)?__classPrivateFieldGet(this,ym,`f`).reset(S):usage(this,__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Sm,__classPrivateFieldGet(this,Sm,`f`)?__classPrivateFieldGet(this,Sm,`f`).reset(S):validation(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldSet(this,Vp,__classPrivateFieldGet(this,Vp,`f`)?__classPrivateFieldGet(this,Vp,`f`).reset():command(__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Sm,`f`),__classPrivateFieldGet(this,Qp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Wp,`f`)||__classPrivateFieldSet(this,Wp,completion(this,__classPrivateFieldGet(this,ym,`f`),__classPrivateFieldGet(this,Vp,`f`),__classPrivateFieldGet(this,hm,`f`)),`f`),__classPrivateFieldGet(this,Qp,`f`).reset(),__classPrivateFieldSet(this,Gp,null,`f`),__classPrivateFieldSet(this,am,``,`f`),__classPrivateFieldSet(this,qp,null,`f`),__classPrivateFieldSet(this,em,!1,`f`),this.parsed=!1,this}[$m](t,n){return __classPrivateFieldGet(this,hm,`f`).path.relative(t,n)}[th](t,n,S,C=0,N=!1){let F=!!S||N;t||=__classPrivateFieldGet(this,pm,`f`),__classPrivateFieldGet(this,om,`f`).__=__classPrivateFieldGet(this,hm,`f`).y18n.__,__classPrivateFieldGet(this,om,`f`).configuration=this[km]();let I=!!__classPrivateFieldGet(this,om,`f`).configuration[`populate--`],H=Object.assign({},__classPrivateFieldGet(this,om,`f`).configuration,{"populate--":!0}),W=__classPrivateFieldGet(this,hm,`f`).Parser.detailed(t,Object.assign({},__classPrivateFieldGet(this,om,`f`),{configuration:{"parse-positional-numbers":!1,...H}})),q=Object.assign(W.argv,__classPrivateFieldGet(this,um,`f`)),Y,X=W.aliases,Z=!1,te=!1;Object.keys(q).forEach(t=>{t===__classPrivateFieldGet(this,tm,`f`)&&q[t]?Z=!0:t===__classPrivateFieldGet(this,xm,`f`)&&q[t]&&(te=!0)}),q.$0=this.$0,this.parsed=W,C===0&&__classPrivateFieldGet(this,ym,`f`).clearCachedHelpMessage();try{if(this[jm](),n)return this[Qm](q,I,!!S,!1);__classPrivateFieldGet(this,tm,`f`)&&[__classPrivateFieldGet(this,tm,`f`)].concat(X[__classPrivateFieldGet(this,tm,`f`)]||[]).filter(t=>t.length>1).includes(``+q._[q._.length-1])&&(q._.pop(),Z=!0),__classPrivateFieldSet(this,nm,!1,`f`);let H=__classPrivateFieldGet(this,Vp,`f`).getCommands(),ne=__classPrivateFieldGet(this,Wp,`f`)?.completionKey?[__classPrivateFieldGet(this,Wp,`f`)?.completionKey,...this.getAliases()[__classPrivateFieldGet(this,Wp,`f`)?.completionKey]??[]].some(t=>Object.prototype.hasOwnProperty.call(q,t)):!1,re=Z||ne||N;if(q._.length){if(H.length){let t;for(let n=C||0,F;q._[n]!==void 0;n++)if(F=String(q._[n]),H.includes(F)&&F!==__classPrivateFieldGet(this,Gp,`f`)){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(F,this,W,n+1,N,Z||te||N);return this[Qm](t,I,!!S,!1)}else if(!t&&F!==__classPrivateFieldGet(this,Gp,`f`)){t=F;break}!__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&__classPrivateFieldGet(this,mm,`f`)&&t&&!re&&__classPrivateFieldGet(this,Sm,`f`).recommendCommands(t,H)}__classPrivateFieldGet(this,Gp,`f`)&&q._.includes(__classPrivateFieldGet(this,Gp,`f`))&&!ne&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,Vp,`f`).hasDefaultCommand()&&!re){let t=__classPrivateFieldGet(this,Vp,`f`).runCommand(null,this,W,0,N,Z||te||N);return this[Qm](t,I,!!S,!1)}if(ne){__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),t=[].concat(t);let n=t.slice(t.indexOf(`--${__classPrivateFieldGet(this,Wp,`f`).completionKey}`)+1);return __classPrivateFieldGet(this,Wp,`f`).getCompletion(n,(t,n)=>{if(t)throw new zl(t.message);(n||[]).forEach(t=>{__classPrivateFieldGet(this,im,`f`).log(t)}),this.exit(0)}),this[Qm](q,!I,!!S,!1)}if(__classPrivateFieldGet(this,em,`f`)||(Z?(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,this.showHelp(t=>{__classPrivateFieldGet(this,im,`f`).log(t),this.exit(0)})):te&&(__classPrivateFieldGet(this,Xp,`f`)&&setBlocking(!0),F=!0,__classPrivateFieldGet(this,ym,`f`).showVersion(`log`),this.exit(0))),!F&&__classPrivateFieldGet(this,om,`f`).skipValidation.length>0&&(F=Object.keys(q).some(t=>__classPrivateFieldGet(this,om,`f`).skipValidation.indexOf(t)>=0&&q[t]===!0)),!F){if(W.error)throw new zl(W.error.message);if(!ne){let t=this[nh](X,{},W.error);S||(Y=applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!0)),Y=this[Hm](t,Y??q),isPromise(Y)&&!S&&(Y=Y.then(()=>applyMiddleware(q,this,__classPrivateFieldGet(this,Qp,`f`).getMiddleware(),!1)))}}}catch(t){if(t instanceof zl)__classPrivateFieldGet(this,ym,`f`).fail(t.message,t);else throw t}return this[Qm](Y??q,I,!!S,!0)}[nh](t,n,S,C){let N={...this.getDemandedOptions()};return F=>{if(S)throw new zl(S.message);__classPrivateFieldGet(this,Sm,`f`).nonOptionCount(F),__classPrivateFieldGet(this,Sm,`f`).requiredArguments(F,N);let I=!1;__classPrivateFieldGet(this,_m,`f`)&&(I=__classPrivateFieldGet(this,Sm,`f`).unknownCommands(F)),__classPrivateFieldGet(this,gm,`f`)&&!I?__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,n,!!C):__classPrivateFieldGet(this,vm,`f`)&&__classPrivateFieldGet(this,Sm,`f`).unknownArguments(F,t,{},!1,!1),__classPrivateFieldGet(this,Sm,`f`).limitedChoices(F),__classPrivateFieldGet(this,Sm,`f`).implications(F),__classPrivateFieldGet(this,Sm,`f`).conflicting(F)}}[rh](){__classPrivateFieldSet(this,em,!0,`f`)}[ih](t){if(typeof t==`string`)__classPrivateFieldGet(this,om,`f`).key[t]=!0;else for(let n of t)__classPrivateFieldGet(this,om,`f`).key[n]=!0}}}),sh,ch=__esmMin(()=>{xp(),oh(),sh=YargsFactory(bp)});function classifyCliFailure(t,n){return typeof t==`string`&&t.length>0?{kind:`usage`,message:t}:{kind:`runtime`}}var lh=__esmMin(()=>{});function buildHeaders(t,n){let S={"user-agent":`gjsify-install/0.64.48`,"accept-encoding":n.acceptEncoding??`identity`};if(n.npmrc){let C=resolveAuthForUrl(t,n.npmrc);C&&(S.authorization=C)}if(n.headers)for(let[t,C]of Object.entries(n.headers))S[t.toLowerCase()]=C;return S}function resolveAuthForUrl(t,n){let S=pathPrefixes(new URL(t));for(let t of S){let S=n.authTokens[t];if(S)return`Bearer ${S}`;let C=n.basicAuth[t];if(C)return`Basic ${btoa(`${C.username}:${C.password}`)}`}return null}function pathPrefixes(t){let n=t.pathname.split(`/`).filter(Boolean),S=[];for(let C=n.length;C>=0;C--){let N=n.slice(0,C).join(`/`);S.push(N?`//${t.host}/${N}`:`//${t.host}`)}return S}var uh=__esmMin(()=>{}),PackageNotFoundError,IntegrityError,RegistryTimeoutError,RegistryUnreachableError,dh=__esmMin(()=>{PackageNotFoundError=class extends Error{name;url;constructor(t,n){super(`Package not found in registry: ${t} (${n})`),this.name=t,this.url=n,this.name=`PackageNotFoundError`}},IntegrityError=class extends Error{url;integrity;constructor(t,n){super(`Tarball integrity mismatch for ${t} (expected ${n})`),this.url=t,this.integrity=n,this.name=`IntegrityError`}},RegistryTimeoutError=class extends Error{url;timeoutMs;attempts;constructor(t,n,S){let C=Math.round(n/100)/10,N=Math.round(n*S/100)/10;super(`@gjsify/npm-registry: GET ${t} timed out after ${C}s × ${S} attempt(s) (total ~${N}s). This usually means the registry CDN is slow or unreachable.`),this.url=t,this.timeoutMs=n,this.attempts=S,this.name=`RegistryTimeoutError`}},RegistryUnreachableError=class extends Error{url;attempts;elapsedMs;constructor(t,n,S,C){let N=Math.round(S/100)/10,F=C instanceof Error?C.message:String(C);super(`@gjsify/npm-registry: GET ${t} failed after ${n} attempt(s) over ~${N}s: ${F}. This usually means the registry or the network dropped out.`),this.url=t,this.attempts=n,this.elapsedMs=S,this.name=`RegistryUnreachableError`,this.cause=C}}});function registryFor(t,n){if(n&&t.startsWith(`@`)){let S=t.slice(0,t.indexOf(`/`)),C=n.scopes[S];if(C)return ensureTrailingSlash$1(C)}return n?.registry?ensureTrailingSlash$1(n.registry):fh}function parseNpmrc(t){let n={registry:fh,scopes:{},authTokens:{},basicAuth:{}},S=t.split(/\r?\n/),C={};for(let t of S){let S=t.replace(/^\s+|\s+$/g,``);if(!S||S.startsWith(`#`)||S.startsWith(`;`))continue;let N=S.indexOf(`=`);if(N<0)continue;let F=S.slice(0,N).trim(),I=expandEnv(stripQuotes(S.slice(N+1).trim()));if(F===`registry`){n.registry=ensureTrailingSlash$1(I);continue}let H=F.match(/^(@[^:]+):registry$/);if(H){n.scopes[H[1]]=ensureTrailingSlash$1(I);continue}let W=F.match(/^\/\/(.+):_authToken$/);if(W){n.authTokens[normalizeAuthHost(W[1])]=I;continue}let q=F.match(/^\/\/(.+):username$/);if(q){(C[normalizeAuthHost(q[1])]??={}).user=I;continue}let Y=F.match(/^\/\/(.+):_password$/);if(Y){let t=base64Decode$1(I);(C[normalizeAuthHost(Y[1])]??={}).pass=t;continue}}for(let[t,S]of Object.entries(C))S.user&&S.pass!==void 0&&(n.basicAuth[t]={username:S.user,password:S.pass});return n}function normalizeAuthHost(t){return`//${t.replace(/\/+$/,``)}`}function ensureTrailingSlash$1(t){return t.endsWith(`/`)?t:t+`/`}function stripQuotes(t){return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}function expandEnv(t){return t.replace(/\$\{([A-Z0-9_]+)\}/gi,(t,n)=>globalThis.process?.env?.[n]??``)}function base64Decode$1(t){return atob(t)}var fh,ph=__esmMin(()=>{fh=`https://registry.npmjs.org/`,__name$1(ensureTrailingSlash$1,`ensureTrailingSlash`),__name$1(base64Decode$1,`base64Decode`)});async function fetchWithRetry(t,n,S){let C=S.fetch??globalThis.fetch;if(!C)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let N=Math.max(0,S.retries??5),F=Math.max(0,S.retryDelayMs??1e3),I=Math.max(0,S.timeoutMs??3e4),H=S.retryNotFound??!1,W=Date.now(),q=0,Y,X=0;for(;;){if(n.signal?.aborted)throw signalAbortError(n.signal);let Z=I>0?new AbortController:null,te=Z===null?null:setTimeout(()=>Z.abort(Error(`@gjsify/npm-registry: per-request timeout ${I}ms`)),I),ne=composeSignals(n.signal,Z?.signal);try{let F=await C(t,{...n,signal:ne}),I=isRetryableStatus(F.status)||H&&F.status===404;if(F.ok||!I||q>=N)return S.read?await S.read(F):F;try{await F.arrayBuffer()}catch{}Y=Error(`HTTP ${F.status} ${F.statusText}`)}catch(S){let C=Z!==null&&Z.signal.aborted,F=n.signal?.aborted===!0;if(C&&!F){if(X++,q>=N)throw new RegistryTimeoutError(t,I,X);Y=S}else if(F)throw signalAbortError(n.signal);else{if(!isRetryableError(S))throw S;if(q>=N)throw new RegistryUnreachableError(t,q+1,Date.now()-W,S);Y=S}}finally{te!==null&&clearTimeout(te)}let re=Math.min(F*2**q,8e3);S.onRetry?.({attempt:q+1,error:Y,delayMs:re}),await delay$1(re,n.signal),q++}}function composeSignals(t,n){return t?n?AbortSignal.any([t,n]):t:n}function isRetryableStatus(t){return t===408||t===425||t===429||t===500||t===502||t===503||t===504||t===521||t===522||t===524||t===525}function isRetryableError(t){if(t&&typeof t==`object`&&`name`in t&&t.name===`AbortError`)return!1;if(t instanceof TypeError)return!0;if(t&&typeof t==`object`&&`name`in t){let n=t.name;if(n===`FetchError`)return!0;if(n===`AbortError`)return!1}let n=t?.cause;if(n&&typeof n==`object`&&`code`in n){let t=n.code;if(typeof t==`string`)return t===`ECONNRESET`||t===`ECONNREFUSED`||t===`ENETUNREACH`||t===`ENOTFOUND`||t===`ETIMEDOUT`||t===`EAI_AGAIN`||t===`UND_ERR_SOCKET`||t===`UND_ERR_CONNECT_TIMEOUT`}return!1}function delay$1(t,n){return t<=0?Promise.resolve():new Promise((S,C)=>{let N=setTimeout(()=>{n?.removeEventListener?.(`abort`,onAbort),S()},t),onAbort=()=>{clearTimeout(N),C(signalAbortError(n))};if(n?.aborted){clearTimeout(N),C(signalAbortError(n));return}n?.addEventListener?.(`abort`,onAbort,{once:!0})})}function signalAbortError(t){let n=t&&`reason`in t?t.reason:void 0;if(n instanceof Error)return n;let S=Error(`Aborted`);return S.name=`AbortError`,S}var mh=__esmMin(()=>{dh(),__name$1(delay$1,`delay`)});async function verifyIntegrity(t,n){let S=n.trim().split(/\s+/);for(let n of S){let S=n.indexOf(`-`);if(S<0)continue;let C=n.slice(0,S).toLowerCase(),N=n.slice(S+1),F=globalThis.crypto?.subtle;if(!F)throw Error(`@gjsify/npm-registry: globalThis.crypto.subtle is missing`);let I=subriToWebCryptoAlgo(C);if(!I)continue;let H=await F.digest(I,dataAsArrayBuffer(t));if(bytesToBase64(new Uint8Array(H))===N)return!0}return!1}function subriToWebCryptoAlgo(t){switch(t){case`sha1`:return`SHA-1`;case`sha256`:return`SHA-256`;case`sha384`:return`SHA-384`;case`sha512`:return`SHA-512`;default:return null}}function dataAsArrayBuffer(t){if(t.byteOffset===0&&t.byteLength===t.buffer.byteLength)return t.buffer;let n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}function bytesToBase64(t){let n=``;for(let S=0;S<t.length;S++)n+=String.fromCharCode(t[S]);return btoa(n)}var hh=__esmMin(()=>{});function assertPackument(t,n){if(!n||typeof n!=`object`)throw TypeError(`registry: ${t} packument is not an object`);let S=n;if(typeof S.name!=`string`)throw TypeError(`registry: ${t} packument missing string name`);if(!S.versions||typeof S.versions!=`object`)throw TypeError(`registry: ${t} packument missing versions map`)}function packumentUrl(t,n){let S=ensureTrailingSlash$1(n);if(t.startsWith(`@`)){let n=t.indexOf(`/`);if(n<0)throw TypeError(`Invalid scoped package name: ${t}`);let C=t.slice(0,n),N=t.slice(n+1);return`${S}${encodeURIComponent(C)}/${encodeURIComponent(N)}`}return`${S}${encodeURIComponent(t)}`}async function fetchPackumentConditional(t,n={}){let S=packumentUrl(t,n.registry??registryFor(t,n.npmrc)),C=buildHeaders(S,{...n,acceptEncoding:`gzip`});C.accept??=n.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,n.ifNoneMatch&&(C[`if-none-match`]=n.ifNoneMatch);let N=await fetchWithRetry(S,{headers:C,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,read:async n=>{if(n.status===304){try{await n.arrayBuffer()}catch{}return{status:`not-modified`}}if(!n.ok)throw n.status===404||n.status===406?new PackageNotFoundError(t,S):Error(`registry GET ${S} -> ${n.status} ${n.statusText}`);return{status:`fresh`,body:await decodeJsonBody(n),etag:n.headers.get(`etag`)??void 0}}});if(N.status===`not-modified`)return{status:`not-modified`,etag:n.ifNoneMatch};let F=N.body;return assertPackument(t,F),{status:`fresh`,packument:F,etag:N.etag}}async function decodeJsonBody(t){return t.json()}async function fetchPackument(t,n={}){let S=await fetchPackumentConditional(t,n);if(!S.packument)throw Error(`registry: ${t} returned 304 Not Modified to an unconditional request`);return S.packument}var gh=__esmMin(()=>{uh(),dh(),ph(),mh()});async function fetchTarball(t,n={}){let S=buildHeaders(t,{...n,acceptEncoding:`identity`});S.accept??=`application/octet-stream`;let C=await fetchWithRetry(t,{headers:S,signal:n.signal},{fetch:n.fetch,retries:n.retries,retryDelayMs:n.retryDelayMs,timeoutMs:n.timeoutMs,onRetry:n.onRetry,retryNotFound:n.retryNotFound??!0,read:async n=>{if(!n.ok)throw Error(`tarball GET ${t} -> ${n.status} ${n.statusText}`);return new Uint8Array(await n.arrayBuffer())}});if(n.integrity&&!await verifyIntegrity(C,n.integrity))throw new IntegrityError(t,n.integrity);return C}var vh=__esmMin(()=>{uh(),dh(),mh(),hh()});async function whoami(t,n){let S=`${ensureTrailingSlash$1(t)}-/whoami`,C=buildHeaders(S,{npmrc:n});C.accept=`application/json`;let N=globalThis.fetch;if(!N)throw Error(`@gjsify/npm-registry: globalThis.fetch is missing`);let F=await N(S,{method:`GET`,headers:C});if(!F.ok)throw Error(`whoami GET ${S} -> ${F.status} ${F.statusText}`);let I=await F.json();if(I&&typeof I==`object`&&`username`in I){let t=I.username;if(typeof t==`string`&&t.length>0)return{username:t}}return{}}var yh=__esmMin(()=>{uh(),ph()}),bh=__esmMin(()=>{uh(),dh(),ph(),hh(),gh(),vh(),yh()});function escapePackageName(t){return t.replace(`/`,`%2f`)}function buildPublishHeaders(t,n){let S=buildHeaders(t,{npmrc:n.npmrc});return S[`content-type`]=`application/json`,S[`npm-command`]=`publish`,S[`npm-auth-type`]=n.otp?`legacy`:`web`,S[`user-agent`]=n.userAgent??defaultUserAgent(),n.otp&&(S[`npm-otp`]=n.otp),n.authorization&&(S.authorization=n.authorization),S}function cliVersion(){return xh===void 0&&(xh=`0.64.48`),xh}function cliPackageDir(){let t=globalThis.process?.env?.GJSIFY_CLI_PACKAGE_JSON,n;try{n=Hn(t||fileURLToPath(import.meta.url))}catch{return null}for(let t=0;t<12;t++){try{if(JSON.parse(readFileSync(`${n}/package.json`,`utf8`)).name===`@gjsify/cli`)return n}catch{}let t=Hn(n);if(t===n)break;n=t}return null}function defaultUserAgent(){let t=globalThis.process,n=t?.arch??`x64`,S=t?.platform??`linux`;return`gjsify-publish/${cliVersion()} (${S} ${n})`}var xh,Sh=__esmMin(()=>{rf(),Xn(),cr(),bh()}),Ch,wh=__esmMin(()=>{Ch=`gjsify`});function parseDeclaredChannel(t,n){if(!(t===void 0||t===``)){if(Th.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a distribution channel. Known: ${Th.join(`, `)}.`)}}function channelAllowsDonations(t){return t!==void 0&&Eh[t]===`external-link`}var Th,Eh,Dh,Oh=__esmMin(()=>{Th=[`flathub`,`web`,`microsoft-store`,`apple-app-store`],Eh={flathub:`external-link`,web:`external-link`,"microsoft-store":`none`,"apple-app-store":`store-purchase`},Dh=`GJSIFY_CHANNEL`});function parseDeclaredPricing(t,n){if(!(t===void 0||t===``)){if(kh.includes(t))return t;throw Error(`${n}: "${String(t)}" is not a pricing tier. Known: ${kh.join(`, `)}.`)}}var kh,Ah,jh=__esmMin(()=>{kh=[`free`,`paid`],Ah=`GJSIFY_PRICING`}),Mh=__commonJSMin(((t,n)=>{let S=(Xn(),__toCommonJS(Pn)),C=($l(),__toCommonJS(Yl)),N=(rf(),__toCommonJS(tf)),resolveFrom=(t,n,F)=>{if(typeof t!=`string`)throw TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof t}\``);if(typeof n!=`string`)throw TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof n}\``);try{t=N.realpathSync(t)}catch(n){if(n.code===`ENOENT`)t=S.resolve(t);else if(F)return null;else throw n}let I=S.join(t,`noop.js`),resolveFileName=()=>C._resolveFilename(n,{id:I,filename:I,paths:C._nodeModulePaths(t)});if(F)try{return resolveFileName()}catch{return null}return resolveFileName()};n.exports=(t,n)=>resolveFrom(t,n),n.exports.silent=(t,n)=>resolveFrom(t,n,!0)})),Nh=__commonJSMin(((t,n)=>{let callsites=()=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=(t,n)=>n;let n=Error().stack.slice(1);return Error.prepareStackTrace=t,n};n.exports=callsites,n.exports.default=callsites})),Ph=__commonJSMin(((t,n)=>{let S=Nh();n.exports=t=>{let n=S();if(!t)return n[2].getFileName();let C=!1;n.shift();for(let S of n){let n=S.getFileName();if(typeof n==`string`){if(n===t){C=!0;continue}if(n!==`module.js`&&C&&n!==t)return n}}}})),Fh=__commonJSMin(((t,n)=>{var{__gjsifyModuleDir:S,__gjsifyModuleFile:C}=(ru(),__toCommonJS(eu)),N=S(`import-fresh/index.js`),F=C(`import-fresh/index.js`);let I=(Xn(),__toCommonJS(Pn)),H=Mh(),W=Ph();n.exports=t=>{if(typeof t!=`string`)throw TypeError(`Expected a string`);let n=W(F),S=n?I.dirname(n):N,C=H(S,t),q=Y.cache[C];if(q&&q.parent){let t=q.parent.children.length;for(;t--;)q.parent.children[t].id===C&&q.parent.children.splice(t,1)}delete Y.cache[C];let X=Y.cache[n];return X===void 0||X.require===void 0?Y(C):X.require(C)}})),Ih=__commonJSMin(((t,n)=>{n.exports=function isArrayish(t){return t?t instanceof Array||Array.isArray(t)||t.length>=0&&t.splice instanceof Function:!1}})),Lh=__commonJSMin(((t,n)=>{var S=(Hu(),__toCommonJS(Ru)),C=Ih(),N=function errorEx(t,n){(!t||t.constructor!==String)&&(n=t||{},t=Error.name);var N=function ErrorEXError(S){if(!this)return new ErrorEXError(S);S=S instanceof Error?S.message:S||this.message,Error.call(this,S),Error.captureStackTrace(this,N),this.name=t,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var t=S.split(/\r?\n/g);for(var N in n)if(n.hasOwnProperty(N)){var F=n[N];`message`in F&&(t=F.message(this[N],t)||t,C(t)||(t=[t]))}return t.join(`
150
150
  `)},set:function(t){S=t}});var F=null,I=Object.getOwnPropertyDescriptor(this,`stack`),H=I.get,W=I.value;delete I.value,delete I.writable,I.set=function(t){F=t},I.get=function(){var t=(F||(H?H.call(this):W)).split(/\r?\n+/g);F||(t[0]=this.name+`: `+this.message);var S=1;for(var C in n)if(n.hasOwnProperty(C)){var N=n[C];if(`line`in N){var I=N.line(this[C]);I&&t.splice(S++,0,` `+I)}`stack`in N&&N.stack(this[C],t)}return t.join(`
151
151
  `)},Object.defineProperty(this,"stack",I)};return Object.setPrototypeOf?(Object.setPrototypeOf(N.prototype,Error.prototype),Object.setPrototypeOf(N,Error)):S.inherits(N,Error),N};N.append=function(t,n){return{message:function(S,C){return S||=n,S&&(C[0]+=` `+t.replace(`%s`,S.toString())),C}}},N.line=function(t,n){return{line:function(S){return S||=n,S?t.replace(`%s`,S.toString()):null}}},n.exports=N})),Rh=__commonJSMin(((t,n)=>{let hexify=t=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return`0x`+(n.length%2?`0`:``)+n},parseError=(t,n,S)=>{if(!n)return{message:t.message+` while parsing empty string`,position:0};let C=t.message.match(/^Unexpected token (.) .*position\s+(\d+)/i),N=C?+C[2]:t.message.match(/^Unexpected end of JSON.*/i)?n.length-1:null,F=C?t.message.replace(/^Unexpected token ./,`Unexpected token ${JSON.stringify(C[1])} (${hexify(C[1])})`):t.message;if(N!=null){let t=N<=S?0:N-S,C=N+S>=n.length?n.length:N+S,I=(t===0?``:`...`)+n.slice(t,C)+(C===n.length?``:`...`);return{message:F+` while parsing ${n===I?``:`near `}${JSON.stringify(I)}`,position:N}}else return{message:F+` while parsing '${n.slice(0,S*2)}'`,position:0}};var JSONParseError=class extends SyntaxError{constructor(t,n,S,C){S||=20;let N=parseError(t,n,S);super(N.message),Object.assign(this,N),this.code=`EJSONPARSE`,this.systemError=t,Error.captureStackTrace(this,C||this.constructor)}get name(){return this.constructor.name}set name(t){}get[Symbol.toStringTag](){return this.constructor.name}};let S=Symbol.for(`indent`),C=Symbol.for(`newline`),N=/^\s*[{\[]((?:\r?\n)+)([\s\t]*)/,F=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,parseJson=(t,n,I)=>{let H=stripBOM(t);I||=20;try{let[,t=`
152
152
  `,I=` `]=H.match(F)||H.match(N)||[,``,``],W=JSON.parse(H,n);return W&&typeof W==`object`&&(W[C]=t,W[S]=I),W}catch(n){if(typeof t!=`string`&&!Buffer.isBuffer(t)){let S=Array.isArray(t)&&t.length===0;throw Object.assign(TypeError(`Cannot parse ${S?`an empty array`:String(t)}`),{code:`EJSONPARSE`,systemError:n})}throw new JSONParseError(n,H,I,parseJson)}},stripBOM=t=>String(t).replace(/^\uFEFF/,``);n.exports=parseJson,parseJson.JSONParseError=JSONParseError,parseJson.noExceptions=(t,n)=>{try{return JSON.parse(stripBOM(t),n)}catch{}}})),zh=__commonJSMin((t=>{t.__esModule=!0,t.LinesAndColumns=void 0;var n=`
@@ -936,7 +936,7 @@ Add @gjsify/node-gi as a dependency to run it on Node, e.g.:
936
936
  `)}function droppedInstallPaths(t,n){let S=new Set(n.map(t=>normalizePath(t.installPath))),C=[...new Set([...t].map(normalizePath))].filter(t=>t.startsWith(`node_modules/`)&&!S.has(t)).sort((t,n)=>t<n?-1:+(t>n)),N=[...S],F=[];for(let t of C){let n=F[F.length-1];n&&t.startsWith(`${n}/`)||N.some(n=>n.startsWith(`${t}/`))||F.push(t)}return F}var vz=__esmMin(()=>{Xn()});function dirLinkTarget(t,n,S=yz){return S===`junction`?In(n):Bn(Hn(t),n)}function linkDirSync(t,n){assertAbsolute(n),symlinkSync(dirLinkTarget(t,n),t,bz)}function replicateLinkSync(t,n){let S=readlinkSync(t);if(!dirLinksAreJunctions()){symlinkSync(S,n);return}let C=In(Hn(t),S),N;try{N=statSync(C).isDirectory()}catch{symlinkSync(S,n);return}N?symlinkSync(C,n,`junction`):symlinkSync(S,n,`file`)}function assertAbsolute(t){if(In(t)!==t)throw TypeError(`linkDir: target must be an absolute path, got ${JSON.stringify(t)}. Node resolves a Windows junction target against the process CWD rather than the link's own directory, so a relative target silently points somewhere else there.`)}var yz,bz,dirLinksAreJunctions,xz=__esmMin(()=>{rf(),Bd(),Xn(),yz=process.platform===`win32`?`junction`:`symlink`,bz=yz===`junction`?`junction`:void 0,dirLinksAreJunctions=()=>yz===`junction`});function checkList(t,n){let S=typeof n==`string`?[n]:n;if(S.length===1&&S[0]===`any`)return!0;let C=0,N=!1;for(let n of S){let S=n.charAt(0)===`!`,F=S?n.slice(1):n;if(S){if(C++,t===F)return!1}else N||=t===F}return N||C===S.length}function checkPlatform(t,n){let S=t.os?checkList(n.os,t.os):!0,C=t.cpu?checkList(n.cpu,t.cpu):!0,N=t.libc?checkList(n.libc,t.libc):!0;return t.libc&&!n.libc&&(N=!1),{ok:S&&C&&N,current:{os:n.os,cpu:n.cpu,libc:n.libc},required:{os:t.os,cpu:t.cpu,libc:t.libc}}}function declaresPlatform(t){return!!(t.os||t.cpu||t.libc)}function badPlatformError(t,n){let S=Error(`Unsupported platform for ${t}: wanted ${JSON.stringify(n.required)} (current: ${JSON.stringify(n.current)})`);return S.code=`EBADPLATFORM`,S.pkgid=t,S.current=n.current,S.required=n.required,S}function isMuslSharedObject(t){return t.includes(`libc.musl-`)||t.includes(`ld-musl-`)}function libcFromLddFile(t){let n=t.readTextFile(Sz);if(n!==null)return n.includes(`musl`)?`musl`:n.includes(`GNU C Library`)?`glibc`:null}function libcFromReportData(t){return t.glibcVersionRuntime?`glibc`:Array.isArray(t.sharedObjects)&&t.sharedObjects.some(t=>isMuslSharedObject(String(t)))?`musl`:null}function libcFromLoaderScan(t,n=Cz){let S=!1;for(let C of n){let n=t.listDir(C);if(n)for(let t of n){if(t.startsWith(`ld-linux`))return`glibc`;t.startsWith(`ld-musl-`)&&(S=!0)}}return S?`musl`:null}function detectLibc(t,n){if(t!==`linux`)return;let S=libcFromLddFile(n);if(S!==void 0)return S??void 0;let C=n.diagnosticReport();return C===null?libcFromLoaderScan(n)??void 0:libcFromReportData(C)??void 0}function defaultLibcProbeHost(){return{readTextFile(t){try{return readFileSync(t,`utf-8`)}catch{return null}},listDir(t){try{return readdirSync(t)}catch{return null}},diagnosticReport(){let t=process.report;if(!t||typeof t.getReport!=`function`)return null;let n=t.excludeNetwork;t.excludeNetwork=!0;try{let n=t.getReport();return{glibcVersionRuntime:n.header?.glibcVersionRuntime,sharedObjects:n.sharedObjects}}finally{t.excludeNetwork=n}}}}function hostLibc(t,n=defaultLibcProbeHost()){return Tz||=(wz=detectLibc(t,n),!0),wz}function readPlatformOverrides(t){let pick=n=>{let S=t[n];if(typeof S!=`string`)return;let C=S.trim();return C===``?void 0:C},n={},S=pick(`npm_config_os`),C=pick(`npm_config_cpu`),N=pick(`npm_config_libc`);return S!==void 0&&(n.os=S),C!==void 0&&(n.cpu=C),N!==void 0&&(n.libc=N),n}function readPlatformForce(t){let n=t.npm_config_force;if(typeof n!=`string`)return!1;let S=n.trim().toLowerCase();return S===`true`||S===`1`}function resolveHostPlatform(t={}){let n=readPlatformOverrides(t.env??process.env),S=n.os??t.platform??process.platform;return{os:S,cpu:n.cpu??t.arch??process.arch,libc:n.libc??(S===`linux`?hostLibc(S,t.probe??defaultLibcProbeHost()):void 0)}}function describePlatformTarget(t){return`${t.os}-${t.cpu}${t.libc?`-${t.libc}`:``}`}var Sz,Cz,wz,Tz,Ez=__esmMin(()=>{rf(),Sz=`/usr/bin/ldd`,Cz=[`/lib`,`/lib64`,`/usr/lib`],Tz=!1});function isReservedEntry(t){return t.startsWith(`.`)}function readManifest$1(t){try{let n=JSON.parse(readFileSync(zn(t,`package.json`),`utf8`)),S={os:n.os,cpu:n.cpu,libc:n.libc};return{name:typeof n.name==`string`?n.name:void 0,version:typeof n.version==`string`?n.version:void 0,platform:declaresPlatform(S)?S:void 0,bundles:[n.bundleDependencies,n.bundledDependencies].some(t=>t===!0||Array.isArray(t)&&t.length>0)}}catch{return null}}function collect(t,n){let S;try{S=readdirSync(t,{withFileTypes:!0})}catch{return}for(let C of S){if(isReservedEntry(C.name))continue;let S=zn(t,C.name);if(C.name.startsWith(`@`)){let t;try{t=readdirSync(S,{withFileTypes:!0})}catch{continue}for(let C of t)isReservedEntry(C.name)||addPackage(zn(S,C.name),n);continue}addPackage(S,n)}}function addPackage(t,n){let S=!1;try{S=lstatSync(t).isSymbolicLink()}catch{return}let C=readManifest$1(t);n.push({name:C?.name??t,version:C?.version??`0.0.0`,dir:t,linked:S,platform:C?.platform,bundles:C?.bundles}),S||collect(zn(t,`node_modules`),n)}function scanPrefix(t){let n=[];return collect(zn(t,`node_modules`),n),n}function planPlatformPrune(t,n){let S=[];for(let C of t){if(C.linked||!C.platform)continue;let t=checkPlatform(C.platform,n);t.ok||S.push({pkg:C,bytes:0,verdict:t})}return S}function dirBytes(t){let n=0,S=[t];for(;S.length>0;){let t=S.pop(),C;try{C=readdirSync(t,{withFileTypes:!0})}catch{continue}for(let N of C){let C=zn(t,N.name);if(N.isDirectory())S.push(C);else if(N.isFile())try{n+=statSync(C).size}catch{}}}return n}function planPrune(t){let n=scanPrefix(t.prefix),S=planPlatformPrune(n,t.target);for(let t of S)t.bytes=dirBytes(t.pkg.dir);return{prefix:t.prefix,target:t.target,scanned:n.length,entries:S,bytes:S.reduce((t,n)=>t+n.bytes,0)}}function executePrune(t,n={}){let S=[],C=[],N=[],F=n.remove??(t=>rmSync(t,{recursive:!0,force:!0,maxRetries:10}));if(!n.dryRun){for(let n of t.entries)try{F(n.pkg.dir),S.push(n)}catch(t){C.push({entry:n,error:t.message})}N.push(...pruneDeadBinLinks(t.prefix))}return{plan:t,removed:S,failed:C,bytes:S.reduce((t,n)=>t+n.bytes,0),binLinks:N}}function pruneDeadBinLinks(t){let n=zn(t,`node_modules`,`.bin`),S=[],C;try{C=readdirSync(n,{withFileTypes:!0})}catch{return S}for(let t of C){let C=zn(n,t.name);try{if(!lstatSync(C).isSymbolicLink()||existsSync(C))continue;unlinkSync(C),S.push(t.name)}catch{}}return S}function humanBytes(t){if(t<1024)return`${t} B`;let n=[`KB`,`MB`,`GB`],S=t/1024,C=0;for(;S>=1024&&C<n.length-1;)S/=1024,C+=1;return`${S.toFixed(1)} ${n[C]}`}function formatPruneReport(t,n){let{plan:S}=t,C=[`${S.prefix} · target ${describePlatformTarget(S.target)} · scanned ${S.scanned} package(s)`];if(S.entries.length===0)return C.push(`nothing to prune — no installed package declares a platform this target cannot use.`),C.join(`
937
937
  `);let N=n.verbose?S.entries:S.entries.slice(0,Dz);for(let t of N){let n=JSON.stringify(t.verdict.required);C.push(` ${t.pkg.name}@${t.pkg.version} ${humanBytes(t.bytes)} requires ${n}`)}N.length<S.entries.length&&C.push(` … and ${S.entries.length-N.length} more (--verbose to list them)`),C.push(n.dryRun?`would free ${humanBytes(S.bytes)} across ${S.entries.length} package(s) (apparent size)`:`freed ${humanBytes(t.bytes)} across ${t.removed.length} package(s) (apparent size)`),t.binLinks.length>0&&C.push(`removed ${t.binLinks.length} dangling .bin link(s): ${t.binLinks.join(`, `)}`);for(let n of t.failed)C.push(`FAILED ${n.entry.pkg.name}: ${n.error}`);return C.join(`
938
938
  `)}function automaticPruneRefusal(t,n){return Object.keys(readPlatformOverrides(t)).length>0?`the platform target was overridden on the command line`:n?`--immutable`:null}function pruneAfterInstall(t,n,S={}){try{if(automaticPruneRefusal(S.env??process.env,S.immutable??!1))return;let C=planPrune({prefix:t,target:n});if(C.entries.length===0)return;let N=executePrune(C);if(N.removed.length===0)return;let F=S.hint?` (${S.hint} to review)`:``;ge.log(`gjsify: pruned ${N.removed.length} package(s) this host cannot use, freeing ${humanBytes(N.bytes)}${F}`)}catch(t){process.env.GJSIFY_DEBUG&&ge.error(`gjsify: prune skipped — ${t.message}`)}}var Dz,Oz=__esmMin(()=>{_e(),rf(),Xn(),Ez(),__name$1(readManifest$1,`readManifest`),Dz=10});function devLinkPath(t){return zn(t,kz)}function readDevLinkOverride(t){let n=devLinkPath(t);if(!existsSync(n))return null;let S;try{S=JSON.parse(readFileSync(n,`utf-8`))}catch(t){throw Error(`gjsify link: ${n} is not valid JSON (${t instanceof Error?t.message:String(t)}). Fix it or run \`gjsify unlink\`.`)}if(!S||typeof S!=`object`)throw Error(`gjsify link: ${n} must contain a JSON object.`);let C=S;if(C.version!==1)throw Error(`gjsify link: ${n} declares version ${JSON.stringify(C.version)}; this CLI understands version 1 only.`);if(typeof C.checkout!=`string`||C.checkout.trim()===``)throw Error(`gjsify link: ${n} has no "checkout" path.`);return{version:1,checkout:Rn(C.checkout)?C.checkout:In(t,C.checkout),packages:Array.isArray(C.packages)?C.packages.filter(t=>typeof t==`string`):[]}}function writeDevLinkOverride(t,n){let S=devLinkPath(t);return writeFileSync(S,JSON.stringify(n,null,2)+`
939
- `),S}function removeDevLinkOverride(t){let n=devLinkPath(t);return existsSync(n)?(rmSync(n),n):null}function devLinkRoot(t){if(existsSync(devLinkPath(t)))return t;let n=findWorkspaceRoot(t);return n&&existsSync(devLinkPath(n))?n:t}function resolveCheckoutWorkspaces(t,n){if(!existsSync(t))throw Error(`gjsify link: the linked checkout ${t} does not exist (named by ${n}). Point it at a gjsify checkout, or run \`gjsify unlink\`.`);let S=readPackageJson$2(zn(t,`package.json`));if(!S||S.workspaces===void 0)throw Error(`gjsify link: ${t} is not a gjsify workspace — ${zn(t,`package.json`)} ${S?`declares no "workspaces" field`:`is missing or unreadable`} (named by ${n}).`);let C;try{C=discoverWorkspaces(t)}catch(S){throw Error(`gjsify link: ${t} declares "workspaces" but they could not be discovered (${S instanceof Error?S.message:String(S)}); named by ${n}.`)}if(C.length===0)throw Error(`gjsify link: ${t} declares "workspaces" but none were found (named by ${n}).`);return C}function consumerKnownNames(t){let n=new Set,S=[readPackageJson$2(zn(t,`package.json`))];try{for(let n of discoverWorkspaces(t))S.push(n.manifest)}catch{}for(let t of S)if(t)for(let S of[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`]){let C=t[S];if(!(!C||typeof C!=`object`))for(let t of Object.keys(C))n.add(t)}for(let S of scanPrefix(t))n.add(S.name);for(let S of lockfileNames(t))n.add(S);return n}function lockfileNames(t){try{let n=JSON.parse(readFileSync(zn(t,`gjsify-lock.json`),`utf-8`)),S=[];for(let t of Object.keys(n.packages??{})){let n=t.lastIndexOf(`node_modules/`);n!==-1&&S.push(t.slice(n+13))}return S}catch{return[]}}function consumerNestedPlacements(t){let n=zn(t,`node_modules`)+qn,S=[];for(let C of scanPrefix(t))C.linked||(C.dir.startsWith(n)?C.dir.slice(n.length):``).includes(`${qn}node_modules${qn}`)&&S.push({name:C.name,dir:C.dir});return S}function planDevLinks(t){let n=t.patterns.length>0?filterWorkspaces(t.workspaces,{include:[...t.patterns]}):[...t.workspaces],S=[];for(let C of n)C.name&&t.knownNames.has(C.name)&&S.push({name:C.name,target:C.location,linkPath:zn(t.consumerRoot,`node_modules`,C.name)});let C=S.map(t=>t.linkPath+qn),N=new Map(S.map(t=>[t.name,t]));for(let n of t.nested??[]){let t=N.get(n.name);t&&(C.some(t=>n.dir.startsWith(t))||S.push({name:n.name,target:t.target,linkPath:n.dir}))}return S.sort((t,n)=>t.name<n.name?-1:t.name>n.name?1:t.linkPath<n.linkPath?-1:+(t.linkPath>n.linkPath)),S}function prepareDevLinks(t){let n=readDevLinkOverride(t);if(!n)return null;let S=devLinkPath(t),C=planDevLinks({consumerRoot:t,workspaces:resolveCheckoutWorkspaces(n.checkout,S),patterns:n.packages,knownNames:consumerKnownNames(t),nested:consumerNestedPlacements(t)});return{overridePath:S,consumerRoot:t,checkout:n.checkout,links:C,names:new Set(C.map(t=>t.name))}}function applyDevLinks(t){assertDevLinksBuilt(t);let n=[];for(let S of t)linkAlreadyPointsAt(S.linkPath,S.target)||(mkdirSync(Hn(S.linkPath),{recursive:!0}),rmSync(S.linkPath,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),linkDirSync(S.linkPath,S.target),n.push(S));return n}function removeDevLinks(t){let n=[];for(let S of t){let t=!1;try{t=lstatSync(S.linkPath).isSymbolicLink()}catch{continue}t&&linkAlreadyPointsAt(S.linkPath,S.target)&&(rmSync(S.linkPath,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),n.push(S))}return n}function linkAlreadyPointsAt(t,n){try{return lstatSync(t).isSymbolicLink()?realpathSync(t)===realpathSync(n):!1}catch{return!1}}function scanDevLinks(t,n){let S=[];for(let t of n)try{S.push(realpathSync(t))}catch{}if(S.length===0)return[];let C=[];for(let n of scanPrefix(t)){if(!n.linked)continue;let N;try{N=realpathSync(n.dir)}catch{continue}S.some(t=>N===t||N.startsWith(t+qn))&&C.push({name:packageNameAt(t,n.dir),target:N,linkPath:n.dir})}return C.sort((t,n)=>t.linkPath<n.linkPath?-1:+(t.linkPath>n.linkPath)),C}function packageNameAt(t,n){let S=Bn(t,n).split(qn).join(`/`);return S.slice(S.lastIndexOf(`node_modules/`)+13)}function retireDevLinks(t,n,S){return removeDevLinks(scanDevLinks(t,n).filter(t=>!S.has(t.name)))}function unbuiltDevLinks(t){let n=[];for(let S of t){let t;try{t=JSON.parse(readFileSync(zn(S.target,`package.json`),`utf-8`))}catch(t){n.push({link:S,reason:`its package.json is missing or unreadable (${t instanceof Error?t.message:String(t)})`});continue}let C=[];for(let n of[`main`,`module`]){let S=t[n];typeof S==`string`&&C.push(S)}let N=t.exports;typeof N==`string`?C.push(N):N&&typeof N==`object`&&collectStringLeaves(N[`.`],C),C.length!==0&&(C.some(t=>existsSync(zn(S.target,t)))||n.push({link:S,reason:`none of its declared entry points exist yet (${C.join(`, `)})`}))}return n}function formatUnbuiltDevLinks(t){let n=t.map(t=>` ${t.link.name} ${t.link.target}\n ${t.reason}`).join(`
939
+ `),S}function removeDevLinkOverride(t){let n=devLinkPath(t);return existsSync(n)?(rmSync(n),n):null}function devLinkRoot(t){if(existsSync(devLinkPath(t)))return t;let n=findWorkspaceRoot(t);return n&&existsSync(devLinkPath(n))?n:t}function tscArgsUnderLink(t,n){return!n||t.some(t=>t.toLowerCase().split(`=`)[0]===`--preservesymlinks`)?[...t]:[...t,`--preserveSymlinks`]}function resolveCheckoutWorkspaces(t,n){if(!existsSync(t))throw Error(`gjsify link: the linked checkout ${t} does not exist (named by ${n}). Point it at a gjsify checkout, or run \`gjsify unlink\`.`);let S=readPackageJson$2(zn(t,`package.json`));if(!S||S.workspaces===void 0)throw Error(`gjsify link: ${t} is not a gjsify workspace — ${zn(t,`package.json`)} ${S?`declares no "workspaces" field`:`is missing or unreadable`} (named by ${n}).`);let C;try{C=discoverWorkspaces(t)}catch(S){throw Error(`gjsify link: ${t} declares "workspaces" but they could not be discovered (${S instanceof Error?S.message:String(S)}); named by ${n}.`)}if(C.length===0)throw Error(`gjsify link: ${t} declares "workspaces" but none were found (named by ${n}).`);return C}function consumerKnownNames(t){let n=new Set,S=[readPackageJson$2(zn(t,`package.json`))];try{for(let n of discoverWorkspaces(t))S.push(n.manifest)}catch{}for(let t of S)if(t)for(let S of[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`]){let C=t[S];if(!(!C||typeof C!=`object`))for(let t of Object.keys(C))n.add(t)}for(let S of scanPrefix(t))n.add(S.name);for(let S of lockfileNames(t))n.add(S);return n}function lockfileNames(t){try{let n=JSON.parse(readFileSync(zn(t,`gjsify-lock.json`),`utf-8`)),S=[];for(let t of Object.keys(n.packages??{})){let n=t.lastIndexOf(`node_modules/`);n!==-1&&S.push(t.slice(n+13))}return S}catch{return[]}}function consumerNestedPlacements(t){let n=zn(t,`node_modules`)+qn,S=[];for(let C of scanPrefix(t))C.linked||(C.dir.startsWith(n)?C.dir.slice(n.length):``).includes(`${qn}node_modules${qn}`)&&S.push({name:C.name,dir:C.dir});return S}function planDevLinks(t){let n=t.patterns.length>0?filterWorkspaces(t.workspaces,{include:[...t.patterns]}):[...t.workspaces],S=[];for(let C of n)C.name&&t.knownNames.has(C.name)&&S.push({name:C.name,target:C.location,linkPath:zn(t.consumerRoot,`node_modules`,C.name)});let C=S.map(t=>t.linkPath+qn),N=new Map(S.map(t=>[t.name,t]));for(let n of t.nested??[]){let t=N.get(n.name);t&&(C.some(t=>n.dir.startsWith(t))||S.push({name:n.name,target:t.target,linkPath:n.dir}))}return S.sort((t,n)=>t.name<n.name?-1:t.name>n.name?1:t.linkPath<n.linkPath?-1:+(t.linkPath>n.linkPath)),S}function prepareDevLinks(t){let n=readDevLinkOverride(t);if(!n)return null;let S=devLinkPath(t),C=planDevLinks({consumerRoot:t,workspaces:resolveCheckoutWorkspaces(n.checkout,S),patterns:n.packages,knownNames:consumerKnownNames(t),nested:consumerNestedPlacements(t)});return{overridePath:S,consumerRoot:t,checkout:n.checkout,links:C,names:new Set(C.map(t=>t.name))}}function applyDevLinks(t){assertDevLinksBuilt(t);let n=[];for(let S of t)linkAlreadyPointsAt(S.linkPath,S.target)||(mkdirSync(Hn(S.linkPath),{recursive:!0}),rmSync(S.linkPath,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),linkDirSync(S.linkPath,S.target),n.push(S));return n}function removeDevLinks(t){let n=[];for(let S of t){let t=!1;try{t=lstatSync(S.linkPath).isSymbolicLink()}catch{continue}t&&linkAlreadyPointsAt(S.linkPath,S.target)&&(rmSync(S.linkPath,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),n.push(S))}return n}function linkAlreadyPointsAt(t,n){try{return lstatSync(t).isSymbolicLink()?realpathSync(t)===realpathSync(n):!1}catch{return!1}}function scanDevLinks(t,n){let S=[];for(let t of n)try{S.push(realpathSync(t))}catch{}if(S.length===0)return[];let C=[];for(let n of scanPrefix(t)){if(!n.linked)continue;let N;try{N=realpathSync(n.dir)}catch{continue}S.some(t=>N===t||N.startsWith(t+qn))&&C.push({name:packageNameAt(t,n.dir),target:N,linkPath:n.dir})}return C.sort((t,n)=>t.linkPath<n.linkPath?-1:+(t.linkPath>n.linkPath)),C}function packageNameAt(t,n){let S=Bn(t,n).split(qn).join(`/`);return S.slice(S.lastIndexOf(`node_modules/`)+13)}function retireDevLinks(t,n,S){return removeDevLinks(scanDevLinks(t,n).filter(t=>!S.has(t.name)))}function unbuiltDevLinks(t){let n=[];for(let S of t){let t;try{t=JSON.parse(readFileSync(zn(S.target,`package.json`),`utf-8`))}catch(t){n.push({link:S,reason:`its package.json is missing or unreadable (${t instanceof Error?t.message:String(t)})`});continue}let C=[];for(let n of[`main`,`module`]){let S=t[n];typeof S==`string`&&C.push(S)}let N=t.exports;typeof N==`string`?C.push(N):N&&typeof N==`object`&&collectStringLeaves(N[`.`],C),C.length!==0&&(C.some(t=>existsSync(zn(S.target,t)))||n.push({link:S,reason:`none of its declared entry points exist yet (${C.join(`, `)})`}))}return n}function formatUnbuiltDevLinks(t){let n=t.map(t=>` ${t.link.name} ${t.link.target}\n ${t.reason}`).join(`
940
940
  `);return`gjsify link: ${t.length} linked package(s) are not built, so linking them would hand the consumer a tree whose first import fails with MODULE_NOT_FOUND:\n${n}\n Build them in the checkout (\`gjsify run build\` there) and re-run, or narrow the selection with \`gjsify link <checkout> --packages <glob>\`. A link does not build.`}function assertDevLinksBuilt(t){let n=unbuiltDevLinks(t);if(n.length!==0)throw Error(formatUnbuiltDevLinks(n))}function collectStringLeaves(t,n){if(typeof t==`string`){n.push(t);return}if(!(!t||typeof t!=`object`))for(let S of Object.values(t))collectStringLeaves(S,n)}function ensureLocallyIgnored(t){let n=resolveGitDir(t);if(!n.commonDir)return n.why;let S=zn(t,`.gitignore`);if(existsSync(S)&&fileMentionsPattern(S,`.gjsify-link.json`))return`already-ignored`;let C=zn(n.commonDir,`info`,`exclude`);if(existsSync(C)&&fileMentionsPattern(C,`.gjsify-link.json`))return`already-ignored`;mkdirSync(Hn(C),{recursive:!0});let N=existsSync(C)?readFileSync(C,`utf-8`):``;return writeFileSync(C,`${N}${N===``||N.endsWith(`
941
941
  `)?``:`
942
942
  `}${Az}\n${kz}\n`),`added`}function removeLocalIgnore(t){let n=resolveGitDir(t);if(!n.commonDir)return n.why;let S=zn(n.commonDir,`info`,`exclude`),C;try{C=readFileSync(S,`utf-8`)}catch{return`absent`}let N=C.split(/\r?\n/),F=[],I=!1;for(let t=0;t<N.length;t++){if(!I&&N[t]?.trim()===Az&&(N[t+1]?.trim()===`.gjsify-link.json`||N[t+1]?.trim()===`/.gjsify-link.json`)){t++,I=!0;continue}F.push(N[t]??``)}return I?(writeFileSync(S,F.join(`
@@ -1894,7 +1894,7 @@ Select upgrades: comma- or space-separated indices, `+nJ.bold+`a`+nJ.reset+` for
1894
1894
  `);return C.length===N.length?N.map((t,n)=>S.some(n=>t.includes(`"${n}"`))?t:C[n]).join(`
1895
1895
  `):n}function uniqueLocations(t){let n=new Set;for(let S of t)for(let t of S.occurrences)n.add(t.workspaceLocation);return[...n]}function detectIndent(t){let n=t.match(/^\{\n( +)/);return n?n[1].length:2}async function loadNpmrcLight(t){let n={registry:fh,scopes:{},authTokens:{},basicAuth:{}};for(let S of[zn(homedir(),`.npmrc`),zn(t,`.npmrc`)])if(existsSync(S))try{let t=parseNpmrc(readFileSync(S,`utf-8`));n={...n,...t,scopes:{...n.scopes,...t.scopes}}}catch{}return process.env.npm_config_registry&&(n.registry=process.env.npm_config_registry),n}var $q,eJ,tJ,nJ,rJ=__esmMin(()=>{_e(),rf(),Xn(),a_(),Zq(),RI(),bh(),BI(),HI(),Qq(),$q={command:`upgrade`,description:"Workspace-aware dependency upgrades. Walks every package.json in the monorepo, groups by dep, flags inconsistencies. `--latest` / `--minor` / `--patch` for bulk-mode, `--align` for offline consistency-only mode, `--check` for CI drift detection.",builder:t=>t.option(`latest`,{description:`Non-interactive: bump every dependency to its latest version (allows major).`,type:`boolean`,default:!1}).option(`minor`,{description:`Non-interactive: bump every dependency to the latest within the same major (semver-minor + semver-patch).`,type:`boolean`,default:!1}).option(`patch`,{description:`Non-interactive: bump every dependency to the latest within the same minor (semver-patch only).`,type:`boolean`,default:!1}).option(`filter`,{description:`Only consider deps whose name matches this substring (case-insensitive). Repeatable; comma-separated values are split.`,type:`string`}).option(`workspace`,{alias:`p`,description:`Restrict to a subset of workspaces. Patterns are matched against the workspace package name AND its directory path (substring + glob). Repeatable; comma-separated values are split.`,type:`string`}).option(`exclude-workspace`,{description:`Skip workspaces matching this pattern (glob-shaped; matched against workspace package name AND directory path). Repeatable; comma-separated values are split. Use for workspaces with intentional dependency drift — e.g. integration tests pinned to specific upstream versions.`,type:`string`}).option(`align`,{description:"Offline repair mode: find deps declared at multiple ranges across the workspace and align them to the highest. With `--exact`, also drop the range operator from declarations that already agree. No registry calls.",type:`boolean`,default:!1}).option(`check`,{description:"CI gate: exit non-zero when any dep is declared inconsistently across workspaces. Implies offline (no registry calls). Pairs with `--align` as the fix.",type:`boolean`,default:!1}).option(`exact`,{description:"Pin without a range operator. When writing, emits `1.2.3` instead of `^1.2.3`; with `--check`, fails on any matched dep that carries one; with `--align`, repairs exactly that. Pair with `--filter` — a repository-wide exactness run touches every ordinary caret dep by design.",type:`boolean`,default:!1}).option(`dry-run`,{description:`Print the upgrade plan without writing package.json files.`,type:`boolean`,default:!1}).option(`cwd`,{description:`Project directory. Default: process.cwd(). When inside a workspace, walks up to the monorepo root.`,type:`string`}).option(`yes`,{alias:`y`,description:`Interactive mode: select all without prompting.`,type:`boolean`,default:!1}).option(`verbose`,{description:`Print extra resolution details.`,type:`boolean`,default:!1}),handler:async t=>{let n=discoverContext(In(t.cwd??process.cwd())),S=applyWorkspaceFilter(n.workspaces,t.workspace,t.excludeWorkspace);if(S.length===0){ge.log(`[gjsify upgrade] no matching workspaces.`);return}let C=collectAllDeclarations(S,parseFilterList(t.filter));if(C.length===0){ge.log(`[gjsify upgrade] no external npm dependencies to check.`);return}let N=groupByDependency(C);if(t.check)return runCheckMode(N,t.exact);if(t.align)return runAlignMode(N,t);let F=await loadNpmrcLight(n.root),I=t.latest?`latest`:t.minor?`minor`:t.patch?`patch`:`interactive`;ge.log(`[gjsify upgrade] checking ${N.length} unique deps across ${S.length} workspace(s) against ${F.registry}…`);let H=await resolveCandidateGroups(N,F,t.verbose??!1,I);if(H.length===0){ge.log(`✅ all dependencies are up to date`);let t=findInconsistencies(N);t.length>0&&ge.log(`\n⚠ ${t.length} dep(s) declared at inconsistent ranges across workspaces. Run \`gjsify upgrade --align\` to fix.`);return}printTable(H);let W;if(I===`interactive`&&!t.yes?W=await promptSelection(H):(t.yes&&I===`interactive`&&ge.log(`[gjsify upgrade] -y / --yes: selecting all`),W=H),W.length===0){ge.log(`[gjsify upgrade] nothing selected; no files changed.`);return}if(t.dryRun){let n=uniqueLocations(W).length;ge.log(`[gjsify upgrade] --dry-run: would update ${W.length} deps across ${n} package.json file(s).`),printChangePlan(W,t.exact);return}let q=applyToFiles(W,t.exact);ge.log(`✏️ updated ${W.length} dep(s) across ${q} package.json file(s). Run \`gjsify install\` to apply.`)}},eJ=[`dependencies`,`devDependencies`,`optionalDependencies`,`peerDependencies`],tJ=new Set([`x`,`X`,`*`,``]),nJ={reset:`\x1B[0m`,bold:`\x1B[1m`,dim:`\x1B[2m`,red:`\x1B[31m`,yellow:`\x1B[33m`,green:`\x1B[32m`,cyan:`\x1B[36m`,magenta:`\x1B[35m`}});async function unscannableBarrelPaths(t,n){let S=[];for(let C of n){let n=In(t,C);try{(await stat$1(n)).isDirectory()||S.push(`${n} is not a directory`)}catch(t){S.push(`${n}: ${t.message}`)}}return S}async function generateBarrels(t){let n=t.singleQuotes?`'`:`"`,S=t.noSemicolon?``:`;`,C=t.extension===`none`?``:`.${t.extension}`,N=0;for(let F of t.paths){let I=In(t.baseDir,F),H=Un(I)===`types`,W;try{W=(await readdir$1(I,{withFileTypes:!0})).filter(t=>t.isFile()).filter(t=>aJ.test(t.name)).filter(t=>t.name!==`index.ts`).filter(n=>!t.exclude.some(t=>t.test(n.name))).sort((t,n)=>t.name.localeCompare(n.name))}catch(n){t.verbose&&ge.error(`[gjsify barrels] skip ${I}: ${n.message}`);continue}let q=W.map(t=>{let N=Un(t.name,Wn(t.name));return`${H?`export type *`:`export *`} from ${n}./${N}${C}${n}${S}`}),Y=q.length?`${q.join(`
1896
1896
  `)}\n`:`export {};
1897
- `,X=`${t.header}\n\n${Y}`,Z=zn(I,`index.ts`);if(await readFile$1(Z,`utf-8`).catch(()=>``)===X){t.verbose&&ge.log(`[gjsify barrels] up-to-date: ${Z}`);continue}t.check?(ge.error(`[gjsify barrels] drift: ${Z}`),N++):(await writeFile$1(Z,X,`utf-8`),t.verbose&&ge.log(`[gjsify barrels] wrote: ${Z}`))}return N}var iJ,aJ,oJ=__esmMin(()=>{_e(),Bd(),Xn(),iJ=[`\\.test\\.`,`\\.spec\\.`,`\\.test-data\\.`],aJ=/\.(ts|tsx|mts|cts)$/}),sJ,cJ=__esmMin(()=>{_e(),oJ(),sJ={command:`barrels [paths..]`,description:"Regenerate `index.ts` barrel files for the given directories. Drop-in replacement for `barrelsby`.",builder:t=>t.positional(`paths`,{description:"Directories whose `index.ts` to (re)generate. May also be passed via `--paths`.",type:`string`,array:!0}).option(`paths`,{alias:`p`,description:`Alternative to positional — repeatable list of directories.`,type:`string`,array:!0}).option(`ext`,{description:"Import-specifier extension. Default: `none` (bundler-mode resolution).",type:`string`,choices:[`js`,`ts`,`none`],default:`none`}).option(`base-dir`,{alias:`b`,description:"Resolve `paths` against this directory. Default: cwd.",type:`string`}).option(`exclude`,{description:"Regex(es) of file names to skip. Repeatable. Defaults: `\\.test\\.`, `\\.spec\\.`, `\\.test-data\\.`.",type:`string`,array:!0}).option(`header`,{description:`Header comment prepended to every generated file.`,type:`string`}).option(`semicolon`,{description:"Emit trailing `;` on each export line. Negate with `--no-semicolon`. Default: omitted.",type:`boolean`,default:!1}).option(`single-quotes`,{description:"Use `'` for import specifiers. Default: true. Pass `--no-single-quotes` for `\"`.",type:`boolean`,default:!0}).option(`check`,{description:`Report drift without modifying files; exit non-zero if any barrel is stale.`,type:`boolean`,default:!1}).option(`verbose`,{description:`Log each file scanned + written.`,type:`boolean`,default:!1}),handler:async t=>{let n=Array.from(new Set((t.paths??[]).filter(Boolean)));if(n.length===0){ge.error(`[gjsify barrels] no paths provided. Pass directories as positional arguments or via --paths.`),process.exitCode=1;return}let S=t.baseDir??process.cwd(),C=await unscannableBarrelPaths(S,n);if(C.length>0){for(let t of C)ge.error(`[gjsify barrels] cannot scan ${t}`);ge.error(`[gjsify barrels] ${C.length} of ${n.length} path(s) could not be scanned — refusing to report on the rest as if that were the whole set.`),process.exitCode=1;return}let N=t.exclude?.length?t.exclude:[...iJ],F=await generateBarrels({paths:n,extension:t.ext??`none`,baseDir:S,exclude:N.map(t=>new RegExp(t)),header:t.header??"// Auto-generated by `gjsify barrels` — do not edit by hand.",noSemicolon:t.semicolon===!1||t.semicolon===void 0,singleQuotes:t.singleQuotes!==!1,check:t.check??!1,verbose:t.verbose??!1});t.check&&F>0&&(ge.error(`[gjsify barrels] ${F} barrel file(s) drifted. Run without --check to fix.`),process.exitCode=1)}}}),lJ,uJ=__esmMin(()=>{_e(),$l(),Xn(),cr(),fL(),sL(),rf(),jG(),zR(),HI(),mv(),lJ={command:`tsc [tscArgs..]`,description:"Run TypeScript compiler (tsc) under GJS via the @gjsify/tsc bundle. All arguments are passed through to tsc. Equivalent to `gjsify-tsc <args>` from the @gjsify/tsc bin.",builder:t=>t.parserConfiguration({"unknown-options-as-args":!0}).version(!1).help(!1).positional(`tscArgs`,{description:"Arguments forwarded verbatim to tsc (e.g. `--version`, `-p tsconfig.json`).",type:`string`,array:!0,default:[]}),handler:async t=>{let n=(t._??[]).slice(1).map(String),S=t.tscArgs??[],C=n.length>0?n:S,N=process.cwd(),F=[pathToFileURL(`${findWorkspaceRoot(N)??N}/__gjsify_tsc__.js`).href,import.meta.url],I;for(let t of F)try{I=createRequire(t).resolve(`@gjsify/tsc/bundle`);break}catch{}let H;for(let t of F)try{H=zn(Hn(createRequire(t).resolve(`typescript/package.json`)),`lib`,`tsc.js`);break}catch{}if(!I&&!H)return ge.error("gjsify tsc: neither @gjsify/tsc (GJS bundle) nor npm `typescript` (Node) is installed."),ge.error(" Install with: gjsify install --save-dev @gjsify/tsc (or add `typescript`)."),forceExit(1);let W=buildNativeEnv(detectNativePackages(N)),q={...process.env,...W},runNodeTsc=async()=>{let t=nodeBinary();if(!(t.includes(`/`)||t.includes(`\\`)?existsSync(t):isOnPath(t)))return ge.error(`gjsify tsc: the @gjsify/tsc GJS bundle is unavailable and \`${t}\` cannot be run, so upstream \`typescript\` cannot run either.`),ge.error(` Build the bundle with: gjsify workspace @gjsify/tsc build`),ge.error(" …or install Node.js so the upstream `typescript` fallback can be spawned."),forceExit(1);try{await new Promise((n,S)=>{spawnToCompletion(t,[H,...C],{completion:`exit`,env:q,onSpawn:t=>{let n=!1;t.on(`error`,()=>{n=!0}),t.on(`close`,t=>{n||forceExit(t??1)})}}).catch(S)})}catch(t){let n=t;return n.code===`ENOENT`?(ge.error("gjsify tsc: the @gjsify/tsc GJS bundle is unavailable and `node` is not on PATH, so upstream `typescript` cannot run either."),ge.error(` Build the bundle with: gjsify workspace @gjsify/tsc build`)):ge.error(`gjsify tsc (node typescript): ${n.message}`),forceExit(1)}};if(I)try{await new Promise((t,n)=>{spawnToCompletion(`gjs`,[`-m`,I,...C],{completion:`exit`,env:q,onSpawn:t=>{let n=!1;t.on(`error`,()=>{n=!0}),t.on(`close`,t=>{n||forceExit(t??1)})}}).catch(n)})}catch(t){let n=t;return n.code===`ENOENT`&&H?await runNodeTsc():(n.code===`ENOENT`?(ge.error("gjsify tsc: `gjs` not found on PATH and no npm `typescript` fallback."),ge.error(" Install GJS (e.g. `dnf install gjs`), or add `typescript` to the project.")):ge.error(`gjsify tsc: ${n.message}`),forceExit(1))}else await runNodeTsc()}}});function readStdinText(){return readFileSync(0,`utf-8`)}function readStdinLines(){return splitStdinLines(readStdinText())}function splitStdinLines(t){return t.split(`
1897
+ `,X=`${t.header}\n\n${Y}`,Z=zn(I,`index.ts`);if(await readFile$1(Z,`utf-8`).catch(()=>``)===X){t.verbose&&ge.log(`[gjsify barrels] up-to-date: ${Z}`);continue}t.check?(ge.error(`[gjsify barrels] drift: ${Z}`),N++):(await writeFile$1(Z,X,`utf-8`),t.verbose&&ge.log(`[gjsify barrels] wrote: ${Z}`))}return N}var iJ,aJ,oJ=__esmMin(()=>{_e(),Bd(),Xn(),iJ=[`\\.test\\.`,`\\.spec\\.`,`\\.test-data\\.`],aJ=/\.(ts|tsx|mts|cts)$/}),sJ,cJ=__esmMin(()=>{_e(),oJ(),sJ={command:`barrels [paths..]`,description:"Regenerate `index.ts` barrel files for the given directories. Drop-in replacement for `barrelsby`.",builder:t=>t.positional(`paths`,{description:"Directories whose `index.ts` to (re)generate. May also be passed via `--paths`.",type:`string`,array:!0}).option(`paths`,{alias:`p`,description:`Alternative to positional — repeatable list of directories.`,type:`string`,array:!0}).option(`ext`,{description:"Import-specifier extension. Default: `none` (bundler-mode resolution).",type:`string`,choices:[`js`,`ts`,`none`],default:`none`}).option(`base-dir`,{alias:`b`,description:"Resolve `paths` against this directory. Default: cwd.",type:`string`}).option(`exclude`,{description:"Regex(es) of file names to skip. Repeatable. Defaults: `\\.test\\.`, `\\.spec\\.`, `\\.test-data\\.`.",type:`string`,array:!0}).option(`header`,{description:`Header comment prepended to every generated file.`,type:`string`}).option(`semicolon`,{description:"Emit trailing `;` on each export line. Negate with `--no-semicolon`. Default: omitted.",type:`boolean`,default:!1}).option(`single-quotes`,{description:"Use `'` for import specifiers. Default: true. Pass `--no-single-quotes` for `\"`.",type:`boolean`,default:!0}).option(`check`,{description:`Report drift without modifying files; exit non-zero if any barrel is stale.`,type:`boolean`,default:!1}).option(`verbose`,{description:`Log each file scanned + written.`,type:`boolean`,default:!1}),handler:async t=>{let n=Array.from(new Set((t.paths??[]).filter(Boolean)));if(n.length===0){ge.error(`[gjsify barrels] no paths provided. Pass directories as positional arguments or via --paths.`),process.exitCode=1;return}let S=t.baseDir??process.cwd(),C=await unscannableBarrelPaths(S,n);if(C.length>0){for(let t of C)ge.error(`[gjsify barrels] cannot scan ${t}`);ge.error(`[gjsify barrels] ${C.length} of ${n.length} path(s) could not be scanned — refusing to report on the rest as if that were the whole set.`),process.exitCode=1;return}let N=t.exclude?.length?t.exclude:[...iJ],F=await generateBarrels({paths:n,extension:t.ext??`none`,baseDir:S,exclude:N.map(t=>new RegExp(t)),header:t.header??"// Auto-generated by `gjsify barrels` — do not edit by hand.",noSemicolon:t.semicolon===!1||t.semicolon===void 0,singleQuotes:t.singleQuotes!==!1,check:t.check??!1,verbose:t.verbose??!1});t.check&&F>0&&(ge.error(`[gjsify barrels] ${F} barrel file(s) drifted. Run without --check to fix.`),process.exitCode=1)}}}),lJ,uJ=__esmMin(()=>{_e(),$l(),Xn(),cr(),fL(),sL(),rf(),jG(),zR(),HI(),mv(),jz(),lJ={command:`tsc [tscArgs..]`,description:"Run TypeScript compiler (tsc) under GJS via the @gjsify/tsc bundle. All arguments are passed through to tsc. Equivalent to `gjsify-tsc <args>` from the @gjsify/tsc bin.",builder:t=>t.parserConfiguration({"unknown-options-as-args":!0}).version(!1).help(!1).positional(`tscArgs`,{description:"Arguments forwarded verbatim to tsc (e.g. `--version`, `-p tsconfig.json`).",type:`string`,array:!0,default:[]}),handler:async t=>{let n=(t._??[]).slice(1).map(String),S=t.tscArgs??[],C=process.cwd(),N=tscArgsUnderLink(n.length>0?n:S,existsSync(devLinkPath(devLinkRoot(C)))),F=[pathToFileURL(`${findWorkspaceRoot(C)??C}/__gjsify_tsc__.js`).href,import.meta.url],I;for(let t of F)try{I=createRequire(t).resolve(`@gjsify/tsc/bundle`);break}catch{}let H;for(let t of F)try{H=zn(Hn(createRequire(t).resolve(`typescript/package.json`)),`lib`,`tsc.js`);break}catch{}if(!I&&!H)return ge.error("gjsify tsc: neither @gjsify/tsc (GJS bundle) nor npm `typescript` (Node) is installed."),ge.error(" Install with: gjsify install --save-dev @gjsify/tsc (or add `typescript`)."),forceExit(1);let W=buildNativeEnv(detectNativePackages(C)),q={...process.env,...W},runNodeTsc=async()=>{let t=nodeBinary();if(!(t.includes(`/`)||t.includes(`\\`)?existsSync(t):isOnPath(t)))return ge.error(`gjsify tsc: the @gjsify/tsc GJS bundle is unavailable and \`${t}\` cannot be run, so upstream \`typescript\` cannot run either.`),ge.error(` Build the bundle with: gjsify workspace @gjsify/tsc build`),ge.error(" …or install Node.js so the upstream `typescript` fallback can be spawned."),forceExit(1);try{await new Promise((n,S)=>{spawnToCompletion(t,[H,...N],{completion:`exit`,env:q,onSpawn:t=>{let n=!1;t.on(`error`,()=>{n=!0}),t.on(`close`,t=>{n||forceExit(t??1)})}}).catch(S)})}catch(t){let n=t;return n.code===`ENOENT`?(ge.error("gjsify tsc: the @gjsify/tsc GJS bundle is unavailable and `node` is not on PATH, so upstream `typescript` cannot run either."),ge.error(` Build the bundle with: gjsify workspace @gjsify/tsc build`)):ge.error(`gjsify tsc (node typescript): ${n.message}`),forceExit(1)}};if(I)try{await new Promise((t,n)=>{spawnToCompletion(`gjs`,[`-m`,I,...N],{completion:`exit`,env:q,onSpawn:t=>{let n=!1;t.on(`error`,()=>{n=!0}),t.on(`close`,t=>{n||forceExit(t??1)})}}).catch(n)})}catch(t){let n=t;return n.code===`ENOENT`&&H?await runNodeTsc():(n.code===`ENOENT`?(ge.error("gjsify tsc: `gjs` not found on PATH and no npm `typescript` fallback."),ge.error(" Install GJS (e.g. `dnf install gjs`), or add `typescript` to the project.")):ge.error(`gjsify tsc: ${n.message}`),forceExit(1))}else await runNodeTsc()}}});function readStdinText(){return readFileSync(0,`utf-8`)}function readStdinLines(){return splitStdinLines(readStdinText())}function splitStdinLines(t){return t.split(`
1898
1898
  `).map(t=>t.trim()).filter(Boolean)}var dJ=__esmMin(()=>{rf()});function isResolvableScript(t){return gJ.test(t)&&!fJ.some(n=>n.test(t))&&!hJ.some(n=>n.match.test(t))}function resolveRootScripts(t,n){let S=new Set,C=[];for(let n of t)isResolvableScript(n)?C.push(n):S.add(n);let N=new Set;for(;C.length>0;){let t=C.shift();if(!N.has(t)){N.add(t);for(let N of n(t))pJ.some(t=>t.test(N))||(isResolvableScript(N)?C.push(N):S.add(N))}}return{files:[...S],scripts:N.size}}function classifyAndExpand(t,n,S){let C=n.map(t=>t.replace(/\\/g,`/`)).filter(t=>t.length>0);if(C.length===0)return{global:!1,reason:`empty-diff`,workspaces:[],runE2E:!1,runIntegration:!1,skipAll:!0};let N=[];for(let t of C)pJ.some(n=>n.test(t))||N.push(t);let F=``;if(S){let t=resolveRootScripts(N,S);t.scripts>0&&(N=t.files,F=`; ${t.scripts} root script(s) resolved to their readers`)}if(N.length===0)return{global:!1,reason:`ignored-only`+F,workspaces:[],runE2E:!1,runIntegration:!1,skipAll:!0};for(let n of N)for(let S of fJ)if(S.test(n))return{global:!0,reason:`global-trigger ${S.source} matched ${n}${F}`,workspaces:t.map(t=>t.name),runE2E:!0,runIntegration:!0,skipAll:!1};let{matched:I,unmatched:H}=workspacesForChangedFiles(t,N),W=new Set(t.map(t=>t.name)),q=new Set,Y=new Set,X=!1;for(let n of hJ){let S=N.filter(t=>n.match.test(t));if(S.length!==0){for(let t of S)Y.add(t);for(let S of n.seeds){if(!W.has(S))return{global:!0,reason:`script-coupling seed ${S} is not a workspace (${n.match.source} → ${n.why}); SCRIPT_COUPLINGS in commands/affected.ts is stale`,workspaces:t.map(t=>t.name),runE2E:!0,runIntegration:!0,skipAll:!1};q.add(S)}n.runE2E&&(X=!0)}}let Z=H.filter(t=>!Y.has(t));if(Z.length>0)return{global:!0,reason:`unmatched files (${Z.length}): ${Z.slice(0,3).join(`, `)}${Z.length>3?`…`:``}${F}`,workspaces:t.map(t=>t.name),runE2E:!0,runIntegration:!0,skipAll:!1};for(let t of q)I.add(t);if(q.size===0&&N.every(t=>mJ.some(n=>n.test(t)))&&I.size===1){let t=[...I][0],n=N.some(t=>t.startsWith(`tests/e2e/`)),S=N.some(t=>t.startsWith(`tests/integration/`));return{global:!1,reason:`test-only (${N.length} file(s) in ${t})${F}`,workspaces:[t],runE2E:n||X,runIntegration:S||isIntegrationWorkspace(t),skipAll:!1}}let te=affectedClosure(buildReverseDependencyGraph(t,{includeDev:!1}),[...I]),ne=buildDependencyGraph(t,{includeDev:!0}),re=!1;for(let[t,n]of ne.edges)if(isIntegrationWorkspace(t)){for(let S of n)if(te.has(S)){te.add(t),re=!0;break}}let ie=N.some(t=>t.startsWith(`tests/e2e/`))||X;return{global:!1,reason:`closure (${te.size} ws from ${I.size} seed(s))`+(q.size>0?`, ${q.size} via script-coupling`:``)+F,workspaces:[...te].sort(),runE2E:ie,runIntegration:re,skipAll:!1}}function isIntegrationWorkspace(t){return t.startsWith(`@gjsify/integration-`)}var fJ,pJ,mJ,hJ,gJ,_J=__esmMin(()=>{BI(),fJ=[/^packages\/infra\/workspace\//,/^packages\/infra\/cli\//,/^packages\/infra\/rolldown-plugin-gjsify\//,/^packages\/infra\/resolve-npm\//,/^packages\/gjs\/unit\//,/^\.github\/actions\//,/^gjsify-lock\.json$/,/^package\.json$/,/^tsconfig[^/]*\.json$/,/^\.github\/workflows\/main\.yml$/,/^scripts\/audit-runtimes\.mjs$/],pJ=[/\.md$/i,/^refs\//,/^website\//,/^docs\//,/^\.github\/workflows\/(deploy-docs|commitlint|release|release-cut|audit-runtimes|prebuilds|node-gi|napi|cli-cross-platform|build-ci-image|cancel-pr-runs|macos-suites|windows-suites|gtk-os-suites)\.yml$/,/^\.github\/prebuild-toolchain\//,/^scripts\/manifest-conformance\//,/^status\//,/^scripts\/generate-status\.mjs$/,/^packages\/node-gi\//,/^packages\/napi\//,/^flatpak\//,/^LICENSE/,/^\.gitignore$/,/^\.gjsify-[^/]*\.md$/,/^STATUS\.md$/,/^CHANGELOG\.md$/,/^AGENTS\.md$/,/^CLAUDE\.md$/,/^README\.md$/],mJ=[/\.spec\.[mc]?[tj]sx?$/,/^tests\/(e2e|integration)\//],hJ=[{match:/^\.githooks\//,seeds:[],runE2E:!0,why:`tests/e2e/git-hooks-cli-bundle-staleness drives .githooks/pre-commit`},{match:/^templates\//,seeds:[`@gjsify/create-app`],runE2E:!0,why:`@gjsify/create-app build → node scripts/process-template.mjs reads templates/`},{match:/^packages\/framework\/react-native\//,seeds:[],runE2E:!0,why:`tests/e2e/react-native-devtools is the only external observer of AppRegistry.runApplication`}],gJ=/^scripts\/[^/]+$/});function stripCommentLines(t,n){let S=/\.(ya?ml|sh|bash|py|toml)$|(^|\/)\.git[a-z]*$|Dockerfile$/.test(t)?/^\s*#/:/^\s*(\/\/|\/\*|\*)/;return n.split(`
1899
1899
  `).filter(t=>!S.test(t)).join(`
1900
1900
  `)}function scriptNamePattern(t){let n=On.basename(t),S=/^(.*?)(\.d)?\.[mc]?[jt]sx?$/.exec(n),C=S?`${escapeRe(S[1])}(\\.d)?\\.[mc]?[jt]sx?\\b`:`${escapeRe(n)}\\b`;return RegExp(`(^|[^\\w.-])${C}`)}function gatedJobs(t){let n=new Map,S=new Set;for(let{job:C,text:N}of t){if(!C)continue;n.has(C)||n.set(C,[]);let t=/^ {4}needs:\s*\[(.*)\]/.exec(N)??/^ {4}needs:\s*([A-Za-z0-9_-]+)\s*$/.exec(N);t&&n.set(C,t[1].split(`,`).map(t=>t.trim()).filter(Boolean)),(/needs\.changes\b/.test(N)||/^ {4}needs:\s*$/.test(N))&&S.add(C)}let C=new Set([`changes`,...S]),N=!0;for(;N;){N=!1;for(let[t,S]of n)!C.has(t)&&S.some(t=>C.has(t))&&(C.add(t),N=!0)}return C.delete(`changes`),C}function workflowLines(t){let n=t.split(`
@@ -27,6 +27,7 @@ import { forceExit } from '../utils/force-exit.js';
27
27
  import { nodeBinary } from '../utils/run-node.js';
28
28
  import { findWorkspaceRoot } from '../utils/workspace-root.js';
29
29
  import { spawnToCompletion } from '../utils/spawn.js';
30
+ import { devLinkPath, devLinkRoot, tscArgsUnderLink } from '../utils/dev-link.js';
30
31
  export const tscCommand = {
31
32
  command: 'tsc [tscArgs..]',
32
33
  description: 'Run TypeScript compiler (tsc) under GJS via the @gjsify/tsc bundle. All arguments are passed through to tsc. Equivalent to `gjsify-tsc <args>` from the @gjsify/tsc bin.',
@@ -61,9 +62,10 @@ export const tscCommand = {
61
62
  // When `_` has anything beyond the command name, it already
62
63
  // includes both flags AND any bare positionals in the original
63
64
  // order — use it directly. Fall back to the explicit positional
64
- // array for the args-free invocation.
65
- const tscArgs = overflow.length > 0 ? overflow : explicit;
65
+ // array for the args-free invocation. Under a dev link, peer
66
+ // resolution must stay in the consumer tree (gjsify#2249).
66
67
  const cwd = process.cwd();
68
+ const tscArgs = tscArgsUnderLink(overflow.length > 0 ? overflow : explicit, existsSync(devLinkPath(devLinkRoot(cwd))));
67
69
  // Anchor resolution at the workspace root so a sub-package `cwd`
68
70
  // (e.g. `packages/web/fetch`) still finds the hoisted `@gjsify/tsc`
69
71
  // at the root's `node_modules`. Falls back to cwd for standalone
@@ -64,6 +64,17 @@ export declare function removeDevLinkOverride(root: string): string | null;
64
64
  * ignore a link the root declares.
65
65
  */
66
66
  export declare function devLinkRoot(startDir: string): string;
67
+ /**
68
+ * The `tsc` arguments for a project that may carry a dev link (gjsify#2249).
69
+ *
70
+ * A linked package is a symlink into the checkout, and TypeScript follows it to
71
+ * the realpath by default. Its peer dependencies then resolve from the
72
+ * CHECKOUT's `node_modules`, so the consumer sees two copies of the same types
73
+ * (`McpServer` is not assignable to `McpServer`). `--preserveSymlinks` keeps
74
+ * resolution in the consumer tree, which is what an unlinked install does.
75
+ * An explicit `--preserveSymlinks` in either spelling wins.
76
+ */
77
+ export declare function tscArgsUnderLink(args: readonly string[], linked: boolean): string[];
67
78
  /**
68
79
  * Turn `override.checkout` into the workspace list behind it, or refuse.
69
80
  *
@@ -115,6 +115,23 @@ export function devLinkRoot(startDir) {
115
115
  return wsRoot;
116
116
  return startDir;
117
117
  }
118
+ /**
119
+ * The `tsc` arguments for a project that may carry a dev link (gjsify#2249).
120
+ *
121
+ * A linked package is a symlink into the checkout, and TypeScript follows it to
122
+ * the realpath by default. Its peer dependencies then resolve from the
123
+ * CHECKOUT's `node_modules`, so the consumer sees two copies of the same types
124
+ * (`McpServer` is not assignable to `McpServer`). `--preserveSymlinks` keeps
125
+ * resolution in the consumer tree, which is what an unlinked install does.
126
+ * An explicit `--preserveSymlinks` in either spelling wins.
127
+ */
128
+ export function tscArgsUnderLink(args, linked) {
129
+ if (!linked)
130
+ return [...args];
131
+ if (args.some((arg) => arg.toLowerCase().split('=')[0] === '--preservesymlinks'))
132
+ return [...args];
133
+ return [...args, '--preserveSymlinks'];
134
+ }
118
135
  /**
119
136
  * Turn `override.checkout` into the workspace list behind it, or refuse.
120
137
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.64.48-next.345",
3
+ "version": "0.64.48",
4
4
  "description": "CLI for Gjsify",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -142,22 +142,22 @@
142
142
  "cli"
143
143
  ],
144
144
  "dependencies": {
145
- "@gjsify/blueprint": "0.64.48-next.345",
146
- "@gjsify/buffer": "0.64.48-next.345",
147
- "@gjsify/create-app": "0.64.48-next.345",
148
- "@gjsify/node-globals": "0.64.48-next.345",
149
- "@gjsify/node-polyfills": "0.64.48-next.345",
150
- "@gjsify/npm-registry": "0.64.48-next.345",
151
- "@gjsify/resolve-npm": "0.64.48-next.345",
152
- "@gjsify/rolldown-plugin-gjsify": "0.64.48-next.345",
153
- "@gjsify/vite-plugin-blueprint": "0.64.48-next.345",
154
- "@gjsify/rolldown-plugin-pnp": "0.64.48-next.345",
155
- "@gjsify/semver": "0.64.48-next.345",
156
- "@gjsify/tar": "0.64.48-next.345",
157
- "@gjsify/tsc": "0.64.48-next.345",
158
- "@gjsify/utils": "0.64.48-next.345",
159
- "@gjsify/web-polyfills": "0.64.48-next.345",
160
- "@gjsify/workspace": "0.64.48-next.345",
145
+ "@gjsify/blueprint": "0.64.48",
146
+ "@gjsify/buffer": "0.64.48",
147
+ "@gjsify/create-app": "0.64.48",
148
+ "@gjsify/node-globals": "0.64.48",
149
+ "@gjsify/node-polyfills": "0.64.48",
150
+ "@gjsify/npm-registry": "0.64.48",
151
+ "@gjsify/resolve-npm": "0.64.48",
152
+ "@gjsify/rolldown-plugin-gjsify": "0.64.48",
153
+ "@gjsify/vite-plugin-blueprint": "0.64.48",
154
+ "@gjsify/rolldown-plugin-pnp": "0.64.48",
155
+ "@gjsify/semver": "0.64.48",
156
+ "@gjsify/tar": "0.64.48",
157
+ "@gjsify/tsc": "0.64.48",
158
+ "@gjsify/utils": "0.64.48",
159
+ "@gjsify/web-polyfills": "0.64.48",
160
+ "@gjsify/workspace": "0.64.48",
161
161
  "acorn": "^8.17.0",
162
162
  "cosmiconfig": "^9.0.2",
163
163
  "get-tsconfig": "^4.14.0",
@@ -166,13 +166,13 @@
166
166
  "yargs": "^18.0.0"
167
167
  },
168
168
  "devDependencies": {
169
- "@gjsify/unit": "0.64.48-next.345",
169
+ "@gjsify/unit": "0.64.48",
170
170
  "@types/yargs": "^17.0.35",
171
171
  "typescript": "^6.0.3"
172
172
  },
173
173
  "peerDependencies": {
174
- "@gjsify/oxfmt-native": "0.64.48-next.345",
175
- "@gjsify/rolldown-native": "0.64.48-next.345"
174
+ "@gjsify/oxfmt-native": "0.64.48",
175
+ "@gjsify/rolldown-native": "0.64.48"
176
176
  },
177
177
  "peerDependenciesMeta": {
178
178
  "@gjsify/oxfmt-native": {
@@ -191,6 +191,5 @@
191
191
  "bugs": {
192
192
  "url": "https://github.com/gjsify/gjsify/issues"
193
193
  },
194
- "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/cli#readme",
195
- "gitHead": "cc5e06f9f2eb646bbca3c28fa107ce48e06f8cd6"
194
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/cli#readme"
196
195
  }