@tdk-landscape/tdk-cli-core 1.3.176 → 1.3.177
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/cli/dist/backend-languages/node.js +102 -0
- package/cli/dist/backend-languages/registry.js +2 -0
- package/cli/dist/commands/resource.js +1 -1
- package/cli/dist-bundle/{chunk-TH62O42Q.js → chunk-W66JQVU6.js} +146 -74
- package/cli/dist-bundle/cli.js +4 -4
- package/cli/dist-bundle/{cold-preflight-HCFAMPQP.js → cold-preflight-6WRQUFZ6.js} +1 -1
- package/cli/package.json +1 -1
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +27 -2
- package/engine/topologies/tilt/generators/validators.star +1 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +9 -3
- package/package.json +1 -1
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 di,$a as Kf,A as mR,Aa as OR,Ab as Ih,B as pR,Ba as tA,Bb as FQ,C as ER,Ca as HR,Cb as m2,D as zf,Da as GR,Db as p2,E as ui,Ea as kR,Eb as qQ,F as Bt,Fa as Qs,Fb as VQ,G as en,Ga as pm,Gb as E2,H as Aa,Ha as LR,Hb as h2,I as yn,Ia as zR,Ib as C2,J as xI,Ja as jR,Jb as Vf,K as Ua,Ka as JR,Kb as qI,L as _I,La as KR,Lb as B2,M as qn,Ma as zI,Mb as XQ,N as hR,Na as YR,Nb as I2,O as CR,Oa as FR,Ob as y2,P as Eh,Pa as Em,Pb as Q2,Q as dm,Qa as En,Qb as S2,R as BR,Ra as jQ,S as hh,Sa as bo,T as jf,Ta as jI,Tb as v2,U as Jf,Ua as Kc,Ub as D2,V as UI,Va as ZR,W as MI,Wa as JQ,X as kQ,Xa as PR,Y as IR,Ya as WR,Z as gm,Za as $R,_ as fi,_a as nA,a as rR,aa as at,ab as e2,b as S,ba as yR,bb as t2,c as wI,ca as QR,cb as JI,d as sR,da as HA,db as vr,e as eA,ea as OI,eb as Yf,f as kf,fa as LQ,fb as KQ,g as Lf,ga as HI,gb as Ff,h as ph,ha as zQ,hb as Bh,i as cR,ia as SR,ib as YQ,j as uR,ja as vR,jb as n2,k as jc,ka as DR,kb as o2,l as um,la as bl,lb as a2,m as MA,ma as Ch,mb as i2,n as GQ,na as RR,nb as l2,o as bI,oa as TR,ob as A2,p as Nl,pa as NR,pb as r2,q as fR,qa as GI,qb as s2,r as fn,ra as mm,rb as c2,s as Sr,sa as wR,sb as u2,t as ys,ta as kI,tb as f2,u as dR,ua as LI,ub as KI,v as fm,va as bR,vb as YI,w as OA,wa as xR,wb as qf,x as gR,xa as _R,xb as d2,y as wl,ya as UR,yb as FI,z as Jc,za as MR,zb as g2}from"./chunk-TH62O42Q.js";import{a as qR,c as VR,d as XR}from"./chunk-42IVF3YT.js";import{a as HQ,b as Fo,c as fU,d as st}from"./chunk-6EA4DGCY.js";var lN=Fo(cy=>{"use strict";var wO=Symbol.for("react.transitional.element"),bO=Symbol.for("react.fragment");function iN(n,l,A){var c=null;if(A!==void 0&&(c=""+A),l.key!==void 0&&(c=""+l.key),"key"in l){A={};for(var d in l)d!=="key"&&(A[d]=l[d])}else A=l;return l=A.ref,{$$typeof:wO,type:n,key:c,ref:l!==void 0?l:null,props:A}}cy.Fragment=bO;cy.jsx=iN;cy.jsxs=iN});var CN=Fo(Nt=>{"use strict";var IS=Symbol.for("react.transitional.element"),xO=Symbol.for("react.portal"),_O=Symbol.for("react.fragment"),UO=Symbol.for("react.strict_mode"),MO=Symbol.for("react.profiler"),OO=Symbol.for("react.consumer"),HO=Symbol.for("react.context"),GO=Symbol.for("react.forward_ref"),kO=Symbol.for("react.suspense"),LO=Symbol.for("react.memo"),uN=Symbol.for("react.lazy"),zO=Symbol.for("react.activity"),jO=Symbol.for("react.view_transition"),AN=Symbol.iterator;function JO(n){return n===null||typeof n!="object"?null:(n=AN&&n[AN]||n["@@iterator"],typeof n=="function"?n:null)}var fN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dN=Object.assign,gN={};function vm(n,l,A){this.props=n,this.context=l,this.refs=gN,this.updater=A||fN}vm.prototype.isReactComponent={};vm.prototype.setState=function(n,l){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,l,"setState")};vm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function mN(){}mN.prototype=vm.prototype;function yS(n,l,A){this.props=n,this.context=l,this.refs=gN,this.updater=A||fN}var QS=yS.prototype=new mN;QS.constructor=yS;dN(QS,vm.prototype);QS.isPureReactComponent=!0;var rN=Array.isArray;function BS(){}var Pn={H:null,A:null,T:null,S:null},pN=Object.prototype.hasOwnProperty;function SS(n,l,A){var c=A.ref;return{$$typeof:IS,type:n,key:l,ref:c!==void 0?c:null,props:A}}function KO(n,l){return SS(n.type,l,n.props)}function vS(n){return typeof n=="object"&&n!==null&&n.$$typeof===IS}function YO(n){var l={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return l[A]})}var sN=/\/+/g;function CS(n,l){return typeof n=="object"&&n!==null&&n.key!=null?YO(""+n.key):l.toString(36)}function FO(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(BS,BS):(n.status="pending",n.then(function(l){n.status==="pending"&&(n.status="fulfilled",n.value=l)},function(l){n.status==="pending"&&(n.status="rejected",n.reason=l)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Sm(n,l,A,c,d){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var h=!1;if(n===null)h=!0;else switch(p){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case IS:case xO:h=!0;break;case uN:return h=n._init,Sm(h(n._payload),l,A,c,d)}}if(h)return d=d(n),h=c===""?"."+CS(n,0):c,rN(d)?(A="",h!=null&&(A=h.replace(sN,"$&/")+"/"),Sm(d,l,A,"",function(Q){return Q})):d!=null&&(vS(d)&&(d=KO(d,A+(d.key==null||n&&n.key===d.key?"":(""+d.key).replace(sN,"$&/")+"/")+h)),l.push(d)),1;h=0;var B=c===""?".":c+":";if(rN(n))for(var I=0;I<n.length;I++)c=n[I],p=B+CS(c,I),h+=Sm(c,l,A,p,d);else if(I=JO(n),typeof I=="function")for(n=I.call(n),I=0;!(c=n.next()).done;)c=c.value,p=B+CS(c,I++),h+=Sm(c,l,A,p,d);else if(p==="object"){if(typeof n.then=="function")return Sm(FO(n),l,A,c,d);throw l=String(n),Error("Objects are not valid as a React child (found: "+(l==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":l)+"). If you meant to render a collection of children, use an array instead.")}return h}function uy(n,l,A){if(n==null)return n;var c=[],d=0;return Sm(n,c,"","",function(p){return l.call(A,p,d++)}),c}function qO(n){if(n._status===-1){var l=n._result,A=l();A.then(function(c){(n._status===0||n._status===-1)&&(n._status=1,n._result=c,A.status===void 0&&(A.status="fulfilled",A.value=c))},function(c){(n._status===0||n._status===-1)&&(n._status=2,n._result=c,A.status===void 0&&(A.status="rejected",A.reason=c))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var cN=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=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(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function EN(n){var l=Pn.T,A={};A.types=l!==null?l.types:null,Pn.T=A;try{var c=n(),d=Pn.S;d!==null&&d(A,c),typeof c=="object"&&c!==null&&typeof c.then=="function"&&c.then(BS,cN)}catch(p){cN(p)}finally{l!==null&&A.types!==null&&(l.types=A.types),Pn.T=l}}function hN(n){var l=Pn.T;if(l!==null){var A=l.types;A===null?l.types=[n]:A.indexOf(n)===-1&&A.push(n)}else EN(hN.bind(null,n))}var VO={map:uy,forEach:function(n,l,A){uy(n,function(){l.apply(this,arguments)},A)},count:function(n){var l=0;return uy(n,function(){l++}),l},toArray:function(n){return uy(n,function(l){return l})||[]},only:function(n){if(!vS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Nt.Activity=zO;Nt.Children=VO;Nt.Component=vm;Nt.Fragment=_O;Nt.Profiler=MO;Nt.PureComponent=yS;Nt.StrictMode=UO;Nt.Suspense=kO;Nt.ViewTransition=jO;Nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pn;Nt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Pn.H.useMemoCache(n)}};Nt.addTransitionType=hN;Nt.cache=function(n){return function(){return n.apply(null,arguments)}};Nt.cacheSignal=function(){return null};Nt.cloneElement=function(n,l,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var c=dN({},n.props),d=n.key;if(l!=null)for(p in l.key!==void 0&&(d=""+l.key),l)!pN.call(l,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&l.ref===void 0||(c[p]=l[p]);var p=arguments.length-2;if(p===1)c.children=A;else if(1<p){for(var h=Array(p),B=0;B<p;B++)h[B]=arguments[B+2];c.children=h}return SS(n.type,d,c)};Nt.createContext=function(n){return n={$$typeof:HO,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:OO,_context:n},n};Nt.createElement=function(n,l,A){var c,d={},p=null;if(l!=null)for(c in l.key!==void 0&&(p=""+l.key),l)pN.call(l,c)&&c!=="key"&&c!=="__self"&&c!=="__source"&&(d[c]=l[c]);var h=arguments.length-2;if(h===1)d.children=A;else if(1<h){for(var B=Array(h),I=0;I<h;I++)B[I]=arguments[I+2];d.children=B}if(n&&n.defaultProps)for(c in h=n.defaultProps,h)d[c]===void 0&&(d[c]=h[c]);return SS(n,p,d)};Nt.createRef=function(){return{current:null}};Nt.forwardRef=function(n){return{$$typeof:GO,render:n}};Nt.isValidElement=vS;Nt.lazy=function(n){return{$$typeof:uN,_payload:{_status:-1,_result:n},_init:qO}};Nt.memo=function(n,l){return{$$typeof:LO,type:n,compare:l===void 0?null:l}};Nt.startTransition=EN;Nt.unstable_useCacheRefresh=function(){return Pn.H.useCacheRefresh()};Nt.use=function(n){return Pn.H.use(n)};Nt.useActionState=function(n,l,A){return Pn.H.useActionState(n,l,A)};Nt.useCallback=function(n,l){return Pn.H.useCallback(n,l)};Nt.useContext=function(n){return Pn.H.useContext(n)};Nt.useDebugValue=function(){};Nt.useDeferredValue=function(n,l){return Pn.H.useDeferredValue(n,l)};Nt.useEffect=function(n,l){return Pn.H.useEffect(n,l)};Nt.useEffectEvent=function(n){return Pn.H.useEffectEvent(n)};Nt.useId=function(){return Pn.H.useId()};Nt.useImperativeHandle=function(n,l,A){return Pn.H.useImperativeHandle(n,l,A)};Nt.useInsertionEffect=function(n,l){return Pn.H.useInsertionEffect(n,l)};Nt.useLayoutEffect=function(n,l){return Pn.H.useLayoutEffect(n,l)};Nt.useMemo=function(n,l){return Pn.H.useMemo(n,l)};Nt.useOptimistic=function(n,l){return Pn.H.useOptimistic(n,l)};Nt.useReducer=function(n,l,A){return Pn.H.useReducer(n,l,A)};Nt.useRef=function(n){return Pn.H.useRef(n)};Nt.useState=function(n){return Pn.H.useState(n)};Nt.useSyncExternalStore=function(n,l,A){return Pn.H.useSyncExternalStore(n,l,A)};Nt.useTransition=function(){return Pn.H.useTransition()};Nt.version="19.3.0"});var BN=Fo((Qt,fy)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(D,K){Object.defineProperty(c.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",K[0],K[1])}})}function l(D){return D===null||typeof D!="object"?null:(D=ko&&D[ko]||D["@@iterator"],typeof D=="function"?D:null)}function A(D,K){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var pe=D+"."+K;Lt[pe]||(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.",K,D),Lt[pe]=!0)}function c(D,K,pe){this.props=D,this.context=K,this.refs=ro,this.updater=pe||Jn}function d(){}function p(D,K,pe){this.props=D,this.context=K,this.refs=ro,this.updater=pe||Jn}function h(){}function B(D){return""+D}function I(D){try{B(D);var K=!1}catch{K=!0}if(K){K=console;var pe=K.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return pe.call(K,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),B(D)}}function Q(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===Ot?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case yt:return"Fragment";case Ue:return"Profiler";case te:return"StrictMode";case vt:return"Suspense";case Ke:return"SuspenseList";case ot:return"Activity";case Mt:return"ViewTransition"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case Et:return"Portal";case Je:return D.displayName||"Context";case fe:return(D._context.displayName||"Context")+".Consumer";case St:var K=D.render;return D=D.displayName,D||(D=K.displayName||K.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case be:return K=D.displayName||null,K!==null?K:Q(D.type)||"Memo";case Jt:K=D._payload,D=D._init;try{return Q(D(K))}catch{}}return null}function b(D){if(D===yt)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===Jt)return"<...>";try{var K=Q(D);return K?"<"+K+">":"<...>"}catch{return"<...>"}}function U(){var D=Xe.A;return D===null?null:D.getOwner()}function T(){return Error("react-stack-top-frame")}function x(D){if(Hn.call(D,"key")){var K=Object.getOwnPropertyDescriptor(D,"key").get;if(K&&K.isReactWarning)return!1}return D.key!==void 0}function O(D,K){function pe(){so||(so=!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)",K))}pe.isReactWarning=!0,Object.defineProperty(D,"key",{get:pe,configurable:!0})}function k(){var D=Q(this.type);return dt[D]||(dt[D]=!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.")),D=this.props.ref,D!==void 0?D:null}function Y(D,K,pe,H,ee,et){var Ne=pe.ref;return D={$$typeof:De,type:D,key:K,props:pe,_owner:H},(Ne!==void 0?Ne:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:k}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function j(D,K){return K=Y(D.type,K,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(K._store.validated=D._store.validated),K}function Se(D){_e(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===Jt&&(D._payload.status==="fulfilled"?_e(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function _e(D){return typeof D=="object"&&D!==null&&D.$$typeof===De}function ke(D){var K={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(pe){return K[pe]})}function He(D,K){return typeof D=="object"&&D!==null&&D.key!=null?(I(D.key),ke(""+D.key)):K.toString(36)}function Ze(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(h,h):(D.status="pending",D.then(function(K){D.status==="pending"&&(D.status="fulfilled",D.value=K)},function(K){D.status==="pending"&&(D.status="rejected",D.reason=K)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function we(D,K,pe,H,ee){var et=typeof D;(et==="undefined"||et==="boolean")&&(D=null);var Ne=!1;if(D===null)Ne=!0;else switch(et){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(D.$$typeof){case De:case Et:Ne=!0;break;case Jt:return Ne=D._init,we(Ne(D._payload),K,pe,H,ee)}}if(Ne){Ne=D,ee=ee(Ne);var he=H===""?"."+He(Ne,0):H;return Yt(ee)?(pe="",he!=null&&(pe=he.replace(qo,"$&/")+"/"),we(ee,K,pe,"",function(Gn){return Gn})):ee!=null&&(_e(ee)&&(ee.key!=null&&(Ne&&Ne.key===ee.key||I(ee.key)),pe=j(ee,pe+(ee.key==null||Ne&&Ne.key===ee.key?"":(""+ee.key).replace(qo,"$&/")+"/")+he),H!==""&&Ne!=null&&_e(Ne)&&Ne.key==null&&Ne._store&&!Ne._store.validated&&(pe._store.validated=2),ee=pe),K.push(ee)),1}if(Ne=0,he=H===""?".":H+":",Yt(D))for(var ze=0;ze<D.length;ze++)H=D[ze],et=he+He(H,ze),Ne+=we(H,K,pe,et,ee);else if(ze=l(D),typeof ze=="function")for(ze===D.entries&&(sa||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),sa=!0),D=ze.call(D),ze=0;!(H=D.next()).done;)H=H.value,et=he+He(H,ze++),Ne+=we(H,K,pe,et,ee);else if(et==="object"){if(typeof D.then=="function")return we(Ze(D),K,pe,H,ee);throw K=String(D),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function Oe(D,K,pe){if(D==null)return D;var H=[],ee=0;return we(D,H,"","",function(et){return K.call(pe,et,ee++)}),H}function ve(D){if(D._status===-1){var K=null,pe=null,H=D._ioInfo;H!=null&&(H.start=H.end=performance.now(),H.value=new Promise(function(Ne,he){K=Ne,pe=he})),H=D._result;var ee=H();if(ee.then(function(Ne){if(D._status===0||D._status===-1){D._status=1,D._result=Ne;var he=D._ioInfo;if(he!=null){he.end=performance.now();var ze=Ne?.default;K(ze),he.value.status="fulfilled",he.value.value=ze}ee.status===void 0&&(ee.status="fulfilled",ee.value=Ne)}},function(Ne){if(D._status===0||D._status===-1){D._status=2,D._result=Ne;var he=D._ioInfo;he!=null&&(he.end=performance.now(),he.value.then(h,h),pe(Ne),he.value.status="rejected",he.value.reason=Ne),ee.status===void 0&&(ee.status="rejected",ee.reason=Ne)}}),H=D._ioInfo,H!=null){var et=ee.displayName;typeof et=="string"&&(H.name=et)}D._status===-1&&(D._status=0,D._result=ee)}if(D._status===1)return H=D._result,H===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
3
|
+
import{$ as di,$a as Kf,A as mR,Aa as OR,Ab as Ih,B as pR,Ba as tA,Bb as FQ,C as ER,Ca as HR,Cb as m2,D as zf,Da as GR,Db as p2,E as ui,Ea as kR,Eb as qQ,F as Bt,Fa as Qs,Fb as VQ,G as en,Ga as pm,Gb as E2,H as Aa,Ha as LR,Hb as h2,I as yn,Ia as zR,Ib as C2,J as xI,Ja as jR,Jb as Vf,K as Ua,Ka as JR,Kb as qI,L as _I,La as KR,Lb as B2,M as qn,Ma as zI,Mb as XQ,N as hR,Na as YR,Nb as I2,O as CR,Oa as FR,Ob as y2,P as Eh,Pa as Em,Pb as Q2,Q as dm,Qa as En,Qb as S2,R as BR,Ra as jQ,S as hh,Sa as bo,T as jf,Ta as jI,Tb as v2,U as Jf,Ua as Kc,Ub as D2,V as UI,Va as ZR,W as MI,Wa as JQ,X as kQ,Xa as PR,Y as IR,Ya as WR,Z as gm,Za as $R,_ as fi,_a as nA,a as rR,aa as at,ab as e2,b as S,ba as yR,bb as t2,c as wI,ca as QR,cb as JI,d as sR,da as HA,db as vr,e as eA,ea as OI,eb as Yf,f as kf,fa as LQ,fb as KQ,g as Lf,ga as HI,gb as Ff,h as ph,ha as zQ,hb as Bh,i as cR,ia as SR,ib as YQ,j as uR,ja as vR,jb as n2,k as jc,ka as DR,kb as o2,l as um,la as bl,lb as a2,m as MA,ma as Ch,mb as i2,n as GQ,na as RR,nb as l2,o as bI,oa as TR,ob as A2,p as Nl,pa as NR,pb as r2,q as fR,qa as GI,qb as s2,r as fn,ra as mm,rb as c2,s as Sr,sa as wR,sb as u2,t as ys,ta as kI,tb as f2,u as dR,ua as LI,ub as KI,v as fm,va as bR,vb as YI,w as OA,wa as xR,wb as qf,x as gR,xa as _R,xb as d2,y as wl,ya as UR,yb as FI,z as Jc,za as MR,zb as g2}from"./chunk-W66JQVU6.js";import{a as qR,c as VR,d as XR}from"./chunk-42IVF3YT.js";import{a as HQ,b as Fo,c as fU,d as st}from"./chunk-6EA4DGCY.js";var lN=Fo(cy=>{"use strict";var wO=Symbol.for("react.transitional.element"),bO=Symbol.for("react.fragment");function iN(n,l,A){var c=null;if(A!==void 0&&(c=""+A),l.key!==void 0&&(c=""+l.key),"key"in l){A={};for(var d in l)d!=="key"&&(A[d]=l[d])}else A=l;return l=A.ref,{$$typeof:wO,type:n,key:c,ref:l!==void 0?l:null,props:A}}cy.Fragment=bO;cy.jsx=iN;cy.jsxs=iN});var CN=Fo(Nt=>{"use strict";var IS=Symbol.for("react.transitional.element"),xO=Symbol.for("react.portal"),_O=Symbol.for("react.fragment"),UO=Symbol.for("react.strict_mode"),MO=Symbol.for("react.profiler"),OO=Symbol.for("react.consumer"),HO=Symbol.for("react.context"),GO=Symbol.for("react.forward_ref"),kO=Symbol.for("react.suspense"),LO=Symbol.for("react.memo"),uN=Symbol.for("react.lazy"),zO=Symbol.for("react.activity"),jO=Symbol.for("react.view_transition"),AN=Symbol.iterator;function JO(n){return n===null||typeof n!="object"?null:(n=AN&&n[AN]||n["@@iterator"],typeof n=="function"?n:null)}var fN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dN=Object.assign,gN={};function vm(n,l,A){this.props=n,this.context=l,this.refs=gN,this.updater=A||fN}vm.prototype.isReactComponent={};vm.prototype.setState=function(n,l){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,l,"setState")};vm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function mN(){}mN.prototype=vm.prototype;function yS(n,l,A){this.props=n,this.context=l,this.refs=gN,this.updater=A||fN}var QS=yS.prototype=new mN;QS.constructor=yS;dN(QS,vm.prototype);QS.isPureReactComponent=!0;var rN=Array.isArray;function BS(){}var Pn={H:null,A:null,T:null,S:null},pN=Object.prototype.hasOwnProperty;function SS(n,l,A){var c=A.ref;return{$$typeof:IS,type:n,key:l,ref:c!==void 0?c:null,props:A}}function KO(n,l){return SS(n.type,l,n.props)}function vS(n){return typeof n=="object"&&n!==null&&n.$$typeof===IS}function YO(n){var l={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return l[A]})}var sN=/\/+/g;function CS(n,l){return typeof n=="object"&&n!==null&&n.key!=null?YO(""+n.key):l.toString(36)}function FO(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(BS,BS):(n.status="pending",n.then(function(l){n.status==="pending"&&(n.status="fulfilled",n.value=l)},function(l){n.status==="pending"&&(n.status="rejected",n.reason=l)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Sm(n,l,A,c,d){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var h=!1;if(n===null)h=!0;else switch(p){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case IS:case xO:h=!0;break;case uN:return h=n._init,Sm(h(n._payload),l,A,c,d)}}if(h)return d=d(n),h=c===""?"."+CS(n,0):c,rN(d)?(A="",h!=null&&(A=h.replace(sN,"$&/")+"/"),Sm(d,l,A,"",function(Q){return Q})):d!=null&&(vS(d)&&(d=KO(d,A+(d.key==null||n&&n.key===d.key?"":(""+d.key).replace(sN,"$&/")+"/")+h)),l.push(d)),1;h=0;var B=c===""?".":c+":";if(rN(n))for(var I=0;I<n.length;I++)c=n[I],p=B+CS(c,I),h+=Sm(c,l,A,p,d);else if(I=JO(n),typeof I=="function")for(n=I.call(n),I=0;!(c=n.next()).done;)c=c.value,p=B+CS(c,I++),h+=Sm(c,l,A,p,d);else if(p==="object"){if(typeof n.then=="function")return Sm(FO(n),l,A,c,d);throw l=String(n),Error("Objects are not valid as a React child (found: "+(l==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":l)+"). If you meant to render a collection of children, use an array instead.")}return h}function uy(n,l,A){if(n==null)return n;var c=[],d=0;return Sm(n,c,"","",function(p){return l.call(A,p,d++)}),c}function qO(n){if(n._status===-1){var l=n._result,A=l();A.then(function(c){(n._status===0||n._status===-1)&&(n._status=1,n._result=c,A.status===void 0&&(A.status="fulfilled",A.value=c))},function(c){(n._status===0||n._status===-1)&&(n._status=2,n._result=c,A.status===void 0&&(A.status="rejected",A.reason=c))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var cN=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=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(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function EN(n){var l=Pn.T,A={};A.types=l!==null?l.types:null,Pn.T=A;try{var c=n(),d=Pn.S;d!==null&&d(A,c),typeof c=="object"&&c!==null&&typeof c.then=="function"&&c.then(BS,cN)}catch(p){cN(p)}finally{l!==null&&A.types!==null&&(l.types=A.types),Pn.T=l}}function hN(n){var l=Pn.T;if(l!==null){var A=l.types;A===null?l.types=[n]:A.indexOf(n)===-1&&A.push(n)}else EN(hN.bind(null,n))}var VO={map:uy,forEach:function(n,l,A){uy(n,function(){l.apply(this,arguments)},A)},count:function(n){var l=0;return uy(n,function(){l++}),l},toArray:function(n){return uy(n,function(l){return l})||[]},only:function(n){if(!vS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Nt.Activity=zO;Nt.Children=VO;Nt.Component=vm;Nt.Fragment=_O;Nt.Profiler=MO;Nt.PureComponent=yS;Nt.StrictMode=UO;Nt.Suspense=kO;Nt.ViewTransition=jO;Nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pn;Nt.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Pn.H.useMemoCache(n)}};Nt.addTransitionType=hN;Nt.cache=function(n){return function(){return n.apply(null,arguments)}};Nt.cacheSignal=function(){return null};Nt.cloneElement=function(n,l,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var c=dN({},n.props),d=n.key;if(l!=null)for(p in l.key!==void 0&&(d=""+l.key),l)!pN.call(l,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&l.ref===void 0||(c[p]=l[p]);var p=arguments.length-2;if(p===1)c.children=A;else if(1<p){for(var h=Array(p),B=0;B<p;B++)h[B]=arguments[B+2];c.children=h}return SS(n.type,d,c)};Nt.createContext=function(n){return n={$$typeof:HO,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:OO,_context:n},n};Nt.createElement=function(n,l,A){var c,d={},p=null;if(l!=null)for(c in l.key!==void 0&&(p=""+l.key),l)pN.call(l,c)&&c!=="key"&&c!=="__self"&&c!=="__source"&&(d[c]=l[c]);var h=arguments.length-2;if(h===1)d.children=A;else if(1<h){for(var B=Array(h),I=0;I<h;I++)B[I]=arguments[I+2];d.children=B}if(n&&n.defaultProps)for(c in h=n.defaultProps,h)d[c]===void 0&&(d[c]=h[c]);return SS(n,p,d)};Nt.createRef=function(){return{current:null}};Nt.forwardRef=function(n){return{$$typeof:GO,render:n}};Nt.isValidElement=vS;Nt.lazy=function(n){return{$$typeof:uN,_payload:{_status:-1,_result:n},_init:qO}};Nt.memo=function(n,l){return{$$typeof:LO,type:n,compare:l===void 0?null:l}};Nt.startTransition=EN;Nt.unstable_useCacheRefresh=function(){return Pn.H.useCacheRefresh()};Nt.use=function(n){return Pn.H.use(n)};Nt.useActionState=function(n,l,A){return Pn.H.useActionState(n,l,A)};Nt.useCallback=function(n,l){return Pn.H.useCallback(n,l)};Nt.useContext=function(n){return Pn.H.useContext(n)};Nt.useDebugValue=function(){};Nt.useDeferredValue=function(n,l){return Pn.H.useDeferredValue(n,l)};Nt.useEffect=function(n,l){return Pn.H.useEffect(n,l)};Nt.useEffectEvent=function(n){return Pn.H.useEffectEvent(n)};Nt.useId=function(){return Pn.H.useId()};Nt.useImperativeHandle=function(n,l,A){return Pn.H.useImperativeHandle(n,l,A)};Nt.useInsertionEffect=function(n,l){return Pn.H.useInsertionEffect(n,l)};Nt.useLayoutEffect=function(n,l){return Pn.H.useLayoutEffect(n,l)};Nt.useMemo=function(n,l){return Pn.H.useMemo(n,l)};Nt.useOptimistic=function(n,l){return Pn.H.useOptimistic(n,l)};Nt.useReducer=function(n,l,A){return Pn.H.useReducer(n,l,A)};Nt.useRef=function(n){return Pn.H.useRef(n)};Nt.useState=function(n){return Pn.H.useState(n)};Nt.useSyncExternalStore=function(n,l,A){return Pn.H.useSyncExternalStore(n,l,A)};Nt.useTransition=function(){return Pn.H.useTransition()};Nt.version="19.3.0"});var BN=Fo((Qt,fy)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(D,K){Object.defineProperty(c.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",K[0],K[1])}})}function l(D){return D===null||typeof D!="object"?null:(D=ko&&D[ko]||D["@@iterator"],typeof D=="function"?D:null)}function A(D,K){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var pe=D+"."+K;Lt[pe]||(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.",K,D),Lt[pe]=!0)}function c(D,K,pe){this.props=D,this.context=K,this.refs=ro,this.updater=pe||Jn}function d(){}function p(D,K,pe){this.props=D,this.context=K,this.refs=ro,this.updater=pe||Jn}function h(){}function B(D){return""+D}function I(D){try{B(D);var K=!1}catch{K=!0}if(K){K=console;var pe=K.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return pe.call(K,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),B(D)}}function Q(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===Ot?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case yt:return"Fragment";case Ue:return"Profiler";case te:return"StrictMode";case vt:return"Suspense";case Ke:return"SuspenseList";case ot:return"Activity";case Mt:return"ViewTransition"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case Et:return"Portal";case Je:return D.displayName||"Context";case fe:return(D._context.displayName||"Context")+".Consumer";case St:var K=D.render;return D=D.displayName,D||(D=K.displayName||K.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case be:return K=D.displayName||null,K!==null?K:Q(D.type)||"Memo";case Jt:K=D._payload,D=D._init;try{return Q(D(K))}catch{}}return null}function b(D){if(D===yt)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===Jt)return"<...>";try{var K=Q(D);return K?"<"+K+">":"<...>"}catch{return"<...>"}}function U(){var D=Xe.A;return D===null?null:D.getOwner()}function T(){return Error("react-stack-top-frame")}function x(D){if(Hn.call(D,"key")){var K=Object.getOwnPropertyDescriptor(D,"key").get;if(K&&K.isReactWarning)return!1}return D.key!==void 0}function O(D,K){function pe(){so||(so=!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)",K))}pe.isReactWarning=!0,Object.defineProperty(D,"key",{get:pe,configurable:!0})}function k(){var D=Q(this.type);return dt[D]||(dt[D]=!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.")),D=this.props.ref,D!==void 0?D:null}function Y(D,K,pe,H,ee,et){var Ne=pe.ref;return D={$$typeof:De,type:D,key:K,props:pe,_owner:H},(Ne!==void 0?Ne:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:k}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:et}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function j(D,K){return K=Y(D.type,K,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(K._store.validated=D._store.validated),K}function Se(D){_e(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===Jt&&(D._payload.status==="fulfilled"?_e(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function _e(D){return typeof D=="object"&&D!==null&&D.$$typeof===De}function ke(D){var K={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(pe){return K[pe]})}function He(D,K){return typeof D=="object"&&D!==null&&D.key!=null?(I(D.key),ke(""+D.key)):K.toString(36)}function Ze(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(h,h):(D.status="pending",D.then(function(K){D.status==="pending"&&(D.status="fulfilled",D.value=K)},function(K){D.status==="pending"&&(D.status="rejected",D.reason=K)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function we(D,K,pe,H,ee){var et=typeof D;(et==="undefined"||et==="boolean")&&(D=null);var Ne=!1;if(D===null)Ne=!0;else switch(et){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(D.$$typeof){case De:case Et:Ne=!0;break;case Jt:return Ne=D._init,we(Ne(D._payload),K,pe,H,ee)}}if(Ne){Ne=D,ee=ee(Ne);var he=H===""?"."+He(Ne,0):H;return Yt(ee)?(pe="",he!=null&&(pe=he.replace(qo,"$&/")+"/"),we(ee,K,pe,"",function(Gn){return Gn})):ee!=null&&(_e(ee)&&(ee.key!=null&&(Ne&&Ne.key===ee.key||I(ee.key)),pe=j(ee,pe+(ee.key==null||Ne&&Ne.key===ee.key?"":(""+ee.key).replace(qo,"$&/")+"/")+he),H!==""&&Ne!=null&&_e(Ne)&&Ne.key==null&&Ne._store&&!Ne._store.validated&&(pe._store.validated=2),ee=pe),K.push(ee)),1}if(Ne=0,he=H===""?".":H+":",Yt(D))for(var ze=0;ze<D.length;ze++)H=D[ze],et=he+He(H,ze),Ne+=we(H,K,pe,et,ee);else if(ze=l(D),typeof ze=="function")for(ze===D.entries&&(sa||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),sa=!0),D=ze.call(D),ze=0;!(H=D.next()).done;)H=H.value,et=he+He(H,ze++),Ne+=we(H,K,pe,et,ee);else if(et==="object"){if(typeof D.then=="function")return we(Ze(D),K,pe,H,ee);throw K=String(D),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function Oe(D,K,pe){if(D==null)return D;var H=[],ee=0;return we(D,H,"","",function(et){return K.call(pe,et,ee++)}),H}function ve(D){if(D._status===-1){var K=null,pe=null,H=D._ioInfo;H!=null&&(H.start=H.end=performance.now(),H.value=new Promise(function(Ne,he){K=Ne,pe=he})),H=D._result;var ee=H();if(ee.then(function(Ne){if(D._status===0||D._status===-1){D._status=1,D._result=Ne;var he=D._ioInfo;if(he!=null){he.end=performance.now();var ze=Ne?.default;K(ze),he.value.status="fulfilled",he.value.value=ze}ee.status===void 0&&(ee.status="fulfilled",ee.value=Ne)}},function(Ne){if(D._status===0||D._status===-1){D._status=2,D._result=Ne;var he=D._ioInfo;he!=null&&(he.end=performance.now(),he.value.then(h,h),pe(Ne),he.value.status="rejected",he.value.reason=Ne),ee.status===void 0&&(ee.status="rejected",ee.reason=Ne)}}),H=D._ioInfo,H!=null){var et=ee.displayName;typeof et=="string"&&(H.name=et)}D._status===-1&&(D._status=0,D._result=ee)}if(D._status===1)return H=D._result,H===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'))
|
|
@@ -567,7 +567,7 @@ Available templates:`));for(let[p,h]of Object.entries(ny))console.log(` ${S.cya
|
|
|
567
567
|
`,0),at(`Source: ${A.bundledPath?"bundled TDK example":A.repo}`,0),at(`Destination: ${d}
|
|
568
568
|
`,0);try{if(A.bundledPath){let p=oy(HM(GM(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");_M(oy(p,A.bundledPath),d,{recursive:!0});let h=OM(d).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=Qm(d,B),Q=iS(I,"utf-8");MM(I,Q.replaceAll("tdk_example",h))}}else xM("git",["clone",A.repo,d],{stdio:"inherit"})}catch{Ua(A.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(S.green(`
|
|
569
569
|
\u2705 Cloned "${n}" into ${c}/`)),at(`
|
|
570
|
-
Next steps:`,0),at(`1. cd ${c}`),at("2. tdk doctor # check Docker/Tilt are ready"),at("3. tdk up # start the stack")}var Rh={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:zM()},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:{}},fT=new kM("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(ny).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,l)=>{let{assertMachineReadyOrExit:A}=await import("./cold-preflight-
|
|
570
|
+
Next steps:`,0),at(`1. cd ${c}`),at("2. tdk doctor # check Docker/Tilt are ready"),at("3. tdk up # start the stack")}var Rh={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:zM()},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:{}},fT=new kM("project").description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(ny).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,l)=>{let{assertMachineReadyOrExit:A}=await import("./cold-preflight-6WRQUFZ6.js");if(await A(),n){await yn(async()=>jM(n,l.path));return}await yn(async()=>{let c=fn();c||(c=cT(),di(`\u{1F680} Initializing new TDK project...
|
|
571
571
|
`),at(`Location: ${c}
|
|
572
572
|
`,0));let d=Qm(c,".tdk"),p=Qm(d,jc);if(l.check){let x=MA.every(k=>Yc(Qm(c,".tdk",".tdk-out",k))),O=Yc(p);if(x&&O){let k=nA(c);fi("Project configuration is valid"),at(`Project: ${k.project.name}`,3),at(`Phases: ${Object.keys(k.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(S.yellow("\u26A0\uFE0F Project configuration incomplete:")),O||at(".tdk/project.json (not found)",3),!x)for(let k of MA.filter(Y=>!Yc(Qm(c,".tdk/.tdk-out",Y))))at(`.tdk/.tdk-out/${k} (not found)`,3);at("Run `tdk project` to create them."),process.exit(1)}}Jf("Project Configuration"),at(`Project root: ${c}
|
|
573
573
|
`,0),Yc(d)||(ZR(d),fi("Created: .tdk/ directory"));let h=Yc(p);if(h&&!l.force){fi(".tdk/project.json exists");let x=JSON.parse(iS(p,"utf-8")),O=nA(c),k=lS(c),Y=AS(O,k);if((Y.length>0||!x.phases)&&Kc(p,O),Y.length>0&&at(`Auto-enabled discovered service stacks: ${Y.join(", ")}`,0),di(`
|
|
@@ -1589,7 +1589,7 @@ datasource db {
|
|
|
1589
1589
|
url: process.env.DATABASE_URL,
|
|
1590
1590
|
},
|
|
1591
1591
|
};
|
|
1592
|
-
`;function cO(n,l){let A=wh(n,l),c=Th(n,l);return{...JT,compilerOptions:{...JT.compilerOptions,...n==="frontend"?{}:{types:["node"]},...A?.compilerOptions??{},...c?.compilerOptions??{}}}}var JT={compilerOptions:{target:"ES2022",module:"ESNext",moduleResolution:"bundler",strict:!0,esModuleInterop:!0,skipLibCheck:!0,forceConsistentCasingInFileNames:!0,outDir:"./dist",rootDir:"./src",declaration:!0,declarationMap:!0,sourceMap:!0},include:["src/**/*"],exclude:["node_modules","dist"]};function uO(n){let l=n==="byo"?eA:n,A=[...x2,"sdk"];if(!A.includes(l))throw new Bt(`Unknown resource type "${n}". Supported types: ${A.join(", ")}.`,[`Use one of: ${A.join(", ")}`,"Omit --type to create a backend"]);return l}var YT=new iO("resource").description("Create a new resource (service) from scratch, or register an existing one").argument("[name]","Resource name (kebab-case)").option("-t, --type <type>","Resource type: backend, frontend, worker, mcp, agent, bring-your-own, sdk","backend").option("--framework <id>","Framework: frontend react (default), vue, svelte, preact, lit, solid, qwik, vanilla, tanstack-router (see --frameworks); backend hono (default), express, elysia, fastify, nestjs, koa, h3").option("--frameworks","List registered frontend frameworks and exit").option("--language <id>","Backend language: bun (default), python, go, rust").option("-s, --stack <stack>","Stack to assign resource to","default").option("-p, --path <path>","Custom path for resource directory").option("--resource-path <path>","Alias for --path (for backward compatibility)").option("--register-existing","Register an existing resource without creating templates").option("-y, --yes","Run without prompts; use defaults",!1).option("--ddd","Scaffold DDD (domain-driven design) folders + path aliases (Premium - requires TDK_LICENSE_KEY)").option("--dockerfile <path>","Path to Dockerfile relative to resource dir (for bring-your-own)").option("--health-path <path>","HTTP health check path (for bring-your-own)","/health").option("--no-proxy","Disable the Traefik route (bring-your-own only)").option("--restart <policy>","Compose restart policy: no, on-failure, unless-stopped, always (bring-your-own only; use no for one-shot jobs)").option("--image <name>","Docker image name instead of building from Dockerfile (for bring-your-own)").option("--port <port>","Port for the resource, within its type's range (default: next free port in that range)").option("--feature <feature...>","Enable a resource feature (for example: prisma)").option("--runtime <id>","Agent runtime (for agent only): custom (default)").option("--durability <kind>","Where agent sessions are checkpointed (for agent only): files (default, named volume) or postgres").action(async(n,l)=>{if(l.frameworks){for(let A of sS())console.log(`${A.id} ${A.label} ${A.kind} ${A.verified?"verified":"unverified"} ${A.command}`);return}await yn(async()=>{let A=Aa(),c=l.resourcePath||l.path;Jf("Resource Creation");let d=tA(),p=n;if(!p&&l.yes)throw new Bt("A resource name is required when using --yes.",["Pass the name explicitly, for example: tdk resource api --yes."]);p?Xf(NR(p)):p=await vr({message:"Resource name (kebab-case):",validate:Ie=>{let De=mm("resource")(Ie);return De===!0||De}});let h=uO(l.type);if(h!=="agent"&&(l.runtime!==void 0||l.durability!==void 0))throw new Bt("--runtime and --durability can only be used with --type agent.",["Drop --runtime and --durability, or pass --type agent"]);let B;h==="agent"&&(iy(l.runtime),B={runtime:l.runtime??ay,durability:hT(l.durability)});let I=l.framework;h==="frontend"&&I===void 0&&!l.yes&&process.stdin.isTTY&&(I=await KQ({message:"Frontend framework:",choices:sS().map(Be=>({title:Be.label,value:Be.id})).sort((Be,Ie)=>Be.value===Nh?-1:Ie.value===Nh?1:0)}));let Q=wh(h,I,p),b=YQ(h,l.language),U=Th(h,I,b),T=h==="mcp"||h==="agent"?void 0:Q?.id??U?.id,x=!1;if(l.ddd)if(h!=="backend"&&h!=="worker")console.log(S.yellow(`
|
|
1592
|
+
`;function cO(n,l){let A=wh(n,l),c=Th(n,l);return{...JT,compilerOptions:{...JT.compilerOptions,...n==="frontend"?{}:{types:["node"]},...A?.compilerOptions??{},...c?.compilerOptions??{}}}}var JT={compilerOptions:{target:"ES2022",module:"ESNext",moduleResolution:"bundler",strict:!0,esModuleInterop:!0,skipLibCheck:!0,forceConsistentCasingInFileNames:!0,outDir:"./dist",rootDir:"./src",declaration:!0,declarationMap:!0,sourceMap:!0},include:["src/**/*"],exclude:["node_modules","dist"]};function uO(n){let l=n==="byo"?eA:n,A=[...x2,"sdk"];if(!A.includes(l))throw new Bt(`Unknown resource type "${n}". Supported types: ${A.join(", ")}.`,[`Use one of: ${A.join(", ")}`,"Omit --type to create a backend"]);return l}var YT=new iO("resource").description("Create a new resource (service) from scratch, or register an existing one").argument("[name]","Resource name (kebab-case)").option("-t, --type <type>","Resource type: backend, frontend, worker, mcp, agent, bring-your-own, sdk","backend").option("--framework <id>","Framework: frontend react (default), vue, svelte, preact, lit, solid, qwik, vanilla, tanstack-router (see --frameworks); backend hono (default), express, elysia, fastify, nestjs, koa, h3").option("--frameworks","List registered frontend frameworks and exit").option("--language <id>","Backend language: bun (default), python, go, rust, node").option("-s, --stack <stack>","Stack to assign resource to","default").option("-p, --path <path>","Custom path for resource directory").option("--resource-path <path>","Alias for --path (for backward compatibility)").option("--register-existing","Register an existing resource without creating templates").option("-y, --yes","Run without prompts; use defaults",!1).option("--ddd","Scaffold DDD (domain-driven design) folders + path aliases (Premium - requires TDK_LICENSE_KEY)").option("--dockerfile <path>","Path to Dockerfile relative to resource dir (for bring-your-own)").option("--health-path <path>","HTTP health check path (for bring-your-own)","/health").option("--no-proxy","Disable the Traefik route (bring-your-own only)").option("--restart <policy>","Compose restart policy: no, on-failure, unless-stopped, always (bring-your-own only; use no for one-shot jobs)").option("--image <name>","Docker image name instead of building from Dockerfile (for bring-your-own)").option("--port <port>","Port for the resource, within its type's range (default: next free port in that range)").option("--feature <feature...>","Enable a resource feature (for example: prisma)").option("--runtime <id>","Agent runtime (for agent only): custom (default)").option("--durability <kind>","Where agent sessions are checkpointed (for agent only): files (default, named volume) or postgres").action(async(n,l)=>{if(l.frameworks){for(let A of sS())console.log(`${A.id} ${A.label} ${A.kind} ${A.verified?"verified":"unverified"} ${A.command}`);return}await yn(async()=>{let A=Aa(),c=l.resourcePath||l.path;Jf("Resource Creation");let d=tA(),p=n;if(!p&&l.yes)throw new Bt("A resource name is required when using --yes.",["Pass the name explicitly, for example: tdk resource api --yes."]);p?Xf(NR(p)):p=await vr({message:"Resource name (kebab-case):",validate:Ie=>{let De=mm("resource")(Ie);return De===!0||De}});let h=uO(l.type);if(h!=="agent"&&(l.runtime!==void 0||l.durability!==void 0))throw new Bt("--runtime and --durability can only be used with --type agent.",["Drop --runtime and --durability, or pass --type agent"]);let B;h==="agent"&&(iy(l.runtime),B={runtime:l.runtime??ay,durability:hT(l.durability)});let I=l.framework;h==="frontend"&&I===void 0&&!l.yes&&process.stdin.isTTY&&(I=await KQ({message:"Frontend framework:",choices:sS().map(Be=>({title:Be.label,value:Be.id})).sort((Be,Ie)=>Be.value===Nh?-1:Ie.value===Nh?1:0)}));let Q=wh(h,I,p),b=YQ(h,l.language),U=Th(h,I,b),T=h==="mcp"||h==="agent"?void 0:Q?.id??U?.id,x=!1;if(l.ddd)if(h!=="backend"&&h!=="worker")console.log(S.yellow(`
|
|
1593
1593
|
\u26A0\uFE0F --ddd only applies to backend/worker resources, ignoring for type "${h}"`));else{if(!await XR(A))throw new Error("DDD scaffolding is a Premium feature and requires a license key that grants it. Set export TDK_LICENSE_KEY=<key> (request a Premium license at https://tdk-landscape.github.io/tdk-website/#waitlist) and try again.");x=!0}Xf(GI(l.stack));let O=l.stack;if(O==="default"){let Be=d,Ie=new Set;for(let Et of Be)Et.stack&&Ie.add(Et.stack);let De=Array.from(Ie);if(De.length>0)if(l.yes){if(De.length>1)throw new Bt("Multiple stacks exist; specify --stack when using --yes.",[`Available stacks: ${De.join(", ")}`]);O=De[0]??"main"}else{let Et=await KQ({message:"Assign to stack:",choices:[...De.map(yt=>({title:yt,value:yt})),{title:"Create new stack",value:"__new__"}]});Et==="__new__"?O=await vr({message:"New stack name:",validate:te=>{let Ue=mm("stack")(te);return Ue===!0||Ue}}):O=Et}else l.yes?O="main":O=await vr({message:"Stack name (first resource):",initial:"main",validate:yt=>{let te=mm("stack")(yt);return te===!0||te}})}let k=c,Y;if(!k&&(k={backend:`services/${O}/${p}`,frontend:`apps/${p}`,worker:`workers/${p}`,mcp:`services/${O}/${p}`,agent:`services/${O}/${p}`,[eA]:`services/${O}/${p}`,sdk:`packages/${p}`}[h],h!=="sdk")){let Ie=f2(A,k,O,p);k=Ie.path,Y=Ie.adjustedFrom}let j=oA(A,k),Se=gS(A,j);(Se.startsWith("..")||HT(Se))&&en.invalidPath(j).exit(),LI(k)||en.invalidPath(k).exit();let _e=Ay(j),ke=Ay(oA(j,Lf));if(l.port!==void 0&&h==="sdk")throw new Bt("--port does not apply to --type sdk.",["Drop --port, or use a service type"]);if(h==="sdk"&&!ke)throw new Bt(`No service.json in ${k}`,['Add one with "appType": "sdk", then run this again to register it']);let He=l.registerExisting||h==="sdk"||_e&&ke;_e&&!He&&h!==eA&&en.directoryExists(j).exit();let Ze=h==="sdk"?0:AT(h,d);if(l.restart!==void 0){if(h!==eA)throw new Bt("--restart can only be used with --type bring-your-own.",["Add --type bring-your-own, or drop --restart"]);if(!GT.includes(l.restart))throw new Bt(`Unknown --restart policy "${l.restart}".`,[`Use one of: ${GT.join(", ")}`])}let we=h==="sdk"?0:AO(h,l.port,Ze,d);if(console.log(S.gray(`
|
|
1594
1594
|
Resource details:`)),console.log(S.gray(` Name: ${p}`)),console.log(S.gray(` Type: ${h}`)),console.log(S.gray(` Stack: ${O}`)),console.log(S.gray(` Port: ${we||"N/A (SDK)"}`)),console.log(S.gray(` Path: ${k}`)),He&&ke&&console.log(S.yellow(`
|
|
1595
1595
|
\u26A0\uFE0F Existing resource detected - will update service.json only`)),!(l.yes||await hm(He&&ke?`
|
|
@@ -1693,7 +1693,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
|
|
|
1693
1693
|
`)}`,B="Upgrade tdk to a version that supports these files. Changing schemaVersion by hand is not a fix";l.onInvalid?.(`${h}
|
|
1694
1694
|
Fix: ${B}`),console.error(S.red(`\u2717 ${h}`)),console.error(S.gray(` Fix: ${B}`)),A(1)}import{execFileSync as Hk}from"node:child_process";import{realpathSync as Gk}from"node:fs";import{resolve as kk}from"node:path";var Lk=(n,l)=>Hk(n,l,{encoding:"utf-8",stdio:"pipe",timeout:5e3,windowsHide:!0});function zk(n,l=process.platform,A=Lk){if(l==="win32")return null;try{let c=A("lsof",["-nP",`-iTCP:${n}`,"-sTCP:LISTEN","-t"]).split(/\r?\n/).map(d=>d.trim()).filter(Boolean);for(let d of c){let p=A("ps",["-p",d,"-o","command="]).trim(),[h]=i2(`${d} ${p}`);if(h)return h}}catch{}return null}function B_(n){try{return Gk(n)}catch{return kk(n)}}function jk(n,l){return n!==null&&B_(n.root)!==B_(l)}async function I_(n,l,A,c=zk){let d={running:[],foreign:[]};for(let p of n){if(!await A(p))continue;let h=c(p);h&&jk(h,l)?d.foreign.push({port:p,root:h.root}):d.running.push(p)}return d}import{execFileSync as Jk}from"node:child_process";var y_=(n,l)=>Jk(n,l,{encoding:"utf-8",stdio:"pipe",windowsHide:!0});function Kk(n,l=process.platform,A=y_){if(!Number.isInteger(n)||n<1||n>65535)return[];if(l==="win32"){let d=`$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 A("powershell.exe",["-NoProfile","-Command",d]).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 c;try{c=A("lsof",["-nP","-t",`-iTCP:${n}`,"-sTCP:LISTEN"]).split(/\s+/).map(Number).filter(d=>Number.isInteger(d)&&d>0)}catch(d){let p=d,h=p.stderr?.toString().trim();if(p?.status===1&&!h)return[];throw new Error(`Unable to inspect listeners on port ${n}. Install lsof or resolve the lsof error before using --force.`,{cause:p})}return c.filter(d=>{try{return A("ps",["-p",String(d),"-o","comm="]).trim().split(/[\\/]/).at(-1)==="tilt"}catch(p){throw new Error(`Unable to identify the process listening on port ${n}.`,{cause:p})}})}function E0(n,l=process.platform,A=y_){let c=Kk(n,l,A);for(let d of c)l==="win32"?A("taskkill.exe",["/PID",String(d),"/F"]):A("kill",["-TERM",String(d)]);return c}function Q_(n,l){let A=new Set(l.map(c=>c.name));return n.filter(c=>!A.has(c))}function S_(n,l){let A=new Map(l.map(p=>[p.name,p])),c=new Set,d=p=>{if(!(c.has(p)||!A.has(p))){c.add(p);for(let h of A.get(p)?.config?.dependsOn??[])d(h)}};for(let p of n)d(p);return{selected:l.filter(p=>c.has(p.name)),dependencies:l.map(p=>p.name).filter(p=>c.has(p)&&!n.includes(p))}}function D_(n,l=[]){return["TDK is up.",`Tilt UI: http://localhost:${n}`,"App URLs:",...l.length>0?l.slice(0,5).map(A=>` ${A}`):[" run: tdk networks"],"Stop: tdk down"]}function Vk(n,l){return n!=="win32"||l==="1"?null:"Landscape startup needs Ubuntu on WSL2. Native Windows is inspect-only."}async function Xk(n=r2(),l=Zk){return n.kind==="webcontainer"?l2:s2(n.kind)&&!await l()?A2:null}async function Zk(){let{execFile:n}=await import("node:child_process");return new Promise(l=>{n("docker",["ps"],{timeout:1e4},A=>l(!A))})}var Pk=2;function Wk(n){let l;try{({handEdited:l}=JI(n))}catch(A){if(A instanceof $R)return null;throw A}return l.length===0?null:["Generated files were edited by hand and no longer match service.json:",...l.map(A=>` ${A}`),"Run `tdk config regenerate` to discard the edits, or bypass with `tdk up --ignore-drift`."]}function $k(n,l,A=process.exit){if(l.ignoreDrift){console.warn(S.yellow("Warning: --ignore-drift set; generated files were not checked."));return}let c=Wk(n);if(c){l.onDrift?.(c.join(`
|
|
1695
1695
|
`));for(let d of c)console.error(S.red(d));A(Pk)}}function e5(n,l,A=Sr(),c=process.exit){if(l.ignoreVersion){console.warn(S.yellow("Warning: --ignore-version set; minTdkVersion was not checked."));return}let d=Q2(n,A);d.status==="none"||d.status==="ok"||(l.onFail?.(`${d.message}
|
|
1696
|
-
${d.fix}`),console.error(S.red(d.message)),console.error(S.red(d.fix)),c(1))}function t5(n,l=3e4){return new Promise(A=>{let c=Date.now()+l,d=()=>{let p=Fk({host:"127.0.0.1",port:n}),h=!1,B=I=>{h||(h=!0,p.destroy(),I||Date.now()>=c?A(I):setTimeout(d,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};d()})}var R_=new qk("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,l)=>{let A=l.json?$I("UP_FAILED","tdk up"):void 0;l.json&&(l.quiet=!0);let c=hS(process.env.TILT_PORT);c.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:c.message}]),Ua(c.message));let d=c.port,p=fn();p&&e5(p,{ignoreVersion:l.ignoreVersion,onFail:b=>A?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:b}])});let h=l.dryRun?null:await Xk();h&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:h}]),Ua(h));let B=Vk(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Ua(B);let I=fn();if(I&&C_(I,{onInvalid:b=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:b}])}),!l.dryRun){let{assertMachineReadyOrExit:b}=await import("./cold-preflight-
|
|
1696
|
+
${d.fix}`),console.error(S.red(d.message)),console.error(S.red(d.fix)),c(1))}function t5(n,l=3e4){return new Promise(A=>{let c=Date.now()+l,d=()=>{let p=Fk({host:"127.0.0.1",port:n}),h=!1,B=I=>{h||(h=!0,p.destroy(),I||Date.now()>=c?A(I):setTimeout(d,250))};p.once("connect",()=>B(!0)),p.once("error",()=>B(!1))};d()})}var R_=new qk("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,l)=>{let A=l.json?$I("UP_FAILED","tdk up"):void 0;l.json&&(l.quiet=!0);let c=hS(process.env.TILT_PORT);c.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:c.message}]),Ua(c.message));let d=c.port,p=fn();p&&e5(p,{ignoreVersion:l.ignoreVersion,onFail:b=>A?.({ok:!1},[{code:"TDK_VERSION_TOO_OLD",message:b}])});let h=l.dryRun?null:await Xk();h&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:h}]),Ua(h));let B=Vk(process.platform,process.env.TDK_ALLOW_NATIVE_WINDOWS);B&&Ua(B);let I=fn();if(I&&C_(I,{onInvalid:b=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:b}])}),!l.dryRun){let{assertMachineReadyOrExit:b}=await import("./cold-preflight-6WRQUFZ6.js");await b()}let Q=async()=>{let b=l.dryRun?Aa():fn(),U=b??process.cwd(),T=HR(),x,O=[];if((!l.only||n)&&(x=Qs(T),O=x.map(fe=>fe.name)),l.only){if(n&&!pm(n)){let St=en.stackNotFound(n,O);A?.({ok:!1},[jQ(St).error]),St.exit()}let fe=n?T.filter(St=>St.stack===n):T,Je=Q_(l.only,fe);if(Je.length>0){let St=fe.map(Ke=>Ke.name),vt=en.unknownServices(Je,St);A?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:vt.message,...vt.suggestions.length>0?{suggestions:vt.suggestions}:{}}]),vt.exit()}}b&&$k(b,{ignoreDrift:l.ignoreDrift,onDrift:fe=>A?.({ok:!1},[{code:"DRIFT_DETECTED",message:fe}])}),b&&y2(b,{onInvalid:fe=>A?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:fe}])}),b&&!A&&!l.quiet&&I2(b);let k=await Em(U,{inspectDocker:!l.dryRun});if(!l.dryRun){if(b){let St=Ih(U);St.length>0&&!l.quiet&&console.log(S.gray(`Added ${St.join(", ")} to .env (generated; existing values unchanged)`))}b&&!Yk(v_(U,".tdk",".tdk-out","Tiltfile"))&&(l.quiet||console.log(S.gray("No generated Tiltfile yet; generating .tdk/.tdk-out/ ...")),await Kf(U,{quiet:l.quiet}));let fe=t2(U);fe.length>0&&l.verbose&&!l.quiet&&console.log(S.gray(`Refreshed runtime assets: ${fe.join(", ")}`));let Je=uT(U);Je.length>0&&!l.quiet&&console.log(S.gray(`Added ${Je.join(", ")} to the pre_alpha phase in .tdk/project.json`))}let Y,j,Se=[];if(n){if(Y=T.filter(fe=>fe.stack===n),Y.length===0){let fe=en.stackNotFound(n,O);A?.({ok:!1},[jQ(fe).error]),fe.exit()}Se=Y.map(fe=>fe.name),j=`stack "${n}"`}else{Y=T;let fe=x??Qs(T);j=`all stacks (${qn(fe.length,"stack")}, ${qn(Y.length,"service")})`}let _e=[];if(l.only){let fe=S_(l.only,tA());Y=fe.selected,_e=fe.dependencies,Se=Y.map(Je=>Je.name),j=`${qn(l.only.length,"requested service")}${_e.length>0?` plus ${_e.join(", ")}`:""}`}l.verbose&&!l.quiet&&console.log(S.gray(`Found ${qn(Y.length,"service")} in ${j}`));let ke=Y.map(fe=>fe.name);if(!l.quiet){console.log(S.blue(`${l.dryRun?"Would start":"Starting"} ${qn(ke.length,"service")} from ${j}...`));for(let Ke of ke)console.log(S.gray(` - ${Ke}`));let{appBase:fe,apiBase:Je}=OI(k.ingressHttp),St=Y.filter(Ke=>Ke.config?.appType==="frontend"),vt=Y.filter(Ke=>HA(Ke.config?.appType));if(St.length>0){console.log(S.blue(`
|
|
1697
1697
|
\u{1F30D} Frontend URLs:`));for(let Ke of St){let be=Ke.config?.basePath??`/${Ke.name}`;console.log(S.gray(` - ${Ke.name}: ${fe}${S.cyan(LQ(be))}`))}}if(vt.length>0){console.log(S.blue(`
|
|
1698
1698
|
\u{1F527} Backend API URLs:`));for(let Ke of vt){let be=Ke.name.replace(/-api$/,""),Jt=Ke.config?.apiPath??`/api/${be}`,ot=Ke.config?.sablier,Mt=ot?.enable&&ot?.deferStart?S.dim(" (deferred \u2014 starts on first request)"):"";console.log(S.gray(` - ${Ke.name}: ${Je}${S.cyan(LQ(Jt))}${Mt}`))}}}let He=l.only??(n?[n]:void 0),Ze=pR(Se,{verbose:l.verbose,quiet:l.quiet,force:l.force,focusTargets:He}),we=He?`tilt up ${Ze.join(" ")}`:"tilt up";if(!l.quiet){console.log(S.blue(KR(k)));for(let fe of h_(k))console.log(S.yellow(fe));console.log(S.gray("Override with TDK_HTTP_PORT, TDK_HTTPS_PORT, or TDK_POSTGRES_PORT."))}if(A&&l.dryRun){A({ok:!0,dryRun:!0,stack:n??null,services:ke,...l.only?{requested:l.only,declaredDependencies:_e}:{},command:we});return}if(PI(l,"not starting services",we))return;FR(k),YR(U,k);let Oe=Nl.tiltUi,ve=d??Oe,Pe=l.only?[...new Set([Oe,ve])]:[ve],{running:ut,foreign:Ye}=await I_(Pe,U,async fe=>await Vf(fe)!==null);if(Ye.length>0&&d!==void 0){let fe=Ye[0],Je=`TILT_PORT=${fe?.port} is used by another project's Tilt (${fe?.root}). Choose a free port, or run tdk down in that project.`;A?.({ok:!1},[{code:"TILT_PORT_IN_USE",message:Je}]),Ua(Je)}if(!l.quiet)for(let fe of Ye)console.log(S.yellow(`\u26A0\uFE0F Tilt on port ${fe.port} belongs to another project (${fe.root}); this project will use another port.`));let Ut=l.force&&Ye.length===0,At=tN({runningPorts:ut,force:Ut,only:!!l.only});if(At.action==="already-running"){let fe=`Environment is already running on port ${At.ports.join(", ")}.`;A?.({ok:!0,alreadyRunning:!0,tiltUrl:`http://localhost:${At.ports[0]}`}),l.quiet||console.log(S.green(fe));return}if(At.action==="only-blocked"){let fe=`A Tilt is already running on port ${At.ports.join(", ")}. --only cannot change a running stack's services: run \`tdk down\` first, or pass --force to replace it.`;A?.({ok:!1},[{code:"TILT_ALREADY_RUNNING",message:fe}]),Ua(fe)}if(l.only)for(let fe of ut)E0(fe);let de=await nN({configuredPort:d,force:Ut,basePort:Oe,findAvailablePort:lT}),Re=de.port;de.autoSwitched&&!l.quiet&&(console.log(S.yellow(`\u26A0\uFE0F Port ${Oe} is already in use`)),console.log(S.blue(`\u{1F504} Auto-switching to port ${Re}
|
|
1699
1699
|
`))),process.env.TILT_PORT=Re.toString(),await oN({force:Ut,quiet:l.quiet,port:Re},{stop:E0,log:fe=>console.log(S.yellow(fe)),wait:fe=>new Promise(Je=>setTimeout(Je,fe))}),l.quiet||(console.log(S.gray(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{Rb as a,Sb as b,Tb as c,Ub as d,Vb as e}from"./chunk-
|
|
2
|
+
import{Rb as a,Sb as b,Tb as c,Ub as d,Vb as e}from"./chunk-W66JQVU6.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
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
BASE_PORT_BACKEND = 4000
|
|
11
11
|
|
|
12
12
|
# Languages whose runtime files are owned by the provider (no Vite/tsconfig/Bun config).
|
|
13
|
-
PROVIDER_OWNED_LANGUAGES = ["python", "go", "rust"]
|
|
13
|
+
PROVIDER_OWNED_LANGUAGES = ["python", "go", "rust", "node"]
|
|
14
14
|
|
|
15
15
|
# Files a provider-owned language must scaffold; checked before generating anything.
|
|
16
16
|
LANGUAGE_REQUIRED_FILES = {
|
|
17
17
|
"python": ["pyproject.toml", "src/main.py"],
|
|
18
18
|
"go": ["go.mod", "main.go"],
|
|
19
19
|
"rust": ["Cargo.toml", "src/main.rs"],
|
|
20
|
+
"node": ["package.json", "src/index.js"],
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
_CURL = """RUN apt-get update && apt-get install -y --no-install-recommends curl \\
|
|
@@ -111,6 +112,30 @@ EXPOSE {port}
|
|
|
111
112
|
CMD ["app"]
|
|
112
113
|
"""
|
|
113
114
|
|
|
115
|
+
_NODE = """# Generated by TDK for a Node.js backend. Do not edit; change service.json instead.
|
|
116
|
+
FROM node:22-slim@sha256:c3de60bf2f9dd0ac6370e6117950ff62d6e339527e7472301c9c78a017978392 AS base
|
|
117
|
+
|
|
118
|
+
WORKDIR /app/{res_path}
|
|
119
|
+
|
|
120
|
+
{curl}
|
|
121
|
+
COPY {res_path}/package*.json ./
|
|
122
|
+
RUN npm ci || npm install --omit=dev
|
|
123
|
+
|
|
124
|
+
COPY {res_path}/src ./src
|
|
125
|
+
|
|
126
|
+
FROM base AS test
|
|
127
|
+
RUN npm install
|
|
128
|
+
COPY {res_path}/tests ./tests
|
|
129
|
+
RUN npm test
|
|
130
|
+
|
|
131
|
+
FROM base AS production
|
|
132
|
+
|
|
133
|
+
{healthcheck}
|
|
134
|
+
EXPOSE {port}
|
|
135
|
+
|
|
136
|
+
CMD ["node", "src/index.js"]
|
|
137
|
+
"""
|
|
138
|
+
|
|
114
139
|
# The watcher the Go development target runs. It compiles a change into a staging binary while the running app keeps serving, and stops
|
|
115
140
|
# and swaps the app only when that build succeeds. Air was tried first and stops the app as soon as it sees a change (engine.go `start`
|
|
116
141
|
# calls stopBin before buildRun), so the service stayed down for the whole compile; a Traefik health check landing in that gap kept the
|
|
@@ -207,7 +232,7 @@ CMD ["tdk-go-watch"]
|
|
|
207
232
|
|
|
208
233
|
def generate_language_dockerfile(res_path, language, port = BASE_PORT_BACKEND, dev = False):
|
|
209
234
|
"""Dockerfile text for a provider-owned backend language, or fail for an unknown one."""
|
|
210
|
-
template = {"python": _PYTHON, "go": _GO, "rust": _RUST}.get(language)
|
|
235
|
+
template = {"python": _PYTHON, "go": _GO, "rust": _RUST, "node": _NODE}.get(language)
|
|
211
236
|
if template == None:
|
|
212
237
|
fail("No Dockerfile generator for backend language '{}'".format(language))
|
|
213
238
|
go_development = ""
|
|
@@ -567,6 +567,7 @@ def generate_resource_health_check(resource_name, resource_path, manifest, check
|
|
|
567
567
|
"python": ["pyproject.toml", "src/main.py"],
|
|
568
568
|
"go": ["go.mod", "main.go"],
|
|
569
569
|
"rust": ["Cargo.toml", "src/main.rs"],
|
|
570
|
+
"node": ["package.json", "src/index.js"],
|
|
570
571
|
}.get(manifest.get("language", "bun"), ["package.json", "prisma/schema.prisma"])
|
|
571
572
|
required_files = {
|
|
572
573
|
"backend": backend_files,
|
package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star
CHANGED
|
@@ -348,15 +348,21 @@ def _build_live_update_rules(res_path, full_res_path, syncs, project_root='', la
|
|
|
348
348
|
|
|
349
349
|
live_update_rules = []
|
|
350
350
|
for sync_path in syncs:
|
|
351
|
-
# Python images never read the
|
|
351
|
+
# Python and Node images never read the Bun registry config, and the engine does not
|
|
352
352
|
# generate it for provider-owned languages, so there is nothing to sync.
|
|
353
|
-
if language == 'python' and (
|
|
353
|
+
if language == 'python' and (
|
|
354
|
+
sync_path.endswith('.npmrc.docker.autogenerated') or sync_path.endswith('bunfig.docker.autogenerated.toml')
|
|
355
|
+
):
|
|
356
|
+
continue
|
|
357
|
+
if language == 'node' and (
|
|
358
|
+
sync_path.endswith('.npmrc.docker.autogenerated') or sync_path.endswith('bunfig.docker.autogenerated.toml')
|
|
359
|
+
):
|
|
354
360
|
continue
|
|
355
361
|
full_sync_path = _live_update_sync_source(project_root, full_res_path, sync_path)
|
|
356
362
|
dest = '/app/' + full_res_path + '/' + sync_path
|
|
357
363
|
live_update_rules.append(sync(full_sync_path, dest))
|
|
358
364
|
|
|
359
|
-
if language == 'python':
|
|
365
|
+
if language == 'python' or language == 'node':
|
|
360
366
|
return live_update_rules
|
|
361
367
|
|
|
362
368
|
package_json_path = '/app/' + full_res_path + '/package.json'
|