@tdk-landscape/tdk-cli-core 1.3.141 → 1.3.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cli/dist/cli.js +1 -1
- package/cli/dist/commands/help.js +1 -1
- package/cli/dist-bundle/{chunk-CJ3L25OH.js → chunk-FFPLKZUH.js} +1 -1
- package/cli/dist-bundle/cli.js +5 -5
- package/cli/dist-bundle/{cold-preflight-KLI6R3XF.js → cold-preflight-DUL4575P.js} +1 -1
- package/cli/package.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# TDK CLI — start services on your
|
|
1
|
+
# TDK CLI — start services on your machine
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tdk-landscape/tdk-cli-core)
|
|
4
4
|
[](https://packagephobia.com/result?p=@tdk-landscape/tdk-cli-core)
|
|
@@ -29,7 +29,7 @@ No vendor lock-in. No tedious plumbing. Run a single command to natively orchest
|
|
|
29
29
|
* **Messaging & Gateway:** NATS, Traefik
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
TDK CLI — start services on your
|
|
32
|
+
TDK CLI — start services on your machine. It is not a deploy and not a Compose file: define each service in `service.json`, then run `tdk up`. No Kubernetes is needed on the machine.
|
|
33
33
|
|
|
34
34
|
Stability: 1.x local dev. Write `service.json`; TDK generates the local runtime files. See [what TDK writes](docs/generated-files.md) and how to check for drift. Core CLI is MIT and needs no key. Premium is optional.
|
|
35
35
|
|
package/cli/dist/cli.js
CHANGED
|
@@ -32,7 +32,7 @@ import { unknownHelpTarget } from "./utils/help-command.js";
|
|
|
32
32
|
const program = new Command();
|
|
33
33
|
program
|
|
34
34
|
.name("tdk")
|
|
35
|
-
.description("TDK CLI — start services on your
|
|
35
|
+
.description("TDK CLI — start services on your machine.")
|
|
36
36
|
.version(pkg.version, "-v, --version", "Display version number")
|
|
37
37
|
.option("--verbose", "Enable verbose output", false)
|
|
38
38
|
.configureOutput({
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import pkg from "../../package.json" with { type: "json" };
|
|
5
5
|
const TDK_BANNER = `
|
|
6
|
-
${chalk.bold.cyan("tdk")} ${chalk.gray(`v${pkg.version}`)} ${chalk.white("TDK CLI — start services on your
|
|
6
|
+
${chalk.bold.cyan("tdk")} ${chalk.gray(`v${pkg.version}`)} ${chalk.white("TDK CLI — start services on your machine.")}
|
|
7
7
|
`;
|
|
8
8
|
const COMMAND_GROUPS = [
|
|
9
9
|
{
|
|
@@ -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 Pu(e,t){let n=uo[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 vu(e){console.log(f.yellow(e||"Cancelled."))}function wu(e){console.log(f.blue(`TDK ${e}
|
|
12
|
-
`))}function $u(e,t){console.log(f.green(`All ${e} are ${t}!`))}var pt=62;function Ru(e="\u2500",t=pt){return e.repeat(t)}function In(e,t=pt-2){let n=Math.max(0,t-e.length),r=Math.floor(n/2),s=n-r;return" ".repeat(r)+e+" ".repeat(s)}function _u(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function Ou(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function Au(e){console.log(f.green(`\u2713 ${e}`))}function Du(e){console.log(f.blue(e))}function Cu(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function Nu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ju(e,t,n=pt){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(In(e,r))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(In(t,r))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as po}from"node:fs";import{dirname as fo,join as mo,resolve as Mn}from"node:path";import{cwd as ho}from"node:process";var Fn={name:"tdk-cli-internal",private:!0,version:"1.3.141",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","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=ho()){let t=Mn(e),n=Mn("/");for(;t!==n;){if(po(mo(t,".tdk",E)))return t;let r=fo(t);if(r===t)break;t=r}return null}var Ce=null;function go(){if(Ce)return Ce;let e=Fn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return Ce={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},Ce}function Ln(){return go().version}import{readFileSync as ko}from"node:fs";import{join as yo}from"node:path";function Ne(){let e=m();if(e)try{let t=ko(yo(e,".tdk",E),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function ft(e){let t=Ne(),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 So(e){return`${e.replace(/\/+$/,"")}/health`}function mt(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 Bn(e,t){let{appBase:n,apiBase:r}=ft(t);return e.filter(s=>s.config?.appType==="frontend"||w(s.config?.appType)).map(s=>{let o=w(s.config.appType)?r:n;return{name:s.name,appType:s.config.appType,url:`${o}${So(mt(s))}`}})}async function bo(e,t){try{let n=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:n.ok,status:n.status}}catch(n){let r=n instanceof Error&&n.name==="TimeoutError"?`no response within ${t}ms`:n instanceof Error?n.message:String(n);return{...e,ok:!1,error:r}}}async function Un(e,t){return Promise.all(e.map(n=>bo(n,t)))}import{existsSync as ee,readdirSync as lr,readFileSync as pr,statSync as xt}from"node:fs";import{dirname as oi,join as J}from"node:path";var he=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 Hn(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as _o,execSync as Oo}from"node:child_process";import{existsSync as vo}from"node:fs";import{delimiter as wo,extname as $o,join as Ro}from"node:path";import{delimiter as Zu,extname as To}from"node:path";function je(){return process.platform==="win32"}function xo(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Eo(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Po(e,t){let n=xo(e),r=Eo(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function Qu(){return Po(process.platform,process.arch)}function ed(){return je()?"tdk.exe":"tdk"}function Vn(e,t=je()){return t?To(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",n=je(),r=Vn(e,n);if(n&&!$o(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!r.includes(`${e}${o}`)&&r.push(`${e}${o}`)}for(let s of t.split(wo))if(s)for(let o of r){let i=Ro(s,o);if(vo(i))return i}return null}var Gn=1e4;function Kn(){let e=!1;if(process.platform==="win32")try{return _o($("docker")??"docker",["ps"],{stdio:"ignore",timeout:Gn,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Oo(t,{stdio:"ignore",timeout:Gn}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function Ie(e,t){return e[t]??0}function Ao(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(Ie(s,o-1)+1,Ie(n,o)+1,Ie(n,o-1)+i)}n=s}return Ie(n,t.length)}function Do(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 Wn(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=Do(n,i)?1:Ao(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 Co}from"node:child_process";import{join as No}from"node:path";function jo(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=Co($("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 Jn(){try{return(await jo("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Io(){let e=m();if(!e)throw H.notInProject();return No(e,".tdk",".tdk-out","Tiltfile")}function qn(e){let t=Io();e.push("-f",t)}function hd(e,t={}){let n=[];return qn(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 gd(e={}){let t=[];return qn(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function Yn(e){return e instanceof Error?e.message:String(e)}function Pd(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${Yn(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var R=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){Lo(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function ht(e,t,n=!1){let r=new Set;for(let s of e){let o=Wn(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var H={tiltNotInstalled:()=>new R("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${ct}`]),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: ${ct}`]),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`,[...ht([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`,[...ht([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=ht(e,t,e.length>1);return new R(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new R(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new R(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new R("Could not find project root (no .tdk/project.json found)",["Run this from within a TDK project","Run `tdk project --yes` to initialize a new project"])};function vd(){let e=m();return e||H.notInProject().exit()}function Fo(e){e instanceof R&&e.exit(),console.error(f.red(`Error: ${Yn(e)}`)),process.exit(1)}async function Mo(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),Fo(n)}}async function wd(e,t){let n=[],r=Kn();return r==="unresponsive"?n.push(H.dockerNotResponding()):r==="missing"&&n.push(H.dockerNotAvailable()),await Jn()||n.push(H.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
12
|
+
`))}function $u(e,t){console.log(f.green(`All ${e} are ${t}!`))}var pt=62;function Ru(e="\u2500",t=pt){return e.repeat(t)}function In(e,t=pt-2){let n=Math.max(0,t-e.length),r=Math.floor(n/2),s=n-r;return" ".repeat(r)+e+" ".repeat(s)}function _u(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e.padEnd(t)}function Ou(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}function Au(e){console.log(f.green(`\u2713 ${e}`))}function Du(e){console.log(f.blue(e))}function Cu(e,t=2){console.log(f.gray(`${" ".repeat(t)}${e}`))}function Nu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ju(e,t,n=pt){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(In(e,r))+f.cyan("\u2502")),t&&(console.log(f.cyan(`\u251C${s}\u2524`)),console.log(f.cyan("\u2502")+f.gray(In(t,r))+f.cyan("\u2502"))),console.log(f.cyan(`\u2570${s}\u256F`))}import{existsSync as po}from"node:fs";import{dirname as fo,join as mo,resolve as Mn}from"node:path";import{cwd as ho}from"node:process";var Fn={name:"tdk-cli-internal",private:!0,version:"1.3.143",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=ho()){let t=Mn(e),n=Mn("/");for(;t!==n;){if(po(mo(t,".tdk",E)))return t;let r=fo(t);if(r===t)break;t=r}return null}var Ce=null;function go(){if(Ce)return Ce;let e=Fn;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return Ce={name:String(t.name??"@tdk-landscape/tdk-cli-core"),version:String(t.version??"0.0.0"),fullPackage:t},Ce}function Ln(){return go().version}import{readFileSync as ko}from"node:fs";import{join as yo}from"node:path";function Ne(){let e=m();if(e)try{let t=ko(yo(e,".tdk",E),"utf-8"),n=JSON.parse(t);if(n?.project?.name)return n.project.name}catch{}return"tdk-project"}function ft(e){let t=Ne(),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 So(e){return`${e.replace(/\/+$/,"")}/health`}function mt(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 Bn(e,t){let{appBase:n,apiBase:r}=ft(t);return e.filter(s=>s.config?.appType==="frontend"||w(s.config?.appType)).map(s=>{let o=w(s.config.appType)?r:n;return{name:s.name,appType:s.config.appType,url:`${o}${So(mt(s))}`}})}async function bo(e,t){try{let n=await fetch(e.url,{method:"GET",redirect:"manual",signal:AbortSignal.timeout(t)});return{...e,ok:n.ok,status:n.status}}catch(n){let r=n instanceof Error&&n.name==="TimeoutError"?`no response within ${t}ms`:n instanceof Error?n.message:String(n);return{...e,ok:!1,error:r}}}async function Un(e,t){return Promise.all(e.map(n=>bo(n,t)))}import{existsSync as ee,readdirSync as lr,readFileSync as pr,statSync as xt}from"node:fs";import{dirname as oi,join as J}from"node:path";var he=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 Hn(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}import{execFileSync as _o,execSync as Oo}from"node:child_process";import{existsSync as vo}from"node:fs";import{delimiter as wo,extname as $o,join as Ro}from"node:path";import{delimiter as Zu,extname as To}from"node:path";function je(){return process.platform==="win32"}function xo(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Eo(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Po(e,t){let n=xo(e),r=Eo(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let s=`tdk-${n}-${r}`;return n==="windows"?`${s}.exe`:s}function Qu(){return Po(process.platform,process.arch)}function ed(){return je()?"tdk.exe":"tdk"}function Vn(e,t=je()){return t?To(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function $(e){let t=process.env.PATH??process.env.Path??"",n=je(),r=Vn(e,n);if(n&&!$o(e))for(let s of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let o=s.toLowerCase();o&&!r.includes(`${e}${o}`)&&r.push(`${e}${o}`)}for(let s of t.split(wo))if(s)for(let o of r){let i=Ro(s,o);if(vo(i))return i}return null}var Gn=1e4;function Kn(){let e=!1;if(process.platform==="win32")try{return _o($("docker")??"docker",["ps"],{stdio:"ignore",timeout:Gn,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Oo(t,{stdio:"ignore",timeout:Gn}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function Ie(e,t){return e[t]??0}function Ao(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(Ie(s,o-1)+1,Ie(n,o)+1,Ie(n,o-1)+i)}n=s}return Ie(n,t.length)}function Do(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 Wn(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=Do(n,i)?1:Ao(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 Co}from"node:child_process";import{join as No}from"node:path";function jo(e,t=[],n={}){return new Promise((r,s)=>{let o=[e,...t];n.verbose&&console.log(`Executing: tilt ${o.join(" ")}`);let i=Co($("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 Jn(){try{return(await jo("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Io(){let e=m();if(!e)throw H.notInProject();return No(e,".tdk",".tdk-out","Tiltfile")}function qn(e){let t=Io();e.push("-f",t)}function hd(e,t={}){let n=[];return qn(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 gd(e={}){let t=[];return qn(t),e.force&&t.push("--force"),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function Yn(e){return e instanceof Error?e.message:String(e)}function Pd(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${Yn(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var R=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){Lo(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}};function ht(e,t,n=!1){let r=new Set;for(let s of e){let o=Wn(s,t);o&&r.add(n?`Did you mean "${o}" for "${s}"?`:`Did you mean "${o}"?`)}return[...r]}var H={tiltNotInstalled:()=>new R("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${ct}`]),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: ${ct}`]),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`,[...ht([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`,[...ht([e],t),"Run `tdk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=ht(e,t,e.length>1);return new R(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new R(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new R(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new R("Could not find project root (no .tdk/project.json found)",["Run this from within a TDK project","Run `tdk project --yes` to initialize a new project"])};function vd(){let e=m();return e||H.notInProject().exit()}function Fo(e){e instanceof R&&e.exit(),console.error(f.red(`Error: ${Yn(e)}`)),process.exit(1)}async function Mo(e,t){try{return await e()}catch(n){return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),Fo(n)}}async function wd(e,t){let n=[],r=Kn();return r==="unresponsive"?n.push(H.dockerNotResponding()):r==="missing"&&n.push(H.dockerNotAvailable()),await Jn()||n.push(H.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)),Mo(e,t)}function $d(e,t=1){console.error(f.red(`Error: ${e}`)),process.exit(t)}function Lo(e,t,n){if(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:`));for(let r of n)console.error(f.cyan(` \u2192 ${r}`))}}function Rd(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 M1,$a as uB,A as D1,Aa as $m,B as R1,Ba as Y1,C as uA,Ca as q1,D as Vm,Da as lB,E as b1,Ea as qA,F as T1,Fa as V1,G as N1,Ga as X1,H as w1,Ha as Z1,I as is,Ia as As,J as x1,Ja as vg,K as Xm,Ka as P1,L as fA,La as W1,M as YA,Ma as $1,N as Bg,Na as rB,O as Zm,Oa as nQ,P as _1,Pa as eD,Q as U1,Qa as tD,R as Ku,Ra as nD,S as di,Sa as aD,T as gn,Ta as oD,U as on,Ua as iD,V as Za,Va as AD,W as wn,Wa as lD,X as eB,Xa as rD,Y as Uo,Ya as sB,Z as tB,Za as cB,_ as Jn,_a as ls,a as R,aa as O1,ab as fB,b as ZC,ba as Pm,bb as sD,c as KA,ca as Ig,cb as eE,d as Tl,da as k1,db as aQ,e as fr,ea as Wm,eb as cD,f as Ju,fa as yg,fb as uD,g as y1,ga as Yu,gb as fD,h as dr,ha as nB,hb as dD,i as Ym,ia as aB,ib as gD,j as qm,ja as tQ,jb as dB,k as sc,ka as H1,kb as pD,l as Nl,la as Qg,lb as mD,m as wl,ma as Zo,mb as oQ,n as Wy,na as Po,nb as iQ,o as Pn,oa as nt,ob as ED,p as xl,pa as G1,pb as hD,q as Q1,qa as L1,qb as CD,r as $y,ra as j1,rb as BD,s as S1,sa as z1,t as cc,ta as oB,u as vn,ua as Sg,ub as ID,v as gr,va as F1,vb as yD,w as WC,wa as iB,x as eQ,xa as AB,y as $C,ya as J1,z as v1,za as K1}from"./chunk-CJ3L25OH.js";import{a as C1,c as PC,d as B1,e as I1}from"./chunk-42IVF3YT.js";import{a as Cg,b as Ha,c as ix,d as st}from"./chunk-6EA4DGCY.js";var s2=Ha(TB=>{"use strict";var uM=Symbol.for("react.transitional.element"),fM=Symbol.for("react.fragment");function r2(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:uM,type:n,key:s,ref:i!==void 0?i:null,props:l}}TB.Fragment=fM;TB.jsx=r2;TB.jsxs=r2});var y2=Ha(Rt=>{"use strict";var LQ=Symbol.for("react.transitional.element"),dM=Symbol.for("react.portal"),gM=Symbol.for("react.fragment"),pM=Symbol.for("react.strict_mode"),mM=Symbol.for("react.profiler"),EM=Symbol.for("react.consumer"),hM=Symbol.for("react.context"),CM=Symbol.for("react.forward_ref"),BM=Symbol.for("react.suspense"),IM=Symbol.for("react.memo"),g2=Symbol.for("react.lazy"),yM=Symbol.for("react.activity"),QM=Symbol.for("react.view_transition"),c2=Symbol.iterator;function SM(n){return n===null||typeof n!="object"?null:(n=c2&&n[c2]||n["@@iterator"],typeof n=="function"?n:null)}var p2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m2=Object.assign,E2={};function Og(n,i,l){this.props=n,this.context=i,this.refs=E2,this.updater=l||p2}Og.prototype.isReactComponent={};Og.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")};Og.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function h2(){}h2.prototype=Og.prototype;function jQ(n,i,l){this.props=n,this.context=i,this.refs=E2,this.updater=l||p2}var zQ=jQ.prototype=new h2;zQ.constructor=jQ;m2(zQ,Og.prototype);zQ.isPureReactComponent=!0;var u2=Array.isArray;function GQ(){}var Kn={H:null,A:null,T:null,S:null},C2=Object.prototype.hasOwnProperty;function FQ(n,i,l){var s=l.ref;return{$$typeof:LQ,type:n,key:i,ref:s!==void 0?s:null,props:l}}function vM(n,i){return FQ(n.type,i,n.props)}function JQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===LQ}function DM(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return i[l]})}var f2=/\/+/g;function HQ(n,i){return typeof n=="object"&&n!==null&&n.key!=null?DM(""+n.key):i.toString(36)}function RM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(GQ,GQ):(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 Mg(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 LQ:case dM:E=!0;break;case g2:return E=n._init,Mg(E(n._payload),i,l,s,u)}}if(E)return u=u(n),E=s===""?"."+HQ(n,0):s,u2(u)?(l="",E!=null&&(l=E.replace(f2,"$&/")+"/"),Mg(u,i,l,"",function(S){return S})):u!=null&&(JQ(u)&&(u=vM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(f2,"$&/")+"/")+E)),i.push(u)),1;E=0;var B=s===""?".":s+":";if(u2(n))for(var I=0;I<n.length;I++)s=n[I],p=B+HQ(s,I),E+=Mg(s,i,l,p,u);else if(I=SM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+HQ(s,I++),E+=Mg(s,i,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Mg(RM(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 NB(n,i,l){if(n==null)return n;var s=[],u=0;return Mg(n,s,"","",function(p){return i.call(l,p,u++)}),s}function bM(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 d2=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 B2(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(GQ,d2)}catch(p){d2(p)}finally{i!==null&&l.types!==null&&(i.types=l.types),Kn.T=i}}function I2(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 B2(I2.bind(null,n))}var TM={map:NB,forEach:function(n,i,l){NB(n,function(){i.apply(this,arguments)},l)},count:function(n){var i=0;return NB(n,function(){i++}),i},toArray:function(n){return NB(n,function(i){return i})||[]},only:function(n){if(!JQ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Rt.Activity=yM;Rt.Children=TM;Rt.Component=Og;Rt.Fragment=gM;Rt.Profiler=mM;Rt.PureComponent=jQ;Rt.StrictMode=pM;Rt.Suspense=BM;Rt.ViewTransition=QM;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=I2;Rt.cache=function(n){return function(){return n.apply(null,arguments)}};Rt.cacheSignal=function(){return null};Rt.cloneElement=function(n,i,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=m2({},n.props),u=n.key;if(i!=null)for(p in i.key!==void 0&&(u=""+i.key),i)!C2.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 FQ(n.type,u,s)};Rt.createContext=function(n){return n={$$typeof:hM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:EM,_context:n},n};Rt.createElement=function(n,i,l){var s,u={},p=null;if(i!=null)for(s in i.key!==void 0&&(p=""+i.key),i)C2.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 FQ(n,p,u)};Rt.createRef=function(){return{current:null}};Rt.forwardRef=function(n){return{$$typeof:CM,render:n}};Rt.isValidElement=JQ;Rt.lazy=function(n){return{$$typeof:g2,_payload:{_status:-1,_result:n},_init:bM}};Rt.memo=function(n,i){return{$$typeof:IM,type:n,compare:i===void 0?null:i}};Rt.startTransition=B2;Rt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Rt.use=function(n){return Kn.H.use(n)};Rt.useActionState=function(n,i,l){return Kn.H.useActionState(n,i,l)};Rt.useCallback=function(n,i){return Kn.H.useCallback(n,i)};Rt.useContext=function(n){return Kn.H.useContext(n)};Rt.useDebugValue=function(){};Rt.useDeferredValue=function(n,i){return Kn.H.useDeferredValue(n,i)};Rt.useEffect=function(n,i){return Kn.H.useEffect(n,i)};Rt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Rt.useId=function(){return Kn.H.useId()};Rt.useImperativeHandle=function(n,i,l){return Kn.H.useImperativeHandle(n,i,l)};Rt.useInsertionEffect=function(n,i){return Kn.H.useInsertionEffect(n,i)};Rt.useLayoutEffect=function(n,i){return Kn.H.useLayoutEffect(n,i)};Rt.useMemo=function(n,i){return Kn.H.useMemo(n,i)};Rt.useOptimistic=function(n,i){return Kn.H.useOptimistic(n,i)};Rt.useReducer=function(n,i,l){return Kn.H.useReducer(n,i,l)};Rt.useRef=function(n){return Kn.H.useRef(n)};Rt.useState=function(n){return Kn.H.useState(n)};Rt.useSyncExternalStore=function(n,i,l){return Kn.H.useSyncExternalStore(n,i,l)};Rt.useTransition=function(){return Kn.H.useTransition()};Rt.version="19.3.0"});var Q2=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 i(y){return y===null||typeof y!="object"?null:(y=$a&&y[$a]||y["@@iterator"],typeof y=="function"?y:null)}function l(y,U){y=(y=y.constructor)&&(y.displayName||y.name)||"ReactClass";var ue=y+"."+U;St[ue]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,y),St[ue]=!0)}function s(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function u(){}function p(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function E(){}function B(y){return""+y}function I(y){try{B(y);var U=!1}catch{U=!0}if(U){U=console;var ue=U.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return ue.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),B(y)}}function S(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===Wn?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case Qt:return"Fragment";case Te:return"Profiler";case J:return"StrictMode";case ut:return"Suspense";case qe:return"SuspenseList";case mn:return"Activity";case Ga:return"ViewTransition"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case Tt:return"Portal";case Pe:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case We:var U=y.render;return y=y.displayName,y||(y=U.displayName||U.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case He:return U=y.displayName||null,U!==null?U:S(y.type)||"Memo";case $e:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function N(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===$e)return"<...>";try{var U=S(y);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function 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,ct){var xe=ue.ref;return y={$$typeof:Me,type:y,key:U,props:ue,_owner:re},(xe!==void 0?xe:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:F}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function ae(y,U){return U=M(y.type,U,y.props,y._owner,y._debugStack,y._debugTask),y._store&&(U._store.validated=y._store.validated),U}function he(y){Re(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===$e&&(y._payload.status==="fulfilled"?Re(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function Re(y){return typeof y=="object"&&y!==null&&y.$$typeof===Me}function Ie(y){var U={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ue){return U[ue]})}function je(y,U){return typeof y=="object"&&y!==null&&y.key!=null?(I(y.key),Ie(""+y.key)):U.toString(36)}function Oe(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(E,E):(y.status="pending",y.then(function(U){y.status==="pending"&&(y.status="fulfilled",y.value=U)},function(U){y.status==="pending"&&(y.status="rejected",y.reason=U)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function be(y,U,ue,re,ce){var ct=typeof y;(ct==="undefined"||ct==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ct){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case Tt:xe=!0;break;case $e:return xe=y._init,be(xe(y._payload),U,ue,re,ce)}}if(xe){xe=y,ce=ce(xe);var Xe=re===""?"."+je(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function($n){return $n})):ce!=null&&(Re(ce)&&(ce.key!=null&&(xe&&xe.key===ce.key||I(ce.key)),ue=ae(ce,ue+(ce.key==null||xe&&xe.key===ce.key?"":(""+ce.key).replace(Qo,"$&/")+"/")+Xe),re!==""&&xe!=null&&Re(xe)&&xe.key==null&&xe._store&&!xe._store.validated&&(ue._store.validated=2),ce=ue),U.push(ce)),1}if(xe=0,Xe=re===""?".":re+":",ua(y))for(var Dt=0;Dt<y.length;Dt++)re=y[Dt],ct=Xe+je(re,Dt),xe+=be(re,U,ue,ct,ce);else if(Dt=i(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 M1,$a as uB,A as D1,Aa as $m,B as R1,Ba as Y1,C as uA,Ca as q1,D as Vm,Da as lB,E as b1,Ea as qA,F as T1,Fa as V1,G as N1,Ga as X1,H as w1,Ha as Z1,I as is,Ia as As,J as x1,Ja as vg,K as Xm,Ka as P1,L as fA,La as W1,M as YA,Ma as $1,N as Bg,Na as rB,O as Zm,Oa as nQ,P as _1,Pa as eD,Q as U1,Qa as tD,R as Ku,Ra as nD,S as di,Sa as aD,T as gn,Ta as oD,U as on,Ua as iD,V as Za,Va as AD,W as wn,Wa as lD,X as eB,Xa as rD,Y as Uo,Ya as sB,Z as tB,Za as cB,_ as Jn,_a as ls,a as R,aa as O1,ab as fB,b as ZC,ba as Pm,bb as sD,c as KA,ca as Ig,cb as eE,d as Tl,da as k1,db as aQ,e as fr,ea as Wm,eb as cD,f as Ju,fa as yg,fb as uD,g as y1,ga as Yu,gb as fD,h as dr,ha as nB,hb as dD,i as Ym,ia as aB,ib as gD,j as qm,ja as tQ,jb as dB,k as sc,ka as H1,kb as pD,l as Nl,la as Qg,lb as mD,m as wl,ma as Zo,mb as oQ,n as Wy,na as Po,nb as iQ,o as Pn,oa as nt,ob as ED,p as xl,pa as G1,pb as hD,q as Q1,qa as L1,qb as CD,r as $y,ra as j1,rb as BD,s as S1,sa as z1,t as cc,ta as oB,u as vn,ua as Sg,ub as ID,v as gr,va as F1,vb as yD,w as WC,wa as iB,x as eQ,xa as AB,y as $C,ya as J1,z as v1,za as K1}from"./chunk-FFPLKZUH.js";import{a as C1,c as PC,d as B1,e as I1}from"./chunk-42IVF3YT.js";import{a as Cg,b as Ha,c as ix,d as st}from"./chunk-6EA4DGCY.js";var s2=Ha(TB=>{"use strict";var uM=Symbol.for("react.transitional.element"),fM=Symbol.for("react.fragment");function r2(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:uM,type:n,key:s,ref:i!==void 0?i:null,props:l}}TB.Fragment=fM;TB.jsx=r2;TB.jsxs=r2});var y2=Ha(Rt=>{"use strict";var LQ=Symbol.for("react.transitional.element"),dM=Symbol.for("react.portal"),gM=Symbol.for("react.fragment"),pM=Symbol.for("react.strict_mode"),mM=Symbol.for("react.profiler"),EM=Symbol.for("react.consumer"),hM=Symbol.for("react.context"),CM=Symbol.for("react.forward_ref"),BM=Symbol.for("react.suspense"),IM=Symbol.for("react.memo"),g2=Symbol.for("react.lazy"),yM=Symbol.for("react.activity"),QM=Symbol.for("react.view_transition"),c2=Symbol.iterator;function SM(n){return n===null||typeof n!="object"?null:(n=c2&&n[c2]||n["@@iterator"],typeof n=="function"?n:null)}var p2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m2=Object.assign,E2={};function Og(n,i,l){this.props=n,this.context=i,this.refs=E2,this.updater=l||p2}Og.prototype.isReactComponent={};Og.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")};Og.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function h2(){}h2.prototype=Og.prototype;function jQ(n,i,l){this.props=n,this.context=i,this.refs=E2,this.updater=l||p2}var zQ=jQ.prototype=new h2;zQ.constructor=jQ;m2(zQ,Og.prototype);zQ.isPureReactComponent=!0;var u2=Array.isArray;function GQ(){}var Kn={H:null,A:null,T:null,S:null},C2=Object.prototype.hasOwnProperty;function FQ(n,i,l){var s=l.ref;return{$$typeof:LQ,type:n,key:i,ref:s!==void 0?s:null,props:l}}function vM(n,i){return FQ(n.type,i,n.props)}function JQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===LQ}function DM(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return i[l]})}var f2=/\/+/g;function HQ(n,i){return typeof n=="object"&&n!==null&&n.key!=null?DM(""+n.key):i.toString(36)}function RM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(GQ,GQ):(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 Mg(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 LQ:case dM:E=!0;break;case g2:return E=n._init,Mg(E(n._payload),i,l,s,u)}}if(E)return u=u(n),E=s===""?"."+HQ(n,0):s,u2(u)?(l="",E!=null&&(l=E.replace(f2,"$&/")+"/"),Mg(u,i,l,"",function(S){return S})):u!=null&&(JQ(u)&&(u=vM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(f2,"$&/")+"/")+E)),i.push(u)),1;E=0;var B=s===""?".":s+":";if(u2(n))for(var I=0;I<n.length;I++)s=n[I],p=B+HQ(s,I),E+=Mg(s,i,l,p,u);else if(I=SM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+HQ(s,I++),E+=Mg(s,i,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Mg(RM(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 NB(n,i,l){if(n==null)return n;var s=[],u=0;return Mg(n,s,"","",function(p){return i.call(l,p,u++)}),s}function bM(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 d2=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 B2(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(GQ,d2)}catch(p){d2(p)}finally{i!==null&&l.types!==null&&(i.types=l.types),Kn.T=i}}function I2(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 B2(I2.bind(null,n))}var TM={map:NB,forEach:function(n,i,l){NB(n,function(){i.apply(this,arguments)},l)},count:function(n){var i=0;return NB(n,function(){i++}),i},toArray:function(n){return NB(n,function(i){return i})||[]},only:function(n){if(!JQ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Rt.Activity=yM;Rt.Children=TM;Rt.Component=Og;Rt.Fragment=gM;Rt.Profiler=mM;Rt.PureComponent=jQ;Rt.StrictMode=pM;Rt.Suspense=BM;Rt.ViewTransition=QM;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=I2;Rt.cache=function(n){return function(){return n.apply(null,arguments)}};Rt.cacheSignal=function(){return null};Rt.cloneElement=function(n,i,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=m2({},n.props),u=n.key;if(i!=null)for(p in i.key!==void 0&&(u=""+i.key),i)!C2.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 FQ(n.type,u,s)};Rt.createContext=function(n){return n={$$typeof:hM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:EM,_context:n},n};Rt.createElement=function(n,i,l){var s,u={},p=null;if(i!=null)for(s in i.key!==void 0&&(p=""+i.key),i)C2.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 FQ(n,p,u)};Rt.createRef=function(){return{current:null}};Rt.forwardRef=function(n){return{$$typeof:CM,render:n}};Rt.isValidElement=JQ;Rt.lazy=function(n){return{$$typeof:g2,_payload:{_status:-1,_result:n},_init:bM}};Rt.memo=function(n,i){return{$$typeof:IM,type:n,compare:i===void 0?null:i}};Rt.startTransition=B2;Rt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Rt.use=function(n){return Kn.H.use(n)};Rt.useActionState=function(n,i,l){return Kn.H.useActionState(n,i,l)};Rt.useCallback=function(n,i){return Kn.H.useCallback(n,i)};Rt.useContext=function(n){return Kn.H.useContext(n)};Rt.useDebugValue=function(){};Rt.useDeferredValue=function(n,i){return Kn.H.useDeferredValue(n,i)};Rt.useEffect=function(n,i){return Kn.H.useEffect(n,i)};Rt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Rt.useId=function(){return Kn.H.useId()};Rt.useImperativeHandle=function(n,i,l){return Kn.H.useImperativeHandle(n,i,l)};Rt.useInsertionEffect=function(n,i){return Kn.H.useInsertionEffect(n,i)};Rt.useLayoutEffect=function(n,i){return Kn.H.useLayoutEffect(n,i)};Rt.useMemo=function(n,i){return Kn.H.useMemo(n,i)};Rt.useOptimistic=function(n,i){return Kn.H.useOptimistic(n,i)};Rt.useReducer=function(n,i,l){return Kn.H.useReducer(n,i,l)};Rt.useRef=function(n){return Kn.H.useRef(n)};Rt.useState=function(n){return Kn.H.useState(n)};Rt.useSyncExternalStore=function(n,i,l){return Kn.H.useSyncExternalStore(n,i,l)};Rt.useTransition=function(){return Kn.H.useTransition()};Rt.version="19.3.0"});var Q2=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 i(y){return y===null||typeof y!="object"?null:(y=$a&&y[$a]||y["@@iterator"],typeof y=="function"?y:null)}function l(y,U){y=(y=y.constructor)&&(y.displayName||y.name)||"ReactClass";var ue=y+"."+U;St[ue]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,y),St[ue]=!0)}function s(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function u(){}function p(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function E(){}function B(y){return""+y}function I(y){try{B(y);var U=!1}catch{U=!0}if(U){U=console;var ue=U.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return ue.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),B(y)}}function S(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===Wn?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case Qt:return"Fragment";case Te:return"Profiler";case J:return"StrictMode";case ut:return"Suspense";case qe:return"SuspenseList";case mn:return"Activity";case Ga:return"ViewTransition"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case Tt:return"Portal";case Pe:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case We:var U=y.render;return y=y.displayName,y||(y=U.displayName||U.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case He:return U=y.displayName||null,U!==null?U:S(y.type)||"Memo";case $e:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function N(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===$e)return"<...>";try{var U=S(y);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function 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,ct){var xe=ue.ref;return y={$$typeof:Me,type:y,key:U,props:ue,_owner:re},(xe!==void 0?xe:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:F}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function ae(y,U){return U=M(y.type,U,y.props,y._owner,y._debugStack,y._debugTask),y._store&&(U._store.validated=y._store.validated),U}function he(y){Re(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===$e&&(y._payload.status==="fulfilled"?Re(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function Re(y){return typeof y=="object"&&y!==null&&y.$$typeof===Me}function Ie(y){var U={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ue){return U[ue]})}function je(y,U){return typeof y=="object"&&y!==null&&y.key!=null?(I(y.key),Ie(""+y.key)):U.toString(36)}function Oe(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(E,E):(y.status="pending",y.then(function(U){y.status==="pending"&&(y.status="fulfilled",y.value=U)},function(U){y.status==="pending"&&(y.status="rejected",y.reason=U)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function be(y,U,ue,re,ce){var ct=typeof y;(ct==="undefined"||ct==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ct){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case Tt:xe=!0;break;case $e:return xe=y._init,be(xe(y._payload),U,ue,re,ce)}}if(xe){xe=y,ce=ce(xe);var Xe=re===""?"."+je(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function($n){return $n})):ce!=null&&(Re(ce)&&(ce.key!=null&&(xe&&xe.key===ce.key||I(ce.key)),ue=ae(ce,ue+(ce.key==null||xe&&xe.key===ce.key?"":(""+ce.key).replace(Qo,"$&/")+"/")+Xe),re!==""&&xe!=null&&Re(xe)&&xe.key==null&&xe._store&&!xe._store.validated&&(ue._store.validated=2),ce=ue),U.push(ce)),1}if(xe=0,Xe=re===""?".":re+":",ua(y))for(var Dt=0;Dt<y.length;Dt++)re=y[Dt],ct=Xe+je(re,Dt),xe+=be(re,U,ue,ct,ce);else if(Dt=i(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'))
|
|
@@ -578,7 +578,7 @@ Deleting them also removes what the Tiltfile needs.
|
|
|
578
578
|
|
|
579
579
|
To go back to TDK: install it and run \`tdk config regenerate\`.
|
|
580
580
|
`,YD=new E_("eject").description("Write EJECTED.md describing the generated Tilt files (copies and generates nothing; they stay in .tdk/.tdk-out/)").option("--dry-run","List the generated files and what would be written, without changing the project",!1).option("--yes","Skip the confirmation prompt",!1).action(async n=>{await wn(async()=>{let i=vn();if(!i)throw on.notInProject();let u=[".tdk/.tdk-out"].filter(S=>aE(Tg(i,S))).flatMap(S=>{let N=Tg(i,S);if(p_(N).isFile())return[S];try{return g_(N,{recursive:!0}).map(w=>Tg(S,w.toString()))}catch{return[S]}});if(!aE(Tg(i,".tdk",".tdk-out","Tiltfile")))throw new Error("Generated Tilt files are missing. Run `tdk project --yes` before ejecting.");let p=Tg(i,"Tiltfile"),E=aE(p)?["Tiltfile"]:[],B=Tg(i,"EJECTED.md"),I=aE(B)?[]:["EJECTED.md"];if(n.dryRun){console.log("Generated files, left where they are (git-ignored):");for(let S of u)console.log(` ${S}`);if(E.length>0){console.log("Root Tiltfile, left where it is (not generated, not git-ignored):");for(let S of E)console.log(` ${S}`)}console.log("Files written:");for(let S of I)console.log(` ${S}`);I.length===0&&console.log(" (none)");return}!n.yes&&!await bg("Write EJECTED.md? (Generated files stay in .tdk/.tdk-out/; nothing is copied or moved.)")||(aE(B)?console.log(R.green("EJECTED.md already exists and was left unchanged. Nothing was copied, moved or generated.")):(m_(B,C_,{flag:"wx"}),console.log(R.green("Wrote EJECTED.md. Nothing was copied, moved or generated."))),console.log("Generated files stay in .tdk/.tdk-out/ (git-ignored) and still need TDK inputs."),console.log(`Run from the project root: ${KD}`),console.log("Replace <stack> with a stack name under services/, or omit --focus to use the Tiltfile's default phase."),console.log("Read EJECTED.md"))})});var B_=`
|
|
581
|
-
${R.bold.cyan("tdk")} ${R.gray(`v${ZC.version}`)} ${R.white("TDK CLI \u2014 start services on your
|
|
581
|
+
${R.bold.cyan("tdk")} ${R.gray(`v${ZC.version}`)} ${R.white("TDK CLI \u2014 start services on your machine.")}
|
|
582
582
|
`,I_=[{title:"Project Level",color:R.blue,commands:[{name:"project",desc:"Initialize master configs (TILT_RESOURCE_DEFAULTS.star)",alias:""},{name:"projects, info",desc:"Show project information and config status",alias:""},{name:"import",desc:"Import the services a directory describes",alias:"[dir] --dry-run --yes"},{name:"eject",desc:"Write EJECTED.md describing the generated Tilt files",alias:"--dry-run --yes"}]},{title:"Stack Level",color:R.magenta,commands:[{name:"stack",desc:"Organize resources into stacks (interactive)",alias:""},{name:"stacks, ls",desc:"List all stacks and their resources",alias:""}]},{title:"Resource Level",color:R.yellow,commands:[{name:"resource",desc:"Create new resource with templates",alias:""},{name:"resources",desc:"List all resources with filtering",alias:"--stack, --ports"}]},{title:"Lifecycle",color:R.green,commands:[{name:"up, deploy",desc:"Start services (optionally by stack)",alias:"[stack-name]"},{name:"down",desc:"Stop all tilt resources",alias:""},{name:"status",desc:"Show status of services and stacks",alias:""},{name:"logs",desc:"Print recent logs from the running stack",alias:"--json"}]},{title:"Networking",color:R.blueBright,commands:[{name:"networks, traefik",desc:"Show Traefik-routed URLs for all services",alias:"--stack, --json"}]},{title:"Utilities",color:R.cyan,commands:[{name:"ui, interactive",desc:"Interactive TUI for managing services",alias:""},{name:"config",desc:"Manage project configuration and regenerate master files",alias:"regenerate, verify, edit"},{name:"doctor",desc:"Check environment readiness",alias:""},{name:"mcp",desc:"Run an MCP server over stdio for coding agents",alias:""},{name:"runtime",desc:"Inspect packaged engine and template assets",alias:"--check-assets"},{name:"completion",desc:"Generate shell completions",alias:"--install --shell zsh"},{name:"upgrade, update",desc:"Self-update to latest version",alias:"--force"},{name:"version, -v",desc:"Display version number",alias:""},{name:"help",desc:"Show help",alias:"[command]"}]}];function y_(n,i,l,s){let u=s(n.padEnd(20)),p=R.white(i),E=l?R.gray(` ${l}`):"";return` ${u} ${p}${E}`}function CQ(){console.log(B_),console.log(R.gray(`
|
|
583
583
|
Local development inner loop; TDK does not replace Helm for cluster deployments.
|
|
584
584
|
`)),console.log(R.bold.white(` Project \u2192 Phase \u2192 Stack \u2192 Resource
|
|
@@ -607,7 +607,7 @@ Available templates:`));for(let[p,E]of Object.entries(SB))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=vB(BU(IU(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");mU(vB(p,l.bundledPath),u,{recursive:!0});let E=CU(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=Ug(u,B),S=QQ(I,"utf-8");hU(I,S.replaceAll("tdk_example",E))}}else pU("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 lE={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:SU()},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:{}},QR=new yU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(SB).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 lE={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:SU()},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:{}},QR=new yU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(SB).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-DUL4575P.js");if(await l(),n){await wn(async()=>vU(n,i.path));return}await wn(async()=>{let s=vn();s||(s=IR(),Po(`\u{1F680} Initializing new TDK project...
|
|
611
611
|
`),nt(`Location: ${s}
|
|
612
612
|
`,0));let u=Ug(s,".tdk"),p=Ug(u,sc);if(i.check){let x=wl.every(F=>uc(Ug(s,".tdk",".tdk-out",F))),z=uc(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 wl.filter(M=>!uc(Ug(s,".tdk/.tdk-out",M))))nt(`.tdk/.tdk-out/${F} (not found)`,3);nt("Run `tdk project` to create them."),process.exit(1)}}Yu("Project Configuration"),nt(`Project root: ${s}
|
|
613
613
|
`,0),uc(u)||(RD(u),Zo("Created: .tdk/ directory"));let E=uc(p);if(E&&!i.force){Zo(".tdk/project.json exists");let x=JSON.parse(QQ(p,"utf-8")),z=Hi(s),F=SQ(s),M=vQ(z,F);if((M.length>0||!x.phases)&&rs(p,z),M.length>0&&nt(`Auto-enabled discovered service stacks: ${M.join(", ")}`,0),Po(`
|
|
@@ -1416,7 +1416,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
|
|
|
1416
1416
|
`)}`,B="Upgrade tdk to a version that supports these files. Changing schemaVersion by hand is not a fix";i.onInvalid?.(`${E}
|
|
1417
1417
|
Fix: ${B}`),console.error(R.red(`\u2717 ${E}`)),console.error(R.gray(` Fix: ${B}`)),l(1)}import{execFileSync as s3}from"node:child_process";var Ew=(n,i)=>s3(n,i,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function c3(n,i=process.platform,l=Ew){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 LI(n,i=process.platform,l=Ew){let s=c3(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 hw(n){if(n===void 0||n==="")return{ok:!0,port:void 0};let i=Number(n);return!/^[0-9]+$/.test(n)||!iB(i)?{ok:!1,message:`Invalid TILT_PORT "${n}": expected an integer from 1 to 65535.`}:{ok:!0,port:i}}function Cw(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 Bw(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 Iw(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 yw(n,i){let l=new Set(i.map(s=>s.name));return n.filter(s=>!l.has(s))}function Qw(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 Sw(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 g3(n,i){return n!=="win32"||i==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function p3(n=oD(),i=m3){return n.kind==="webcontainer"?nD:iD(n.kind)&&!await i()?aD:null}async function m3(){let{execFile:n}=await import("node:child_process");return new Promise(i=>{n("docker",["ps"],{timeout:1e4},l=>i(!l))})}var E3=2;function h3(n){let i;try{({handEdited:i}=hB(n))}catch(l){if(l instanceof tE)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 C3(n,i,l=process.exit){if(i.ignoreDrift){console.warn(R.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let s=h3(n);if(s){i.onDrift?.(s.join(`
|
|
1418
1418
|
`));for(let u of s)console.error(R.red(u));l(E3)}}function B3(n,i,l=gr(),s=process.exit){if(i.ignoreVersion){console.warn(R.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let u=CD(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 I3(n,i=3e4){return new Promise(l=>{let s=Date.now()+i,u=()=>{let p=u3({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 vw=new d3("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?QB("UP_FAILED","tdk up"):void 0;i.json&&(i.quiet=!0);let s=hw(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&&B3(p,{ignoreVersion:i.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=i.dryRun?null:await p3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=g3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&mw(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 I3(n,i=3e4){return new Promise(l=>{let s=Date.now()+i,u=()=>{let p=u3({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 vw=new d3("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?QB("UP_FAILED","tdk up"):void 0;i.json&&(i.quiet=!0);let s=hw(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&&B3(p,{ignoreVersion:i.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=i.dryRun?null:await p3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=g3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&mw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!i.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-DUL4575P.js");await N()}let S=async()=>{let N=i.dryRun?Za():vn(),w=N??process.cwd(),T=V1(),x,z=[];if((!i.only||n)&&(x=As(T),z=x.map(J=>J.name)),i.only){if(n&&!vg(n)){let Ge=on.stackNotFound(n,z);l?.({ok:!1},[IB(Ge).error]),Ge.exit()}let J=n?T.filter(Ge=>Ge.stack===n):T,Te=yw(i.only,J);if(Te.length>0){let Ge=J.map(We=>We.name),Pe=on.unknownServices(Te,Ge);l?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Pe.message,...Pe.suggestions.length>0?{suggestions:Pe.suggestions}:{}}]),Pe.exit()}}N&&C3(N,{ignoreDrift:i.ignoreDrift,onDrift:J=>l?.({ok:!1},[{code:"DRIFT_DETECTED",message:J}])}),N&&hD(N,{onInvalid:J=>l?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:J}])}),N&&!l&&!i.quiet&&ED(N);let F=await dB(w,{inspectDocker:!i.dryRun});if(!i.dryRun){if(N){let Ge=eE(w);Ge.length>0&&!i.quiet&&console.log(R.gray(`Added ${Ge.join(", ")} to .env (generated; existing values unchanged)`))}let J=pQ(w);J.length>0&&i.verbose&&!i.quiet&&console.log(R.gray(`Refreshed runtime assets: ${J.join(", ")}`));let Te=yR(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},[IB(J).error]),J.exit()}he=M.map(J=>J.name),ae=`stack "${n}"`}else{M=T;let J=x??As(T);ae=`all stacks (${Jn(J.length,"stack")}, ${Jn(M.length,"service")})`}let Re=[];if(i.only){let J=Qw(i.only,qA());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}...`));for(let We of Ie)console.log(R.gray(` - ${We}`));let{appBase:J,apiBase:Te}=WC(F.ingressHttp),Ge=M.filter(We=>We.config?.appType==="frontend"),Pe=M.filter(We=>cc(We.config?.appType));if(Ge.length>0){console.log(R.blue(`
|
|
1420
1420
|
\u{1F30D} Frontend URLs:`));for(let We of Ge){let ut=We.config?.basePath??`/${We.name}`;console.log(R.gray(` - ${We.name}: ${J}${R.cyan(eQ(ut))}`))}}if(Pe.length>0){console.log(R.blue(`
|
|
1421
1421
|
\u{1F527} Backend API URLs:`));for(let We of Pe){let ut=We.name.replace(/-api$/,""),qe=We.config?.apiPath??`/api/${ut}`,He=We.config?.sablier,$e=He?.enable&&He?.deferStart?R.dim(" (deferred \u2014 starts on first request)"):"";console.log(R.gray(` - ${We.name}: ${Te}${R.cyan(eQ(qe))}${$e}`))}}}let je=i.only??(n?[n]:void 0),Oe=_1(he,{verbose:i.verbose,quiet:i.quiet,force:i.force,focusTargets:je}),be=je?`tilt up ${Oe.join(" ")}`:"tilt up";if(!i.quiet){console.log(R.blue(uD(F)));for(let J of pw(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(BB(i,"not starting services",be))return;gD(F),dD(w,F);let ze=xl.tiltUi,Qe=u??ze,Ye=i.only?[...new Set([ze,Qe])]:[Qe],At=[];for(let J of Ye)await fc(J)!==null&&At.push(J);let ke=Cw({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)LI(J);let kt=await Bw({configuredPort:u,force:i.force,basePort:ze,findAvailablePort:ER}),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 Iw({force:i.force,quiet:i.quiet,port:at},{stop:LI,log:J=>console.log(R.yellow(J)),wait:J=>new Promise(Te=>setTimeout(Te,J))}),i.quiet||(console.log(R.gray(`
|
|
@@ -1446,7 +1446,7 @@ Manual upgrade using a published package:`)),console.log(R.cyan(" npm install
|
|
|
1446
1446
|
\u{1F4CB} Dry run mode - would perform:`)),console.log(R.gray(` Method: ${l.method}`)),l.path&&console.log(R.gray(` Path: ${l.path}`)),l.method==="git"?console.log(R.gray(" Action: git pull origin main && bun install && bun link --force")):l.method==="binary"&&p?(console.log(R.gray(` Action: Download and replace with ${p.downloadUrl}`)),console.log(R.gray(` Action: Refresh bundled engine from ${p.engineDownloadUrl}`))):console.log(R.gray(` Action: Upgrade to ${u}`)),console.log(R.yellow(`
|
|
1447
1447
|
(Not actually upgrading due to --dry-run)`)),process.exit(0)),n.yes?console.log(R.gray(`\u26A1 Auto-confirming (--yes flag)
|
|
1448
1448
|
`)):(console.log(),await Rg({message:"Proceed with upgrade?",initial:!0})||(yg(),process.exit(0))),console.log();let E=!1;switch(l.method){case"npm":E=await z3();break;case"bun":E=await F3();break;case"git":l.path&&(E=await J3(l.path));break;case"binary":l.path&&p&&(E=await G3(l.path,p));break}if(!E){if(console.error(R.red(`
|
|
1449
|
-
Upgrade failed`)),l.method==="git")console.log(R.cyan(` cd ${l.path} && git pull && bun link --force`));else if(l.method==="binary"&&p&&l.path){let I=Gi(MS(l.path),"tdk-cli");is()?console.log(R.cyan(" irm https://tdk-landscape.github.io/install.ps1 | iex")):(console.log(R.cyan(` curl -fsSL -o ${l.path} ${p.downloadUrl}`)),console.log(R.cyan(` chmod +x ${l.path}`)),console.log(R.cyan(` rm -rf ${I} && mkdir -p ${I}`)),console.log(R.cyan(` curl -fsSL ${p.engineDownloadUrl} | tar -xzf - -C ${I} --strip-components=1`)))}process.exit(1)}console.log();let B=gf("Verifying upgrade...");try{let I=gA(fA(Xm())??Xm(),["version"],{encoding:"utf-8",windowsHide:is()}).trim();B.succeed(`Verified: now running ${R.green(I)}`),console.log(),console.log(R.green.bold("\u2728 Upgrade complete!")),console.log(R.gray(` Version: ${i} \u2192 ${I}`)),console.log(),console.log(R.cyan.bold("\u{1F4CD} Installation Details:")),l.method==="git"&&l.path?(console.log(R.gray(` Location: ${l.path}`)),console.log(R.gray(" Method: git clone + bun link"))):console.log(R.gray(` Method: ${l.method}`)),console.log(R.gray(` Binary: ${l.path??fA(Xm())??"unknown"}`)),console.log(),console.log(R.cyan.bold("\u{1F680} Quick Start:")),console.log(R.white(" tdk --help Show all commands")),console.log(R.white(" tdk networks View service URLs")),console.log(R.white(" tdk doctor Check environment")),I===i&&!n.force&&(console.log(),console.log(R.yellow("\u{1F4A1} Tip: Version appears unchanged. You may need to restart your terminal."))),console.log(),console.log(R.green("Happy coding! \u{1F389}"))}catch(I){B.warn("Could not verify new version"),console.error(R.red(`Verification error: ${Ku(I)}`)),console.log(),console.log(R.yellow("\u26A0\uFE0F Upgrade status unknown - verification failed")),console.log(),k3(I)&&l.method!=="git"&&l.path?(console.log(R.yellow("\u{1F4A1} The installed binary isn't executable. Fix it with:")),console.log(R.cyan(` chmod +x ${l.path}`)),console.log(R.white(" then run: tdk version"))):(console.log(R.yellow("\u{1F4A1} Verify manually:")),console.log(R.white(" 1. Restart your terminal")),console.log(R.white(" 2. Run: tdk version")),l.method==="git"&&l.path&&console.log(R.white(` 3. Compare with: git -C ${l.path} rev-parse HEAD`)))}});import{Command as K3}from"commander";var Mw=new K3("version").description("Display version number").alias("v").action(()=>{console.log(gr())});function Ow(n,i){let[l,s]=n;return l!=="help"||!s||s.startsWith("-")||i.some(p=>p.name()===s||p.aliases().includes(s))?void 0:s}var xn=new Y3;xn.name("tdk").description("TDK CLI \u2014 start services on your
|
|
1449
|
+
Upgrade failed`)),l.method==="git")console.log(R.cyan(` cd ${l.path} && git pull && bun link --force`));else if(l.method==="binary"&&p&&l.path){let I=Gi(MS(l.path),"tdk-cli");is()?console.log(R.cyan(" irm https://tdk-landscape.github.io/install.ps1 | iex")):(console.log(R.cyan(` curl -fsSL -o ${l.path} ${p.downloadUrl}`)),console.log(R.cyan(` chmod +x ${l.path}`)),console.log(R.cyan(` rm -rf ${I} && mkdir -p ${I}`)),console.log(R.cyan(` curl -fsSL ${p.engineDownloadUrl} | tar -xzf - -C ${I} --strip-components=1`)))}process.exit(1)}console.log();let B=gf("Verifying upgrade...");try{let I=gA(fA(Xm())??Xm(),["version"],{encoding:"utf-8",windowsHide:is()}).trim();B.succeed(`Verified: now running ${R.green(I)}`),console.log(),console.log(R.green.bold("\u2728 Upgrade complete!")),console.log(R.gray(` Version: ${i} \u2192 ${I}`)),console.log(),console.log(R.cyan.bold("\u{1F4CD} Installation Details:")),l.method==="git"&&l.path?(console.log(R.gray(` Location: ${l.path}`)),console.log(R.gray(" Method: git clone + bun link"))):console.log(R.gray(` Method: ${l.method}`)),console.log(R.gray(` Binary: ${l.path??fA(Xm())??"unknown"}`)),console.log(),console.log(R.cyan.bold("\u{1F680} Quick Start:")),console.log(R.white(" tdk --help Show all commands")),console.log(R.white(" tdk networks View service URLs")),console.log(R.white(" tdk doctor Check environment")),I===i&&!n.force&&(console.log(),console.log(R.yellow("\u{1F4A1} Tip: Version appears unchanged. You may need to restart your terminal."))),console.log(),console.log(R.green("Happy coding! \u{1F389}"))}catch(I){B.warn("Could not verify new version"),console.error(R.red(`Verification error: ${Ku(I)}`)),console.log(),console.log(R.yellow("\u26A0\uFE0F Upgrade status unknown - verification failed")),console.log(),k3(I)&&l.method!=="git"&&l.path?(console.log(R.yellow("\u{1F4A1} The installed binary isn't executable. Fix it with:")),console.log(R.cyan(` chmod +x ${l.path}`)),console.log(R.white(" then run: tdk version"))):(console.log(R.yellow("\u{1F4A1} Verify manually:")),console.log(R.white(" 1. Restart your terminal")),console.log(R.white(" 2. Run: tdk version")),l.method==="git"&&l.path&&console.log(R.white(` 3. Compare with: git -C ${l.path} rev-parse HEAD`)))}});import{Command as K3}from"commander";var Mw=new K3("version").description("Display version number").alias("v").action(()=>{console.log(gr())});function Ow(n,i){let[l,s]=n;return l!=="help"||!s||s.startsWith("-")||i.some(p=>p.name()===s||p.aliases().includes(s))?void 0:s}var xn=new Y3;xn.name("tdk").description("TDK CLI \u2014 start services on your machine.").version(ZC.version,"-v, --version","Display version number").option("--verbose","Enable verbose output",!1).configureOutput({outputError:(n,i)=>i(R.red(n)),writeOut:n=>process.stdout.write(n),writeErr:n=>process.stderr.write(n)});xn.helpCommand("help [command]","Show colorful help").on("--help",()=>{CQ(),process.exit(0)});xn.addHelpText("before","");xn.addCommand(UQ);xn.addCommand($R);xn.addCommand(vR);xn.addCommand(vw);xn.addCommand(JD);xn.addCommand(gR);xn.addCommand(eR);xn.addCommand(YD);xn.addCommand(qD);xn.addCommand(l2);xn.addCommand(t2);xn.addCommand(WR);xn.addCommand(_Q);xn.addCommand(QR);xn.addCommand(EQ);xn.addCommand(gw);xn.addCommand(Mw);xn.addCommand(nR);xn.addCommand(BD);xn.addCommand(SD);xn.addCommand(Uw);xn.addCommand(BR);if(process.argv.length===2){let n=await ID();console.log(yD(n)),console.log(`
|
|
1450
1450
|
Commands: tdk doctor | tdk project --yes | tdk --help`),process.exit(n.ok?0:1)}process.argv[2]==="--doctor"&&(process.argv[2]="doctor");process.argv.length===3&&["-h","--help","help"].includes(process.argv[2])&&(CQ(),process.exit(0));var kw=Ow(process.argv.slice(2),xn.commands);kw&&xn.error(`error: unknown command '${kw}'`,{exitCode:1,code:"commander.unknownCommand"});xn.parse();
|
|
1451
1451
|
/*! Bundled license information:
|
|
1452
1452
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{sb as a,tb as b,ub as c,vb as d,wb as e}from"./chunk-
|
|
2
|
+
import{sb as a,tb as b,ub as c,vb as d,wb as e}from"./chunk-FFPLKZUH.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tdk-landscape/tdk-cli-core",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "TDK CLI — start services on your
|
|
3
|
+
"version": "1.3.143",
|
|
4
|
+
"description": "TDK CLI — start services on your machine.",
|
|
5
5
|
"homepage": "https://tdk-landscape.github.io/tdk-website",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|