@meonode/ui 1.4.4-beta.6 → 1.4.5
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/dist/cjs/components/styled-renderer.client.cjs +1 -1
- package/dist/cjs/core.node.cjs +1 -1
- package/dist/cjs/util/server-theme.util.cjs +1 -1
- package/dist/esm/components/styled-renderer.client.js +1 -1
- package/dist/esm/core.node.js +1 -1
- package/dist/esm/util/server-theme.util.js +1 -1
- package/dist/types/components/styled-renderer.client.d.ts.map +1 -1
- package/dist/types/core.node.d.ts.map +1 -1
- package/dist/types/util/server-theme.util.d.ts +15 -0
- package/dist/types/util/server-theme.util.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@emotion/react"),r=require("./theme-provider.client.cjs"),s=require("../util/theme.util.cjs");function i({element:i,children:o,...c}){const l=e.useContext(r.ThemeContext),n=l?.theme,{css:u,...m}=c
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@emotion/react"),r=require("./theme-provider.client.cjs"),s=require("../util/theme.util.cjs");function i({element:i,children:o,...c}){const l=e.useContext(r.ThemeContext),n=l?.theme,{css:u,...m}=c,h=n?s.ThemeUtil.resolveObjWithTheme(u,n,{processFunctions:!0,themeStringsMode:"vars"}):u,a=s.ThemeUtil.resolveDefaultStyle(h);return t.jsx(i,{...m,css:a},o)}i.displayName="Styled",i.__meonodeAcceptsServerCss=!0,exports.default=i;
|
package/dist/cjs/core.node.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("./helper/react-is.helper.cjs"),s=require("./helper/common.helper.cjs"),n=require("./components/styled-renderer.client.cjs"),r=require("./constant/common.const.cjs"),o=require("./util/mount-tracker.util.cjs"),i=require("./components/meonode-unmounter.client.cjs"),l=require("./util/navigation-cache-manager.util.cjs"),a=require("./util/node.util.cjs"),c=require("./util/server-emotion.util.cjs"),d=require("./util/server-theme.util.cjs"),h=require("./util/theme.util.cjs"),m=Object.defineProperty,u=(e,t,s)=>((e,t,s)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);const p=Symbol.for("@meonode/ui/BaseNode/elementCache"),g=Symbol.for("@meonode/ui/BaseNode/navigationStarted"),y=Symbol.for("@meonode/ui/BaseNode/renderContextPool"),f=Symbol.for("@meonode/ui/BaseNode/cacheCleanupRegistry"),C=class m{constructor(e,n={},r){if(u(this,"instanceId","m"+ ++m._idCounter),u(this,"element"),u(this,"rawProps",{}),u(this,"isBaseNode",!0),u(this,"_props"),u(this,"_deps"),u(this,"stableKey"),u(this,"lastPropsObj"),u(this,"lastSignature"),!t.isValidElementType(e)){const t=s.getComponentType(e);if(a.NodeUtil.isNodeInstance(e))throw new Error("Invalid element type: MeoNode UI instance provided!");throw new Error(`Invalid element type: ${t} provided!`)}if(this.element=e,this.rawProps=n,this._deps=r,a.NodeUtil.isServer&&a.NodeUtil.providesServerTheme(e)){const e=n.theme;if(e&&"object"==typeof e&&"system"in e){const t=e;d.setActiveServerTheme(t),d.registerServerThemeVariables(t)}}const{ref:o,children:i,...c}=n;this.stableKey=this._getStableKey(c),a.NodeUtil.isServer||m._navigationStarted||(l.NavigationCacheManagerUtil.getInstance().start(),m._navigationStarted=!0)}static get elementCache(){return s.getGlobalState(p,()=>new Map)}static get _navigationStarted(){return s.getGlobalState(g,()=>({value:!1})).value}static set _navigationStarted(e){s.getGlobalState(g,()=>({value:!1})).value=e}static get renderContextPool(){return s.getGlobalState(y,()=>[])}static acquireRenderContext(){const e=m.renderContextPool;return e.length>0?e.pop():{workStack:new Array(512),renderedElements:new Map}}static releaseRenderContext(e){m.renderContextPool.length<50&&e.workStack.length<2048&&(e.workStack.length=0,e.renderedElements.clear(),m.renderContextPool.push(e))}get props(){return this._props||(this._props=a.NodeUtil.processProps(this.rawProps,this.stableKey)),this._props}get dependencies(){return this._deps}_getStableKey({key:e,...t}){if(a.NodeUtil.isServer)return;if(this.lastPropsObj===t)return this.lastSignature;this.lastPropsObj=t;const n=Object.keys(t),o=n.length;if(o>100){const e=a.NodeUtil.extractCriticalProps(t,n);this.lastSignature=a.NodeUtil.createPropSignature(this.element,e),r.__DEBUG__&&o>200&&console.warn(`MeoNode: Large props (${o} keys) on "${s.getElementTypeName(this.element)}". Consider splitting.`)}else this.lastSignature=a.NodeUtil.createPropSignature(this.element,t);return null!=e?`${String(e)}:${this.lastSignature}`:this.lastSignature}static get cacheCleanupRegistry(){return s.getGlobalState(f,()=>new FinalizationRegistry(e=>{const{cacheKey:t,instanceId:s}=e,n=m.elementCache.get(t);n?.instanceId===s&&m.elementCache.delete(t),o.MountTrackerUtil.isMounted(t)&&o.MountTrackerUtil.untrackMount(t)}))}render(r=!1){const o=a.NodeUtil.shouldCacheElement(this)?m.elementCache.get(this.stableKey):void 0,l=a.NodeUtil.shouldNodeUpdate(o?.prevDeps,this._deps,r);if(!l&&o?.renderedElement)return o.accessCount+=1,o.renderedElement;const u=!l,p=m.acquireRenderContext();let{workStack:g}=p;const{renderedElements:y}=p;let f=0;try{const r=e=>{if(e>g.length){const t=Math.max(e,g.length<<1),s=new Array(t);for(let e=0;e<f;e++)s[e]=g[e];g=s}};for(g[f++]={node:this,isProcessed:!1,blocked:u,theme:void 0};f>0;){const o=g[f-1];if(!o){f--;continue}const{node:i,isProcessed:l,blocked:u,theme:p}=o,C=(e,t)=>{const s=e.theme;return s&&"object"==typeof s&&"system"in s?s:t??d.getActiveServerTheme()};if(l){f--;const{children:r,key:o,css:l,nativeProps:u,disableEmotion:g,...
|
|
1
|
+
"use strict";var e=require("react"),t=require("./helper/react-is.helper.cjs"),s=require("./helper/common.helper.cjs"),n=require("./components/styled-renderer.client.cjs"),r=require("./constant/common.const.cjs"),o=require("./util/mount-tracker.util.cjs"),i=require("./components/meonode-unmounter.client.cjs"),l=require("./util/navigation-cache-manager.util.cjs"),a=require("./util/node.util.cjs"),c=require("./util/server-emotion.util.cjs"),d=require("./util/server-theme.util.cjs"),h=require("./util/theme.util.cjs"),m=Object.defineProperty,u=(e,t,s)=>((e,t,s)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);const p=Symbol.for("@meonode/ui/BaseNode/elementCache"),g=Symbol.for("@meonode/ui/BaseNode/navigationStarted"),y=Symbol.for("@meonode/ui/BaseNode/renderContextPool"),f=Symbol.for("@meonode/ui/BaseNode/cacheCleanupRegistry"),C=class m{constructor(e,n={},r){if(u(this,"instanceId","m"+ ++m._idCounter),u(this,"element"),u(this,"rawProps",{}),u(this,"isBaseNode",!0),u(this,"_props"),u(this,"_deps"),u(this,"stableKey"),u(this,"lastPropsObj"),u(this,"lastSignature"),!t.isValidElementType(e)){const t=s.getComponentType(e);if(a.NodeUtil.isNodeInstance(e))throw new Error("Invalid element type: MeoNode UI instance provided!");throw new Error(`Invalid element type: ${t} provided!`)}if(this.element=e,this.rawProps=n,this._deps=r,a.NodeUtil.isServer&&a.NodeUtil.providesServerTheme(e)){const e=n.theme;if(e&&"object"==typeof e&&"system"in e){const t=e;d.setActiveServerTheme(t),d.registerServerThemeVariables(t)}}const{ref:o,children:i,...c}=n;this.stableKey=this._getStableKey(c),a.NodeUtil.isServer||m._navigationStarted||(l.NavigationCacheManagerUtil.getInstance().start(),m._navigationStarted=!0)}static get elementCache(){return s.getGlobalState(p,()=>new Map)}static get _navigationStarted(){return s.getGlobalState(g,()=>({value:!1})).value}static set _navigationStarted(e){s.getGlobalState(g,()=>({value:!1})).value=e}static get renderContextPool(){return s.getGlobalState(y,()=>[])}static acquireRenderContext(){const e=m.renderContextPool;return e.length>0?e.pop():{workStack:new Array(512),renderedElements:new Map}}static releaseRenderContext(e){m.renderContextPool.length<50&&e.workStack.length<2048&&(e.workStack.length=0,e.renderedElements.clear(),m.renderContextPool.push(e))}get props(){return this._props||(this._props=a.NodeUtil.processProps(this.rawProps,this.stableKey)),this._props}get dependencies(){return this._deps}_getStableKey({key:e,...t}){if(a.NodeUtil.isServer)return;if(this.lastPropsObj===t)return this.lastSignature;this.lastPropsObj=t;const n=Object.keys(t),o=n.length;if(o>100){const e=a.NodeUtil.extractCriticalProps(t,n);this.lastSignature=a.NodeUtil.createPropSignature(this.element,e),r.__DEBUG__&&o>200&&console.warn(`MeoNode: Large props (${o} keys) on "${s.getElementTypeName(this.element)}". Consider splitting.`)}else this.lastSignature=a.NodeUtil.createPropSignature(this.element,t);return null!=e?`${String(e)}:${this.lastSignature}`:this.lastSignature}static get cacheCleanupRegistry(){return s.getGlobalState(f,()=>new FinalizationRegistry(e=>{const{cacheKey:t,instanceId:s}=e,n=m.elementCache.get(t);n?.instanceId===s&&m.elementCache.delete(t),o.MountTrackerUtil.isMounted(t)&&o.MountTrackerUtil.untrackMount(t)}))}render(r=!1){const o=a.NodeUtil.shouldCacheElement(this)?m.elementCache.get(this.stableKey):void 0,l=a.NodeUtil.shouldNodeUpdate(o?.prevDeps,this._deps,r);if(!l&&o?.renderedElement)return o.accessCount+=1,o.renderedElement;const u=!l,p=m.acquireRenderContext();let{workStack:g}=p;const{renderedElements:y}=p;let f=0;try{const r=e=>{if(e>g.length){const t=Math.max(e,g.length<<1),s=new Array(t);for(let e=0;e<f;e++)s[e]=g[e];g=s}};for(g[f++]={node:this,isProcessed:!1,blocked:u,theme:void 0};f>0;){const o=g[f-1];if(!o){f--;continue}const{node:i,isProcessed:l,blocked:u,theme:p}=o,C=(e,t)=>{const s=e.theme;return s&&"object"==typeof s&&"system"in s?s:t??d.getActiveServerTheme()};if(l){f--;const{children:r,key:o,css:l,nativeProps:u,disableEmotion:g,...N}=i.props,v=C(i.props,p);let S=[];if(r){const e=Array.isArray(r)?r:[r],t=e.length;S=new Array(t);for(let s=0;s<t;s++){const t=e[s];if(a.NodeUtil.isNodeInstance(t)){const e=y.get(t);if(!e)throw new Error(`[MeoNode] Missing rendered element for child node: ${t.stableKey}`);S[s]=e}else S[s]=t}}const b=d.replaceThemeTokensWithCssVars({...N,key:o,...u});let U;if(i.element===e.Fragment||t.isFragment(i.element))U=e.createElement(i.element,{key:o},...S);else{const t=!g&&(l||!s.hasNoStyleTag(i.element))&&Object.keys(l||{}).length>0,r=a.NodeUtil.isServer&&"string"!=typeof i.element,o=t&&r&&a.NodeUtil.isClientReference(i.element);if(t&&!r||o){const t=a.NodeUtil.isServer?d.replaceThemeTokensWithCssVars(l):l;U=e.createElement(n.default,{element:i.element,...b,css:t},...S)}else if(t&&r&&!a.NodeUtil.acceptsServerCss(i.element)){const t=h.ThemeUtil.resolveObjWithTheme(d.replaceThemeTokensWithCssVars(l),v,{processFunctions:!0}),s=h.ThemeUtil.resolveDefaultStyle(t),n=c.compileServerEmotionClassName(s),r=[b.className,n].filter(Boolean).join(" ")||void 0,o=r?{...b,className:r}:b;U=e.createElement(i.element,o,...S)}else{const s=t&&(!r||a.NodeUtil.acceptsServerCss(i.element))?{...b,css:l}:b;U=e.createElement(i.element,s,...S)}}if(i!==this&&a.NodeUtil.shouldCacheElement(i)){const e=m.elementCache.get(i.stableKey);if(e)e.prevDeps=i._deps,e.renderedElement=U,e.accessCount+=1;else{const e={prevDeps:i._deps,renderedElement:U,nodeRef:new WeakRef(i),createdAt:Date.now(),accessCount:1,instanceId:i.instanceId};m.elementCache.set(i.stableKey,e),m.cacheCleanupRegistry.register(i,{cacheKey:i.stableKey,instanceId:i.instanceId},i)}}y.set(i,U)}else{o.isProcessed=!0;const e=i.props.children,t=C(i.props,p);if(e){const s=Array.isArray(e)?e:[e];let n=0;for(let e=0;e<s.length;e++)a.NodeUtil.isNodeInstance(s[e])&&n++;r(f+n);for(let e=s.length-1;e>=0;e--){const n=s[e];if(!a.NodeUtil.isNodeInstance(n))continue;const r=a.NodeUtil.shouldCacheElement(n)?m.elementCache.get(n.stableKey):void 0,o=a.NodeUtil.shouldNodeUpdate(r?.prevDeps,n._deps,u);if(!o&&r?.renderedElement){y.set(n,r.renderedElement);continue}const i=u||!o;g[f++]={node:n,isProcessed:!1,blocked:i,theme:t}}}}}let o=y.get(this);if(!a.NodeUtil.isServer&&this.stableKey&&(o=e.createElement(i.default,{node:this},o)),a.NodeUtil.shouldCacheElement(this)){const e=m.elementCache.get(this.stableKey);if(e)e.prevDeps=this._deps,e.renderedElement=o,e.accessCount+=1;else{const e={prevDeps:this._deps,renderedElement:o,nodeRef:new WeakRef(this),createdAt:Date.now(),accessCount:1,instanceId:this.instanceId};m.elementCache.set(this.stableKey,e),m.cacheCleanupRegistry.register(this,{cacheKey:this.stableKey,instanceId:this.instanceId},this)}}return o}finally{for(let e=0;e<f;e++)g[e]=null;m.releaseRenderContext({workStack:g,renderedElements:y})}}static clearCaches(){const e=Array.from(m.elementCache.keys());r.__DEBUG__&&console.log(`[MeoNode] clearCaches: Clearing ${e.length} entries`);for(const t of e){const e=m.elementCache.get(t);if(e){const s=e.nodeRef?.deref();if(s)try{m.cacheCleanupRegistry.unregister(s),s.lastSignature=void 0,s.lastPropsObj=void 0}catch{r.__DEBUG__&&console.warn(`[MeoNode] Could not unregister ${t} from FinalizationRegistry`)}}}m.elementCache.clear(),o.MountTrackerUtil.cleanup(),r.__DEBUG__&&console.log("[MeoNode] All caches cleared")}};u(C,"_idCounter",0);let N=C;function v(e,t={},s){return new N(e,t,s)}v.clearCaches=N.clearCaches,exports.BaseNode=N,exports.Node=v,exports.createChildrenFirstNode=function(e,t){const s=(s,n,r)=>v(e,{...t,...n,children:s},r);return s.element=e,s},exports.createNode=function(e,t){const s=(s,n)=>v(e,{...t,...s},n);return s.element=e,s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../helper/common.helper.cjs");const t=Symbol.for("@meonode/ui/serverActiveTheme"),
|
|
1
|
+
"use strict";var e=require("../helper/common.helper.cjs");const t=Symbol.for("@meonode/ui/serverActiveTheme"),r=Symbol.for("@meonode/ui/serverThemeVariables");function o(e){return`--meonode-theme-${e.replace(/[^\w.-]/g,"-").replace(/\./g,"-")}`}function s(){return e.getGlobalState(r,()=>({byName:new Map}))}exports.buildThemeVariablesCss=function(e){if(!e?.system||"object"!=typeof e.system)return"";const t=[],r=[{path:"",value:e.system}];for(;r.length>0;){const e=r.pop();if(!e||!e.value||"object"!=typeof e.value)continue;const s=e.value;for(const[n,l]of Object.entries(s)){const s=e.path?`${e.path}.${n}`:n;if(null!=l)if("string"!=typeof l&&"number"!=typeof l&&"boolean"!=typeof l){if("object"==typeof l){const e=l.default;"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||t.push([o(s),String(e)]),r.push({path:s,value:l})}}else t.push([o(s),String(l)])}}return 0===t.length?"":`:root{${t.sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t};`).join("")}}`},exports.consumeServerThemeVariablesCss=function(){const e=s();if(0===e.byName.size)return;const t=Array.from(e.byName.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t};`).join("");return e.byName.clear(),t?{id:"theme-vars",cssText:`:root{${t}}`}:void 0},exports.getActiveServerTheme=function(){return e.getGlobalState(t,()=>({})).activeTheme},exports.registerServerThemeVariables=function(e){if(!e?.system||"object"!=typeof e.system)return;const t=s(),r=[{path:"",value:e.system}];for(;r.length>0;){const e=r.pop();if(!e||!e.value||"object"!=typeof e.value)continue;const s=e.value;for(const[n,l]of Object.entries(s)){const s=e.path?`${e.path}.${n}`:n;if(null!=l)if("string"!=typeof l&&"number"!=typeof l&&"boolean"!=typeof l){if("object"==typeof l){const e=l.default;"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||t.byName.set(o(s),String(e)),r.push({path:s,value:l})}}else t.byName.set(o(s),String(l))}}},exports.replaceThemeTokensWithCssVars=function(e){const t=/theme\.([a-zA-Z0-9_.-]+)/g,r=e=>{if(!e.includes("theme."))return e;t.lastIndex=0;let r=!1;const s=e.replace(t,(e,t)=>(r=!0,`var(${o(t)})`));return r?s:e},s=e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};if("string"==typeof e)return r(e);if(!s(e)&&!Array.isArray(e))return e;const n=[{value:e,isProcessed:!1}],l=new Map,a=new Set;for(;n.length>0;){const e=n[n.length-1],t=e.value;if(s(t)||Array.isArray(t))if(l.has(t))n.pop();else if(e.isProcessed){n.pop(),a.delete(t);let e=t;if(Array.isArray(t)){let o=null;for(let e=0;e<t.length;e++){const n=t[e];let a=n;"string"==typeof n?a=r(n):(s(n)||Array.isArray(n))&&(a=l.get(n)??n),a!==n&&(null===o&&(o=[...t]),o[e]=a)}null!==o&&(e=o)}else{let o=null;const n=t;for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const t=n[e];let a=e,i=t;e.includes("theme.")&&(a=r(e)),"string"==typeof t?i=r(t):(s(t)||Array.isArray(t))&&(i=l.get(t)??t),i===t&&a===e||(null===o&&(o={...n}),a!==e&&delete o[e],o[a]=i)}null!==o&&(e=o)}l.set(t,e)}else{e.isProcessed=!0,a.add(t);const r=Array.isArray(t)?t:Object.values(t);for(let e=r.length-1;e>=0;e--){const t=r[e];!s(t)&&!Array.isArray(t)||a.has(t)||n.push({value:t,isProcessed:!1})}}else n.pop()}return l.get(e)??e},exports.setActiveServerTheme=function(r){e.getGlobalState(t,()=>({})).activeTheme=r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useContext as e}from"react";import{jsx as t}from"@emotion/react";import{ThemeContext as r}from"./theme-provider.client.js";import{ThemeUtil as o}from"../util/theme.util.js";function s({element:s,children:m,...i}){const
|
|
2
|
+
import{useContext as e}from"react";import{jsx as t}from"@emotion/react";import{ThemeContext as r}from"./theme-provider.client.js";import{ThemeUtil as o}from"../util/theme.util.js";function s({element:s,children:m,...i}){const c=e(r),l=c?.theme,{css:n,...p}=i,a=l?o.resolveObjWithTheme(n,l,{processFunctions:!0,themeStringsMode:"vars"}):n,d=o.resolveDefaultStyle(a);return t(s,{...p,css:d},m)}s.displayName="Styled",s.__meonodeAcceptsServerCss=!0;export{s as default};
|
package/dist/esm/core.node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as e,createElement as t}from"react";import{isValidElementType as
|
|
1
|
+
import{Fragment as e,createElement as t}from"react";import{isValidElementType as n,isFragment as s}from"./helper/react-is.helper.js";import{getComponentType as r,getGlobalState as o,hasNoStyleTag as i,getElementTypeName as l}from"./helper/common.helper.js";import a from"./components/styled-renderer.client.js";import{__DEBUG__ as c}from"./constant/common.const.js";import{MountTrackerUtil as d}from"./util/mount-tracker.util.js";import h from"./components/meonode-unmounter.client.js";import{NavigationCacheManagerUtil as m}from"./util/navigation-cache-manager.util.js";import{NodeUtil as p}from"./util/node.util.js";import{compileServerEmotionClassName as u}from"./util/server-emotion.util.js";import{setActiveServerTheme as f,registerServerThemeVariables as g,getActiveServerTheme as y,replaceThemeTokensWithCssVars as C}from"./util/server-theme.util.js";import{ThemeUtil as v}from"./util/theme.util.js";var b=Object.defineProperty,S=(e,t,n)=>((e,t,n)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const w=Symbol.for("@meonode/ui/BaseNode/elementCache"),k=Symbol.for("@meonode/ui/BaseNode/navigationStarted"),j=Symbol.for("@meonode/ui/BaseNode/renderContextPool"),P=Symbol.for("@meonode/ui/BaseNode/cacheCleanupRegistry"),_=class b{constructor(e,t={},s){if(S(this,"instanceId","m"+ ++b._idCounter),S(this,"element"),S(this,"rawProps",{}),S(this,"isBaseNode",!0),S(this,"_props"),S(this,"_deps"),S(this,"stableKey"),S(this,"lastPropsObj"),S(this,"lastSignature"),!n(e)){const t=r(e);if(p.isNodeInstance(e))throw new Error("Invalid element type: MeoNode UI instance provided!");throw new Error(`Invalid element type: ${t} provided!`)}if(this.element=e,this.rawProps=t,this._deps=s,p.isServer&&p.providesServerTheme(e)){const e=t.theme;if(e&&"object"==typeof e&&"system"in e){const t=e;f(t),g(t)}}const{ref:o,children:i,...l}=t;this.stableKey=this._getStableKey(l),p.isServer||b._navigationStarted||(m.getInstance().start(),b._navigationStarted=!0)}static get elementCache(){return o(w,()=>new Map)}static get _navigationStarted(){return o(k,()=>({value:!1})).value}static set _navigationStarted(e){o(k,()=>({value:!1})).value=e}static get renderContextPool(){return o(j,()=>[])}static acquireRenderContext(){const e=b.renderContextPool;return e.length>0?e.pop():{workStack:new Array(512),renderedElements:new Map}}static releaseRenderContext(e){b.renderContextPool.length<50&&e.workStack.length<2048&&(e.workStack.length=0,e.renderedElements.clear(),b.renderContextPool.push(e))}get props(){return this._props||(this._props=p.processProps(this.rawProps,this.stableKey)),this._props}get dependencies(){return this._deps}_getStableKey({key:e,...t}){if(p.isServer)return;if(this.lastPropsObj===t)return this.lastSignature;this.lastPropsObj=t;const n=Object.keys(t),s=n.length;if(s>100){const e=p.extractCriticalProps(t,n);this.lastSignature=p.createPropSignature(this.element,e),c&&s>200&&console.warn(`MeoNode: Large props (${s} keys) on "${l(this.element)}". Consider splitting.`)}else this.lastSignature=p.createPropSignature(this.element,t);return null!=e?`${String(e)}:${this.lastSignature}`:this.lastSignature}static get cacheCleanupRegistry(){return o(P,()=>new FinalizationRegistry(e=>{const{cacheKey:t,instanceId:n}=e,s=b.elementCache.get(t);s?.instanceId===n&&b.elementCache.delete(t),d.isMounted(t)&&d.untrackMount(t)}))}render(n=!1){const r=p.shouldCacheElement(this)?b.elementCache.get(this.stableKey):void 0,o=p.shouldNodeUpdate(r?.prevDeps,this._deps,n);if(!o&&r?.renderedElement)return r.accessCount+=1,r.renderedElement;const l=!o,c=b.acquireRenderContext();let{workStack:d}=c;const{renderedElements:m}=c;let f=0;try{const n=e=>{if(e>d.length){const t=Math.max(e,d.length<<1),n=new Array(t);for(let e=0;e<f;e++)n[e]=d[e];d=n}};for(d[f++]={node:this,isProcessed:!1,blocked:l,theme:void 0};f>0;){const r=d[f-1];if(!r){f--;continue}const{node:o,isProcessed:l,blocked:c,theme:h}=r,g=(e,t)=>{const n=e.theme;return n&&"object"==typeof n&&"system"in n?n:t??y()};if(l){f--;const{children:n,key:r,css:l,nativeProps:c,disableEmotion:d,...y}=o.props,S=g(o.props,h);let w=[];if(n){const e=Array.isArray(n)?n:[n],t=e.length;w=new Array(t);for(let n=0;n<t;n++){const t=e[n];if(p.isNodeInstance(t)){const e=m.get(t);if(!e)throw new Error(`[MeoNode] Missing rendered element for child node: ${t.stableKey}`);w[n]=e}else w[n]=t}}const k=C({...y,key:r,...c});let j;if(o.element===e||s(o.element))j=t(o.element,{key:r},...w);else{const e=!d&&(l||!i(o.element))&&Object.keys(l||{}).length>0,n=p.isServer&&"string"!=typeof o.element,s=e&&n&&p.isClientReference(o.element);if(e&&!n||s){const e=p.isServer?C(l):l;j=t(a,{element:o.element,...k,css:e},...w)}else if(e&&n&&!p.acceptsServerCss(o.element)){const e=v.resolveObjWithTheme(C(l),S,{processFunctions:!0}),n=v.resolveDefaultStyle(e),s=u(n),r=[k.className,s].filter(Boolean).join(" ")||void 0,i=r?{...k,className:r}:k;j=t(o.element,i,...w)}else{const s=e&&(!n||p.acceptsServerCss(o.element))?{...k,css:l}:k;j=t(o.element,s,...w)}}if(o!==this&&p.shouldCacheElement(o)){const e=b.elementCache.get(o.stableKey);if(e)e.prevDeps=o._deps,e.renderedElement=j,e.accessCount+=1;else{const e={prevDeps:o._deps,renderedElement:j,nodeRef:new WeakRef(o),createdAt:Date.now(),accessCount:1,instanceId:o.instanceId};b.elementCache.set(o.stableKey,e),b.cacheCleanupRegistry.register(o,{cacheKey:o.stableKey,instanceId:o.instanceId},o)}}m.set(o,j)}else{r.isProcessed=!0;const e=o.props.children,t=g(o.props,h);if(e){const s=Array.isArray(e)?e:[e];let r=0;for(let e=0;e<s.length;e++)p.isNodeInstance(s[e])&&r++;n(f+r);for(let e=s.length-1;e>=0;e--){const n=s[e];if(!p.isNodeInstance(n))continue;const r=p.shouldCacheElement(n)?b.elementCache.get(n.stableKey):void 0,o=p.shouldNodeUpdate(r?.prevDeps,n._deps,c);if(!o&&r?.renderedElement){m.set(n,r.renderedElement);continue}const i=c||!o;d[f++]={node:n,isProcessed:!1,blocked:i,theme:t}}}}}let r=m.get(this);if(!p.isServer&&this.stableKey&&(r=t(h,{node:this},r)),p.shouldCacheElement(this)){const e=b.elementCache.get(this.stableKey);if(e)e.prevDeps=this._deps,e.renderedElement=r,e.accessCount+=1;else{const e={prevDeps:this._deps,renderedElement:r,nodeRef:new WeakRef(this),createdAt:Date.now(),accessCount:1,instanceId:this.instanceId};b.elementCache.set(this.stableKey,e),b.cacheCleanupRegistry.register(this,{cacheKey:this.stableKey,instanceId:this.instanceId},this)}}return r}finally{for(let e=0;e<f;e++)d[e]=null;b.releaseRenderContext({workStack:d,renderedElements:m})}}static clearCaches(){const e=Array.from(b.elementCache.keys());c&&console.log(`[MeoNode] clearCaches: Clearing ${e.length} entries`);for(const t of e){const e=b.elementCache.get(t);if(e){const n=e.nodeRef?.deref();if(n)try{b.cacheCleanupRegistry.unregister(n),n.lastSignature=void 0,n.lastPropsObj=void 0}catch{c&&console.warn(`[MeoNode] Could not unregister ${t} from FinalizationRegistry`)}}}b.elementCache.clear(),d.cleanup(),c&&console.log("[MeoNode] All caches cleared")}};S(_,"_idCounter",0);let E=_;function I(e,t={},n){return new E(e,t,n)}function N(e,t){const n=(n,s)=>I(e,{...t,...n},s);return n.element=e,n}function K(e,t){const n=(n,s,r)=>I(e,{...t,...s,children:n},r);return n.element=e,n}I.clearCaches=E.clearCaches;export{E as BaseNode,I as Node,K as createChildrenFirstNode,N as createNode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getGlobalState as e}from"../helper/common.helper.js";const t=Symbol.for("@meonode/ui/serverActiveTheme"),o=Symbol.for("@meonode/ui/serverThemeVariables");function
|
|
1
|
+
import{getGlobalState as e}from"../helper/common.helper.js";const t=Symbol.for("@meonode/ui/serverActiveTheme"),o=Symbol.for("@meonode/ui/serverThemeVariables");function r(){return e(t,()=>({})).activeTheme}function n(o){e(t,()=>({})).activeTheme=o}function s(e){return`--meonode-theme-${e.replace(/[^\w.-]/g,"-").replace(/\./g,"-")}`}function l(){return e(o,()=>({byName:new Map}))}function a(e){if(!e?.system||"object"!=typeof e.system)return;const t=l(),o=[{path:"",value:e.system}];for(;o.length>0;){const e=o.pop();if(!e||!e.value||"object"!=typeof e.value)continue;const r=e.value;for(const[n,l]of Object.entries(r)){const r=e.path?`${e.path}.${n}`:n;if(null!=l)if("string"!=typeof l&&"number"!=typeof l&&"boolean"!=typeof l){if("object"==typeof l){const e=l.default;"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||t.byName.set(s(r),String(e)),o.push({path:r,value:l})}}else t.byName.set(s(r),String(l))}}}function i(){const e=l();if(0===e.byName.size)return;const t=Array.from(e.byName.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t};`).join("");return e.byName.clear(),t?{id:"theme-vars",cssText:`:root{${t}}`}:void 0}function f(e){if(!e?.system||"object"!=typeof e.system)return"";const t=[],o=[{path:"",value:e.system}];for(;o.length>0;){const e=o.pop();if(!e||!e.value||"object"!=typeof e.value)continue;const r=e.value;for(const[n,l]of Object.entries(r)){const r=e.path?`${e.path}.${n}`:n;if(null!=l)if("string"!=typeof l&&"number"!=typeof l&&"boolean"!=typeof l){if("object"==typeof l){const e=l.default;"string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e||t.push([s(r),String(e)]),o.push({path:r,value:l})}}else t.push([s(r),String(l)])}}if(0===t.length)return"";return`:root{${t.sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t};`).join("")}}`}function c(e){const t=/theme\.([a-zA-Z0-9_.-]+)/g,o=e=>{if(!e.includes("theme."))return e;t.lastIndex=0;let o=!1;const r=e.replace(t,(e,t)=>(o=!0,`var(${s(t)})`));return o?r:e},r=e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};if("string"==typeof e)return o(e);if(!r(e)&&!Array.isArray(e))return e;const n=[{value:e,isProcessed:!1}],l=new Map,a=new Set;for(;n.length>0;){const e=n[n.length-1],t=e.value;if(r(t)||Array.isArray(t))if(l.has(t))n.pop();else if(e.isProcessed){n.pop(),a.delete(t);let e=t;if(Array.isArray(t)){let n=null;for(let e=0;e<t.length;e++){const s=t[e];let a=s;"string"==typeof s?a=o(s):(r(s)||Array.isArray(s))&&(a=l.get(s)??s),a!==s&&(null===n&&(n=[...t]),n[e]=a)}null!==n&&(e=n)}else{let n=null;const s=t;for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const t=s[e];let a=e,i=t;e.includes("theme.")&&(a=o(e)),"string"==typeof t?i=o(t):(r(t)||Array.isArray(t))&&(i=l.get(t)??t),i===t&&a===e||(null===n&&(n={...s}),a!==e&&delete n[e],n[a]=i)}null!==n&&(e=n)}l.set(t,e)}else{e.isProcessed=!0,a.add(t);const o=Array.isArray(t)?t:Object.values(t);for(let e=o.length-1;e>=0;e--){const t=o[e];!r(t)&&!Array.isArray(t)||a.has(t)||n.push({value:t,isProcessed:!1})}}else n.pop()}return l.get(e)??e}export{f as buildThemeVariablesCss,i as consumeServerThemeVariablesCss,r as getActiveServerTheme,a as registerServerThemeVariables,c as replaceThemeTokensWithCssVars,n as setActiveServerTheme};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled-renderer.client.d.ts","sourceRoot":"","sources":["../../../src/components/styled-renderer.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAInE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,WAAW;IACxD,OAAO,EAAE,CAAC,CAAA;IACV,QAAQ,EAAE,SAAS,CAAA;IACnB,GAAG,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;;GASG;AACH,iBAAwB,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAChG,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"styled-renderer.client.d.ts","sourceRoot":"","sources":["../../../src/components/styled-renderer.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAInE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,WAAW;IACxD,OAAO,EAAE,CAAC,CAAA;IACV,QAAQ,EAAE,SAAS,CAAA;IACnB,GAAG,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;;GASG;AACH,iBAAwB,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAChG,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,OAAO,CAgB/C;kBApBuB,cAAc;;;eAAd,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../../src/core.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,YAAY,EAElB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,SAAS,EACT,OAAO,EAGR,MA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E,UAAU,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IACvJ,OAAO,EAAE,CAAC,CAAA;CACX,CAKJ;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,sBAAsB,EAAE,CAAC,SAAS,eAAe,EAAE,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAClI,OAAO,EAAE,CAAC,EACV,YAAY,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,sBAAsB,EAAE,iBAAiB,CAAC,GACvE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACxC,CAAC,CAAC,eAAe,GAAG,SAAS,EAAE,UAAU,SAAS,MAAM,GAAG,MAAM,EAC/D,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,WAAW,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,EACzE,IAAI,CAAC,EAAE,cAAc,KAClB,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,GACtC,CAAC,CAAC,eAAe,GAAG,SAAS,EAAE,UAAU,SAAS,MAAM,GAAG,MAAM,EAC/D,QAAQ,CAAC,EAAE,QAAQ,EACnB,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,EAC1E,IAAI,CAAC,EAAE,cAAc,KAClB,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IACtB,OAAO,EAAE,CAAC,CAAA;CACX,CAQJ"}
|
|
@@ -12,5 +12,20 @@ export declare function consumeServerThemeVariablesCss(): {
|
|
|
12
12
|
* SPA flows (Vite/CRA) where there is no SSR emission to pick up.
|
|
13
13
|
*/
|
|
14
14
|
export declare function buildThemeVariablesCss(theme: Theme): string;
|
|
15
|
+
/**
|
|
16
|
+
* Replaces `theme.*` token strings with `var(--meonode-theme-*)` references,
|
|
17
|
+
* walking arbitrary structures iteratively with copy-on-write semantics.
|
|
18
|
+
*
|
|
19
|
+
* Mirrors `ThemeUtil.resolveObjWithTheme`'s traversal contract:
|
|
20
|
+
* - Only descends into plain objects and arrays. Class instances (refs,
|
|
21
|
+
* Date, RegExp, MUI internals, React elements, etc.) are passed through
|
|
22
|
+
* untouched so their identity and prototype chain are preserved.
|
|
23
|
+
* - Copy-on-write: untouched subtrees keep their original reference, which
|
|
24
|
+
* matters when forwarding props to memoized components.
|
|
25
|
+
* - Iterative with a manual work stack — safe for deeply nested trees.
|
|
26
|
+
* - Detects cycles via a path Set.
|
|
27
|
+
* - Replaces tokens inside object keys too (e.g. nested selectors/media
|
|
28
|
+
* queries that embed `theme.*` references).
|
|
29
|
+
*/
|
|
15
30
|
export declare function replaceThemeTokensWithCssVars<T>(value: T): T;
|
|
16
31
|
//# sourceMappingURL=server-theme.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-theme.util.d.ts","sourceRoot":"","sources":["../../../src/util/server-theme.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAapD,wBAAgB,oBAAoB,IAAI,KAAK,GAAG,SAAS,CAExD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAEvD;AAUD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CA6B/D;AAED,wBAAgB,8BAA8B,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAU5F;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAmC3D;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"server-theme.util.d.ts","sourceRoot":"","sources":["../../../src/util/server-theme.util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAapD,wBAAgB,oBAAoB,IAAI,KAAK,GAAG,SAAS,CAExD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAEvD;AAUD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CA6B/D;AAED,wBAAgB,8BAA8B,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAU5F;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAmC3D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA0G5D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meonode/ui",
|
|
3
3
|
"description": "A structured approach to component composition, direct CSS-first prop styling, built-in theming, smart prop handling (including raw property pass-through), and dynamic children.",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/esm/main.js",
|
|
11
11
|
"require": "./dist/cjs/main.cjs",
|
|
12
|
-
"types": "./dist/
|
|
12
|
+
"types": "./dist/types/main.d.ts"
|
|
13
13
|
},
|
|
14
14
|
"./client": {
|
|
15
15
|
"import": "./dist/esm/client.js",
|
|
16
16
|
"require": "./dist/cjs/client.cjs",
|
|
17
|
-
"types": "./dist/
|
|
17
|
+
"types": "./dist/types/client.d.ts"
|
|
18
18
|
},
|
|
19
19
|
"./nextjs-registry": {
|
|
20
20
|
"import": "./dist/esm/nextjs-registry/index.js",
|
|
21
21
|
"require": "./dist/cjs/nextjs-registry/index.cjs",
|
|
22
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/types/nextjs-registry/index.d.ts"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"watch:build": "bunx nodemon --watch src --ext ts,tsx,js,json --exec \"bun run build\"",
|
|
33
33
|
"lint": "eslint --fix && tsc --noEmit",
|
|
34
34
|
"test": "NODE_OPTIONS='--expose-gc' node --stack-size=10000 --max-old-space-size=8192 --experimental-vm-modules $(bun pm bin)/jest --ci --verbose --testPathIgnorePatterns=\"tests/performance.test.ts\" --testPathIgnorePatterns=\"tests/react-createelement-comparison.test.ts\" --testPathIgnorePatterns=\"tests/rsc-integration.test.ts\" --testPathIgnorePatterns=\"tests/build-output.test.ts\"",
|
|
35
|
-
"test:perf": "NODE_OPTIONS='--expose-gc' node --stack-size=10000 --max-old-space-size=8192 --experimental-vm-modules
|
|
36
|
-
"test:all": "NODE_OPTIONS='--expose-gc' node --stack-size=10000 --max-old-space-size=8192 --experimental-vm-modules
|
|
35
|
+
"test:perf": "NODE_OPTIONS='--expose-gc' node --stack-size=10000 --max-old-space-size=8192 --experimental-vm-modules $(bun pm bin)/jest --ci --verbose tests/performance.test.ts tests/react-createelement-comparison.test.ts",
|
|
36
|
+
"test:all": "NODE_OPTIONS='--expose-gc' node --stack-size=10000 --max-old-space-size=8192 --experimental-vm-modules $(bun pm bin)/jest --ci --verbose --testPathIgnorePatterns=\"tests/rsc-integration.test.ts\" --testPathIgnorePatterns=\"tests/build-output.test.ts\"",
|
|
37
37
|
"test:rsc": "NODE_OPTIONS='--experimental-vm-modules' node $(bun pm bin)/jest --config jest.integration.config.ts --ci --verbose --runInBand",
|
|
38
38
|
"prepare:rsc-fixture": "cd tests/rsc-fixtures/next-app && bun install",
|
|
39
39
|
"verify": "bun run prepare:rsc-fixture && bun run lint && bun run tsc --noEmit && bun run test && bun run test:rsc",
|
|
40
|
-
"build": "rm -rf ./dist && rollup -c rollup.config.ts --configPlugin typescript && tsc -p tsconfig.build.json --diagnostics && tsc-alias -p tsconfig.build.json",
|
|
40
|
+
"build": "rm -rf ./dist && rollup -c rollup.config.ts --configPlugin 'typescript={tsconfig:\"./tsconfig.rollup-config.json\"}' && tsc -p tsconfig.build.json --diagnostics && tsc-alias -p tsconfig.build.json",
|
|
41
41
|
"semantic-release": "semantic-release",
|
|
42
42
|
"release": "semantic-release",
|
|
43
43
|
"release:dry": "semantic-release --dry-run",
|