@tdk-landscape/tdk-cli-core 1.3.150 → 1.3.151
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/CHANGELOG.md +5 -0
- package/cli/dist-bundle/{chunk-27DX52SA.js → chunk-DWF3VS6P.js} +1 -1
- package/cli/dist-bundle/cli.js +3 -3
- package/cli/dist-bundle/{cold-preflight-XZ4RH2DH.js → cold-preflight-IKGPFETT.js} +1 -1
- package/cli/package.json +1 -1
- package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +21 -1
- package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +7 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to the `tdk` CLI. Versions match [npm](https://www.npmjs.com/package/@tdk-landscape/tdk-cli-core?activeTab=versions) and the [binary releases](https://github.com/tdk-landscape/tdk-cli-releases/releases).
|
|
4
4
|
|
|
5
|
+
## 1.3.151 (2026-10-12)
|
|
6
|
+
|
|
7
|
+
- The Prisma migrator image builds again. It used to `COPY` `migrate.sh` and `prisma-runtime-relink.sh` from `shared-platform-engineering/docker-templates/`, which no package ships, so `tdk up` failed with `…/migrate.sh: not found`. Both are now written inline into the Dockerfile. The relink step is reconstructed and not yet verified against a real migrator build (#1094).
|
|
8
|
+
- Generated Dockerfiles start with `# syntax=docker/dockerfile:1`, so the heredocs in them build on CI's Docker builder (#1092).
|
|
9
|
+
|
|
5
10
|
## 1.3.131 (2026-10-12)
|
|
6
11
|
|
|
7
12
|
- `healthCheckPath` is optional for `appType: "bring-your-own"` in `service.json`, so a service that is not HTTP (Postgres, Redis, MinIO, an SMTP relay) no longer needs a made-up `"/"` to validate. Without it TDK sends no HTTP probe to the service and gives its Traefik route no health check; the container counts as healthy once Docker reports it running. `port` stays required, and a set `healthCheckPath` behaves as before. Fixes #1086.
|
|
@@ -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 td(e,t){let r=Co[e];console.log(t?f.yellow(`No ${r.singular}s found${t}.`):f.yellow(`No ${r.singular}s found.`)),console.log(f.gray(r.context)),console.log(f.gray(` ${r.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 rd(e){console.log(f.yellow(e||"Cancelled."))}function nd(e){console.log(f.blue(`TDK ${e}
|
|
13
|
-
`))}function sd(e,t){console.log(f.green(`All ${e} are ${t}!`))}var mt=62;function od(e="\u2500",t=mt){return e.repeat(t)}function Wr(e,t=mt-2){let r=Math.max(0,t-e.length),n=Math.floor(r/2),s=r-n;return" ".repeat(n)+e+" ".repeat(s)}function id(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function ad(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function cd(e){console.log(f.green(`\u2713 ${e}`))}function ud(e){console.log(f.blue(e))}function dd(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function ld(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function pd(e,t,r=mt){let n=r-2,s="\u2500".repeat(n);console.log(),console.log(f.cyan(`\u256D${s}\u256E`)),console.log(f.cyan("\u2502")+f.bold.white(Wr(e,n))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(Wr(t,n))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as jo}from"node:fs";import{dirname as Io,join as Fo,resolve as qr}from"node:path";import{cwd as Mo}from"node:process";var Jr={name:"tdk-cli-internal",private:!0,version:"1.3.150",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=Mo()){let t=qr(e),r=qr("/");for(;t!==r;){if(jo(Fo(t,".tdk",P)))return t;let n=Io(t);if(n===t)break;t=n}return null}var Ne=null;function Lo(){if(Ne)return Ne;let e=Jr;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 zr(){return Lo().version}import{readFileSync as Bo}from"node:fs";import{join as Uo}from"node:path";function je(){let e=m();if(e)try{let t=Bo(Uo(e,".tdk",P),"utf-8"),r=JSON.parse(t);if(r?.project?.name)return r.project.name}catch{}return"tdk-project"}function ht(e){let t=je(),r=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let n=new URL(r.includes("://")?r:`http://${r}`),s=n.hostname,o=n.protocol==="https:"?"443":"80",i=n.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${n.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${n.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${n.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${n.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function Ho(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 Xr(e,t,r=>Ho(r))}function Yr(e,t){return Xr(e,t,r=>r)}function Xr(e,t,r){let{appBase:n,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:n;return{name:o.name,appType:o.config.appType,url:`${i}${r(gt(o))}`}})}async function Vo(e,t){try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:r.ok,status:r.status}}catch(r){let n=r instanceof Error&&r.name==="TimeoutError"?`no response within ${t}ms`:r instanceof Error?r.message:String(r);return{...e,ok:!1,error:n}}}async function Ie(e,t){return Promise.all(e.map(r=>Vo(r,t)))}import{existsSync as ee,readdirSync as wn,readFileSync as $n,statSync as Et}from"node:fs";import{dirname as Ri,join as J}from"node:path";var ge=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let r=this.data.get(t);return r?Date.now()-r.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,r){this.data.set(t,{value:r,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let r of this.data.keys())this.has(r)&&t.push(r);return t}size(){return this.keys().length}};function Zr(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as Zo,execSync as Qo}from"node:child_process";import{existsSync as qo}from"node:fs";import{delimiter as zo,extname as Yo,join as Xo}from"node:path";import{delimiter as _d,extname as Ko}from"node:path";function Fe(){return process.platform==="win32"}function Go(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Wo(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Jo(e,t){let r=Go(e),n=Wo(t);if(!r||!n||r==="windows"&&n!=="amd64")return null;let s=`tdk-${r}-${n}`;return r==="windows"?`${s}.exe`:s}function Od(){return Jo(process.platform,process.arch)}function Ad(){return Fe()?"tdk.exe":"tdk"}function Qr(e,t=Fe()){return t?Ko(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",r=Fe(),n=Qr(e,r);if(r&&!Yo(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!n.includes(`${e}${o}`)&&n.push(`${e}${o}`)}for(let s of t.split(zo))if(s)for(let o of n){let i=Xo(s,o);if(qo(i))return i}return null}var en=1e4;function tn(){let e=!1;if(process.platform==="win32")try{return Zo($("docker")??"docker",["ps"],{stdio:"ignore",timeout:en,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Qo(t,{stdio:"ignore",timeout:en}),"running"}catch(r){r.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function Me(e,t){return e[t]??0}function ei(e,t){let r=Array.from({length:t.length+1},(n,s)=>s);for(let n=1;n<=e.length;n++){let s=[n];for(let o=1;o<=t.length;o++){let i=e[n-1]===t[o-1]?0:1;s[o]=Math.min(Me(s,o-1)+1,Me(r,o)+1,Me(r,o-1)+i)}r=s}return Me(r,t.length)}function ti(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length-1;r++)if(e[r]!==t[r]&&e[r]===t[r+1]&&e[r+1]===t[r]&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+2)===t.slice(r+2))return!0;return!1}function rn(e,t){if(e.length<2||t.length===0||t.includes(e))return;let r=e.toLowerCase(),n,s=Number.POSITIVE_INFINITY;for(let o of t){if(o.length===0)continue;let i=o.toLowerCase(),a=ti(r,i)?1:ei(r,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(r.length,i.length)/3)));a>c||(a<s||a===s&&(n===void 0||o<n))&&(n=o,s=a)}return n}import{spawn as ri}from"node:child_process";import{join as ni}from"node:path";function si(e,t=[],r={}){return new Promise((n,s)=>{let o=[e,...t];r.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=ri($("tilt")??"tilt",o,{stdio:r.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:r.timeoutMs}),a="",c="";r.inheritStdio||(i.stdout?.on("data",u=>{a+=u.toString()}),i.stderr?.on("data",u=>{c+=u.toString()})),i.on("close",u=>{n({exitCode:u??1,stdout:a,stderr:c})}),i.on("error",u=>{s(new Error(`Failed to spawn tilt: ${u.message}`))})})}async function nn(){try{return(await si("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function oi(){let e=m();if(!e)throw V.notInProject();return ni(e,".tdk",".tdk-out","Tiltfile")}function sn(e){let t=oi();e.push("-f",t)}function Wd(e,t={}){let r=[];return sn(r),t.focusTargets&&t.focusTargets.length>0&&r.push("--",`--focus=${t.focusTargets.join(",")}`),r.push(...e),t.verbose&&!t.quiet&&r.push("--verbose"),t.watch&&r.push("--watch"),r}function Jd(e={}){let t=[];return sn(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function on(e){return e instanceof Error?e.message:String(e)}function tl(e,t){if(process.env.TDK_VERBOSE){let r=t!==void 0?`: ${on(t)}`:"";console.warn(f.gray(`${e}${r}`))}}var R=class extends Error{suggestions;exitCode;constructor(t,r=[],n=1){super(t),this.name="TdkError",this.suggestions=r,this.exitCode=n}display(){ci(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function yt(e,t,r=!1){let n=new Set;for(let s of e){let o=rn(s,t);o&&n.add(r?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...n]}var V={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 r=yt(e,t,e.length>1);return new R(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,r,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 rl(){let e=m();return e||V.notInProject().exit()}function ii(e){e instanceof R&&e.exit(),console.error(f.red(`Error: ${on(e)}`)),process.exit(1)}async function ai(e,t){try{return await e()}catch(r){return t?.verbose&&r instanceof Error&&r.stack&&console.error(f.gray(r.stack)),ii(r)}}async function nl(e,t){let r=[],n=tn();return n==="unresponsive"?r.push(V.dockerNotResponding()):n==="missing"&&r.push(V.dockerNotAvailable()),await nn()||r.push(V.tiltNotInstalled()),r.length>0&&(console.error(f.red(`
|
|
13
|
+
`))}function sd(e,t){console.log(f.green(`All ${e} are ${t}!`))}var mt=62;function od(e="\u2500",t=mt){return e.repeat(t)}function Wr(e,t=mt-2){let r=Math.max(0,t-e.length),n=Math.floor(r/2),s=r-n;return" ".repeat(n)+e+" ".repeat(s)}function id(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function ad(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function cd(e){console.log(f.green(`\u2713 ${e}`))}function ud(e){console.log(f.blue(e))}function dd(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function ld(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function pd(e,t,r=mt){let n=r-2,s="\u2500".repeat(n);console.log(),console.log(f.cyan(`\u256D${s}\u256E`)),console.log(f.cyan("\u2502")+f.bold.white(Wr(e,n))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(Wr(t,n))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as jo}from"node:fs";import{dirname as Io,join as Fo,resolve as qr}from"node:path";import{cwd as Mo}from"node:process";var Jr={name:"tdk-cli-internal",private:!0,version:"1.3.151",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=Mo()){let t=qr(e),r=qr("/");for(;t!==r;){if(jo(Fo(t,".tdk",P)))return t;let n=Io(t);if(n===t)break;t=n}return null}var Ne=null;function Lo(){if(Ne)return Ne;let e=Jr;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 zr(){return Lo().version}import{readFileSync as Bo}from"node:fs";import{join as Uo}from"node:path";function je(){let e=m();if(e)try{let t=Bo(Uo(e,".tdk",P),"utf-8"),r=JSON.parse(t);if(r?.project?.name)return r.project.name}catch{}return"tdk-project"}function ht(e){let t=je(),r=process.env.TDK_SERVICE_BASE_URL??`http://${t}.localhost${e?`:${e}`:""}`;try{let n=new URL(r.includes("://")?r:`http://${r}`),s=n.hostname,o=n.protocol==="https:"?"443":"80",i=n.port||(e?String(e):""),a=i===o?"":i;if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${n.protocol}//${s}${a?`:${a}`:""}`,apiBase:`${n.protocol}//${s}${a?`:${a}`:""}`};let c=s.replace(/^(app|api)\./,"");return{appBase:`${n.protocol}//app.${c}${a?`:${a}`:""}`,apiBase:`${n.protocol}//api.${c}${a?`:${a}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function Ho(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 Xr(e,t,r=>Ho(r))}function Yr(e,t){return Xr(e,t,r=>r)}function Xr(e,t,r){let{appBase:n,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:n;return{name:o.name,appType:o.config.appType,url:`${i}${r(gt(o))}`}})}async function Vo(e,t){try{let r=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:r.ok,status:r.status}}catch(r){let n=r instanceof Error&&r.name==="TimeoutError"?`no response within ${t}ms`:r instanceof Error?r.message:String(r);return{...e,ok:!1,error:n}}}async function Ie(e,t){return Promise.all(e.map(r=>Vo(r,t)))}import{existsSync as ee,readdirSync as wn,readFileSync as $n,statSync as Et}from"node:fs";import{dirname as Ri,join as J}from"node:path";var ge=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let r=this.data.get(t);return r?Date.now()-r.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,r){this.data.set(t,{value:r,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let r of this.data.keys())this.has(r)&&t.push(r);return t}size(){return this.keys().length}};function Zr(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as Zo,execSync as Qo}from"node:child_process";import{existsSync as qo}from"node:fs";import{delimiter as zo,extname as Yo,join as Xo}from"node:path";import{delimiter as _d,extname as Ko}from"node:path";function Fe(){return process.platform==="win32"}function Go(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Wo(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Jo(e,t){let r=Go(e),n=Wo(t);if(!r||!n||r==="windows"&&n!=="amd64")return null;let s=`tdk-${r}-${n}`;return r==="windows"?`${s}.exe`:s}function Od(){return Jo(process.platform,process.arch)}function Ad(){return Fe()?"tdk.exe":"tdk"}function Qr(e,t=Fe()){return t?Ko(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",r=Fe(),n=Qr(e,r);if(r&&!Yo(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!n.includes(`${e}${o}`)&&n.push(`${e}${o}`)}for(let s of t.split(zo))if(s)for(let o of n){let i=Xo(s,o);if(qo(i))return i}return null}var en=1e4;function tn(){let e=!1;if(process.platform==="win32")try{return Zo($("docker")??"docker",["ps"],{stdio:"ignore",timeout:en,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Qo(t,{stdio:"ignore",timeout:en}),"running"}catch(r){r.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function Me(e,t){return e[t]??0}function ei(e,t){let r=Array.from({length:t.length+1},(n,s)=>s);for(let n=1;n<=e.length;n++){let s=[n];for(let o=1;o<=t.length;o++){let i=e[n-1]===t[o-1]?0:1;s[o]=Math.min(Me(s,o-1)+1,Me(r,o)+1,Me(r,o-1)+i)}r=s}return Me(r,t.length)}function ti(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length-1;r++)if(e[r]!==t[r]&&e[r]===t[r+1]&&e[r+1]===t[r]&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+2)===t.slice(r+2))return!0;return!1}function rn(e,t){if(e.length<2||t.length===0||t.includes(e))return;let r=e.toLowerCase(),n,s=Number.POSITIVE_INFINITY;for(let o of t){if(o.length===0)continue;let i=o.toLowerCase(),a=ti(r,i)?1:ei(r,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(r.length,i.length)/3)));a>c||(a<s||a===s&&(n===void 0||o<n))&&(n=o,s=a)}return n}import{spawn as ri}from"node:child_process";import{join as ni}from"node:path";function si(e,t=[],r={}){return new Promise((n,s)=>{let o=[e,...t];r.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=ri($("tilt")??"tilt",o,{stdio:r.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:r.timeoutMs}),a="",c="";r.inheritStdio||(i.stdout?.on("data",u=>{a+=u.toString()}),i.stderr?.on("data",u=>{c+=u.toString()})),i.on("close",u=>{n({exitCode:u??1,stdout:a,stderr:c})}),i.on("error",u=>{s(new Error(`Failed to spawn tilt: ${u.message}`))})})}async function nn(){try{return(await si("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function oi(){let e=m();if(!e)throw V.notInProject();return ni(e,".tdk",".tdk-out","Tiltfile")}function sn(e){let t=oi();e.push("-f",t)}function Wd(e,t={}){let r=[];return sn(r),t.focusTargets&&t.focusTargets.length>0&&r.push("--",`--focus=${t.focusTargets.join(",")}`),r.push(...e),t.verbose&&!t.quiet&&r.push("--verbose"),t.watch&&r.push("--watch"),r}function Jd(e={}){let t=[];return sn(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function on(e){return e instanceof Error?e.message:String(e)}function tl(e,t){if(process.env.TDK_VERBOSE){let r=t!==void 0?`: ${on(t)}`:"";console.warn(f.gray(`${e}${r}`))}}var R=class extends Error{suggestions;exitCode;constructor(t,r=[],n=1){super(t),this.name="TdkError",this.suggestions=r,this.exitCode=n}display(){ci(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function yt(e,t,r=!1){let n=new Set;for(let s of e){let o=rn(s,t);o&&n.add(r?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...n]}var V={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 r=yt(e,t,e.length>1);return new R(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,r,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 rl(){let e=m();return e||V.notInProject().exit()}function ii(e){e instanceof R&&e.exit(),console.error(f.red(`Error: ${on(e)}`)),process.exit(1)}async function ai(e,t){try{return await e()}catch(r){return t?.verbose&&r instanceof Error&&r.stack&&console.error(f.gray(r.stack)),ii(r)}}async function nl(e,t){let r=[],n=tn();return n==="unresponsive"?r.push(V.dockerNotResponding()):n==="missing"&&r.push(V.dockerNotAvailable()),await nn()||r.push(V.tiltNotInstalled()),r.length>0&&(console.error(f.red(`
|
|
14
14
|
TDK can't start - missing prerequisites:
|
|
15
15
|
`)),r.forEach((s,o)=>{o>0&&console.error(""),s.display()}),console.error(f.gray("\nRun `tdk doctor` for a full environment check.")),process.exit(1)),ai(e,t)}function sl(e,t=1){console.error(f.red(`Error: ${e}`)),process.exit(t)}function ci(e,t,r){if(console.error(f.red(`\u274C ${e}`)),t&&console.error(f.gray(` ${t}`)),r&&r.length>0){console.error(f.yellow(`
|
|
16
16
|
\u{1F4A1} Suggestions:`));for(let n of r)console.error(f.cyan(` \u2192 ${n}`))}}function ol(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 rs,A as R1,Aa as $m,B as b1,Ba as V1,C as dA,Ca as X1,D as Xm,Da as AB,E as T1,Ea as VA,F as N1,Fa as Z1,G as w1,Ga as P1,H as x1,Ha as W1,I as As,Ia as ls,J as _1,Ja as Dg,K as Zm,Ka as $1,L as gA,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 uD,Z as eB,Za as rB,_ as Mn,_a as sB,a as R,aa as H1,ab as cB,b as XC,ba as Pm,bb as uB,c as qA,ca as yg,cb as fD,d as fA,da as G1,db as eE,e as fr,ea as Wm,eb as aQ,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 ED,k as gr,ka as L1,kb as fB,l as Nl,la as Sg,lb as hD,m as wl,ma as Zo,mb as CD,n as Wy,na as Po,nb as oQ,o as Pn,oa as Pe,ob as iQ,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,sb as QD,t as cc,ta as aB,u as In,ua as vg,v as pr,va as K1,vb as SD,w as PC,wa as oB,wb as vD,x as eQ,xa as iB,y as WC,ya as Y1,z as D1,za as q1}from"./chunk-27DX52SA.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 cx,d as st}from"./chunk-6EA4DGCY.js";var E2=Ha(TB=>{"use strict";var CM=Symbol.for("react.transitional.element"),BM=Symbol.for("react.fragment");function m2(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:CM,type:n,key:s,ref:o!==void 0?o:null,props:l}}TB.Fragment=BM;TB.jsx=m2;TB.jsxs=m2});var N2=Ha(Rt=>{"use strict";var jQ=Symbol.for("react.transitional.element"),IM=Symbol.for("react.portal"),yM=Symbol.for("react.fragment"),QM=Symbol.for("react.strict_mode"),SM=Symbol.for("react.profiler"),vM=Symbol.for("react.consumer"),DM=Symbol.for("react.context"),RM=Symbol.for("react.forward_ref"),bM=Symbol.for("react.suspense"),TM=Symbol.for("react.memo"),y2=Symbol.for("react.lazy"),NM=Symbol.for("react.activity"),wM=Symbol.for("react.view_transition"),h2=Symbol.iterator;function xM(n){return n===null||typeof n!="object"?null:(n=h2&&n[h2]||n["@@iterator"],typeof n=="function"?n:null)}var Q2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S2=Object.assign,v2={};function kg(n,o,l){this.props=n,this.context=o,this.refs=v2,this.updater=l||Q2}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 D2(){}D2.prototype=kg.prototype;function zQ(n,o,l){this.props=n,this.context=o,this.refs=v2,this.updater=l||Q2}var FQ=zQ.prototype=new D2;FQ.constructor=zQ;S2(FQ,kg.prototype);FQ.isPureReactComponent=!0;var C2=Array.isArray;function LQ(){}var Kn={H:null,A:null,T:null,S:null},R2=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 _M(n,o){return JQ(n.type,o,n.props)}function KQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===jQ}function UM(n){var o={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return o[l]})}var B2=/\/+/g;function GQ(n,o){return typeof n=="object"&&n!==null&&n.key!=null?UM(""+n.key):o.toString(36)}function MM(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 IM:E=!0;break;case y2:return E=n._init,Og(E(n._payload),o,l,s,u)}}if(E)return u=u(n),E=s===""?"."+GQ(n,0):s,C2(u)?(l="",E!=null&&(l=E.replace(B2,"$&/")+"/"),Og(u,o,l,"",function(S){return S})):u!=null&&(KQ(u)&&(u=_M(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(B2,"$&/")+"/")+E)),o.push(u)),1;E=0;var B=s===""?".":s+":";if(C2(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=xM(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(MM(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 OM(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 I2=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 b2(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,I2)}catch(p){I2(p)}finally{o!==null&&l.types!==null&&(o.types=l.types),Kn.T=o}}function T2(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 b2(T2.bind(null,n))}var kM={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=NM;Rt.Children=kM;Rt.Component=kg;Rt.Fragment=yM;Rt.Profiler=SM;Rt.PureComponent=zQ;Rt.StrictMode=QM;Rt.Suspense=bM;Rt.ViewTransition=wM;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=T2;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=S2({},n.props),u=n.key;if(o!=null)for(p in o.key!==void 0&&(u=""+o.key),o)!R2.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:DM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:vM,_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)R2.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:RM,render:n}};Rt.isValidElement=KQ;Rt.lazy=function(n){return{$$typeof:y2,_payload:{_status:-1,_result:n},_init:OM}};Rt.memo=function(n,o){return{$$typeof:TM,type:n,compare:o===void 0?null:o}};Rt.startTransition=b2;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 w2=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 We:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case $e: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 et:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function w(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===et)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 N(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 L(y,U){function ue(){kn||(kn=!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 j(){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:j}):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===et&&(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 et: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 rs,A as R1,Aa as $m,B as b1,Ba as V1,C as dA,Ca as X1,D as Xm,Da as AB,E as T1,Ea as VA,F as N1,Fa as Z1,G as w1,Ga as P1,H as x1,Ha as W1,I as As,Ia as ls,J as _1,Ja as Dg,K as Zm,Ka as $1,L as gA,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 uD,Z as eB,Za as rB,_ as Mn,_a as sB,a as R,aa as H1,ab as cB,b as XC,ba as Pm,bb as uB,c as qA,ca as yg,cb as fD,d as fA,da as G1,db as eE,e as fr,ea as Wm,eb as aQ,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 ED,k as gr,ka as L1,kb as fB,l as Nl,la as Sg,lb as hD,m as wl,ma as Zo,mb as CD,n as Wy,na as Po,nb as oQ,o as Pn,oa as Pe,ob as iQ,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,sb as QD,t as cc,ta as aB,u as In,ua as vg,v as pr,va as K1,vb as SD,w as PC,wa as oB,wb as vD,x as eQ,xa as iB,y as WC,ya as Y1,z as D1,za as q1}from"./chunk-DWF3VS6P.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 cx,d as st}from"./chunk-6EA4DGCY.js";var E2=Ha(TB=>{"use strict";var CM=Symbol.for("react.transitional.element"),BM=Symbol.for("react.fragment");function m2(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:CM,type:n,key:s,ref:o!==void 0?o:null,props:l}}TB.Fragment=BM;TB.jsx=m2;TB.jsxs=m2});var N2=Ha(Rt=>{"use strict";var jQ=Symbol.for("react.transitional.element"),IM=Symbol.for("react.portal"),yM=Symbol.for("react.fragment"),QM=Symbol.for("react.strict_mode"),SM=Symbol.for("react.profiler"),vM=Symbol.for("react.consumer"),DM=Symbol.for("react.context"),RM=Symbol.for("react.forward_ref"),bM=Symbol.for("react.suspense"),TM=Symbol.for("react.memo"),y2=Symbol.for("react.lazy"),NM=Symbol.for("react.activity"),wM=Symbol.for("react.view_transition"),h2=Symbol.iterator;function xM(n){return n===null||typeof n!="object"?null:(n=h2&&n[h2]||n["@@iterator"],typeof n=="function"?n:null)}var Q2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S2=Object.assign,v2={};function kg(n,o,l){this.props=n,this.context=o,this.refs=v2,this.updater=l||Q2}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 D2(){}D2.prototype=kg.prototype;function zQ(n,o,l){this.props=n,this.context=o,this.refs=v2,this.updater=l||Q2}var FQ=zQ.prototype=new D2;FQ.constructor=zQ;S2(FQ,kg.prototype);FQ.isPureReactComponent=!0;var C2=Array.isArray;function LQ(){}var Kn={H:null,A:null,T:null,S:null},R2=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 _M(n,o){return JQ(n.type,o,n.props)}function KQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===jQ}function UM(n){var o={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return o[l]})}var B2=/\/+/g;function GQ(n,o){return typeof n=="object"&&n!==null&&n.key!=null?UM(""+n.key):o.toString(36)}function MM(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 IM:E=!0;break;case y2:return E=n._init,Og(E(n._payload),o,l,s,u)}}if(E)return u=u(n),E=s===""?"."+GQ(n,0):s,C2(u)?(l="",E!=null&&(l=E.replace(B2,"$&/")+"/"),Og(u,o,l,"",function(S){return S})):u!=null&&(KQ(u)&&(u=_M(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(B2,"$&/")+"/")+E)),o.push(u)),1;E=0;var B=s===""?".":s+":";if(C2(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=xM(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(MM(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 OM(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 I2=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 b2(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,I2)}catch(p){I2(p)}finally{o!==null&&l.types!==null&&(o.types=l.types),Kn.T=o}}function T2(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 b2(T2.bind(null,n))}var kM={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=NM;Rt.Children=kM;Rt.Component=kg;Rt.Fragment=yM;Rt.Profiler=SM;Rt.PureComponent=zQ;Rt.StrictMode=QM;Rt.Suspense=bM;Rt.ViewTransition=wM;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=T2;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=S2({},n.props),u=n.key;if(o!=null)for(p in o.key!==void 0&&(u=""+o.key),o)!R2.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:DM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:vM,_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)R2.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:RM,render:n}};Rt.isValidElement=KQ;Rt.lazy=function(n){return{$$typeof:y2,_payload:{_status:-1,_result:n},_init:OM}};Rt.memo=function(n,o){return{$$typeof:TM,type:n,compare:o===void 0?null:o}};Rt.startTransition=b2;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 w2=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 We:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case $e: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 et:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function w(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===et)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 N(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 L(y,U){function ue(){kn||(kn=!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 j(){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:j}):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===et&&(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 et: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(` ${R.cya
|
|
|
607
607
|
`,0),Pe(`Source: ${l.bundledPath?"bundled TDK example":l.repo}`,0),Pe(`Destination: ${u}
|
|
608
608
|
`,0);try{if(l.bundledPath){let p=SB(vU(DU(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");IU(SB(p,l.bundledPath),u,{recursive:!0});let E=SU(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");QU(I,S.replaceAll("tdk_example",E))}}else BU("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(R.green(`
|
|
609
609
|
\u2705 Cloned "${n}" into ${s}/`)),Pe(`
|
|
610
|
-
Next steps:`,0),Pe(`1. cd ${s}`),Pe("2. tdk doctor # check Docker/Tilt are ready"),Pe("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:TU()},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:{}},DR=new RU("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),Pe(`1. cd ${s}`),Pe("2. tdk doctor # check Docker/Tilt are ready"),Pe("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:TU()},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:{}},DR=new RU("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-IKGPFETT.js");if(await l(),n){await wn(async()=>NU(n,o.path));return}await wn(async()=>{let s=In();s||(s=SR(),Po(`\u{1F680} Initializing new TDK project...
|
|
611
611
|
`),Pe(`Location: ${s}
|
|
612
612
|
`,0));let u=Mg(s,".tdk"),p=Mg(u,gr);if(o.check){let N=wl.every(j=>uc(Mg(s,".tdk",".tdk-out",j))),L=uc(p);if(N&&L){let j=Gi(s);Zo("Project configuration is valid"),Pe(`Project: ${j.project.name}`,3),Pe(`Phases: ${Object.keys(j.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(R.yellow("\u26A0\uFE0F Project configuration incomplete:")),L||Pe(".tdk/project.json (not found)",3),!N)for(let j of wl.filter(M=>!uc(Mg(s,".tdk/.tdk-out",M))))Pe(`.tdk/.tdk-out/${j} (not found)`,3);Pe("Run `tdk project` to create them."),process.exit(1)}}Yu("Project Configuration"),Pe(`Project root: ${s}
|
|
613
613
|
`,0),uc(u)||(ND(u),Zo("Created: .tdk/ directory"));let E=uc(p);if(E&&!o.force){Zo(".tdk/project.json exists");let N=JSON.parse(QQ(p,"utf-8")),L=Gi(s),j=SQ(s),M=vQ(L,j);if((M.length>0||!N.phases)&&ss(p,L),M.length>0&&Pe(`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(R.red(`\u2717 ${E}`)),console.error(R.gray(` Fix: ${B}`)),l(1)}import{execFileSync as E3}from"node:child_process";var vw=(n,o)=>E3(n,o,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function h3(n,o=process.platform,l=vw){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=vw){let s=h3(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 Dw(n,o){let l=new Set(o.map(s=>s.name));return n.filter(s=>!l.has(s))}function Rw(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 Tw(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 y3(n,o){return n!=="win32"||o==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function Q3(n=lD(),o=S3){return n.kind==="webcontainer"?iD:rD(n.kind)&&!await o()?AD:null}async function S3(){let{execFile:n}=await import("node:child_process");return new Promise(o=>{n("docker",["ps"],{timeout:1e4},l=>o(!l))})}var v3=2;function D3(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 R3(n,o,l=process.exit){if(o.ignoreDrift){console.warn(R.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let s=D3(n);if(s){o.onDrift?.(s.join(`
|
|
1418
1418
|
`));for(let u of s)console.error(R.red(u));l(v3)}}function b3(n,o,l=pr(),s=process.exit){if(o.ignoreVersion){console.warn(R.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let u=yD(n,l);u.status==="none"||u.status==="ok"||(o.onFail?.(`${u.message}
|
|
1419
|
-
${u.fix}`),console.error(R.red(u.message)),console.error(R.red(u.fix)),s(1))}function T3(n,o=3e4){return new Promise(l=>{let s=Date.now()+o,u=()=>{let p=B3({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 Nw=new I3("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=In();p&&b3(p,{ignoreVersion:o.ignoreVersion,onFail:w=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:w}])});let E=o.dryRun?null:await Q3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=y3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=In();if(I&&Sw(I,{onInvalid:w=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:w}])}),!o.dryRun){let{assertMachineReadyOrExit:w}=await import("./cold-preflight-
|
|
1419
|
+
${u.fix}`),console.error(R.red(u.message)),console.error(R.red(u.fix)),s(1))}function T3(n,o=3e4){return new Promise(l=>{let s=Date.now()+o,u=()=>{let p=B3({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 Nw=new I3("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=In();p&&b3(p,{ignoreVersion:o.ignoreVersion,onFail:w=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:w}])});let E=o.dryRun?null:await Q3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=y3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=In();if(I&&Sw(I,{onInvalid:w=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:w}])}),!o.dryRun){let{assertMachineReadyOrExit:w}=await import("./cold-preflight-IKGPFETT.js");await w()}let S=async()=>{let w=o.dryRun?Za():In(),x=w??process.cwd(),v=Z1(),N,L=[];if((!o.only||n)&&(N=ls(v),L=N.map(J=>J.name)),o.only){if(n&&!Dg(n)){let Ge=on.stackNotFound(n,L);l?.({ok:!1},[BB(Ge).error]),Ge.exit()}let J=n?v.filter(Ge=>Ge.stack===n):v,Te=Dw(o.only,J);if(Te.length>0){let Ge=J.map($e=>$e.name),We=on.unknownServices(Te,Ge);l?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:We.message,...We.suggestions.length>0?{suggestions:We.suggestions}:{}}]),We.exit()}}w&&R3(w,{ignoreDrift:o.ignoreDrift,onDrift:J=>l?.({ok:!1},[{code:"DRIFT_DETECTED",message:J}])}),w&&ID(w,{onInvalid:J=>l?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:J}])}),w&&!l&&!o.quiet&&BD(w);let j=await fB(x,{inspectDocker:!o.dryRun});if(!o.dryRun){if(w){let Ge=eE(x);Ge.length>0&&!o.quiet&&console.log(R.gray(`Added ${Ge.join(", ")} to .env (generated; existing values unchanged)`))}w&&!C3(bw(x,".tdk",".tdk-out","Tiltfile"))&&(o.quiet||console.log(R.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(R.gray(`Refreshed runtime assets: ${J.join(", ")}`));let Te=vR(x);Te.length>0&&!o.quiet&&console.log(R.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,L);l?.({ok:!1},[BB(J).error]),J.exit()}he=M.map(J=>J.name),ae=`stack "${n}"`}else{M=v;let J=N??ls(v);ae=`all stacks (${Mn(J.length,"stack")}, ${Mn(M.length,"service")})`}let Re=[];if(o.only){let J=Rw(o.only,VA());M=J.selected,Re=J.dependencies,he=M.map(Te=>Te.name),ae=`${Mn(o.only.length,"requested service")}${Re.length>0?` plus ${Re.join(", ")}`:""}`}o.verbose&&!o.quiet&&console.log(R.gray(`Found ${Mn(M.length,"service")} in ${ae}`));let Ie=M.map(J=>J.name);if(!o.quiet){console.log(R.blue(`${o.dryRun?"Would start":"Starting"} ${Mn(Ie.length,"service")} from ${ae}...`));for(let $e of Ie)console.log(R.gray(` - ${$e}`));let{appBase:J,apiBase:Te}=PC(j.ingressHttp),Ge=M.filter($e=>$e.config?.appType==="frontend"),We=M.filter($e=>cc($e.config?.appType));if(Ge.length>0){console.log(R.blue(`
|
|
1420
1420
|
\u{1F30D} Frontend URLs:`));for(let $e of Ge){let ut=$e.config?.basePath??`/${$e.name}`;console.log(R.gray(` - ${$e.name}: ${J}${R.cyan(eQ(ut))}`))}}if(We.length>0){console.log(R.blue(`
|
|
1421
1421
|
\u{1F527} Backend API URLs:`));for(let $e of We){let ut=$e.name.replace(/-api$/,""),qe=$e.config?.apiPath??`/api/${ut}`,He=$e.config?.sablier,et=He?.enable&&He?.deferStart?R.dim(" (deferred \u2014 starts on first request)"):"";console.log(R.gray(` - ${$e.name}: ${Te}${R.cyan(eQ(qe))}${et}`))}}}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(R.blue(gD(j)));for(let J of Qw(j))console.log(R.yellow(J));console.log(R.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;ED(j),mD(x,j);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=f2({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(R.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 d2({configuredPort:u,force:o.force,basePort:ze,findAvailablePort:BR}),at=kt.port;kt.autoSwitched&&!o.quiet&&(console.log(R.yellow(`\u26A0\uFE0F Port ${ze} is already in use`)),console.log(R.blue(`\u{1F504} Auto-switching to port ${at}
|
|
1422
1422
|
`))),process.env.TILT_PORT=at.toString(),await g2({force:o.force,quiet:o.quiet,port:at},{stop:LI,log:J=>console.log(R.yellow(J)),wait:J=>new Promise(Te=>setTimeout(Te,J))}),o.quiet||(console.log(R.gray(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{tb as a,ub as b,vb as c,wb as d,xb as e}from"./chunk-
|
|
2
|
+
import{tb as a,ub as b,vb as c,wb as d,xb as e}from"./chunk-DWF3VS6P.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
|
@@ -68,7 +68,27 @@ def prisma_engines_symlink():
|
|
|
68
68
|
"""
|
|
69
69
|
return (
|
|
70
70
|
"# Re-link @prisma packages from Bun store so Prisma CLI can resolve engines\n"
|
|
71
|
-
|
|
71
|
+
# Written inline: the template this used to COPY is not shipped anywhere.
|
|
72
|
+
+ "RUN cat > /usr/local/bin/prisma-runtime-relink.sh << 'EOF'\n"
|
|
73
|
+
+ "#!/bin/sh\n"
|
|
74
|
+
+ "set -e\n"
|
|
75
|
+
+ "# Nested @prisma packages: replace the symlink into node_modules/.bun with a real copy.\n"
|
|
76
|
+
+ "for name in client adapter-pg; do\n"
|
|
77
|
+
+ " src=$(ls -d /app/node_modules/.bun/@prisma+${name}@*/node_modules/@prisma/${name} 2>/dev/null | head -n 1 || true)\n"
|
|
78
|
+
+ " if [ -n \"$src\" ]; then\n"
|
|
79
|
+
+ " rm -rf /app/node_modules/@prisma/${name}\n"
|
|
80
|
+
+ " mkdir -p /app/node_modules/@prisma\n"
|
|
81
|
+
+ " cp -R \"$src\" /app/node_modules/@prisma/${name}\n"
|
|
82
|
+
+ " fi\n"
|
|
83
|
+
+ "done\n"
|
|
84
|
+
+ "# Top-level @prisma/engines: copy as real files, not a symlink.\n"
|
|
85
|
+
+ "src=$(ls -d /app/node_modules/.bun/@prisma+engines@*/node_modules/@prisma/engines 2>/dev/null | head -n 1 || true)\n"
|
|
86
|
+
+ "if [ -n \"$src\" ]; then\n"
|
|
87
|
+
+ " rm -rf /app/node_modules/@prisma/engines\n"
|
|
88
|
+
+ " mkdir -p /app/node_modules/@prisma\n"
|
|
89
|
+
+ " cp -R \"$src\" /app/node_modules/@prisma/engines\n"
|
|
90
|
+
+ "fi\n"
|
|
91
|
+
+ "EOF\n"
|
|
72
92
|
+ "RUN chmod +x /usr/local/bin/prisma-runtime-relink.sh && /usr/local/bin/prisma-runtime-relink.sh\n"
|
|
73
93
|
)
|
|
74
94
|
|
|
@@ -20,6 +20,7 @@ load('../l2_dependency_layers.star', 'normalize_res_path')
|
|
|
20
20
|
load('../../../../../../discovery/config.star', 'GLOBAL_CONFIG')
|
|
21
21
|
load('../../../../tilt/manifest/constants.star', 'AUTOGENERATED_CONFIG_PATHS')
|
|
22
22
|
load('./filesystem_setup.star', 'migrator_filesystem_setup')
|
|
23
|
+
load('./migrate_script.star', 'migrate_sh_dockerfile_block')
|
|
23
24
|
load(
|
|
24
25
|
'./constants.star',
|
|
25
26
|
'APP_DIR',
|
|
@@ -41,7 +42,6 @@ load(
|
|
|
41
42
|
|
|
42
43
|
_docker_cfg = GLOBAL_CONFIG['docker']
|
|
43
44
|
GOLDEN_L4_MIGRATOR_IMAGE = _docker_cfg.get('golden_l4_migrator_image', DEFAULT_GOLDEN_L4_MIGRATOR_IMAGE)
|
|
44
|
-
MIGRATE_SH_TEMPLATE_PATH = "shared-platform-engineering/docker-templates/migrate.sh"
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
# ---------------------------------------------------------------------------
|
|
@@ -152,16 +152,13 @@ def _migrator_artifact_copies(res_path):
|
|
|
152
152
|
)
|
|
153
153
|
|
|
154
154
|
|
|
155
|
-
def _migrate_script_copy_block():
|
|
155
|
+
def _migrate_script_copy_block(resource_name):
|
|
156
156
|
"""
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
Write the migrate entrypoint inline. It used to be COPYed from
|
|
158
|
+
shared-platform-engineering/docker-templates, a file no package ships, so the
|
|
159
|
+
migrator image could not build.
|
|
159
160
|
"""
|
|
160
|
-
return (
|
|
161
|
-
"# Provide the migrate entrypoint\n"
|
|
162
|
-
+ "COPY " + MIGRATE_SH_TEMPLATE_PATH + " " + MIGRATE_SH_ABS_PATH + "\n"
|
|
163
|
-
+ "RUN chmod +x " + MIGRATE_SH_ABS_PATH + "\n"
|
|
164
|
-
)
|
|
161
|
+
return migrate_sh_dockerfile_block(resource_name)
|
|
165
162
|
|
|
166
163
|
|
|
167
164
|
def L4_generate_migrator_runtime(res_path, resource_name = 'migrator', use_golden = True):
|
|
@@ -194,7 +191,7 @@ def L4_generate_migrator_runtime(res_path, resource_name = 'migrator', use_golde
|
|
|
194
191
|
+ "USER " + ROOT_USER + "\n"
|
|
195
192
|
+ migrator_filesystem_setup()
|
|
196
193
|
+ "USER " + ROOT_USER + "\n"
|
|
197
|
-
+ _migrate_script_copy_block()
|
|
194
|
+
+ _migrate_script_copy_block(resource_name)
|
|
198
195
|
# Migrators are one-shot jobs; they should not inherit long-running
|
|
199
196
|
# service healthchecks (e.g. HTTP probes on localhost:3000) from base layers.
|
|
200
197
|
+ "HEALTHCHECK NONE\n"
|