ts-pantry 0.11.20 → 0.11.21
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/bin/cli.js +560 -58
- package/dist/packages/github.com/ggerganov/llama.cpp.d.ts +1 -1
- package/dist/packages/github.com/router-for-me/CLIProxyAPI.d.ts +1 -1
- package/dist/packages/sourceware.org/libffi.d.ts +1 -1
- package/dist/src/index.js +502 -1
- package/dist/src/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-1fkycmh1.js +0 -1
- package/dist/chunk-4svjvh9y.js +0 -1
- package/dist/chunk-5a704hnd.js +0 -2
- package/dist/chunk-5cxd7nd8.js +0 -3
- package/dist/chunk-7dxexqk4.js +0 -2
- package/dist/chunk-8wwjwd7g.js +0 -1
- package/dist/chunk-9bfbcz1d.js +0 -313
- package/dist/chunk-9d4jsxqb.js +0 -1
- package/dist/chunk-akzqpam7.js +0 -1
- package/dist/chunk-eketndff.js +0 -2
- package/dist/chunk-eyk9nwn4.js +0 -11
- package/dist/chunk-f1gbsg8z.js +0 -1
- package/dist/chunk-fv0x8qv2.js +0 -2
- package/dist/chunk-h2mtxt0d.js +0 -1
- package/dist/chunk-hy4gs87x.js +0 -2
- package/dist/chunk-kw6vvwkh.js +0 -2
- package/dist/chunk-mm22ceze.js +0 -141
- package/dist/chunk-mq7cybgp.js +0 -2
- package/dist/chunk-sbnjmp1y.js +0 -1
- package/dist/chunk-t0k284nq.js +0 -42
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createRequire as h}from"node:module";var{defineProperty:q,getOwnPropertyNames:Y,getOwnPropertyDescriptor:Z}=Object,a=Object.prototype.hasOwnProperty;function I(s){return this[s]}var ys=(s)=>{var o=(z??=new WeakMap).get(s),t;if(o)return o;if(o=q({},"__esModule",{value:!0}),s&&typeof s==="object"||typeof s==="function"){for(var n of Y(s))if(!a.call(o,n))q(o,n,{get:I.bind(s,n),enumerable:!(t=Z(s,n))||t.enumerable})}return z.set(s,o),o},z;var W=(s)=>s;function _(s,o){this[s]=W.bind(null,o)}var ls=(s,o)=>{for(var t in o)q(s,t,{get:o[t],enumerable:!0,configurable:!0,set:_.bind(o,t)})};var y=(s,o)=>()=>(s&&(o=s(s=0)),o);var Cs=h(import.meta.url);import{execSync as m}from"node:child_process";function p(){if(B)return;B=!0;let s=()=>{for(let o of l)try{m(`pantry stop ${o}`,{stdio:"ignore",timeout:1e4})}catch{}l.clear()};process.on("exit",s),process.on("SIGINT",()=>{s(),process.exit(130)}),process.on("SIGTERM",()=>{s(),process.exit(143)})}function C(s,o=!1){let t={encoding:"utf-8",timeout:30000,stdio:o?"pipe":["pipe","pipe","pipe"]};return m(`pantry ${s}`,t)}function v(s){let o=s.match(/Name:\s+(\S+)/)?.[1]??"",t=/Status:\s+running/i.test(s),n=s.match(/Port:\s+(\d+)/),r=s.match(/PID:\s+(\d+)/),x=s.match(/Data Dir:\s+(.+)/);return{name:o,running:t,port:n?Number.parseInt(n[1],10):null,pid:r?Number.parseInt(r[1],10):null,dataDir:x?x[1].trim():null}}class e{config;_startedByUs=!1;constructor(s){this.config={name:s.name,port:s.port??0,readyTimeoutMs:s.readyTimeoutMs??15000,pollIntervalMs:s.pollIntervalMs??200,quiet:s.quiet??!0}}static isAvailable(){try{return m("pantry --version",{stdio:"ignore",timeout:5000}),!0}catch{return!1}}status(){try{let s=C(`inspect ${this.config.name}`,!0);return v(s)}catch{return{name:this.config.name,running:!1,port:null,pid:null,dataDir:null}}}isRunning(){return this.status().running}getPort(){return this.status().port}async start(){if(p(),this.isRunning())return this.status();return C(`start ${this.config.name}`,this.config.quiet),this._startedByUs=!0,l.add(this.config.name),await this.waitReady(),this.status()}async stop(){if(!this._startedByUs)return;try{C(`stop ${this.config.name}`,this.config.quiet)}catch{}l.delete(this.config.name),this._startedByUs=!1}async forceStop(){try{C(`stop ${this.config.name}`,this.config.quiet)}catch{}l.delete(this.config.name),this._startedByUs=!1}async ensureRunning(){if(this.isRunning())return this.status();return this.start()}async waitReady(){let s=Date.now()+this.config.readyTimeoutMs;while(Date.now()<s){if(this.isRunning())return;await new Promise((o)=>setTimeout(o,this.config.pollIntervalMs))}throw Error(`Service '${this.config.name}' did not become ready within ${this.config.readyTimeoutMs}ms`)}}var l,B=!1;var w=y(()=>{l=new Set});async function M(s){let o=await F.ensureRunning();return{port:s?.port??o.port??5432,host:s?.host??"localhost",database:s?.database??"postgres",username:s?.username??process.env.USER??"postgres"}}async function i(){await F.stop()}function E(s){let o=null;return{get connection(){if(!o)throw Error("Postgres not started. Ensure beforeAll has run.");return o},beforeAll:async()=>{o=await M(s)},afterAll:async()=>{await i(),o=null}}}async function j(s,o){let t=await M(o);try{return await s(t)}finally{if(o?.stopAfter!==!1)await i()}}var F;var G=y(()=>{w();F=new e({name:"postgres"})});async function A(s){let o=await H.ensureRunning(),t=s?.port??o.port??6379,n=s?.host??"localhost";return{port:t,host:n,url:`redis://${n}:${t}`}}async function T(){await H.stop()}function f(s){let o=null;return{get connection(){if(!o)throw Error("Redis not started. Ensure beforeAll has run.");return o},beforeAll:async()=>{o=await A(s)},afterAll:async()=>{await T(),o=null}}}async function k(s,o){let t=await A(o);try{return await s(t)}finally{if(o?.stopAfter!==!1)await T()}}var H;var J=y(()=>{w();H=new e({name:"redis"})});async function b(s){let o=await K.ensureRunning();return{port:s?.port??o.port??3306,host:s?.host??"localhost",database:s?.database??"test",username:s?.username??"root"}}async function P(){await K.stop()}function S(s){let o=null;return{get connection(){if(!o)throw Error("MySQL not started. Ensure beforeAll has run.");return o},beforeAll:async()=>{o=await b(s)},afterAll:async()=>{await P(),o=null}}}async function D(s,o){let t=await b(o);try{return await s(t)}finally{if(o?.stopAfter!==!1)await P()}}var K;var N=y(()=>{w();K=new e({name:"mysql"})});import{existsSync as Q,mkdirSync as U,mkdtempSync as g,rmSync as V,writeFileSync as d}from"node:fs";import{tmpdir as c}from"node:os";import{join as $}from"node:path";function ss(){if(O)return;O=!0;let s=()=>{for(let o of R)try{if(Q(o))V(o,{recursive:!0,force:!0})}catch{}R.clear()};process.on("exit",s),process.on("SIGINT",()=>{s(),process.exit(130)}),process.on("SIGTERM",()=>{s(),process.exit(143)})}function L(s="pantry-test-"){ss();let o=g($(c(),s));return R.add(o),o}function u(s){R.delete(s);try{if(Q(s))V(s,{recursive:!0,force:!0})}catch{}}async function os(s,o){let t=L(s);try{return await o(t)}finally{u(t)}}function ts(s,o){let t=L(s);try{return o(t)}finally{u(t)}}function ns(s,o,t){let n=$(s,o),r=n.substring(0,n.lastIndexOf("/"));if(r&&!Q(r))U(r,{recursive:!0});return d(n,t),n}function es(s,o){let t=$(s,o);return U(t,{recursive:!0}),t}var R,O=!1;var X=y(()=>{R=new Set});var rs=y(()=>{w();G();J();N();X()});rs();export{ts as withTempDirSync,os as withTempDir,k as withRedis,j as withPostgres,D as withMysql,f as useRedis,E as usePostgres,S as useMysql,T as stopRedis,i as stopPostgres,P as stopMysql,A as startRedis,M as startPostgres,b as startMysql,u as removeTempDir,ns as createTestFile,es as createTestDir,L as createTempDir,e as PantryService};
|
package/package.json
CHANGED
package/dist/chunk-1fkycmh1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ac as o,mc as a,nc as b,oc as c,pc as d,qc as e,rc as f,sc as g,tc as h,uc as i,vc as j,wc as k,xc as l,yc as m,zc as n}from"./chunk-hy4gs87x.js";import"./chunk-5a704hnd.js";import"./chunk-eketndff.js";import"./chunk-7dxexqk4.js";export{l as validatePackageSpec,h as searchPackages,o as resolveVersionFromMetadata,e as resolveVersion,g as resolvePackageDomain,m as parseVersion,d as isVersionAvailable,j as getPopularPackages,c as getPhpVersionsForWorkflow,i as getPackagesByPattern,f as getPackageInfo,a as getLatestVersion,b as getAvailableVersions,k as getActivePackages,n as compareVersionsDesc};
|
package/dist/chunk-4svjvh9y.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$b as g,Vb as a,Wb as b,Xb as c,Yb as d,Zb as e,_b as f,ac as h,bc as i,cc as j,dc as k,ec as l,fc as m,gc as n}from"./chunk-eyk9nwn4.js";import"./chunk-eketndff.js";import"./chunk-7dxexqk4.js";export{b as shouldProceedWithGitHubRequest,a as saveRateLimitInfo,d as saveGitHubPackageCache,k as resolvePackageDomain,f as logPkgxProjects,m as isKnownAlias,j as guessOriginalDomain,l as getPackageAliases,c as getGitHubPackageCache,n as getCanonicalDomain,g as formatObjectWithoutQuotedKeys,e as fetchPackageListFromGitHub,h as convertDomainToVarName,i as convertDomainToFileName};
|