@adaas/are-html 0.0.2

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 (365) hide show
  1. package/.conf/tsconfig.base.json +87 -0
  2. package/.conf/tsconfig.browser.json +34 -0
  3. package/.conf/tsconfig.node.json +35 -0
  4. package/.nvmrc +1 -0
  5. package/LICENSE +13 -0
  6. package/README.md +678 -0
  7. package/dist/browser/index.d.mts +521 -0
  8. package/dist/browser/index.mjs +1782 -0
  9. package/dist/browser/index.mjs.map +1 -0
  10. package/dist/node/AreBinding.attribute-C6JasbJL.d.ts +110 -0
  11. package/dist/node/AreBinding.attribute-C6qrxN8K.d.mts +110 -0
  12. package/dist/node/attributes/AreBinding.attribute.d.mts +4 -0
  13. package/dist/node/attributes/AreBinding.attribute.d.ts +4 -0
  14. package/dist/node/attributes/AreBinding.attribute.js +15 -0
  15. package/dist/node/attributes/AreBinding.attribute.js.map +1 -0
  16. package/dist/node/attributes/AreBinding.attribute.mjs +14 -0
  17. package/dist/node/attributes/AreBinding.attribute.mjs.map +1 -0
  18. package/dist/node/attributes/AreDirective.attribute.d.mts +4 -0
  19. package/dist/node/attributes/AreDirective.attribute.d.ts +4 -0
  20. package/dist/node/attributes/AreDirective.attribute.js +20 -0
  21. package/dist/node/attributes/AreDirective.attribute.js.map +1 -0
  22. package/dist/node/attributes/AreDirective.attribute.mjs +19 -0
  23. package/dist/node/attributes/AreDirective.attribute.mjs.map +1 -0
  24. package/dist/node/attributes/AreEvent.attribute.d.mts +4 -0
  25. package/dist/node/attributes/AreEvent.attribute.d.ts +4 -0
  26. package/dist/node/attributes/AreEvent.attribute.js +10 -0
  27. package/dist/node/attributes/AreEvent.attribute.js.map +1 -0
  28. package/dist/node/attributes/AreEvent.attribute.mjs +9 -0
  29. package/dist/node/attributes/AreEvent.attribute.mjs.map +1 -0
  30. package/dist/node/attributes/AreStatic.attribute.d.mts +4 -0
  31. package/dist/node/attributes/AreStatic.attribute.d.ts +4 -0
  32. package/dist/node/attributes/AreStatic.attribute.js +10 -0
  33. package/dist/node/attributes/AreStatic.attribute.js.map +1 -0
  34. package/dist/node/attributes/AreStatic.attribute.mjs +9 -0
  35. package/dist/node/attributes/AreStatic.attribute.mjs.map +1 -0
  36. package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
  37. package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
  38. package/dist/node/directives/AreComponent.directive.d.mts +2 -0
  39. package/dist/node/directives/AreComponent.directive.d.ts +2 -0
  40. package/dist/node/directives/AreComponent.directive.js +4 -0
  41. package/dist/node/directives/AreComponent.directive.js.map +1 -0
  42. package/dist/node/directives/AreComponent.directive.mjs +3 -0
  43. package/dist/node/directives/AreComponent.directive.mjs.map +1 -0
  44. package/dist/node/directives/AreDirectiveFor.directive.d.mts +41 -0
  45. package/dist/node/directives/AreDirectiveFor.directive.d.ts +41 -0
  46. package/dist/node/directives/AreDirectiveFor.directive.js +206 -0
  47. package/dist/node/directives/AreDirectiveFor.directive.js.map +1 -0
  48. package/dist/node/directives/AreDirectiveFor.directive.mjs +196 -0
  49. package/dist/node/directives/AreDirectiveFor.directive.mjs.map +1 -0
  50. package/dist/node/directives/AreDirectiveIf.directive.d.mts +15 -0
  51. package/dist/node/directives/AreDirectiveIf.directive.d.ts +15 -0
  52. package/dist/node/directives/AreDirectiveIf.directive.js +91 -0
  53. package/dist/node/directives/AreDirectiveIf.directive.js.map +1 -0
  54. package/dist/node/directives/AreDirectiveIf.directive.mjs +81 -0
  55. package/dist/node/directives/AreDirectiveIf.directive.mjs.map +1 -0
  56. package/dist/node/engine/AreHTML.compiler.d.mts +27 -0
  57. package/dist/node/engine/AreHTML.compiler.d.ts +27 -0
  58. package/dist/node/engine/AreHTML.compiler.js +150 -0
  59. package/dist/node/engine/AreHTML.compiler.js.map +1 -0
  60. package/dist/node/engine/AreHTML.compiler.mjs +140 -0
  61. package/dist/node/engine/AreHTML.compiler.mjs.map +1 -0
  62. package/dist/node/engine/AreHTML.constants.d.mts +2 -0
  63. package/dist/node/engine/AreHTML.constants.d.ts +2 -0
  64. package/dist/node/engine/AreHTML.constants.js +4 -0
  65. package/dist/node/engine/AreHTML.constants.js.map +1 -0
  66. package/dist/node/engine/AreHTML.constants.mjs +3 -0
  67. package/dist/node/engine/AreHTML.constants.mjs.map +1 -0
  68. package/dist/node/engine/AreHTML.context.d.mts +108 -0
  69. package/dist/node/engine/AreHTML.context.d.ts +108 -0
  70. package/dist/node/engine/AreHTML.context.js +155 -0
  71. package/dist/node/engine/AreHTML.context.js.map +1 -0
  72. package/dist/node/engine/AreHTML.context.mjs +154 -0
  73. package/dist/node/engine/AreHTML.context.mjs.map +1 -0
  74. package/dist/node/engine/AreHTML.engine.d.mts +21 -0
  75. package/dist/node/engine/AreHTML.engine.d.ts +21 -0
  76. package/dist/node/engine/AreHTML.engine.js +191 -0
  77. package/dist/node/engine/AreHTML.engine.js.map +1 -0
  78. package/dist/node/engine/AreHTML.engine.mjs +181 -0
  79. package/dist/node/engine/AreHTML.engine.mjs.map +1 -0
  80. package/dist/node/engine/AreHTML.interpreter.d.mts +28 -0
  81. package/dist/node/engine/AreHTML.interpreter.d.ts +28 -0
  82. package/dist/node/engine/AreHTML.interpreter.js +340 -0
  83. package/dist/node/engine/AreHTML.interpreter.js.map +1 -0
  84. package/dist/node/engine/AreHTML.interpreter.mjs +330 -0
  85. package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -0
  86. package/dist/node/engine/AreHTML.lifecycle.d.mts +17 -0
  87. package/dist/node/engine/AreHTML.lifecycle.d.ts +17 -0
  88. package/dist/node/engine/AreHTML.lifecycle.js +91 -0
  89. package/dist/node/engine/AreHTML.lifecycle.js.map +1 -0
  90. package/dist/node/engine/AreHTML.lifecycle.mjs +79 -0
  91. package/dist/node/engine/AreHTML.lifecycle.mjs.map +1 -0
  92. package/dist/node/engine/AreHTML.tokenizer.d.mts +13 -0
  93. package/dist/node/engine/AreHTML.tokenizer.d.ts +13 -0
  94. package/dist/node/engine/AreHTML.tokenizer.js +83 -0
  95. package/dist/node/engine/AreHTML.tokenizer.js.map +1 -0
  96. package/dist/node/engine/AreHTML.tokenizer.mjs +71 -0
  97. package/dist/node/engine/AreHTML.tokenizer.mjs.map +1 -0
  98. package/dist/node/engine/AreHTML.transformer.d.mts +11 -0
  99. package/dist/node/engine/AreHTML.transformer.d.ts +11 -0
  100. package/dist/node/engine/AreHTML.transformer.js +44 -0
  101. package/dist/node/engine/AreHTML.transformer.js.map +1 -0
  102. package/dist/node/engine/AreHTML.transformer.mjs +32 -0
  103. package/dist/node/engine/AreHTML.transformer.mjs.map +1 -0
  104. package/dist/node/engine/AreHTML.types.d.mts +6 -0
  105. package/dist/node/engine/AreHTML.types.d.ts +6 -0
  106. package/dist/node/engine/AreHTML.types.js +4 -0
  107. package/dist/node/engine/AreHTML.types.js.map +1 -0
  108. package/dist/node/engine/AreHTML.types.mjs +3 -0
  109. package/dist/node/engine/AreHTML.types.mjs.map +1 -0
  110. package/dist/node/index.d.mts +39 -0
  111. package/dist/node/index.d.ts +39 -0
  112. package/dist/node/index.js +294 -0
  113. package/dist/node/index.js.map +1 -0
  114. package/dist/node/index.mjs +43 -0
  115. package/dist/node/index.mjs.map +1 -0
  116. package/dist/node/instructions/AddAttribute.instruction.d.mts +9 -0
  117. package/dist/node/instructions/AddAttribute.instruction.d.ts +9 -0
  118. package/dist/node/instructions/AddAttribute.instruction.js +32 -0
  119. package/dist/node/instructions/AddAttribute.instruction.js.map +1 -0
  120. package/dist/node/instructions/AddAttribute.instruction.mjs +25 -0
  121. package/dist/node/instructions/AddAttribute.instruction.mjs.map +1 -0
  122. package/dist/node/instructions/AddComment.instruction.d.mts +9 -0
  123. package/dist/node/instructions/AddComment.instruction.d.ts +9 -0
  124. package/dist/node/instructions/AddComment.instruction.js +35 -0
  125. package/dist/node/instructions/AddComment.instruction.js.map +1 -0
  126. package/dist/node/instructions/AddComment.instruction.mjs +28 -0
  127. package/dist/node/instructions/AddComment.instruction.mjs.map +1 -0
  128. package/dist/node/instructions/AddElement.instruction.d.mts +8 -0
  129. package/dist/node/instructions/AddElement.instruction.d.ts +8 -0
  130. package/dist/node/instructions/AddElement.instruction.js +32 -0
  131. package/dist/node/instructions/AddElement.instruction.js.map +1 -0
  132. package/dist/node/instructions/AddElement.instruction.mjs +25 -0
  133. package/dist/node/instructions/AddElement.instruction.mjs.map +1 -0
  134. package/dist/node/instructions/AddInterpolation.instruction.d.mts +8 -0
  135. package/dist/node/instructions/AddInterpolation.instruction.d.ts +8 -0
  136. package/dist/node/instructions/AddInterpolation.instruction.js +32 -0
  137. package/dist/node/instructions/AddInterpolation.instruction.js.map +1 -0
  138. package/dist/node/instructions/AddInterpolation.instruction.mjs +25 -0
  139. package/dist/node/instructions/AddInterpolation.instruction.mjs.map +1 -0
  140. package/dist/node/instructions/AddListener.instruction.d.mts +8 -0
  141. package/dist/node/instructions/AddListener.instruction.d.ts +8 -0
  142. package/dist/node/instructions/AddListener.instruction.js +32 -0
  143. package/dist/node/instructions/AddListener.instruction.js.map +1 -0
  144. package/dist/node/instructions/AddListener.instruction.mjs +25 -0
  145. package/dist/node/instructions/AddListener.instruction.mjs.map +1 -0
  146. package/dist/node/instructions/AddStyle.instruction.d.mts +8 -0
  147. package/dist/node/instructions/AddStyle.instruction.d.ts +8 -0
  148. package/dist/node/instructions/AddStyle.instruction.js +32 -0
  149. package/dist/node/instructions/AddStyle.instruction.js.map +1 -0
  150. package/dist/node/instructions/AddStyle.instruction.mjs +25 -0
  151. package/dist/node/instructions/AddStyle.instruction.mjs.map +1 -0
  152. package/dist/node/instructions/AddText.instruction.d.mts +8 -0
  153. package/dist/node/instructions/AddText.instruction.d.ts +8 -0
  154. package/dist/node/instructions/AddText.instruction.js +32 -0
  155. package/dist/node/instructions/AddText.instruction.js.map +1 -0
  156. package/dist/node/instructions/AddText.instruction.mjs +25 -0
  157. package/dist/node/instructions/AddText.instruction.mjs.map +1 -0
  158. package/dist/node/instructions/AreHTML.instructions.constants.d.mts +11 -0
  159. package/dist/node/instructions/AreHTML.instructions.constants.d.ts +11 -0
  160. package/dist/node/instructions/AreHTML.instructions.constants.js +15 -0
  161. package/dist/node/instructions/AreHTML.instructions.constants.js.map +1 -0
  162. package/dist/node/instructions/AreHTML.instructions.constants.mjs +15 -0
  163. package/dist/node/instructions/AreHTML.instructions.constants.mjs.map +1 -0
  164. package/dist/node/instructions/AreHTML.instructions.types.d.mts +46 -0
  165. package/dist/node/instructions/AreHTML.instructions.types.d.ts +46 -0
  166. package/dist/node/instructions/AreHTML.instructions.types.js +4 -0
  167. package/dist/node/instructions/AreHTML.instructions.types.js.map +1 -0
  168. package/dist/node/instructions/AreHTML.instructions.types.mjs +3 -0
  169. package/dist/node/instructions/AreHTML.instructions.types.mjs.map +1 -0
  170. package/dist/node/lib/AreDirective/AreDirective.component.d.mts +4 -0
  171. package/dist/node/lib/AreDirective/AreDirective.component.d.ts +4 -0
  172. package/dist/node/lib/AreDirective/AreDirective.component.js +117 -0
  173. package/dist/node/lib/AreDirective/AreDirective.component.js.map +1 -0
  174. package/dist/node/lib/AreDirective/AreDirective.component.mjs +107 -0
  175. package/dist/node/lib/AreDirective/AreDirective.component.mjs.map +1 -0
  176. package/dist/node/lib/AreDirective/AreDirective.constants.d.mts +16 -0
  177. package/dist/node/lib/AreDirective/AreDirective.constants.d.ts +16 -0
  178. package/dist/node/lib/AreDirective/AreDirective.constants.js +20 -0
  179. package/dist/node/lib/AreDirective/AreDirective.constants.js.map +1 -0
  180. package/dist/node/lib/AreDirective/AreDirective.constants.mjs +20 -0
  181. package/dist/node/lib/AreDirective/AreDirective.constants.mjs.map +1 -0
  182. package/dist/node/lib/AreDirective/AreDirective.context.d.mts +9 -0
  183. package/dist/node/lib/AreDirective/AreDirective.context.d.ts +9 -0
  184. package/dist/node/lib/AreDirective/AreDirective.context.js +14 -0
  185. package/dist/node/lib/AreDirective/AreDirective.context.js.map +1 -0
  186. package/dist/node/lib/AreDirective/AreDirective.context.mjs +13 -0
  187. package/dist/node/lib/AreDirective/AreDirective.context.mjs.map +1 -0
  188. package/dist/node/lib/AreDirective/AreDirective.meta.d.mts +7 -0
  189. package/dist/node/lib/AreDirective/AreDirective.meta.d.ts +7 -0
  190. package/dist/node/lib/AreDirective/AreDirective.meta.js +14 -0
  191. package/dist/node/lib/AreDirective/AreDirective.meta.js.map +1 -0
  192. package/dist/node/lib/AreDirective/AreDirective.meta.mjs +13 -0
  193. package/dist/node/lib/AreDirective/AreDirective.meta.mjs.map +1 -0
  194. package/dist/node/lib/AreDirective/AreDirective.types.d.mts +17 -0
  195. package/dist/node/lib/AreDirective/AreDirective.types.d.ts +17 -0
  196. package/dist/node/lib/AreDirective/AreDirective.types.js +4 -0
  197. package/dist/node/lib/AreDirective/AreDirective.types.js.map +1 -0
  198. package/dist/node/lib/AreDirective/AreDirective.types.mjs +3 -0
  199. package/dist/node/lib/AreDirective/AreDirective.types.mjs.map +1 -0
  200. package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.mts +13 -0
  201. package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.ts +13 -0
  202. package/dist/node/lib/AreHTML/AreHTML.tokenizer.js +82 -0
  203. package/dist/node/lib/AreHTML/AreHTML.tokenizer.js.map +1 -0
  204. package/dist/node/lib/AreHTML/AreHTML.tokenizer.mjs +70 -0
  205. package/dist/node/lib/AreHTML/AreHTML.tokenizer.mjs.map +1 -0
  206. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.mts +4 -0
  207. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.ts +4 -0
  208. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js +13 -0
  209. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js.map +1 -0
  210. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs +12 -0
  211. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs.map +1 -0
  212. package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.mts +4 -0
  213. package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.ts +4 -0
  214. package/dist/node/lib/AreHTMLNode/AreHTMLNode.js +82 -0
  215. package/dist/node/lib/AreHTMLNode/AreHTMLNode.js.map +1 -0
  216. package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs +75 -0
  217. package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs.map +1 -0
  218. package/dist/node/lib/AreRoot/AreRoot.component.d.mts +13 -0
  219. package/dist/node/lib/AreRoot/AreRoot.component.d.ts +13 -0
  220. package/dist/node/lib/AreRoot/AreRoot.component.js +117 -0
  221. package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -0
  222. package/dist/node/lib/AreRoot/AreRoot.component.mjs +107 -0
  223. package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -0
  224. package/dist/node/lib/AreStyle/AreStyle.context.d.mts +8 -0
  225. package/dist/node/lib/AreStyle/AreStyle.context.d.ts +8 -0
  226. package/dist/node/lib/AreStyle/AreStyle.context.js +16 -0
  227. package/dist/node/lib/AreStyle/AreStyle.context.js.map +1 -0
  228. package/dist/node/lib/AreStyle/AreStyle.context.mjs +15 -0
  229. package/dist/node/lib/AreStyle/AreStyle.context.mjs.map +1 -0
  230. package/dist/node/lib/AreStyle/AreStyle.types.d.mts +2 -0
  231. package/dist/node/lib/AreStyle/AreStyle.types.d.ts +2 -0
  232. package/dist/node/lib/AreStyle/AreStyle.types.js +4 -0
  233. package/dist/node/lib/AreStyle/AreStyle.types.js.map +1 -0
  234. package/dist/node/lib/AreStyle/AreStyle.types.mjs +3 -0
  235. package/dist/node/lib/AreStyle/AreStyle.types.mjs.map +1 -0
  236. package/dist/node/lib/AreWatcher/AreWatcher.component.d.mts +18 -0
  237. package/dist/node/lib/AreWatcher/AreWatcher.component.d.ts +18 -0
  238. package/dist/node/lib/AreWatcher/AreWatcher.component.js +78 -0
  239. package/dist/node/lib/AreWatcher/AreWatcher.component.js.map +1 -0
  240. package/dist/node/lib/AreWatcher/AreWatcher.component.mjs +71 -0
  241. package/dist/node/lib/AreWatcher/AreWatcher.component.mjs.map +1 -0
  242. package/dist/node/nodes/AreComment.d.mts +10 -0
  243. package/dist/node/nodes/AreComment.d.ts +10 -0
  244. package/dist/node/nodes/AreComment.js +19 -0
  245. package/dist/node/nodes/AreComment.js.map +1 -0
  246. package/dist/node/nodes/AreComment.mjs +18 -0
  247. package/dist/node/nodes/AreComment.mjs.map +1 -0
  248. package/dist/node/nodes/AreComponent.d.mts +17 -0
  249. package/dist/node/nodes/AreComponent.d.ts +17 -0
  250. package/dist/node/nodes/AreComponent.js +35 -0
  251. package/dist/node/nodes/AreComponent.js.map +1 -0
  252. package/dist/node/nodes/AreComponent.mjs +28 -0
  253. package/dist/node/nodes/AreComponent.mjs.map +1 -0
  254. package/dist/node/nodes/AreInterpolation.d.mts +10 -0
  255. package/dist/node/nodes/AreInterpolation.d.ts +10 -0
  256. package/dist/node/nodes/AreInterpolation.js +19 -0
  257. package/dist/node/nodes/AreInterpolation.js.map +1 -0
  258. package/dist/node/nodes/AreInterpolation.mjs +18 -0
  259. package/dist/node/nodes/AreInterpolation.mjs.map +1 -0
  260. package/dist/node/nodes/AreRoot.d.mts +21 -0
  261. package/dist/node/nodes/AreRoot.d.ts +21 -0
  262. package/dist/node/nodes/AreRoot.js +41 -0
  263. package/dist/node/nodes/AreRoot.js.map +1 -0
  264. package/dist/node/nodes/AreRoot.mjs +34 -0
  265. package/dist/node/nodes/AreRoot.mjs.map +1 -0
  266. package/dist/node/nodes/AreText.d.mts +10 -0
  267. package/dist/node/nodes/AreText.d.ts +10 -0
  268. package/dist/node/nodes/AreText.js +19 -0
  269. package/dist/node/nodes/AreText.js.map +1 -0
  270. package/dist/node/nodes/AreText.mjs +18 -0
  271. package/dist/node/nodes/AreText.mjs.map +1 -0
  272. package/dist/node/signals/AreRoute.signal.d.mts +12 -0
  273. package/dist/node/signals/AreRoute.signal.d.ts +12 -0
  274. package/dist/node/signals/AreRoute.signal.js +25 -0
  275. package/dist/node/signals/AreRoute.signal.js.map +1 -0
  276. package/dist/node/signals/AreRoute.signal.mjs +24 -0
  277. package/dist/node/signals/AreRoute.signal.mjs.map +1 -0
  278. package/docs/a-logo-docs.png +0 -0
  279. package/examples/dashboard/concept.ts +60 -0
  280. package/examples/dashboard/containers/UI.container.ts +233 -0
  281. package/examples/dashboard/dist/index.html +22 -0
  282. package/examples/dashboard/dist/mnzfypsd-6zjt7w.js +11454 -0
  283. package/examples/dashboard/dist/styles.css +792 -0
  284. package/examples/dashboard/public/index.html +22 -0
  285. package/examples/dashboard/public/styles.css +792 -0
  286. package/examples/dashboard/src/components/DashboardApp.component.ts +31 -0
  287. package/examples/dashboard/src/components/DashboardHeader.component.ts +40 -0
  288. package/examples/dashboard/src/components/DashboardLogo.component.ts +29 -0
  289. package/examples/dashboard/src/components/DashboardMain.component.ts +57 -0
  290. package/examples/dashboard/src/components/DashboardMenu.component.ts +94 -0
  291. package/examples/dashboard/src/components/DashboardNav.component.ts +28 -0
  292. package/examples/dashboard/src/components/DashboardNavItem.component.ts +32 -0
  293. package/examples/dashboard/src/components/DashboardSidebar.component.ts +43 -0
  294. package/examples/dashboard/src/components/DashboardStatCard.component.ts +71 -0
  295. package/examples/dashboard/src/components/DashboardStats.component.ts +28 -0
  296. package/examples/dashboard/src/components/DashboardTable.component.ts +138 -0
  297. package/examples/dashboard/src/components/DashboardUserCard.component.ts +39 -0
  298. package/examples/dashboard/src/concept.ts +93 -0
  299. package/examples/jumpstart/concept.ts +60 -0
  300. package/examples/jumpstart/containers/UI.container.ts +233 -0
  301. package/examples/jumpstart/dist/index.html +104 -0
  302. package/examples/jumpstart/dist/mnpl1g4i-nobz9g.js +10882 -0
  303. package/examples/jumpstart/dist/static/css/main.css +40 -0
  304. package/examples/jumpstart/dist/static/img/test.png +0 -0
  305. package/examples/jumpstart/public/index.html +104 -0
  306. package/examples/jumpstart/public/static/css/main.css +40 -0
  307. package/examples/jumpstart/public/static/img/test.png +0 -0
  308. package/examples/jumpstart/src/components/A-Btn.component.ts +150 -0
  309. package/examples/jumpstart/src/components/A-Input.component.ts +78 -0
  310. package/examples/jumpstart/src/components/A-Navigation.component.ts +167 -0
  311. package/examples/jumpstart/src/components/List.component.ts +138 -0
  312. package/examples/jumpstart/src/components/PromptTextArea.component.ts +359 -0
  313. package/examples/jumpstart/src/components/SignInComponent.component.ts +127 -0
  314. package/examples/jumpstart/src/concept.ts +105 -0
  315. package/jest.config.ts +61 -0
  316. package/package.json +110 -0
  317. package/src/attributes/AreBinding.attribute.ts +19 -0
  318. package/src/attributes/AreDirective.attribute.ts +26 -0
  319. package/src/attributes/AreEvent.attribute.ts +5 -0
  320. package/src/attributes/AreStatic.attribute.ts +6 -0
  321. package/src/directives/AreComponent.directive.ts +0 -0
  322. package/src/directives/AreDirectiveFor.directive.ts +322 -0
  323. package/src/directives/AreDirectiveIf.directive.ts +130 -0
  324. package/src/engine/AreHTML.compiler.ts +226 -0
  325. package/src/engine/AreHTML.constants.ts +2 -0
  326. package/src/engine/AreHTML.context.ts +196 -0
  327. package/src/engine/AreHTML.engine.ts +210 -0
  328. package/src/engine/AreHTML.interpreter.ts +466 -0
  329. package/src/engine/AreHTML.lifecycle.ts +96 -0
  330. package/src/engine/AreHTML.tokenizer.ts +90 -0
  331. package/src/engine/AreHTML.transformer.ts +37 -0
  332. package/src/engine/AreHTML.types.ts +6 -0
  333. package/src/index.ts +80 -0
  334. package/src/instructions/AddAttribute.instruction.ts +25 -0
  335. package/src/instructions/AddComment.instruction.ts +27 -0
  336. package/src/instructions/AddElement.instruction.ts +22 -0
  337. package/src/instructions/AddInterpolation.instruction.ts +24 -0
  338. package/src/instructions/AddListener.instruction.ts +24 -0
  339. package/src/instructions/AddStyle.instruction.ts +24 -0
  340. package/src/instructions/AddText.instruction.ts +21 -0
  341. package/src/instructions/AreHTML.instructions.constants.ts +11 -0
  342. package/src/instructions/AreHTML.instructions.types.ts +51 -0
  343. package/src/lib/AreDirective/AreDirective.component.ts +124 -0
  344. package/src/lib/AreDirective/AreDirective.constants.ts +16 -0
  345. package/src/lib/AreDirective/AreDirective.context.ts +16 -0
  346. package/src/lib/AreDirective/AreDirective.meta.ts +9 -0
  347. package/src/lib/AreDirective/AreDirective.types.ts +14 -0
  348. package/src/lib/AreHTML/AreHTML.tokenizer.ts +86 -0
  349. package/src/lib/AreHTMLAttribute/AreHTML.attribute.ts +13 -0
  350. package/src/lib/AreHTMLNode/AreHTMLNode.ts +84 -0
  351. package/src/lib/AreRoot/AreRoot.component.ts +134 -0
  352. package/src/lib/AreStyle/AreStyle.context.ts +20 -0
  353. package/src/lib/AreStyle/AreStyle.types.ts +0 -0
  354. package/src/lib/AreWatcher/AreWatcher.component.ts +84 -0
  355. package/src/nodes/AreComment.ts +17 -0
  356. package/src/nodes/AreComponent.ts +25 -0
  357. package/src/nodes/AreInterpolation.ts +16 -0
  358. package/src/nodes/AreRoot.ts +29 -0
  359. package/src/nodes/AreText.ts +17 -0
  360. package/src/signals/AreRoute.signal.ts +27 -0
  361. package/tests/AreTokenizer.test.ts +260 -0
  362. package/tests/jest.setup.ts +30 -0
  363. package/tsconfig.json +60 -0
  364. package/tslint.json +98 -0
  365. package/tsup.config.ts +108 -0
@@ -0,0 +1,16 @@
1
+ import { AreNodeNewProps } from "@adaas/are";
2
+ import { AreHTMLNode } from "@adaas/are-html/node";
3
+
4
+
5
+ export class AreInterpolation extends AreHTMLNode {
6
+
7
+ fromNew(newEntity: AreNodeNewProps): void {
8
+ super.fromNew({
9
+ ...newEntity,
10
+ payload:{
11
+ ...(newEntity.payload || {}),
12
+ entity: 'are-interpolation',
13
+ }
14
+ });
15
+ }
16
+ }
@@ -0,0 +1,29 @@
1
+ import { A_FormatterHelper, } from "@adaas/a-concept";
2
+ import { A_Frame } from "@adaas/a-frame";
3
+ import { Are } from "@adaas/are";
4
+ import { AreHTMLNode } from "@adaas/are-html/node";
5
+
6
+
7
+ @A_Frame.Entity({
8
+ namespace: 'A-ARE',
9
+ name: 'AreRootNode',
10
+ description: 'AreRootNode represents the root node in the scene graph. It extends the base AreHTMLNode and includes additional properties and methods specific to the root node, such as handling the root element and its associated component.'
11
+ })
12
+ export class AreRootNode extends AreHTMLNode {
13
+ /**
14
+ * For the root node, we can default to a generic container element like <div> since it serves as the root of the component tree and does not correspond to a specific HTML tag defined in the markup. The actual content and structure of the root node will be determined by the child nodes and components that are rendered within it, allowing for flexibility in how the root node is used and what it contains.
15
+ */
16
+ get tag(): string {
17
+ return 'div';
18
+ }
19
+ /**
20
+ * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own template, markup, styles, and features that are specific to the functionality it provides.
21
+ *
22
+ * Example: If the node type is "custom-component", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.
23
+ *
24
+ * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.
25
+ */
26
+ get component(): Are | undefined {
27
+ return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;
28
+ }
29
+ }
@@ -0,0 +1,17 @@
1
+ import { AreNodeNewProps } from "@adaas/are";
2
+ import { AreHTMLNode } from "@adaas/are-html/node";
3
+
4
+
5
+ export class AreText extends AreHTMLNode {
6
+
7
+
8
+ fromNew(newEntity: AreNodeNewProps): void {
9
+ super.fromNew({
10
+ ...newEntity,
11
+ payload: {
12
+ ...(newEntity.payload || {}),
13
+ entity: 'are-text',
14
+ }
15
+ });
16
+ }
17
+ }
@@ -0,0 +1,27 @@
1
+ import { A_Route } from "@adaas/a-utils/a-route";
2
+ import { A_Signal } from "@adaas/a-utils/a-signal";
3
+ import { AreSignal } from "@adaas/are";
4
+
5
+
6
+
7
+ export class AreRoute extends AreSignal<A_Route> {
8
+
9
+ constructor(path: string | RegExp) {
10
+ super({
11
+ data: new A_Route(path)
12
+ });
13
+ }
14
+
15
+ get route(): A_Route {
16
+ return this.data;
17
+ }
18
+
19
+ static default(): AreRoute | undefined {
20
+ return new AreRoute(document.location.pathname || '/');
21
+ }
22
+
23
+
24
+ compare(other: A_Signal<A_Route>): boolean {
25
+ return this.route.toRegExp().test(other.data.toString());
26
+ }
27
+ }
@@ -0,0 +1,260 @@
1
+ import { AreHTMLTokenizer } from '@adaas/are-html/tokenizer';
2
+ import { AreStaticAttribute } from '@adaas/are-html/attributes/AreStatic.attribute';
3
+ import { AreBindingAttribute } from '@adaas/are-html/attributes/AreBinding.attribute';
4
+ import { AreEventAttribute } from '@adaas/are-html/attributes/AreEvent.attribute';
5
+ import { AreDirectiveAttribute } from '@adaas/are-html/attributes/AreDirective.attribute';
6
+ import { AreHTMLEngine } from '@adaas/are-html/engine';
7
+ import { AreSyntaxTokenMatch } from '@adaas/are';
8
+
9
+ jest.retryTimes(0);
10
+
11
+
12
+ // ─────────────────────────────────────────────────────────────────────────────
13
+ // ── Helpers ───────────────────────────────────────────────────────────────────
14
+ // ─────────────────────────────────────────────────────────────────────────────
15
+
16
+ /**
17
+ * Returns a bare AreHTMLTokenizer instance without registering it in any scope,
18
+ * sufficient for testing pure attribute-extraction logic.
19
+ */
20
+ function makeTokenizer(): AreHTMLTokenizer {
21
+ // Object.create skips the constructor, so instance properties aren't set.
22
+ // Manually initialise ATTR_PATTERN (the only property extractAttributes needs).
23
+ const t = Object.create(AreHTMLTokenizer.prototype) as AreHTMLTokenizer;
24
+ t.ATTR_PATTERN = /([$:@]?[\w-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>/"'=]+)))?/g;
25
+ return t;
26
+ }
27
+
28
+ /**
29
+ * Returns an AreHTMLEngine instance so we can call its protected matchers
30
+ * directly without spinning up a full container.
31
+ */
32
+ function makeEngine(): AreHTMLEngine {
33
+ return Object.create(AreHTMLEngine.prototype) as AreHTMLEngine;
34
+ }
35
+
36
+ /** Minimal stub for the `build` callback required by the matcher methods. */
37
+ function buildStub(
38
+ raw: string,
39
+ content: string,
40
+ position: number,
41
+ closing: string,
42
+ ): AreSyntaxTokenMatch {
43
+ return { raw, content, position, closing, opening: '<', payload: {} } as unknown as AreSyntaxTokenMatch;
44
+ }
45
+
46
+
47
+ // ─────────────────────────────────────────────────────────────────────────────
48
+ // ── AreHTMLTokenizer — extractAttributes ─────────────────────────────────────
49
+ // ─────────────────────────────────────────────────────────────────────────────
50
+
51
+ describe('AreHTMLTokenizer — extractAttributes', () => {
52
+
53
+ it('parses plain static attributes', () => {
54
+ const tokenizer = makeTokenizer();
55
+ const attrs = tokenizer.extractAttributes('<div class="dashboard" id="main">');
56
+
57
+ expect(attrs).toHaveLength(2);
58
+ expect(attrs[0]).toBeInstanceOf(AreStaticAttribute);
59
+ expect(attrs[0].name).toBe('class');
60
+ expect(attrs[0].content).toBe('dashboard');
61
+ expect(attrs[1]).toBeInstanceOf(AreStaticAttribute);
62
+ expect(attrs[1].name).toBe('id');
63
+ expect(attrs[1].content).toBe('main');
64
+ });
65
+
66
+ it('parses a binding attribute prefixed with ":"', () => {
67
+ const tokenizer = makeTokenizer();
68
+ const attrs = tokenizer.extractAttributes('<span :class="dynamicClass">');
69
+
70
+ expect(attrs).toHaveLength(1);
71
+ expect(attrs[0]).toBeInstanceOf(AreBindingAttribute);
72
+ expect(attrs[0].name).toBe('class');
73
+ expect(attrs[0].content).toBe('dynamicClass');
74
+ });
75
+
76
+ it('parses an event attribute prefixed with "@"', () => {
77
+ const tokenizer = makeTokenizer();
78
+ const attrs = tokenizer.extractAttributes('<button @click="onSubmit">');
79
+
80
+ expect(attrs).toHaveLength(1);
81
+ expect(attrs[0]).toBeInstanceOf(AreEventAttribute);
82
+ expect(attrs[0].name).toBe('click');
83
+ expect(attrs[0].content).toBe('onSubmit');
84
+ });
85
+
86
+ it('parses a directive attribute prefixed with "$"', () => {
87
+ const tokenizer = makeTokenizer();
88
+ const attrs = tokenizer.extractAttributes('<div $if="isVisible">');
89
+
90
+ expect(attrs).toHaveLength(1);
91
+ expect(attrs[0]).toBeInstanceOf(AreDirectiveAttribute);
92
+ expect(attrs[0].name).toBe('if');
93
+ expect(attrs[0].content).toBe('isVisible');
94
+ });
95
+
96
+ it('parses a "$for" directive from a dashboard-style template', () => {
97
+ const tokenizer = makeTokenizer();
98
+ const attrs = tokenizer.extractAttributes('<tr $for="item in items">');
99
+
100
+ expect(attrs).toHaveLength(1);
101
+ expect(attrs[0]).toBeInstanceOf(AreDirectiveAttribute);
102
+ expect(attrs[0].name).toBe('for');
103
+ expect(attrs[0].content).toBe('item in items');
104
+ });
105
+
106
+ it('handles mixed attribute types on the same element', () => {
107
+ const tokenizer = makeTokenizer();
108
+ // Resembles a real dashboard nav-item: static class, binding, event, directive
109
+ const attrs = tokenizer.extractAttributes(
110
+ '<span class="nav-item" :class="activeClass" @click="navigate" $if="isVisible">'
111
+ );
112
+
113
+ expect(attrs).toHaveLength(4);
114
+ expect(attrs[0]).toBeInstanceOf(AreStaticAttribute);
115
+ expect(attrs[1]).toBeInstanceOf(AreBindingAttribute);
116
+ expect(attrs[2]).toBeInstanceOf(AreEventAttribute);
117
+ expect(attrs[3]).toBeInstanceOf(AreDirectiveAttribute);
118
+ });
119
+
120
+ it('returns an empty array for a tag with no attributes', () => {
121
+ const tokenizer = makeTokenizer();
122
+ const attrs = tokenizer.extractAttributes('<div>');
123
+
124
+ expect(attrs).toHaveLength(0);
125
+ });
126
+
127
+ it('returns an empty array for a self-closing tag with no attributes', () => {
128
+ const tokenizer = makeTokenizer();
129
+ const attrs = tokenizer.extractAttributes('<br/>');
130
+
131
+ expect(attrs).toHaveLength(0);
132
+ });
133
+
134
+ it('handles attribute values with single quotes', () => {
135
+ const tokenizer = makeTokenizer();
136
+ const attrs = tokenizer.extractAttributes(`<div class='stat-card'>`);
137
+
138
+ expect(attrs).toHaveLength(1);
139
+ expect(attrs[0]).toBeInstanceOf(AreStaticAttribute);
140
+ expect(attrs[0].content).toBe('stat-card');
141
+ });
142
+ });
143
+
144
+
145
+ // ─────────────────────────────────────────────────────────────────────────────
146
+ // ── AreHTMLEngine — htmlElementMatcher ───────────────────────────────────────
147
+ // ─────────────────────────────────────────────────────────────────────────────
148
+
149
+ describe('AreHTMLEngine — htmlElementMatcher', () => {
150
+
151
+ it('matches a simple element and returns correct raw/content', () => {
152
+ const engine = makeEngine();
153
+ const source = '<div class="dashboard"></div>';
154
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
155
+
156
+ expect(match).not.toBeNull();
157
+ expect(match!.raw).toBe('<div class="dashboard"></div>');
158
+ expect(match!.content).toBe('');
159
+ expect(match!.payload.entity).toBe('div');
160
+ expect(match!.payload.selfClose).toBe(false);
161
+ });
162
+
163
+ it('matches nested elements and captures inner content', () => {
164
+ const engine = makeEngine();
165
+ const source = '<header class="header"><dashboard-logo></dashboard-logo></header>';
166
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
167
+
168
+ expect(match).not.toBeNull();
169
+ expect(match!.payload.entity).toBe('header');
170
+ expect(match!.content).toBe('<dashboard-logo></dashboard-logo>');
171
+ });
172
+
173
+ it('matches a self-closing element', () => {
174
+ const engine = makeEngine();
175
+ const source = '<br/>';
176
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
177
+
178
+ expect(match).not.toBeNull();
179
+ expect(match!.payload.entity).toBe('br');
180
+ expect(match!.payload.selfClose).toBe(true);
181
+ });
182
+
183
+ it('skips HTML comments and still finds the next element', () => {
184
+ const engine = makeEngine();
185
+ const source = '<!-- header comment --><div></div>';
186
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
187
+
188
+ expect(match).not.toBeNull();
189
+ expect(match!.payload.entity).toBe('div');
190
+ });
191
+
192
+ it('matches deeply nested same-tag elements (nesting counter)', () => {
193
+ const engine = makeEngine();
194
+ const source = '<div><div>inner</div></div>';
195
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
196
+
197
+ expect(match).not.toBeNull();
198
+ expect(match!.raw).toBe('<div><div>inner</div></div>');
199
+ expect(match!.content).toBe('<div>inner</div>');
200
+ });
201
+
202
+ it('matches a custom component tag (e.g. dashboard-header)', () => {
203
+ const engine = makeEngine();
204
+ const source = '<dashboard-header></dashboard-header>';
205
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
206
+
207
+ expect(match).not.toBeNull();
208
+ expect(match!.payload.entity).toBe('dashboard-header');
209
+ });
210
+
211
+ it('extracts the id attribute into the payload', () => {
212
+ const engine = makeEngine();
213
+ const source = '<section id="stats-section"></section>';
214
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
215
+
216
+ expect(match).not.toBeNull();
217
+ expect(match!.payload.id).toBe('stats-section');
218
+ });
219
+
220
+ it('returns null for an empty string', () => {
221
+ const engine = makeEngine();
222
+ const match = (engine as any).htmlElementMatcher('', 0, 0, buildStub);
223
+
224
+ expect(match).toBeNull();
225
+ });
226
+
227
+ it('returns null when the source contains only a closing tag', () => {
228
+ const engine = makeEngine();
229
+ const source = '</div>';
230
+ const match = (engine as any).htmlElementMatcher(source, 0, source.length, buildStub);
231
+
232
+ expect(match).toBeNull();
233
+ });
234
+ });
235
+
236
+
237
+ // ─────────────────────────────────────────────────────────────────────────────
238
+ // ── AreHTMLEngine — rootElementMatcher ───────────────────────────────────────
239
+ // ─────────────────────────────────────────────────────────────────────────────
240
+
241
+ describe('AreHTMLEngine — rootElementMatcher', () => {
242
+
243
+ it('matches an <are-root> tag', () => {
244
+ const engine = makeEngine();
245
+ const source = '<are-root><div class="app"></div></are-root>';
246
+ const match = (engine as any).rootElementMatcher(source, 0, source.length, buildStub);
247
+
248
+ expect(match).not.toBeNull();
249
+ expect(match!.payload.entity).toBe('are-root');
250
+ expect(match!.content).toBe('<div class="app"></div>');
251
+ });
252
+
253
+ it('does not match a non-root tag', () => {
254
+ const engine = makeEngine();
255
+ const source = '<div class="dashboard"></div>';
256
+ const match = (engine as any).rootElementMatcher(source, 0, source.length, buildStub);
257
+
258
+ expect(match).toBeNull();
259
+ });
260
+ });
@@ -0,0 +1,30 @@
1
+ // import { A_Context } from '@adaas/a-concept/a-context';
2
+ // import fs from 'fs';
3
+
4
+ // /**
5
+ // * Base hooks for tests
6
+ // */
7
+ // beforeAll(async () => {
8
+
9
+ // return Promise.resolve();
10
+ // });
11
+
12
+ // afterAll(async () => {
13
+ // try {
14
+ // fs.unlinkSync('a-concept.conf.json');
15
+
16
+ // } catch (error) {
17
+
18
+ // }
19
+ // return Promise.resolve();
20
+ // });
21
+
22
+ // beforeEach(async () => {
23
+ // A_Context.reset();
24
+ // return Promise.resolve();
25
+ // });
26
+
27
+ // afterEach(async () => {
28
+ // A_Context.reset();
29
+ // return Promise.resolve();
30
+ // });
package/tsconfig.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "extends": "./.conf/tsconfig.base.json",
3
+
4
+ "compilerOptions": {
5
+ "rootDir": "./",
6
+ "baseUrl": ".",
7
+ /* ===============================
8
+ Internal aliases (DEV ONLY)
9
+ =============================== */
10
+ "paths": {
11
+ // Base ARE Entities
12
+ "@adaas/are-html/nodes/*": ["src/nodes/*"],
13
+ "@adaas/are-html/attributes/*": ["src/attributes/*"],
14
+ "@adaas/are-html/directives/*": ["src/directives/*"],
15
+ "@adaas/are-html/instructions/*": ["src/instructions/*"],
16
+ "@adaas/are-html/watchers/*": ["src/watchers/*"],
17
+ "@adaas/are-html/signals/*": ["src/signals/*"],
18
+ // Custom Lib Exports
19
+ "@adaas/are-html/style/*": ["src/lib/AreStyle/*"],
20
+ "@adaas/are-html/directive/*": ["src/lib/AreDirective/*"],
21
+ "@adaas/are-html/root/*": ["src/lib/AreRoot/*"],
22
+ "@adaas/are-html/node": ["src/lib/AreHTMLNode/AreHTMLNode"],
23
+ "@adaas/are-html/attribute": ["src/lib/AreHTMLAttribute/AreHTML.attribute"],
24
+ // HTML Engine Basics
25
+ "@adaas/are-html/compiler": ["src/engine/AreHTML.compiler"],
26
+ "@adaas/are-html/constants": ["src/engine/AreHTML.constants"],
27
+ "@adaas/are-html/context": ["src/engine/AreHTML.context"],
28
+ "@adaas/are-html/engine": ["src/engine/AreHTML.engine"],
29
+ "@adaas/are-html/interpreter": ["src/engine/AreHTML.interpreter.ts"],
30
+ "@adaas/are-html/lifecycle": ["src/engine/AreHTML.lifecycle"],
31
+ "@adaas/are-html/tokenizer": ["src/engine/AreHTML.tokenizer"],
32
+ "@adaas/are-html/transformer": ["src/engine/AreHTML.transformer"],
33
+ "@adaas/are-html/types": ["src/engine/AreHTML.types"],
34
+
35
+ },
36
+
37
+ /* ===============================
38
+ Types
39
+ =============================== */
40
+ "types": [
41
+ "node",
42
+ "jest",
43
+ "mocha",
44
+ ],
45
+ "typeRoots": ["node_modules/@types"]
46
+ },
47
+
48
+ "include": [
49
+ "src/**/*",
50
+ "tests/**/*",
51
+ "examples/**/*.ts",
52
+ "src/index.ts",
53
+ "src/env/global.browser.d.ts"
54
+ ],
55
+
56
+ "exclude": [
57
+ "node_modules",
58
+ "dist",
59
+ ]
60
+ }
package/tslint.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "extends": [
3
+ "tslint-react",
4
+ "tslint-config-standard",
5
+ "tslint-microsoft-contrib",
6
+ "tslint-config-prettier"
7
+ ],
8
+ "rules": {
9
+ "array-bracket-spacing": [true, "never"],
10
+ "arrow-return-shorthand": true,
11
+ "no-backbone-get-set-outside-model": false,
12
+ "completed-docs": false,
13
+ "curly": [true, "ignore-same-line"],
14
+ "cyclomatic-complexity": [true, 24],
15
+ "eofline": true,
16
+ "export-name": false,
17
+ "function-name": false,
18
+ "import-name": false,
19
+ "import-spacing": true,
20
+ "interface-name": [true, "never-prefix"],
21
+ "jsx-alignment": false,
22
+ "jsx-boolean-value": false,
23
+ "jsx-curly-spacing": false,
24
+ "jsx-no-multiline-js": false,
25
+ "match-default-export-name": false,
26
+ "max-func-body-length": 200,
27
+ "member-access": [true, "no-public"],
28
+ "member-ordering": {"options": [{"order": "fields-first"}]},
29
+ "missing-jsdoc": false,
30
+ "mocha-no-side-effect-code": false,
31
+ "no-arg": true,
32
+ "no-bitwise": true,
33
+ "no-console": false,
34
+ "no-construct": true,
35
+ "no-default-export": false,
36
+ "no-duplicate-switch-case": true,
37
+ "no-duplicate-variable": true,
38
+ "no-empty-interface": false,
39
+ "no-eval": true,
40
+ "no-function-expression": false,
41
+ "no-http-string": false,
42
+ "no-implicit-dependencies": false,
43
+ "no-multiline-string": false,
44
+ "no-non-null-assertion": true,
45
+ "no-relative-imports": false,
46
+ "no-require-imports": {"severity": "warning"},
47
+ "no-reserved-keywords": false,
48
+ "no-return-await": true,
49
+ "no-single-line-block-comment": false,
50
+ "no-string-throw": true,
51
+ "no-submodule-imports": false,
52
+ "no-suspicious-comment": false,
53
+ "no-unsafe-any": false,
54
+ "no-unused-variable": false,
55
+ "no-var-requires": true,
56
+ "no-void-expression": false,
57
+ "object-curly-spacing": [true, "never"],
58
+ "ordered-imports": false,
59
+ "prefer-for-of": true,
60
+ "prefer-object-spread": true,
61
+ "prefer-type-cast": false,
62
+ "quotemark": [true, "single", "jsx-double", "avoid-escape"],
63
+ "semicolon": [true, "never"],
64
+ "strict-boolean-expressions": false,
65
+ "strict-type-predicates": false,
66
+ "ter-func-call-spacing": [true, "never"],
67
+ "trailing-comma": [true, "always"],
68
+ "type-literal-delimiter": false,
69
+ "typedef": false,
70
+ "typedef-whitespace": [
71
+ true,
72
+ {
73
+ "call-signature": "nospace",
74
+ "index-signature": "nospace",
75
+ "parameter": "nospace",
76
+ "property-declaration": "nospace",
77
+ "variable-declaration": "nospace"
78
+ },
79
+ {
80
+ "call-signature": "onespace",
81
+ "index-signature": "onespace",
82
+ "parameter": "onespace",
83
+ "property-declaration": "onespace",
84
+ "variable-declaration": "onespace"
85
+ }
86
+ ],
87
+ "unified-signatures": true,
88
+ "variable-name": false,
89
+ "whitespace": [
90
+ true,
91
+ "check-branch",
92
+ "check-operator",
93
+ "check-typecast",
94
+ "check-rest-spread",
95
+ "check-type-operator"
96
+ ]
97
+ }
98
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,108 @@
1
+ import { defineConfig } from "tsup";
2
+ import { resolve } from "path";
3
+ import { existsSync } from "fs";
4
+ import type { Plugin } from "esbuild";
5
+
6
+ /**
7
+ * Custom esbuild plugin that prevents esbuild's built-in `native-node-modules`
8
+ * plugin from intercepting TypeScript source files that use `.node` in their
9
+ * filename convention (e.g. `AreComponent.node.ts`).
10
+ *
11
+ * Esbuild treats any import path ending in `.node` as a native binary addon.
12
+ * This plugin intercepts those paths first, checks if a matching `.ts` source
13
+ * file exists, and resolves it directly — leaving native binary imports
14
+ * (where no `.ts` counterpart exists) for the native-node-modules plugin.
15
+ */
16
+ const tsNodeFilesPlugin: Plugin = {
17
+ name: "are-ts-node-files",
18
+ setup(build) {
19
+ build.onResolve({ filter: /\.node$/ }, (args) => {
20
+ const tsPath = resolve(args.resolveDir, args.path + ".ts");
21
+ if (existsSync(tsPath)) {
22
+ return { path: tsPath };
23
+ }
24
+ return null;
25
+ });
26
+ },
27
+ };
28
+
29
+ export default defineConfig([
30
+ /**
31
+ * ============================
32
+ * Browser build
33
+ * ============================
34
+ *
35
+ * Single bundled ESM output for browser consumers.
36
+ */
37
+ {
38
+ entry: [
39
+ "src/index.ts", // Main entry point for browser build
40
+ ],
41
+
42
+ // Output directory for browser bundle
43
+ outDir: "dist/browser",
44
+
45
+ tsconfig: ".conf/tsconfig.browser.json",
46
+
47
+ bundle: true, // Bundle all modules into one file
48
+
49
+ // Browser consumers expect ESM
50
+ format: ["esm"],
51
+
52
+ // Tells esbuild this is browser-safe code
53
+ platform: "browser",
54
+
55
+ // Reasonable baseline for modern browsers
56
+ target: "es2020",
57
+
58
+ // Smaller bundles
59
+ treeshake: true,
60
+
61
+ // Useful for debugging in bundlers
62
+ sourcemap: true,
63
+
64
+ // Emit .d.ts files
65
+ dts: true,
66
+
67
+ esbuildPlugins: [tsNodeFilesPlugin],
68
+ },
69
+
70
+ /**
71
+ * ============================
72
+ * Node build
73
+ * ============================
74
+ *
75
+ * Individual CJS + ESM files preserved for direct imports.
76
+ */
77
+ {
78
+ entry: [
79
+ "src/**/*.ts"
80
+ ],
81
+
82
+ // Output directory for node bundle
83
+ outDir: "dist/node",
84
+
85
+ tsconfig: ".conf/tsconfig.node.json",
86
+
87
+ bundle: false, // Don't bundle node build, keep imports as-is
88
+
89
+ clean: true,
90
+
91
+ // Support both module systems
92
+ format: ["cjs", "esm"],
93
+
94
+ // Enables Node globals and resolution
95
+ platform: "node",
96
+
97
+ // Node 16+ safe baseline
98
+ target: "es2020",
99
+
100
+ treeshake: true,
101
+ sourcemap: true,
102
+
103
+ // Emit .d.ts files (shared shape)
104
+ dts: true,
105
+
106
+ esbuildPlugins: [tsNodeFilesPlugin],
107
+ },
108
+ ]);