@stacksjs/ts-cloud 0.7.26 → 0.7.27

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 CHANGED
@@ -7298,7 +7298,13 @@ let files = []
7298
7298
  try { files = readdirSync(dir).filter(n => n.endsWith('.json')).sort() } catch {}
7299
7299
  for (const f of files) {
7300
7300
  let frag
7301
- try { frag = JSON.parse(readFileSync(dir + '/' + f, 'utf8')) } catch { continue }
7301
+ // Fragments are written atomically (temp + rename by ts-cloud), so a parse
7302
+ // failure here means a genuinely corrupt fragment, not a mid-write read. Log
7303
+ // it LOUD — a silent skip drops that app's whole host from the routing table,
7304
+ // which then answers 404 until someone notices. We still continue so one bad
7305
+ // fragment can't take every other app down, but the drop is now visible.
7306
+ try { frag = JSON.parse(readFileSync(dir + '/' + f, 'utf8')) }
7307
+ catch (err) { console.error('[rpx-assembler] SKIPPING malformed fragment ' + f + ' — its host(s) will 404 until fixed: ' + err); continue }
7302
7308
  for (const p of frag.proxies ?? []) {
7303
7309
  const key = p.id || (p.to + (p.path ?? ''))
7304
7310
  if (seen.has(key)) continue
@@ -7326,7 +7332,7 @@ const config = {
7326
7332
  }
7327
7333
 
7328
7334
  await startProxies(config)
7329
- `}function B8($,J,Y){return[`cat > ${$} <<'${Y}'`,J,Y]}function HR($){let J=new Set;for(let Y of $.proxies){let Z=Y.to;if(!Z||Z.startsWith("*")||Z.includes(":")||!Z.includes("."))continue;J.add(Z)}return[...J]}function XR($){let{config:J,proxy:Y}=$,Z=J.acmeChallengeWebroot,Q=HR(J);if(!Y.onDemandTls||!Z||Q.length===0)return[];let G=$.bunBin??"/usr/local/bin/bun",W=Y.version??"latest",z=J.productionCerts.certsDir,U=Y.onDemandTlsEmail??`webmaster@${Q[0]}`,H=`${G} ${b2}/node_modules/@stacksjs/tlsx/dist/bin/cli.js`,X=Q.join(","),K=Q.join(" "),B=($.slug||"app").replace(/[^a-z0-9._-]+/gi,"-"),V=`${Q5}/renew-certs-${B}.sh`,O=`rpx-cert-renew-${B}.service`,A=`rpx-cert-renew-${B}.timer`,_=["#!/bin/sh","# Generated by ts-cloud — issue/renew rpx gateway TLS certs via tlsx http-01.","# The running gateway serves the challenge from $WEBROOT on :80, so this needs","# no downtime and no DNS credentials. Reloads the gateway only if a cert changed.","set -u",`CERTS='${z}'`,`WEBROOT='${Z}'`,`EMAIL='${U}'`,`TLSX="${H}"`,`DOMAINS='${X}'`,'before=$(cat "$CERTS"/*.crt 2>/dev/null | sha256sum)',`for d in ${K}; do`,' [ -s "$CERTS/$d.crt" ] || $TLSX acme:issue -d "$d" --method http-01 --webroot "$WEBROOT" --dir "$CERTS" --prod --email "$EMAIL" || echo "issue $d failed (non-fatal)"',"done",'$TLSX acme:renew --domains "$DOMAINS" --method http-01 --webroot "$WEBROOT" --dir "$CERTS" --days 30 --prod --email "$EMAIL" || echo "renew: some domains failed (non-fatal)"','rm -f "$CERTS"/*.chain.crt','after=$(cat "$CERTS"/*.crt 2>/dev/null | sha256sum)',`[ "$before" = "$after" ] || systemctl restart ${K8}`].join(`
7335
+ `}function B8($,J,Y){return[`__tsc_tmp="$(mktemp "${$}.XXXXXX")"`,`cat > "$__tsc_tmp" <<'${Y}'`,J,Y,`mv -f "$__tsc_tmp" ${$}`,`chmod 0644 ${$}`]}function HR($){let J=new Set;for(let Y of $.proxies){let Z=Y.to;if(!Z||Z.startsWith("*")||Z.includes(":")||!Z.includes("."))continue;J.add(Z)}return[...J]}function XR($){let{config:J,proxy:Y}=$,Z=J.acmeChallengeWebroot,Q=HR(J);if(!Y.onDemandTls||!Z||Q.length===0)return[];let G=$.bunBin??"/usr/local/bin/bun",W=Y.version??"latest",z=J.productionCerts.certsDir,U=Y.onDemandTlsEmail??`webmaster@${Q[0]}`,H=`${G} ${b2}/node_modules/@stacksjs/tlsx/dist/bin/cli.js`,X=Q.join(","),K=Q.join(" "),B=($.slug||"app").replace(/[^a-z0-9._-]+/gi,"-"),V=`${Q5}/renew-certs-${B}.sh`,O=`rpx-cert-renew-${B}.service`,A=`rpx-cert-renew-${B}.timer`,_=["#!/bin/sh","# Generated by ts-cloud — issue/renew rpx gateway TLS certs via tlsx http-01.","# The running gateway serves the challenge from $WEBROOT on :80, so this needs","# no downtime and no DNS credentials. Reloads the gateway only if a cert changed.","set -u",`CERTS='${z}'`,`WEBROOT='${Z}'`,`EMAIL='${U}'`,`TLSX="${H}"`,`DOMAINS='${X}'`,'before=$(cat "$CERTS"/*.crt 2>/dev/null | sha256sum)',`for d in ${K}; do`,' [ -s "$CERTS/$d.crt" ] || $TLSX acme:issue -d "$d" --method http-01 --webroot "$WEBROOT" --dir "$CERTS" --prod --email "$EMAIL" || echo "issue $d failed (non-fatal)"',"done",'$TLSX acme:renew --domains "$DOMAINS" --method http-01 --webroot "$WEBROOT" --dir "$CERTS" --days 30 --prod --email "$EMAIL" || echo "renew: some domains failed (non-fatal)"','rm -f "$CERTS"/*.chain.crt','after=$(cat "$CERTS"/*.crt 2>/dev/null | sha256sum)',`[ "$before" = "$after" ] || systemctl restart ${K8}`].join(`
7330
7336
  `),M=["[Unit]",`Description=Issue/renew rpx gateway TLS certs for ${B} (tlsx http-01)`,`After=network-online.target ${K8}`,"Wants=network-online.target","","[Service]","Type=oneshot",`ExecStart=${V}`].join(`
7331
7337
  `),j=["[Unit]",`Description=Daily rpx gateway TLS cert issuance/renewal for ${B}`,"","[Timer]","OnCalendar=*-*-* 03:30:00","RandomizedDelaySec=1h","Persistent=true","","[Install]","WantedBy=timers.target"].join(`
7332
7338
  `);return[`mkdir -p ${Z}`,`(cd ${b2} && ${G} add @stacksjs/tlsx@${W}) || true`,...B8(V,_,"TS_CLOUD_RENEW_EOF"),`chmod +x ${V}`,...B8(`/etc/systemd/system/${O}`,M,"TS_CLOUD_RENEW_SVC_EOF"),...B8(`/etc/systemd/system/${A}`,j,"TS_CLOUD_RENEW_TIMER_EOF"),"systemctl daemon-reload",`systemctl enable --now ${A} || true`,`${V} || true`]}function V8($){let{config:J,proxy:Y}=$,Z=$.bunBin??"/usr/local/bin/bun",Q=Y.version??"latest",G=J.productionCerts.certsDir,W=($.slug||"app").replace(/[^a-z0-9._-]+/gi,"-"),z=JSON.stringify({slug:W,...J},null,2),U=UR(Z5,G),X=[`Environment=RPX_UPSTREAM_TIMEOUT=${Y.upstreamTimeout??60}`];if(typeof Y.maxUpstreamConns==="number")X.push(`Environment=RPX_MAX_UPSTREAM_CONNS=${Y.maxUpstreamConns}`);return["set -euo pipefail",`mkdir -p ${Q5} ${Z5} ${G} ${b2}`,`rm -rf ${b2}/node_modules ${b2}/bun.lock ${b2}/package.json`,`(cd ${b2} && ${Z} add @stacksjs/rpx@${Q})`,`ln -sfn ${b2}/node_modules ${Q5}/node_modules`,...B8(`${Z5}/${W}.json`,z,"TS_CLOUD_RPX_FRAGMENT_EOF"),...B8(oQ,U,"TS_CLOUD_RPX_EOF"),...B8(`/etc/systemd/system/${K8}`,["[Unit]","Description=rpx reverse-proxy gateway (managed by ts-cloud)","After=network.target network-online.target","Wants=network-online.target","","[Service]","Type=simple",`ExecStart=${Z} ${oQ}`,`WorkingDirectory=${b2}`,"Environment=BUN_INSTALL=/root/.bun",...X,"Restart=always","RestartSec=5","LimitNOFILE=1048576","AmbientCapabilities=CAP_NET_BIND_SERVICE","","[Install]","WantedBy=multi-user.target"].join(`
@@ -7576,7 +7582,7 @@ Run \`${this.name??"cli"} --help\` for usage.`;d2.stderr.write(`${G}${Q}${W}
7576
7582
  `).length-1;this.output.write(M2.move(-999,$*-1))}render(){let $=J4(this._render(this)??"",$4.stdout.columns,{hard:!0,trim:!1});if($===this._prevFrame)return;if(this.state==="initial")this.output.write(M2.hide);else{let J=bV(this._prevFrame,$);if(this.restoreCursor(),J&&J?.length===1){let Y=J[0];this.output.write(M2.move(0,Y)),this.output.write(a5.lines(1));let Z=$.split(`
7577
7583
  `);this.output.write(Z[Y]),this._prevFrame=$,this.output.write(M2.move(0,Z.length-Y-1));return}if(J&&J?.length>1){let Y=J[0];this.output.write(M2.move(0,Y)),this.output.write(a5.down());let Q=$.split(`
7578
7584
  `).slice(Y);this.output.write(Q.join(`
7579
- `)),this._prevFrame=$;return}this.output.write(a5.down())}if(this.output.write($),this.state==="initial")this.state="active";this._prevFrame=$}}function dV($,J){if($===void 0)return 0;if(J.length===0)return 0;let Z=J.findIndex((Q)=>Q.value===$);return Z!==-1?Z:0}function cV($,J){return(J.label??String(J.value)).toLowerCase().includes($.toLowerCase())}function mV($,J){if(!J)return;if($)return J;return J[0]}class lV extends JJ{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#$=0;#Y="";#Z;#J;get cursor(){return this.#$}get userInputWithCursor(){if(!this.userInput)return V6.inverse(V6.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let $=this.userInput.slice(0,this._cursor),[J,...Y]=this.userInput.slice(this._cursor);return`${$}${V6.inverse(J)}${Y.join("")}`}get options(){if(typeof this.#J==="function")return this.#J();return this.#J}constructor($){super($);this.#J=$.options;let J=this.options;this.filteredOptions=[...J],this.multiple=$.multiple===!0,this.#Z=$.filter??cV;let Y;if($.initialValue&&Array.isArray($.initialValue))if(this.multiple)Y=$.initialValue;else Y=$.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Y=[this.options[0].value];if(Y)for(let Z of Y){let Q=J.findIndex((G)=>G.value===Z);if(Q!==-1)this.toggleSelected(Z),this.#$=Q}this.focusedValue=this.options[this.#$]?.value,this.on("key",(Z,Q)=>this.#Q(Z,Q)),this.on("userInput",(Z)=>this.#G(Z))}_isActionKey($,J){return $==="\t"||this.multiple&&this.isNavigating&&J.name==="space"&&$!==void 0&&$!==""}#Q($,J){let Y=J.name==="up",Z=J.name==="down",Q=J.name==="return";if(Y||Z){if(this.#$=Math.max(0,Math.min(this.#$+(Y?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#$]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Q)this.value=mV(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&(J.name==="tab"||this.isNavigating&&J.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected($){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes($))this.selectedValues=this.selectedValues.filter((J)=>J!==$);else this.selectedValues=[...this.selectedValues,$];else this.selectedValues=[$]}#G($){if($!==this.#Y){this.#Y=$;let J=this.options;if($)this.filteredOptions=J.filter((Y)=>this.#Z($,Y));else this.filteredOptions=[...J];if(this.#$=dV(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#$]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class pV extends JJ{options;cursor=0;#$;getGroupItems($){return this.options.filter((J)=>J.group===$)}isGroupSelected($){let J=this.getGroupItems($),Y=this.value;if(Y===void 0)return!1;return J.every((Z)=>Y.includes(Z.value))}toggleValue(){let $=this.options[this.cursor];if(this.value===void 0)this.value=[];if($.group===!0){let J=String($.value),Y=this.getGroupItems(J);if(this.isGroupSelected(J))this.value=this.value.filter((Z)=>Y.findIndex((Q)=>Q.value===Z)===-1);else this.value=[...this.value,...Y.map((Z)=>Z.value)];this.value=Array.from(new Set(this.value))}else{let J=this.value.includes($.value);this.value=J?this.value.filter((Y)=>Y!==$.value):[...this.value,$.value]}}constructor($){super($,!1);let{options:J}=$;this.#$=$.selectableGroups!==!1,this.options=Object.entries(J).flatMap(([Y,Z])=>[{value:Y,group:!0,label:Y},...Z.map((Q)=>({...Q,group:Y}))]),this.value=[...$.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Y})=>Y===$.cursorAt),this.#$?0:1),this.on("cursor",(Y)=>{switch(Y){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Z=this.options[this.cursor]?.group===!0;if(!this.#$&&Z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Z=this.options[this.cursor]?.group===!0;if(!this.#$&&Z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var rV=$V();var P0=($,J)=>rV?$:J,FP=P0("◆","*"),KP=P0("■","x"),BP=P0("▲","x"),VP=P0("◇","o"),OP=P0("┌","T"),nV=P0("│","|"),AP=P0("└","—"),_P=P0("●",">"),jP=P0("○"," "),LP=P0("◻","[•]"),MP=P0("◼","[+]"),EP=P0("◻","[ ]"),qP=P0("▪","•"),TP=P0("─","-"),RP=P0("╮","+"),DP=P0("├","+"),wP=P0("╯","+"),NP=P0("●","•"),PP=P0("◆","*"),SP=P0("▲","!"),CP=P0("■","x");var xP={light:P0("─","-"),heavy:P0("━","="),block:P0("█","#")};function iV(){return`${V6.gray(nV)} `}var IP=iV();var YJ="0.7.26";F0();import{existsSync as KJ}from"node:fs";import{mkdir as GO,writeFile as L4}from"node:fs/promises";function BJ($){$.command("init","Initialize a new ts-cloud project").option("--mode <mode>","Deployment mode: server or serverless").option("--name <name>","Project name").option("--region <region>","AWS Region").action(async(J)=>{if(D("Initializing ts-cloud Project"),KJ("cloud.config.ts")){if(!await p("cloud.config.ts already exists. Overwrite?",!1)){F("Initialization cancelled");return}}let Y=J?.name||await D0("Project name","my-app"),Z=J?.mode||await _6("Select deployment mode",["serverless","server"]),Q=J?.region||await _6("Select AWS region",["us-east-1","us-west-2","eu-west-1","eu-central-1","ap-southeast-1"]),G=new P("Creating configuration file...");G.start();let W=`import { defineConfig } from '@ts-cloud/core'
7585
+ `)),this._prevFrame=$;return}this.output.write(a5.down())}if(this.output.write($),this.state==="initial")this.state="active";this._prevFrame=$}}function dV($,J){if($===void 0)return 0;if(J.length===0)return 0;let Z=J.findIndex((Q)=>Q.value===$);return Z!==-1?Z:0}function cV($,J){return(J.label??String(J.value)).toLowerCase().includes($.toLowerCase())}function mV($,J){if(!J)return;if($)return J;return J[0]}class lV extends JJ{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#$=0;#Y="";#Z;#J;get cursor(){return this.#$}get userInputWithCursor(){if(!this.userInput)return V6.inverse(V6.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}█`;let $=this.userInput.slice(0,this._cursor),[J,...Y]=this.userInput.slice(this._cursor);return`${$}${V6.inverse(J)}${Y.join("")}`}get options(){if(typeof this.#J==="function")return this.#J();return this.#J}constructor($){super($);this.#J=$.options;let J=this.options;this.filteredOptions=[...J],this.multiple=$.multiple===!0,this.#Z=$.filter??cV;let Y;if($.initialValue&&Array.isArray($.initialValue))if(this.multiple)Y=$.initialValue;else Y=$.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Y=[this.options[0].value];if(Y)for(let Z of Y){let Q=J.findIndex((G)=>G.value===Z);if(Q!==-1)this.toggleSelected(Z),this.#$=Q}this.focusedValue=this.options[this.#$]?.value,this.on("key",(Z,Q)=>this.#Q(Z,Q)),this.on("userInput",(Z)=>this.#G(Z))}_isActionKey($,J){return $==="\t"||this.multiple&&this.isNavigating&&J.name==="space"&&$!==void 0&&$!==""}#Q($,J){let Y=J.name==="up",Z=J.name==="down",Q=J.name==="return";if(Y||Z){if(this.#$=Math.max(0,Math.min(this.#$+(Y?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#$]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(Q)this.value=mV(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&(J.name==="tab"||this.isNavigating&&J.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected($){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes($))this.selectedValues=this.selectedValues.filter((J)=>J!==$);else this.selectedValues=[...this.selectedValues,$];else this.selectedValues=[$]}#G($){if($!==this.#Y){this.#Y=$;let J=this.options;if($)this.filteredOptions=J.filter((Y)=>this.#Z($,Y));else this.filteredOptions=[...J];if(this.#$=dV(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#$]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class pV extends JJ{options;cursor=0;#$;getGroupItems($){return this.options.filter((J)=>J.group===$)}isGroupSelected($){let J=this.getGroupItems($),Y=this.value;if(Y===void 0)return!1;return J.every((Z)=>Y.includes(Z.value))}toggleValue(){let $=this.options[this.cursor];if(this.value===void 0)this.value=[];if($.group===!0){let J=String($.value),Y=this.getGroupItems(J);if(this.isGroupSelected(J))this.value=this.value.filter((Z)=>Y.findIndex((Q)=>Q.value===Z)===-1);else this.value=[...this.value,...Y.map((Z)=>Z.value)];this.value=Array.from(new Set(this.value))}else{let J=this.value.includes($.value);this.value=J?this.value.filter((Y)=>Y!==$.value):[...this.value,$.value]}}constructor($){super($,!1);let{options:J}=$;this.#$=$.selectableGroups!==!1,this.options=Object.entries(J).flatMap(([Y,Z])=>[{value:Y,group:!0,label:Y},...Z.map((Q)=>({...Q,group:Y}))]),this.value=[...$.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Y})=>Y===$.cursorAt),this.#$?0:1),this.on("cursor",(Y)=>{switch(Y){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let Z=this.options[this.cursor]?.group===!0;if(!this.#$&&Z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let Z=this.options[this.cursor]?.group===!0;if(!this.#$&&Z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}var rV=$V();var P0=($,J)=>rV?$:J,FP=P0("◆","*"),KP=P0("■","x"),BP=P0("▲","x"),VP=P0("◇","o"),OP=P0("┌","T"),nV=P0("│","|"),AP=P0("└","—"),_P=P0("●",">"),jP=P0("○"," "),LP=P0("◻","[•]"),MP=P0("◼","[+]"),EP=P0("◻","[ ]"),qP=P0("▪","•"),TP=P0("─","-"),RP=P0("╮","+"),DP=P0("├","+"),wP=P0("╯","+"),NP=P0("●","•"),PP=P0("◆","*"),SP=P0("▲","!"),CP=P0("■","x");var xP={light:P0("─","-"),heavy:P0("━","="),block:P0("█","#")};function iV(){return`${V6.gray(nV)} `}var IP=iV();var YJ="0.7.27";F0();import{existsSync as KJ}from"node:fs";import{mkdir as GO,writeFile as L4}from"node:fs/promises";function BJ($){$.command("init","Initialize a new ts-cloud project").option("--mode <mode>","Deployment mode: server or serverless").option("--name <name>","Project name").option("--region <region>","AWS Region").action(async(J)=>{if(D("Initializing ts-cloud Project"),KJ("cloud.config.ts")){if(!await p("cloud.config.ts already exists. Overwrite?",!1)){F("Initialization cancelled");return}}let Y=J?.name||await D0("Project name","my-app"),Z=J?.mode||await _6("Select deployment mode",["serverless","server"]),Q=J?.region||await _6("Select AWS region",["us-east-1","us-west-2","eu-west-1","eu-central-1","ap-southeast-1"]),G=new P("Creating configuration file...");G.start();let W=`import { defineConfig } from '@ts-cloud/core'
7580
7586
 
7581
7587
  export default defineConfig({
7582
7588
  project: {
@@ -841,7 +841,13 @@ let files = []
841
841
  try { files = readdirSync(dir).filter(n => n.endsWith('.json')).sort() } catch {}
842
842
  for (const f of files) {
843
843
  let frag
844
- try { frag = JSON.parse(readFileSync(dir + '/' + f, 'utf8')) } catch { continue }
844
+ // Fragments are written atomically (temp + rename by ts-cloud), so a parse
845
+ // failure here means a genuinely corrupt fragment, not a mid-write read. Log
846
+ // it LOUD — a silent skip drops that app's whole host from the routing table,
847
+ // which then answers 404 until someone notices. We still continue so one bad
848
+ // fragment can't take every other app down, but the drop is now visible.
849
+ try { frag = JSON.parse(readFileSync(dir + '/' + f, 'utf8')) }
850
+ catch (err) { console.error('[rpx-assembler] SKIPPING malformed fragment ' + f + ' — its host(s) will 404 until fixed: ' + err); continue }
845
851
  for (const p of frag.proxies ?? []) {
846
852
  const key = p.id || (p.to + (p.path ?? ''))
847
853
  if (seen.has(key)) continue
@@ -873,9 +879,12 @@ await startProxies(config)
873
879
  }
874
880
  function writeFileHeredoc(path, content, delimiter) {
875
881
  return [
876
- `cat > ${path} <<'${delimiter}'`,
882
+ `__tsc_tmp="$(mktemp "${path}.XXXXXX")"`,
883
+ `cat > "$__tsc_tmp" <<'${delimiter}'`,
877
884
  content,
878
- delimiter
885
+ delimiter,
886
+ `mv -f "$__tsc_tmp" ${path}`,
887
+ `chmod 0644 ${path}`
879
888
  ];
880
889
  }
881
890
  function certDomainsForConfig(config) {
@@ -28,7 +28,7 @@ import {
28
28
  resolveSiteKind,
29
29
  resolveUiSource,
30
30
  siteInstallBase
31
- } from "./chunk-q75x5tw6.js";
31
+ } from "./chunk-arz8x67j.js";
32
32
  import {
33
33
  artifactKey,
34
34
  composeServerlessAppTemplate,
@@ -12,7 +12,7 @@ import {
12
12
  sanitizeCloudConfig,
13
13
  setMaintenance,
14
14
  startLocalDashboardServer
15
- } from "../chunk-zz10yhec.js";
15
+ } from "../chunk-x5yfwpaf.js";
16
16
  import {
17
17
  buildAndPushServerlessImage
18
18
  } from "../chunk-zcx1x2bf.js";
@@ -30,7 +30,7 @@ import {
30
30
  resolveUiSource,
31
31
  siteInstallBase,
32
32
  validateDeploymentConfig
33
- } from "../chunk-q75x5tw6.js";
33
+ } from "../chunk-arz8x67j.js";
34
34
  import"../chunk-haw9g3zk.js";
35
35
  import"../chunk-93hjhs78.js";
36
36
  import {
@@ -48,7 +48,7 @@ import {
48
48
  waitForCloudInit,
49
49
  waitForSsh,
50
50
  wrapCloudInitUserData
51
- } from "../chunk-q75x5tw6.js";
51
+ } from "../chunk-arz8x67j.js";
52
52
  import"../chunk-haw9g3zk.js";
53
53
  import"../chunk-93hjhs78.js";
54
54
  import"../chunk-qpj3edwz.js";
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  sanitizeCloudConfig,
56
56
  setMaintenance,
57
57
  startLocalDashboardServer
58
- } from "./chunk-zz10yhec.js";
58
+ } from "./chunk-x5yfwpaf.js";
59
59
  import {
60
60
  buildAndPushServerlessImage
61
61
  } from "./chunk-zcx1x2bf.js";
@@ -105,7 +105,7 @@ import {
105
105
  waitForCloudInit,
106
106
  waitForSsh,
107
107
  wrapCloudInitUserData
108
- } from "./chunk-q75x5tw6.js";
108
+ } from "./chunk-arz8x67j.js";
109
109
  import {
110
110
  ABTestManager,
111
111
  AI,