Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lage

Package Overview
Dependencies
Maintainers
0
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lage - npm Package Compare versions

Comparing version 2.11.7 to 2.11.8

2

dist/singleTargetWorker.js

@@ -9,3 +9,3 @@ "use strict";var It=Object.create;var $e=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var qt=Object.getPrototypeOf,Dt=Object.prototype.hasOwnProperty;var f=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Nt=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Et(e))!Dt.call(r,n)&&n!==t&&$e(r,n,{get:()=>e[n],enumerable:!(s=xt(e,n))||s.enumerable});return r};var At=(r,e,t)=>(t=r!=null?It(qt(r)):{},Nt(e||!r||!r.__esModule?$e(t,"default",{value:r,enumerable:!0}):t,r));var x=f(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});function jt(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}jt(G,{START_MARKER_PREFIX:function(){return Ce},END_MARKER_PREFIX:function(){return Le},startMarker:function(){return Ft},endMarker:function(){return $t}});var Ce="## WORKER:START:",Le="## WORKER:END:";function Ft(r){return`${Ce}${r}`}function $t(r){return`${Le}${r}`}});var Be=f(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});Object.defineProperty(U,"registerWorker",{enumerable:!0,get:function(){return Ct}});var E=require("worker_threads"),q=x();function Ct(r){var s;(s=E.parentPort)==null||s.on("message",async n=>{let i;switch(n.type){case"start":return i=new AbortController,n.task&&await e(n.id,n.task,i.signal);case"abort":return i==null?void 0:i.abort();case"check-memory-usage":return t(E.parentPort)}});async function e(n,i,o){var a,c;try{process.stdout.write(`${(0,q.startMarker)(n)}

`),u.kill("SIGTERM");let w=setTimeout(()=>{u&&!u.killed&&u.kill("SIGKILL")},r.gracefulKillTimeout);w.unref&&w.unref()}};n.addEventListener("abort",g)}let l=this.getNpmArgs(c,a),d=[i,(m=t.options)==null?void 0:m.nodeOptions].filter(g=>g).join(" ");await new Promise((g,k)=>{u=(0,dr.spawn)(o,l,{cwd:t.cwd,stdio:["inherit","pipe","pipe"],shell:!0,env:{...process.stdout.isTTY&&{FORCE_COLOR:"1"},...process.env,...d&&{NODE_OPTIONS:d},LAGE_PACKAGE_NAME:t.packageName,LAGE_TASK:t.task,LAGE_WEIGHT:String(s)}});let w=!1,I=Ne=>{var Ae,je,Fe;if(u==null||u.off("exit",I),u==null||u.off("error",I),!w){if(w=!0,(Ae=u==null?void 0:u.stdout)==null||Ae.destroy(),(je=u==null?void 0:u.stderr)==null||je.destroy(),(Fe=u==null?void 0:u.stdin)==null||Fe.destroy(),Ne===0)return g();k(new Error(`NPM Script Runner: ${o} ${l.join(" ")} exited with code ${Ne}`))}},{pid:Ot}=u;process.stdout.write(`Running ${[o,...l].join(" ")}, pid: ${Ot}
`);let St=u.stdout,Rt=u.stderr;St.pipe(process.stdout),Rt.pipe(process.stderr),u.on("exit",I),u.on("error",()=>I(1))})}constructor(e){ot(this,"options",void 0),this.options=e}};ot(F,"gracefulKillTimeout",2500)});var ct=f(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});Object.defineProperty(ae,"WorkerRunner",{enumerable:!0,get:function(){return $}});var pr=require("url");function ut(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var $=class{async shouldRun(e){let t=await this.getScriptModule(e);return typeof t.shouldRun=="function"?await t.shouldRun(e):!0}async run(e){let{target:t,weight:s,abortSignal:n}=e,{taskArgs:i}=this.options,o=await this.getScriptModule(t),a=typeof o.run=="function"?o.run:typeof o.default=="function"?o.default:o;if(typeof a!="function")throw new Error("WorkerRunner: worker script must export a function; you likely need to use `module.exports = function() {...}`");return await a({target:t,weight:s,taskArgs:i,abortSignal:n})}async getScriptModule(e){var n,i;let t=((n=e.options)==null?void 0:n.worker)??((i=e.options)==null?void 0:i.script);if(!t)throw new Error('WorkerRunner: "script" configuration is required - e.g. { type: "worker", script: "./worker.js" }');let s=t;return s.startsWith("file://")||(s=(0,pr.pathToFileURL)(s).toString()),await import(s)}constructor(e){ut(this,"options",void 0),this.options=e}};ut($,"gracefulKillTimeout",2500)});var de=f(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});Object.defineProperty(ce,"NoOpRunner",{enumerable:!0,get:function(){return ue}});var ue=class{async shouldRun(){return!0}async run(){}}});var dt=f(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});Object.defineProperty(pe,"sortTargetsByPriority",{enumerable:!0,get:function(){return lr}});function lr(r){return r.sort((e,t)=>(t.priority??0)-(e.priority??0))}});var W=f(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});function fr(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}fr(le,{getTargetId:function(){return hr},getPackageAndTask:function(){return gr},getStartTargetId:function(){return yr}});function hr(r,e){return`${typeof r=="string"?r:""}#${e}`}function gr(r){if(r.includes("#")){let e=r.split("#");return r.startsWith("#")||e[0]==="//"?{packageName:void 0,task:e[1]}:{packageName:e[0],task:e[1]}}else return{packageName:void 0,task:r}}var mr="__start";function yr(){return mr}});var he=f(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});Object.defineProperty(fe,"detectCycles",{enumerable:!0,get:function(){return _r}});function _r(r){let e=new Map;for(let[t]of r.entries())if(!e.has(t)){let s=kr(r,e,t);if(s.length>0)return{hasCycle:!0,cycle:s}}return{hasCycle:!1}}var kr=(r,e,t)=>{let s=[{node:t,traversing:!1}];for(;s.length>0;){let n=s[s.length-1];if(n.traversing)e.set(n.node,!1),s.pop();else{if(e.has(n.node))if(e.get(n.node)){let o=s.filter(a=>a.traversing).map(a=>a.node);return o.slice(o.indexOf(n.node))}else{s.pop();continue}e.set(n.node,!0),s[s.length-1]={...n,traversing:!0};let i=r.get(n.node);if(!i)throw new Error(`Could not find node "${n.node}" in the graph`);s.push(...[...i.dependents].map(o=>({node:o,traversing:!1})))}}return[]}});var pt=f(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.getPackageDependencies=void 0;function wr(r,e,t={withDevDependencies:!0}){let s=[];if(r.dependencies)for(let n of Object.keys(r.dependencies))n!==r.name&&e.has(n)&&s.push(n);if(r.devDependencies&&t.withDevDependencies)for(let n of Object.keys(r.devDependencies))n!==r.name&&e.has(n)&&s.push(n);if(r.peerDependencies&&t.withPeerDependencies)for(let n of Object.keys(r.peerDependencies))n!==r.name&&e.has(n)&&s.push(n);return s}C.getPackageDependencies=wr});var lt=f(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.createDependencyMap=void 0;var vr=pt();function Pr(r,e={withDevDependencies:!0,withPeerDependencies:!1}){let t={dependencies:new Map,dependents:new Map},s=new Set(Object.keys(r));for(let[n,i]of Object.entries(r)){let o=(0,vr.getPackageDependencies)(i,s,e);for(let a of o)t.dependencies.has(n)||t.dependencies.set(n,new Set),t.dependencies.get(n).add(a),t.dependents.has(a)||t.dependents.set(a,new Set),t.dependents.get(a).add(n)}return t}L.createDependencyMap=Pr});var ht=f(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});Object.defineProperty(me,"expandDepSpecs",{enumerable:!0,get:function(){return br}});var S=W();function br(r,e){let t=[],s=(o,a)=>{t.push([o,a])},n=(o,a)=>a?i.filter(c=>{let{task:u,packageName:l}=c;return u===o&&a.some(d=>d===l)}).map(c=>c.id):i.filter(c=>c.task===o).map(c=>c.id),i=[...r.values()];for(let o of i){let{depSpecs:a,packageName:c,id:u}=o;if(t.push([(0,S.getStartTargetId)(),u]),!(!a||a.length===0))for(let l of a)if(l.includes("#")){let{packageName:d,task:h}=(0,S.getPackageAndTask)(l),m=(0,S.getTargetId)(d,h);s(m,u)}else if(l.startsWith("^^")&&c){let d=l.substring(2),h=[...ft(c,e)??[]],m=n(d,h);for(let g of m)s(g,u)}else if(l.startsWith("^")&&c){let d=l.substring(1),h=[...e.dependencies.get(c)??[]],m=n(d,h);for(let g of m)s(g,u)}else if(c){let d=l;r.has((0,S.getTargetId)(c,d))&&s((0,S.getTargetId)(c,d),u)}else{if(l.startsWith("^"))throw new Error(`invalid pipeline config detected: ${o.id}, packageName: ${c}, dep: ${l}`);{let h=n(l);for(let m of h)s(m,u)}}}return t}var ge=new Map;function ft(r,e){let t=ge.get(r);if(t)return t==="walk-in-progress"?new Set:t;{ge.set(r,"walk-in-progress");let s=[...e.dependencies.get(r)??[]],n=new Set(s);for(let i of s)for(let o of ft(i,e))n.add(o);return ge.set(r,n),n}}});var gt=f(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});Object.defineProperty(ye,"prioritize",{enumerable:!0,get:function(){return Or}});function Tr(r){let e=[];for(let[t,s]of r)s.dependencies.length===0&&e.push(t);return e}function Mr(r){return new Map([...r.entries()].map(([e,t])=>[e,new Set(t.dependencies)]))}function Wr(r,e){let t=[],s=Mr(r),n=[...e];for(;n.length>0;){let i=n.pop();t.push(i),r.get(i).dependents.forEach(a=>{let c=s.get(a);c.delete(i),c.size===0&&n.push(a)})}return t}function Or(r){let e=new Map,t=Tr(r),s=Wr(r,t);for(let n of s){let i=r.get(n),o=i.priority||0,a=i.dependencies.map(l=>{let d=e.get(l);if(d===void 0)throw new Error(`Expected to have already computed the cumulative priority for node ${l}`);return d}),c=Math.max(...a,0),u=o+c;e.set(n,u)}for(let n of r.values()){let i=e.get(n.id);if(i===void 0)throw new Error(`Expected to have already computed the cumulative priority for node ${n.id}`);n.priority=i}}});var ve=f(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});Object.defineProperty(we,"TargetGraphBuilder",{enumerable:!0,get:function(){return ke}});var _e=W(),Sr=gt(),Rr=he();function Ir(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var ke=class r{addTarget(e){return this.targets.set(e.id,e),this.addDependency((0,_e.getStartTargetId)(),e.id),e}addDependency(e,t){if(this.targets.has(t)){let s=this.targets.get(t);s.dependencies.includes(e)||s.dependencies.push(e)}if(this.targets.has(e)){let s=this.targets.get(e);s.dependents.includes(t)||s.dependents.push(t)}}build(){let e=(0,Rr.detectCycles)(this.targets);if(e.hasCycle)throw new Error("Cycles detected in the target graph: "+e.cycle.concat(e.cycle[0]).join(" -> "));return(0,Sr.prioritize)(this.targets),{targets:this.targets}}subgraph(e){let t=new r,s=new Set,n=[];for(let i of e)if(this.targets.has(i)){let o=this.targets.get(i);t.addTarget({...o,dependencies:[],dependents:[]}),n.push(i)}for(;n.length>0;){let i=n.shift();if(s.has(i))continue;s.add(i);let o=this.targets.get(i);if(!o)throw new Error("Subgraph builder failed - target not found: "+i);for(let a of o.dependencies)a!==(0,_e.getStartTargetId)()&&(t.targets.has(a)||t.addTarget({...this.targets.get(a),dependencies:[],dependents:[]}),t.addDependency(a,i)),s.has(a)||n.push(a)}return t.build()}constructor(){Ir(this,"targets",new Map);let e=(0,_e.getStartTargetId)();this.targets.set(e,{id:e,task:e,cwd:"",label:"Start",hidden:!0,dependencies:[],dependents:[],depSpecs:[],weight:1,priority:0})}}});var mt=f(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Object.defineProperty(Pe,"getWeight",{enumerable:!0,get:function(){return xr}});function xr(r,e,t){return typeof e=="number"?e:typeof e=="function"?e(r,t):1}});var Me=f(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Object.defineProperty(Te,"TargetFactory",{enumerable:!0,get:function(){return be}});var yt=W(),_t=mt();function kt(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var be=class{getTargetType(e,t){return t.type?t.type:this.packageScripts.has(e)?"npmScript":"noop"}createPackageTarget(e,t,s){let{resolve:n}=this.options,{options:i,deps:o,dependsOn:a,cache:c,inputs:u,priority:l,maxWorkers:d,environmentGlob:h,weight:m}=s,g=n(e),k=this.getTargetType(t,s),w={id:(0,yt.getTargetId)(e,t),label:`${e} - ${t}`,type:k,packageName:e,task:t,cache:c!==!1,cwd:g,depSpecs:a??o??[],dependencies:[],dependents:[],inputs:u,outputs:k==="noop"?[]:s.outputs,priority:l,maxWorkers:d,environmentGlob:h,weight:1,options:i};return w.weight=(0,_t.getWeight)(w,m,d),w}createGlobalTarget(e,t){let{root:s}=this.options,{options:n,deps:i,dependsOn:o,cache:a,inputs:c,outputs:u,priority:l,maxWorkers:d,environmentGlob:h,weight:m}=t,{task:g}=(0,yt.getPackageAndTask)(e),k={id:e,label:e,type:this.getTargetType(g,t),task:g,cache:a!==!1,cwd:s,depSpecs:o??i??[],dependencies:[],dependents:[],inputs:c,outputs:u,priority:l,maxWorkers:d,environmentGlob:h,weight:1,options:n};return k.weight=(0,_t.getWeight)(k,m,d),k}constructor(e){kt(this,"options",void 0),kt(this,"packageScripts",void 0),this.options=e,this.packageScripts=new Set;let{packageInfos:t}=e;for(let s of Object.values(t))for(let n of Object.keys(s.scripts??{}))this.packageScripts.add(n)}}});var wt=f(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Object.defineProperty(Oe,"WorkspaceTargetGraphBuilder",{enumerable:!0,get:function(){return We}});var Er=lt(),B=W(),qr=ht(),Dr=jr(require("path")),Nr=ve(),Ar=Me();function R(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jr(r){return r&&r.__esModule?r:{default:r}}var We=class{addTargetConfig(e,t={}){if(e.startsWith("//")||e.startsWith("#")){let s=this.targetFactory.createGlobalTarget(e,t);this.graphBuilder.addTarget(s),this.hasRootTarget=!0}else if(e.includes("#")){let{packageName:s,task:n}=(0,B.getPackageAndTask)(e),i=this.targetFactory.createPackageTarget(s,n,t);this.graphBuilder.addTarget(i)}else{let s=Object.keys(this.packageInfos);for(let n of s){let i=e,o=this.targetFactory.createPackageTarget(n,i,t);this.graphBuilder.addTarget(o)}}}build(e,t){let s=(0,qr.expandDepSpecs)(this.graphBuilder.targets,this.dependencyMap);for(let[o,a]of s)this.graphBuilder.addDependency(o,a);let n=[];for(let o of e){if(t)for(let a of t)n.push((0,B.getTargetId)(a,o));else for(let a of Object.keys(this.packageInfos))n.push((0,B.getTargetId)(a,o));if(this.hasRootTarget){let a=(0,B.getTargetId)(void 0,o);this.graphBuilder.targets.has(a)&&n.push(a)}}return{targets:this.graphBuilder.subgraph(n).targets}}constructor(e,t){R(this,"packageInfos",void 0),R(this,"dependencyMap",void 0),R(this,"graphBuilder",void 0),R(this,"targetFactory",void 0),R(this,"hasRootTarget",void 0),this.packageInfos=t,this.hasRootTarget=!1,this.dependencyMap=(0,Er.createDependencyMap)(t,{withDevDependencies:!0,withPeerDependencies:!1}),this.graphBuilder=new Nr.TargetGraphBuilder,this.targetFactory=new Ar.TargetFactory({root:e,packageInfos:t,resolve(s){try{return Dr.default.dirname(t[s].packageJsonPath)}catch{throw new Error(`Cannot open package.json file for ${s}`)}}})}}});var vt=f(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Object.defineProperty(Se,"removeNodes",{enumerable:!0,get:function(){return Fr}});async function Fr(r,e){let t=new Map;r.forEach(n=>t.set(n.id,n));let s=new Map;for(let n of r)if(await e(n)){t.delete(n.id);for(let o of n.dependencies)s.has(n.id)||s.set(n.id,new Set),s.get(n.id).add(o)}for(let n of t.values()){let i=new Set(n.dependencies);for(let o of n.dependencies)s.has(o)&&s.get(o).forEach(a=>i.add(a));n.dependencies=Array.from(i).filter(o=>t.has(o))}return Array.from(t.values())}});var Pt=f(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Object.defineProperty(Re,"transitiveReduction",{enumerable:!0,get:function(){return $r}});function $r(r){let e=new Map;r.forEach(n=>e.set(n.id,n));function t(n,i,o){if(n===i)return!0;if(o.has(n))return!1;o.add(n);let a=e.get(n);return a?a.dependencies.some(c=>t(c,i,o)):!1}return r.map(n=>({...n,dependencies:n.dependencies.filter(i=>{let o=new Set;return!n.dependencies.some(a=>a!==i&&t(a,i,o))})}))}});var bt=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});function Cr(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}Cr(xe,{sortTargetsByPriority:function(){return Lr.sortTargetsByPriority},getTargetId:function(){return Ie.getTargetId},getStartTargetId:function(){return Ie.getStartTargetId},getPackageAndTask:function(){return Ie.getPackageAndTask},detectCycles:function(){return Br.detectCycles},WorkspaceTargetGraphBuilder:function(){return Gr.WorkspaceTargetGraphBuilder},TargetGraphBuilder:function(){return Ur.TargetGraphBuilder},TargetFactory:function(){return Kr.TargetFactory},removeNodes:function(){return zr.removeNodes},transitiveReduction:function(){return Hr.transitiveReduction}});var Lr=dt(),Ie=W(),Br=he(),Gr=wt(),Ur=ve(),Kr=Me(),zr=vt(),Hr=Pt()});var Mt=f(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});Object.defineProperty(qe,"TargetRunnerPicker",{enumerable:!0,get:function(){return Ee}});var Tt=Qr(require("path")),Xr=bt(),Jr=require("url");function Yr(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qr(r){return r&&r.__esModule?r:{default:r}}var Ee=class{async pick(e){if(e.id===(0,Xr.getStartTargetId)())return new(await Promise.resolve().then(()=>At(de()))).NoOpRunner;if(e.type||(e.type="npmScript"),this.options[e.type]){let t=this.options[e.type],{script:s,options:n}=t,i=s;i.startsWith("file://")||(i=(0,Jr.pathToFileURL)(i).toString());let o=await import(i),a=Tt.default.basename(s),c=a.replace(Tt.default.extname(a),""),u=typeof o[c]=="function"?o[c]:typeof o.default=="function"?o.default:typeof o.default[c]=="function"?o.default[c]:o;return new u(n)}throw new Error(`No runner found for target ${e.id}`)}constructor(e){Yr(this,"options",void 0),this.options=e}}});var Wt=f(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});function Vr(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}Vr(De,{NpmScriptRunner:function(){return Zr.NpmScriptRunner},WorkerRunner:function(){return en.WorkerRunner},NoOpRunner:function(){return tn.NoOpRunner},TargetRunnerPicker:function(){return rn.TargetRunnerPicker}});var Zr=at(),en=ct(),tn=de(),rn=Mt()});Object.defineProperty(exports,"__esModule",{value:!0});var nn=it(),sn=Wt(),on=require("worker_threads");async function an(r){let{runners:e}=r,t=new sn.TargetRunnerPicker(e);return{options:r,runnerPicker:t}}(async()=>{let{runnerPicker:r}=await an(on.workerData);async function e(t,s){let n;return n=await(await r.pick(t.target)).run({target:t.target,weight:0,abortSignal:s}),{skipped:!1,hash:void 0,value:n}}(0,nn.registerWorker)(e)})();
`);let St=u.stdout,Rt=u.stderr;St.pipe(process.stdout),Rt.pipe(process.stderr),u.on("exit",I),u.on("error",()=>I(1))})}constructor(e){ot(this,"options",void 0),this.options=e}};ot(F,"gracefulKillTimeout",2500)});var ct=f(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});Object.defineProperty(ae,"WorkerRunner",{enumerable:!0,get:function(){return $}});var pr=require("url");function ut(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var $=class{async shouldRun(e){let t=await this.getScriptModule(e);return typeof t.shouldRun=="function"?await t.shouldRun(e):!0}async run(e){let{target:t,weight:s,abortSignal:n}=e,{taskArgs:i}=this.options,o=await this.getScriptModule(t),a=typeof o.run=="function"?o.run:typeof o.default=="function"?o.default:o;if(typeof a!="function")throw new Error("WorkerRunner: worker script must export a function; you likely need to use `module.exports = function() {...}`");return await a({target:t,weight:s,taskArgs:i,abortSignal:n})}async getScriptModule(e){var n,i;let t=((n=e.options)==null?void 0:n.worker)??((i=e.options)==null?void 0:i.script);if(!t)throw new Error('WorkerRunner: "script" configuration is required - e.g. { type: "worker", script: "./worker.js" }');let s=t;return s.startsWith("file://")||(s=(0,pr.pathToFileURL)(s).toString()),await import(s)}constructor(e){ut(this,"options",void 0),this.options=e}};ut($,"gracefulKillTimeout",2500)});var de=f(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});Object.defineProperty(ce,"NoOpRunner",{enumerable:!0,get:function(){return ue}});var ue=class{async shouldRun(){return!0}async run(){}}});var dt=f(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});Object.defineProperty(pe,"sortTargetsByPriority",{enumerable:!0,get:function(){return lr}});function lr(r){return r.sort((e,t)=>(t.priority??0)-(e.priority??0))}});var W=f(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});function fr(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}fr(le,{getTargetId:function(){return hr},getPackageAndTask:function(){return gr},getStartTargetId:function(){return yr}});function hr(r,e){return`${typeof r=="string"?r:""}#${e}`}function gr(r){if(r.includes("#")){let e=r.split("#");return r.startsWith("#")||e[0]==="//"?{packageName:void 0,task:e[1]}:{packageName:e[0],task:e[1]}}else return{packageName:void 0,task:r}}var mr="__start";function yr(){return mr}});var he=f(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});Object.defineProperty(fe,"detectCycles",{enumerable:!0,get:function(){return _r}});function _r(r){let e=new Map;for(let[t]of r.entries())if(!e.has(t)){let s=kr(r,e,t);if(s.length>0)return{hasCycle:!0,cycle:s}}return{hasCycle:!1}}var kr=(r,e,t)=>{let s=[{node:t,traversing:!1}];for(;s.length>0;){let n=s[s.length-1];if(n.traversing)e.set(n.node,!1),s.pop();else{if(e.has(n.node))if(e.get(n.node)){let o=s.filter(a=>a.traversing).map(a=>a.node);return o.slice(o.indexOf(n.node))}else{s.pop();continue}e.set(n.node,!0),s[s.length-1]={...n,traversing:!0};let i=r.get(n.node);if(!i)throw new Error(`Could not find node "${n.node}" in the graph`);s.push(...[...i.dependents].map(o=>({node:o,traversing:!1})))}}return[]}});var pt=f(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.getPackageDependencies=void 0;function wr(r,e,t={withDevDependencies:!0}){let s=[];if(r.dependencies)for(let n of Object.keys(r.dependencies))n!==r.name&&e.has(n)&&s.push(n);if(r.devDependencies&&t.withDevDependencies)for(let n of Object.keys(r.devDependencies))n!==r.name&&e.has(n)&&s.push(n);if(r.peerDependencies&&t.withPeerDependencies)for(let n of Object.keys(r.peerDependencies))n!==r.name&&e.has(n)&&s.push(n);return s}C.getPackageDependencies=wr});var lt=f(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.createDependencyMap=void 0;var vr=pt();function Pr(r,e={withDevDependencies:!0,withPeerDependencies:!1}){let t={dependencies:new Map,dependents:new Map},s=new Set(Object.keys(r));for(let[n,i]of Object.entries(r)){let o=(0,vr.getPackageDependencies)(i,s,e);for(let a of o)t.dependencies.has(n)||t.dependencies.set(n,new Set),t.dependencies.get(n).add(a),t.dependents.has(a)||t.dependents.set(a,new Set),t.dependents.get(a).add(n)}return t}L.createDependencyMap=Pr});var ht=f(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});Object.defineProperty(me,"expandDepSpecs",{enumerable:!0,get:function(){return br}});var S=W();function br(r,e){let t=[],s=(o,a)=>{t.push([o,a])},n=(o,a)=>a?i.filter(c=>{let{task:u,packageName:l}=c;return u===o&&a.some(d=>d===l)}).map(c=>c.id):i.filter(c=>c.task===o).map(c=>c.id),i=[...r.values()];for(let o of i){let{depSpecs:a,packageName:c,id:u}=o;if(t.push([(0,S.getStartTargetId)(),u]),!(!a||a.length===0))for(let l of a)if(l.includes("#")){let{packageName:d,task:h}=(0,S.getPackageAndTask)(l),m=(0,S.getTargetId)(d,h);s(m,u)}else if(l.startsWith("^^")&&c){let d=l.substring(2),h=[...ft(c,e)??[]],m=n(d,h);for(let g of m)s(g,u)}else if(l.startsWith("^")&&c){let d=l.substring(1),h=[...e.dependencies.get(c)??[]],m=n(d,h);for(let g of m)s(g,u)}else if(c){let d=l;r.has((0,S.getTargetId)(c,d))&&s((0,S.getTargetId)(c,d),u)}else{if(l.startsWith("^"))throw new Error(`invalid pipeline config detected: ${o.id}, packageName: ${c}, dep: ${l}`);{let h=n(l);for(let m of h)s(m,u)}}}return t}var ge=new Map;function ft(r,e){let t=ge.get(r);if(t)return t==="walk-in-progress"?new Set:t;{ge.set(r,"walk-in-progress");let s=[...e.dependencies.get(r)??[]],n=new Set(s);for(let i of s)for(let o of ft(i,e))n.add(o);return ge.set(r,n),n}}});var gt=f(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});Object.defineProperty(ye,"prioritize",{enumerable:!0,get:function(){return Or}});function Tr(r){let e=[];for(let[t,s]of r)s.dependencies.length===0&&e.push(t);return e}function Mr(r){return new Map([...r.entries()].map(([e,t])=>[e,new Set(t.dependencies)]))}function Wr(r,e){let t=[],s=Mr(r),n=[...e];for(;n.length>0;){let i=n.pop();t.push(i),r.get(i).dependents.forEach(a=>{let c=s.get(a);c.delete(i),c.size===0&&n.push(a)})}return t}function Or(r){let e=new Map,t=Tr(r),s=Wr(r,t);for(let n of s){let i=r.get(n),o=i.priority||0,a=i.dependencies.map(l=>{let d=e.get(l);if(d===void 0)throw new Error(`Expected to have already computed the cumulative priority for node ${l}`);return d}),c=Math.max(...a,0),u=o+c;e.set(n,u)}for(let n of r.values()){let i=e.get(n.id);if(i===void 0)throw new Error(`Expected to have already computed the cumulative priority for node ${n.id}`);n.priority=i}}});var ve=f(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});Object.defineProperty(we,"TargetGraphBuilder",{enumerable:!0,get:function(){return ke}});var _e=W(),Sr=gt(),Rr=he();function Ir(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var ke=class r{addTarget(e){return this.targets.set(e.id,e),this.addDependency((0,_e.getStartTargetId)(),e.id),e}addDependency(e,t){if(this.targets.has(t)){let s=this.targets.get(t);s.dependencies.includes(e)||s.dependencies.push(e)}if(this.targets.has(e)){let s=this.targets.get(e);s.dependents.includes(t)||s.dependents.push(t)}}build(){let e=(0,Rr.detectCycles)(this.targets);if(e.hasCycle)throw new Error("Cycles detected in the target graph: "+e.cycle.concat(e.cycle[0]).join(" -> "));return(0,Sr.prioritize)(this.targets),{targets:this.targets}}subgraph(e){let t=new r,s=new Set,n=[];for(let i of e)if(this.targets.has(i)){let o=this.targets.get(i);t.addTarget({...o,dependencies:[],dependents:[]}),n.push(i)}for(;n.length>0;){let i=n.shift();if(s.has(i))continue;s.add(i);let o=this.targets.get(i);if(!o)throw new Error("Subgraph builder failed - target not found: "+i);for(let a of o.dependencies)a!==(0,_e.getStartTargetId)()&&(t.targets.has(a)||t.addTarget({...this.targets.get(a),dependencies:[],dependents:[]}),t.addDependency(a,i)),s.has(a)||n.push(a)}return t.build()}constructor(){Ir(this,"targets",new Map);let e=(0,_e.getStartTargetId)();this.targets.set(e,{id:e,task:e,cwd:"",label:"Start",hidden:!0,dependencies:[],dependents:[],depSpecs:[],weight:1,priority:0})}}});var mt=f(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Object.defineProperty(Pe,"getWeight",{enumerable:!0,get:function(){return xr}});function xr(r,e,t){return typeof e=="number"?e:typeof e=="function"?e(r,t):1}});var Me=f(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Object.defineProperty(Te,"TargetFactory",{enumerable:!0,get:function(){return be}});var yt=W(),_t=mt();function kt(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var be=class{getTargetType(e,t){return t.type?t.type:this.packageScripts.has(e)?"npmScript":"noop"}createPackageTarget(e,t,s){let{resolve:n}=this.options,{options:i,deps:o,dependsOn:a,cache:c,inputs:u,priority:l,maxWorkers:d,environmentGlob:h,weight:m}=s,g=n(e),k=this.getTargetType(t,s),w={id:(0,yt.getTargetId)(e,t),label:`${e} - ${t}`,type:k,packageName:e,task:t,cache:c!==!1,cwd:g,depSpecs:a??o??[],dependencies:[],dependents:[],inputs:u,outputs:k==="noop"?[]:s.outputs,priority:l,maxWorkers:d,environmentGlob:h,weight:1,options:i};return w.weight=(0,_t.getWeight)(w,m,d),w}createGlobalTarget(e,t){let{root:s}=this.options,{options:n,deps:i,dependsOn:o,cache:a,inputs:c,outputs:u,priority:l,maxWorkers:d,environmentGlob:h,weight:m}=t,{task:g}=(0,yt.getPackageAndTask)(e),k={id:e,label:e,type:this.getTargetType(g,t),task:g,cache:a!==!1,cwd:s,depSpecs:o??i??[],dependencies:[],dependents:[],inputs:c,outputs:u,priority:l,maxWorkers:d,environmentGlob:h,weight:1,options:n};return k.weight=(0,_t.getWeight)(k,m,d),k}constructor(e){kt(this,"options",void 0),kt(this,"packageScripts",void 0),this.options=e,this.packageScripts=new Set;let{packageInfos:t}=e;for(let s of Object.values(t))for(let n of Object.keys(s.scripts??{}))this.packageScripts.add(n)}}});var wt=f(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Object.defineProperty(Oe,"WorkspaceTargetGraphBuilder",{enumerable:!0,get:function(){return We}});var Er=lt(),B=W(),qr=ht(),Dr=jr(require("path")),Nr=ve(),Ar=Me();function R(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function jr(r){return r&&r.__esModule?r:{default:r}}var We=class{addTargetConfig(e,t={}){if(e.startsWith("//")||e.startsWith("#")){let s=this.targetFactory.createGlobalTarget(e,t);this.graphBuilder.addTarget(s),this.hasRootTarget=!0}else if(e.includes("#")){let{packageName:s,task:n}=(0,B.getPackageAndTask)(e),i=this.targetFactory.createPackageTarget(s,n,t);this.graphBuilder.addTarget(i)}else{let s=Object.keys(this.packageInfos);for(let n of s){let i=e,o=this.targetFactory.createPackageTarget(n,i,t);this.graphBuilder.addTarget(o)}}}build(e,t){let s=(0,qr.expandDepSpecs)(this.graphBuilder.targets,this.dependencyMap);for(let[o,a]of s)this.graphBuilder.addDependency(o,a);let n=[];for(let o of e){if(t)for(let a of t)n.push((0,B.getTargetId)(a,o));else for(let a of Object.keys(this.packageInfos))n.push((0,B.getTargetId)(a,o));if(this.hasRootTarget){let a=(0,B.getTargetId)(void 0,o);this.graphBuilder.targets.has(a)&&n.push(a)}}return{targets:this.graphBuilder.subgraph(n).targets}}constructor(e,t){R(this,"packageInfos",void 0),R(this,"dependencyMap",void 0),R(this,"graphBuilder",void 0),R(this,"targetFactory",void 0),R(this,"hasRootTarget",void 0),this.packageInfos=t,this.hasRootTarget=!1,this.dependencyMap=(0,Er.createDependencyMap)(t,{withDevDependencies:!0,withPeerDependencies:!1}),this.graphBuilder=new Nr.TargetGraphBuilder,this.targetFactory=new Ar.TargetFactory({root:e,packageInfos:t,resolve(s){try{return Dr.default.dirname(t[s].packageJsonPath)}catch{throw new Error(`Cannot open package.json file for ${s}`)}}})}}});var vt=f(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Object.defineProperty(Se,"removeNodes",{enumerable:!0,get:function(){return Fr}});async function Fr(r,e){let t=new Map;r.forEach(n=>t.set(n.id,n));let s=new Map;for(let n of r)if(await e(n)){t.delete(n.id);for(let o of n.dependencies)s.has(n.id)||s.set(n.id,new Set),s.get(n.id).add(o)}for(let n of t.values()){let i=new Set(n.dependencies);for(let o of n.dependencies)s.has(o)&&s.get(o).forEach(a=>i.add(a));n.dependencies=Array.from(i).filter(o=>t.has(o))}return Array.from(t.values())}});var Pt=f(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Object.defineProperty(Re,"transitiveReduction",{enumerable:!0,get:function(){return $r}});function $r(r){let e=new Map,t=new Map;r.forEach(i=>{e.set(i.id,i),t.set(i.id,new Map),i.dependencies.forEach(o=>{t.get(i.id).set(o,!0)})});function s(i,o,a){var l;if(i===o)return!0;if(a.has(i))return!1;if(a.add(i),(l=t.get(i))!=null&&l.has(o))return t.get(i).get(o);let c=e.get(i);if(!c)return!1;let u=c.dependencies.some(d=>s(d,o,a));return t.get(i).set(o,u),u}return r.map(i=>({...i,dependencies:i.dependencies.filter(o=>{let a=new Set;return!i.dependencies.some(c=>c!==o&&s(c,o,a))})}))}});var bt=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});function Cr(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}Cr(xe,{sortTargetsByPriority:function(){return Lr.sortTargetsByPriority},getTargetId:function(){return Ie.getTargetId},getStartTargetId:function(){return Ie.getStartTargetId},getPackageAndTask:function(){return Ie.getPackageAndTask},detectCycles:function(){return Br.detectCycles},WorkspaceTargetGraphBuilder:function(){return Gr.WorkspaceTargetGraphBuilder},TargetGraphBuilder:function(){return Ur.TargetGraphBuilder},TargetFactory:function(){return Kr.TargetFactory},removeNodes:function(){return zr.removeNodes},transitiveReduction:function(){return Hr.transitiveReduction}});var Lr=dt(),Ie=W(),Br=he(),Gr=wt(),Ur=ve(),Kr=Me(),zr=vt(),Hr=Pt()});var Mt=f(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});Object.defineProperty(qe,"TargetRunnerPicker",{enumerable:!0,get:function(){return Ee}});var Tt=Qr(require("path")),Xr=bt(),Jr=require("url");function Yr(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qr(r){return r&&r.__esModule?r:{default:r}}var Ee=class{async pick(e){if(e.id===(0,Xr.getStartTargetId)())return new(await Promise.resolve().then(()=>At(de()))).NoOpRunner;if(e.type||(e.type="npmScript"),this.options[e.type]){let t=this.options[e.type],{script:s,options:n}=t,i=s;i.startsWith("file://")||(i=(0,Jr.pathToFileURL)(i).toString());let o=await import(i),a=Tt.default.basename(s),c=a.replace(Tt.default.extname(a),""),u=typeof o[c]=="function"?o[c]:typeof o.default=="function"?o.default:typeof o.default[c]=="function"?o.default[c]:o;return new u(n)}throw new Error(`No runner found for target ${e.id}`)}constructor(e){Yr(this,"options",void 0),this.options=e}}});var Wt=f(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});function Vr(r,e){for(var t in e)Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}Vr(De,{NpmScriptRunner:function(){return Zr.NpmScriptRunner},WorkerRunner:function(){return en.WorkerRunner},NoOpRunner:function(){return tn.NoOpRunner},TargetRunnerPicker:function(){return rn.TargetRunnerPicker}});var Zr=at(),en=ct(),tn=de(),rn=Mt()});Object.defineProperty(exports,"__esModule",{value:!0});var nn=it(),sn=Wt(),on=require("worker_threads");async function an(r){let{runners:e}=r,t=new sn.TargetRunnerPicker(e);return{options:r,runnerPicker:t}}(async()=>{let{runnerPicker:r}=await an(on.workerData);async function e(t,s){let n;return n=await(await r.pick(t.target)).run({target:t.target,weight:0,abortSignal:s}),{skipped:!1,hash:void 0,value:n}}(0,nn.registerWorker)(e)})();
//# sourceMappingURL=singleTargetWorker.js.map
{
"name": "lage",
"version": "2.11.7",
"version": "2.11.8",
"repository": {

@@ -26,4 +26,4 @@ "type": "git",

"devDependencies": {
"@lage-run/cli": "^0.23.7",
"@lage-run/runners": "^1.0.4",
"@lage-run/cli": "^0.23.8",
"@lage-run/runners": "^1.0.5",
"backfill-config": "6.4.2",

@@ -30,0 +30,0 @@ "dts-bundle-generator": "^9.5.1",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc