@jujulego/jill 2.2.0-alpha.4 → 2.2.0-alpha.6
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/57.js +1 -1
- package/dist/57.js.map +1 -1
- package/dist/86.js +9 -0
- package/dist/86.js.map +1 -0
- package/dist/commands/exec.d.ts +16 -0
- package/dist/commons/logger/thread.transport.d.ts +10 -0
- package/dist/config/config-options.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/project/workspace.d.ts +2 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/worker-cache.d.ts +4 -0
- package/package.json +12 -9
- package/dist/322.js +0 -9
- package/dist/322.js.map +0 -1
- /package/dist/{322.js.LICENSE.txt → 86.js.LICENSE.txt} +0 -0
package/dist/57.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.id=57,exports.ids=[57],exports.modules={90236:(e,t,s)=>{s.d(t,{F:()=>d});var r=s(25182),n=s(29724),o=s(79060),i=s(85099),a=s(95960),c=s(29921),l=function(e,t){return function(s,r){t(s,r,e)}};let d=class{constructor(e,t){this.manager=e,this.logger=t}command(e,t,s={}){const n={logger:this.logger,...s},o=new r.m("git",[e,...t],{command:e},n);return o.subscribe("stream",(({data:e})=>n.logger.debug(e.toString("utf-8")))),this.manager.add(o),o}branch(e,t){return this.command("branch",e,t)}diff(e,t){return this.command("diff",e,t)}tag(e,t){return this.command("tag",e,t)}isAffected(e,t=[],s){return new Promise(((r,n)=>{const o=this.diff(["--quiet",e,"--",...t],s);o.subscribe("status.done",(()=>r(!1))),o.subscribe("status.failed",(()=>{o.exitCode?r(!0):n(new Error(`Task ${o.name} failed`))}))}))}async listBranches(e=[],t){const s=this.branch(["-l",...e],t),r=[];for await(const e of(0,a.F)(s,"stdout"))r.push(e.replace(/^[ *] /,""));return r}async listTags(e=[],t){const s=this.tag(["-l",...e],t),r=[];for await(const e of(0,a.F)(s,"stdout"))r.push(e);return r}};d=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i}([(0,c.t)(),l(0,(0,n.f)(i.N)),l(1,(0,n.f)(o.Y))],d)},79060:(e,t,s)=>{s.d(t,{D:()=>a,Y:()=>c});var r=s(9),n=s(41429),o=s.n(n),i=s(10466);const a=o().format.combine(o().format.colorize({message:!0,colors:{debug:"grey",verbose:"blue",info:"white",error:"red"}}),o().format.printf((({label:e,message:t,stack:s})=>{s&&(t=r.ZP.red(s));const n=t.split("\n");let o="",i=n[0];e&&(o=" ".repeat(e.length+3),i=`${r.ZP.grey(`[${e}]`)} ${n[0]}`);for(let e=1;e<n.length;++e)i+=`\n${o}${n[e]}`;return i})));class c{}i.nC.bind(c).toDynamicValue((()=>o().createLogger({format:o().format.combine(o().format.timestamp(),o().format.errors({stack:!1})),transports:[new(o().transports.Console)({format:a})]}))).inSingletonScope()},53565:(e,t,s)=>{s.d(t,{V:()=>l});var r=s(36793),n=s(26844),o=s(19694),i=s(29921),a=s(10466),c=s(42561);(0,n.GW)((0,o.b)(),r.n);let l=class extends r.n{_status="stop";_label="";_awakeInk(){a.nC.get(c.I)}spin(e){this._status="spin",this._label=e,this.emit("update.spin",this.state),this._awakeInk()}success(e){this._status="success",this._label=e,this.emit("update.success",this.state),this._awakeInk()}failed(e){this._status="failed",this._label=e,this.emit("update.failed",this.state),this._awakeInk()}stop(){"spin"===this._status&&(this._status="stop",this.emit("update.stop",this.state))}get state(){return{status:this._status,label:this._label}}};l=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i}([(0,i.t)()],l)},77839:(e,t,s)=>{s.d(t,{k:()=>b});var r=s(70612),n=s.n(r),o=s(49411),i=s.n(o),a=s(69670),c=s.n(a),l=s(10466),d=s(79060);const u=Symbol("jujulego:jill:Ajv");l.nC.bind(u).toDynamicValue((()=>{const e=l.nC.get(d.Y);return new(c())({allErrors:!0,logger:e.child({label:"ajv"}),strict:!0})})).inSingletonScope();var f=s(13843),p=s(2925);const h=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","type":"object","additionalProperties":false,"properties":{"jobs":{"type":"number"},"plugins":{"type":"array","items":{"type":"string"}},"verbose":{"type":"string","enum":["info","verbose","debug"]}}}');var g=s(18520);const m=Symbol("jujulego:jill:config-explorer"),y=Symbol("jujulego:jill:config-validator");l.nC.bind(y).toDynamicValue((e=>e.container.get(u).compile(h))).inSingletonScope(),l.nC.bind(m).toDynamicValue((()=>(0,p.oG)("jill",{loaders:{".cjs":e=>(0,g.y)(e).then((e=>e.default)),".js":e=>(0,g.y)(e).then((e=>e.default)),".json":p.Jq[".json"],".yaml":p.Jq[".yaml"],".yml":p.Jq[".yml"],noExt:p.Jq.noExt}}))).inSingletonScope();const b=Symbol("jujulego:jill:config");l.nC.bind(b).toDynamicValue((async function(){const e=l.nC.get(d.Y).child({label:"config"}),t=l.nC.get(f.c),s=l.nC.get(m),r=l.nC.get(y),o=await s.search(),a=o?.config??{};if(t.jobs&&(a.jobs=t.jobs),t.verbose&&(a.verbose=t.verbose),a.jobs??=n().cpus().length-1,!r(a)){const t=l.nC.get(u).errorsText(r.errors,{separator:"\n- ",dataVar:"config"});return e.error(`Errors in config file:\n- ${t}`),process.exit(1),{}}if(o){const t=i().dirname(o.filepath);a.plugins=a.plugins?.map((e=>i().resolve(t,e))),a.verbose&&(l.nC.get(d.Y).level=a.verbose),e.verbose(`Loaded ${o.filepath} config file`)}return e.debug(`Loaded config:\n${JSON.stringify(a,null,2)}`),a})).inSingletonScope()},13843:(e,t,s)=>{s.d(t,{N:()=>c,c:()=>i});var r=s(96678),n=s(65359),o=s(10466);const i=Symbol("jujulego:jill:config-options"),a={1:"verbose",2:"debug"};function c(e){return e.option("verbose",{alias:"v",type:"count",description:"Set verbosity level",coerce:e=>a[Math.min(e,2)]}).option("jobs",{alias:"j",type:"number",description:"Set maximum parallel job number"})}o.nC.bind(i).toDynamicValue((()=>{const e=(0,r.Z)((0,n.bA)(process.argv)).help(!1).version(!1);return c(e),e.parse()})).inSingletonScope()},48652:(e,t,s)=>{s.d(t,{L:()=>a});var r=s(90236),n=s(10466),o=s(79060),i=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i};class a{constructor(e,t,s){this.format=e,this.fallback=t,this.sort=s}async _formatRevision(e){const t=this._logger.child({label:e.name});let s=this.format;s=s.replace(/(?<!\\)((?:\\\\)*)%name/g,`$1${e.name}`),s=s.replace(/\\(.)/g,"$1");const r=this.sort?["--sort",this.sort]:[];if(s.includes("*")){const n=await this._git.listBranches([...r,s],{cwd:e.cwd,logger:t});n.length>0&&(s=n[n.length-1])}if(s.includes("*")){const n=await this._git.listTags([...r,s],{cwd:e.cwd,logger:t});n.length>0&&(s=n[n.length-1])}return s!==this.format&&t.verbose(`Resolved ${this.format} into ${s}`),s.includes("*")?(t.warn(`No revision found matching ${s}, using fallback ${this.fallback}`),this.fallback):s}async test(e){const t=await this._formatRevision(e);return await e.isAffected(t)}}i([(0,n.yT)(o.Y)],a.prototype,"_logger",void 0),i([(0,n.yT)(r.F)],a.prototype,"_git",void 0)},72999:(e,t,s)=>{s.d(t,{B:()=>r});class r{_filters=[];add(e){this._filters.push(e)}async _test(e){for(const t of this._filters)if(!await t.test(e))return!1;return!0}async*filter(e){for await(const t of e)await this._test(t)&&(yield t)}}},40307:(e,t,s)=>{s.d(t,{N:()=>r});class r{constructor(e){this.value=e}test(e){return(e.manifest.private??!1)===this.value}}},84203:(e,t,s)=>{s.d(t,{f:()=>r});class r{constructor(e){this.scripts=e}test(e){const t=Object.keys(e.manifest.scripts||{});return this.scripts.some((e=>t.includes(e)))}}},42561:(e,t,s)=>{s.d(t,{I:()=>a});var r=s(52010),n=s(81119),o=s(10466),i=s(58348);const a=Symbol.for("jujulego:jill:ink-app");o.nC.bind(a).toDynamicValue((()=>(0,n.render)((0,r.jsx)(i.Z,{}),{stdout:process.stdout.isTTY?process.stdout:process.stderr}))).inSingletonScope()},10466:(e,t,s)=>{s.d(t,{nC:()=>o,oV:()=>a,yT:()=>i});var r=s(26403),n=s(44147);s(52866);const o=new r.W,{lazyInject:i,lazyInjectNamed:a}=(0,n.Z)(o)},8754:(e,t,s)=>{s.d(t,{r:()=>l});var r=s(29724),n=s(81632),o=s(53565),i=s(10466),a=s(1284),c=s(97672);let l=class{constructor(e){this.spinner=e}builder(e){return e.option("project",{alias:"p",type:"string",default:process.cwd(),description:"Project root directory"}).option("package-manager",{choices:["yarn","npm"],type:"string",description:"Force package manager"})}async handler(e){try{this.spinner.spin("Loading project ...");const t=e.project=await c.I.searchProjectRoot(e.project);i.nC.bind(c.I).toDynamicValue((()=>new c.I(t,{packageManager:e.packageManager}))).whenTargetNamed(a.W)}finally{this.spinner.stop()}}};var d,u;l=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i}([(0,n.d)(),(d=0,u=(0,r.f)(o.V),function(e,t){u(e,t,d)})],l)},72419:(e,t,s)=>{s.d(t,{S:()=>f});var r=s(29724),n=s(96678),o=s(81632),i=s(53565),a=s(10466),c=s(97672),l=s(1284),d=s(28410),u=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i};let f=class{constructor(e){this.spinner=e}builder(e){return e.option("workspace",{alias:"w",type:"string",desc:"Workspace to use"})}async handler(e){try{this.spinner.spin(`Loading "${e.workspace||"."}" workspace ...`);const t=await this.project.workspace(e.workspace);t?a.nC.bind(d.j).toConstantValue(t).whenTargetNamed(l.W):(this.spinner.failed(`Workspace "${e.workspace||"."}" not found`),n.Z.exit(1,new Error("Workspace not found")))}finally{this.spinner.stop()}}};var p,h;u([(0,c._)()],f.prototype,"project",void 0),f=u([(0,o.d)(),(p=0,h=(0,r.f)(i.V),function(e,t){h(e,t,p)})],f)},39717:(e,t,s)=>{s.d(t,{$f:()=>d,NI:()=>c,_Y:()=>l,mY:()=>u});var r=s(26844),n=s(19694),o=s(81632),i=s(23617);const a=Symbol("jujulego:jill:command-opts"),c=Symbol("jujulego:jill:command");function l(e){const t=Reflect.getMetadata(a,e);if("object"!=typeof t)throw new Error(`No command options found in ${e.name}`);return t}function d(e,t){return{command:t.command,aliases:t.aliases,describe:t.describe,deprecated:t.deprecated,builder:s=>(t.middlewares&&(s=(0,o.S)(s,t.middlewares)),e.builder&&(s=e.builder(s)),s),handler:(...t)=>e.handler(...t)}}function u(e){return t=>{(0,r.GW)((0,n.b)(),t),Reflect.defineMetadata(a,e,t),(0,i.i8)(t,(s=>{s(t).toSelf(),s(c).toDynamicValue((async({container:s})=>d(await s.getAsync(t),e))).whenTargetNamed(e.command.split(" ")[0])}))}}},96729:(e,t,s)=>{s.d(t,{m:()=>l});var r=s(52010),n=s(19694),o=s(42561),i=s(10466),a=s(58348),c=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i};let l=class{builder(e){return e}async handler(e){for await(const t of this.render(e))this.app.rerender((0,r.jsx)(a.Z,{children:t}));return this.app.waitUntilExit()}};c([(0,i.yT)(o.I)],l.prototype,"app",void 0),l=c([(0,n.b)()],l)},81632:(e,t,s)=>{s.d(t,{S:()=>a,d:()=>i});var r=s(26844),n=s(19694),o=s(10466);function i(){return e=>{(0,r.GW)((0,n.b)(),e),o.nC.bind(e).toSelf().inSingletonScope()}}function a(e,t){let s=e;for(const e of t){const t=o.nC.get(e);t.builder&&(s=t.builder(s)),s.middleware((e=>t.handler(e)))}return s}},23617:(e,t,s)=>{s.d(t,{IY:()=>l,JH:()=>i,i8:()=>a,rT:()=>c});var r=s(20328);const n=Symbol("jujulego:jill:module"),o=Symbol("jujulego:jill:registry");function i(e){const t=Reflect.getMetadata(o,e);if("function"!=typeof t)throw new Error(`No registry found in ${e.name}`);return t}function a(e,t){Reflect.defineMetadata(o,t,e)}function c(e,t=!1){let s=Reflect.getMetadata(n,e);if(!(s&&s instanceof r.n)){const n=Reflect.getMetadata(o,e);if("function"!=typeof n){if(t)throw new Error(`No module found in ${e.name}`);return null}s=new r.n(n),l(e,s)}return s}function l(e,t){Reflect.defineMetadata(n,t,e)}},77051:(e,t,s)=>{s.d(t,{B:()=>u});var r=s(29724),n=s(77839),o=s(79060),i=s(10466),a=s(18520),c=s(23617),l=s(29921),d=function(e,t){return function(s,r){t(s,r,e)}};let u=class{constructor(e,t){this._config=e,this._logger=t.child({label:"plugin"})}async _importPlugin(e){this._logger.verbose(`Loading plugin ${e}`);let t=await(0,a.y)(e);for(;t&&"object"==typeof t&&"default"in t;)t=t.default;if(!t)throw new Error(`Invalid plugin ${e}: no plugin class found`);const s=(0,c.rT)(t);if(!s)throw new Error(`Invalid plugin ${e}: invalid plugin class`);return s}async loadPlugins(){if(this._config.plugins)for(const e of this._config.plugins){const t=await this._importPlugin(e);i.nC.load(t)}}};u=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i}([(0,l.t)(),d(0,(0,r.f)(n.k)),d(1,(0,r.f)(o.Y))],u)},75756:(e,t,s)=>{s.d(t,{S:()=>a,p:()=>i});var r=s(20328),n=s(66150),o=s(23617);class i extends r.n{constructor(e,t){super(((...e)=>{for(const t of this.commands)(0,o.JH)(t)(...e)})),this.name=e,this.commands=t,this.id=(0,n.id)()}}function a(e){return t=>{const s=e.name??t.name,r=new i(s,e.commands);(0,o.IY)(t,r)}}},29921:(e,t,s)=>{s.d(t,{t:()=>i});var r=s(26844),n=s(19694),o=s(10466);function i(){return e=>((0,r.GW)((0,n.b)(),e),o.nC.bind(e).toSelf().inSingletonScope(),e)}},1284:(e,t,s)=>{s.d(t,{W:()=>r});const r="current"},97672:(e,t,s)=>{s.d(t,{I:()=>b,_:()=>w});var r=s(15226),n=s(19694),o=s(93977),i=s.n(o),a=s(49411),c=s.n(a),l=s(74782),d=s.n(l),u=s(18799),f=s.n(u),p=s(10466),h=s(79060),g=s(1284),m=s(28410),y=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i};let b=class{constructor(e,t={}){this._root=e,this._names=new Map,this._workspaces=new Map,this._isFullyLoaded=!1,this._lock=new r.H,t.packageManager&&(this._logger.debug(`Forced use of ${t.packageManager} in ${c().relative(process.cwd(),this.root)||"."}`),this._packageManager=t.packageManager)}static async searchProjectRoot(e){const t=p.nC.get(h.Y);let s=!1,r=e;e=c().resolve(e);do{const n=await i().readdir(e);if(n.includes("package.json")&&(r=e,s=!0),["package-lock.json","yarn.lock"].some((e=>n.includes(e))))return t.debug(`Project root found at ${c().relative(process.cwd(),e)||"."}`),e;e=c().dirname(e)}while(e!==c().dirname(e));return s?t.debug(`Project root found at ${c().relative(process.cwd(),r)||"."}`):t.debug(`Project root not found, keeping ${c().relative(process.cwd(),r)||"."}`),r}async _loadManifest(e){const t=c().resolve(this.root,e,"package.json"),s=c().relative(this.root,c().dirname(t)),r=this._logger.child({label:s?`project@${s}`:"project"});r.verbose("Loading package.json ...");const n=await i().readFile(t,"utf-8"),o=JSON.parse(n);return d()(o,(e=>r.verbose(e))),o}async _loadWorkspace(e){return await this._lock.with((async()=>{let t=this._workspaces.get(e);if(!t){const s=await this._loadManifest(e);t=new m.j(e,s,this),this._workspaces.set(e,t),this._names.set(t.name,t)}return t}))}async packageManager(){if(!this._packageManager){const e=await i().readdir(this.root);e.includes("yarn.lock")?(this._logger.debug(`Detected yarn in ${c().relative(process.cwd(),this.root)||"."}`),this._packageManager="yarn"):e.includes("package-lock.json")?(this._logger.debug(`Detected npm in ${c().relative(process.cwd(),this.root)||"."}`),this._packageManager="npm"):(this._logger.debug(`No package manager recognized in ${c().relative(process.cwd(),this.root)||"."}, defaults to npm`),this._packageManager="npm")}return this._packageManager}async mainWorkspace(){if(!this._mainWorkspace){const e=await this._loadManifest(".");this._mainWorkspace=new m.j(".",e,this),this._names.set(this._mainWorkspace.name,this._mainWorkspace)}return this._mainWorkspace}async currentWorkspace(e=process.cwd()){let t=null;e=c().resolve(e);for await(const s of this.workspaces())if(e.startsWith(s.cwd)&&(t=s,s.cwd!==this.root))return s;return t}async*workspaces(){const e=await this.mainWorkspace();if(yield e,this._isFullyLoaded)for(const t of this._names.values())t.name!==e.name&&(yield t);else{const{workspaces:t=[]}=e.manifest;for(const e of t)for(const t of await f()(e,{cwd:this.root}))try{const e=c().resolve(this.root,t);(await i().stat(e)).isDirectory()&&(yield await this._loadWorkspace(t))}catch(e){if("ENOENT"===e.code)continue;throw e}this._isFullyLoaded=!0}}async workspace(e){if(!e){const e=c().relative(this.root,process.cwd());return this._loadWorkspace(e)}const t=this._names.get(e);if(t)return t;if(this._isFullyLoaded)return null;for await(const t of this.workspaces())if(t.name===e)return t;return this._isFullyLoaded=!0,null}get root(){return c().resolve(this._root)}};function w(){return(0,p.oV)(b,g.W)}y([(0,p.yT)(h.Y)],b.prototype,"_logger",void 0),b=y([(0,n.b)()],b)},28410:(e,t,s)=>{s.d(t,{I:()=>g,j:()=>h});var r=s(25182),n=s(19694),o=s(49411),i=s.n(o),a=s(67329),c=s(90236),l=s(10466),d=s(79060),u=s(95960),f=s(1284),p=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i};let h=class{constructor(e,t,s){this._cwd=e,this.manifest=t,this.project=s,this._affectedCache=new Map,this._tasks=new Map;const r=l.nC.get(d.Y);this._logger=r.child({label:this.manifest.name})}_satisfies(e,t){return t.startsWith("file:")?i().resolve(e.cwd,t.substring(5))===this.cwd:(t.startsWith("workspace:")&&(t=t.substring(10)),!this.version||(0,a.satisfies)(this.version,t))}async _buildDependencies(e,t="all"){const s=[];switch(t){case"all":s.unshift(this.devDependencies());case"prod":s.unshift(this.dependencies())}for await(const t of(0,u.$)(...s)){const s=await t.build();s&&e.dependsOn(s)}}async _isAffected(e){if(await this._git.isAffected(e,[this.cwd],{cwd:this.project.root,logger:this._logger}))return!0;const t=[];for await(const s of(0,u.$)(this.dependencies(),this.devDependencies()))t.push(s.isAffected(e));return(await Promise.all(t)).some((e=>e))}async isAffected(e){let t=this._affectedCache.get(e);return t||(t=this._isAffected(e),this._affectedCache.set(e,t)),await t}async*_loadDependencies(e,t){for(const[s,r]of Object.entries(e)){const e=await this.project.workspace(s);e&&(e._satisfies(this,r)?yield e:this._logger.verbose(`Ignoring ${t} ${e.reference} as it does not match requirement ${r}`))}}async*dependencies(){if(this.manifest.dependencies)for await(const e of this._loadDependencies(this.manifest.dependencies,"dependency"))yield e}async*devDependencies(){if(this.manifest.devDependencies)for await(const e of this._loadDependencies(this.manifest.devDependencies,"devDependency"))yield e}async _streamLogs(e,t,s){try{for await(const r of(0,u.F)(e,t))this._logger.log(s,r,{label:`${this.name}#${e.context.script}`})}catch(s){s&&this._logger.warn(`Error while streaming task ${t}`,s,{label:`${this.name}#${e.context.script}`})}}async run(e,t=[],s={}){let n=this._tasks.get(e);if(!n){const o=await this.project.packageManager();n=new r.m(o,["run",e,...t],{workspace:this,script:e},{...s,cwd:this.cwd,logger:this._logger.child({label:`${this.name}#${e}`}),env:{FORCE_COLOR:"1",...s.env}}),this._streamLogs(n,"stdout","info"),this._streamLogs(n,"stderr","info"),await this._buildDependencies(n,s.buildDeps),this._tasks.set(e,n)}return n}async build(e){const{scripts:t={}}=this.manifest;return t.build?await this.run("build",[],e):(this._logger.warn("Will not be built (no build script)"),null)}toJSON(){return{name:this.name,version:this.version,cwd:this.cwd}}get name(){return this.manifest.name}get version(){return this.manifest.version}get reference(){return this.version?`${this.name}@${this.version}`:this.name}get cwd(){return i().resolve(this.project.root,this._cwd)}};function g(){return(0,l.oV)(h,f.W)}p([(0,l.yT)(c.F)],h.prototype,"_git",void 0),h=p([(0,n.b)()],h)},3678:(e,t,s)=>{s.d(t,{P:()=>d});var r=s(78523),n=s(76259),o=s(73480),i=s.n(o),a=s(79060),c=s(29724),l=s(29921);let d=class{static isTaskNode(e){return"script"in e}constructor(e){this._logger=e}_lexer(){return i().states({task:{lparen:"(",whitespace:/[ \t]+/,string:[{match:/[:a-zA-Z0-9]+/,push:"operator"},{match:/'(?:\\['\\]|[^\n'\\])+'/,push:"operator",value:e=>e.slice(1,-1).replace(/\\(['\\])/g,"$1")},{match:/"(?:\\["\\]|[^\n"\\])+"/,push:"operator",value:e=>e.slice(1,-1).replace(/\\(["\\])/g,"$1")}]},operator:{whitespace:/[ \t]+/,rparen:")",operator:{match:["->","//"],pop:1}}})}_nextNode(e,t=0){let s=null;for(const r of e){if("whitespace"===r.type)continue;if("rparen"===r.type)break;if("operator"===r.type){const t=r.value;if(s){if(d.isTaskNode(s)){s={operator:t,tasks:[s]};continue}s.operator!==t&&(s={operator:t,tasks:[s]});continue}throw new Error(e.formatError(r,"Unexpected operator"))}let n;if("string"===r.type)n={script:r.value};else{if("lparen"!==r.type)throw new Error(e.formatError(r,"Unexpected token"));{const s=this._nextNode(e,t+1);if(!s)throw new Error(e.formatError(r,"Empty group found"));n=s}}if(s){if(d.isTaskNode(s))throw new Error(e.formatError(r,"Unexpected token, expected an operator"));s.tasks.push(n)}else s=n}return s}parse(e){const t=this._lexer().reset(e),s={roots:[]};for(;;){const e=this._nextNode(t);if(!e)break;s.roots.push(e)}return s}async buildTask(e,t,s){if(d.isTaskNode(e))return t.run(e.script,[],s);{let o;o="//"===e.operator?new r.W("In parallel",{},{logger:this._logger}):new n.h("In sequence",{},{logger:this._logger});for(const r of e.tasks)o.add(await this.buildTask(r,t,s));return o}}};var u,f;d=function(e,t,s,r){var n,o=arguments.length,i=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,s,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,s,i):n(t,s))||i);return o>3&&i&&Object.defineProperty(t,s,i),i}([(0,l.t)(),(u=0,f=(0,c.f)(a.Y),function(e,t){f(e,t,u)})],d)},85099:(e,t,s)=>{s.d(t,{N:()=>a});var r=s(99625),n=s(79060),o=s(77839),i=s(10466);const a=Symbol("jujulego:jill:TaskManager");i.nC.bind(a).toDynamicValue((e=>{const t=e.container.get(o.k),s=e.container.get(n.Y);return new r.q({jobs:t.jobs,logger:s})})).inSingletonScope()},36872:(e,t,s)=>{s.d(t,{Z:()=>c});var r=s(52010),n=s(50397),o=s(81119),i=s(76687),a=s(76797);function c({group:e}){const[t,s]=(0,i.useState)([...e.tasks]);return(0,i.useLayoutEffect)((()=>{let t=!1;return e.subscribe("task.added",(()=>{t||(t=!0,queueMicrotask((()=>{s([...e.tasks]),t=!1})))}))}),[e]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{task:e}),(0,r.jsx)(o.Box,{flexDirection:"column",marginLeft:2,children:t.map((e=>(0,r.jsx)(i.Fragment,{children:e instanceof n.O?(0,r.jsx)(c,{group:e}):(0,r.jsx)(a.Z,{task:e})},e.id)))})]})}},58348:(e,t,s)=>{s.d(t,{Z:()=>b});var r=s(52010),n=s(81119),o=s(96122),i=s(40427),a=s(76687),c=s(10466),l=s(53565);function d(){const[e,t]=(0,a.useState)({status:"stop",label:""});switch((0,a.useLayoutEffect)((()=>{const e=c.nC.get(l.V);return t(e.state),e.subscribe("update",t)}),[]),e.status){case"spin":return(0,r.jsxs)(n.Text,{children:[(0,r.jsx)(o.Z,{})," "+e.label]});case"success":return(0,r.jsxs)(n.Text,{color:"green",children:[i.Z.success," ",e.label]});case"failed":return(0,r.jsxs)(n.Text,{color:"red",children:[i.Z.error," ",e.label]});default:return null}}var u=s(41429),f=s.n(u),p=s(86709),h=s.n(p),g=s(79060);const m=Symbol.for("message");function y(){const{write:e}=(0,n.useStderr)();return(0,a.useLayoutEffect)((()=>{const t=c.nC.get(g.Y);for(const e of t.transports)e instanceof f().transports.Console&&t.remove(e);const s=new class extends(h()){constructor(){super({format:g.D})}log(t,s){setTimeout((()=>{this.emit("logged",t)}),0),e(t[m]+"\n"),s()}};return t.add(s),()=>{t.remove(s),t.add(new(f().transports.Console)({format:g.D}))}}),[e]),null}function b({children:e}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y,{}),(0,r.jsx)(d,{}),e]})}},75740:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(52010),n=s(81119),o=s(46379);function i({items:e,headers:t}){return 0===e.length?null:(0,r.jsx)(n.Box,{children:Object.keys(e[0]).map((s=>(0,r.jsxs)(n.Box,{flexDirection:"column",marginRight:2,children:[t&&(0,r.jsx)(n.Text,{bold:!0,children:(0,o.k)(s)}),e.map(((e,t)=>(0,r.jsx)(n.Text,{children:e[s]||" "},t)))]},s)))})}},4887:(e,t,s)=>{s.d(t,{Z:()=>c});var r=s(52010),n=s(50397),o=s(76687),i=s(36872),a=s(76797);function c({manager:e}){const[t,s]=(0,o.useState)(e.tasks.filter((e=>!e.group)));return(0,o.useLayoutEffect)((()=>{let t=!1;return e.subscribe("added",(()=>{t||(t=!0,queueMicrotask((()=>{s(e.tasks.filter((e=>!e.group))),t=!1})))}))}),[e]),(0,r.jsx)(r.Fragment,{children:t.map((e=>e instanceof n.O?(0,r.jsx)(i.Z,{group:e},e.id):(0,r.jsx)(a.Z,{task:e},e.id)))})}},51562:(e,t,s)=>{s.d(t,{Z:()=>o});var r=s(52010),n=s(81119);function o({task:e}){return"workspace"in e.context?(0,r.jsxs)(n.Text,{children:["Running ",(0,r.jsx)(n.Text,{bold:!0,children:e.context.script})," in ",e.context.workspace.name]}):(0,r.jsx)(n.Text,{children:e.name})}},76797:(e,t,s)=>{s.d(t,{Z:()=>d});var r=s(52010),n=s(81119),o=s(96122),i=s(40427),a=s(21061),c=s(76687),l=s(51562);function d({task:e}){const[t,s]=(0,c.useState)(e.status),[d,u]=(0,c.useState)(0);switch((0,c.useLayoutEffect)((()=>e.subscribe("status",(e=>{s(e.status)}))),[e]),(0,c.useLayoutEffect)((()=>e.subscribe("completed",(({duration:e})=>{u(e)}))),[e]),t){case"blocked":case"ready":return(0,r.jsxs)(n.Text,{color:"grey",children:[(0,r.jsx)(o.Z,{type:"line2"})," ",(0,r.jsx)(l.Z,{task:e})]});case"running":return(0,r.jsxs)(n.Text,{children:[(0,r.jsx)(o.Z,{})," ",(0,r.jsx)(l.Z,{task:e})]});case"done":return(0,r.jsxs)(n.Text,{children:[(0,r.jsxs)(n.Text,{color:"green",children:[i.Z.success," ",(0,r.jsx)(l.Z,{task:e})]}),(0,r.jsxs)(n.Text,{color:"magenta",children:[" ","(took ",(0,a.Z)(d),")"]})]});case"failed":return(0,r.jsxs)(n.Text,{children:[(0,r.jsxs)(n.Text,{color:"red",children:[i.Z.error," ",(0,r.jsx)(l.Z,{task:e})]}),(0,r.jsxs)(n.Text,{color:"magenta",children:[" ","(took ",(0,a.Z)(d),")"]})]})}}},66238:(e,t,s)=>{s.d(t,{Z:()=>a});var r=s(52010),n=s(81119),o=s(76687);const i=e=>({color:e?"blue":""});function a(e){const{workspace:t,dev:s=!1,level:c=""}=e,[l,d]=(0,o.useState)([]);return(0,o.useEffect)((()=>{(async()=>{const e=[];for await(const s of t.dependencies())e.push([s,null]);for await(const s of t.devDependencies())e.push([s,!0]);d(e)})()}),[t]),(0,r.jsxs)(n.Text,{children:[(0,r.jsx)(n.Text,{...i(s),children:t.name}),t.version&&(0,r.jsxs)(n.Text,{color:"grey",children:["@",t.version]}),l.length>0&&(0,r.jsx)(n.Newline,{}),l.map((([e,t],o)=>(0,r.jsxs)(n.Text,{children:[c,(0,r.jsxs)(n.Text,{...i(s),children:[o===l.length-1?"└":"├","─"," "]}),(0,r.jsx)(a,{workspace:e,dev:t??s,level:(0,r.jsxs)(r.Fragment,{children:[c,(0,r.jsxs)(n.Text,{...i(s),children:[o===l.length-1?" ":"│"," "]})]})}),o<l.length-1&&(0,r.jsx)(n.Newline,{})]},e.name)))]})}},18520:(e,t,s)=>{async function r(e){return import("win32"===process.platform?`file://${e}`:e)}s.d(t,{y:()=>r})},55472:(e,t,s)=>{function r(e,t=process.stdout){t.isTTY?t.write(JSON.stringify(e,null,2)):t.write(JSON.stringify(e))}s.d(t,{i:()=>r})},95960:(e,t,s)=>{s.d(t,{$:()=>n,F:()=>o});var r=s(94415);async function*n(...e){for(const t of e)yield*t}async function*o(e,t){const s=new AbortController,n=new Error("aborted");e.subscribe("completed",(()=>s.abort(n)));let o="";try{for await(const n of(0,r.Vq)(e,`stream.${t}`,{signal:s.signal})){const e=(o+n.data.toString("utf-8")).split(/\r?\n/);o=e.pop()??"";for(const t of e)yield t}}catch(e){if(e!==n)throw e;o&&(yield o)}}},46379:(e,t,s)=>{function r(e){return e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()}s.d(t,{k:()=>r})}};
|
|
1
|
+
"use strict";exports.id=57,exports.ids=[57],exports.modules={90236:(e,t,n)=>{n.d(t,{F:()=>d});var s=n(25182),r=n(29724),o=n(62429),a=n(85099),i=n(95960),c=n(29921),l=function(e,t){return function(n,s){t(n,s,e)}};let d=class{constructor(e,t){this.manager=e,this.logger=t}command(e,t,n={}){const r={logger:this.logger,...n},o=new s.m("git",[e,...t],{command:e},r);return o.subscribe("stream",(({data:e})=>r.logger.debug(e.toString("utf-8")))),this.manager.add(o),o}branch(e,t){return this.command("branch",e,t)}diff(e,t){return this.command("diff",e,t)}tag(e,t){return this.command("tag",e,t)}isAffected(e,t=[],n){return new Promise(((s,r)=>{const o=this.diff(["--quiet",e,"--",...t],n);o.subscribe("status.done",(()=>s(!1))),o.subscribe("status.failed",(()=>{o.exitCode?s(!0):r(new Error(`Task ${o.name} failed`))}))}))}async listBranches(e=[],t){const n=this.branch(["-l",...e],t),s=[];for await(const e of(0,i.F)(n,"stdout"))s.push(e.replace(/^[ *] /,""));return s}async listTags(e=[],t){const n=this.tag(["-l",...e],t),s=[];for await(const e of(0,i.F)(n,"stdout"))s.push(e);return s}};d=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(0,c.t)(),l(0,(0,r.f)(a.N)),l(1,(0,r.f)(o.Y))],d)},62429:(e,t,n)=>{n.d(t,{Y:()=>p,D:()=>f});var s=n(9),r=n(41429),o=n.n(r),a=n(24086),i=n.n(a),c=n(10466),l=n(86709),d=n.n(l);class u extends(d()){constructor(e){super({level:"debug"}),this.channel=new a.BroadcastChannel(e),this.channel.onmessageerror=e=>{this.emit("error",e)},this.channel.unref()}log(e,t){this.channel.postMessage(e),this.emit("logged",e),t()}close(e){this.channel.close(),e&&e(),this.emit("closed")}}const f=o().format.combine(o().format.colorize({message:!0,colors:{debug:"grey",verbose:"blue",info:"white",error:"red"}}),o().format.printf((({label:e,message:t,stack:n})=>{n&&(t=s.ZP.red(n));const r=t.split("\n");let o="",a=r[0];e&&(o=" ".repeat(e.length+3),a=`${s.ZP.grey(`[${e}]`)} ${r[0]}`);for(let e=1;e<r.length;++e)a+=`\n${o}${r[e]}`;return a})));class p{}c.nC.bind(p).toDynamicValue((()=>{const e=o().createLogger({format:o().format.combine(o().format.timestamp(),o().format.errors({stack:!1})),transports:[]});if(i().isMainThread){e.add(new(o().transports.Console)({format:f}));const t=new(i().BroadcastChannel)("jujulego:jill:logger");t.onmessage=t=>e.log(t.data),t.unref()}else e.add(new u("jujulego:jill:logger"));return e})).inSingletonScope()},53565:(e,t,n)=>{n.d(t,{V:()=>l});var s=n(36793),r=n(26844),o=n(19694),a=n(29921),i=n(10466),c=n(42561);(0,r.GW)((0,o.b)(),s.n);let l=class extends s.n{_status="stop";_label="";_awakeInk(){i.nC.get(c.I)}spin(e){this._status="spin",this._label=e,this.emit("update.spin",this.state),this._awakeInk()}success(e){this._status="success",this._label=e,this.emit("update.success",this.state),this._awakeInk()}failed(e){this._status="failed",this._label=e,this.emit("update.failed",this.state),this._awakeInk()}stop(){"spin"===this._status&&(this._status="stop",this.emit("update.stop",this.state))}get state(){return{status:this._status,label:this._label}}};l=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(0,a.t)()],l)},77839:(e,t,n)=>{n.d(t,{k:()=>w});var s=n(70612),r=n.n(s),o=n(49411),a=n.n(o),i=n(69670),c=n.n(i),l=n(10466),d=n(62429);const u=Symbol("jujulego:jill:Ajv");l.nC.bind(u).toDynamicValue((()=>{const e=l.nC.get(d.Y);return new(c())({allErrors:!0,logger:e.child({label:"ajv"}),strict:!0})})).inSingletonScope();var f=n(82180),p=n(13843),h=n(96329);const g=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","type":"object","additionalProperties":false,"properties":{"jobs":{"type":"number"},"plugins":{"type":"array","items":{"type":"string"}},"verbose":{"type":"string","enum":["info","verbose","debug"]}}}');var m=n(18520);const y=Symbol("jujulego:jill:config-explorer"),b=Symbol("jujulego:jill:config-validator");l.nC.bind(b).toDynamicValue((e=>e.container.get(u).compile(g))).inSingletonScope(),l.nC.bind(y).toDynamicValue((()=>(0,h.oG)("jill",{loaders:{".cjs":e=>(0,m.y)(e).then((e=>e.default)),".js":e=>(0,m.y)(e).then((e=>e.default)),".json":h.Jq[".json"],".yaml":h.Jq[".yaml"],".yml":h.Jq[".yml"],noExt:h.Jq.noExt}}))).inSingletonScope();const w=Symbol("jujulego:jill:config");async function j(){const e=l.nC.get(d.Y).child({label:"config"}),t=l.nC.get(p.c),n=l.nC.get(y),s=l.nC.get(b),o=await n.search(),i=o?.config??{};if(t.jobs&&(i.jobs=t.jobs),t.verbose&&(i.verbose=t.verbose),i.jobs??=r().cpus().length-1,!s(i)){const t=l.nC.get(u).errorsText(s.errors,{separator:"\n- ",dataVar:"config"});return e.error(`Errors in config file:\n- ${t}`),process.exit(1),{}}if(o){const t=a().dirname(o.filepath);i.plugins=i.plugins?.map((e=>a().resolve(t,e))),i.verbose&&(l.nC.get(d.Y).level=i.verbose),e.verbose(`Loaded ${o.filepath} config file`)}return e.debug(`Loaded config:\n${JSON.stringify(i,null,2)}`),i}l.nC.bind(w).toDynamicValue((async()=>await(0,f.F)("jujulego:jill:config",j))).inSingletonScope()},13843:(e,t,n)=>{n.d(t,{N:()=>c,c:()=>a});var s=n(98687),r=n(14281),o=n(10466);const a=Symbol("jujulego:jill:config-options"),i={1:"verbose",2:"debug"};function c(e){return e.option("verbose",{alias:"v",type:"count",description:"Set verbosity level",coerce:e=>i[Math.min(e,2)]}).option("jobs",{alias:"j",type:"number",description:"Set maximum parallel job number"})}o.nC.bind(a).toDynamicValue((()=>{const e=(0,s.Z)((0,r.bA)(process.argv)).help(!1).version(!1);return c(e),e.parse()})).inSingletonScope()},48652:(e,t,n)=>{n.d(t,{L:()=>i});var s=n(90236),r=n(10466),o=n(62429),a=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};class i{constructor(e,t,n){this.format=e,this.fallback=t,this.sort=n}async _formatRevision(e){const t=this._logger.child({label:e.name});let n=this.format;n=n.replace(/(?<!\\)((?:\\\\)*)%name/g,`$1${e.name}`),n=n.replace(/\\(.)/g,"$1");const s=this.sort?["--sort",this.sort]:[];if(n.includes("*")){const r=await this._git.listBranches([...s,n],{cwd:e.cwd,logger:t});r.length>0&&(n=r[r.length-1])}if(n.includes("*")){const r=await this._git.listTags([...s,n],{cwd:e.cwd,logger:t});r.length>0&&(n=r[r.length-1])}return n!==this.format&&t.verbose(`Resolved ${this.format} into ${n}`),n.includes("*")?(t.warn(`No revision found matching ${n}, using fallback ${this.fallback}`),this.fallback):n}async test(e){const t=await this._formatRevision(e);return await e.isAffected(t)}}a([(0,r.yT)(o.Y)],i.prototype,"_logger",void 0),a([(0,r.yT)(s.F)],i.prototype,"_git",void 0)},72999:(e,t,n)=>{n.d(t,{B:()=>s});class s{_filters=[];add(e){this._filters.push(e)}async _test(e){for(const t of this._filters)if(!await t.test(e))return!1;return!0}async*filter(e){for await(const t of e)await this._test(t)&&(yield t)}}},40307:(e,t,n)=>{n.d(t,{N:()=>s});class s{constructor(e){this.value=e}test(e){return(e.manifest.private??!1)===this.value}}},84203:(e,t,n)=>{n.d(t,{f:()=>s});class s{constructor(e){this.scripts=e}test(e){const t=Object.keys(e.manifest.scripts||{});return this.scripts.some((e=>t.includes(e)))}}},42561:(e,t,n)=>{n.d(t,{I:()=>l});var s=n(52010),r=n(81119),o=n(24086),a=n.n(o),i=n(10466),c=n(58348);const l=Symbol.for("jujulego:jill:ink-app");i.nC.bind(l).toDynamicValue((()=>{if(!a().isMainThread)throw new Error("Ink should only be used in main thread");return(0,r.render)((0,s.jsx)(c.Z,{}),{stdout:process.stdout.isTTY?process.stdout:process.stderr})})).inSingletonScope()},10466:(e,t,n)=>{n.d(t,{nC:()=>o,oV:()=>i,yT:()=>a});var s=n(26403),r=n(44147);n(52866);const o=new s.W,{lazyInject:a,lazyInjectNamed:i}=(0,r.Z)(o)},8754:(e,t,n)=>{n.d(t,{r:()=>l});var s=n(29724),r=n(81632),o=n(53565),a=n(10466),i=n(1284),c=n(97672);let l=class{constructor(e){this.spinner=e}builder(e){return e.option("project",{alias:"p",type:"string",default:process.cwd(),description:"Project root directory"}).option("package-manager",{choices:["yarn","npm"],type:"string",description:"Force package manager"})}async handler(e){try{this.spinner.spin("Loading project ...");const t=e.project=await c.I.searchProjectRoot(e.project);a.nC.bind(c.I).toDynamicValue((()=>new c.I(t,{packageManager:e.packageManager}))).whenTargetNamed(i.W)}finally{this.spinner.stop()}}};var d,u;l=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(0,r.d)(),(d=0,u=(0,s.f)(o.V),function(e,t){u(e,t,d)})],l)},72419:(e,t,n)=>{n.d(t,{S:()=>f});var s=n(29724),r=n(98687),o=n(81632),a=n(53565),i=n(10466),c=n(97672),l=n(1284),d=n(28410),u=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let f=class{constructor(e){this.spinner=e}builder(e){return e.option("workspace",{alias:"w",type:"string",desc:"Workspace to use"})}async handler(e){try{this.spinner.spin(`Loading "${e.workspace||"."}" workspace ...`);const t=await this.project.workspace(e.workspace);t?i.nC.bind(d.j).toConstantValue(t).whenTargetNamed(l.W):(this.spinner.failed(`Workspace "${e.workspace||"."}" not found`),r.Z.exit(1,new Error("Workspace not found")))}finally{this.spinner.stop()}}};var p,h;u([(0,c._)()],f.prototype,"project",void 0),f=u([(0,o.d)(),(p=0,h=(0,s.f)(a.V),function(e,t){h(e,t,p)})],f)},39717:(e,t,n)=>{n.d(t,{$f:()=>d,NI:()=>c,_Y:()=>l,mY:()=>u});var s=n(26844),r=n(19694),o=n(81632),a=n(23617);const i=Symbol("jujulego:jill:command-opts"),c=Symbol("jujulego:jill:command");function l(e){const t=Reflect.getMetadata(i,e);if("object"!=typeof t)throw new Error(`No command options found in ${e.name}`);return t}function d(e,t){return{command:t.command,aliases:t.aliases,describe:t.describe,deprecated:t.deprecated,builder:n=>(t.middlewares&&(n=(0,o.S)(n,t.middlewares)),e.builder&&(n=e.builder(n)),n),handler:(...t)=>e.handler(...t)}}function u(e){return t=>{(0,s.GW)((0,r.b)(),t),Reflect.defineMetadata(i,e,t),(0,a.i8)(t,(n=>{n(t).toSelf(),n(c).toDynamicValue((async({container:n})=>d(await n.getAsync(t),e))).whenTargetNamed(e.command.split(" ")[0])}))}}},96729:(e,t,n)=>{n.d(t,{m:()=>l});var s=n(52010),r=n(19694),o=n(42561),a=n(10466),i=n(58348),c=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let l=class{builder(e){return e}async handler(e){for await(const t of this.render(e))this.app.rerender((0,s.jsx)(i.Z,{children:t}));return this.app.waitUntilExit()}};c([(0,a.yT)(o.I)],l.prototype,"app",void 0),l=c([(0,r.b)()],l)},81632:(e,t,n)=>{n.d(t,{S:()=>i,d:()=>a});var s=n(26844),r=n(19694),o=n(10466);function a(){return e=>{(0,s.GW)((0,r.b)(),e),o.nC.bind(e).toSelf().inSingletonScope()}}function i(e,t){let n=e;for(const e of t){const t=o.nC.get(e);t.builder&&(n=t.builder(n)),n.middleware((e=>t.handler(e)))}return n}},23617:(e,t,n)=>{n.d(t,{IY:()=>l,JH:()=>a,i8:()=>i,rT:()=>c});var s=n(20328);const r=Symbol("jujulego:jill:module"),o=Symbol("jujulego:jill:registry");function a(e){const t=Reflect.getMetadata(o,e);if("function"!=typeof t)throw new Error(`No registry found in ${e.name}`);return t}function i(e,t){Reflect.defineMetadata(o,t,e)}function c(e,t=!1){let n=Reflect.getMetadata(r,e);if(!(n&&n instanceof s.n)){const r=Reflect.getMetadata(o,e);if("function"!=typeof r){if(t)throw new Error(`No module found in ${e.name}`);return null}n=new s.n(r),l(e,n)}return n}function l(e,t){Reflect.defineMetadata(r,t,e)}},77051:(e,t,n)=>{n.d(t,{B:()=>u});var s=n(29724),r=n(77839),o=n(62429),a=n(10466),i=n(18520),c=n(23617),l=n(29921),d=function(e,t){return function(n,s){t(n,s,e)}};let u=class{constructor(e,t){this._config=e,this._logger=t.child({label:"plugin"})}async _importPlugin(e){this._logger.verbose(`Loading plugin ${e}`);let t=await(0,i.y)(e);for(;t&&"object"==typeof t&&"default"in t;)t=t.default;if(!t)throw new Error(`Invalid plugin ${e}: no plugin class found`);const n=(0,c.rT)(t);if(!n)throw new Error(`Invalid plugin ${e}: invalid plugin class`);return n}async loadPlugins(){if(this._config.plugins)for(const e of this._config.plugins){const t=await this._importPlugin(e);a.nC.load(t)}}};u=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(0,l.t)(),d(0,(0,s.f)(r.k)),d(1,(0,s.f)(o.Y))],u)},75756:(e,t,n)=>{n.d(t,{S:()=>i,p:()=>a});var s=n(20328),r=n(66150),o=n(23617);class a extends s.n{constructor(e,t){super(((...e)=>{for(const t of this.commands)(0,o.JH)(t)(...e)})),this.name=e,this.commands=t,this.id=(0,r.id)()}}function i(e){return t=>{const n=e.name??t.name,s=new a(n,e.commands);(0,o.IY)(t,s)}}},29921:(e,t,n)=>{n.d(t,{t:()=>a});var s=n(26844),r=n(19694),o=n(10466);function a(){return e=>((0,s.GW)((0,r.b)(),e),o.nC.bind(e).toSelf().inSingletonScope(),e)}},1284:(e,t,n)=>{n.d(t,{W:()=>s});const s="current"},97672:(e,t,n)=>{n.d(t,{I:()=>b,_:()=>w});var s=n(15226),r=n(19694),o=n(93977),a=n.n(o),i=n(49411),c=n.n(i),l=n(74782),d=n.n(l),u=n(18799),f=n.n(u),p=n(10466),h=n(62429),g=n(1284),m=n(28410),y=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let b=class{constructor(e,t={}){this._root=e,this._names=new Map,this._workspaces=new Map,this._isFullyLoaded=!1,this._lock=new s.H,t.packageManager&&(this._logger.debug(`Forced use of ${t.packageManager} in ${c().relative(process.cwd(),this.root)||"."}`),this._packageManager=t.packageManager)}static async searchProjectRoot(e){const t=p.nC.get(h.Y);let n=!1,s=e;e=c().resolve(e);do{const r=await a().readdir(e);if(r.includes("package.json")&&(s=e,n=!0),["package-lock.json","yarn.lock"].some((e=>r.includes(e))))return t.debug(`Project root found at ${c().relative(process.cwd(),e)||"."}`),e;e=c().dirname(e)}while(e!==c().dirname(e));return n?t.debug(`Project root found at ${c().relative(process.cwd(),s)||"."}`):t.debug(`Project root not found, keeping ${c().relative(process.cwd(),s)||"."}`),s}async _loadManifest(e){const t=c().resolve(this.root,e,"package.json"),n=c().relative(this.root,c().dirname(t)),s=this._logger.child({label:n?`project@${n}`:"project"});s.verbose("Loading package.json ...");const r=await a().readFile(t,"utf-8"),o=JSON.parse(r);return d()(o,(e=>s.verbose(e))),o}async _loadWorkspace(e){return await this._lock.with((async()=>{let t=this._workspaces.get(e);if(!t){const n=await this._loadManifest(e);t=new m.j(e,n,this),this._workspaces.set(e,t),this._names.set(t.name,t)}return t}))}async packageManager(){if(!this._packageManager){const e=await a().readdir(this.root);e.includes("yarn.lock")?(this._logger.debug(`Detected yarn in ${c().relative(process.cwd(),this.root)||"."}`),this._packageManager="yarn"):e.includes("package-lock.json")?(this._logger.debug(`Detected npm in ${c().relative(process.cwd(),this.root)||"."}`),this._packageManager="npm"):(this._logger.debug(`No package manager recognized in ${c().relative(process.cwd(),this.root)||"."}, defaults to npm`),this._packageManager="npm")}return this._packageManager}async mainWorkspace(){if(!this._mainWorkspace){const e=await this._loadManifest(".");this._mainWorkspace=new m.j(".",e,this),this._names.set(this._mainWorkspace.name,this._mainWorkspace)}return this._mainWorkspace}async currentWorkspace(e=process.cwd()){let t=null;e=c().resolve(e);for await(const n of this.workspaces())if(e.startsWith(n.cwd)&&(t=n,n.cwd!==this.root))return n;return t}async*workspaces(){const e=await this.mainWorkspace();if(yield e,this._isFullyLoaded)for(const t of this._names.values())t.name!==e.name&&(yield t);else{const{workspaces:t=[]}=e.manifest;for(const e of t)for(const t of await f()(e,{cwd:this.root}))try{const e=c().resolve(this.root,t);(await a().stat(e)).isDirectory()&&(yield await this._loadWorkspace(t))}catch(e){if("ENOENT"===e.code)continue;throw e}this._isFullyLoaded=!0}}async workspace(e){if(!e){const e=c().relative(this.root,process.cwd());return this._loadWorkspace(e)}const t=this._names.get(e);if(t)return t;if(this._isFullyLoaded)return null;for await(const t of this.workspaces())if(t.name===e)return t;return this._isFullyLoaded=!0,null}get root(){return c().resolve(this._root)}};function w(){return(0,p.oV)(b,g.W)}y([(0,p.yT)(h.Y)],b.prototype,"_logger",void 0),b=y([(0,r.b)()],b)},28410:(e,t,n)=>{n.d(t,{I:()=>g,j:()=>h});var s=n(25182),r=n(19694),o=n(49411),a=n.n(o),i=n(67329),c=n(90236),l=n(10466),d=n(62429),u=n(95960),f=n(1284),p=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let h=class{constructor(e,t,n){this._cwd=e,this.manifest=t,this.project=n,this._affectedCache=new Map,this._tasks=new Map;const s=l.nC.get(d.Y);this._logger=s.child({label:this.manifest.name})}_satisfies(e,t){return t.startsWith("file:")?a().resolve(e.cwd,t.substring(5))===this.cwd:(t.startsWith("workspace:")&&(t=t.substring(10)),!this.version||(0,i.satisfies)(this.version,t))}async _buildDependencies(e,t="all"){const n=[];switch(t){case"all":n.unshift(this.devDependencies());case"prod":n.unshift(this.dependencies())}for await(const t of(0,u.$)(...n)){const n=await t.build();n&&e.dependsOn(n)}}async _isAffected(e){if(await this._git.isAffected(e,[this.cwd],{cwd:this.project.root,logger:this._logger}))return!0;const t=[];for await(const n of(0,u.$)(this.dependencies(),this.devDependencies()))t.push(n.isAffected(e));return(await Promise.all(t)).some((e=>e))}async isAffected(e){let t=this._affectedCache.get(e);return t||(t=this._isAffected(e),this._affectedCache.set(e,t)),await t}async*_loadDependencies(e,t){for(const[n,s]of Object.entries(e)){const e=await this.project.workspace(n);e&&(e._satisfies(this,s)?yield e:this._logger.verbose(`Ignoring ${t} ${e.reference} as it does not match requirement ${s}`))}}async*dependencies(){if(this.manifest.dependencies)for await(const e of this._loadDependencies(this.manifest.dependencies,"dependency"))yield e}async*devDependencies(){if(this.manifest.devDependencies)for await(const e of this._loadDependencies(this.manifest.devDependencies,"devDependency"))yield e}async _streamLogs(e,{stream:t,level:n,label:s}){try{for await(const r of(0,u.F)(e,t))this._logger.log(n,r,{label:s})}catch(e){e&&this._logger.warn(`Error while streaming task ${t}`,e,{label:s})}}async exec(e,t=[],n={}){const{loggerLabel:r=`${this.name}$${e}`}=n,o=new s.m(e,t,{workspace:this,script:e},{...n,cwd:this.cwd,logger:this._logger.child({label:r}),env:{FORCE_COLOR:"1",...n.env}});return this._streamLogs(o,{stream:"stdout",level:"info",label:r}),this._streamLogs(o,{stream:"stderr",level:"info",label:r}),await this._buildDependencies(o,n.buildDeps),o}async run(e,t=[],n={}){let s=this._tasks.get(e);if(!s){const r=await this.project.packageManager();s=await this.exec(r,["run",e,...t],{...n,loggerLabel:`${this.name}#${e}`}),s.context.script=e,this._tasks.set(e,s)}return s}async build(e){const{scripts:t={}}=this.manifest;return t.build?await this.run("build",[],e):(this._logger.warn("Will not be built (no build script)"),null)}toJSON(){return{name:this.name,version:this.version,cwd:this.cwd}}get name(){return this.manifest.name}get version(){return this.manifest.version}get reference(){return this.version?`${this.name}@${this.version}`:this.name}get cwd(){return a().resolve(this.project.root,this._cwd)}};function g(){return(0,l.oV)(h,f.W)}p([(0,l.yT)(c.F)],h.prototype,"_git",void 0),h=p([(0,r.b)()],h)},3678:(e,t,n)=>{n.d(t,{P:()=>d});var s=n(78523),r=n(76259),o=n(73480),a=n.n(o),i=n(62429),c=n(29724),l=n(29921);let d=class{static isTaskNode(e){return"script"in e}constructor(e){this._logger=e}_lexer(){return a().states({task:{lparen:"(",whitespace:/[ \t]+/,string:[{match:/[:a-zA-Z0-9]+/,push:"operator"},{match:/'(?:\\['\\]|[^\n'\\])+'/,push:"operator",value:e=>e.slice(1,-1).replace(/\\(['\\])/g,"$1")},{match:/"(?:\\["\\]|[^\n"\\])+"/,push:"operator",value:e=>e.slice(1,-1).replace(/\\(["\\])/g,"$1")}]},operator:{whitespace:/[ \t]+/,rparen:")",operator:{match:["->","//"],pop:1}}})}_nextNode(e,t=0){let n=null;for(const s of e){if("whitespace"===s.type)continue;if("rparen"===s.type)break;if("operator"===s.type){const t=s.value;if(n){if(d.isTaskNode(n)){n={operator:t,tasks:[n]};continue}n.operator!==t&&(n={operator:t,tasks:[n]});continue}throw new Error(e.formatError(s,"Unexpected operator"))}let r;if("string"===s.type)r={script:s.value};else{if("lparen"!==s.type)throw new Error(e.formatError(s,"Unexpected token"));{const n=this._nextNode(e,t+1);if(!n)throw new Error(e.formatError(s,"Empty group found"));r=n}}if(n){if(d.isTaskNode(n))throw new Error(e.formatError(s,"Unexpected token, expected an operator"));n.tasks.push(r)}else n=r}return n}parse(e){const t=this._lexer().reset(e),n={roots:[]};for(;;){const e=this._nextNode(t);if(!e)break;n.roots.push(e)}return n}async buildTask(e,t,n){if(d.isTaskNode(e))return t.run(e.script,[],n);{let o;o="//"===e.operator?new s.W("In parallel",{},{logger:this._logger}):new r.h("In sequence",{},{logger:this._logger});for(const s of e.tasks)o.add(await this.buildTask(s,t,n));return o}}};var u,f;d=function(e,t,n,s){var r,o=arguments.length,a=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,s);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(0,l.t)(),(u=0,f=(0,c.f)(i.Y),function(e,t){f(e,t,u)})],d)},85099:(e,t,n)=>{n.d(t,{N:()=>i});var s=n(99625),r=n(62429),o=n(77839),a=n(10466);const i=Symbol("jujulego:jill:TaskManager");a.nC.bind(i).toDynamicValue((e=>{const t=e.container.get(o.k),n=e.container.get(r.Y);return new s.q({jobs:t.jobs,logger:n})})).inSingletonScope()},36872:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(52010),r=n(50397),o=n(81119),a=n(76687),i=n(76797);function c({group:e}){const[t,n]=(0,a.useState)([...e.tasks]);return(0,a.useLayoutEffect)((()=>{let t=!1;return e.subscribe("task.added",(()=>{t||(t=!0,queueMicrotask((()=>{n([...e.tasks]),t=!1})))}))}),[e]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{task:e}),(0,s.jsx)(o.Box,{flexDirection:"column",marginLeft:2,children:t.map((e=>(0,s.jsx)(a.Fragment,{children:e instanceof r.O?(0,s.jsx)(c,{group:e}):(0,s.jsx)(i.Z,{task:e})},e.id)))})]})}},58348:(e,t,n)=>{n.d(t,{Z:()=>b});var s=n(52010),r=n(81119),o=n(96122),a=n(40427),i=n(76687),c=n(10466),l=n(53565);function d(){const[e,t]=(0,i.useState)({status:"stop",label:""});switch((0,i.useLayoutEffect)((()=>{const e=c.nC.get(l.V);return t(e.state),e.subscribe("update",t)}),[]),e.status){case"spin":return(0,s.jsxs)(r.Text,{children:[(0,s.jsx)(o.Z,{})," "+e.label]});case"success":return(0,s.jsxs)(r.Text,{color:"green",children:[a.Z.success," ",e.label]});case"failed":return(0,s.jsxs)(r.Text,{color:"red",children:[a.Z.error," ",e.label]});default:return null}}var u=n(41429),f=n.n(u),p=n(86709),h=n.n(p),g=n(62429);const m=Symbol.for("message");function y(){const{write:e}=(0,r.useStderr)();return(0,i.useLayoutEffect)((()=>{const t=c.nC.get(g.Y);for(const e of t.transports)e instanceof f().transports.Console&&t.remove(e);const n=new class extends(h()){constructor(){super({format:g.D})}log(t,n){setTimeout((()=>{this.emit("logged",t)}),0),e(t[m]+"\n"),n()}};return t.add(n),()=>{t.remove(n),t.add(new(f().transports.Console)({format:g.D}))}}),[e]),null}function b({children:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y,{}),(0,s.jsx)(d,{}),e]})}},75740:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(52010),r=n(81119),o=n(46379);function a({items:e,headers:t}){return 0===e.length?null:(0,s.jsx)(r.Box,{children:Object.keys(e[0]).map((n=>(0,s.jsxs)(r.Box,{flexDirection:"column",marginRight:2,children:[t&&(0,s.jsx)(r.Text,{bold:!0,children:(0,o.k)(n)}),e.map(((e,t)=>(0,s.jsx)(r.Text,{children:e[n]||" "},t)))]},n)))})}},4887:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(52010),r=n(50397),o=n(76687),a=n(36872),i=n(76797);function c({manager:e}){const[t,n]=(0,o.useState)(e.tasks.filter((e=>!e.group)));return(0,o.useLayoutEffect)((()=>{let t=!1;return e.subscribe("added",(()=>{t||(t=!0,queueMicrotask((()=>{n(e.tasks.filter((e=>!e.group))),t=!1})))}))}),[e]),(0,s.jsx)(s.Fragment,{children:t.map((e=>e instanceof r.O?(0,s.jsx)(a.Z,{group:e},e.id):(0,s.jsx)(i.Z,{task:e},e.id)))})}},51562:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(52010),r=n(81119);function o({task:e}){return"workspace"in e.context?(0,s.jsxs)(r.Text,{children:["Running ",(0,s.jsx)(r.Text,{bold:!0,children:e.context.script})," in ",e.context.workspace.name]}):(0,s.jsx)(r.Text,{children:e.name})}},76797:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(52010),r=n(81119),o=n(96122),a=n(40427),i=n(21061),c=n(76687),l=n(51562);function d({task:e}){const[t,n]=(0,c.useState)(e.status),[d,u]=(0,c.useState)(0);switch((0,c.useLayoutEffect)((()=>e.subscribe("status",(e=>{n(e.status)}))),[e]),(0,c.useLayoutEffect)((()=>e.subscribe("completed",(({duration:e})=>{u(e)}))),[e]),t){case"blocked":case"ready":return(0,s.jsxs)(r.Text,{color:"grey",children:[(0,s.jsx)(o.Z,{type:"line2"})," ",(0,s.jsx)(l.Z,{task:e})]});case"running":return(0,s.jsxs)(r.Text,{children:[(0,s.jsx)(o.Z,{})," ",(0,s.jsx)(l.Z,{task:e})]});case"done":return(0,s.jsxs)(r.Text,{children:[(0,s.jsxs)(r.Text,{color:"green",children:[a.Z.success," ",(0,s.jsx)(l.Z,{task:e})]}),(0,s.jsxs)(r.Text,{color:"magenta",children:[" ","(took ",(0,i.Z)(d),")"]})]});case"failed":return(0,s.jsxs)(r.Text,{children:[(0,s.jsxs)(r.Text,{color:"red",children:[a.Z.error," ",(0,s.jsx)(l.Z,{task:e})]}),(0,s.jsxs)(r.Text,{color:"magenta",children:[" ","(took ",(0,i.Z)(d),")"]})]})}}},66238:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(52010),r=n(81119),o=n(76687);const a=e=>({color:e?"blue":""});function i(e){const{workspace:t,dev:n=!1,level:c=""}=e,[l,d]=(0,o.useState)([]);return(0,o.useEffect)((()=>{(async()=>{const e=[];for await(const n of t.dependencies())e.push([n,null]);for await(const n of t.devDependencies())e.push([n,!0]);d(e)})()}),[t]),(0,s.jsxs)(r.Text,{children:[(0,s.jsx)(r.Text,{...a(n),children:t.name}),t.version&&(0,s.jsxs)(r.Text,{color:"grey",children:["@",t.version]}),l.length>0&&(0,s.jsx)(r.Newline,{}),l.map((([e,t],o)=>(0,s.jsxs)(r.Text,{children:[c,(0,s.jsxs)(r.Text,{...a(n),children:[o===l.length-1?"└":"├","─"," "]}),(0,s.jsx)(i,{workspace:e,dev:t??n,level:(0,s.jsxs)(s.Fragment,{children:[c,(0,s.jsxs)(r.Text,{...a(n),children:[o===l.length-1?" ":"│"," "]})]})}),o<l.length-1&&(0,s.jsx)(r.Newline,{})]},e.name)))]})}},18520:(e,t,n)=>{async function s(e){return import("win32"===process.platform?`file://${e}`:e)}n.d(t,{y:()=>s})},55472:(e,t,n)=>{function s(e,t=process.stdout){t.isTTY?t.write(JSON.stringify(e,null,2)):t.write(JSON.stringify(e))}n.d(t,{i:()=>s})},95960:(e,t,n)=>{n.d(t,{$:()=>r,F:()=>o});var s=n(94415);async function*r(...e){for(const t of e)yield*t}async function*o(e,t){const n=new AbortController,r=new Error("aborted");e.subscribe("completed",(()=>n.abort(r)));let o="";try{for await(const r of(0,s.Vq)(e,`stream.${t}`,{signal:n.signal})){const e=(o+r.data.toString("utf-8")).split(/\r?\n/);o=e.pop()??"";for(const t of e)yield t}}catch(e){if(e!==r)throw e;o&&(yield o)}}},46379:(e,t,n)=>{function s(e){return e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()}n.d(t,{k:()=>s})},82180:(e,t,n)=>{n.d(t,{F:()=>o});var s=n(24086);const r=new s.BroadcastChannel("jujulego:jill:worker-cache");async function o(e,t){const n=(0,s.getEnvironmentData)(e);if(void 0!==n)return n;const o=await t();return(0,s.setEnvironmentData)(e,o),r.postMessage({key:e,value:o}),o}r.unref(),r.onmessage=e=>{const t=e;(function(e){return"object"==typeof e&&null!==e&&"key"in e&&"value"in e})(t.data)&&(0,s.setEnvironmentData)(t.data.key,t.data.value)}}};
|
|
2
2
|
//# sourceMappingURL=57.js.map
|