@tdk-landscape/tdk-cli-core 1.3.146 → 1.3.147
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/README.md +2 -0
- package/cli/dist-bundle/{chunk-SWAGCVPQ.js → chunk-LNZN426S.js} +1 -1
- package/cli/dist-bundle/cli.js +3 -3
- package/cli/dist-bundle/{cold-preflight-2ZV2PDU2.js → cold-preflight-D7CAIHND.js} +1 -1
- package/cli/package.json +1 -1
- package/discovery/config.star +1 -1
- package/engine/assets/docker/golden-layers.Dockerfile +8 -25
- package/engine/topologies/platform/docker/build/golden_image_build.star +7 -1
- package/engine/topologies/platform/docker/build/golden_image_constants.star +13 -6
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +8 -27
- package/engine/topologies/platform/docker/layers/prisma/constants.star +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,6 +141,8 @@ Set `TDK_DEBUG=1` before running `tdk up --verbose` to include Starlark debug lo
|
|
|
141
141
|
- [Show HN draft](docs/drafts/show-hn.md)
|
|
142
142
|
- [Architecture and repository map](docs/project-overview.md)
|
|
143
143
|
- [Scale fixture measurements and caveats](docs/benchmarks/scale-bench.md)
|
|
144
|
+
- [Benchmark report: warm and cold start charts, history](https://tdk-landscape.github.io/tdk-cli-core/) (updated on every change to `main` that affects start-up)
|
|
145
|
+
- [How to run the start-time benchmark](scripts/benchmark/README.md#tdk-up-warm-start-benchmark)
|
|
144
146
|
|
|
145
147
|
## History
|
|
146
148
|
|
|
@@ -10,7 +10,7 @@ To create a stack, use:`},services:{singular:"service",command:"tdk resource <na
|
|
|
10
10
|
To create a service:`},"stack-services":{singular:"service",command:"tdk resource <name> --stack <stack-name>",context:`
|
|
11
11
|
To add services to this stack:`}};function zu(e,t){let n=Oo[e];console.log(t?f.yellow(`No ${n.singular}s found${t}.`):f.yellow(`No ${n.singular}s found.`)),console.log(f.gray(n.context)),console.log(f.gray(` ${n.command}`)),e==="stacks"&&(console.log(f.gray(`
|
|
12
12
|
Or create a new resource with a stack:`)),console.log(f.gray(" tdk resource <name> --stack <stack-name>")))}function Yu(e){console.log(f.yellow(e||"Cancelled."))}function Xu(e){console.log(f.blue(`TDK ${e}
|
|
13
|
-
`))}function Zu(e,t){console.log(f.green(`All ${e} are ${t}!`))}var mt=62;function Qu(e="\u2500",t=mt){return e.repeat(t)}function Wn(e,t=mt-2){let n=Math.max(0,t-e.length),r=Math.floor(n/2),s=n-r;return" ".repeat(r)+e+" ".repeat(s)}function ed(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function td(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function nd(e){console.log(f.green(`\u2713 ${e}`))}function rd(e){console.log(f.blue(e))}function sd(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function od(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function id(e,t,n=mt){let r=n-2,s="\u2500".repeat(r);console.log(),console.log(f.cyan(`\u256D${s}\u256E`)),console.log(f.cyan("\u2502")+f.bold.white(Wn(e,r))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(Wn(t,r))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as Do}from"node:fs";import{dirname as Co,join as No,resolve as qn}from"node:path";import{cwd as jo}from"node:process";var Jn={name:"tdk-cli-internal",private:!0,version:"1.3.146",description:"TDK CLI \u2014 start services on your machine.",keywords:["tdk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/tdk-landscape/tdk-cli-core#readme",bugs:{url:"https://github.com/tdk-landscape/tdk-cli-core/issues"},repository:{type:"git",url:"git+https://github.com/tdk-landscape/tdk-cli-core.git",directory:"cli"},license:"MIT",author:"TDK Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{tdk:"bin/tdk.js","tdk-cli":"bin/tdk.js"},files:["dist","dist-bundle","bin","templates","README.md","Tiltfile","engine","discovery","specs","ext","!ext/ide-components/code_executor","shared-platform-engineering/docker-templates"],scripts:{build:"tsc && node scripts/bundle.mjs","build:watch":"tsc --watch",lint:"biome check .","lint:fix":"biome check . --write",typecheck:"tsc --project tsconfig.typecheck.json",clean:"rm -rf dist",dev:"bun run build:watch",test:"vitest run","test:watch":"vitest",prepack:"../scripts/stage-npm-engine.sh && npm run build"},dependencies:{commander:"^15.0.0",handlebars:"^4.7.8"},devDependencies:{"@biomejs/biome":"^2.5.13","@types/node":"^22.0.0","@types/react":"^19.3.0",ajv:"^8.17.1",chalk:"^6.0.1",esbuild:"^0.28.2",ink:"^7.1.1",knip:"^6.38.0",react:"^19.3.0","react-devtools-core":"^8.0.0",typescript:"^7.0.2",vite:"^8.3.1",vitest:"^5.0.0"},engines:{node:">=22.12.0"}};function m(e=jo()){let t=qn(e),n=qn("/");for(;t!==n;){if(Do(No(t,".tdk",P)))return t;let r=Co(t);if(r===t)break;t=r}return null}var Ne=null;function Io(){if(Ne)return Ne;let e=Jn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return Ne={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},Ne}function zn(){return Io().version}import{readFileSync as Fo}from"node:fs";import{join as Mo}from"node:path";function je(){let e=m();if(e)try{let t=Fo(Mo(e,".tdk",P),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function ht(e){let t=je(),n=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let r=new URL(n.includes("://")?n:`http://${n}`),s=r.hostname,o=r.protocol==="https:"?"443":"80",i=r.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${r.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${r.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${r.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${r.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function Lo(e){return`${e.replace(/\/+$/,"")}/health`}function gt(e){if(w(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function kt(e,t){return Xn(e,t,n=>Lo(n))}function Yn(e,t){return Xn(e,t,n=>n)}function Xn(e,t,n){let{appBase:r,apiBase:s}=ht(t);return e.filter(o=>o.config?.appType==="frontend"||w(o.config?.appType)).map(o=>{let i=w(o.config.appType)?s:r;return{name:o.name,appType:o.config.appType,url:`${i}${n(gt(o))}`}})}async function Bo(e,t){try{let n=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:n.ok,status:n.status}}catch(n){let r=n instanceof Error&&n.name==="TimeoutError"?`no response within ${t}ms`:n instanceof Error?n.message:String(n);return{...e,ok:!1,error:r}}}async function Ie(e,t){return Promise.all(e.map(n=>Bo(n,t)))}import{existsSync as ee,readdirSync as vr,readFileSync as wr,statSync as vt}from"node:fs";import{dirname as vi,join as J}from"node:path";var ge=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let n=this.data.get(t);return n?Date.now()-n.timestamp>this.options.ttlMs?(this.data.delete(t),!1):!0:!1}get(t){if(this.has(t))return this.data.get(t)?.value}set(t,n){this.data.set(t,{value:n,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let n of this.data.keys())this.has(n)&&t.push(n);return t}size(){return this.keys().length}};function Zn(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as zo,execSync as Yo}from"node:child_process";import{existsSync as Go}from"node:fs";import{delimiter as Wo,extname as Jo,join as qo}from"node:path";import{delimiter as Pd,extname as Uo}from"node:path";function Fe(){return process.platform==="win32"}function Ho(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Vo(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Ko(e,t){let n=Ho(e),r=Vo(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function Ed(){return Ko(process.platform,process.arch)}function vd(){return Fe()?"tdk.exe":"tdk"}function Qn(e,t=Fe()){return t?Uo(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",n=Fe(),r=Qn(e,n);if(n&&!Jo(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!r.includes(`${e}${o}`)&&r.push(`${e}${o}`)}for(let s of t.split(Wo))if(s)for(let o of r){let i=qo(s,o);if(Go(i))return i}return null}var er=1e4;function tr(){let e=!1;if(process.platform==="win32")try{return zo($("docker")??"docker",["ps"],{stdio:"ignore",timeout:er,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Yo(t,{stdio:"ignore",timeout:er}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function Me(e,t){return e[t]??0}function Xo(e,t){let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r++){let s=[r];for(let o=1;o<=t.length;o++){let i=e[r-1]===t[o-1]?0:1;s[o]=Math.min(Me(s,o-1)+1,Me(n,o)+1,Me(n,o-1)+i)}n=s}return Me(n,t.length)}function Zo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length-1;n++)if(e[n]!==t[n]&&e[n]===t[n+1]&&e[n+1]===t[n]&&e.slice(0,n)===t.slice(0,n)&&e.slice(n+2)===t.slice(n+2))return!0;return!1}function nr(e,t){if(e.length<2||t.length===0||t.includes(e))return;let n=e.toLowerCase(),r,s=Number.POSITIVE_INFINITY;for(let o of t){if(o.length===0)continue;let i=o.toLowerCase(),a=Zo(n,i)?1:Xo(n,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(n.length,i.length)/3)));a>c||(a<s||a===s&&(r===void 0||o<r))&&(r=o,s=a)}return r}import{spawn as Qo}from"node:child_process";import{join as ei}from"node:path";function ti(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=Qo($("tilt")??"tilt",o,{stdio:n.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:n.timeoutMs}),a="",c="";n.inheritStdio||(i.stdout?.on("data",u=>{a+=u.toString()}),i.stderr?.on("data",u=>{c+=u.toString()})),i.on("close",u=>{r({exitCode:u??1,stdout:a,stderr:c})}),i.on("error",u=>{s(new Error(`Failed to spawn tilt: ${u.message}`))})})}async function rr(){try{return(await ti("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function ni(){let e=m();if(!e)throw H.notInProject();return ei(e,".tdk",".tdk-out","Tiltfile")}function sr(e){let t=ni();e.push("-f",t)}function Bd(e,t={}){let n=[];return sr(n),t.focusTargets&&t.focusTargets.length>0&&n.push("--",`--focus=${t.focusTargets.join(",")}`),n.push(...e),t.verbose&&!t.quiet&&n.push("--verbose"),t.watch&&n.push("--watch"),n}function Ud(e={}){let t=[];return sr(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function or(e){return e instanceof Error?e.message:String(e)}function zd(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${or(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var R=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){oi(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function yt(e,t,n=!1){let r=new Set;for(let s of e){let o=nr(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var H={tiltNotInstalled:()=>new R("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${dt}`]),dockerNotAvailable:()=>new R("Docker (or a compatible container runtime) is not running",["Start Docker Desktop, then verify with: `docker ps`","Or start Colima: `colima start`","Or start the Docker service on Linux: `sudo systemctl start docker`",`Setup guide: ${dt}`]),dockerNotResponding:()=>new R("Docker is running but not responding (`docker ps` hung for 10s)",["Quit and reopen Docker Desktop, or run `colima restart`","Then verify with: `docker ps`"]),stackNotFound:(e,t=[])=>new R(`Stack "${e}" not found`,[...yt([e],t),"Run `tdk stacks` to see available stacks","Run `tdk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new R(`Resource "${e}" not found`,[...yt([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=yt(e,t,e.length>1);return new R(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new R(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new R(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new R("Could not find project root (no .tdk/project.json found)",["Run this from within a TDK project","Run `tdk project --yes` to initialize a new project"])};function Yd(){let e=m();return e||H.notInProject().exit()}function ri(e){e instanceof R&&e.exit(),console.error(f.red(`Error: ${or(e)}`)),process.exit(1)}async function si(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),ri(n)}}async function Xd(e,t){let n=[],r=tr();return r==="unresponsive"?n.push(H.dockerNotResponding()):r==="missing"&&n.push(H.dockerNotAvailable()),await rr()||n.push(H.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
13
|
+
`))}function Zu(e,t){console.log(f.green(`All ${e} are ${t}!`))}var mt=62;function Qu(e="\u2500",t=mt){return e.repeat(t)}function Wn(e,t=mt-2){let n=Math.max(0,t-e.length),r=Math.floor(n/2),s=n-r;return" ".repeat(r)+e+" ".repeat(s)}function ed(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function td(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function nd(e){console.log(f.green(`\u2713 ${e}`))}function rd(e){console.log(f.blue(e))}function sd(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function od(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function id(e,t,n=mt){let r=n-2,s="\u2500".repeat(r);console.log(),console.log(f.cyan(`\u256D${s}\u256E`)),console.log(f.cyan("\u2502")+f.bold.white(Wn(e,r))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(Wn(t,r))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as Do}from"node:fs";import{dirname as Co,join as No,resolve as qn}from"node:path";import{cwd as jo}from"node:process";var Jn={name:"tdk-cli-internal",private:!0,version:"1.3.147",description:"TDK CLI \u2014 start services on your machine.",keywords:["tdk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/tdk-landscape/tdk-cli-core#readme",bugs:{url:"https://github.com/tdk-landscape/tdk-cli-core/issues"},repository:{type:"git",url:"git+https://github.com/tdk-landscape/tdk-cli-core.git",directory:"cli"},license:"MIT",author:"TDK Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{tdk:"bin/tdk.js","tdk-cli":"bin/tdk.js"},files:["dist","dist-bundle","bin","templates","README.md","Tiltfile","engine","discovery","specs","ext","!ext/ide-components/code_executor","shared-platform-engineering/docker-templates"],scripts:{build:"tsc && node scripts/bundle.mjs","build:watch":"tsc --watch",lint:"biome check .","lint:fix":"biome check . --write",typecheck:"tsc --project tsconfig.typecheck.json",clean:"rm -rf dist",dev:"bun run build:watch",test:"vitest run","test:watch":"vitest",prepack:"../scripts/stage-npm-engine.sh && npm run build"},dependencies:{commander:"^15.0.0",handlebars:"^4.7.8"},devDependencies:{"@biomejs/biome":"^2.5.13","@types/node":"^22.0.0","@types/react":"^19.3.0",ajv:"^8.17.1",chalk:"^6.0.1",esbuild:"^0.28.2",ink:"^7.1.1",knip:"^6.38.0",react:"^19.3.0","react-devtools-core":"^8.0.0",typescript:"^7.0.2",vite:"^8.3.1",vitest:"^5.0.0"},engines:{node:">=22.12.0"}};function m(e=jo()){let t=qn(e),n=qn("/");for(;t!==n;){if(Do(No(t,".tdk",P)))return t;let r=Co(t);if(r===t)break;t=r}return null}var Ne=null;function Io(){if(Ne)return Ne;let e=Jn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return Ne={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},Ne}function zn(){return Io().version}import{readFileSync as Fo}from"node:fs";import{join as Mo}from"node:path";function je(){let e=m();if(e)try{let t=Fo(Mo(e,".tdk",P),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function ht(e){let t=je(),n=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let r=new URL(n.includes("://")?n:`http://${n}`),s=r.hostname,o=r.protocol==="https:"?"443":"80",i=r.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${r.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${r.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${r.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${r.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function Lo(e){return`${e.replace(/\/+$/,"")}/health`}function gt(e){if(w(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function kt(e,t){return Xn(e,t,n=>Lo(n))}function Yn(e,t){return Xn(e,t,n=>n)}function Xn(e,t,n){let{appBase:r,apiBase:s}=ht(t);return e.filter(o=>o.config?.appType==="frontend"||w(o.config?.appType)).map(o=>{let i=w(o.config.appType)?s:r;return{name:o.name,appType:o.config.appType,url:`${i}${n(gt(o))}`}})}async function Bo(e,t){try{let n=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:n.ok,status:n.status}}catch(n){let r=n instanceof Error&&n.name==="TimeoutError"?`no response within ${t}ms`:n instanceof Error?n.message:String(n);return{...e,ok:!1,error:r}}}async function Ie(e,t){return Promise.all(e.map(n=>Bo(n,t)))}import{existsSync as ee,readdirSync as vr,readFileSync as wr,statSync as vt}from"node:fs";import{dirname as vi,join as J}from"node:path";var ge=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let n=this.data.get(t);return n?Date.now()-n.timestamp>this.options.ttlMs?(this.data.delete(t),!1):!0:!1}get(t){if(this.has(t))return this.data.get(t)?.value}set(t,n){this.data.set(t,{value:n,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let n of this.data.keys())this.has(n)&&t.push(n);return t}size(){return this.keys().length}};function Zn(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as zo,execSync as Yo}from"node:child_process";import{existsSync as Go}from"node:fs";import{delimiter as Wo,extname as Jo,join as qo}from"node:path";import{delimiter as Pd,extname as Uo}from"node:path";function Fe(){return process.platform==="win32"}function Ho(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Vo(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Ko(e,t){let n=Ho(e),r=Vo(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function Ed(){return Ko(process.platform,process.arch)}function vd(){return Fe()?"tdk.exe":"tdk"}function Qn(e,t=Fe()){return t?Uo(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",n=Fe(),r=Qn(e,n);if(n&&!Jo(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!r.includes(`${e}${o}`)&&r.push(`${e}${o}`)}for(let s of t.split(Wo))if(s)for(let o of r){let i=qo(s,o);if(Go(i))return i}return null}var er=1e4;function tr(){let e=!1;if(process.platform==="win32")try{return zo($("docker")??"docker",["ps"],{stdio:"ignore",timeout:er,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Yo(t,{stdio:"ignore",timeout:er}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function Me(e,t){return e[t]??0}function Xo(e,t){let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r++){let s=[r];for(let o=1;o<=t.length;o++){let i=e[r-1]===t[o-1]?0:1;s[o]=Math.min(Me(s,o-1)+1,Me(n,o)+1,Me(n,o-1)+i)}n=s}return Me(n,t.length)}function Zo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length-1;n++)if(e[n]!==t[n]&&e[n]===t[n+1]&&e[n+1]===t[n]&&e.slice(0,n)===t.slice(0,n)&&e.slice(n+2)===t.slice(n+2))return!0;return!1}function nr(e,t){if(e.length<2||t.length===0||t.includes(e))return;let n=e.toLowerCase(),r,s=Number.POSITIVE_INFINITY;for(let o of t){if(o.length===0)continue;let i=o.toLowerCase(),a=Zo(n,i)?1:Xo(n,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(n.length,i.length)/3)));a>c||(a<s||a===s&&(r===void 0||o<r))&&(r=o,s=a)}return r}import{spawn as Qo}from"node:child_process";import{join as ei}from"node:path";function ti(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=Qo($("tilt")??"tilt",o,{stdio:n.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:n.timeoutMs}),a="",c="";n.inheritStdio||(i.stdout?.on("data",u=>{a+=u.toString()}),i.stderr?.on("data",u=>{c+=u.toString()})),i.on("close",u=>{r({exitCode:u??1,stdout:a,stderr:c})}),i.on("error",u=>{s(new Error(`Failed to spawn tilt: ${u.message}`))})})}async function rr(){try{return(await ti("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function ni(){let e=m();if(!e)throw H.notInProject();return ei(e,".tdk",".tdk-out","Tiltfile")}function sr(e){let t=ni();e.push("-f",t)}function Bd(e,t={}){let n=[];return sr(n),t.focusTargets&&t.focusTargets.length>0&&n.push("--",`--focus=${t.focusTargets.join(",")}`),n.push(...e),t.verbose&&!t.quiet&&n.push("--verbose"),t.watch&&n.push("--watch"),n}function Ud(e={}){let t=[];return sr(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function or(e){return e instanceof Error?e.message:String(e)}function zd(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${or(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var R=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){oi(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function yt(e,t,n=!1){let r=new Set;for(let s of e){let o=nr(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var H={tiltNotInstalled:()=>new R("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${dt}`]),dockerNotAvailable:()=>new R("Docker (or a compatible container runtime) is not running",["Start Docker Desktop, then verify with: `docker ps`","Or start Colima: `colima start`","Or start the Docker service on Linux: `sudo systemctl start docker`",`Setup guide: ${dt}`]),dockerNotResponding:()=>new R("Docker is running but not responding (`docker ps` hung for 10s)",["Quit and reopen Docker Desktop, or run `colima restart`","Then verify with: `docker ps`"]),stackNotFound:(e,t=[])=>new R(`Stack "${e}" not found`,[...yt([e],t),"Run `tdk stacks` to see available stacks","Run `tdk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new R(`Resource "${e}" not found`,[...yt([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=yt(e,t,e.length>1);return new R(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new R(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new R(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new R("Could not find project root (no .tdk/project.json found)",["Run this from within a TDK project","Run `tdk project --yes` to initialize a new project"])};function Yd(){let e=m();return e||H.notInProject().exit()}function ri(e){e instanceof R&&e.exit(),console.error(f.red(`Error: ${or(e)}`)),process.exit(1)}async function si(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),ri(n)}}async function Xd(e,t){let n=[],r=tr();return r==="unresponsive"?n.push(H.dockerNotResponding()):r==="missing"&&n.push(H.dockerNotAvailable()),await rr()||n.push(H.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
14
14
|
TDK can't start - missing prerequisites:
|
|
15
15
|
`)),n.forEach((s,o)=>{o>0&&console.error(""),s.display()}),console.error(f.gray("\nRun `tdk doctor` for a full environment check.")),process.exit(1)),si(e,t)}function Zd(e,t=1){console.error(f.red(`Error: ${e}`)),process.exit(t)}function oi(e,t,n){if(console.error(f.red(`\u274C ${e}`)),t&&console.error(f.gray(` ${t}`)),n&&n.length>0){console.error(f.yellow(`
|
|
16
16
|
\u{1F4A1} Suggestions:`));for(let r of n)console.error(f.cyan(` \u2192 ${r}`))}}function Qd(e,t){console.error(f.red(`
|
package/cli/dist-bundle/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
3
|
-
import{$ as k1,$a as cB,A as R1,Aa as $m,B as b1,Ba as V1,C as fA,Ca as X1,D as Xm,Da as AB,E as T1,Ea as qA,F as N1,Fa as Z1,G as w1,Ga as P1,H as x1,Ha as W1,I as is,Ia as As,J as _1,Ja as Dg,K as Zm,Ka as $1,L as dA,La as eD,M as xl,Ma as tD,N as Ig,Na as lB,O as U1,Oa as nQ,P as M1,Pa as nD,Q as O1,Qa as aD,R as Ku,Ra as oD,S as di,Sa as iD,T as gn,Ta as AD,U as on,Ua as lD,V as Za,Va as rD,W as wn,Wa as sD,X as $C,Xa as cD,Y as Uo,Ya as rB,Z as eB,Za as sB,_ as Jn,_a as ls,a as b,aa as H1,ab as uB,b as XC,ba as Pm,bb as uD,c as YA,ca as yg,cb as eE,d as Tl,da as G1,db as aQ,e as fr,ea as Wm,eb as fD,f as Ju,fa as Qg,fb as dD,g as Q1,ga as Yu,gb as gD,h as dr,ha as tB,hb as pD,i as qm,ia as nB,ib as mD,j as Vm,ja as tQ,jb as fB,k as sc,ka as L1,kb as ED,l as Nl,la as Sg,lb as hD,m as wl,ma as Zo,mb as oQ,n as Wy,na as Po,nb as iQ,o as Pn,oa as nt,ob as CD,p as ki,pa as j1,pb as BD,q as S1,qa as z1,qb as ID,r as $y,ra as F1,rb as yD,s as v1,sa as J1,t as cc,ta as aB,u as vn,ua as vg,ub as QD,v as gr,va as K1,vb as SD,w as PC,wa as oB,x as eQ,xa as iB,y as WC,ya as Y1,z as D1,za as q1}from"./chunk-SWAGCVPQ.js";import{a as B1,c as ZC,d as I1,e as y1}from"./chunk-42IVF3YT.js";import{a as Bg,b as Ha,c as lx,d as st}from"./chunk-6EA4DGCY.js";var g2=Ha(TB=>{"use strict";var dM=Symbol.for("react.transitional.element"),gM=Symbol.for("react.fragment");function d2(n,o,l){var s=null;if(l!==void 0&&(s=""+l),o.key!==void 0&&(s=""+o.key),"key"in o){l={};for(var u in o)u!=="key"&&(l[u]=o[u])}else l=o;return o=l.ref,{$$typeof:dM,type:n,key:s,ref:o!==void 0?o:null,props:l}}TB.Fragment=gM;TB.jsx=d2;TB.jsxs=d2});var R2=Ha(Rt=>{"use strict";var jQ=Symbol.for("react.transitional.element"),pM=Symbol.for("react.portal"),mM=Symbol.for("react.fragment"),EM=Symbol.for("react.strict_mode"),hM=Symbol.for("react.profiler"),CM=Symbol.for("react.consumer"),BM=Symbol.for("react.context"),IM=Symbol.for("react.forward_ref"),yM=Symbol.for("react.suspense"),QM=Symbol.for("react.memo"),C2=Symbol.for("react.lazy"),SM=Symbol.for("react.activity"),vM=Symbol.for("react.view_transition"),p2=Symbol.iterator;function DM(n){return n===null||typeof n!="object"?null:(n=p2&&n[p2]||n["@@iterator"],typeof n=="function"?n:null)}var B2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I2=Object.assign,y2={};function kg(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}kg.prototype.isReactComponent={};kg.prototype.setState=function(n,o){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,o,"setState")};kg.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Q2(){}Q2.prototype=kg.prototype;function zQ(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}var FQ=zQ.prototype=new Q2;FQ.constructor=zQ;I2(FQ,kg.prototype);FQ.isPureReactComponent=!0;var m2=Array.isArray;function LQ(){}var Kn={H:null,A:null,T:null,S:null},S2=Object.prototype.hasOwnProperty;function JQ(n,o,l){var s=l.ref;return{$$typeof:jQ,type:n,key:o,ref:s!==void 0?s:null,props:l}}function RM(n,o){return JQ(n.type,o,n.props)}function KQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===jQ}function bM(n){var o={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return o[l]})}var E2=/\/+/g;function GQ(n,o){return typeof n=="object"&&n!==null&&n.key!=null?bM(""+n.key):o.toString(36)}function TM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(LQ,LQ):(n.status="pending",n.then(function(o){n.status==="pending"&&(n.status="fulfilled",n.value=o)},function(o){n.status==="pending"&&(n.status="rejected",n.reason=o)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Og(n,o,l,s,u){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var E=!1;if(n===null)E=!0;else switch(p){case"bigint":case"string":case"number":E=!0;break;case"object":switch(n.$$typeof){case jQ:case pM:E=!0;break;case C2:return E=n._init,Og(E(n._payload),o,l,s,u)}}if(E)return u=u(n),E=s===""?"."+GQ(n,0):s,m2(u)?(l="",E!=null&&(l=E.replace(E2,"$&/")+"/"),Og(u,o,l,"",function(S){return S})):u!=null&&(KQ(u)&&(u=RM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(E2,"$&/")+"/")+E)),o.push(u)),1;E=0;var B=s===""?".":s+":";if(m2(n))for(var I=0;I<n.length;I++)s=n[I],p=B+GQ(s,I),E+=Og(s,o,l,p,u);else if(I=DM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+GQ(s,I++),E+=Og(s,o,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Og(TM(n),o,l,s,u);throw o=String(n),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return E}function NB(n,o,l){if(n==null)return n;var s=[],u=0;return Og(n,s,"","",function(p){return o.call(l,p,u++)}),s}function NM(n){if(n._status===-1){var o=n._result,l=o();l.then(function(s){(n._status===0||n._status===-1)&&(n._status=1,n._result=s,l.status===void 0&&(l.status="fulfilled",l.value=s))},function(s){(n._status===0||n._status===-1)&&(n._status=2,n._result=s,l.status===void 0&&(l.status="rejected",l.reason=s))}),n._status===-1&&(n._status=0,n._result=l)}if(n._status===1)return n._result.default;throw n._result}var h2=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function v2(n){var o=Kn.T,l={};l.types=o!==null?o.types:null,Kn.T=l;try{var s=n(),u=Kn.S;u!==null&&u(l,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(LQ,h2)}catch(p){h2(p)}finally{o!==null&&l.types!==null&&(o.types=l.types),Kn.T=o}}function D2(n){var o=Kn.T;if(o!==null){var l=o.types;l===null?o.types=[n]:l.indexOf(n)===-1&&l.push(n)}else v2(D2.bind(null,n))}var wM={map:NB,forEach:function(n,o,l){NB(n,function(){o.apply(this,arguments)},l)},count:function(n){var o=0;return NB(n,function(){o++}),o},toArray:function(n){return NB(n,function(o){return o})||[]},only:function(n){if(!KQ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Rt.Activity=SM;Rt.Children=wM;Rt.Component=kg;Rt.Fragment=mM;Rt.Profiler=hM;Rt.PureComponent=zQ;Rt.StrictMode=EM;Rt.Suspense=yM;Rt.ViewTransition=vM;Rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kn;Rt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Kn.H.useMemoCache(n)}};Rt.addTransitionType=D2;Rt.cache=function(n){return function(){return n.apply(null,arguments)}};Rt.cacheSignal=function(){return null};Rt.cloneElement=function(n,o,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=I2({},n.props),u=n.key;if(o!=null)for(p in o.key!==void 0&&(u=""+o.key),o)!S2.call(o,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&o.ref===void 0||(s[p]=o[p]);var p=arguments.length-2;if(p===1)s.children=l;else if(1<p){for(var E=Array(p),B=0;B<p;B++)E[B]=arguments[B+2];s.children=E}return JQ(n.type,u,s)};Rt.createContext=function(n){return n={$$typeof:BM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:CM,_context:n},n};Rt.createElement=function(n,o,l){var s,u={},p=null;if(o!=null)for(s in o.key!==void 0&&(p=""+o.key),o)S2.call(o,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(u[s]=o[s]);var E=arguments.length-2;if(E===1)u.children=l;else if(1<E){for(var B=Array(E),I=0;I<E;I++)B[I]=arguments[I+2];u.children=B}if(n&&n.defaultProps)for(s in E=n.defaultProps,E)u[s]===void 0&&(u[s]=E[s]);return JQ(n,p,u)};Rt.createRef=function(){return{current:null}};Rt.forwardRef=function(n){return{$$typeof:IM,render:n}};Rt.isValidElement=KQ;Rt.lazy=function(n){return{$$typeof:C2,_payload:{_status:-1,_result:n},_init:NM}};Rt.memo=function(n,o){return{$$typeof:QM,type:n,compare:o===void 0?null:o}};Rt.startTransition=v2;Rt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Rt.use=function(n){return Kn.H.use(n)};Rt.useActionState=function(n,o,l){return Kn.H.useActionState(n,o,l)};Rt.useCallback=function(n,o){return Kn.H.useCallback(n,o)};Rt.useContext=function(n){return Kn.H.useContext(n)};Rt.useDebugValue=function(){};Rt.useDeferredValue=function(n,o){return Kn.H.useDeferredValue(n,o)};Rt.useEffect=function(n,o){return Kn.H.useEffect(n,o)};Rt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Rt.useId=function(){return Kn.H.useId()};Rt.useImperativeHandle=function(n,o,l){return Kn.H.useImperativeHandle(n,o,l)};Rt.useInsertionEffect=function(n,o){return Kn.H.useInsertionEffect(n,o)};Rt.useLayoutEffect=function(n,o){return Kn.H.useLayoutEffect(n,o)};Rt.useMemo=function(n,o){return Kn.H.useMemo(n,o)};Rt.useOptimistic=function(n,o){return Kn.H.useOptimistic(n,o)};Rt.useReducer=function(n,o,l){return Kn.H.useReducer(n,o,l)};Rt.useRef=function(n){return Kn.H.useRef(n)};Rt.useState=function(n){return Kn.H.useState(n)};Rt.useSyncExternalStore=function(n,o,l){return Kn.H.useSyncExternalStore(n,o,l)};Rt.useTransition=function(){return Kn.H.useTransition()};Rt.version="19.3.0"});var b2=Ha((yt,wB)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(y,U){Object.defineProperty(s.prototype,y,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",U[0],U[1])}})}function o(y){return y===null||typeof y!="object"?null:(y=$a&&y[$a]||y["@@iterator"],typeof y=="function"?y:null)}function l(y,U){y=(y=y.constructor)&&(y.displayName||y.name)||"ReactClass";var ue=y+"."+U;St[ue]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,y),St[ue]=!0)}function s(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function u(){}function p(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function E(){}function B(y){return""+y}function I(y){try{B(y);var U=!1}catch{U=!0}if(U){U=console;var ue=U.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return ue.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),B(y)}}function S(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===Wn?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case Qt:return"Fragment";case Te:return"Profiler";case J:return"StrictMode";case ut:return"Suspense";case qe:return"SuspenseList";case mn:return"Activity";case Ga:return"ViewTransition"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case Tt:return"Portal";case Pe:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case We:var U=y.render;return y=y.displayName,y||(y=U.displayName||U.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case He:return U=y.displayName||null,U!==null?U:S(y.type)||"Memo";case $e:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function N(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===$e)return"<...>";try{var U=S(y);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function x(){var y=Ve.A;return y===null?null:y.getOwner()}function v(){return Error("react-stack-top-frame")}function w(y){if(Wt.call(y,"key")){var U=Object.getOwnPropertyDescriptor(y,"key").get;if(U&&U.isReactWarning)return!1}return y.key!==void 0}function z(y,U){function ue(){On||(On=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",U))}ue.isReactWarning=!0,Object.defineProperty(y,"key",{get:ue,configurable:!0})}function F(){var y=S(this.type);return Na[y]||(Na[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function M(y,U,ue,re,ce,ct){var xe=ue.ref;return y={$$typeof:Me,type:y,key:U,props:ue,_owner:re},(xe!==void 0?xe:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:F}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function ae(y,U){return U=M(y.type,U,y.props,y._owner,y._debugStack,y._debugTask),y._store&&(U._store.validated=y._store.validated),U}function he(y){Re(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===$e&&(y._payload.status==="fulfilled"?Re(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function Re(y){return typeof y=="object"&&y!==null&&y.$$typeof===Me}function Ie(y){var U={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ue){return U[ue]})}function je(y,U){return typeof y=="object"&&y!==null&&y.key!=null?(I(y.key),Ie(""+y.key)):U.toString(36)}function Oe(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(E,E):(y.status="pending",y.then(function(U){y.status==="pending"&&(y.status="fulfilled",y.value=U)},function(U){y.status==="pending"&&(y.status="rejected",y.reason=U)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function be(y,U,ue,re,ce){var ct=typeof y;(ct==="undefined"||ct==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ct){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case Tt:xe=!0;break;case $e:return xe=y._init,be(xe(y._payload),U,ue,re,ce)}}if(xe){xe=y,ce=ce(xe);var Xe=re===""?"."+je(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function($n){return $n})):ce!=null&&(Re(ce)&&(ce.key!=null&&(xe&&xe.key===ce.key||I(ce.key)),ue=ae(ce,ue+(ce.key==null||xe&&xe.key===ce.key?"":(""+ce.key).replace(Qo,"$&/")+"/")+Xe),re!==""&&xe!=null&&Re(xe)&&xe.key==null&&xe._store&&!xe._store.validated&&(ue._store.validated=2),ce=ue),U.push(ce)),1}if(xe=0,Xe=re===""?".":re+":",ua(y))for(var Dt=0;Dt<y.length;Dt++)re=y[Dt],ct=Xe+je(re,Dt),xe+=be(re,U,ue,ct,ce);else if(Dt=o(y),typeof Dt=="function")for(Dt===y.entries&&(qt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qt=!0),y=Dt.call(y),Dt=0;!(re=y.next()).done;)re=re.value,ct=Xe+je(re,Dt++),xe+=be(re,U,ue,ct,ce);else if(ct==="object"){if(typeof y.then=="function")return be(Oe(y),U,ue,re,ce);throw U=String(y),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ze(y,U,ue){if(y==null)return y;var re=[],ce=0;return be(y,re,"","",function(ct){return U.call(ue,ct,ce++)}),re}function Qe(y){if(y._status===-1){var U=null,ue=null,re=y._ioInfo;re!=null&&(re.start=re.end=performance.now(),re.value=new Promise(function(xe,Xe){U=xe,ue=Xe})),re=y._result;var ce=re();if(ce.then(function(xe){if(y._status===0||y._status===-1){y._status=1,y._result=xe;var Xe=y._ioInfo;if(Xe!=null){Xe.end=performance.now();var Dt=xe?.default;U(Dt),Xe.value.status="fulfilled",Xe.value.value=Dt}ce.status===void 0&&(ce.status="fulfilled",ce.value=xe)}},function(xe){if(y._status===0||y._status===-1){y._status=2,y._result=xe;var Xe=y._ioInfo;Xe!=null&&(Xe.end=performance.now(),Xe.value.then(E,E),ue(xe),Xe.value.status="rejected",Xe.value.reason=xe),ce.status===void 0&&(ce.status="rejected",ce.reason=xe)}}),re=y._ioInfo,re!=null){var ct=ce.displayName;typeof ct=="string"&&(re.name=ct)}y._status===-1&&(y._status=0,y._result=ce)}if(y._status===1)return re=y._result,re===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
3
|
+
import{$ as k1,$a as cB,A as R1,Aa as $m,B as b1,Ba as V1,C as fA,Ca as X1,D as Xm,Da as AB,E as T1,Ea as qA,F as N1,Fa as Z1,G as w1,Ga as P1,H as x1,Ha as W1,I as is,Ia as As,J as _1,Ja as Dg,K as Zm,Ka as $1,L as dA,La as eD,M as xl,Ma as tD,N as Ig,Na as lB,O as U1,Oa as nQ,P as M1,Pa as nD,Q as O1,Qa as aD,R as Ku,Ra as oD,S as di,Sa as iD,T as gn,Ta as AD,U as on,Ua as lD,V as Za,Va as rD,W as wn,Wa as sD,X as $C,Xa as cD,Y as Uo,Ya as rB,Z as eB,Za as sB,_ as Jn,_a as ls,a as b,aa as H1,ab as uB,b as XC,ba as Pm,bb as uD,c as YA,ca as yg,cb as eE,d as Tl,da as G1,db as aQ,e as fr,ea as Wm,eb as fD,f as Ju,fa as Qg,fb as dD,g as Q1,ga as Yu,gb as gD,h as dr,ha as tB,hb as pD,i as qm,ia as nB,ib as mD,j as Vm,ja as tQ,jb as fB,k as sc,ka as L1,kb as ED,l as Nl,la as Sg,lb as hD,m as wl,ma as Zo,mb as oQ,n as Wy,na as Po,nb as iQ,o as Pn,oa as nt,ob as CD,p as ki,pa as j1,pb as BD,q as S1,qa as z1,qb as ID,r as $y,ra as F1,rb as yD,s as v1,sa as J1,t as cc,ta as aB,u as vn,ua as vg,ub as QD,v as gr,va as K1,vb as SD,w as PC,wa as oB,x as eQ,xa as iB,y as WC,ya as Y1,z as D1,za as q1}from"./chunk-LNZN426S.js";import{a as B1,c as ZC,d as I1,e as y1}from"./chunk-42IVF3YT.js";import{a as Bg,b as Ha,c as lx,d as st}from"./chunk-6EA4DGCY.js";var g2=Ha(TB=>{"use strict";var dM=Symbol.for("react.transitional.element"),gM=Symbol.for("react.fragment");function d2(n,o,l){var s=null;if(l!==void 0&&(s=""+l),o.key!==void 0&&(s=""+o.key),"key"in o){l={};for(var u in o)u!=="key"&&(l[u]=o[u])}else l=o;return o=l.ref,{$$typeof:dM,type:n,key:s,ref:o!==void 0?o:null,props:l}}TB.Fragment=gM;TB.jsx=d2;TB.jsxs=d2});var R2=Ha(Rt=>{"use strict";var jQ=Symbol.for("react.transitional.element"),pM=Symbol.for("react.portal"),mM=Symbol.for("react.fragment"),EM=Symbol.for("react.strict_mode"),hM=Symbol.for("react.profiler"),CM=Symbol.for("react.consumer"),BM=Symbol.for("react.context"),IM=Symbol.for("react.forward_ref"),yM=Symbol.for("react.suspense"),QM=Symbol.for("react.memo"),C2=Symbol.for("react.lazy"),SM=Symbol.for("react.activity"),vM=Symbol.for("react.view_transition"),p2=Symbol.iterator;function DM(n){return n===null||typeof n!="object"?null:(n=p2&&n[p2]||n["@@iterator"],typeof n=="function"?n:null)}var B2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I2=Object.assign,y2={};function kg(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}kg.prototype.isReactComponent={};kg.prototype.setState=function(n,o){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,o,"setState")};kg.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Q2(){}Q2.prototype=kg.prototype;function zQ(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}var FQ=zQ.prototype=new Q2;FQ.constructor=zQ;I2(FQ,kg.prototype);FQ.isPureReactComponent=!0;var m2=Array.isArray;function LQ(){}var Kn={H:null,A:null,T:null,S:null},S2=Object.prototype.hasOwnProperty;function JQ(n,o,l){var s=l.ref;return{$$typeof:jQ,type:n,key:o,ref:s!==void 0?s:null,props:l}}function RM(n,o){return JQ(n.type,o,n.props)}function KQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===jQ}function bM(n){var o={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return o[l]})}var E2=/\/+/g;function GQ(n,o){return typeof n=="object"&&n!==null&&n.key!=null?bM(""+n.key):o.toString(36)}function TM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(LQ,LQ):(n.status="pending",n.then(function(o){n.status==="pending"&&(n.status="fulfilled",n.value=o)},function(o){n.status==="pending"&&(n.status="rejected",n.reason=o)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Og(n,o,l,s,u){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var E=!1;if(n===null)E=!0;else switch(p){case"bigint":case"string":case"number":E=!0;break;case"object":switch(n.$$typeof){case jQ:case pM:E=!0;break;case C2:return E=n._init,Og(E(n._payload),o,l,s,u)}}if(E)return u=u(n),E=s===""?"."+GQ(n,0):s,m2(u)?(l="",E!=null&&(l=E.replace(E2,"$&/")+"/"),Og(u,o,l,"",function(S){return S})):u!=null&&(KQ(u)&&(u=RM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(E2,"$&/")+"/")+E)),o.push(u)),1;E=0;var B=s===""?".":s+":";if(m2(n))for(var I=0;I<n.length;I++)s=n[I],p=B+GQ(s,I),E+=Og(s,o,l,p,u);else if(I=DM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+GQ(s,I++),E+=Og(s,o,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Og(TM(n),o,l,s,u);throw o=String(n),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return E}function NB(n,o,l){if(n==null)return n;var s=[],u=0;return Og(n,s,"","",function(p){return o.call(l,p,u++)}),s}function NM(n){if(n._status===-1){var o=n._result,l=o();l.then(function(s){(n._status===0||n._status===-1)&&(n._status=1,n._result=s,l.status===void 0&&(l.status="fulfilled",l.value=s))},function(s){(n._status===0||n._status===-1)&&(n._status=2,n._result=s,l.status===void 0&&(l.status="rejected",l.reason=s))}),n._status===-1&&(n._status=0,n._result=l)}if(n._status===1)return n._result.default;throw n._result}var h2=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function v2(n){var o=Kn.T,l={};l.types=o!==null?o.types:null,Kn.T=l;try{var s=n(),u=Kn.S;u!==null&&u(l,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(LQ,h2)}catch(p){h2(p)}finally{o!==null&&l.types!==null&&(o.types=l.types),Kn.T=o}}function D2(n){var o=Kn.T;if(o!==null){var l=o.types;l===null?o.types=[n]:l.indexOf(n)===-1&&l.push(n)}else v2(D2.bind(null,n))}var wM={map:NB,forEach:function(n,o,l){NB(n,function(){o.apply(this,arguments)},l)},count:function(n){var o=0;return NB(n,function(){o++}),o},toArray:function(n){return NB(n,function(o){return o})||[]},only:function(n){if(!KQ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Rt.Activity=SM;Rt.Children=wM;Rt.Component=kg;Rt.Fragment=mM;Rt.Profiler=hM;Rt.PureComponent=zQ;Rt.StrictMode=EM;Rt.Suspense=yM;Rt.ViewTransition=vM;Rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kn;Rt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Kn.H.useMemoCache(n)}};Rt.addTransitionType=D2;Rt.cache=function(n){return function(){return n.apply(null,arguments)}};Rt.cacheSignal=function(){return null};Rt.cloneElement=function(n,o,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=I2({},n.props),u=n.key;if(o!=null)for(p in o.key!==void 0&&(u=""+o.key),o)!S2.call(o,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&o.ref===void 0||(s[p]=o[p]);var p=arguments.length-2;if(p===1)s.children=l;else if(1<p){for(var E=Array(p),B=0;B<p;B++)E[B]=arguments[B+2];s.children=E}return JQ(n.type,u,s)};Rt.createContext=function(n){return n={$$typeof:BM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:CM,_context:n},n};Rt.createElement=function(n,o,l){var s,u={},p=null;if(o!=null)for(s in o.key!==void 0&&(p=""+o.key),o)S2.call(o,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(u[s]=o[s]);var E=arguments.length-2;if(E===1)u.children=l;else if(1<E){for(var B=Array(E),I=0;I<E;I++)B[I]=arguments[I+2];u.children=B}if(n&&n.defaultProps)for(s in E=n.defaultProps,E)u[s]===void 0&&(u[s]=E[s]);return JQ(n,p,u)};Rt.createRef=function(){return{current:null}};Rt.forwardRef=function(n){return{$$typeof:IM,render:n}};Rt.isValidElement=KQ;Rt.lazy=function(n){return{$$typeof:C2,_payload:{_status:-1,_result:n},_init:NM}};Rt.memo=function(n,o){return{$$typeof:QM,type:n,compare:o===void 0?null:o}};Rt.startTransition=v2;Rt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Rt.use=function(n){return Kn.H.use(n)};Rt.useActionState=function(n,o,l){return Kn.H.useActionState(n,o,l)};Rt.useCallback=function(n,o){return Kn.H.useCallback(n,o)};Rt.useContext=function(n){return Kn.H.useContext(n)};Rt.useDebugValue=function(){};Rt.useDeferredValue=function(n,o){return Kn.H.useDeferredValue(n,o)};Rt.useEffect=function(n,o){return Kn.H.useEffect(n,o)};Rt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Rt.useId=function(){return Kn.H.useId()};Rt.useImperativeHandle=function(n,o,l){return Kn.H.useImperativeHandle(n,o,l)};Rt.useInsertionEffect=function(n,o){return Kn.H.useInsertionEffect(n,o)};Rt.useLayoutEffect=function(n,o){return Kn.H.useLayoutEffect(n,o)};Rt.useMemo=function(n,o){return Kn.H.useMemo(n,o)};Rt.useOptimistic=function(n,o){return Kn.H.useOptimistic(n,o)};Rt.useReducer=function(n,o,l){return Kn.H.useReducer(n,o,l)};Rt.useRef=function(n){return Kn.H.useRef(n)};Rt.useState=function(n){return Kn.H.useState(n)};Rt.useSyncExternalStore=function(n,o,l){return Kn.H.useSyncExternalStore(n,o,l)};Rt.useTransition=function(){return Kn.H.useTransition()};Rt.version="19.3.0"});var b2=Ha((yt,wB)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(y,U){Object.defineProperty(s.prototype,y,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",U[0],U[1])}})}function o(y){return y===null||typeof y!="object"?null:(y=$a&&y[$a]||y["@@iterator"],typeof y=="function"?y:null)}function l(y,U){y=(y=y.constructor)&&(y.displayName||y.name)||"ReactClass";var ue=y+"."+U;St[ue]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,y),St[ue]=!0)}function s(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function u(){}function p(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function E(){}function B(y){return""+y}function I(y){try{B(y);var U=!1}catch{U=!0}if(U){U=console;var ue=U.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return ue.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),B(y)}}function S(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===Wn?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case Qt:return"Fragment";case Te:return"Profiler";case J:return"StrictMode";case ut:return"Suspense";case qe:return"SuspenseList";case mn:return"Activity";case Ga:return"ViewTransition"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case Tt:return"Portal";case Pe:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case We:var U=y.render;return y=y.displayName,y||(y=U.displayName||U.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case He:return U=y.displayName||null,U!==null?U:S(y.type)||"Memo";case $e:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function N(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===$e)return"<...>";try{var U=S(y);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function x(){var y=Ve.A;return y===null?null:y.getOwner()}function v(){return Error("react-stack-top-frame")}function w(y){if(Wt.call(y,"key")){var U=Object.getOwnPropertyDescriptor(y,"key").get;if(U&&U.isReactWarning)return!1}return y.key!==void 0}function z(y,U){function ue(){On||(On=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",U))}ue.isReactWarning=!0,Object.defineProperty(y,"key",{get:ue,configurable:!0})}function F(){var y=S(this.type);return Na[y]||(Na[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function M(y,U,ue,re,ce,ct){var xe=ue.ref;return y={$$typeof:Me,type:y,key:U,props:ue,_owner:re},(xe!==void 0?xe:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:F}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function ae(y,U){return U=M(y.type,U,y.props,y._owner,y._debugStack,y._debugTask),y._store&&(U._store.validated=y._store.validated),U}function he(y){Re(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===$e&&(y._payload.status==="fulfilled"?Re(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function Re(y){return typeof y=="object"&&y!==null&&y.$$typeof===Me}function Ie(y){var U={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ue){return U[ue]})}function je(y,U){return typeof y=="object"&&y!==null&&y.key!=null?(I(y.key),Ie(""+y.key)):U.toString(36)}function Oe(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(E,E):(y.status="pending",y.then(function(U){y.status==="pending"&&(y.status="fulfilled",y.value=U)},function(U){y.status==="pending"&&(y.status="rejected",y.reason=U)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function be(y,U,ue,re,ce){var ct=typeof y;(ct==="undefined"||ct==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ct){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case Tt:xe=!0;break;case $e:return xe=y._init,be(xe(y._payload),U,ue,re,ce)}}if(xe){xe=y,ce=ce(xe);var Xe=re===""?"."+je(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function($n){return $n})):ce!=null&&(Re(ce)&&(ce.key!=null&&(xe&&xe.key===ce.key||I(ce.key)),ue=ae(ce,ue+(ce.key==null||xe&&xe.key===ce.key?"":(""+ce.key).replace(Qo,"$&/")+"/")+Xe),re!==""&&xe!=null&&Re(xe)&&xe.key==null&&xe._store&&!xe._store.validated&&(ue._store.validated=2),ce=ue),U.push(ce)),1}if(xe=0,Xe=re===""?".":re+":",ua(y))for(var Dt=0;Dt<y.length;Dt++)re=y[Dt],ct=Xe+je(re,Dt),xe+=be(re,U,ue,ct,ce);else if(Dt=o(y),typeof Dt=="function")for(Dt===y.entries&&(qt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qt=!0),y=Dt.call(y),Dt=0;!(re=y.next()).done;)re=re.value,ct=Xe+je(re,Dt++),xe+=be(re,U,ue,ct,ce);else if(ct==="object"){if(typeof y.then=="function")return be(Oe(y),U,ue,re,ce);throw U=String(y),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ze(y,U,ue){if(y==null)return y;var re=[],ce=0;return be(y,re,"","",function(ct){return U.call(ue,ct,ce++)}),re}function Qe(y){if(y._status===-1){var U=null,ue=null,re=y._ioInfo;re!=null&&(re.start=re.end=performance.now(),re.value=new Promise(function(xe,Xe){U=xe,ue=Xe})),re=y._result;var ce=re();if(ce.then(function(xe){if(y._status===0||y._status===-1){y._status=1,y._result=xe;var Xe=y._ioInfo;if(Xe!=null){Xe.end=performance.now();var Dt=xe?.default;U(Dt),Xe.value.status="fulfilled",Xe.value.value=Dt}ce.status===void 0&&(ce.status="fulfilled",ce.value=xe)}},function(xe){if(y._status===0||y._status===-1){y._status=2,y._result=xe;var Xe=y._ioInfo;Xe!=null&&(Xe.end=performance.now(),Xe.value.then(E,E),ue(xe),Xe.value.status="rejected",Xe.value.reason=xe),ce.status===void 0&&(ce.status="rejected",ce.reason=xe)}}),re=y._ioInfo,re!=null){var ct=ce.displayName;typeof ct=="string"&&(re.name=ct)}y._status===-1&&(y._status=0,y._result=ce)}if(y._status===1)return re=y._result,re===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
4
4
|
|
|
5
5
|
Your code should look like:
|
|
6
6
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -607,7 +607,7 @@ Available templates:`));for(let[p,E]of Object.entries(QB))console.log(` ${b.cya
|
|
|
607
607
|
`,0),nt(`Source: ${l.bundledPath?"bundled TDK example":l.repo}`,0),nt(`Destination: ${u}
|
|
608
608
|
`,0);try{if(l.bundledPath){let p=SB(yU(QU(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");hU(SB(p,l.bundledPath),u,{recursive:!0});let E=IU(u).replace(/-/g,"_");for(let B of["services/platform/messaging/docker-compose.yml","services/shop/orders-api/service.json","services/shop/orders-api/src/index.ts","services/shop/orders-worker/service.json","services/shop/orders-worker/src/index.ts"]){let I=Mg(u,B),S=QQ(I,"utf-8");BU(I,S.replaceAll("tdk_example",E))}}else EU("git",["clone",l.repo,u],{stdio:"inherit"})}catch{Uo(l.bundledPath?"Bundled example copy failed. Reinstall the TDK CLI package and try again.":"git clone failed. Check you have git installed and network access.")}console.log(b.green(`
|
|
609
609
|
\u2705 Cloned "${n}" into ${s}/`)),nt(`
|
|
610
|
-
Next steps:`,0),nt(`1. cd ${s}`),nt("2. tdk doctor # check Docker/Tilt are ready"),nt("3. tdk up # start the stack")}var AE={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:DU()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},vR=new SU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(QB).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--yes","Non-interactive mode (use defaults)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,o)=>{let{assertMachineReadyOrExit:l}=await import("./cold-preflight-
|
|
610
|
+
Next steps:`,0),nt(`1. cd ${s}`),nt("2. tdk doctor # check Docker/Tilt are ready"),nt("3. tdk up # start the stack")}var AE={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:DU()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},vR=new SU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(QB).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--yes","Non-interactive mode (use defaults)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,o)=>{let{assertMachineReadyOrExit:l}=await import("./cold-preflight-D7CAIHND.js");if(await l(),n){await wn(async()=>RU(n,o.path));return}await wn(async()=>{let s=vn();s||(s=QR(),Po(`\u{1F680} Initializing new TDK project...
|
|
611
611
|
`),nt(`Location: ${s}
|
|
612
612
|
`,0));let u=Mg(s,".tdk"),p=Mg(u,sc);if(o.check){let w=wl.every(F=>uc(Mg(s,".tdk",".tdk-out",F))),z=uc(p);if(w&&z){let F=Gi(s);Zo("Project configuration is valid"),nt(`Project: ${F.project.name}`,3),nt(`Phases: ${Object.keys(F.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(b.yellow("\u26A0\uFE0F Project configuration incomplete:")),z||nt(".tdk/project.json (not found)",3),!w)for(let F of wl.filter(M=>!uc(Mg(s,".tdk/.tdk-out",M))))nt(`.tdk/.tdk-out/${F} (not found)`,3);nt("Run `tdk project` to create them."),process.exit(1)}}Yu("Project Configuration"),nt(`Project root: ${s}
|
|
613
613
|
`,0),uc(u)||(TD(u),Zo("Created: .tdk/ directory"));let E=uc(p);if(E&&!o.force){Zo(".tdk/project.json exists");let w=JSON.parse(QQ(p,"utf-8")),z=Gi(s),F=SQ(s),M=vQ(z,F);if((M.length>0||!w.phases)&&rs(p,z),M.length>0&&nt(`Auto-enabled discovered service stacks: ${M.join(", ")}`,0),Po(`
|
|
@@ -1416,7 +1416,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
|
|
|
1416
1416
|
`)}`,B="Upgrade tdk to a version that supports these files. Changing schemaVersion by hand is not a fix";o.onInvalid?.(`${E}
|
|
1417
1417
|
Fix: ${B}`),console.error(b.red(`\u2717 ${E}`)),console.error(b.gray(` Fix: ${B}`)),l(1)}import{execFileSync as u3}from"node:child_process";var yw=(n,o)=>u3(n,o,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function f3(n,o=process.platform,l=yw){if(!Number.isInteger(n)||n<1||n>65535)return[];if(o==="win32"){let u=`$port=${n}; Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $p=Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue; if ($p -and $p.ProcessName -eq 'tilt') { $_.OwningProcess } } | Sort-Object -Unique`;try{return l("powershell.exe",["-NoProfile","-Command",u]).split(/\s+/).map(Number).filter(p=>Number.isInteger(p)&&p>0)}catch{throw new Error(`Unable to inspect Tilt listeners on port ${n} with PowerShell.`)}}let s;try{s=l("lsof",["-nP","-t",`-iTCP:${n}`,"-sTCP:LISTEN"]).split(/\s+/).map(Number).filter(u=>Number.isInteger(u)&&u>0)}catch(u){let p=u,E=p.stderr?.toString().trim();if(p?.status===1&&!E)return[];throw new Error(`Unable to inspect listeners on port ${n}. Install lsof or resolve the lsof error before using --force.`,{cause:p})}return s.filter(u=>{try{return l("ps",["-p",String(u),"-o","comm="]).trim().split(/[\\/]/).at(-1)==="tilt"}catch(p){throw new Error(`Unable to identify the process listening on port ${n}.`,{cause:p})}})}function LI(n,o=process.platform,l=yw){let s=f3(n,o,l);for(let u of s)o==="win32"?l("taskkill.exe",["/PID",String(u),"/F"]):l("kill",["-TERM",String(u)]);return s}function Qw(n,o){let l=new Set(o.map(s=>s.name));return n.filter(s=>!l.has(s))}function Sw(n,o){let l=new Map(o.map(p=>[p.name,p])),s=new Set,u=p=>{if(!(s.has(p)||!l.has(p))){s.add(p);for(let E of l.get(p)?.config?.dependsOn??[])u(E)}};for(let p of n)u(p);return{selected:o.filter(p=>s.has(p.name)),dependencies:o.map(p=>p.name).filter(p=>s.has(p)&&!n.includes(p))}}function Dw(n,o=[]){return["TDK is up.",`Tilt UI: http://localhost:${n}`,"App URLs:",...o.length>0?o.slice(0,5).map(l=>` ${l}`):[" run: tdk networks"],"Stop: tdk down"]}function m3(n,o){return n!=="win32"||o==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function E3(n=AD(),o=h3){return n.kind==="webcontainer"?oD:lD(n.kind)&&!await o()?iD:null}async function h3(){let{execFile:n}=await import("node:child_process");return new Promise(o=>{n("docker",["ps"],{timeout:1e4},l=>o(!l))})}var C3=2;function B3(n){let o;try{({handEdited:o}=EB(n))}catch(l){if(l instanceof tE)return null;throw l}return o.length===0?null:["Generated files were edited by hand and no longer match service.json:",...o.map(l=>` ${l}`),"Run `tdk config regenerate` to discard the edits, or bypass with `tdk up --ignore-drift`."]}function I3(n,o,l=process.exit){if(o.ignoreDrift){console.warn(b.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let s=B3(n);if(s){o.onDrift?.(s.join(`
|
|
1418
1418
|
`));for(let u of s)console.error(b.red(u));l(C3)}}function y3(n,o,l=gr(),s=process.exit){if(o.ignoreVersion){console.warn(b.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let u=ID(n,l);u.status==="none"||u.status==="ok"||(o.onFail?.(`${u.message}
|
|
1419
|
-
${u.fix}`),console.error(b.red(u.message)),console.error(b.red(u.fix)),s(1))}function Q3(n,o=3e4){return new Promise(l=>{let s=Date.now()+o,u=()=>{let p=g3({host:"127.0.0.1",port:n}),E=!1,B=I=>{E||(E=!0,p.destroy(),I||Date.now()>=s?l(I):setTimeout(u,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};u()})}var Rw=new p3("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this tdk is older than minTdkVersion in .tdk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,o)=>{let l=o.json?yB("UP_FAILED","tdk up"):void 0;o.json&&(o.quiet=!0);let s=HQ(process.env.TILT_PORT);s.ok||(l?.({ok:!1},[{code:"INVALID_TILT_PORT",message:s.message}]),Uo(s.message));let u=s.port,p=vn();p&&y3(p,{ignoreVersion:o.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=o.dryRun?null:await E3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=m3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&Iw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!o.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-
|
|
1419
|
+
${u.fix}`),console.error(b.red(u.message)),console.error(b.red(u.fix)),s(1))}function Q3(n,o=3e4){return new Promise(l=>{let s=Date.now()+o,u=()=>{let p=g3({host:"127.0.0.1",port:n}),E=!1,B=I=>{E||(E=!0,p.destroy(),I||Date.now()>=s?l(I):setTimeout(u,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};u()})}var Rw=new p3("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this tdk is older than minTdkVersion in .tdk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,o)=>{let l=o.json?yB("UP_FAILED","tdk up"):void 0;o.json&&(o.quiet=!0);let s=HQ(process.env.TILT_PORT);s.ok||(l?.({ok:!1},[{code:"INVALID_TILT_PORT",message:s.message}]),Uo(s.message));let u=s.port,p=vn();p&&y3(p,{ignoreVersion:o.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=o.dryRun?null:await E3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=m3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&Iw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!o.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-D7CAIHND.js");await N()}let S=async()=>{let N=o.dryRun?Za():vn(),x=N??process.cwd(),v=Z1(),w,z=[];if((!o.only||n)&&(w=As(v),z=w.map(J=>J.name)),o.only){if(n&&!Dg(n)){let Ge=on.stackNotFound(n,z);l?.({ok:!1},[BB(Ge).error]),Ge.exit()}let J=n?v.filter(Ge=>Ge.stack===n):v,Te=Qw(o.only,J);if(Te.length>0){let Ge=J.map(We=>We.name),Pe=on.unknownServices(Te,Ge);l?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Pe.message,...Pe.suggestions.length>0?{suggestions:Pe.suggestions}:{}}]),Pe.exit()}}N&&I3(N,{ignoreDrift:o.ignoreDrift,onDrift:J=>l?.({ok:!1},[{code:"DRIFT_DETECTED",message:J}])}),N&&BD(N,{onInvalid:J=>l?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:J}])}),N&&!l&&!o.quiet&&CD(N);let F=await fB(x,{inspectDocker:!o.dryRun});if(!o.dryRun){if(N){let Ge=eE(x);Ge.length>0&&!o.quiet&&console.log(b.gray(`Added ${Ge.join(", ")} to .env (generated; existing values unchanged)`))}N&&!d3(vw(x,".tdk",".tdk-out","Tiltfile"))&&(o.quiet||console.log(b.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await Zu(x,{quiet:o.quiet}));let J=pQ(x);J.length>0&&o.verbose&&!o.quiet&&console.log(b.gray(`Refreshed runtime assets: ${J.join(", ")}`));let Te=SR(x);Te.length>0&&!o.quiet&&console.log(b.gray(`Added ${Te.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let M,ae,he=[];if(n){if(M=v.filter(J=>J.stack===n),M.length===0){let J=on.stackNotFound(n,z);l?.({ok:!1},[BB(J).error]),J.exit()}he=M.map(J=>J.name),ae=`stack "${n}"`}else{M=v;let J=w??As(v);ae=`all stacks (${Jn(J.length,"stack")}, ${Jn(M.length,"service")})`}let Re=[];if(o.only){let J=Sw(o.only,qA());M=J.selected,Re=J.dependencies,he=M.map(Te=>Te.name),ae=`${Jn(o.only.length,"requested service")}${Re.length>0?` plus ${Re.join(", ")}`:""}`}o.verbose&&!o.quiet&&console.log(b.gray(`Found ${Jn(M.length,"service")} in ${ae}`));let Ie=M.map(J=>J.name);if(!o.quiet){console.log(b.blue(`${o.dryRun?"Would start":"Starting"} ${Jn(Ie.length,"service")} from ${ae}...`));for(let We of Ie)console.log(b.gray(` - ${We}`));let{appBase:J,apiBase:Te}=PC(F.ingressHttp),Ge=M.filter(We=>We.config?.appType==="frontend"),Pe=M.filter(We=>cc(We.config?.appType));if(Ge.length>0){console.log(b.blue(`
|
|
1420
1420
|
\u{1F30D} Frontend URLs:`));for(let We of Ge){let ut=We.config?.basePath??`/${We.name}`;console.log(b.gray(` - ${We.name}: ${J}${b.cyan(eQ(ut))}`))}}if(Pe.length>0){console.log(b.blue(`
|
|
1421
1421
|
\u{1F527} Backend API URLs:`));for(let We of Pe){let ut=We.name.replace(/-api$/,""),qe=We.config?.apiPath??`/api/${ut}`,He=We.config?.sablier,$e=He?.enable&&He?.deferStart?b.dim(" (deferred \u2014 starts on first request)"):"";console.log(b.gray(` - ${We.name}: ${Te}${b.cyan(eQ(qe))}${$e}`))}}}let je=o.only??(n?[n]:void 0),Oe=M1(he,{verbose:o.verbose,quiet:o.quiet,force:o.force,focusTargets:je}),be=je?`tilt up ${Oe.join(" ")}`:"tilt up";if(!o.quiet){console.log(b.blue(dD(F)));for(let J of Bw(F))console.log(b.yellow(J));console.log(b.gray("Override with TDK_HTTP_PORT, TDK_HTTPS_PORT, or TDK_POSTGRES_PORT."))}if(l&&o.dryRun){l({ok:!0,dryRun:!0,stack:n??null,services:Ie,...o.only?{requested:o.only,declaredDependencies:Re}:{},command:be});return}if(CB(o,"not starting services",be))return;mD(F),pD(x,F);let ze=ki.tiltUi,Qe=u??ze,Ye=o.only?[...new Set([ze,Qe])]:[Qe],At=[];for(let J of Ye)await fc(J)!==null&&At.push(J);let ke=s2({runningPorts:At,force:o.force,only:!!o.only});if(ke.action==="already-running"){let J=`Environment is already running on port ${ke.ports.join(", ")}.`;l?.({ok:!0,alreadyRunning:!0,tiltUrl:`http://localhost:${ke.ports[0]}`}),o.quiet||console.log(b.green(J));return}if(ke.action==="only-blocked"){let J=`A Tilt is already running on port ${ke.ports.join(", ")}. --only cannot change a running stack's services: run \`tdk down\` first, or pass --force to replace it.`;l?.({ok:!1},[{code:"TILT_ALREADY_RUNNING",message:J}]),Uo(J)}if(o.only)for(let J of At)LI(J);let kt=await c2({configuredPort:u,force:o.force,basePort:ze,findAvailablePort:CR}),at=kt.port;kt.autoSwitched&&!o.quiet&&(console.log(b.yellow(`\u26A0\uFE0F Port ${ze} is already in use`)),console.log(b.blue(`\u{1F504} Auto-switching to port ${at}
|
|
1422
1422
|
`))),process.env.TILT_PORT=at.toString(),await u2({force:o.force,quiet:o.quiet,port:at},{stop:LI,log:J=>console.log(b.yellow(J)),wait:J=>new Promise(Te=>setTimeout(Te,J))}),o.quiet||(console.log(b.gray(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{sb as a,tb as b,ub as c,vb as d,wb as e}from"./chunk-
|
|
2
|
+
import{sb as a,tb as b,ub as c,vb as d,wb as e}from"./chunk-LNZN426S.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
|
package/cli/package.json
CHANGED
package/discovery/config.star
CHANGED
|
@@ -179,7 +179,7 @@ def get_global_config():
|
|
|
179
179
|
"golden_l2_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l2:latest",
|
|
180
180
|
"golden_l3_backend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-backend:latest",
|
|
181
181
|
"golden_l3_frontend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-frontend:latest",
|
|
182
|
-
"golden_l3_migrator_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-
|
|
182
|
+
"golden_l3_migrator_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-backend:latest",
|
|
183
183
|
"golden_l4_backend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l4-backend:latest",
|
|
184
184
|
"golden_l4_frontend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l4-frontend:latest",
|
|
185
185
|
"golden_l4_migrator_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l4-migrator:latest",
|
|
@@ -17,13 +17,16 @@
|
|
|
17
17
|
# This Dockerfile builds 8 golden images:
|
|
18
18
|
# - tdk-project-l1:latest - OS base + Bun runtime
|
|
19
19
|
# - tdk-project-l2:latest - Dependencies installed
|
|
20
|
-
# - tdk-project-l3-backend:latest - Backend build tools (Prisma, no Infisical CLI)
|
|
20
|
+
# - tdk-project-l3-backend:latest - Backend and migrator build tools (Prisma, no Infisical CLI)
|
|
21
21
|
# - tdk-project-l3-frontend:latest - Frontend build tools (no Prisma)
|
|
22
|
-
# - tdk-project-
|
|
23
|
-
# - tdk-project-l4-backend:latest - Backend production runtime
|
|
22
|
+
# - tdk-project-l4-backend:latest - Backend production runtime (Bun)
|
|
23
|
+
# - tdk-project-l4-backend-node:latest - Backend production runtime (Node.js)
|
|
24
24
|
# - tdk-project-l4-frontend:latest - Frontend production runtime (Nginx)
|
|
25
25
|
# - tdk-project-l4-migrator:latest - Migrator production runtime
|
|
26
26
|
#
|
|
27
|
+
# Migrators build on l3-backend: a separate l3-migrator stage installed the same Prisma
|
|
28
|
+
# and produced identical layers under a second image name.
|
|
29
|
+
#
|
|
27
30
|
# Services use these as base images to skip heavy dependency installation.
|
|
28
31
|
#
|
|
29
32
|
# ⚠️ SKIP_INFISICAL_SETUP Support:
|
|
@@ -100,26 +103,6 @@ LABEL layer="l3-frontend" description="Frontend build tools without Prisma
|
|
|
100
103
|
RUN echo "Bun version: $(bun --version)"
|
|
101
104
|
|
|
102
105
|
|
|
103
|
-
# =============================================================================
|
|
104
|
-
# L3-MIGRATOR: MIGRATOR BUILD TOOLS (PRISMA)
|
|
105
|
-
# =============================================================================
|
|
106
|
-
FROM l2_golden AS l3_migrator_golden
|
|
107
|
-
|
|
108
|
-
LABEL layer="l3-migrator" description="Migrator build tools with Prisma" maintainer="tdk-project"
|
|
109
|
-
|
|
110
|
-
# Install Prisma CLI globally (required for migrations, pinned)
|
|
111
|
-
RUN bun add -g prisma@7.5.0 @prisma/client@7.5.0
|
|
112
|
-
|
|
113
|
-
# Verify Prisma installation
|
|
114
|
-
RUN echo "Prisma version: $(bunx prisma --version | head -1)"
|
|
115
|
-
|
|
116
|
-
# ⚠️ CRITICAL: Infisical CLI is NOT installed in golden L3 images
|
|
117
|
-
# Reason: curl to dl.cloudsmith.io hangs during Docker builds when CDN is slow
|
|
118
|
-
# Solution: Use SKIP_INFISICAL_SETUP=1 build arg or runtime env var injection
|
|
119
|
-
# Services read secrets from environment variables at runtime (no CLI needed)
|
|
120
|
-
# See: .tilt/topologies/platform/docker/layers/l3_builder_layers.star
|
|
121
|
-
|
|
122
|
-
|
|
123
106
|
# =============================================================================
|
|
124
107
|
# L4-BACKEND-BUN: BACKEND PRODUCTION RUNTIME (BUN)
|
|
125
108
|
# =============================================================================
|
|
@@ -202,8 +185,8 @@ LABEL layer="l4-migrator" description="Migrator runtime with Prisma"
|
|
|
202
185
|
|
|
203
186
|
ENV NODE_ENV=production
|
|
204
187
|
|
|
205
|
-
# Copy global Prisma installation from L3
|
|
206
|
-
COPY --from=
|
|
188
|
+
# Copy global Prisma installation from L3 (l3-backend carries the same pinned Prisma)
|
|
189
|
+
COPY --from=l3_backend_golden /root/.bun/install/global /root/.bun/install/global
|
|
207
190
|
|
|
208
191
|
# ⚠️ Infisical CLI is NOT included in golden L4 images
|
|
209
192
|
# The migrator reads secrets directly from environment variables at runtime
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# 🏗️ TILT SDK - GOLDEN IMAGE BUILDERS
|
|
3
3
|
# =============================================================================
|
|
4
4
|
|
|
5
|
-
load('./golden_image_constants.star', 'GOLDEN_DOCKERFILE', 'GOLDEN_IMAGE_PREFIX', 'GOLDEN_LAYERS')
|
|
5
|
+
load('./golden_image_constants.star', 'GOLDEN_DOCKERFILE', 'GOLDEN_IMAGE_PREFIX', 'GOLDEN_LAYERS', 'LEGACY_GOLDEN_IMAGES')
|
|
6
6
|
|
|
7
7
|
# Label that records which golden Dockerfile an image was built from.
|
|
8
8
|
GOLDEN_HASH_LABEL = 'tdk.golden.hash'
|
|
@@ -53,6 +53,11 @@ else
|
|
|
53
53
|
@@SERIAL_BUILDS@@
|
|
54
54
|
fi
|
|
55
55
|
|
|
56
|
+
# Untag golden images that older engines built and nothing uses now; an image still in use is left alone.
|
|
57
|
+
for img in @@LEGACY_IMAGES@@; do
|
|
58
|
+
docker image rm "$img" >/dev/null 2>&1 && echo " 🧹 Removed legacy golden image $img"
|
|
59
|
+
done
|
|
60
|
+
|
|
56
61
|
echo "✅ Golden layers built (@@COUNT@@ images):"
|
|
57
62
|
@@SUMMARY@@
|
|
58
63
|
'''
|
|
@@ -118,6 +123,7 @@ def build_golden_layers(project_root='.'):
|
|
|
118
123
|
.replace('@@DF_REL@@', _sh_quote(dockerfile_from_tiltfile))
|
|
119
124
|
.replace('@@ROOT_REL@@', _sh_quote(context))
|
|
120
125
|
.replace('@@IMAGES@@', ' '.join(images))
|
|
126
|
+
.replace('@@LEGACY_IMAGES@@', ' '.join(LEGACY_GOLDEN_IMAGES))
|
|
121
127
|
.replace('@@HASH_LABEL@@', GOLDEN_HASH_LABEL)
|
|
122
128
|
.replace('@@COUNT@@', str(len(images)))
|
|
123
129
|
.replace('@@TARGET_NAMES@@', ', '.join(target_names))
|
|
@@ -46,12 +46,6 @@ GOLDEN_LAYERS = {
|
|
|
46
46
|
'description': 'Frontend build tools (no Prisma)',
|
|
47
47
|
'target': 'l3_frontend_golden',
|
|
48
48
|
},
|
|
49
|
-
'l3-migrator': {
|
|
50
|
-
'name': GOLDEN_IMAGE_PREFIX + '-l3-migrator',
|
|
51
|
-
'tag': 'latest',
|
|
52
|
-
'description': 'Migrator build tools (Prisma only, Infisical CLI skipped to avoid CDN hangs)',
|
|
53
|
-
'target': 'l3_migrator_golden',
|
|
54
|
-
},
|
|
55
49
|
'l4-backend': {
|
|
56
50
|
'name': GOLDEN_IMAGE_PREFIX + '-l4-backend',
|
|
57
51
|
'tag': 'latest',
|
|
@@ -79,8 +73,21 @@ GOLDEN_LAYERS = {
|
|
|
79
73
|
}
|
|
80
74
|
|
|
81
75
|
|
|
76
|
+
# Layers that are no longer built, mapped to the layer that replaced them.
|
|
77
|
+
# l3-migrator installed the same Prisma as l3-backend and produced identical layers.
|
|
78
|
+
LAYER_ALIASES = {
|
|
79
|
+
'l3-migrator': 'l3-backend',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Image names older engines built that nothing uses now; the golden build untags them.
|
|
83
|
+
LEGACY_GOLDEN_IMAGES = [
|
|
84
|
+
GOLDEN_IMAGE_PREFIX + '-l3-migrator:latest',
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
|
|
82
88
|
def get_layer_reference(layer):
|
|
83
89
|
"""Returns the full image reference for a specific layer."""
|
|
90
|
+
layer = LAYER_ALIASES.get(layer, layer)
|
|
84
91
|
if layer not in GOLDEN_LAYERS:
|
|
85
92
|
fail("Invalid layer: " + layer + ". Must be one of: l1, l2, l3, l4")
|
|
86
93
|
|
|
@@ -38,13 +38,16 @@ def generate_golden_dockerfile():
|
|
|
38
38
|
# This Dockerfile builds 8 golden images:
|
|
39
39
|
# - """ + prefix + """-l1:latest - OS base + Bun runtime
|
|
40
40
|
# - """ + prefix + """-l2:latest - Dependencies installed
|
|
41
|
-
# - """ + prefix + """-l3-backend:latest - Backend build tools (Prisma, no Infisical CLI)
|
|
41
|
+
# - """ + prefix + """-l3-backend:latest - Backend and migrator build tools (Prisma, no Infisical CLI)
|
|
42
42
|
# - """ + prefix + """-l3-frontend:latest - Frontend build tools (no Prisma)
|
|
43
|
-
# - """ + prefix + """-
|
|
44
|
-
# - """ + prefix + """-l4-backend:latest - Backend production runtime
|
|
43
|
+
# - """ + prefix + """-l4-backend:latest - Backend production runtime (Bun)
|
|
44
|
+
# - """ + prefix + """-l4-backend-node:latest - Backend production runtime (Node.js)
|
|
45
45
|
# - """ + prefix + """-l4-frontend:latest - Frontend production runtime (Nginx)
|
|
46
46
|
# - """ + prefix + """-l4-migrator:latest - Migrator production runtime
|
|
47
47
|
#
|
|
48
|
+
# Migrators build on l3-backend: a separate l3-migrator stage installed the same Prisma
|
|
49
|
+
# and produced identical layers under a second image name.
|
|
50
|
+
#
|
|
48
51
|
# Services use these as base images to skip heavy dependency installation.
|
|
49
52
|
#
|
|
50
53
|
# ⚠️ SKIP_INFISICAL_SETUP Support:
|
|
@@ -139,28 +142,6 @@ LABEL layer="l3-frontend" \
|
|
|
139
142
|
RUN echo "Bun version: $(bun --version)"
|
|
140
143
|
|
|
141
144
|
|
|
142
|
-
# =============================================================================
|
|
143
|
-
# L3-MIGRATOR: MIGRATOR BUILD TOOLS (PRISMA)
|
|
144
|
-
# =============================================================================
|
|
145
|
-
FROM l2_golden AS l3_migrator_golden
|
|
146
|
-
|
|
147
|
-
LABEL layer="l3-migrator" \
|
|
148
|
-
description="Migrator build tools with Prisma" \
|
|
149
|
-
maintainer="{prefix}"
|
|
150
|
-
|
|
151
|
-
# Install Prisma CLI globally (required for migrations, pinned)
|
|
152
|
-
RUN bun add -g prisma@7.5.0 @prisma/client@7.5.0
|
|
153
|
-
|
|
154
|
-
# Verify Prisma installation
|
|
155
|
-
RUN echo "Prisma version: $(bunx prisma --version | head -1)"
|
|
156
|
-
|
|
157
|
-
# ⚠️ CRITICAL: Infisical CLI is NOT installed in golden L3 images
|
|
158
|
-
# Reason: curl to dl.cloudsmith.io hangs during Docker builds when CDN is slow
|
|
159
|
-
# Solution: Use SKIP_INFISICAL_SETUP=1 build arg or runtime env var injection
|
|
160
|
-
# Services read secrets from environment variables at runtime (no CLI needed)
|
|
161
|
-
# See: .tilt/topologies/platform/docker/layers/l3_builder_layers.star
|
|
162
|
-
|
|
163
|
-
|
|
164
145
|
# =============================================================================
|
|
165
146
|
# L4-BACKEND-BUN: BACKEND PRODUCTION RUNTIME (BUN)
|
|
166
147
|
# =============================================================================
|
|
@@ -256,8 +237,8 @@ LABEL layer="l4-migrator" \
|
|
|
256
237
|
|
|
257
238
|
ENV NODE_ENV=production
|
|
258
239
|
|
|
259
|
-
# Copy global Prisma installation from L3
|
|
260
|
-
COPY --from=
|
|
240
|
+
# Copy global Prisma installation from L3 (l3-backend carries the same pinned Prisma)
|
|
241
|
+
COPY --from=l3_backend_golden /root/.bun/install/global /root/.bun/install/global
|
|
261
242
|
|
|
262
243
|
# ⚠️ Infisical CLI is NOT included in golden L4 images
|
|
263
244
|
# The migrator reads secrets directly from environment variables at runtime
|
|
@@ -83,7 +83,8 @@ def _load_golden_prefix():
|
|
|
83
83
|
|
|
84
84
|
_GOLDEN_PREFIX = _load_golden_prefix()
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
# Migrators build on l3-backend; the golden build no longer makes a separate l3-migrator image.
|
|
87
|
+
DEFAULT_GOLDEN_L3_MIGRATOR_IMAGE = _GOLDEN_PREFIX + "-l3-backend:latest"
|
|
87
88
|
DEFAULT_GOLDEN_L4_MIGRATOR_IMAGE = _GOLDEN_PREFIX + "-l4-migrator:latest"
|
|
88
89
|
|
|
89
90
|
DEFAULT_DB_PORT = "5432"
|