Monorepo skeleton, Prisma schema, core domain and services with tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
45d7512d2b
64 files changed
+9483
No files matched your search
@@ -0,0 +1,48 @@
|
||||
// GENERATED from dc-runtime/src/*.ts - do not edit. Rebuild with `bun build.ts` (see the package README for the source-only recipe).
|
||||
"use strict";(()=>{var Rt=Object.defineProperty,Mt=(t,n,e)=>n in t?Rt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,T=(t,n,e)=>Mt(t,typeof n!="symbol"?n+"":n,e);function L(){const t=window.React;if(!t)throw new Error("dc-runtime: window.React is not available yet");return t}function Tt(){const t=window.ReactDOM;if(!t)throw new Error("dc-runtime: window.ReactDOM is not available yet");return t}var A=((...t)=>L().createElement(...t));function Lt(t){const n=t.querySelector("x-dc");if(!n)return null;const e=t.querySelector("script[data-dc-script]"),{props:r,preview:o}=B(e?.getAttribute("data-props")??null);return{template:n.innerHTML,js:e&&e.textContent||"",props:r,preview:o}}function tt(t){const n=/<x-dc(?:\s[^>]*)?>/.exec(t);if(!n)return null;const e=t.lastIndexOf("</x-dc>");if(e===-1||e<n.index)return null;const r=t.slice(n.index+n[0].length,e),s=new DOMParser().parseFromString(t,"text/html").querySelector("script[data-dc-script]"),{props:i,preview:l}=B(s?.getAttribute("data-props")??null);return{template:r,js:s&&s.textContent||"",props:i,preview:l}}function B(t){if(!t)return{props:null,preview:null};let n;try{n=JSON.parse(t)}catch{return{props:null,preview:null}}if(!n||typeof n!="object"||Array.isArray(n))return{props:null,preview:null};const e=n,r=e.$preview&&typeof e.$preview=="object"?e.$preview:null,o={};for(const s of Object.keys(e))s[0]!=="$"&&(o[s]=e[s]);return{props:Object.keys(o).length?o:null,preview:r}}function Pt(t){let n=t||"";try{n=decodeURIComponent(n)}catch{}return(n.split("/").pop()||"Root").replace(/\.dc\.html$|\.html?$/,"")||"Root"}var Dt=`
|
||||
.sc-placeholder{background:color-mix(in srgb,currentColor 8%,transparent);
|
||||
border:1px solid color-mix(in srgb,currentColor 50%,transparent);
|
||||
border-radius:2px;box-sizing:border-box;overflow:hidden}
|
||||
@keyframes sc-shine{0%{background-position:100% 50%}100%{background-position:0% 50%}}
|
||||
html.sc-dc-streaming .sc-placeholder,
|
||||
html.sc-dc-streaming .sc-interp.sc-missing{position:relative;
|
||||
background:color-mix(in srgb,currentColor 5%,transparent);
|
||||
border-color:transparent}
|
||||
html.sc-dc-streaming .sc-placeholder::before,
|
||||
html.sc-dc-streaming .sc-interp.sc-missing::before{content:'';
|
||||
position:absolute;inset:0;pointer-events:none;
|
||||
background:linear-gradient(90deg,rgba(217,119,87,0) 25%,rgba(247,225,211,.95) 37%,rgba(217,119,87,0) 63%);
|
||||
background-size:400% 100%;animation:sc-shine 1.4s ease infinite}
|
||||
html.sc-dc-streaming .sc-placeholder:nth-child(n+9 of .sc-placeholder)::before,
|
||||
html.sc-dc-streaming .sc-interp.sc-missing:nth-child(n+9 of .sc-interp.sc-missing)::before{animation:none;
|
||||
background:color-mix(in srgb,currentColor 8%,transparent)}
|
||||
.sc-placeholder-error{padding:4px 8px;font:11px/1.4 ui-monospace,monospace;
|
||||
color:color-mix(in srgb,currentColor 70%,transparent);word-break:break-word}
|
||||
.sc-interp.sc-missing{display:inline-block;width:2em;height:1em;overflow:hidden;
|
||||
vertical-align:text-bottom;background:rgba(255,255,255,.3);border:1px solid rgba(0,0,0,.5);
|
||||
border-radius:2px;box-sizing:border-box;color:transparent;
|
||||
user-select:none}
|
||||
.sc-interp.sc-unresolved{font-family:ui-monospace,monospace;font-size:.85em;
|
||||
color:color-mix(in srgb,currentColor 50%,transparent);
|
||||
background:color-mix(in srgb,currentColor 10%,transparent);border-radius:3px;
|
||||
padding:0 3px}
|
||||
.sc-host.sc-has-error{position:relative}
|
||||
.sc-logic-error{position:absolute;top:8px;left:8px;z-index:2147483647;max-width:60ch;
|
||||
padding:6px 10px;background:#b00020;color:#fff;font:12px/1.4 ui-monospace,monospace;
|
||||
border-radius:4px;white-space:pre-wrap;pointer-events:none}
|
||||
/* Mirrors PRINT_BASELINE_CSS in apps/web deck-stage-export.ts \u2014 keep both
|
||||
in sync until dc-runtime regains a build step. */
|
||||
@media print {
|
||||
@page { margin: 0.5cm; }
|
||||
figure, table { break-inside: avoid; }
|
||||
#dc-root, #dc-root > .sc-host { height: auto; }
|
||||
*, *::before, *::after {
|
||||
print-color-adjust: exact; -webkit-print-color-adjust: exact;
|
||||
backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
|
||||
animation-delay: -99s !important; animation-duration: .001s !important;
|
||||
animation-iteration-count: 1 !important; animation-fill-mode: both !important;
|
||||
animation-play-state: running !important; transition-duration: 0s !important;
|
||||
}
|
||||
}
|
||||
`,Ot="html,body{height:100%;margin:0}#dc-root,#dc-root>.sc-host{height:100%}";function jt(t,n){let e=n.pathname||"";if(!/\.dc\.html?$/i.test(It(e)))try{e=new URL(t.baseURI||"/").pathname}catch{}return Pt(e)}function It(t){try{return decodeURIComponent(t)}catch{return t}}function zt(t,n=document){const e=Lt(n);if(!e)return null;const r=L(),o=jt(n,location);t.markFetched(o),t.setRootName(o),t.adoptParsed(o,e),window.__resources||fetch(location.href).then(_=>_.ok?_.text():"").then(_=>{const u=_?tt(_):null;u?.template&&t.updateHtml(o,u.template)}).catch(()=>{});const s=n.querySelector("x-dc"),i=n.createElement("div");if(i.id="dc-root",s.replaceWith(i),!e.preview){const _=n.createElement("style");_.textContent=Ot,n.head.appendChild(_)}const l=t.getDC(o),c=t.registry.get(o);function a(){const[,_]=r.useState(0);r.useEffect(()=>{const d=()=>_(g=>g+1);return c.subs.add(d),()=>{c.subs.delete(d)}},[]);const u=r.useMemo(()=>{const d={};for(const g in c.propsMeta||{}){const m=c.propsMeta?.[g]?.default;m!==void 0&&(d[g]=m)}return d},[c.propsMeta]);return A(l,{...u,...c.propOverrides||{}})}const f=Tt();return f.createRoot?f.createRoot(i).render(A(a)):f.render(A(a),i),o}var et=/^[A-Za-z_$][A-Za-z0-9_$]*/,Ut=/^-?\d+(\.\d+)?$/;function D(t,n){const e=String(n).trim();if(!e)return;if(e[0]==="("&&e[e.length-1]===")"&&Gt(e))return D(t,e.slice(1,-1));const r=Ft(e);if(r){const o=D(t,e.slice(0,r.index)),s=D(t,e.slice(r.index+r.op.length));switch(r.op){case"===":return o===s;case"!==":return o!==s;case"==":return o==s;default:return o!=s}}if(e[0]==="!")return!D(t,e.slice(1));if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e!=="undefined")return Ut.test(e)?Number(e):e.length>=2&&(e[0]==='"'||e[0]==="'")&&e[e.length-1]===e[0]?e.slice(1,-1):Bt(t,e)}function Gt(t){let n=0;for(let e=0;e<t.length-1;e++)if(t[e]==="(")n++;else if(t[e]===")"&&(n--,n===0))return!1;return!0}function Ft(t){let n=0;for(let e=0;e<t.length;e++){const r=t[e];if(r==="["||r==="(")n++;else if(r==="]"||r===")")n--;else if(n===0&&(r==="="||r==="!")&&t[e+1]==="="){if(e>0&&(t[e-1]==="="||t[e-1]==="!")||!t.slice(0,e).trim())continue;const o=t[e+2]==="="?r+"==":r+"=";return{index:e,op:o}}}return null}function Bt(t,n){const e=n.match(et);if(!e)return;let r=t?.[e[0]],o=e[0].length;for(;o<n.length;)if(n[o]==="."){const s=n.slice(o+1).match(et)||n.slice(o+1).match(/^\d+/);if(!s)return;r=r?.[s[0]],o+=1+s[0].length}else if(n[o]==="["){let s=1,i=o+1;for(;i<n.length&&s>0;){if(n[i]==="[")s++;else if(n[i]==="]"&&(s--,s===0))break;i++}if(s!==0)return;const l=D(t,n.slice(o+1,i));r=r?.[l],o=i+1}else return;return r}var W="sc-camel-",Wt=new Set("a abbr b bdi bdo br cite code del dfn em i ins kbd mark q s samp small span strike strong sub sup u var wbr".split(" ")),nt={select:"sc-raw-select",table:"sc-raw-table",tbody:"sc-raw-tbody",thead:"sc-raw-thead",tfoot:"sc-raw-tfoot",tr:"sc-raw-tr",td:"sc-raw-td",th:"sc-raw-th",caption:"sc-raw-caption"},rt=Object.fromEntries(Object.entries(nt).map(([t,n])=>[n,t])),$t=new Set("allowFullScreen async autoFocus autoPlay checked controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden itemScope loop multiple muted noModule noValidate open playsInline readOnly required reversed scoped seamless selected".split(" ")),qt={onclick:"onClick",onchange:"onChange",oninput:"onInput",onsubmit:"onSubmit",onkeydown:"onKeyDown",onkeyup:"onKeyUp",onkeypress:"onKeyPress",onmousedown:"onMouseDown",onmouseup:"onMouseUp",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onfocus:"onFocus",onblur:"onBlur",ondoubleclick:"onDoubleClick",oncontextmenu:"onContextMenu",onmousemove:"onMouseMove",onmouseover:"onMouseOver",onmouseout:"onMouseOut",onpointerdown:"onPointerDown",onpointerup:"onPointerUp",onpointermove:"onPointerMove",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointercancel:"onPointerCancel",onpointerover:"onPointerOver",onpointerout:"onPointerOut",ongotpointercapture:"onGotPointerCapture",onlostpointercapture:"onLostPointerCapture",ontouchstart:"onTouchStart",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchcancel:"onTouchCancel",ondragstart:"onDragStart",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragleave:"onDragLeave",ondragover:"onDragOver",onanimationstart:"onAnimationStart",onanimationend:"onAnimationEnd",onanimationiteration:"onAnimationIteration",ontransitionend:"onTransitionEnd"},Vt=`(?:[^>"']|"[^"]*"|'[^']*')*`,Ht=new RegExp("<(x-import|dc-import)("+Vt+")/>","gi"),ot=`(?:=\\s*"[^"]*"|=\\s*'[^']*'|=(?!\\s*["'])|[^>=])*`,Kt=new RegExp("(<!---?>|<!--[\\s\\S]*?--!?>)|(<(script|style|textarea|title)(?=[\\s/>])"+ot+">)([\\s\\S]*?<\\/\\3(?=[\\s/>])[^>]*>)|<[a-zA-Z][^\\s/>]*(?=[\\s/>])"+ot+">","gi"),Zt=/=\s*"[^"]*"|=\s*'[^']*'|(\s)([a-z]+[A-Z][A-Za-z0-9]*)(?=\s*=)/g;function Jt(t){const n=e=>e.replace(Zt,(r,o,s)=>s===void 0?r:o+W+s.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()));return t.replace(Kt,(e,r,o,s,i)=>r!==void 0?e:o?n(o)+i:n(e))}function Xt(t){tLine truncated
|
||||
;return (typeof Component!=="undefined"&&Component)||undefined;`)(I,I,L())}function Ue(t,n){if(!n)return!1;const e=Object.keys(t).filter(o=>o!=="children"),r=Object.keys(n).filter(o=>o!=="children");if(e.length!==r.length)return!1;for(const o of e)if(t[o]!==n[o])return!1;return!0}var K,St=t=>t.chrome?{className:t.className,"data-omelette-chrome":""}:{className:t.className};function Z(t){return K?A(K,t):A("div",St(t),t.message)}function F({name:t,hintSize:n,streaming:e,error:r}){const[o,s]=(n||"100%,60px").split(","),i=r?(t?t+": ":"")+r:null;return A("div",{className:"sc-placeholder"+(e?" sc-streaming":""),style:{width:o.trim(),height:s&&s.trim()},title:t},i?Z({className:"sc-placeholder-error",message:i}):null)}function Ge(t){if(!t)return;const[n,e]=t.split(",");return{minWidth:n.trim(),minHeight:e&&e.trim()}}function Fe(t,n,e=()=>{}){const r=L();K=class extends r.Component{constructor(){super(...arguments),T(this,"off")}componentDidMount(){this.off=Et(this.props.message)}componentDidUpdate(c){c.message!==this.props.message&&(this.off?.(),this.off=Et(this.props.message))}componentWillUnmount(){this.off?.()}render(){return A("div",St(this.props),this.props.message)}};const o=r.createContext([]);class s extends r.Component{constructor(a){super(a),T(this,"__name"),T(this,"__sub"),T(this,"__needsDidMount",!1),T(this,"__streamingNow",!1),T(this,"__htmlStreamingNow",!1),T(this,"__failedLogic",null),T(this,"__failedUserProps",null),T(this,"__failedVer",-1),T(this,"__ctorError",null),T(this,"logic"),this.__name=a.__name,this.state={__v:0,__err:null},this.__sub=()=>{this.state.__err&&this.setState({__err:null}),this.forceUpdate()},this.__makeLogic(t.get(this.__name).Logic,null),n(this.__name)}static getDerivedStateFromError(a){return{__err:a instanceof Error&&a.message?a.message:String(a)}}componentDidCatch(a,f){console.error("[dc-runtime] render error in <"+this.__name+">:",a,f?.componentStack||"")}__makeLogic(a,f){const _=a||I;try{this.logic=new _(this.__userProps()),this.__failedLogic=null,this.__failedUserProps=null,this.__ctorError=null}catch(u){console.error(u),this.__failedLogic=a,this.__failedUserProps=this.__userProps(),this.__failedVer=t.get(this.__name).ver,this.__ctorError=this.__name+": "+(u instanceof Error&&u.message?u.message:String(u)),this.logic=new I(this.__userProps())}this.logic.__host=this,f&&(this.logic.state={...this.logic.state||{},...f})}__userProps(){const{__name:a,__hintSize:f,__tplId:_,__hostStyle:u,...d}=this.props;return d}__setLogicState(a,f){const _=this.logic.state,u=typeof a=="function"?a(_):a;this.logic.state={..._,...u},this.setState(d=>({__v:d.__v+1}),f)}__reconcileLogic(){const a=t.get(this.__name),f=a.Logic,_=this.logic.constructor;if(!(f===_||!f&&_===I||f===this.__failedLogic&&a.ver===this.__failedVer&&Ue(this.__userProps(),this.__failedUserProps))){if(!this.__needsDidMount)try{this.logic.componentWillUnmount()}catch(u){console.error(u)}this.__makeLogic(f,this.logic.state),this.__needsDidMount=!0}}componentDidMount(){t.get(this.__name).subs.add(this.__sub);try{this.logic.componentDidMount()}catch(a){console.error(a)}}componentDidUpdate(a){if(this.logic.props=this.__userProps(),this.__needsDidMount){if(this.state.__err||!t.get(this.__name).tpl)return;this.__needsDidMount=!1;try{this.logic.componentDidMount()}catch(f){console.error(f)}}else try{this.logic.componentDidUpdate(a)}catch(f){console.error(f)}}componentWillUnmount(){if(t.get(this.__name).subs.delete(this.__sub),!this.__needsDidMount)try{this.logic.componentWillUnmount()}catch(a){console.error(a)}}render(){e(this.__name);const a=t.get(this.__name),f="sc-host"+(a.htmlStreaming?" sc-streaming-html":"")+(a.jsStreaming?" sc-streaming-js":""),_=a.htmlStreaming?Ge(this.props.__hintSize):void 0,u=this.props.__hostStyle||_?{..._||{},...this.props.__hostStyle||{}}:void 0,d={className:f,style:u,"data-sc-name":this.__name,"data-dc-tpl":this.props.__tplId},g=Array.isArray(this.context)?this.context:[];if(g.includes(this.__name)){const b=[...g.slice(g.indexOf(this.__name)),this.__name].join(" \u2192 ");return A("div",{...d,className:f+" sc-has-error"},A(F,{name:this.__name,hintSize:this.props.__hintSize,error:"circular import: "+b}))}if(this.state.__err)return A("div",{...d,className:f+" sc-has-error"},Z({className:"sc-logic-error",message:this.__name+": "+this.state.__err,chrome:!0}),A(F,{name:this.__name,hintSize:this.props.__hintSize,error:this.state.__err}));if(this.__reconcileLogic(),!a.tpl)return A("div",d,A(F,{name:this.__name,hintSize:this.props.__hintSize}));const m=this.__userProps();this.logic.props=m;let S=m,v=a.logicError||this.__ctorError;try{S={...m,...this.logic.renderVals()||{}}}catch(b){console.error(b),v=this.__name+".renderVals(): "+(b instanceof Error&&b.message?b.message:String(b))}return this.__streamingNow=!!(a.htmlStreaming||a.jsStreaming),this.__htmlStreamingNow=!!a.htmlStreaming,A("div",{...d,className:f+(v?" sc-has-error":"")},v&&Z({className:"sc-logic-error",message:v,chrome:!0}),A(o.Provider,{value:[..
Line truncated
|
||||
Reference in new issue
Block a user