@zenithbuild/core 0.6.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +20 -19
  2. package/cli/commands/add.ts +2 -2
  3. package/cli/commands/build.ts +2 -3
  4. package/cli/commands/dev.ts +182 -103
  5. package/cli/commands/index.ts +1 -1
  6. package/cli/commands/preview.ts +1 -1
  7. package/cli/commands/remove.ts +2 -2
  8. package/cli/index.ts +1 -1
  9. package/cli/main.ts +1 -1
  10. package/cli/utils/logger.ts +1 -1
  11. package/cli/utils/plugin-manager.ts +1 -1
  12. package/cli/utils/project.ts +4 -4
  13. package/core/components/ErrorPage.zen +218 -0
  14. package/core/components/index.ts +15 -0
  15. package/core/config.ts +1 -0
  16. package/core/index.ts +29 -0
  17. package/dist/compiler-native-frej59m4.node +0 -0
  18. package/dist/core/compiler-native-frej59m4.node +0 -0
  19. package/dist/core/index.js +6293 -0
  20. package/dist/runtime/lifecycle/index.js +1 -0
  21. package/dist/runtime/reactivity/index.js +1 -0
  22. package/dist/zen-build.js +7465 -19128
  23. package/dist/zen-dev.js +7465 -19128
  24. package/dist/zen-preview.js +7465 -19128
  25. package/dist/zenith.js +7465 -19128
  26. package/package.json +21 -22
  27. package/cli/utils/content.ts +0 -112
  28. package/compiler/README.md +0 -380
  29. package/compiler/build-analyzer.ts +0 -122
  30. package/compiler/css/index.ts +0 -317
  31. package/compiler/discovery/componentDiscovery.ts +0 -178
  32. package/compiler/discovery/layouts.ts +0 -70
  33. package/compiler/errors/compilerError.ts +0 -56
  34. package/compiler/finalize/finalizeOutput.ts +0 -192
  35. package/compiler/finalize/generateFinalBundle.ts +0 -82
  36. package/compiler/index.ts +0 -83
  37. package/compiler/ir/types.ts +0 -174
  38. package/compiler/output/types.ts +0 -34
  39. package/compiler/parse/detectMapExpressions.ts +0 -102
  40. package/compiler/parse/importTypes.ts +0 -78
  41. package/compiler/parse/parseImports.ts +0 -309
  42. package/compiler/parse/parseScript.ts +0 -46
  43. package/compiler/parse/parseTemplate.ts +0 -599
  44. package/compiler/parse/parseZenFile.ts +0 -66
  45. package/compiler/parse/scriptAnalysis.ts +0 -91
  46. package/compiler/parse/trackLoopContext.ts +0 -82
  47. package/compiler/runtime/dataExposure.ts +0 -317
  48. package/compiler/runtime/generateDOM.ts +0 -246
  49. package/compiler/runtime/generateHydrationBundle.ts +0 -407
  50. package/compiler/runtime/hydration.ts +0 -309
  51. package/compiler/runtime/navigation.ts +0 -432
  52. package/compiler/runtime/thinRuntime.ts +0 -160
  53. package/compiler/runtime/transformIR.ts +0 -370
  54. package/compiler/runtime/wrapExpression.ts +0 -95
  55. package/compiler/runtime/wrapExpressionWithLoop.ts +0 -83
  56. package/compiler/spa-build.ts +0 -917
  57. package/compiler/ssg-build.ts +0 -422
  58. package/compiler/test/validate-test.ts +0 -104
  59. package/compiler/transform/classifyExpression.ts +0 -444
  60. package/compiler/transform/componentResolver.ts +0 -312
  61. package/compiler/transform/componentScriptTransformer.ts +0 -303
  62. package/compiler/transform/expressionTransformer.ts +0 -385
  63. package/compiler/transform/fragmentLowering.ts +0 -634
  64. package/compiler/transform/generateBindings.ts +0 -47
  65. package/compiler/transform/generateHTML.ts +0 -28
  66. package/compiler/transform/layoutProcessor.ts +0 -132
  67. package/compiler/transform/slotResolver.ts +0 -292
  68. package/compiler/transform/transformNode.ts +0 -126
  69. package/compiler/transform/transformTemplate.ts +0 -38
  70. package/compiler/validate/invariants.ts +0 -292
  71. package/compiler/validate/validateExpressions.ts +0 -168
  72. package/core/config/index.ts +0 -16
  73. package/core/config/loader.ts +0 -69
  74. package/core/config/types.ts +0 -89
  75. package/core/plugins/index.ts +0 -7
  76. package/core/plugins/registry.ts +0 -81
  77. package/dist/cli.js +0 -11665
  78. package/router/manifest.ts +0 -314
  79. package/router/navigation/ZenLink.zen +0 -231
  80. package/router/navigation/index.ts +0 -78
  81. package/router/navigation/zen-link.ts +0 -584
  82. package/router/runtime.ts +0 -458
  83. package/router/types.ts +0 -168
  84. package/runtime/build.ts +0 -17
  85. package/runtime/bundle-generator.ts +0 -1247
  86. package/runtime/client-runtime.ts +0 -549
  87. package/runtime/serve.ts +0 -93
@@ -0,0 +1 @@
1
+ var q=[],A=new Set,y=!1;function B(j){let h={callback:j,cleanup:null,mounted:!1};if(y)G(h);else q.push(h);return A.add(h),()=>{let F=q.indexOf(h);if(F!==-1)q.splice(F,1);if(h.mounted&&h.cleanup)h.cleanup(),h.cleanup=null;A.delete(h)}}function G(j){if(j.mounted)return;j.mounted=!0;try{let h=j.callback();if(typeof h==="function")j.cleanup=h}catch(h){console.error("[Zenith] Error in onMount callback:",h)}}function J(){y=!0;let j=[...q];q.length=0;for(let h of j)G(h)}function K(){y=!1;for(let j of A){if(j.cleanup){try{j.cleanup()}catch(h){console.error("[Zenith] Error in onMount cleanup:",h)}j.cleanup=null}j.mounted=!1}}function L(){return y}function N(){y=!1,q.length=0,A.clear()}var w=new Set;function E(j){return w.add(j),()=>{w.delete(j)}}function Q(){for(let j of w)try{j()}catch(h){console.error("[Zenith] Error in onUnmount callback:",h)}w.clear()}function T(){return w.size}function V(){w.clear()}var D=B,P=E;var X=B,f=E;export{P as zenOnUnmount,D as zenOnMount,K as triggerUnmount,J as triggerMount,V as resetUnmountState,N as resetMountState,f as onUnmount,X as onMount,T as getUnmountCallbackCount,L as getIsMounted,Q as executeUnmountCallbacks};
@@ -0,0 +1 @@
1
+ var j=[],X=!1,Z=0,U=new Set;function S(){if(X)return;return j[j.length-1]}function $(q){j.push(q)}function K(){return j.pop()}function J(q){let F=S();if(F)q.add(F.execute),F.dependencies.add(q)}function W(q){let F=[...q];for(let I of F)if(Z>0)U.add(I);else I()}function Y(q){for(let F of q.dependencies)F.delete(q.execute);q.dependencies.clear()}function A(q){let F=X;X=!0;try{return q()}finally{X=F}}function B(){Z++}function R(){if(Z--,Z===0&&U.size>0){let q=[...U];U.clear();for(let F of q)F()}}function y(){return Z>0}function T(q){let F={value:q,subscribers:new Set};function I(G){if(arguments.length===0)return J(F.subscribers),F.value;else{let H=F.value;if(F.value=G,!Object.is(H,G))W(F.subscribers);return F.value}}return Object.defineProperty(I,"value",{get(){return J(F.subscribers),F.value},set(G){let H=F.value;if(F.value=G,!Object.is(H,G))W(F.subscribers)},enumerable:!0,configurable:!1}),I.peek=function(){return F.value},I.subscribe=function(G){let H=()=>G(F.value);return F.subscribers.add(H),()=>{F.subscribers.delete(H)}},I}var z=new WeakMap,V=new WeakMap;function N(q,F){let I=z.get(q);if(!I)I=new Map,z.set(q,I);let G=I.get(F);if(!G)G=new Set,I.set(F,G);return G}function m(q){if(q===null||typeof q!=="object")return!1;if(q instanceof Date||q instanceof RegExp||q instanceof Map||q instanceof Set||q instanceof WeakMap||q instanceof WeakSet||q instanceof Promise||ArrayBuffer.isView(q))return!1;return!0}function x(q){let F=V.get(q);if(F)return F;let I=new Proxy(q,{get(G,H,L){let O=N(G,H);J(O);let Q=Reflect.get(G,H,L);if(m(Q))return x(Q);return Q},set(G,H,L,O){let Q=Reflect.get(G,H,O),D=L,d=Reflect.set(G,H,D,O);if(!Object.is(Q,D)){let k=N(G,H);W(k)}return d},deleteProperty(G,H){let L=Reflect.has(G,H),O=Reflect.deleteProperty(G,H);if(L&&O){let Q=N(G,H);W(Q)}return O},has(G,H){let L=N(G,H);return J(L),Reflect.has(G,H)},ownKeys(G){let H=N(G,Symbol.for("zen:keys"));return J(H),Reflect.ownKeys(G)}});return V.set(q,I),I}function M(q){if(!m(q))throw Error("zenState requires a plain object or array");return x(q)}function P(q){let F={fn:q,cleanup:null,context:{execute:()=>v(F),dependencies:new Set},disposed:!1};return v(F),()=>f(F)}function v(q){if(q.disposed)return;if(q.cleanup)q.cleanup(),q.cleanup=null;Y(q.context),$(q.context);try{let F=q.fn();if(typeof F==="function")q.cleanup=F}finally{K()}}function f(q){if(q.disposed)return;if(q.disposed=!0,q.cleanup)q.cleanup(),q.cleanup=null;Y(q.context)}function E(q){let F={fn:q,value:void 0,dirty:!0,context:{execute:()=>g(F),dependencies:new Set},subscribers:new Set,initialized:!1};function I(){if(J(F.subscribers),F.dirty)h(F);return F.value}return I.peek=function(){if(F.dirty&&!F.initialized)h(F);return F.value},I}function h(q){Y(q.context),$(q.context);try{q.value=q.fn(),q.dirty=!1,q.initialized=!0}finally{K()}}function g(q){if(!q.dirty){q.dirty=!0;let F=[...q.subscribers];for(let I of F)I()}}function _(q){return{current:q}}function C(q){B();try{return q()}finally{R()}}function w(q){return A(q)}var Qq=T,Wq=M,Yq=P,Zq=E,$q=_,Kq=C,Nq=w,Xq=T,Uq=M,jq=P,Aq=E,Bq=_,Rq=C,Tq=w;export{Nq as zenUntrack,Wq as zenState,Qq as zenSignal,$q as zenRef,Zq as zenMemo,Yq as zenEffect,Kq as zenBatch,Tq as untrack,J as trackDependency,Uq as state,B as startBatch,Xq as signal,A as runUntracked,Bq as ref,$ as pushContext,K as popContext,W as notifySubscribers,Aq as memo,y as isBatching,S as getCurrentContext,R as endBatch,jq as effect,Y as cleanupContext,Rq as batch};