@codions/portta 0.0.0-develop.20261102224932.sha-dc29471 → 0.0.0-develop.20261102225441.sha-8d7d3c5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -761,9 +761,9 @@ t.push(` - hostname: ${Tn(n.hostname)}`,` service: ${Tn(n.service)}`)}return
761
761
  s=="string"?o.s:"";if(!s||!a||!c)throw new Cn("the token is missing the account, tunnel or secret field");if(!Im.test(a))throw new Cn("the tunnel id inside the token is not a UUID");return{AccountTag:s,TunnelID:a,TunnelSecret:c}}i(mE,"parseTunnelToken");function hE(e){return`${JSON.stringify(e)}
762
762
  `}i(hE,"renderTunnelCredentials");var GB=/(Unauthorized|failed to authenticate|invalid tunnel secret|token is invalid|401)/i,VB=/(Couldn't start tunnel|validation failed|error parsing YAML|unable to parse config)/i,WB=/Registered tunnel connection/i;function gE(e){return!e.tokenConfigured||!e.zoneConfigured?{state:"not-configured",detail:e.tokenConfigured?"no domain has been set":"no tunnel token has been set",hint:"Settings -> Cloudflare Tunnel"}:e.enabled?GB.test(e.logTail)?{state:"auth-error",detail:"Cloudflare rejected the t\
763
763
  unnel token",hint:"the tunnel may have been deleted, or the token belongs to another account. Replace the token."}:VB.test(e.logTail)?{state:"config-error",detail:"the connector refused its configuration",hint:"portta tunnel status --logs"}:e.containerState!=="running"?{state:"disconnected",detail:e.containerState?`the connector container is ${e.containerState}`:"the connector container does not exist",hint:"portta up"}:WB.test(e.logTail)?{state:"connected",detail:"holding registered connections\
764
- to the Cloudflare edge",hint:null}:e.containerHealth==="starting"||!e.logTail?{state:"starting",detail:"the connector is establishing its connections",hint:null}:{state:"disconnected",detail:"the connector is running but has registered no connection",hint:"check outbound network access; the connector dials Cloudflare on 7844/udp and 443/tcp"}:{state:"configured",detail:"set up, and not enabled",hint:"enable it to start the connector"}}i(gE,"tunnelStatusFrom");import{stderr as KB,stdin as bE}from"node:process";import{createInterface as JB}from"node:readline/promises";var ze={success:0,failure:1,usage:2,precondition:3,refused:4},xe=class extends Error{static{i(this,"CliError")}exitCode;hint;constructor(t,n=ze.failure,r){super(t),this.name="CliError",this.exitCode=n,this.hint=r}},L=class extends xe{static{i(this,"PreconditionError")}constructor(t,n){super(t,ze.precondition,n)}},B=class extends xe{static{i(this,"RefusedError")}constructor(t,n){super(t,ze.refused,n)}},T=class extends xe{static{i(this,"UsageError")}constructor(t,n){super(t,ze.usage,n)}};async function Ye(e,t){if(t)return;if(!bE.isTTY)throw new B(`${e}; confirmation is unavailable without a TTY`,"pass --yes to confirm non-interactively");let n=JB({input:bE,output:KB});try{let r=await n.question(`${e} [y/N] `);if(!/^y(es)?$/i.test(r.trim()))throw new B("operation cancelled")}finally{n.close()}}i(Ye,"confirm");import{existsSync as ar,readFileSync as wE}from"node:fs";import{dirname as XB,join as vt,resolve as ho}from"node:path";var yE={name:"@codions/portta",version:"0.0.0-develop.20261102224932.sha-dc29471",description:"Machine-first CLI for a shared Docker development gateway",keywords:["docker","docker-compose","traefik","development","gateway","devcontainer","reverse-proxy"],license:"MIT",type:"module",bin:{portta:"dist/cli.js"},files:["dist"],publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"node --import tsx scripts/build.mjs",typecheck:"tsc -p tsconfig.json --noEmit",test:"vi\
764
+ to the Cloudflare edge",hint:null}:e.containerHealth==="starting"||!e.logTail?{state:"starting",detail:"the connector is establishing its connections",hint:null}:{state:"disconnected",detail:"the connector is running but has registered no connection",hint:"check outbound network access; the connector dials Cloudflare on 7844/udp and 443/tcp"}:{state:"configured",detail:"set up, and not enabled",hint:"enable it to start the connector"}}i(gE,"tunnelStatusFrom");import{stderr as KB,stdin as bE}from"node:process";import{createInterface as JB}from"node:readline/promises";var ze={success:0,failure:1,usage:2,precondition:3,refused:4},xe=class extends Error{static{i(this,"CliError")}exitCode;hint;constructor(t,n=ze.failure,r){super(t),this.name="CliError",this.exitCode=n,this.hint=r}},L=class extends xe{static{i(this,"PreconditionError")}constructor(t,n){super(t,ze.precondition,n)}},B=class extends xe{static{i(this,"RefusedError")}constructor(t,n){super(t,ze.refused,n)}},T=class extends xe{static{i(this,"UsageError")}constructor(t,n){super(t,ze.usage,n)}};async function Ye(e,t){if(t)return;if(!bE.isTTY)throw new B(`${e}; confirmation is unavailable without a TTY`,"pass --yes to confirm non-interactively");let n=JB({input:bE,output:KB});try{let r=await n.question(`${e} [y/N] `);if(!/^y(es)?$/i.test(r.trim()))throw new B("operation cancelled")}finally{n.close()}}i(Ye,"confirm");import{existsSync as ar,readFileSync as wE}from"node:fs";import{dirname as XB,join as vt,resolve as ho}from"node:path";var yE={name:"@codions/portta",version:"0.0.0-develop.20261102225441.sha-8d7d3c5",description:"Machine-first CLI for a shared Docker development gateway",keywords:["docker","docker-compose","traefik","development","gateway","devcontainer","reverse-proxy"],license:"MIT",type:"module",bin:{portta:"dist/cli.js"},files:["dist"],publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"node --import tsx scripts/build.mjs",typecheck:"tsc -p tsconfig.json --noEmit",test:"vi\
765
765
  test run",prepack:"npm run build",prepublishOnly:"npm run typecheck && npm test"},engines:{node:">=24"},repository:{type:"git",url:"git+https://github.com/codions-labs/portta.git",directory:"packages/cli"},homepage:"https://github.com/codions-labs/portta#readme",bugs:"https://github.com/codions-labs/portta/issues",dependencies:{"@clack/prompts":"^1.1.0",commander:"14.0.2",execa:"9.6.1",systeminformation:"^5.33.8",yaml:"^2.8.2",zod:"4.6.7"},devDependencies:{"@types/node":"24.13.3",esbuild:"0.28.2",
766
- "portta-contracts":"0.1.0","portta-core":"0.1.0",typescript:"7.0.2",vitest:"4.1.12",tsx:"4.23.13"}};var ir=yE.version,Rc="2026-11-02T22:51:17Z";function ei(){return`portta ${ir}${Rc?` (built ${Rc})`:""}`}i(ei,"cliVersionLine");var QB="0.0.0-local";function Nm(e){return ar(vt(e,"docker","compose","compose.yaml"))?ar(vt(e,"VERSION"))||ar(vt(e,"packages","cli","package.json")):!1}i(Nm,"isGatewayRoot");function Lm(e){let t=vt(e,"VERSION");if(ar(t))return wE(t,"utf8").trim();let n=vt(e,"packages","cli","package.json");if(ar(n))return QB;throw new L(`missing generated VERSION in ${e}`,"reinstall the @codions/portta npm package")}i(Lm,"versionForRoot");function eU(){let e=process.env.HOME;return[process.env.PORTTA_HOME,e?vt(
766
+ "portta-contracts":"0.1.0","portta-core":"0.1.0",typescript:"7.0.2",vitest:"4.1.12",tsx:"4.23.13"}};var ir=yE.version,Rc="2026-11-02T22:56:17Z";function ei(){return`portta ${ir}${Rc?` (built ${Rc})`:""}`}i(ei,"cliVersionLine");var QB="0.0.0-local";function Nm(e){return ar(vt(e,"docker","compose","compose.yaml"))?ar(vt(e,"VERSION"))||ar(vt(e,"packages","cli","package.json")):!1}i(Nm,"isGatewayRoot");function Lm(e){let t=vt(e,"VERSION");if(ar(t))return wE(t,"utf8").trim();let n=vt(e,"packages","cli","package.json");if(ar(n))return QB;throw new L(`missing generated VERSION in ${e}`,"reinstall the @codions/portta npm package")}i(Lm,"versionForRoot");function eU(){let e=process.env.HOME;return[process.env.PORTTA_HOME,e?vt(
767
767
  e,"portta"):void 0,"/opt/portta",e?vt(e,".portta"):void 0,"/var/lib/portta"].filter(t=>!!t)}i(eU,"wellKnownRoots");function Mm(e=process.cwd()){let t=process.env.PORTTA_ROOT;if(t&&Nm(ho(t)))return ho(t);let n=ho(e);for(;;){if(Nm(n))return n;let r=XB(n);if(r===n)break;n=r}for(let r of eU())if(Nm(ho(r)))return ho(r);return null}i(Mm,"findGatewayRoot");function O(e={}){let t=e.root?ho(e.root):Mm();if(!t){if(e.required===!1){let c={...process.env,PORTTA_PROFILE:e.profile??process.env.PORTTA_PROFILE},
768
768
  u=Xn(c);return{root:process.cwd(),env:c,config:u,composeFiles:[],version:ir}}throw new L("no Portta installation found","run `portta setup`, set PORTTA_HOME, or run this inside the gateway directory")}let n=ar(vt(t,".env"))?Ee(wE(vt(t,".env"),"utf8")):new Map,r=Wr(n,process.env);for(let[c,u]of Object.entries(e.overrides??{}))r[c]=u;e.profile&&(r.PORTTA_PROFILE=e.profile),r.PORTTA_ROOT=t,pv(r);let o=Xn(r);r.PORTTA_DOMAIN=o.domain,r.PORTTA_BIND_ADDRESS=o.bindAddress;let s=lv(o);for(let c of s)if(!ar(
769
769
  vt(t,c)))throw new L(`missing compose file: ${c}`);let a=Lm(t);return r.PORTTA_VERSION=a,{root:t,env:r,config:o,composeFiles:s,version:a}}i(O,"gatewayContext");function ye(e){return["--project-directory",e.root,...e.composeFiles.flatMap(t=>["-f",vt(e.root,t)])]}i(ye,"composeArguments");import{spawn as EW}from"node:child_process";import{closeSync as AW,openSync as OW}from"node:fs";function Se(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}i(Se,"isPlainObject");import{fileURLToPath as tU}from"node:url";var go=i((e,t)=>{let n=Fm(nU(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},"safeNormalizeFileUrl"),nU=i(e=>zm(e)?e.toString():e,"normalizeDenoExecPath"),zm=i(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),Fm=i(e=>e instanceof URL?tU(e):e,"normalizeFileUrl");var Ic=i((e,t=[],n={})=>{let r=go(e,"First argument"),[o,s]=Se(t)?[[],t]:[t,n];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let a=o.map(String),c=a.find(u=>u.includes("\0"));if(c!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${c}`);if(!Se(s))throw new TypeError(`Last argument\
Binary file
@@ -1 +1 @@
1
- 0.0.0-develop.20261102224932.sha-dc29471
1
+ 0.0.0-develop.20261102225441.sha-8d7d3c5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codions/portta",
3
- "version": "0.0.0-develop.20261102224932.sha-dc29471",
3
+ "version": "0.0.0-develop.20261102225441.sha-8d7d3c5",
4
4
  "description": "Machine-first CLI for a shared Docker development gateway",
5
5
  "keywords": [
6
6
  "docker",