@tdk-landscape/tdk-cli-core 1.3.133 → 1.3.134
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
CHANGED
|
@@ -43,6 +43,8 @@ Docker runs the containers. Tilt watches services and live-updates containers wh
|
|
|
43
43
|
|
|
44
44
|
No teams are listed yet. Be the first: [tell us you use TDK](https://github.com/tdk-landscape/tdk-cli-core/issues/new?template=we-use-tdk.yml) or [add a row to ADOPTERS.md](ADOPTERS.md).
|
|
45
45
|
|
|
46
|
+
If TDK saves you time, a ⭐ on [this repo](https://github.com/tdk-landscape/tdk-cli-core) helps other developers find it.
|
|
47
|
+
|
|
46
48
|
## Quick start
|
|
47
49
|
|
|
48
50
|
```bash
|
|
@@ -9,7 +9,7 @@ To create a stack, use:`},services:{singular:"service",command:"tdk resource <na
|
|
|
9
9
|
To create a service:`},"stack-services":{singular:"service",command:"tdk resource <name> --stack <stack-name>",context:`
|
|
10
10
|
To add services to this stack:`}};function du(e,t){let n=Zs[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(`
|
|
11
11
|
Or create a new resource with a stack:`)),console.log(f.gray(" tdk resource <name> --stack <stack-name>")))}function lu(e){console.log(f.yellow(e||"Cancelled."))}function pu(e){console.log(f.blue(`TDK ${e}
|
|
12
|
-
`))}function fu(e,t){console.log(f.green(`All ${e} are ${t}!`))}var rt=62;function mu(e="\u2500",t=rt){return e.repeat(t)}function En(e,t=rt-2){let n=Math.max(0,t-e.length),r=Math.floor(n/2),s=n-r;return" ".repeat(r)+e+" ".repeat(s)}function hu(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function gu(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function ku(e){console.log(f.green(`\u2713 ${e}`))}function yu(e){console.log(f.blue(e))}function Su(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function bu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function xu(e,t,n=rt){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(En(e,r))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(En(t,r))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as eo}from"node:fs";import{dirname as to,join as no,resolve as _n}from"node:path";import{cwd as ro}from"node:process";var Rn={name:"tdk-cli-internal",private:!0,version:"1.3.133",description:"TDK CLI \u2014 start services on your laptop.",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","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=ro()){let t=_n(e),n=_n("/");for(;t!==n;){if(eo(no(t,".tdk","project.json")))return t;let r=to(t);if(r===t)break;t=r}return null}var $e=null;function so(){if($e)return $e;let e=Rn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return $e={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},$e}function On(){return so().version}import{readFileSync as oo}from"node:fs";import{join as io}from"node:path";function st(){let e=m();if(e)try{let t=oo(io(e,".tdk","project.json"),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function ot(e){let t=st(),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.port||(e?String(e):"");if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${r.protocol}//${s}${o?`:${o}`:""}`,apiBase:`${r.protocol}//${s}${o?`:${o}`:""}`};let i=s.replace(/^(app|api)\./,"");return{appBase:`${r.protocol}//app.${i}${o?`:${o}`:""}`,apiBase:`${r.protocol}//api.${i}${o?`:${o}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function ao(e){return`${e.replace(/\/+$/,"")}/health`}function it(e){if(P(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function An(e,t){let{appBase:n,apiBase:r}=ot(t);return e.filter(s=>s.config?.appType==="frontend"||P(s.config?.appType)).map(s=>{let o=P(s.config.appType)?r:n;return{name:s.name,appType:s.config.appType,url:`${o}${ao(it(s))}`}})}async function co(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 Dn(e,t){return Promise.all(e.map(n=>co(n,t)))}import{existsSync as J,readdirSync as nr,readFileSync as rr,statSync as mt}from"node:fs";import{dirname as Jo,join as U}from"node:path";var ce=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 Cn(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as yo,execSync as So}from"node:child_process";import{existsSync as mo}from"node:fs";import{delimiter as ho,extname as go,join as ko}from"node:path";import{delimiter as Iu,extname as uo}from"node:path";function Ee(){return process.platform==="win32"}function lo(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function po(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function fo(e,t){let n=lo(e),r=po(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function Fu(){return fo(process.platform,process.arch)}function Mu(){return Ee()?"tdk.exe":"tdk"}function Nn(e,t=Ee()){return t?uo(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",n=Ee(),r=Nn(e,n);if(n&&!go(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(ho))if(s)for(let o of r){let i=ko(s,o);if(mo(i))return i}return null}var jn=1e4;function In(){let e=!1;if(process.platform==="win32")try{return yo($("docker")??"docker",["ps"],{stdio:"ignore",timeout:jn,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return So(t,{stdio:"ignore",timeout:jn}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function bo(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(s[o-1]+1,n[o]+1,n[o-1]+i)}n=s}return n[t.length]}function xo(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 Fn(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=xo(n,i)?1:bo(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 To}from"node:child_process";import{join as wo}from"node:path";function vo(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=To($("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 Mn(){try{return(await vo("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Po(){let e=m();if(!e)throw I.notInProject();return wo(e,".tdk",".tdk-out","Tiltfile")}function Ln(e){let t=Po();e.push("-f",t)}function Qu(e,t={}){let n=[];return Ln(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 ed(e={}){let t=[];return Ln(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function Bn(e){return e instanceof Error?e.message:String(e)}function cd(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${Bn(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var E=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){Ro(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function at(e,t,n=!1){let r=new Set;for(let s of e){let o=Fn(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var I={tiltNotInstalled:()=>new E("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: ${Qe}`]),dockerNotAvailable:()=>new E("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: ${Qe}`]),dockerNotResponding:()=>new E("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 E(`Stack "${e}" not found`,[...at([e],t),"Run `tdk stacks` to see available stacks","Run `tdk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new E(`Resource "${e}" not found`,[...at([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=at(e,t,e.length>1);return new E(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new E(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new E(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new E("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 ud(){let e=m();return e||I.notInProject().exit()}function $o(e){e instanceof E&&e.exit(),console.error(f.red(`Error: ${Bn(e)}`)),process.exit(1)}async function Eo(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),$o(n)}}async function dd(e,t){let n=[],r=In();return r==="unresponsive"?n.push(I.dockerNotResponding()):r==="missing"&&n.push(I.dockerNotAvailable()),await Mn()||n.push(I.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
12
|
+
`))}function fu(e,t){console.log(f.green(`All ${e} are ${t}!`))}var rt=62;function mu(e="\u2500",t=rt){return e.repeat(t)}function En(e,t=rt-2){let n=Math.max(0,t-e.length),r=Math.floor(n/2),s=n-r;return" ".repeat(r)+e+" ".repeat(s)}function hu(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function gu(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function ku(e){console.log(f.green(`\u2713 ${e}`))}function yu(e){console.log(f.blue(e))}function Su(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function bu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function xu(e,t,n=rt){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(En(e,r))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(En(t,r))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as eo}from"node:fs";import{dirname as to,join as no,resolve as _n}from"node:path";import{cwd as ro}from"node:process";var Rn={name:"tdk-cli-internal",private:!0,version:"1.3.134",description:"TDK CLI \u2014 start services on your laptop.",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","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=ro()){let t=_n(e),n=_n("/");for(;t!==n;){if(eo(no(t,".tdk","project.json")))return t;let r=to(t);if(r===t)break;t=r}return null}var $e=null;function so(){if($e)return $e;let e=Rn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return $e={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},$e}function On(){return so().version}import{readFileSync as oo}from"node:fs";import{join as io}from"node:path";function st(){let e=m();if(e)try{let t=oo(io(e,".tdk","project.json"),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function ot(e){let t=st(),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.port||(e?String(e):"");if(s==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(s))return{appBase:`${r.protocol}//${s}${o?`:${o}`:""}`,apiBase:`${r.protocol}//${s}${o?`:${o}`:""}`};let i=s.replace(/^(app|api)\./,"");return{appBase:`${r.protocol}//app.${i}${o?`:${o}`:""}`,apiBase:`${r.protocol}//api.${i}${o?`:${o}`:""}`}}catch{return{appBase:`http://app.${t}.localhost`,apiBase:`http://api.${t}.localhost`}}}function ao(e){return`${e.replace(/\/+$/,"")}/health`}function it(e){if(P(e.config?.appType)){let t=e.name.replace(/-api$/,"");return e.config?.apiPath??`/api/${t}`}return e.config?.basePath??`/${e.name}`}function An(e,t){let{appBase:n,apiBase:r}=ot(t);return e.filter(s=>s.config?.appType==="frontend"||P(s.config?.appType)).map(s=>{let o=P(s.config.appType)?r:n;return{name:s.name,appType:s.config.appType,url:`${o}${ao(it(s))}`}})}async function co(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 Dn(e,t){return Promise.all(e.map(n=>co(n,t)))}import{existsSync as J,readdirSync as nr,readFileSync as rr,statSync as mt}from"node:fs";import{dirname as Jo,join as U}from"node:path";var ce=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 Cn(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as yo,execSync as So}from"node:child_process";import{existsSync as mo}from"node:fs";import{delimiter as ho,extname as go,join as ko}from"node:path";import{delimiter as Iu,extname as uo}from"node:path";function Ee(){return process.platform==="win32"}function lo(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function po(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function fo(e,t){let n=lo(e),r=po(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function Fu(){return fo(process.platform,process.arch)}function Mu(){return Ee()?"tdk.exe":"tdk"}function Nn(e,t=Ee()){return t?uo(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",n=Ee(),r=Nn(e,n);if(n&&!go(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(ho))if(s)for(let o of r){let i=ko(s,o);if(mo(i))return i}return null}var jn=1e4;function In(){let e=!1;if(process.platform==="win32")try{return yo($("docker")??"docker",["ps"],{stdio:"ignore",timeout:jn,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return So(t,{stdio:"ignore",timeout:jn}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function bo(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(s[o-1]+1,n[o]+1,n[o-1]+i)}n=s}return n[t.length]}function xo(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 Fn(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=xo(n,i)?1:bo(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 To}from"node:child_process";import{join as wo}from"node:path";function vo(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=To($("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 Mn(){try{return(await vo("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Po(){let e=m();if(!e)throw I.notInProject();return wo(e,".tdk",".tdk-out","Tiltfile")}function Ln(e){let t=Po();e.push("-f",t)}function Qu(e,t={}){let n=[];return Ln(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 ed(e={}){let t=[];return Ln(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function Bn(e){return e instanceof Error?e.message:String(e)}function cd(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${Bn(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var E=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){Ro(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function at(e,t,n=!1){let r=new Set;for(let s of e){let o=Fn(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var I={tiltNotInstalled:()=>new E("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: ${Qe}`]),dockerNotAvailable:()=>new E("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: ${Qe}`]),dockerNotResponding:()=>new E("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 E(`Stack "${e}" not found`,[...at([e],t),"Run `tdk stacks` to see available stacks","Run `tdk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new E(`Resource "${e}" not found`,[...at([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=at(e,t,e.length>1);return new E(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new E(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new E(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new E("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 ud(){let e=m();return e||I.notInProject().exit()}function $o(e){e instanceof E&&e.exit(),console.error(f.red(`Error: ${Bn(e)}`)),process.exit(1)}async function Eo(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),$o(n)}}async function dd(e,t){let n=[],r=In();return r==="unresponsive"?n.push(I.dockerNotResponding()):r==="missing"&&n.push(I.dockerNotAvailable()),await Mn()||n.push(I.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
13
13
|
TDK can't start - missing prerequisites:
|
|
14
14
|
`)),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)),Eo(e,t)}function ld(e,t=1){console.error(f.red(`Error: ${e}`)),process.exit(t)}function Ro(e,t,n){console.error(f.red(`\u274C ${e}`)),t&&console.error(f.gray(` ${t}`)),n&&n.length>0&&(console.error(f.yellow(`
|
|
15
15
|
\u{1F4A1} Suggestions:`)),n.forEach(r=>{console.error(f.cyan(` \u2192 ${r}`))}))}function pd(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 Jy,$a as nB,A as Gm,Aa as G1,B as fA,Ba as L1,C as KA,Ca as j1,D as dg,Da as PC,E as Lm,Ea as Ky,F as I1,Fa as z1,G as y1,Ga as F1,H as Hu,Ha as J1,I as di,Ia as K1,J as pn,Ja as Y1,K as on,Ka as q1,L as Za,La as V1,M as xn,Ma as X1,N as FC,Na as Z1,O as Uo,Oa as WC,P as JC,Pa as $C,Q as Jn,Qa as ns,R as Q1,Ra as eB,S as S1,Sa as tB,T as jm,Ta as P1,U as gg,Ua as Jm,V as v1,Va as Yy,W as zm,Wa as W1,X as pg,Xa as $1,Y as Gu,Ya as eD,Z as KC,Za as tD,_ as YC,_a as nD,a as R,aa as D1,ab as aD,b as GC,ba as mg,bb as oD,c as bl,ca as Zo,cb as qy,d as jy,da as Po,db as Vy,e as Ia,ea as nt,eb as iD,f as Tl,fa as R1,fb as AD,g as u1,ga as b1,gb as lD,h as zy,ha as T1,hb as rD,i as f1,ia as N1,j as ic,ja as qC,k as vn,ka as Eg,kb as sD,l as sr,la as w1,lb as cD,m as jC,ma as VC,n as Fy,na as XC,o as zC,oa as x1,p as d1,pa as _1,q as g1,qa as Fm,r as p1,ra as U1,s as uA,sa as M1,t as Hm,ta as ZC,u as m1,ua as YA,v as E1,va as O1,w as h1,wa as k1,x as C1,xa as H1,y as es,ya as ts,z as B1,za as hg}from"./chunk-ULERVCPH.js";import{a as r1,c as LC,d as s1,e as c1}from"./chunk-OBQS5CYC.js";import{a as fg,b as ka,c as Yw,d as st}from"./chunk-6EA4DGCY.js";var ZR=ka(hB=>{"use strict";var PU=Symbol.for("react.transitional.element"),WU=Symbol.for("react.fragment");function XR(n,i,l){var s=null;if(l!==void 0&&(s=""+l),i.key!==void 0&&(s=""+i.key),"key"in i){l={};for(var u in i)u!=="key"&&(l[u]=i[u])}else l=i;return i=l.ref,{$$typeof:PU,type:n,key:s,ref:i!==void 0?i:null,props:l}}hB.Fragment=WU;hB.jsx=XR;hB.jsxs=XR});var s2=ka(Dt=>{"use strict";var TQ=Symbol.for("react.transitional.element"),$U=Symbol.for("react.portal"),eM=Symbol.for("react.fragment"),tM=Symbol.for("react.strict_mode"),nM=Symbol.for("react.profiler"),aM=Symbol.for("react.consumer"),oM=Symbol.for("react.context"),iM=Symbol.for("react.forward_ref"),AM=Symbol.for("react.suspense"),lM=Symbol.for("react.memo"),t2=Symbol.for("react.lazy"),rM=Symbol.for("react.activity"),sM=Symbol.for("react.view_transition"),PR=Symbol.iterator;function cM(n){return n===null||typeof n!="object"?null:(n=PR&&n[PR]||n["@@iterator"],typeof n=="function"?n:null)}var n2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},a2=Object.assign,o2={};function bg(n,i,l){this.props=n,this.context=i,this.refs=o2,this.updater=l||n2}bg.prototype.isReactComponent={};bg.prototype.setState=function(n,i){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,i,"setState")};bg.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function i2(){}i2.prototype=bg.prototype;function NQ(n,i,l){this.props=n,this.context=i,this.refs=o2,this.updater=l||n2}var wQ=NQ.prototype=new i2;wQ.constructor=NQ;a2(wQ,bg.prototype);wQ.isPureReactComponent=!0;var WR=Array.isArray;function bQ(){}var Kn={H:null,A:null,T:null,S:null},A2=Object.prototype.hasOwnProperty;function xQ(n,i,l){var s=l.ref;return{$$typeof:TQ,type:n,key:i,ref:s!==void 0?s:null,props:l}}function uM(n,i){return xQ(n.type,i,n.props)}function _Q(n){return typeof n=="object"&&n!==null&&n.$$typeof===TQ}function fM(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return i[l]})}var $R=/\/+/g;function RQ(n,i){return typeof n=="object"&&n!==null&&n.key!=null?fM(""+n.key):i.toString(36)}function dM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(bQ,bQ):(n.status="pending",n.then(function(i){n.status==="pending"&&(n.status="fulfilled",n.value=i)},function(i){n.status==="pending"&&(n.status="rejected",n.reason=i)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Rg(n,i,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 TQ:case $U:E=!0;break;case t2:return E=n._init,Rg(E(n._payload),i,l,s,u)}}if(E)return u=u(n),E=s===""?"."+RQ(n,0):s,WR(u)?(l="",E!=null&&(l=E.replace($R,"$&/")+"/"),Rg(u,i,l,"",function(S){return S})):u!=null&&(_Q(u)&&(u=uM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace($R,"$&/")+"/")+E)),i.push(u)),1;E=0;var B=s===""?".":s+":";if(WR(n))for(var I=0;I<n.length;I++)s=n[I],p=B+RQ(s,I),E+=Rg(s,i,l,p,u);else if(I=cM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+RQ(s,I++),E+=Rg(s,i,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Rg(dM(n),i,l,s,u);throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return E}function CB(n,i,l){if(n==null)return n;var s=[],u=0;return Rg(n,s,"","",function(p){return i.call(l,p,u++)}),s}function gM(n){if(n._status===-1){var i=n._result,l=i();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 e2=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=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(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function l2(n){var i=Kn.T,l={};l.types=i!==null?i.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(bQ,e2)}catch(p){e2(p)}finally{i!==null&&l.types!==null&&(i.types=l.types),Kn.T=i}}function r2(n){var i=Kn.T;if(i!==null){var l=i.types;l===null?i.types=[n]:l.indexOf(n)===-1&&l.push(n)}else l2(r2.bind(null,n))}var pM={map:CB,forEach:function(n,i,l){CB(n,function(){i.apply(this,arguments)},l)},count:function(n){var i=0;return CB(n,function(){i++}),i},toArray:function(n){return CB(n,function(i){return i})||[]},only:function(n){if(!_Q(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Dt.Activity=rM;Dt.Children=pM;Dt.Component=bg;Dt.Fragment=eM;Dt.Profiler=nM;Dt.PureComponent=NQ;Dt.StrictMode=tM;Dt.Suspense=AM;Dt.ViewTransition=sM;Dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kn;Dt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Kn.H.useMemoCache(n)}};Dt.addTransitionType=r2;Dt.cache=function(n){return function(){return n.apply(null,arguments)}};Dt.cacheSignal=function(){return null};Dt.cloneElement=function(n,i,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=a2({},n.props),u=n.key;if(i!=null)for(p in i.key!==void 0&&(u=""+i.key),i)!A2.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(s[p]=i[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 xQ(n.type,u,s)};Dt.createContext=function(n){return n={$$typeof:oM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:aM,_context:n},n};Dt.createElement=function(n,i,l){var s,u={},p=null;if(i!=null)for(s in i.key!==void 0&&(p=""+i.key),i)A2.call(i,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(u[s]=i[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 xQ(n,p,u)};Dt.createRef=function(){return{current:null}};Dt.forwardRef=function(n){return{$$typeof:iM,render:n}};Dt.isValidElement=_Q;Dt.lazy=function(n){return{$$typeof:t2,_payload:{_status:-1,_result:n},_init:gM}};Dt.memo=function(n,i){return{$$typeof:lM,type:n,compare:i===void 0?null:i}};Dt.startTransition=l2;Dt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Dt.use=function(n){return Kn.H.use(n)};Dt.useActionState=function(n,i,l){return Kn.H.useActionState(n,i,l)};Dt.useCallback=function(n,i){return Kn.H.useCallback(n,i)};Dt.useContext=function(n){return Kn.H.useContext(n)};Dt.useDebugValue=function(){};Dt.useDeferredValue=function(n,i){return Kn.H.useDeferredValue(n,i)};Dt.useEffect=function(n,i){return Kn.H.useEffect(n,i)};Dt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Dt.useId=function(){return Kn.H.useId()};Dt.useImperativeHandle=function(n,i,l){return Kn.H.useImperativeHandle(n,i,l)};Dt.useInsertionEffect=function(n,i){return Kn.H.useInsertionEffect(n,i)};Dt.useLayoutEffect=function(n,i){return Kn.H.useLayoutEffect(n,i)};Dt.useMemo=function(n,i){return Kn.H.useMemo(n,i)};Dt.useOptimistic=function(n,i){return Kn.H.useOptimistic(n,i)};Dt.useReducer=function(n,i,l){return Kn.H.useReducer(n,i,l)};Dt.useRef=function(n){return Kn.H.useRef(n)};Dt.useState=function(n){return Kn.H.useState(n)};Dt.useSyncExternalStore=function(n,i,l){return Kn.H.useSyncExternalStore(n,i,l)};Dt.useTransition=function(){return Kn.H.useTransition()};Dt.version="19.3.0"});var c2=ka((yt,BB)=>{"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 i(y){return y===null||typeof y!="object"?null:(y=Wa&&y[Wa]||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===Pn?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 ct: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 bt:return"Portal";case Pe:return y.displayName||"Context";case Le: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 w(){var y=Ve.A;return y===null?null:y.getOwner()}function T(){return Error("react-stack-top-frame")}function x(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,ut){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:ut}),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 Ge(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 ut=typeof y;(ut==="undefined"||ut==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ut){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case bt: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===""?"."+Ge(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function(Wn){return Wn})):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 _t=0;_t<y.length;_t++)re=y[_t],ut=Xe+Ge(re,_t),xe+=be(re,U,ue,ut,ce);else if(_t=i(y),typeof _t=="function")for(_t===y.entries&&(qt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qt=!0),y=_t.call(y),_t=0;!(re=y.next()).done;)re=re.value,ut=Xe+Ge(re,_t++),xe+=be(re,U,ue,ut,ce);else if(ut==="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(ut){return U.call(ue,ut,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 _t=xe?.default;U(_t),Xe.value.status="fulfilled",Xe.value.value=_t}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 ut=ce.displayName;typeof ut=="string"&&(re.name=ut)}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 Jy,$a as nB,A as Gm,Aa as G1,B as fA,Ba as L1,C as KA,Ca as j1,D as dg,Da as PC,E as Lm,Ea as Ky,F as I1,Fa as z1,G as y1,Ga as F1,H as Hu,Ha as J1,I as di,Ia as K1,J as pn,Ja as Y1,K as on,Ka as q1,L as Za,La as V1,M as xn,Ma as X1,N as FC,Na as Z1,O as Uo,Oa as WC,P as JC,Pa as $C,Q as Jn,Qa as ns,R as Q1,Ra as eB,S as S1,Sa as tB,T as jm,Ta as P1,U as gg,Ua as Jm,V as v1,Va as Yy,W as zm,Wa as W1,X as pg,Xa as $1,Y as Gu,Ya as eD,Z as KC,Za as tD,_ as YC,_a as nD,a as R,aa as D1,ab as aD,b as GC,ba as mg,bb as oD,c as bl,ca as Zo,cb as qy,d as jy,da as Po,db as Vy,e as Ia,ea as nt,eb as iD,f as Tl,fa as R1,fb as AD,g as u1,ga as b1,gb as lD,h as zy,ha as T1,hb as rD,i as f1,ia as N1,j as ic,ja as qC,k as vn,ka as Eg,kb as sD,l as sr,la as w1,lb as cD,m as jC,ma as VC,n as Fy,na as XC,o as zC,oa as x1,p as d1,pa as _1,q as g1,qa as Fm,r as p1,ra as U1,s as uA,sa as M1,t as Hm,ta as ZC,u as m1,ua as YA,v as E1,va as O1,w as h1,wa as k1,x as C1,xa as H1,y as es,ya as ts,z as B1,za as hg}from"./chunk-DLEX3BP5.js";import{a as r1,c as LC,d as s1,e as c1}from"./chunk-OBQS5CYC.js";import{a as fg,b as ka,c as Yw,d as st}from"./chunk-6EA4DGCY.js";var ZR=ka(hB=>{"use strict";var PU=Symbol.for("react.transitional.element"),WU=Symbol.for("react.fragment");function XR(n,i,l){var s=null;if(l!==void 0&&(s=""+l),i.key!==void 0&&(s=""+i.key),"key"in i){l={};for(var u in i)u!=="key"&&(l[u]=i[u])}else l=i;return i=l.ref,{$$typeof:PU,type:n,key:s,ref:i!==void 0?i:null,props:l}}hB.Fragment=WU;hB.jsx=XR;hB.jsxs=XR});var s2=ka(Dt=>{"use strict";var TQ=Symbol.for("react.transitional.element"),$U=Symbol.for("react.portal"),eM=Symbol.for("react.fragment"),tM=Symbol.for("react.strict_mode"),nM=Symbol.for("react.profiler"),aM=Symbol.for("react.consumer"),oM=Symbol.for("react.context"),iM=Symbol.for("react.forward_ref"),AM=Symbol.for("react.suspense"),lM=Symbol.for("react.memo"),t2=Symbol.for("react.lazy"),rM=Symbol.for("react.activity"),sM=Symbol.for("react.view_transition"),PR=Symbol.iterator;function cM(n){return n===null||typeof n!="object"?null:(n=PR&&n[PR]||n["@@iterator"],typeof n=="function"?n:null)}var n2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},a2=Object.assign,o2={};function bg(n,i,l){this.props=n,this.context=i,this.refs=o2,this.updater=l||n2}bg.prototype.isReactComponent={};bg.prototype.setState=function(n,i){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,i,"setState")};bg.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function i2(){}i2.prototype=bg.prototype;function NQ(n,i,l){this.props=n,this.context=i,this.refs=o2,this.updater=l||n2}var wQ=NQ.prototype=new i2;wQ.constructor=NQ;a2(wQ,bg.prototype);wQ.isPureReactComponent=!0;var WR=Array.isArray;function bQ(){}var Kn={H:null,A:null,T:null,S:null},A2=Object.prototype.hasOwnProperty;function xQ(n,i,l){var s=l.ref;return{$$typeof:TQ,type:n,key:i,ref:s!==void 0?s:null,props:l}}function uM(n,i){return xQ(n.type,i,n.props)}function _Q(n){return typeof n=="object"&&n!==null&&n.$$typeof===TQ}function fM(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return i[l]})}var $R=/\/+/g;function RQ(n,i){return typeof n=="object"&&n!==null&&n.key!=null?fM(""+n.key):i.toString(36)}function dM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(bQ,bQ):(n.status="pending",n.then(function(i){n.status==="pending"&&(n.status="fulfilled",n.value=i)},function(i){n.status==="pending"&&(n.status="rejected",n.reason=i)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Rg(n,i,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 TQ:case $U:E=!0;break;case t2:return E=n._init,Rg(E(n._payload),i,l,s,u)}}if(E)return u=u(n),E=s===""?"."+RQ(n,0):s,WR(u)?(l="",E!=null&&(l=E.replace($R,"$&/")+"/"),Rg(u,i,l,"",function(S){return S})):u!=null&&(_Q(u)&&(u=uM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace($R,"$&/")+"/")+E)),i.push(u)),1;E=0;var B=s===""?".":s+":";if(WR(n))for(var I=0;I<n.length;I++)s=n[I],p=B+RQ(s,I),E+=Rg(s,i,l,p,u);else if(I=cM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+RQ(s,I++),E+=Rg(s,i,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Rg(dM(n),i,l,s,u);throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return E}function CB(n,i,l){if(n==null)return n;var s=[],u=0;return Rg(n,s,"","",function(p){return i.call(l,p,u++)}),s}function gM(n){if(n._status===-1){var i=n._result,l=i();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 e2=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=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(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function l2(n){var i=Kn.T,l={};l.types=i!==null?i.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(bQ,e2)}catch(p){e2(p)}finally{i!==null&&l.types!==null&&(i.types=l.types),Kn.T=i}}function r2(n){var i=Kn.T;if(i!==null){var l=i.types;l===null?i.types=[n]:l.indexOf(n)===-1&&l.push(n)}else l2(r2.bind(null,n))}var pM={map:CB,forEach:function(n,i,l){CB(n,function(){i.apply(this,arguments)},l)},count:function(n){var i=0;return CB(n,function(){i++}),i},toArray:function(n){return CB(n,function(i){return i})||[]},only:function(n){if(!_Q(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Dt.Activity=rM;Dt.Children=pM;Dt.Component=bg;Dt.Fragment=eM;Dt.Profiler=nM;Dt.PureComponent=NQ;Dt.StrictMode=tM;Dt.Suspense=AM;Dt.ViewTransition=sM;Dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kn;Dt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Kn.H.useMemoCache(n)}};Dt.addTransitionType=r2;Dt.cache=function(n){return function(){return n.apply(null,arguments)}};Dt.cacheSignal=function(){return null};Dt.cloneElement=function(n,i,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=a2({},n.props),u=n.key;if(i!=null)for(p in i.key!==void 0&&(u=""+i.key),i)!A2.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(s[p]=i[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 xQ(n.type,u,s)};Dt.createContext=function(n){return n={$$typeof:oM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:aM,_context:n},n};Dt.createElement=function(n,i,l){var s,u={},p=null;if(i!=null)for(s in i.key!==void 0&&(p=""+i.key),i)A2.call(i,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(u[s]=i[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 xQ(n,p,u)};Dt.createRef=function(){return{current:null}};Dt.forwardRef=function(n){return{$$typeof:iM,render:n}};Dt.isValidElement=_Q;Dt.lazy=function(n){return{$$typeof:t2,_payload:{_status:-1,_result:n},_init:gM}};Dt.memo=function(n,i){return{$$typeof:lM,type:n,compare:i===void 0?null:i}};Dt.startTransition=l2;Dt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Dt.use=function(n){return Kn.H.use(n)};Dt.useActionState=function(n,i,l){return Kn.H.useActionState(n,i,l)};Dt.useCallback=function(n,i){return Kn.H.useCallback(n,i)};Dt.useContext=function(n){return Kn.H.useContext(n)};Dt.useDebugValue=function(){};Dt.useDeferredValue=function(n,i){return Kn.H.useDeferredValue(n,i)};Dt.useEffect=function(n,i){return Kn.H.useEffect(n,i)};Dt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Dt.useId=function(){return Kn.H.useId()};Dt.useImperativeHandle=function(n,i,l){return Kn.H.useImperativeHandle(n,i,l)};Dt.useInsertionEffect=function(n,i){return Kn.H.useInsertionEffect(n,i)};Dt.useLayoutEffect=function(n,i){return Kn.H.useLayoutEffect(n,i)};Dt.useMemo=function(n,i){return Kn.H.useMemo(n,i)};Dt.useOptimistic=function(n,i){return Kn.H.useOptimistic(n,i)};Dt.useReducer=function(n,i,l){return Kn.H.useReducer(n,i,l)};Dt.useRef=function(n){return Kn.H.useRef(n)};Dt.useState=function(n){return Kn.H.useState(n)};Dt.useSyncExternalStore=function(n,i,l){return Kn.H.useSyncExternalStore(n,i,l)};Dt.useTransition=function(){return Kn.H.useTransition()};Dt.version="19.3.0"});var c2=ka((yt,BB)=>{"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 i(y){return y===null||typeof y!="object"?null:(y=Wa&&y[Wa]||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===Pn?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 ct: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 bt:return"Portal";case Pe:return y.displayName||"Context";case Le: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 w(){var y=Ve.A;return y===null?null:y.getOwner()}function T(){return Error("react-stack-top-frame")}function x(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,ut){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:ut}),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 Ge(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 ut=typeof y;(ut==="undefined"||ut==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ut){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case bt: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===""?"."+Ge(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function(Wn){return Wn})):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 _t=0;_t<y.length;_t++)re=y[_t],ut=Xe+Ge(re,_t),xe+=be(re,U,ue,ut,ce);else if(_t=i(y),typeof _t=="function")for(_t===y.entries&&(qt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qt=!0),y=_t.call(y),_t=0;!(re=y.next()).done;)re=re.value,ut=Xe+Ge(re,_t++),xe+=be(re,U,ue,ut,ce);else if(ut==="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(ut){return U.call(ue,ut,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 _t=xe?.default;U(_t),Xe.value.status="fulfilled",Xe.value.value=_t}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 ut=ce.displayName;typeof ut=="string"&&(re.name=ut)}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(dB))console.log(` ${R.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=gB(AU(lU(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");nU(gB(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=Dg(u,B),S=fQ(I,"utf-8");oU(I,S.replaceAll("tdk_example",E))}}else tU("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}/`)),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 Pm={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:cU()},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:{}},cR=new rU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(dB).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,i)=>{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 Pm={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:cU()},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:{}},cR=new rU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(dB).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,i)=>{let{assertMachineReadyOrExit:l}=await import("./cold-preflight-6X67ZFII.js");if(await l(),n){await xn(async()=>uU(n,i.path));return}await xn(async()=>{let s=vn();s||(s=rR(),Po(`\u{1F680} Initializing new TDK project...
|
|
611
611
|
`),nt(`Location: ${s}
|
|
612
612
|
`,0));let u=Dg(s,".tdk"),p=Dg(u,"project.json");if(i.check){let x=bl.every(F=>Ac(Dg(s,".tdk",".tdk-out",F))),z=Ac(p);if(x&&z){let F=Hi(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(R.yellow("\u26A0\uFE0F Project configuration incomplete:")),z||nt(".tdk/project.json (not found)",3),!x)for(let F of bl.filter(M=>!Ac(Dg(s,".tdk/.tdk-out",M))))nt(`.tdk/.tdk-out/${F} (not found)`,3);nt("Run `tdk project` to create them."),process.exit(1)}}Gu("Project Configuration"),nt(`Project root: ${s}
|
|
613
613
|
`,0),Ac(u)||(pD(u),Zo("Created: .tdk/ directory"));let E=Ac(p);if(E&&!i.force){Zo(".tdk/project.json exists");let x=JSON.parse(fQ(p,"utf-8")),z=Hi(s),F=dQ(s),M=gQ(z,F);if((M.length>0||!x.phases)&&as(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";i.onInvalid?.(`${E}
|
|
1417
1417
|
Fix: ${B}`),console.error(R.red(`\u2717 ${E}`)),console.error(R.gray(` Fix: ${B}`)),l(1)}import{execFileSync as X4}from"node:child_process";var ow=(n,i)=>X4(n,i,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function Z4(n,i=process.platform,l=ow){if(!Number.isInteger(n)||n<1||n>65535)return[];if(i==="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 TI(n,i=process.platform,l=ow){let s=Z4(n,i,l);for(let u of s)i==="win32"?l("taskkill.exe",["/PID",String(u),"/F"]):l("kill",["-TERM",String(u)]);return s}function iw(n){if(n===void 0||n==="")return{ok:!0,port:void 0};let i=Number(n);return!/^[0-9]+$/.test(n)||!VC(i)?{ok:!1,message:`Invalid TILT_PORT "${n}": expected an integer from 1 to 65535.`}:{ok:!0,port:i}}function Aw(n){return n.runningPorts.length===0||n.force?{action:"start"}:n.only?{action:"only-blocked",ports:n.runningPorts}:{action:"already-running",ports:n.runningPorts}}async function lw(n){if(n.configuredPort!==void 0)return{port:n.configuredPort,autoSwitched:!1};if(n.force)return{port:n.basePort,autoSwitched:!1};let i=await n.findAvailablePort(n.basePort,10);return i&&i!==n.basePort?{port:i,autoSwitched:!0}:{port:n.basePort,autoSwitched:!1}}async function rw(n,i){n.force&&(n.quiet||i.log(`Force flag set - stopping Tilt on port ${n.port} if running...`),i.stop(n.port),await i.wait(2e3))}function sw(n,i){let l=new Set(i.map(s=>s.name));return n.filter(s=>!l.has(s))}function cw(n,i){let l=new Map(i.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:i.filter(p=>s.has(p.name)),dependencies:i.map(p=>p.name).filter(p=>s.has(p)&&!n.includes(p))}}function uw(n,i=[]){return["TDK is up.",`Tilt UI: http://localhost:${n}`,"App URLs:",...i.length>0?i.slice(0,5).map(l=>` ${l}`):[" run: tdk networks"],"Stop: tdk down"]}function e3(n,i){return n!=="win32"||i==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function t3(n=Y1(),i=n3){return n.kind==="webcontainer"?J1:q1(n.kind)&&!await i()?K1:null}async function n3(){let{execFile:n}=await import("node:child_process");return new Promise(i=>{n("docker",["ps"],{timeout:1e4},l=>i(!l))})}var a3=2;function o3(n){let i;try{({handEdited:i}=lB(n))}catch(l){if(l instanceof Km)return null;throw l}return i.length===0?null:["Generated files were edited by hand and no longer match service.json:",...i.map(l=>` ${l}`),"Run `tdk config regenerate` to discard the edits, or bypass with `tdk up --ignore-drift`."]}function i3(n,i,l=process.exit){if(i.ignoreDrift){console.warn(R.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let s=o3(n);if(s){i.onDrift?.(s.join(`
|
|
1418
1418
|
`));for(let u of s)console.error(R.red(u));l(a3)}}function A3(n,i,l=sr(),s=process.exit){if(i.ignoreVersion){console.warn(R.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let u=lD(n,l);u.status==="none"||u.status==="ok"||(i.onFail?.(`${u.message}
|
|
1419
|
-
${u.fix}`),console.error(R.red(u.message)),console.error(R.red(u.fix)),s(1))}function l3(n,i=3e4){return new Promise(l=>{let s=Date.now()+i,u=()=>{let p=P4({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 fw=new $4("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,i)=>{let l=i.json?fB("UP_FAILED","tdk up"):void 0;i.json&&(i.quiet=!0);let s=iw(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&&A3(p,{ignoreVersion:i.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=i.dryRun?null:await t3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=e3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&aw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!i.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-
|
|
1419
|
+
${u.fix}`),console.error(R.red(u.message)),console.error(R.red(u.fix)),s(1))}function l3(n,i=3e4){return new Promise(l=>{let s=Date.now()+i,u=()=>{let p=P4({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 fw=new $4("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,i)=>{let l=i.json?fB("UP_FAILED","tdk up"):void 0;i.json&&(i.quiet=!0);let s=iw(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&&A3(p,{ignoreVersion:i.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=i.dryRun?null:await t3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=e3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&aw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!i.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-6X67ZFII.js");await N()}let S=async()=>{let N=i.dryRun?Za():vn(),w=N??process.cwd(),T=O1(),x,z=[];if((!i.only||n)&&(x=ts(T),z=x.map(J=>J.name)),i.only){if(n&&!hg(n)){let Le=on.stackNotFound(n,z);l?.({ok:!1},[cB(Le).error]),Le.exit()}let J=n?T.filter(Le=>Le.stack===n):T,Te=sw(i.only,J);if(Te.length>0){let Le=J.map(We=>We.name),Pe=on.unknownServices(Te,Le);l?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Pe.message,...Pe.suggestions.length>0?{suggestions:Pe.suggestions}:{}}]),Pe.exit()}}N&&i3(N,{ignoreDrift:i.ignoreDrift,onDrift:J=>l?.({ok:!1},[{code:"DRIFT_DETECTED",message:J}])}),N&&AD(N,{onInvalid:J=>l?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:J}])}),N&&!l&&!i.quiet&&iD(N);let F=await nB(w,{inspectDocker:!i.dryRun});if(!i.dryRun){if(N){let Le=Jm(w);Le.length>0&&!i.quiet&&console.log(R.gray(`Added ${Le.join(", ")} to .env (generated; existing values unchanged)`))}let J=oQ(w);J.length>0&&i.verbose&&!i.quiet&&console.log(R.gray(`Refreshed runtime assets: ${J.join(", ")}`));let Te=sR(w);Te.length>0&&!i.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=T.filter(J=>J.stack===n),M.length===0){let J=on.stackNotFound(n,z);l?.({ok:!1},[cB(J).error]),J.exit()}he=M.map(J=>J.name),Ae=`stack "${n}"`}else{M=T;let J=x??ts(T);Ae=`all stacks (${Jn(J.length,"stack")}, ${Jn(M.length,"service")})`}let Re=[];if(i.only){let J=cw(i.only,YA());M=J.selected,Re=J.dependencies,he=M.map(Te=>Te.name),Ae=`${Jn(i.only.length,"requested service")}${Re.length>0?` plus ${Re.join(", ")}`:""}`}i.verbose&&!i.quiet&&console.log(R.gray(`Found ${Jn(M.length,"service")} in ${Ae}`));let Ie=M.map(J=>J.name);if(!i.quiet){console.log(R.blue(`${i.dryRun?"Would start":"Starting"} ${Jn(Ie.length,"service")} from ${Ae}...`)),Ie.forEach(We=>{console.log(R.gray(` - ${We}`))});let{appBase:J,apiBase:Te}=jC(F.ingressHttp),Le=M.filter(We=>We.config?.appType==="frontend"),Pe=M.filter(We=>ic(We.config?.appType));Le.length>0&&(console.log(R.blue(`
|
|
1420
1420
|
\u{1F30D} Frontend URLs:`)),Le.forEach(We=>{let ct=We.config?.basePath??`/${We.name}`;console.log(R.gray(` - ${We.name}: ${J}${R.cyan(Fy(ct))}`))})),Pe.length>0&&(console.log(R.blue(`
|
|
1421
1421
|
\u{1F527} Backend API URLs:`)),Pe.forEach(We=>{let ct=We.name.replace(/-api$/,""),qe=We.config?.apiPath??`/api/${ct}`,He=We.config?.sablier,$e=He?.enable&&He?.deferStart?R.dim(" (deferred \u2014 starts on first request)"):"";console.log(R.gray(` - ${We.name}: ${Te}${R.cyan(Fy(qe))}${$e}`))}))}let Ge=i.only??(n?[n]:void 0),Oe=I1(he,{verbose:i.verbose,quiet:i.quiet,force:i.force,focusTargets:Ge}),be=Ge?`tilt up ${Oe.join(" ")}`:"tilt up";if(!i.quiet){console.log(R.blue($1(F)));for(let J of nw(F))console.log(R.yellow(J));console.log(R.gray("Override with TDK_HTTP_PORT, TDK_HTTPS_PORT, or TDK_POSTGRES_PORT."))}if(l&&i.dryRun){l({ok:!0,dryRun:!0,stack:n??null,services:Ie,...i.only?{requested:i.only,declaredDependencies:Re}:{},command:be});return}if(sB(i,"not starting services",be))return;nD(F),tD(w,F);let ze=Tl.tiltUi,Qe=u??ze,Ye=i.only?[...new Set([ze,Qe])]:[Qe],At=[];for(let J of Ye)await lc(J)!==null&&At.push(J);let ke=Aw({runningPorts:At,force:i.force,only:!!i.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]}`}),i.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(i.only)for(let J of At)TI(J);let kt=await lw({configuredPort:u,force:i.force,basePort:ze,findAvailablePort:oR}),at=kt.port;kt.autoSwitched&&!i.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 rw({force:i.force,quiet:i.quiet,port:at},{stop:TI,log:J=>console.log(R.yellow(J)),wait:J=>new Promise(Te=>setTimeout(Te,J))}),i.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{ib as a,jb as b,kb as c,lb as d,mb as e}from"./chunk-
|
|
2
|
+
import{ib as a,jb as b,kb as c,lb as d,mb as e}from"./chunk-DLEX3BP5.js";import"./chunk-OBQS5CYC.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