@tdk-landscape/tdk-cli-core 1.3.145 → 1.3.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/README.md +4 -2
  3. package/Tiltfile +2 -0
  4. package/cli/dist/commands/doctor.js +49 -2
  5. package/cli/dist/utils/doctor-runtime.js +60 -0
  6. package/cli/dist/utils/host-port-config.js +11 -2
  7. package/cli/dist/utils/host-port-plan.js +25 -3
  8. package/cli/dist/utils/service-urls.js +16 -2
  9. package/cli/dist/utils/smoke.js +28 -0
  10. package/cli/dist-bundle/chunk-LNZN426S.js +321 -0
  11. package/cli/dist-bundle/cli.js +3 -3
  12. package/cli/dist-bundle/{cold-preflight-F2FM46HK.js → cold-preflight-D7CAIHND.js} +1 -1
  13. package/cli/package.json +1 -1
  14. package/cli/templates/Tiltfile.hbs +12 -0
  15. package/discovery/config.star +1 -1
  16. package/engine/Tiltfile +2 -0
  17. package/engine/assets/docker/golden-layers.Dockerfile +8 -25
  18. package/engine/assets/scripts/cleanup-tilt-images.sh +2 -2
  19. package/engine/topologies/platform/docker/build/frontend_build_plan.star +65 -0
  20. package/engine/topologies/platform/docker/build/golden_image_build.star +110 -48
  21. package/engine/topologies/platform/docker/build/golden_image_constants.star +13 -6
  22. package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +8 -27
  23. package/engine/topologies/platform/docker/layers/l3_builder_layers.star +3 -1
  24. package/engine/topologies/platform/docker/layers/prisma/constants.star +2 -1
  25. package/engine/topologies/tilt/resources/build_concurrency.star +56 -0
  26. package/engine/topologies/tilt/resources/infra-loader.star +4 -0
  27. package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +24 -2
  28. package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +5 -1
  29. package/engine/topologies/tilt/resources/watchers.star +7 -4
  30. package/package.json +1 -1
  31. package/cli/dist-bundle/chunk-47CDYJ5E.js +0 -316
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
3
- import{$ as k1,$a as cB,A as R1,Aa as $m,B as b1,Ba as V1,C as fA,Ca as X1,D as Xm,Da as AB,E as T1,Ea as qA,F as N1,Fa as Z1,G as w1,Ga as P1,H as x1,Ha as W1,I as is,Ia as As,J as _1,Ja as Dg,K as Zm,Ka as $1,L as dA,La as eD,M as xl,Ma as tD,N as Ig,Na as lB,O as U1,Oa as nQ,P as M1,Pa as nD,Q as O1,Qa as aD,R as Ku,Ra as oD,S as di,Sa as iD,T as gn,Ta as AD,U as on,Ua as lD,V as Za,Va as rD,W as wn,Wa as sD,X as $C,Xa as cD,Y as Uo,Ya as rB,Z as eB,Za as sB,_ as Jn,_a as ls,a as b,aa as H1,ab as uB,b as XC,ba as Pm,bb as uD,c as YA,ca as yg,cb as eE,d as Tl,da as G1,db as aQ,e as fr,ea as Wm,eb as fD,f as Ju,fa as Qg,fb as dD,g as Q1,ga as Yu,gb as gD,h as dr,ha as tB,hb as pD,i as qm,ia as nB,ib as mD,j as Vm,ja as tQ,jb as fB,k as sc,ka as L1,kb as ED,l as Nl,la as Sg,lb as hD,m as wl,ma as Zo,mb as oQ,n as Wy,na as Po,nb as iQ,o as Pn,oa as nt,ob as CD,p as ki,pa as j1,pb as BD,q as S1,qa as z1,qb as ID,r as $y,ra as F1,rb as yD,s as v1,sa as J1,t as cc,ta as aB,u as vn,ua as vg,ub as QD,v as gr,va as K1,vb as SD,w as PC,wa as oB,x as eQ,xa as iB,y as WC,ya as Y1,z as D1,za as q1}from"./chunk-47CDYJ5E.js";import{a as B1,c as ZC,d as I1,e as y1}from"./chunk-42IVF3YT.js";import{a as Bg,b as Ha,c as lx,d as st}from"./chunk-6EA4DGCY.js";var g2=Ha(TB=>{"use strict";var dM=Symbol.for("react.transitional.element"),gM=Symbol.for("react.fragment");function d2(n,o,l){var s=null;if(l!==void 0&&(s=""+l),o.key!==void 0&&(s=""+o.key),"key"in o){l={};for(var u in o)u!=="key"&&(l[u]=o[u])}else l=o;return o=l.ref,{$$typeof:dM,type:n,key:s,ref:o!==void 0?o:null,props:l}}TB.Fragment=gM;TB.jsx=d2;TB.jsxs=d2});var R2=Ha(Rt=>{"use strict";var jQ=Symbol.for("react.transitional.element"),pM=Symbol.for("react.portal"),mM=Symbol.for("react.fragment"),EM=Symbol.for("react.strict_mode"),hM=Symbol.for("react.profiler"),CM=Symbol.for("react.consumer"),BM=Symbol.for("react.context"),IM=Symbol.for("react.forward_ref"),yM=Symbol.for("react.suspense"),QM=Symbol.for("react.memo"),C2=Symbol.for("react.lazy"),SM=Symbol.for("react.activity"),vM=Symbol.for("react.view_transition"),p2=Symbol.iterator;function DM(n){return n===null||typeof n!="object"?null:(n=p2&&n[p2]||n["@@iterator"],typeof n=="function"?n:null)}var B2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I2=Object.assign,y2={};function kg(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}kg.prototype.isReactComponent={};kg.prototype.setState=function(n,o){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,o,"setState")};kg.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Q2(){}Q2.prototype=kg.prototype;function zQ(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}var FQ=zQ.prototype=new Q2;FQ.constructor=zQ;I2(FQ,kg.prototype);FQ.isPureReactComponent=!0;var m2=Array.isArray;function LQ(){}var Kn={H:null,A:null,T:null,S:null},S2=Object.prototype.hasOwnProperty;function JQ(n,o,l){var s=l.ref;return{$$typeof:jQ,type:n,key:o,ref:s!==void 0?s:null,props:l}}function RM(n,o){return JQ(n.type,o,n.props)}function KQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===jQ}function bM(n){var o={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return o[l]})}var E2=/\/+/g;function GQ(n,o){return typeof n=="object"&&n!==null&&n.key!=null?bM(""+n.key):o.toString(36)}function TM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(LQ,LQ):(n.status="pending",n.then(function(o){n.status==="pending"&&(n.status="fulfilled",n.value=o)},function(o){n.status==="pending"&&(n.status="rejected",n.reason=o)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Og(n,o,l,s,u){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var E=!1;if(n===null)E=!0;else switch(p){case"bigint":case"string":case"number":E=!0;break;case"object":switch(n.$$typeof){case jQ:case pM:E=!0;break;case C2:return E=n._init,Og(E(n._payload),o,l,s,u)}}if(E)return u=u(n),E=s===""?"."+GQ(n,0):s,m2(u)?(l="",E!=null&&(l=E.replace(E2,"$&/")+"/"),Og(u,o,l,"",function(S){return S})):u!=null&&(KQ(u)&&(u=RM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(E2,"$&/")+"/")+E)),o.push(u)),1;E=0;var B=s===""?".":s+":";if(m2(n))for(var I=0;I<n.length;I++)s=n[I],p=B+GQ(s,I),E+=Og(s,o,l,p,u);else if(I=DM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+GQ(s,I++),E+=Og(s,o,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Og(TM(n),o,l,s,u);throw o=String(n),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return E}function NB(n,o,l){if(n==null)return n;var s=[],u=0;return Og(n,s,"","",function(p){return o.call(l,p,u++)}),s}function NM(n){if(n._status===-1){var o=n._result,l=o();l.then(function(s){(n._status===0||n._status===-1)&&(n._status=1,n._result=s,l.status===void 0&&(l.status="fulfilled",l.value=s))},function(s){(n._status===0||n._status===-1)&&(n._status=2,n._result=s,l.status===void 0&&(l.status="rejected",l.reason=s))}),n._status===-1&&(n._status=0,n._result=l)}if(n._status===1)return n._result.default;throw n._result}var h2=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function v2(n){var o=Kn.T,l={};l.types=o!==null?o.types:null,Kn.T=l;try{var s=n(),u=Kn.S;u!==null&&u(l,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(LQ,h2)}catch(p){h2(p)}finally{o!==null&&l.types!==null&&(o.types=l.types),Kn.T=o}}function D2(n){var o=Kn.T;if(o!==null){var l=o.types;l===null?o.types=[n]:l.indexOf(n)===-1&&l.push(n)}else v2(D2.bind(null,n))}var wM={map:NB,forEach:function(n,o,l){NB(n,function(){o.apply(this,arguments)},l)},count:function(n){var o=0;return NB(n,function(){o++}),o},toArray:function(n){return NB(n,function(o){return o})||[]},only:function(n){if(!KQ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Rt.Activity=SM;Rt.Children=wM;Rt.Component=kg;Rt.Fragment=mM;Rt.Profiler=hM;Rt.PureComponent=zQ;Rt.StrictMode=EM;Rt.Suspense=yM;Rt.ViewTransition=vM;Rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kn;Rt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Kn.H.useMemoCache(n)}};Rt.addTransitionType=D2;Rt.cache=function(n){return function(){return n.apply(null,arguments)}};Rt.cacheSignal=function(){return null};Rt.cloneElement=function(n,o,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=I2({},n.props),u=n.key;if(o!=null)for(p in o.key!==void 0&&(u=""+o.key),o)!S2.call(o,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&o.ref===void 0||(s[p]=o[p]);var p=arguments.length-2;if(p===1)s.children=l;else if(1<p){for(var E=Array(p),B=0;B<p;B++)E[B]=arguments[B+2];s.children=E}return JQ(n.type,u,s)};Rt.createContext=function(n){return n={$$typeof:BM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:CM,_context:n},n};Rt.createElement=function(n,o,l){var s,u={},p=null;if(o!=null)for(s in o.key!==void 0&&(p=""+o.key),o)S2.call(o,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(u[s]=o[s]);var E=arguments.length-2;if(E===1)u.children=l;else if(1<E){for(var B=Array(E),I=0;I<E;I++)B[I]=arguments[I+2];u.children=B}if(n&&n.defaultProps)for(s in E=n.defaultProps,E)u[s]===void 0&&(u[s]=E[s]);return JQ(n,p,u)};Rt.createRef=function(){return{current:null}};Rt.forwardRef=function(n){return{$$typeof:IM,render:n}};Rt.isValidElement=KQ;Rt.lazy=function(n){return{$$typeof:C2,_payload:{_status:-1,_result:n},_init:NM}};Rt.memo=function(n,o){return{$$typeof:QM,type:n,compare:o===void 0?null:o}};Rt.startTransition=v2;Rt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Rt.use=function(n){return Kn.H.use(n)};Rt.useActionState=function(n,o,l){return Kn.H.useActionState(n,o,l)};Rt.useCallback=function(n,o){return Kn.H.useCallback(n,o)};Rt.useContext=function(n){return Kn.H.useContext(n)};Rt.useDebugValue=function(){};Rt.useDeferredValue=function(n,o){return Kn.H.useDeferredValue(n,o)};Rt.useEffect=function(n,o){return Kn.H.useEffect(n,o)};Rt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Rt.useId=function(){return Kn.H.useId()};Rt.useImperativeHandle=function(n,o,l){return Kn.H.useImperativeHandle(n,o,l)};Rt.useInsertionEffect=function(n,o){return Kn.H.useInsertionEffect(n,o)};Rt.useLayoutEffect=function(n,o){return Kn.H.useLayoutEffect(n,o)};Rt.useMemo=function(n,o){return Kn.H.useMemo(n,o)};Rt.useOptimistic=function(n,o){return Kn.H.useOptimistic(n,o)};Rt.useReducer=function(n,o,l){return Kn.H.useReducer(n,o,l)};Rt.useRef=function(n){return Kn.H.useRef(n)};Rt.useState=function(n){return Kn.H.useState(n)};Rt.useSyncExternalStore=function(n,o,l){return Kn.H.useSyncExternalStore(n,o,l)};Rt.useTransition=function(){return Kn.H.useTransition()};Rt.version="19.3.0"});var b2=Ha((yt,wB)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(y,U){Object.defineProperty(s.prototype,y,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",U[0],U[1])}})}function o(y){return y===null||typeof y!="object"?null:(y=$a&&y[$a]||y["@@iterator"],typeof y=="function"?y:null)}function l(y,U){y=(y=y.constructor)&&(y.displayName||y.name)||"ReactClass";var ue=y+"."+U;St[ue]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,y),St[ue]=!0)}function s(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function u(){}function p(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function E(){}function B(y){return""+y}function I(y){try{B(y);var U=!1}catch{U=!0}if(U){U=console;var ue=U.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return ue.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),B(y)}}function S(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===Wn?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case Qt:return"Fragment";case Te:return"Profiler";case J:return"StrictMode";case ut:return"Suspense";case qe:return"SuspenseList";case mn:return"Activity";case Ga:return"ViewTransition"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case Tt:return"Portal";case Pe:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case We:var U=y.render;return y=y.displayName,y||(y=U.displayName||U.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case He:return U=y.displayName||null,U!==null?U:S(y.type)||"Memo";case $e:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function N(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===$e)return"<...>";try{var U=S(y);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function x(){var y=Ve.A;return y===null?null:y.getOwner()}function v(){return Error("react-stack-top-frame")}function w(y){if(Wt.call(y,"key")){var U=Object.getOwnPropertyDescriptor(y,"key").get;if(U&&U.isReactWarning)return!1}return y.key!==void 0}function z(y,U){function ue(){On||(On=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",U))}ue.isReactWarning=!0,Object.defineProperty(y,"key",{get:ue,configurable:!0})}function F(){var y=S(this.type);return Na[y]||(Na[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function M(y,U,ue,re,ce,ct){var xe=ue.ref;return y={$$typeof:Me,type:y,key:U,props:ue,_owner:re},(xe!==void 0?xe:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:F}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function ae(y,U){return U=M(y.type,U,y.props,y._owner,y._debugStack,y._debugTask),y._store&&(U._store.validated=y._store.validated),U}function he(y){Re(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===$e&&(y._payload.status==="fulfilled"?Re(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function Re(y){return typeof y=="object"&&y!==null&&y.$$typeof===Me}function Ie(y){var U={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ue){return U[ue]})}function je(y,U){return typeof y=="object"&&y!==null&&y.key!=null?(I(y.key),Ie(""+y.key)):U.toString(36)}function Oe(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(E,E):(y.status="pending",y.then(function(U){y.status==="pending"&&(y.status="fulfilled",y.value=U)},function(U){y.status==="pending"&&(y.status="rejected",y.reason=U)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function be(y,U,ue,re,ce){var ct=typeof y;(ct==="undefined"||ct==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ct){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case Tt:xe=!0;break;case $e:return xe=y._init,be(xe(y._payload),U,ue,re,ce)}}if(xe){xe=y,ce=ce(xe);var Xe=re===""?"."+je(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function($n){return $n})):ce!=null&&(Re(ce)&&(ce.key!=null&&(xe&&xe.key===ce.key||I(ce.key)),ue=ae(ce,ue+(ce.key==null||xe&&xe.key===ce.key?"":(""+ce.key).replace(Qo,"$&/")+"/")+Xe),re!==""&&xe!=null&&Re(xe)&&xe.key==null&&xe._store&&!xe._store.validated&&(ue._store.validated=2),ce=ue),U.push(ce)),1}if(xe=0,Xe=re===""?".":re+":",ua(y))for(var Dt=0;Dt<y.length;Dt++)re=y[Dt],ct=Xe+je(re,Dt),xe+=be(re,U,ue,ct,ce);else if(Dt=o(y),typeof Dt=="function")for(Dt===y.entries&&(qt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qt=!0),y=Dt.call(y),Dt=0;!(re=y.next()).done;)re=re.value,ct=Xe+je(re,Dt++),xe+=be(re,U,ue,ct,ce);else if(ct==="object"){if(typeof y.then=="function")return be(Oe(y),U,ue,re,ce);throw U=String(y),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ze(y,U,ue){if(y==null)return y;var re=[],ce=0;return be(y,re,"","",function(ct){return U.call(ue,ct,ce++)}),re}function Qe(y){if(y._status===-1){var U=null,ue=null,re=y._ioInfo;re!=null&&(re.start=re.end=performance.now(),re.value=new Promise(function(xe,Xe){U=xe,ue=Xe})),re=y._result;var ce=re();if(ce.then(function(xe){if(y._status===0||y._status===-1){y._status=1,y._result=xe;var Xe=y._ioInfo;if(Xe!=null){Xe.end=performance.now();var Dt=xe?.default;U(Dt),Xe.value.status="fulfilled",Xe.value.value=Dt}ce.status===void 0&&(ce.status="fulfilled",ce.value=xe)}},function(xe){if(y._status===0||y._status===-1){y._status=2,y._result=xe;var Xe=y._ioInfo;Xe!=null&&(Xe.end=performance.now(),Xe.value.then(E,E),ue(xe),Xe.value.status="rejected",Xe.value.reason=xe),ce.status===void 0&&(ce.status="rejected",ce.reason=xe)}}),re=y._ioInfo,re!=null){var ct=ce.displayName;typeof ct=="string"&&(re.name=ct)}y._status===-1&&(y._status=0,y._result=ce)}if(y._status===1)return re=y._result,re===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
3
+ import{$ as k1,$a as cB,A as R1,Aa as $m,B as b1,Ba as V1,C as fA,Ca as X1,D as Xm,Da as AB,E as T1,Ea as qA,F as N1,Fa as Z1,G as w1,Ga as P1,H as x1,Ha as W1,I as is,Ia as As,J as _1,Ja as Dg,K as Zm,Ka as $1,L as dA,La as eD,M as xl,Ma as tD,N as Ig,Na as lB,O as U1,Oa as nQ,P as M1,Pa as nD,Q as O1,Qa as aD,R as Ku,Ra as oD,S as di,Sa as iD,T as gn,Ta as AD,U as on,Ua as lD,V as Za,Va as rD,W as wn,Wa as sD,X as $C,Xa as cD,Y as Uo,Ya as rB,Z as eB,Za as sB,_ as Jn,_a as ls,a as b,aa as H1,ab as uB,b as XC,ba as Pm,bb as uD,c as YA,ca as yg,cb as eE,d as Tl,da as G1,db as aQ,e as fr,ea as Wm,eb as fD,f as Ju,fa as Qg,fb as dD,g as Q1,ga as Yu,gb as gD,h as dr,ha as tB,hb as pD,i as qm,ia as nB,ib as mD,j as Vm,ja as tQ,jb as fB,k as sc,ka as L1,kb as ED,l as Nl,la as Sg,lb as hD,m as wl,ma as Zo,mb as oQ,n as Wy,na as Po,nb as iQ,o as Pn,oa as nt,ob as CD,p as ki,pa as j1,pb as BD,q as S1,qa as z1,qb as ID,r as $y,ra as F1,rb as yD,s as v1,sa as J1,t as cc,ta as aB,u as vn,ua as vg,ub as QD,v as gr,va as K1,vb as SD,w as PC,wa as oB,x as eQ,xa as iB,y as WC,ya as Y1,z as D1,za as q1}from"./chunk-LNZN426S.js";import{a as B1,c as ZC,d as I1,e as y1}from"./chunk-42IVF3YT.js";import{a as Bg,b as Ha,c as lx,d as st}from"./chunk-6EA4DGCY.js";var g2=Ha(TB=>{"use strict";var dM=Symbol.for("react.transitional.element"),gM=Symbol.for("react.fragment");function d2(n,o,l){var s=null;if(l!==void 0&&(s=""+l),o.key!==void 0&&(s=""+o.key),"key"in o){l={};for(var u in o)u!=="key"&&(l[u]=o[u])}else l=o;return o=l.ref,{$$typeof:dM,type:n,key:s,ref:o!==void 0?o:null,props:l}}TB.Fragment=gM;TB.jsx=d2;TB.jsxs=d2});var R2=Ha(Rt=>{"use strict";var jQ=Symbol.for("react.transitional.element"),pM=Symbol.for("react.portal"),mM=Symbol.for("react.fragment"),EM=Symbol.for("react.strict_mode"),hM=Symbol.for("react.profiler"),CM=Symbol.for("react.consumer"),BM=Symbol.for("react.context"),IM=Symbol.for("react.forward_ref"),yM=Symbol.for("react.suspense"),QM=Symbol.for("react.memo"),C2=Symbol.for("react.lazy"),SM=Symbol.for("react.activity"),vM=Symbol.for("react.view_transition"),p2=Symbol.iterator;function DM(n){return n===null||typeof n!="object"?null:(n=p2&&n[p2]||n["@@iterator"],typeof n=="function"?n:null)}var B2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I2=Object.assign,y2={};function kg(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}kg.prototype.isReactComponent={};kg.prototype.setState=function(n,o){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,o,"setState")};kg.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Q2(){}Q2.prototype=kg.prototype;function zQ(n,o,l){this.props=n,this.context=o,this.refs=y2,this.updater=l||B2}var FQ=zQ.prototype=new Q2;FQ.constructor=zQ;I2(FQ,kg.prototype);FQ.isPureReactComponent=!0;var m2=Array.isArray;function LQ(){}var Kn={H:null,A:null,T:null,S:null},S2=Object.prototype.hasOwnProperty;function JQ(n,o,l){var s=l.ref;return{$$typeof:jQ,type:n,key:o,ref:s!==void 0?s:null,props:l}}function RM(n,o){return JQ(n.type,o,n.props)}function KQ(n){return typeof n=="object"&&n!==null&&n.$$typeof===jQ}function bM(n){var o={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(l){return o[l]})}var E2=/\/+/g;function GQ(n,o){return typeof n=="object"&&n!==null&&n.key!=null?bM(""+n.key):o.toString(36)}function TM(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(LQ,LQ):(n.status="pending",n.then(function(o){n.status==="pending"&&(n.status="fulfilled",n.value=o)},function(o){n.status==="pending"&&(n.status="rejected",n.reason=o)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Og(n,o,l,s,u){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var E=!1;if(n===null)E=!0;else switch(p){case"bigint":case"string":case"number":E=!0;break;case"object":switch(n.$$typeof){case jQ:case pM:E=!0;break;case C2:return E=n._init,Og(E(n._payload),o,l,s,u)}}if(E)return u=u(n),E=s===""?"."+GQ(n,0):s,m2(u)?(l="",E!=null&&(l=E.replace(E2,"$&/")+"/"),Og(u,o,l,"",function(S){return S})):u!=null&&(KQ(u)&&(u=RM(u,l+(u.key==null||n&&n.key===u.key?"":(""+u.key).replace(E2,"$&/")+"/")+E)),o.push(u)),1;E=0;var B=s===""?".":s+":";if(m2(n))for(var I=0;I<n.length;I++)s=n[I],p=B+GQ(s,I),E+=Og(s,o,l,p,u);else if(I=DM(n),typeof I=="function")for(n=I.call(n),I=0;!(s=n.next()).done;)s=s.value,p=B+GQ(s,I++),E+=Og(s,o,l,p,u);else if(p==="object"){if(typeof n.then=="function")return Og(TM(n),o,l,s,u);throw o=String(n),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return E}function NB(n,o,l){if(n==null)return n;var s=[],u=0;return Og(n,s,"","",function(p){return o.call(l,p,u++)}),s}function NM(n){if(n._status===-1){var o=n._result,l=o();l.then(function(s){(n._status===0||n._status===-1)&&(n._status=1,n._result=s,l.status===void 0&&(l.status="fulfilled",l.value=s))},function(s){(n._status===0||n._status===-1)&&(n._status=2,n._result=s,l.status===void 0&&(l.status="rejected",l.reason=s))}),n._status===-1&&(n._status=0,n._result=l)}if(n._status===1)return n._result.default;throw n._result}var h2=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function v2(n){var o=Kn.T,l={};l.types=o!==null?o.types:null,Kn.T=l;try{var s=n(),u=Kn.S;u!==null&&u(l,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(LQ,h2)}catch(p){h2(p)}finally{o!==null&&l.types!==null&&(o.types=l.types),Kn.T=o}}function D2(n){var o=Kn.T;if(o!==null){var l=o.types;l===null?o.types=[n]:l.indexOf(n)===-1&&l.push(n)}else v2(D2.bind(null,n))}var wM={map:NB,forEach:function(n,o,l){NB(n,function(){o.apply(this,arguments)},l)},count:function(n){var o=0;return NB(n,function(){o++}),o},toArray:function(n){return NB(n,function(o){return o})||[]},only:function(n){if(!KQ(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Rt.Activity=SM;Rt.Children=wM;Rt.Component=kg;Rt.Fragment=mM;Rt.Profiler=hM;Rt.PureComponent=zQ;Rt.StrictMode=EM;Rt.Suspense=yM;Rt.ViewTransition=vM;Rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kn;Rt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Kn.H.useMemoCache(n)}};Rt.addTransitionType=D2;Rt.cache=function(n){return function(){return n.apply(null,arguments)}};Rt.cacheSignal=function(){return null};Rt.cloneElement=function(n,o,l){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var s=I2({},n.props),u=n.key;if(o!=null)for(p in o.key!==void 0&&(u=""+o.key),o)!S2.call(o,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&o.ref===void 0||(s[p]=o[p]);var p=arguments.length-2;if(p===1)s.children=l;else if(1<p){for(var E=Array(p),B=0;B<p;B++)E[B]=arguments[B+2];s.children=E}return JQ(n.type,u,s)};Rt.createContext=function(n){return n={$$typeof:BM,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:CM,_context:n},n};Rt.createElement=function(n,o,l){var s,u={},p=null;if(o!=null)for(s in o.key!==void 0&&(p=""+o.key),o)S2.call(o,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(u[s]=o[s]);var E=arguments.length-2;if(E===1)u.children=l;else if(1<E){for(var B=Array(E),I=0;I<E;I++)B[I]=arguments[I+2];u.children=B}if(n&&n.defaultProps)for(s in E=n.defaultProps,E)u[s]===void 0&&(u[s]=E[s]);return JQ(n,p,u)};Rt.createRef=function(){return{current:null}};Rt.forwardRef=function(n){return{$$typeof:IM,render:n}};Rt.isValidElement=KQ;Rt.lazy=function(n){return{$$typeof:C2,_payload:{_status:-1,_result:n},_init:NM}};Rt.memo=function(n,o){return{$$typeof:QM,type:n,compare:o===void 0?null:o}};Rt.startTransition=v2;Rt.unstable_useCacheRefresh=function(){return Kn.H.useCacheRefresh()};Rt.use=function(n){return Kn.H.use(n)};Rt.useActionState=function(n,o,l){return Kn.H.useActionState(n,o,l)};Rt.useCallback=function(n,o){return Kn.H.useCallback(n,o)};Rt.useContext=function(n){return Kn.H.useContext(n)};Rt.useDebugValue=function(){};Rt.useDeferredValue=function(n,o){return Kn.H.useDeferredValue(n,o)};Rt.useEffect=function(n,o){return Kn.H.useEffect(n,o)};Rt.useEffectEvent=function(n){return Kn.H.useEffectEvent(n)};Rt.useId=function(){return Kn.H.useId()};Rt.useImperativeHandle=function(n,o,l){return Kn.H.useImperativeHandle(n,o,l)};Rt.useInsertionEffect=function(n,o){return Kn.H.useInsertionEffect(n,o)};Rt.useLayoutEffect=function(n,o){return Kn.H.useLayoutEffect(n,o)};Rt.useMemo=function(n,o){return Kn.H.useMemo(n,o)};Rt.useOptimistic=function(n,o){return Kn.H.useOptimistic(n,o)};Rt.useReducer=function(n,o,l){return Kn.H.useReducer(n,o,l)};Rt.useRef=function(n){return Kn.H.useRef(n)};Rt.useState=function(n){return Kn.H.useState(n)};Rt.useSyncExternalStore=function(n,o,l){return Kn.H.useSyncExternalStore(n,o,l)};Rt.useTransition=function(){return Kn.H.useTransition()};Rt.version="19.3.0"});var b2=Ha((yt,wB)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(y,U){Object.defineProperty(s.prototype,y,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",U[0],U[1])}})}function o(y){return y===null||typeof y!="object"?null:(y=$a&&y[$a]||y["@@iterator"],typeof y=="function"?y:null)}function l(y,U){y=(y=y.constructor)&&(y.displayName||y.name)||"ReactClass";var ue=y+"."+U;St[ue]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",U,y),St[ue]=!0)}function s(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function u(){}function p(y,U,ue){this.props=y,this.context=U,this.refs=en,this.updater=ue||Ft}function E(){}function B(y){return""+y}function I(y){try{B(y);var U=!1}catch{U=!0}if(U){U=console;var ue=U.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return ue.call(U,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),B(y)}}function S(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===Wn?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case Qt:return"Fragment";case Te:return"Profiler";case J:return"StrictMode";case ut:return"Suspense";case qe:return"SuspenseList";case mn:return"Activity";case Ga:return"ViewTransition"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case Tt:return"Portal";case Pe:return y.displayName||"Context";case Ge:return(y._context.displayName||"Context")+".Consumer";case We:var U=y.render;return y=y.displayName,y||(y=U.displayName||U.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case He:return U=y.displayName||null,U!==null?U:S(y.type)||"Memo";case $e:U=y._payload,y=y._init;try{return S(y(U))}catch{}}return null}function N(y){if(y===Qt)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===$e)return"<...>";try{var U=S(y);return U?"<"+U+">":"<...>"}catch{return"<...>"}}function x(){var y=Ve.A;return y===null?null:y.getOwner()}function v(){return Error("react-stack-top-frame")}function w(y){if(Wt.call(y,"key")){var U=Object.getOwnPropertyDescriptor(y,"key").get;if(U&&U.isReactWarning)return!1}return y.key!==void 0}function z(y,U){function ue(){On||(On=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",U))}ue.isReactWarning=!0,Object.defineProperty(y,"key",{get:ue,configurable:!0})}function F(){var y=S(this.type);return Na[y]||(Na[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function M(y,U,ue,re,ce,ct){var xe=ue.ref;return y={$$typeof:Me,type:y,key:U,props:ue,_owner:re},(xe!==void 0?xe:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:F}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function ae(y,U){return U=M(y.type,U,y.props,y._owner,y._debugStack,y._debugTask),y._store&&(U._store.validated=y._store.validated),U}function he(y){Re(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===$e&&(y._payload.status==="fulfilled"?Re(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function Re(y){return typeof y=="object"&&y!==null&&y.$$typeof===Me}function Ie(y){var U={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ue){return U[ue]})}function je(y,U){return typeof y=="object"&&y!==null&&y.key!=null?(I(y.key),Ie(""+y.key)):U.toString(36)}function Oe(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(E,E):(y.status="pending",y.then(function(U){y.status==="pending"&&(y.status="fulfilled",y.value=U)},function(U){y.status==="pending"&&(y.status="rejected",y.reason=U)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function be(y,U,ue,re,ce){var ct=typeof y;(ct==="undefined"||ct==="boolean")&&(y=null);var xe=!1;if(y===null)xe=!0;else switch(ct){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(y.$$typeof){case Me:case Tt:xe=!0;break;case $e:return xe=y._init,be(xe(y._payload),U,ue,re,ce)}}if(xe){xe=y,ce=ce(xe);var Xe=re===""?"."+je(xe,0):re;return ua(ce)?(ue="",Xe!=null&&(ue=Xe.replace(Qo,"$&/")+"/"),be(ce,U,ue,"",function($n){return $n})):ce!=null&&(Re(ce)&&(ce.key!=null&&(xe&&xe.key===ce.key||I(ce.key)),ue=ae(ce,ue+(ce.key==null||xe&&xe.key===ce.key?"":(""+ce.key).replace(Qo,"$&/")+"/")+Xe),re!==""&&xe!=null&&Re(xe)&&xe.key==null&&xe._store&&!xe._store.validated&&(ue._store.validated=2),ce=ue),U.push(ce)),1}if(xe=0,Xe=re===""?".":re+":",ua(y))for(var Dt=0;Dt<y.length;Dt++)re=y[Dt],ct=Xe+je(re,Dt),xe+=be(re,U,ue,ct,ce);else if(Dt=o(y),typeof Dt=="function")for(Dt===y.entries&&(qt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),qt=!0),y=Dt.call(y),Dt=0;!(re=y.next()).done;)re=re.value,ct=Xe+je(re,Dt++),xe+=be(re,U,ue,ct,ce);else if(ct==="object"){if(typeof y.then=="function")return be(Oe(y),U,ue,re,ce);throw U=String(y),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ze(y,U,ue){if(y==null)return y;var re=[],ce=0;return be(y,re,"","",function(ct){return U.call(ue,ct,ce++)}),re}function Qe(y){if(y._status===-1){var U=null,ue=null,re=y._ioInfo;re!=null&&(re.start=re.end=performance.now(),re.value=new Promise(function(xe,Xe){U=xe,ue=Xe})),re=y._result;var ce=re();if(ce.then(function(xe){if(y._status===0||y._status===-1){y._status=1,y._result=xe;var Xe=y._ioInfo;if(Xe!=null){Xe.end=performance.now();var Dt=xe?.default;U(Dt),Xe.value.status="fulfilled",Xe.value.value=Dt}ce.status===void 0&&(ce.status="fulfilled",ce.value=xe)}},function(xe){if(y._status===0||y._status===-1){y._status=2,y._result=xe;var Xe=y._ioInfo;Xe!=null&&(Xe.end=performance.now(),Xe.value.then(E,E),ue(xe),Xe.value.status="rejected",Xe.value.reason=xe),ce.status===void 0&&(ce.status="rejected",ce.reason=xe)}}),re=y._ioInfo,re!=null){var ct=ce.displayName;typeof ct=="string"&&(re.name=ct)}y._status===-1&&(y._status=0,y._result=ce)}if(y._status===1)return re=y._result,re===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
4
4
 
5
5
  Your code should look like:
6
6
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -607,7 +607,7 @@ Available templates:`));for(let[p,E]of Object.entries(QB))console.log(` ${b.cya
607
607
  `,0),nt(`Source: ${l.bundledPath?"bundled TDK example":l.repo}`,0),nt(`Destination: ${u}
608
608
  `,0);try{if(l.bundledPath){let p=SB(yU(QU(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");hU(SB(p,l.bundledPath),u,{recursive:!0});let E=IU(u).replace(/-/g,"_");for(let B of["services/platform/messaging/docker-compose.yml","services/shop/orders-api/service.json","services/shop/orders-api/src/index.ts","services/shop/orders-worker/service.json","services/shop/orders-worker/src/index.ts"]){let I=Mg(u,B),S=QQ(I,"utf-8");BU(I,S.replaceAll("tdk_example",E))}}else EU("git",["clone",l.repo,u],{stdio:"inherit"})}catch{Uo(l.bundledPath?"Bundled example copy failed. Reinstall the TDK CLI package and try again.":"git clone failed. Check you have git installed and network access.")}console.log(b.green(`
609
609
  \u2705 Cloned "${n}" into ${s}/`)),nt(`
610
- Next steps:`,0),nt(`1. cd ${s}`),nt("2. tdk doctor # check Docker/Tilt are ready"),nt("3. tdk up # start the stack")}var AE={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:DU()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},vR=new SU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(QB).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--yes","Non-interactive mode (use defaults)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,o)=>{let{assertMachineReadyOrExit:l}=await import("./cold-preflight-F2FM46HK.js");if(await l(),n){await wn(async()=>RU(n,o.path));return}await wn(async()=>{let s=vn();s||(s=QR(),Po(`\u{1F680} Initializing new TDK project...
610
+ Next steps:`,0),nt(`1. cd ${s}`),nt("2. tdk doctor # check Docker/Tilt are ready"),nt("3. tdk up # start the stack")}var AE={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:DU()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},vR=new SU("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(QB).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--yes","Non-interactive mode (use defaults)").option("--config-file <path>","Load project config from existing JSON file").action(async(n,o)=>{let{assertMachineReadyOrExit:l}=await import("./cold-preflight-D7CAIHND.js");if(await l(),n){await wn(async()=>RU(n,o.path));return}await wn(async()=>{let s=vn();s||(s=QR(),Po(`\u{1F680} Initializing new TDK project...
611
611
  `),nt(`Location: ${s}
612
612
  `,0));let u=Mg(s,".tdk"),p=Mg(u,sc);if(o.check){let w=wl.every(F=>uc(Mg(s,".tdk",".tdk-out",F))),z=uc(p);if(w&&z){let F=Gi(s);Zo("Project configuration is valid"),nt(`Project: ${F.project.name}`,3),nt(`Phases: ${Object.keys(F.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(b.yellow("\u26A0\uFE0F Project configuration incomplete:")),z||nt(".tdk/project.json (not found)",3),!w)for(let F of wl.filter(M=>!uc(Mg(s,".tdk/.tdk-out",M))))nt(`.tdk/.tdk-out/${F} (not found)`,3);nt("Run `tdk project` to create them."),process.exit(1)}}Yu("Project Configuration"),nt(`Project root: ${s}
613
613
  `,0),uc(u)||(TD(u),Zo("Created: .tdk/ directory"));let E=uc(p);if(E&&!o.force){Zo(".tdk/project.json exists");let w=JSON.parse(QQ(p,"utf-8")),z=Gi(s),F=SQ(s),M=vQ(z,F);if((M.length>0||!w.phases)&&rs(p,z),M.length>0&&nt(`Auto-enabled discovered service stacks: ${M.join(", ")}`,0),Po(`
@@ -1416,7 +1416,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
1416
1416
  `)}`,B="Upgrade tdk to a version that supports these files. Changing schemaVersion by hand is not a fix";o.onInvalid?.(`${E}
1417
1417
  Fix: ${B}`),console.error(b.red(`\u2717 ${E}`)),console.error(b.gray(` Fix: ${B}`)),l(1)}import{execFileSync as u3}from"node:child_process";var yw=(n,o)=>u3(n,o,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function f3(n,o=process.platform,l=yw){if(!Number.isInteger(n)||n<1||n>65535)return[];if(o==="win32"){let u=`$port=${n}; Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $p=Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue; if ($p -and $p.ProcessName -eq 'tilt') { $_.OwningProcess } } | Sort-Object -Unique`;try{return l("powershell.exe",["-NoProfile","-Command",u]).split(/\s+/).map(Number).filter(p=>Number.isInteger(p)&&p>0)}catch{throw new Error(`Unable to inspect Tilt listeners on port ${n} with PowerShell.`)}}let s;try{s=l("lsof",["-nP","-t",`-iTCP:${n}`,"-sTCP:LISTEN"]).split(/\s+/).map(Number).filter(u=>Number.isInteger(u)&&u>0)}catch(u){let p=u,E=p.stderr?.toString().trim();if(p?.status===1&&!E)return[];throw new Error(`Unable to inspect listeners on port ${n}. Install lsof or resolve the lsof error before using --force.`,{cause:p})}return s.filter(u=>{try{return l("ps",["-p",String(u),"-o","comm="]).trim().split(/[\\/]/).at(-1)==="tilt"}catch(p){throw new Error(`Unable to identify the process listening on port ${n}.`,{cause:p})}})}function LI(n,o=process.platform,l=yw){let s=f3(n,o,l);for(let u of s)o==="win32"?l("taskkill.exe",["/PID",String(u),"/F"]):l("kill",["-TERM",String(u)]);return s}function Qw(n,o){let l=new Set(o.map(s=>s.name));return n.filter(s=>!l.has(s))}function Sw(n,o){let l=new Map(o.map(p=>[p.name,p])),s=new Set,u=p=>{if(!(s.has(p)||!l.has(p))){s.add(p);for(let E of l.get(p)?.config?.dependsOn??[])u(E)}};for(let p of n)u(p);return{selected:o.filter(p=>s.has(p.name)),dependencies:o.map(p=>p.name).filter(p=>s.has(p)&&!n.includes(p))}}function Dw(n,o=[]){return["TDK is up.",`Tilt UI: http://localhost:${n}`,"App URLs:",...o.length>0?o.slice(0,5).map(l=>` ${l}`):[" run: tdk networks"],"Stop: tdk down"]}function m3(n,o){return n!=="win32"||o==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function E3(n=AD(),o=h3){return n.kind==="webcontainer"?oD:lD(n.kind)&&!await o()?iD:null}async function h3(){let{execFile:n}=await import("node:child_process");return new Promise(o=>{n("docker",["ps"],{timeout:1e4},l=>o(!l))})}var C3=2;function B3(n){let o;try{({handEdited:o}=EB(n))}catch(l){if(l instanceof tE)return null;throw l}return o.length===0?null:["Generated files were edited by hand and no longer match service.json:",...o.map(l=>` ${l}`),"Run `tdk config regenerate` to discard the edits, or bypass with `tdk up --ignore-drift`."]}function I3(n,o,l=process.exit){if(o.ignoreDrift){console.warn(b.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let s=B3(n);if(s){o.onDrift?.(s.join(`
1418
1418
  `));for(let u of s)console.error(b.red(u));l(C3)}}function y3(n,o,l=gr(),s=process.exit){if(o.ignoreVersion){console.warn(b.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let u=ID(n,l);u.status==="none"||u.status==="ok"||(o.onFail?.(`${u.message}
1419
- ${u.fix}`),console.error(b.red(u.message)),console.error(b.red(u.fix)),s(1))}function Q3(n,o=3e4){return new Promise(l=>{let s=Date.now()+o,u=()=>{let p=g3({host:"127.0.0.1",port:n}),E=!1,B=I=>{E||(E=!0,p.destroy(),I||Date.now()>=s?l(I):setTimeout(u,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};u()})}var Rw=new p3("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this tdk is older than minTdkVersion in .tdk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,o)=>{let l=o.json?yB("UP_FAILED","tdk up"):void 0;o.json&&(o.quiet=!0);let s=HQ(process.env.TILT_PORT);s.ok||(l?.({ok:!1},[{code:"INVALID_TILT_PORT",message:s.message}]),Uo(s.message));let u=s.port,p=vn();p&&y3(p,{ignoreVersion:o.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=o.dryRun?null:await E3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=m3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&Iw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!o.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-F2FM46HK.js");await N()}let S=async()=>{let N=o.dryRun?Za():vn(),x=N??process.cwd(),v=Z1(),w,z=[];if((!o.only||n)&&(w=As(v),z=w.map(J=>J.name)),o.only){if(n&&!Dg(n)){let Ge=on.stackNotFound(n,z);l?.({ok:!1},[BB(Ge).error]),Ge.exit()}let J=n?v.filter(Ge=>Ge.stack===n):v,Te=Qw(o.only,J);if(Te.length>0){let Ge=J.map(We=>We.name),Pe=on.unknownServices(Te,Ge);l?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Pe.message,...Pe.suggestions.length>0?{suggestions:Pe.suggestions}:{}}]),Pe.exit()}}N&&I3(N,{ignoreDrift:o.ignoreDrift,onDrift:J=>l?.({ok:!1},[{code:"DRIFT_DETECTED",message:J}])}),N&&BD(N,{onInvalid:J=>l?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:J}])}),N&&!l&&!o.quiet&&CD(N);let F=await fB(x,{inspectDocker:!o.dryRun});if(!o.dryRun){if(N){let Ge=eE(x);Ge.length>0&&!o.quiet&&console.log(b.gray(`Added ${Ge.join(", ")} to .env (generated; existing values unchanged)`))}N&&!d3(vw(x,".tdk",".tdk-out","Tiltfile"))&&(o.quiet||console.log(b.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await Zu(x,{quiet:o.quiet}));let J=pQ(x);J.length>0&&o.verbose&&!o.quiet&&console.log(b.gray(`Refreshed runtime assets: ${J.join(", ")}`));let Te=SR(x);Te.length>0&&!o.quiet&&console.log(b.gray(`Added ${Te.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let M,ae,he=[];if(n){if(M=v.filter(J=>J.stack===n),M.length===0){let J=on.stackNotFound(n,z);l?.({ok:!1},[BB(J).error]),J.exit()}he=M.map(J=>J.name),ae=`stack "${n}"`}else{M=v;let J=w??As(v);ae=`all stacks (${Jn(J.length,"stack")}, ${Jn(M.length,"service")})`}let Re=[];if(o.only){let J=Sw(o.only,qA());M=J.selected,Re=J.dependencies,he=M.map(Te=>Te.name),ae=`${Jn(o.only.length,"requested service")}${Re.length>0?` plus ${Re.join(", ")}`:""}`}o.verbose&&!o.quiet&&console.log(b.gray(`Found ${Jn(M.length,"service")} in ${ae}`));let Ie=M.map(J=>J.name);if(!o.quiet){console.log(b.blue(`${o.dryRun?"Would start":"Starting"} ${Jn(Ie.length,"service")} from ${ae}...`));for(let We of Ie)console.log(b.gray(` - ${We}`));let{appBase:J,apiBase:Te}=PC(F.ingressHttp),Ge=M.filter(We=>We.config?.appType==="frontend"),Pe=M.filter(We=>cc(We.config?.appType));if(Ge.length>0){console.log(b.blue(`
1419
+ ${u.fix}`),console.error(b.red(u.message)),console.error(b.red(u.fix)),s(1))}function Q3(n,o=3e4){return new Promise(l=>{let s=Date.now()+o,u=()=>{let p=g3({host:"127.0.0.1",port:n}),E=!1,B=I=>{E||(E=!0,p.destroy(),I||Date.now()>=s?l(I):setTimeout(u,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};u()})}var Rw=new p3("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this tdk is older than minTdkVersion in .tdk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,o)=>{let l=o.json?yB("UP_FAILED","tdk up"):void 0;o.json&&(o.quiet=!0);let s=HQ(process.env.TILT_PORT);s.ok||(l?.({ok:!1},[{code:"INVALID_TILT_PORT",message:s.message}]),Uo(s.message));let u=s.port,p=vn();p&&y3(p,{ignoreVersion:o.ignoreVersion,onFail:N=>l?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:N}])});let E=o.dryRun?null:await E3();E&&(l?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:E}]),Uo(E));let B=m3(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Uo(B);let I=vn();if(I&&Iw(I,{onInvalid:N=>l?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:N}])}),!o.dryRun){let{assertMachineReadyOrExit:N}=await import("./cold-preflight-D7CAIHND.js");await N()}let S=async()=>{let N=o.dryRun?Za():vn(),x=N??process.cwd(),v=Z1(),w,z=[];if((!o.only||n)&&(w=As(v),z=w.map(J=>J.name)),o.only){if(n&&!Dg(n)){let Ge=on.stackNotFound(n,z);l?.({ok:!1},[BB(Ge).error]),Ge.exit()}let J=n?v.filter(Ge=>Ge.stack===n):v,Te=Qw(o.only,J);if(Te.length>0){let Ge=J.map(We=>We.name),Pe=on.unknownServices(Te,Ge);l?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:Pe.message,...Pe.suggestions.length>0?{suggestions:Pe.suggestions}:{}}]),Pe.exit()}}N&&I3(N,{ignoreDrift:o.ignoreDrift,onDrift:J=>l?.({ok:!1},[{code:"DRIFT_DETECTED",message:J}])}),N&&BD(N,{onInvalid:J=>l?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:J}])}),N&&!l&&!o.quiet&&CD(N);let F=await fB(x,{inspectDocker:!o.dryRun});if(!o.dryRun){if(N){let Ge=eE(x);Ge.length>0&&!o.quiet&&console.log(b.gray(`Added ${Ge.join(", ")} to .env (generated; existing values unchanged)`))}N&&!d3(vw(x,".tdk",".tdk-out","Tiltfile"))&&(o.quiet||console.log(b.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await Zu(x,{quiet:o.quiet}));let J=pQ(x);J.length>0&&o.verbose&&!o.quiet&&console.log(b.gray(`Refreshed runtime assets: ${J.join(", ")}`));let Te=SR(x);Te.length>0&&!o.quiet&&console.log(b.gray(`Added ${Te.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let M,ae,he=[];if(n){if(M=v.filter(J=>J.stack===n),M.length===0){let J=on.stackNotFound(n,z);l?.({ok:!1},[BB(J).error]),J.exit()}he=M.map(J=>J.name),ae=`stack "${n}"`}else{M=v;let J=w??As(v);ae=`all stacks (${Jn(J.length,"stack")}, ${Jn(M.length,"service")})`}let Re=[];if(o.only){let J=Sw(o.only,qA());M=J.selected,Re=J.dependencies,he=M.map(Te=>Te.name),ae=`${Jn(o.only.length,"requested service")}${Re.length>0?` plus ${Re.join(", ")}`:""}`}o.verbose&&!o.quiet&&console.log(b.gray(`Found ${Jn(M.length,"service")} in ${ae}`));let Ie=M.map(J=>J.name);if(!o.quiet){console.log(b.blue(`${o.dryRun?"Would start":"Starting"} ${Jn(Ie.length,"service")} from ${ae}...`));for(let We of Ie)console.log(b.gray(` - ${We}`));let{appBase:J,apiBase:Te}=PC(F.ingressHttp),Ge=M.filter(We=>We.config?.appType==="frontend"),Pe=M.filter(We=>cc(We.config?.appType));if(Ge.length>0){console.log(b.blue(`
1420
1420
  \u{1F30D} Frontend URLs:`));for(let We of Ge){let ut=We.config?.basePath??`/${We.name}`;console.log(b.gray(` - ${We.name}: ${J}${b.cyan(eQ(ut))}`))}}if(Pe.length>0){console.log(b.blue(`
1421
1421
  \u{1F527} Backend API URLs:`));for(let We of Pe){let ut=We.name.replace(/-api$/,""),qe=We.config?.apiPath??`/api/${ut}`,He=We.config?.sablier,$e=He?.enable&&He?.deferStart?b.dim(" (deferred \u2014 starts on first request)"):"";console.log(b.gray(` - ${We.name}: ${Te}${b.cyan(eQ(qe))}${$e}`))}}}let je=o.only??(n?[n]:void 0),Oe=M1(he,{verbose:o.verbose,quiet:o.quiet,force:o.force,focusTargets:je}),be=je?`tilt up ${Oe.join(" ")}`:"tilt up";if(!o.quiet){console.log(b.blue(dD(F)));for(let J of Bw(F))console.log(b.yellow(J));console.log(b.gray("Override with TDK_HTTP_PORT, TDK_HTTPS_PORT, or TDK_POSTGRES_PORT."))}if(l&&o.dryRun){l({ok:!0,dryRun:!0,stack:n??null,services:Ie,...o.only?{requested:o.only,declaredDependencies:Re}:{},command:be});return}if(CB(o,"not starting services",be))return;mD(F),pD(x,F);let ze=ki.tiltUi,Qe=u??ze,Ye=o.only?[...new Set([ze,Qe])]:[Qe],At=[];for(let J of Ye)await fc(J)!==null&&At.push(J);let ke=s2({runningPorts:At,force:o.force,only:!!o.only});if(ke.action==="already-running"){let J=`Environment is already running on port ${ke.ports.join(", ")}.`;l?.({ok:!0,alreadyRunning:!0,tiltUrl:`http://localhost:${ke.ports[0]}`}),o.quiet||console.log(b.green(J));return}if(ke.action==="only-blocked"){let J=`A Tilt is already running on port ${ke.ports.join(", ")}. --only cannot change a running stack's services: run \`tdk down\` first, or pass --force to replace it.`;l?.({ok:!1},[{code:"TILT_ALREADY_RUNNING",message:J}]),Uo(J)}if(o.only)for(let J of At)LI(J);let kt=await c2({configuredPort:u,force:o.force,basePort:ze,findAvailablePort:CR}),at=kt.port;kt.autoSwitched&&!o.quiet&&(console.log(b.yellow(`\u26A0\uFE0F Port ${ze} is already in use`)),console.log(b.blue(`\u{1F504} Auto-switching to port ${at}
1422
1422
  `))),process.env.TILT_PORT=at.toString(),await u2({force:o.force,quiet:o.quiet,port:at},{stop:LI,log:J=>console.log(b.yellow(J)),wait:J=>new Promise(Te=>setTimeout(Te,J))}),o.quiet||(console.log(b.gray(`
@@ -1,2 +1,2 @@
1
1
  import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
2
- import{sb as a,tb as b,ub as c,vb as d,wb as e}from"./chunk-47CDYJ5E.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};
2
+ import{sb as a,tb as b,ub as c,vb as d,wb as e}from"./chunk-LNZN426S.js";import"./chunk-42IVF3YT.js";import"./chunk-6EA4DGCY.js";export{e as assertMachineReadyOrExit,d as formatColdPreflight,a as nodeTooOld,b as requireVerifiedDockerVersions,c as runColdPreflight};
package/cli/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tdk-cli-internal",
3
3
  "private": true,
4
- "version": "1.3.145",
4
+ "version": "1.3.147",
5
5
  "description": "TDK CLI — start services on your machine.",
6
6
  "keywords": [
7
7
  "tdk",
@@ -85,6 +85,7 @@ load('ext://tdk-cli',
85
85
  'Watchers',
86
86
  'Infra',
87
87
  'Docker',
88
+ 'FrontendBuildPlan',
88
89
  'load_ui_enhancements',
89
90
  'APP_RESOURCES',
90
91
  'GLOBAL_CONFIG_EXPORT',
@@ -266,6 +267,13 @@ for _KNOWN_SVC in _app_resources_list:
266
267
  _KNOWN_TILT_RESOURCES.add(_KNOWN_RES_NAME)
267
268
  _KNOWN_TILT_RESOURCES.add(_KNOWN_RES_NAME + '-run-only')
268
269
  _KNOWN_TILT_RESOURCES.add(_KNOWN_RES_NAME + '-config-gen')
270
+ # A frontend whose build script is the standard `tsc && vite build` gets a
271
+ # non-blocking <service>-typecheck resource (see Docker frontend registration).
272
+ # Name it here, from the same plan and path, so focus mode can enable it.
273
+ if _KNOWN_RES.get('frontend', False) and not should_enable('backends-only'):
274
+ _KNOWN_RES_DIR = PROJECT_ROOT + '/' + _KNOWN_RES.get('_resource_path', _KNOWN_SVC.get('path', '') + '/' + _KNOWN_RES_NAME)
275
+ if FrontendBuildPlan(_KNOWN_RES_DIR + '/package.json')['typecheck']:
276
+ _KNOWN_TILT_RESOURCES.add(_KNOWN_RES_NAME + '-typecheck')
269
277
  _KNOWN_RES_MANIFEST = _KNOWN_RES.get('_manifest', {})
270
278
  _KNOWN_RES_SABLIER = _KNOWN_RES_MANIFEST.get('sablier', {})
271
279
  # Mirrors _register_single_resource: the prebuild only exists for
@@ -280,6 +288,8 @@ if FOCUS_MODE and FOCUS_ENABLED_RESOURCES:
280
288
  for _R in FOCUS_ENABLED_RESOURCES:
281
289
  if _R in _KNOWN_TILT_RESOURCES:
282
290
  _FILTERED_RESOURCES.append(_R)
291
+ if _R + '-typecheck' in _KNOWN_TILT_RESOURCES:
292
+ _FILTERED_RESOURCES.append(_R + '-typecheck')
283
293
  # Focus expansion normally resolves stack names to concrete
284
294
  # resources before this loop, so the stack branch below is not
285
295
  # reached for the common `tdk up <stack>` path. Keep a deferred
@@ -301,6 +311,8 @@ if FOCUS_MODE and FOCUS_ENABLED_RESOURCES:
301
311
  # enabled name it cannot find.
302
312
  if _STACK_RES_NAME + '-image' in _DEFERRED_IMAGE_RESOURCES:
303
313
  _FILTERED_RESOURCES.append(_STACK_RES_NAME + '-image')
314
+ if _STACK_RES_NAME + '-typecheck' in _KNOWN_TILT_RESOURCES:
315
+ _FILTERED_RESOURCES.append(_STACK_RES_NAME + '-typecheck')
304
316
  else:
305
317
  _MATCHED = [kr for kr in _KNOWN_TILT_RESOURCES if kr != 'service-discovery-daemon' and kr.startswith(_R + '-')]
306
318
  _FILTERED_RESOURCES.extend(_MATCHED)
@@ -179,7 +179,7 @@ def get_global_config():
179
179
  "golden_l2_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l2:latest",
180
180
  "golden_l3_backend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-backend:latest",
181
181
  "golden_l3_frontend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-frontend:latest",
182
- "golden_l3_migrator_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-migrator:latest",
182
+ "golden_l3_migrator_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l3-backend:latest",
183
183
  "golden_l4_backend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l4-backend:latest",
184
184
  "golden_l4_frontend_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l4-frontend:latest",
185
185
  "golden_l4_migrator_image": PlatformDockerConstants.PROJECT_NAME_HYPHEN + "-l4-migrator:latest",
package/engine/Tiltfile CHANGED
@@ -13,6 +13,7 @@
13
13
  load('./topologies/tilt/common/utils.star', _Utils='Utils')
14
14
  load('./topologies/tilt/discovery/loading.star', _Manifest='Manifest')
15
15
  load('./topologies/tilt/config/global.star', _Config='Config')
16
+ load('./topologies/platform/docker/build/frontend_build_plan.star', _frontend_build_plan='frontend_build_plan')
16
17
 
17
18
  # Registry
18
19
  load('./topologies/tilt/discovery/registry.star',
@@ -49,6 +50,7 @@ load('./topologies/tilt/resources/orchestrator/apply_compose_resource_registrati
49
50
  Utils = _Utils
50
51
  Manifest = _Manifest
51
52
  Config = _Config
53
+ FrontendBuildPlan = _frontend_build_plan
52
54
 
53
55
  # Registry Data
54
56
  GLOBAL_CONFIG_EXPORT = _GLOBAL_CONFIG_EXPORT
@@ -17,13 +17,16 @@
17
17
  # This Dockerfile builds 8 golden images:
18
18
  # - tdk-project-l1:latest - OS base + Bun runtime
19
19
  # - tdk-project-l2:latest - Dependencies installed
20
- # - tdk-project-l3-backend:latest - Backend build tools (Prisma, no Infisical CLI)
20
+ # - tdk-project-l3-backend:latest - Backend and migrator build tools (Prisma, no Infisical CLI)
21
21
  # - tdk-project-l3-frontend:latest - Frontend build tools (no Prisma)
22
- # - tdk-project-l3-migrator:latest - Migrator build tools (Prisma, no Infisical CLI)
23
- # - tdk-project-l4-backend:latest - Backend production runtime
22
+ # - tdk-project-l4-backend:latest - Backend production runtime (Bun)
23
+ # - tdk-project-l4-backend-node:latest - Backend production runtime (Node.js)
24
24
  # - tdk-project-l4-frontend:latest - Frontend production runtime (Nginx)
25
25
  # - tdk-project-l4-migrator:latest - Migrator production runtime
26
26
  #
27
+ # Migrators build on l3-backend: a separate l3-migrator stage installed the same Prisma
28
+ # and produced identical layers under a second image name.
29
+ #
27
30
  # Services use these as base images to skip heavy dependency installation.
28
31
  #
29
32
  # ⚠️ SKIP_INFISICAL_SETUP Support:
@@ -100,26 +103,6 @@ LABEL layer="l3-frontend" description="Frontend build tools without Prisma
100
103
  RUN echo "Bun version: $(bun --version)"
101
104
 
102
105
 
103
- # =============================================================================
104
- # L3-MIGRATOR: MIGRATOR BUILD TOOLS (PRISMA)
105
- # =============================================================================
106
- FROM l2_golden AS l3_migrator_golden
107
-
108
- LABEL layer="l3-migrator" description="Migrator build tools with Prisma" maintainer="tdk-project"
109
-
110
- # Install Prisma CLI globally (required for migrations, pinned)
111
- RUN bun add -g prisma@7.5.0 @prisma/client@7.5.0
112
-
113
- # Verify Prisma installation
114
- RUN echo "Prisma version: $(bunx prisma --version | head -1)"
115
-
116
- # ⚠️ CRITICAL: Infisical CLI is NOT installed in golden L3 images
117
- # Reason: curl to dl.cloudsmith.io hangs during Docker builds when CDN is slow
118
- # Solution: Use SKIP_INFISICAL_SETUP=1 build arg or runtime env var injection
119
- # Services read secrets from environment variables at runtime (no CLI needed)
120
- # See: .tilt/topologies/platform/docker/layers/l3_builder_layers.star
121
-
122
-
123
106
  # =============================================================================
124
107
  # L4-BACKEND-BUN: BACKEND PRODUCTION RUNTIME (BUN)
125
108
  # =============================================================================
@@ -202,8 +185,8 @@ LABEL layer="l4-migrator" description="Migrator runtime with Prisma"
202
185
 
203
186
  ENV NODE_ENV=production
204
187
 
205
- # Copy global Prisma installation from L3
206
- COPY --from=l3_migrator_golden /root/.bun/install/global /root/.bun/install/global
188
+ # Copy global Prisma installation from L3 (l3-backend carries the same pinned Prisma)
189
+ COPY --from=l3_backend_golden /root/.bun/install/global /root/.bun/install/global
207
190
 
208
191
  # ⚠️ Infisical CLI is NOT included in golden L4 images
209
192
  # The migrator reads secrets directly from environment variables at runtime
@@ -81,13 +81,13 @@ for repo in $REPOS; do
81
81
  while IFS= read -r row; do
82
82
  [[ -z "$row" ]] && continue
83
83
  if (( i < KEEP_COUNT )); then
84
- ((i++))
84
+ ((++i))
85
85
  continue
86
86
  fi
87
87
  image_id="$(awk '{print $3}' <<< "$row")"
88
88
  tag="$(awk '{print $2}' <<< "$row")"
89
89
  TO_DELETE+=("$image_id|$repo:$tag")
90
- ((i++))
90
+ ((++i))
91
91
  done <<< "$repo_blob"
92
92
  done
93
93
 
@@ -0,0 +1,65 @@
1
+ # =============================================================================
2
+ # 🏗️ TILT SDK - FRONTEND BUILD PLAN
3
+ # =============================================================================
4
+ # Decides how a frontend image runs its production build.
5
+ #
6
+ # A `"build": "tsc --noEmit && vite build"` script (the restaurant example uses it). Running that script
7
+ # inside the image build makes the type-check block the image and compete for
8
+ # CPU with other builds. When the script has exactly that standard shape, the
9
+ # image runs `vite build` directly and the type-check becomes a separate,
10
+ # non-blocking Tilt resource. Any other script runs unchanged.
11
+ # =============================================================================
12
+
13
+ DEFAULT_FRONTEND_BUILD_CMD = 'bun run build'
14
+
15
+ # Only a non-emitting type-check is moved out of the image. A plain `tsc` writes output that the build may
16
+ # use (the CLI scaffold's tsconfig emits to ./dist), so that script keeps running unchanged in the image.
17
+ _TSC_FORMS = ['tsc --noEmit']
18
+ # The generated config is copied into the image; any other config file is not, so a script that selects one is not used.
19
+ _IMAGE_CONFIG_DIR = '.autogenerated/'
20
+ _VITE_BUILD = 'vite build'
21
+
22
+
23
+ def _default_plan():
24
+ return {'build_cmd': DEFAULT_FRONTEND_BUILD_CMD, 'typecheck': False, 'typecheck_cmd': ''}
25
+
26
+
27
+ def frontend_build_plan(package_json_path):
28
+ """Returns {'build_cmd', 'typecheck', 'typecheck_cmd'} for the package.json at package_json_path.
29
+
30
+ build_cmd is the command the image runs; the generated Vite config is appended to it.
31
+ typecheck is True only when the standard `tsc --noEmit && vite build` form was recognised;
32
+ typecheck_cmd is then the host command for the non-blocking type-check resource.
33
+ A missing or unreadable package.json, or any other script, gets the default plan.
34
+ """
35
+ if not os.path.exists(package_json_path):
36
+ return _default_plan()
37
+
38
+ scripts = read_json(package_json_path).get('scripts', {})
39
+ script = scripts.get('build', '').strip()
40
+ steps = script.split(' && ')
41
+ if len(steps) != 2:
42
+ return _default_plan()
43
+
44
+ typecheck_step = steps[0].strip()
45
+ vite_step = steps[1].strip()
46
+ if typecheck_step not in _TSC_FORMS:
47
+ return _default_plan()
48
+ if vite_step != _VITE_BUILD and not vite_step.startswith(_VITE_BUILD + ' '):
49
+ return _default_plan()
50
+
51
+ # Flags after `vite build` are kept. A --config must name the generated config, which the image copies.
52
+ extra_args = vite_step[len(_VITE_BUILD):]
53
+ tokens = extra_args.split()
54
+ for i, token in enumerate(tokens):
55
+ value = ''
56
+ if token == '--config' and i + 1 < len(tokens):
57
+ value = tokens[i + 1]
58
+ elif token.startswith('--config='):
59
+ value = token[len('--config='):]
60
+ else:
61
+ continue
62
+ if not value.startswith(_IMAGE_CONFIG_DIR):
63
+ return _default_plan()
64
+
65
+ return {'build_cmd': 'bunx vite build' + extra_args, 'typecheck': True, 'typecheck_cmd': 'bunx tsc --noEmit'}
@@ -2,7 +2,69 @@
2
2
  # 🏗️ TILT SDK - GOLDEN IMAGE BUILDERS
3
3
  # =============================================================================
4
4
 
5
- load('./golden_image_constants.star', 'GOLDEN_DOCKERFILE', 'GOLDEN_IMAGE_PREFIX')
5
+ load('./golden_image_constants.star', 'GOLDEN_DOCKERFILE', 'GOLDEN_IMAGE_PREFIX', 'GOLDEN_LAYERS', 'LEGACY_GOLDEN_IMAGES')
6
+
7
+ # Label that records which golden Dockerfile an image was built from.
8
+ GOLDEN_HASH_LABEL = 'tdk.golden.hash'
9
+
10
+ # Shell template for the golden build. Placeholders (@@...@@) are replaced in
11
+ # build_golden_layers(); plain `$VAR` references are expanded by the shell.
12
+ _GOLDEN_BUILD_TEMPLATE = '''
13
+ DF_REL=@@DF_REL@@
14
+ ROOT_REL=@@ROOT_REL@@
15
+ DF="$(cd "$(dirname "$DF_REL")" && pwd)/$(basename "$DF_REL")"
16
+ ROOT="$(cd "$ROOT_REL" && pwd)"
17
+ HASH="$(cat "$DF" | (sha256sum 2>/dev/null || shasum -a 256) | cut -c1-64)"
18
+ IMAGES="@@IMAGES@@"
19
+
20
+ if [ -z "$TDK_GOLDEN_REBUILD" ]; then
21
+ fresh=1
22
+ for img in $IMAGES; do
23
+ [ "$(docker image inspect -f '{{index .Config.Labels "@@HASH_LABEL@@"}}' "$img" 2>/dev/null)" = "$HASH" ] || fresh=0
24
+ done
25
+ if [ "$fresh" = 1 ]; then
26
+ echo "✅ Golden images are up to date (hash $HASH) - skipping build"
27
+ exit 0
28
+ fi
29
+ fi
30
+
31
+ echo "🏗️ Building golden layered images (@@COUNT@@ total)..."
32
+ if docker buildx version >/dev/null 2>&1; then
33
+ echo " 🧩 Building all golden targets with one docker buildx bake (independent stages run in parallel)"
34
+ cat > golden-layers.bake.hcl <<HCL
35
+ variable "HASH" {
36
+ default = ""
37
+ }
38
+
39
+ group "default" {
40
+ targets = [@@TARGET_NAMES@@]
41
+ }
42
+ @@BAKE_TARGETS@@
43
+ HCL
44
+ # Buildx 0.19 and later ask for read access outside the bake file's directory; older releases do not know the flag.
45
+ BUILDX_VER="$(docker buildx version 2>/dev/null | sed -n 's/.* v\\([0-9]*\\)\\.\\([0-9]*\\).*/\\1 \\2/p')"
46
+ BUILDX_MAJOR="${BUILDX_VER%% *}"
47
+ BUILDX_MINOR="${BUILDX_VER##* }"
48
+ BAKE_ALLOW=""
49
+ if [ "${BUILDX_MAJOR:-0}" -gt 0 ] || [ "${BUILDX_MINOR:-0}" -ge 19 ]; then BAKE_ALLOW="--allow fs.read=$ROOT"; fi
50
+ HASH="$HASH" docker buildx bake $BAKE_ALLOW -f golden-layers.bake.hcl --load
51
+ else
52
+ echo " ⚠️ docker buildx is not available - building golden targets one at a time"
53
+ @@SERIAL_BUILDS@@
54
+ fi
55
+
56
+ # Untag golden images that older engines built and nothing uses now; an image still in use is left alone.
57
+ for img in @@LEGACY_IMAGES@@; do
58
+ docker image rm "$img" >/dev/null 2>&1 && echo " 🧹 Removed legacy golden image $img"
59
+ done
60
+
61
+ echo "✅ Golden layers built (@@COUNT@@ images):"
62
+ @@SUMMARY@@
63
+ '''
64
+
65
+
66
+ def _sh_quote(text):
67
+ return "'" + text.replace("'", "'\\''") + "'"
6
68
 
7
69
 
8
70
  def build_golden_layers(project_root='.'):
@@ -16,63 +78,63 @@ def build_golden_layers(project_root='.'):
16
78
  is itself project-root-relative, so it must be prefixed with this to
17
79
  resolve correctly - passing project_root='.' (the default) only works
18
80
  when the Tiltfile happens to live at the project root.
81
+
82
+ The build is skipped when every golden image already exists with a
83
+ `tdk.golden.hash` label matching the current Dockerfile. Set
84
+ TDK_GOLDEN_REBUILD=1 to force a rebuild. Otherwise all targets are built
85
+ with one `docker buildx bake`, falling back to serial `docker build` when
86
+ buildx is not installed.
19
87
  """
20
88
  resource_name = 'golden-layers-build'
21
89
  dockerfile_from_tiltfile = (
22
90
  GOLDEN_DOCKERFILE if project_root in (None, '.', '')
23
91
  else project_root.rstrip('/') + '/' + GOLDEN_DOCKERFILE
24
92
  )
93
+ context = project_root or '.'
94
+
95
+ images = []
96
+ summary = []
97
+ bake_targets = []
98
+ serial_builds = []
99
+ target_names = []
100
+ for key in GOLDEN_LAYERS:
101
+ layer = GOLDEN_LAYERS[key]
102
+ ref = layer['name'] + ':' + layer['tag']
103
+ images.append(ref)
104
+ summary.append('echo " ✓ ' + ref + '"')
105
+ target_names.append('"' + key + '"')
106
+ bake_targets.append('''target "{key}" {{
107
+ dockerfile = "$DF"
108
+ context = "$ROOT"
109
+ target = "{target}"
110
+ tags = ["{ref}"]
111
+ labels = {{
112
+ "{label}" = HASH
113
+ }}
114
+ }}
115
+ '''.format(key=key, target=layer['target'], ref=ref, label=GOLDEN_HASH_LABEL))
116
+ serial_builds.append(
117
+ 'docker build --label "{label}=$HASH" -f "$DF" --target {target} -t {ref} "$ROOT" || exit 1'.format(
118
+ label=GOLDEN_HASH_LABEL, target=layer['target'], ref=ref,
119
+ )
120
+ )
25
121
 
26
- build_cmd = """
27
- echo "🏗️ Building golden layered images (8 total)..."
28
- echo " 📦 L1: OS base + runtime"
29
- echo " 📦 L2: Dependencies"
30
- echo " 📦 L3-Backend: Backend build tools (Prisma)"
31
- echo " 📦 L3-Frontend: Frontend build tools"
32
- echo " 📦 L3-Migrator: Migrator build tools (Prisma)"
33
- echo " 📦 L4-Backend: Backend runtime"
34
- echo " 📦 L4-Frontend: Frontend runtime"
35
- echo " 📦 L4-Migrator: Migrator runtime"
36
-
37
- docker build -f {dockerfile} \\
38
- --target l1_golden -t {prefix}-l1:{tag} {context} && \\
39
- docker build -f {dockerfile} \\
40
- --target l2_golden -t {prefix}-l2:{tag} {context} && \\
41
- docker build -f {dockerfile} \\
42
- --target l3_backend_golden -t {prefix}-l3-backend:{tag} {context} && \\
43
- docker build -f {dockerfile} \\
44
- --target l3_frontend_golden -t {prefix}-l3-frontend:{tag} {context} && \\
45
- docker build -f {dockerfile} \\
46
- --target l3_migrator_golden -t {prefix}-l3-migrator:{tag} {context} && \\
47
- docker build -f {dockerfile} \\
48
- --target l4_backend_bun -t {prefix}-l4-backend:{tag} {context} && \\
49
- docker build -f {dockerfile} \\
50
- --target l4_backend_node -t {prefix}-l4-backend-node:{tag} {context} && \\
51
- docker build -f {dockerfile} \\
52
- --target l4_frontend_golden -t {prefix}-l4-frontend:{tag} {context} && \\
53
- docker build -f {dockerfile} \\
54
- --target l4_migrator_golden -t {prefix}-l4-migrator:{tag} {context}
55
-
56
- echo "✅ Golden layers built (9 images):"
57
- echo " ✓ {prefix}-l1:{tag}"
58
- echo " ✓ {prefix}-l2:{tag}"
59
- echo " ✓ {prefix}-l3-backend:{tag}"
60
- echo " ✓ {prefix}-l3-frontend:{tag}"
61
- echo " ✓ {prefix}-l3-migrator:{tag}"
62
- echo " ✓ {prefix}-l4-backend:{tag} (Bun - 128MB)"
63
- echo " ✓ {prefix}-l4-backend-node:{tag} (Node.js - 20MB, LIGHTWEIGHT)"
64
- echo " ✓ {prefix}-l4-frontend:{tag}"
65
- echo " ✓ {prefix}-l4-migrator:{tag}"
66
- """.format(
67
- dockerfile=dockerfile_from_tiltfile,
68
- prefix=GOLDEN_IMAGE_PREFIX,
69
- tag='latest',
70
- context=project_root,
71
- ).strip()
122
+ cmd = (_GOLDEN_BUILD_TEMPLATE
123
+ .replace('@@DF_REL@@', _sh_quote(dockerfile_from_tiltfile))
124
+ .replace('@@ROOT_REL@@', _sh_quote(context))
125
+ .replace('@@IMAGES@@', ' '.join(images))
126
+ .replace('@@LEGACY_IMAGES@@', ' '.join(LEGACY_GOLDEN_IMAGES))
127
+ .replace('@@HASH_LABEL@@', GOLDEN_HASH_LABEL)
128
+ .replace('@@COUNT@@', str(len(images)))
129
+ .replace('@@TARGET_NAMES@@', ', '.join(target_names))
130
+ .replace('@@BAKE_TARGETS@@', '\n'.join(bake_targets))
131
+ .replace('@@SERIAL_BUILDS@@', '\n '.join(serial_builds))
132
+ .replace('@@SUMMARY@@', '\n'.join(summary))
133
+ )
72
134
 
73
135
  local_resource(
74
136
  resource_name,
75
- cmd=build_cmd,
137
+ cmd=cmd,
76
138
  labels=['infra.docker', 'golden-layers'],
77
139
  deps=[dockerfile_from_tiltfile],
78
140
  allow_parallel=True,
@@ -46,12 +46,6 @@ GOLDEN_LAYERS = {
46
46
  'description': 'Frontend build tools (no Prisma)',
47
47
  'target': 'l3_frontend_golden',
48
48
  },
49
- 'l3-migrator': {
50
- 'name': GOLDEN_IMAGE_PREFIX + '-l3-migrator',
51
- 'tag': 'latest',
52
- 'description': 'Migrator build tools (Prisma only, Infisical CLI skipped to avoid CDN hangs)',
53
- 'target': 'l3_migrator_golden',
54
- },
55
49
  'l4-backend': {
56
50
  'name': GOLDEN_IMAGE_PREFIX + '-l4-backend',
57
51
  'tag': 'latest',
@@ -79,8 +73,21 @@ GOLDEN_LAYERS = {
79
73
  }
80
74
 
81
75
 
76
+ # Layers that are no longer built, mapped to the layer that replaced them.
77
+ # l3-migrator installed the same Prisma as l3-backend and produced identical layers.
78
+ LAYER_ALIASES = {
79
+ 'l3-migrator': 'l3-backend',
80
+ }
81
+
82
+ # Image names older engines built that nothing uses now; the golden build untags them.
83
+ LEGACY_GOLDEN_IMAGES = [
84
+ GOLDEN_IMAGE_PREFIX + '-l3-migrator:latest',
85
+ ]
86
+
87
+
82
88
  def get_layer_reference(layer):
83
89
  """Returns the full image reference for a specific layer."""
90
+ layer = LAYER_ALIASES.get(layer, layer)
84
91
  if layer not in GOLDEN_LAYERS:
85
92
  fail("Invalid layer: " + layer + ". Must be one of: l1, l2, l3, l4")
86
93