@format.dev/compile 0.0.0 → 0.1.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 (466) hide show
  1. package/README.md +30 -20
  2. package/bin/format-compile +3 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.mjs +14 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.mjs +16 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.mjs +11 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.mjs +12 -0
  7. package/dist/_virtual/rolldown_runtime.mjs +46 -0
  8. package/dist/node_modules/.pnpm/@babel_parser@7.29.8/node_modules/@babel/parser/lib/index.mjs +12606 -0
  9. package/dist/node_modules/.pnpm/@babel_parser@7.29.8/node_modules/@babel/parser/lib/index.mjs.map +1 -0
  10. package/dist/node_modules/.pnpm/@vue_compiler-core@3.5.41/node_modules/@vue/compiler-core/dist/compiler-core.cjs.mjs +4866 -0
  11. package/dist/node_modules/.pnpm/@vue_compiler-core@3.5.41/node_modules/@vue/compiler-core/dist/compiler-core.cjs.mjs.map +1 -0
  12. package/dist/node_modules/.pnpm/@vue_compiler-core@3.5.41/node_modules/@vue/compiler-core/index.mjs +13 -0
  13. package/dist/node_modules/.pnpm/@vue_compiler-core@3.5.41/node_modules/@vue/compiler-core/index.mjs.map +1 -0
  14. package/dist/node_modules/.pnpm/@vue_compiler-dom@3.5.41/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.mjs +663 -0
  15. package/dist/node_modules/.pnpm/@vue_compiler-dom@3.5.41/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.mjs.map +1 -0
  16. package/dist/node_modules/.pnpm/@vue_compiler-dom@3.5.41/node_modules/@vue/compiler-dom/index.mjs +13 -0
  17. package/dist/node_modules/.pnpm/@vue_compiler-dom@3.5.41/node_modules/@vue/compiler-dom/index.mjs.map +1 -0
  18. package/dist/node_modules/.pnpm/@vue_compiler-ssr@3.5.41/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.mjs +846 -0
  19. package/dist/node_modules/.pnpm/@vue_compiler-ssr@3.5.41/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.mjs.map +1 -0
  20. package/dist/node_modules/.pnpm/@vue_reactivity@3.5.41/node_modules/@vue/reactivity/dist/reactivity.cjs.mjs +1600 -0
  21. package/dist/node_modules/.pnpm/@vue_reactivity@3.5.41/node_modules/@vue/reactivity/dist/reactivity.cjs.mjs.map +1 -0
  22. package/dist/node_modules/.pnpm/@vue_reactivity@3.5.41/node_modules/@vue/reactivity/index.mjs +13 -0
  23. package/dist/node_modules/.pnpm/@vue_reactivity@3.5.41/node_modules/@vue/reactivity/index.mjs.map +1 -0
  24. package/dist/node_modules/.pnpm/@vue_runtime-core@3.5.41/node_modules/@vue/runtime-core/dist/runtime-core.cjs.mjs +5619 -0
  25. package/dist/node_modules/.pnpm/@vue_runtime-core@3.5.41/node_modules/@vue/runtime-core/dist/runtime-core.cjs.mjs.map +1 -0
  26. package/dist/node_modules/.pnpm/@vue_runtime-core@3.5.41/node_modules/@vue/runtime-core/index.mjs +13 -0
  27. package/dist/node_modules/.pnpm/@vue_runtime-core@3.5.41/node_modules/@vue/runtime-core/index.mjs.map +1 -0
  28. package/dist/node_modules/.pnpm/@vue_runtime-dom@3.5.41/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.mjs +1479 -0
  29. package/dist/node_modules/.pnpm/@vue_runtime-dom@3.5.41/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.mjs.map +1 -0
  30. package/dist/node_modules/.pnpm/@vue_runtime-dom@3.5.41/node_modules/@vue/runtime-dom/index.mjs +13 -0
  31. package/dist/node_modules/.pnpm/@vue_runtime-dom@3.5.41/node_modules/@vue/runtime-dom/index.mjs.map +1 -0
  32. package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.41/node_modules/@vue/server-renderer/dist/server-renderer.cjs.mjs +510 -0
  33. package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.41/node_modules/@vue/server-renderer/dist/server-renderer.cjs.mjs.map +1 -0
  34. package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.41/node_modules/@vue/server-renderer/index.mjs +13 -0
  35. package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.41/node_modules/@vue/server-renderer/index.mjs.map +1 -0
  36. package/dist/node_modules/.pnpm/@vue_shared@3.5.41/node_modules/@vue/shared/dist/shared.cjs.mjs +499 -0
  37. package/dist/node_modules/.pnpm/@vue_shared@3.5.41/node_modules/@vue/shared/dist/shared.cjs.mjs.map +1 -0
  38. package/dist/node_modules/.pnpm/@vue_shared@3.5.41/node_modules/@vue/shared/index.mjs +13 -0
  39. package/dist/node_modules/.pnpm/@vue_shared@3.5.41/node_modules/@vue/shared/index.mjs.map +1 -0
  40. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/decode-codepoint.mjs +79 -0
  41. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/decode-codepoint.mjs.map +1 -0
  42. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/decode.mjs +471 -0
  43. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/decode.mjs.map +1 -0
  44. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/generated/decode-data-html.mjs +16 -0
  45. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/generated/decode-data-html.mjs.map +1 -0
  46. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/generated/decode-data-xml.mjs +16 -0
  47. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/generated/decode-data-xml.mjs.map +1 -0
  48. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/internal/bin-trie-flags.mjs +30 -0
  49. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/internal/bin-trie-flags.mjs.map +1 -0
  50. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/internal/decode-shared.mjs +24 -0
  51. package/dist/node_modules/.pnpm/entities@7.0.1/node_modules/entities/dist/commonjs/internal/decode-shared.mjs.map +1 -0
  52. package/dist/node_modules/.pnpm/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.mjs +253 -0
  53. package/dist/node_modules/.pnpm/estree-walker@2.0.2/node_modules/estree-walker/dist/umd/estree-walker.mjs.map +1 -0
  54. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.mjs +5246 -0
  55. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.mjs.map +1 -0
  56. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom-server.node.development.mjs +5616 -0
  57. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom-server.node.development.mjs.map +1 -0
  58. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom.development.mjs +183 -0
  59. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom.development.mjs.map +1 -0
  60. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/index.mjs +13 -0
  61. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/index.mjs.map +1 -0
  62. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/server.node.mjs +21 -0
  63. package/dist/node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/server.node.mjs.map +1 -0
  64. package/dist/node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react.development.mjs +766 -0
  65. package/dist/node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react.development.mjs.map +1 -0
  66. package/dist/node_modules/.pnpm/react@19.2.8/node_modules/react/index.mjs +13 -0
  67. package/dist/node_modules/.pnpm/react@19.2.8/node_modules/react/index.mjs.map +1 -0
  68. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.mjs +100 -0
  69. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.mjs.map +1 -0
  70. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.mjs +73 -0
  71. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.mjs.map +1 -0
  72. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.mjs +41 -0
  73. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.mjs.map +1 -0
  74. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.mjs +68 -0
  75. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.mjs.map +1 -0
  76. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.mjs +77 -0
  77. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.mjs.map +1 -0
  78. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.mjs +89 -0
  79. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.mjs.map +1 -0
  80. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.mjs +788 -0
  81. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.mjs.map +1 -0
  82. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.mjs +295 -0
  83. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.mjs.map +1 -0
  84. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.mjs +293 -0
  85. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.mjs.map +1 -0
  86. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.mjs +352 -0
  87. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.mjs.map +1 -0
  88. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.mjs +17 -0
  89. package/dist/node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.mjs.map +1 -0
  90. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/dist/vue.cjs.mjs +67 -0
  91. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/dist/vue.cjs.mjs.map +1 -0
  92. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/index.mjs +13 -0
  93. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/index.mjs.map +1 -0
  94. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/index2.mjs +10 -0
  95. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/index2.mjs.map +1 -0
  96. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/server-renderer/index.mjs +10 -0
  97. package/dist/node_modules/.pnpm/vue@3.5.41_typescript@5.9.3/node_modules/vue/server-renderer/index.mjs.map +1 -0
  98. package/dist/server/cli/bin.d.mts +1 -0
  99. package/dist/server/cli/bin.mjs +8 -0
  100. package/dist/server/cli/bin.mjs.map +1 -0
  101. package/dist/server/cli/cli-spec.mjs +150 -0
  102. package/dist/server/cli/cli-spec.mjs.map +1 -0
  103. package/dist/server/cli/index.d.mts +16 -0
  104. package/dist/server/cli/index.d.mts.map +1 -0
  105. package/dist/server/cli/index.mjs +64 -0
  106. package/dist/server/cli/index.mjs.map +1 -0
  107. package/dist/server/compile/adaptors/html-partials.d.mts +24 -0
  108. package/dist/server/compile/adaptors/html-partials.d.mts.map +1 -0
  109. package/dist/server/compile/adaptors/html-partials.mjs +50 -0
  110. package/dist/server/compile/adaptors/html-partials.mjs.map +1 -0
  111. package/dist/server/compile/adaptors/html.d.mts +15 -0
  112. package/dist/server/compile/adaptors/html.d.mts.map +1 -0
  113. package/dist/server/compile/adaptors/html.mjs +39 -0
  114. package/dist/server/compile/adaptors/html.mjs.map +1 -0
  115. package/dist/server/compile/adaptors/node-require.d.mts +6 -0
  116. package/dist/server/compile/adaptors/node-require.d.mts.map +1 -0
  117. package/dist/server/compile/adaptors/node-require.mjs +35 -0
  118. package/dist/server/compile/adaptors/node-require.mjs.map +1 -0
  119. package/dist/server/compile/adaptors/react-browser.d.mts +20 -0
  120. package/dist/server/compile/adaptors/react-browser.d.mts.map +1 -0
  121. package/dist/server/compile/adaptors/react-browser.mjs +19 -0
  122. package/dist/server/compile/adaptors/react-browser.mjs.map +1 -0
  123. package/dist/server/compile/adaptors/react-node.d.mts +17 -0
  124. package/dist/server/compile/adaptors/react-node.d.mts.map +1 -0
  125. package/dist/server/compile/adaptors/react-node.mjs +50 -0
  126. package/dist/server/compile/adaptors/react-node.mjs.map +1 -0
  127. package/dist/server/compile/adaptors/types.d.mts +14 -0
  128. package/dist/server/compile/adaptors/types.d.mts.map +1 -0
  129. package/dist/server/compile/adaptors/types.mjs +1 -0
  130. package/dist/server/compile/adaptors/vue-browser.d.mts +16 -0
  131. package/dist/server/compile/adaptors/vue-browser.d.mts.map +1 -0
  132. package/dist/server/compile/adaptors/vue-browser.mjs +16 -0
  133. package/dist/server/compile/adaptors/vue-browser.mjs.map +1 -0
  134. package/dist/server/compile/adaptors/vue-node.d.mts +17 -0
  135. package/dist/server/compile/adaptors/vue-node.d.mts.map +1 -0
  136. package/dist/server/compile/adaptors/vue-node.mjs +50 -0
  137. package/dist/server/compile/adaptors/vue-node.mjs.map +1 -0
  138. package/dist/server/compile/build-entry-module.d.mts +20 -0
  139. package/dist/server/compile/build-entry-module.d.mts.map +1 -0
  140. package/dist/server/compile/build-entry-module.mjs +56 -0
  141. package/dist/server/compile/build-entry-module.mjs.map +1 -0
  142. package/dist/server/compile/bundle-name.d.mts +5 -0
  143. package/dist/server/compile/bundle-name.d.mts.map +1 -0
  144. package/dist/server/compile/bundle-name.mjs +13 -0
  145. package/dist/server/compile/bundle-name.mjs.map +1 -0
  146. package/dist/server/compile/compile-cache.d.mts +23 -0
  147. package/dist/server/compile/compile-cache.d.mts.map +1 -0
  148. package/dist/server/compile/compile-cache.mjs +102 -0
  149. package/dist/server/compile/compile-cache.mjs.map +1 -0
  150. package/dist/server/compile/compile.d.mts +100 -0
  151. package/dist/server/compile/compile.d.mts.map +1 -0
  152. package/dist/server/compile/compile.mjs +735 -0
  153. package/dist/server/compile/compile.mjs.map +1 -0
  154. package/dist/server/compile/constants.d.mts +11 -0
  155. package/dist/server/compile/constants.d.mts.map +1 -0
  156. package/dist/server/compile/constants.mjs +12 -0
  157. package/dist/server/compile/constants.mjs.map +1 -0
  158. package/dist/server/compile/create-renderer.d.mts +16 -0
  159. package/dist/server/compile/create-renderer.d.mts.map +1 -0
  160. package/dist/server/compile/create-renderer.mjs +59 -0
  161. package/dist/server/compile/create-renderer.mjs.map +1 -0
  162. package/dist/server/compile/decode-style-entities.d.mts +12 -0
  163. package/dist/server/compile/decode-style-entities.d.mts.map +1 -0
  164. package/dist/server/compile/decode-style-entities.mjs +32 -0
  165. package/dist/server/compile/decode-style-entities.mjs.map +1 -0
  166. package/dist/server/compile/defaults.d.mts +18 -0
  167. package/dist/server/compile/defaults.d.mts.map +1 -0
  168. package/dist/server/compile/defaults.mjs +128 -0
  169. package/dist/server/compile/defaults.mjs.map +1 -0
  170. package/dist/server/compile/dependency-closure.d.mts +10 -0
  171. package/dist/server/compile/dependency-closure.d.mts.map +1 -0
  172. package/dist/server/compile/dependency-closure.mjs +79 -0
  173. package/dist/server/compile/dependency-closure.mjs.map +1 -0
  174. package/dist/server/compile/document-assets.d.mts +103 -0
  175. package/dist/server/compile/document-assets.d.mts.map +1 -0
  176. package/dist/server/compile/document-assets.mjs +184 -0
  177. package/dist/server/compile/document-assets.mjs.map +1 -0
  178. package/dist/server/compile/finalize-document-html.d.mts +53 -0
  179. package/dist/server/compile/finalize-document-html.d.mts.map +1 -0
  180. package/dist/server/compile/finalize-document-html.mjs +132 -0
  181. package/dist/server/compile/finalize-document-html.mjs.map +1 -0
  182. package/dist/server/compile/generated/adaptorHtml.mjs +6 -0
  183. package/dist/server/compile/generated/adaptorHtml.mjs.map +1 -0
  184. package/dist/server/compile/generated/adaptorReactBrowser.mjs +6 -0
  185. package/dist/server/compile/generated/adaptorReactBrowser.mjs.map +1 -0
  186. package/dist/server/compile/generated/adaptorReactNode.mjs +6 -0
  187. package/dist/server/compile/generated/adaptorReactNode.mjs.map +1 -0
  188. package/dist/server/compile/generated/adaptorVueBrowser.mjs +6 -0
  189. package/dist/server/compile/generated/adaptorVueBrowser.mjs.map +1 -0
  190. package/dist/server/compile/generated/adaptorVueNode.mjs +6 -0
  191. package/dist/server/compile/generated/adaptorVueNode.mjs.map +1 -0
  192. package/dist/server/compile/generated/createRenderer.mjs +6 -0
  193. package/dist/server/compile/generated/createRenderer.mjs.map +1 -0
  194. package/dist/server/compile/generated/decodeStyleEntities.mjs +6 -0
  195. package/dist/server/compile/generated/decodeStyleEntities.mjs.map +1 -0
  196. package/dist/server/compile/generated/sanitizeHtml.mjs +6 -0
  197. package/dist/server/compile/generated/sanitizeHtml.mjs.map +1 -0
  198. package/dist/server/compile/generated/validate.mjs +6 -0
  199. package/dist/server/compile/generated/validate.mjs.map +1 -0
  200. package/dist/server/compile/generated/virtualStyles.mjs +6 -0
  201. package/dist/server/compile/generated/virtualStyles.mjs.map +1 -0
  202. package/dist/server/compile/get-renderer.d.mts +18 -0
  203. package/dist/server/compile/get-renderer.d.mts.map +1 -0
  204. package/dist/server/compile/get-renderer.mjs +31 -0
  205. package/dist/server/compile/get-renderer.mjs.map +1 -0
  206. package/dist/server/compile/index.d.mts +2 -0
  207. package/dist/server/compile/index.mjs +3 -0
  208. package/dist/server/compile/make-config.d.mts +39 -0
  209. package/dist/server/compile/make-config.d.mts.map +1 -0
  210. package/dist/server/compile/make-config.mjs +278 -0
  211. package/dist/server/compile/make-config.mjs.map +1 -0
  212. package/dist/server/compile/package-json.d.mts +5 -0
  213. package/dist/server/compile/package-json.d.mts.map +1 -0
  214. package/dist/server/compile/package-json.mjs +33 -0
  215. package/dist/server/compile/package-json.mjs.map +1 -0
  216. package/dist/server/compile/producer-agreement.d.mts +82 -0
  217. package/dist/server/compile/producer-agreement.d.mts.map +1 -0
  218. package/dist/server/compile/producer-agreement.mjs +143 -0
  219. package/dist/server/compile/producer-agreement.mjs.map +1 -0
  220. package/dist/server/compile/producer-release.d.mts +19 -0
  221. package/dist/server/compile/producer-release.d.mts.map +1 -0
  222. package/dist/server/compile/producer-release.mjs +27 -0
  223. package/dist/server/compile/producer-release.mjs.map +1 -0
  224. package/dist/server/compile/render-error.d.mts +37 -0
  225. package/dist/server/compile/render-error.d.mts.map +1 -0
  226. package/dist/server/compile/render-error.mjs +55 -0
  227. package/dist/server/compile/render-error.mjs.map +1 -0
  228. package/dist/server/compile/sanitize/shared.d.mts +19 -0
  229. package/dist/server/compile/sanitize/shared.d.mts.map +1 -0
  230. package/dist/server/compile/sanitize/shared.mjs +131 -0
  231. package/dist/server/compile/sanitize/shared.mjs.map +1 -0
  232. package/dist/server/compile/sanitize-html.d.mts +5 -0
  233. package/dist/server/compile/sanitize-html.d.mts.map +1 -0
  234. package/dist/server/compile/sanitize-html.mjs +65 -0
  235. package/dist/server/compile/sanitize-html.mjs.map +1 -0
  236. package/dist/server/compile/structured-log.d.mts +22 -0
  237. package/dist/server/compile/structured-log.d.mts.map +1 -0
  238. package/dist/server/compile/structured-log.mjs +31 -0
  239. package/dist/server/compile/structured-log.mjs.map +1 -0
  240. package/dist/server/compile/virtual-styles.d.mts +5 -0
  241. package/dist/server/compile/virtual-styles.d.mts.map +1 -0
  242. package/dist/server/compile/virtual-styles.mjs +19 -0
  243. package/dist/server/compile/virtual-styles.mjs.map +1 -0
  244. package/dist/server/compile/wrapper-source.d.mts +55 -0
  245. package/dist/server/compile/wrapper-source.d.mts.map +1 -0
  246. package/dist/server/compile/wrapper-source.mjs +187 -0
  247. package/dist/server/compile/wrapper-source.mjs.map +1 -0
  248. package/dist/server/constants.d.mts +17 -0
  249. package/dist/server/constants.d.mts.map +1 -0
  250. package/dist/server/constants.mjs +41 -0
  251. package/dist/server/constants.mjs.map +1 -0
  252. package/dist/server/errors.d.mts +21 -0
  253. package/dist/server/errors.d.mts.map +1 -0
  254. package/dist/server/errors.mjs +24 -0
  255. package/dist/server/errors.mjs.map +1 -0
  256. package/dist/server/index.d.mts +4 -0
  257. package/dist/server/index.mjs +4 -0
  258. package/dist/server/integrations/nextjs/generate-entry.d.mts +19 -0
  259. package/dist/server/integrations/nextjs/generate-entry.d.mts.map +1 -0
  260. package/dist/server/integrations/nextjs/generate-entry.mjs +246 -0
  261. package/dist/server/integrations/nextjs/generate-entry.mjs.map +1 -0
  262. package/dist/server/integrations/nextjs/index.d.mts +8 -0
  263. package/dist/server/integrations/nextjs/index.d.mts.map +1 -0
  264. package/dist/server/integrations/nextjs/index.mjs +90 -0
  265. package/dist/server/integrations/nextjs/index.mjs.map +1 -0
  266. package/dist/server/integrations/nextjs/watcher.d.mts +9 -0
  267. package/dist/server/integrations/nextjs/watcher.d.mts.map +1 -0
  268. package/dist/server/integrations/nextjs/watcher.mjs +45 -0
  269. package/dist/server/integrations/nextjs/watcher.mjs.map +1 -0
  270. package/dist/server/integrations/unplugin/esbuild.d.mts +2 -0
  271. package/dist/server/integrations/unplugin/esbuild.mjs +3 -0
  272. package/dist/server/integrations/unplugin/index.d.mts +69 -0
  273. package/dist/server/integrations/unplugin/index.d.mts.map +1 -0
  274. package/dist/server/integrations/unplugin/index.mjs +539 -0
  275. package/dist/server/integrations/unplugin/index.mjs.map +1 -0
  276. package/dist/server/integrations/unplugin/rollup.d.mts +2 -0
  277. package/dist/server/integrations/unplugin/rollup.mjs +3 -0
  278. package/dist/server/integrations/unplugin/utils.d.mts +12 -0
  279. package/dist/server/integrations/unplugin/utils.d.mts.map +1 -0
  280. package/dist/server/integrations/unplugin/utils.mjs +46 -0
  281. package/dist/server/integrations/unplugin/utils.mjs.map +1 -0
  282. package/dist/server/integrations/unplugin/vite.d.mts +2 -0
  283. package/dist/server/integrations/unplugin/vite.mjs +3 -0
  284. package/dist/server/integrations/unplugin/webpack.d.mts +2 -0
  285. package/dist/server/integrations/unplugin/webpack.mjs +3 -0
  286. package/dist/server/project/documents.d.mts +21 -0
  287. package/dist/server/project/documents.d.mts.map +1 -0
  288. package/dist/server/project/documents.mjs +114 -0
  289. package/dist/server/project/documents.mjs.map +1 -0
  290. package/dist/server/project/format-env-types.d.mts +19 -0
  291. package/dist/server/project/format-env-types.d.mts.map +1 -0
  292. package/dist/server/project/format-env-types.mjs +64 -0
  293. package/dist/server/project/format-env-types.mjs.map +1 -0
  294. package/dist/server/project/paths.d.mts +21 -0
  295. package/dist/server/project/paths.d.mts.map +1 -0
  296. package/dist/server/project/paths.mjs +31 -0
  297. package/dist/server/project/paths.mjs.map +1 -0
  298. package/dist/server/project/user-project-dir.d.mts +7 -0
  299. package/dist/server/project/user-project-dir.d.mts.map +1 -0
  300. package/dist/server/project/user-project-dir.mjs +16 -0
  301. package/dist/server/project/user-project-dir.mjs.map +1 -0
  302. package/dist/server/render-worker/client.d.mts +83 -0
  303. package/dist/server/render-worker/client.d.mts.map +1 -0
  304. package/dist/server/render-worker/client.mjs +359 -0
  305. package/dist/server/render-worker/client.mjs.map +1 -0
  306. package/dist/server/render-worker/document-css.d.mts +27 -0
  307. package/dist/server/render-worker/document-css.d.mts.map +1 -0
  308. package/dist/server/render-worker/document-css.mjs +37 -0
  309. package/dist/server/render-worker/document-css.mjs.map +1 -0
  310. package/dist/server/render-worker/env.d.mts +11 -0
  311. package/dist/server/render-worker/env.d.mts.map +1 -0
  312. package/dist/server/render-worker/env.mjs +26 -0
  313. package/dist/server/render-worker/env.mjs.map +1 -0
  314. package/dist/server/render-worker/error.d.mts +17 -0
  315. package/dist/server/render-worker/error.d.mts.map +1 -0
  316. package/dist/server/render-worker/error.mjs +40 -0
  317. package/dist/server/render-worker/error.mjs.map +1 -0
  318. package/dist/server/render-worker/host.d.mts +1 -0
  319. package/dist/server/render-worker/host.mjs +181 -0
  320. package/dist/server/render-worker/host.mjs.map +1 -0
  321. package/dist/server/render-worker/index.d.mts +4 -0
  322. package/dist/server/render-worker/index.mjs +4 -0
  323. package/dist/server/render-worker/sandbox.d.mts +25 -0
  324. package/dist/server/render-worker/sandbox.d.mts.map +1 -0
  325. package/dist/server/render-worker/sandbox.mjs +60 -0
  326. package/dist/server/render-worker/sandbox.mjs.map +1 -0
  327. package/dist/server/render-worker/types.d.mts +59 -0
  328. package/dist/server/render-worker/types.d.mts.map +1 -0
  329. package/dist/server/render-worker/types.mjs +1 -0
  330. package/dist/server/runtime-state.d.mts +12 -0
  331. package/dist/server/runtime-state.d.mts.map +1 -0
  332. package/dist/server/runtime-state.mjs +24 -0
  333. package/dist/server/runtime-state.mjs.map +1 -0
  334. package/dist/server/utils/check-dir.d.mts +12 -0
  335. package/dist/server/utils/check-dir.d.mts.map +1 -0
  336. package/dist/server/utils/check-dir.mjs +30 -0
  337. package/dist/server/utils/check-dir.mjs.map +1 -0
  338. package/dist/server/utils/dependencies.d.mts +11 -0
  339. package/dist/server/utils/dependencies.d.mts.map +1 -0
  340. package/dist/server/utils/dependencies.mjs +34 -0
  341. package/dist/server/utils/dependencies.mjs.map +1 -0
  342. package/dist/server/utils/env-var.d.mts +6 -0
  343. package/dist/server/utils/env-var.d.mts.map +1 -0
  344. package/dist/server/utils/env-var.mjs +28 -0
  345. package/dist/server/utils/env-var.mjs.map +1 -0
  346. package/dist/server/utils/format-for-log.d.mts +5 -0
  347. package/dist/server/utils/format-for-log.d.mts.map +1 -0
  348. package/dist/server/utils/format-for-log.mjs +17 -0
  349. package/dist/server/utils/format-for-log.mjs.map +1 -0
  350. package/dist/server/utils/index.d.mts +8 -0
  351. package/dist/server/utils/index.mjs +9 -0
  352. package/dist/server/utils/load-config.d.mts +13 -0
  353. package/dist/server/utils/load-config.d.mts.map +1 -0
  354. package/dist/server/utils/load-config.mjs +65 -0
  355. package/dist/server/utils/load-config.mjs.map +1 -0
  356. package/dist/server/utils/log.d.mts +36 -0
  357. package/dist/server/utils/log.d.mts.map +1 -0
  358. package/dist/server/utils/log.mjs +125 -0
  359. package/dist/server/utils/log.mjs.map +1 -0
  360. package/dist/server/utils/read-file.d.mts +5 -0
  361. package/dist/server/utils/read-file.d.mts.map +1 -0
  362. package/dist/server/utils/read-file.mjs +14 -0
  363. package/dist/server/utils/read-file.mjs.map +1 -0
  364. package/dist/server/utils/resolve-path-with-extensions.d.mts +21 -0
  365. package/dist/server/utils/resolve-path-with-extensions.d.mts.map +1 -0
  366. package/dist/server/utils/resolve-path-with-extensions.mjs +39 -0
  367. package/dist/server/utils/resolve-path-with-extensions.mjs.map +1 -0
  368. package/dist/server/utils/schema.d.mts +7 -0
  369. package/dist/server/utils/schema.d.mts.map +1 -0
  370. package/dist/server/utils/schema.mjs +21 -0
  371. package/dist/server/utils/schema.mjs.map +1 -0
  372. package/dist/server/utils/standard-schema-validate.d.mts +13 -0
  373. package/dist/server/utils/standard-schema-validate.d.mts.map +1 -0
  374. package/dist/server/utils/standard-schema-validate.mjs +21 -0
  375. package/dist/server/utils/standard-schema-validate.mjs.map +1 -0
  376. package/dist/server/utils/suggest-similar.d.mts +9 -0
  377. package/dist/server/utils/suggest-similar.d.mts.map +1 -0
  378. package/dist/server/utils/suggest-similar.mjs +39 -0
  379. package/dist/server/utils/suggest-similar.mjs.map +1 -0
  380. package/dist/server/utils/warn-lockstep.d.mts +13 -0
  381. package/dist/server/utils/warn-lockstep.d.mts.map +1 -0
  382. package/dist/server/utils/warn-lockstep.mjs +23 -0
  383. package/dist/server/utils/warn-lockstep.mjs.map +1 -0
  384. package/dist/server/vite/create-config.d.mts +35 -0
  385. package/dist/server/vite/create-config.d.mts.map +1 -0
  386. package/dist/server/vite/create-config.mjs +64 -0
  387. package/dist/server/vite/create-config.mjs.map +1 -0
  388. package/dist/server/vite/plugins/collect-css.d.mts +8 -0
  389. package/dist/server/vite/plugins/collect-css.d.mts.map +1 -0
  390. package/dist/server/vite/plugins/collect-css.mjs +21 -0
  391. package/dist/server/vite/plugins/collect-css.mjs.map +1 -0
  392. package/dist/server/vite/plugins/get-styles.d.mts +14 -0
  393. package/dist/server/vite/plugins/get-styles.d.mts.map +1 -0
  394. package/dist/server/vite/plugins/get-styles.mjs +88 -0
  395. package/dist/server/vite/plugins/get-styles.mjs.map +1 -0
  396. package/dist/server/vite/plugins/html-loader.d.mts +18 -0
  397. package/dist/server/vite/plugins/html-loader.d.mts.map +1 -0
  398. package/dist/server/vite/plugins/html-loader.mjs +88 -0
  399. package/dist/server/vite/plugins/html-loader.mjs.map +1 -0
  400. package/dist/server/vite/plugins/postcss/import-url.d.mts +14 -0
  401. package/dist/server/vite/plugins/postcss/import-url.d.mts.map +1 -0
  402. package/dist/server/vite/plugins/postcss/import-url.mjs +163 -0
  403. package/dist/server/vite/plugins/postcss/import-url.mjs.map +1 -0
  404. package/dist/server/vite/plugins/styles-pre-processor.d.mts +7 -0
  405. package/dist/server/vite/plugins/styles-pre-processor.d.mts.map +1 -0
  406. package/dist/server/vite/plugins/styles-pre-processor.mjs +64 -0
  407. package/dist/server/vite/plugins/styles-pre-processor.mjs.map +1 -0
  408. package/dist/server/vite/plugins/utils.d.mts +9 -0
  409. package/dist/server/vite/plugins/utils.d.mts.map +1 -0
  410. package/dist/server/vite/plugins/utils.mjs +14 -0
  411. package/dist/server/vite/plugins/utils.mjs.map +1 -0
  412. package/dist/shared/constants.d.mts +11 -0
  413. package/dist/shared/constants.d.mts.map +1 -0
  414. package/dist/shared/constants.mjs +12 -0
  415. package/dist/shared/constants.mjs.map +1 -0
  416. package/dist/shared/env.d.mts +6 -0
  417. package/dist/shared/env.d.mts.map +1 -0
  418. package/dist/shared/env.mjs +11 -0
  419. package/dist/shared/env.mjs.map +1 -0
  420. package/dist/shared/http.d.mts +15 -0
  421. package/dist/shared/http.d.mts.map +1 -0
  422. package/dist/shared/http.mjs +54 -0
  423. package/dist/shared/http.mjs.map +1 -0
  424. package/dist/shared/types/document.d.mts +17 -0
  425. package/dist/shared/types/document.d.mts.map +1 -0
  426. package/dist/shared/types/document.mjs +1 -0
  427. package/dist/shared/types/index.d.mts +7 -0
  428. package/dist/shared/types/index.mjs +4 -0
  429. package/dist/shared/types/log.d.mts +10 -0
  430. package/dist/shared/types/log.d.mts.map +1 -0
  431. package/dist/shared/types/log.mjs +12 -0
  432. package/dist/shared/types/log.mjs.map +1 -0
  433. package/dist/shared/types/public/cli.d.mts +33 -0
  434. package/dist/shared/types/public/cli.d.mts.map +1 -0
  435. package/dist/shared/types/public/cli.mjs +1 -0
  436. package/dist/shared/types/public/compile.d.mts +45 -0
  437. package/dist/shared/types/public/compile.d.mts.map +1 -0
  438. package/dist/shared/types/public/compile.mjs +29 -0
  439. package/dist/shared/types/public/compile.mjs.map +1 -0
  440. package/dist/shared/types/public/config.d.mts +94 -0
  441. package/dist/shared/types/public/config.d.mts.map +1 -0
  442. package/dist/shared/types/public/config.mjs +20 -0
  443. package/dist/shared/types/public/config.mjs.map +1 -0
  444. package/dist/shared/types/public/index.d.mts +6 -0
  445. package/dist/shared/types/public/index.mjs +4 -0
  446. package/dist/shared/types/public/nextjs.d.mts +111 -0
  447. package/dist/shared/types/public/nextjs.d.mts.map +1 -0
  448. package/dist/shared/types/public/nextjs.mjs +1 -0
  449. package/dist/shared/types/public/renderer.d.mts +2 -0
  450. package/dist/shared/types/public/renderer.mjs +1 -0
  451. package/dist/shared/types/public/unplugin.d.mts +65 -0
  452. package/dist/shared/types/public/unplugin.d.mts.map +1 -0
  453. package/dist/shared/types/public/unplugin.mjs +1 -0
  454. package/dist/shared/types/server.d.mts +5 -0
  455. package/dist/shared/types/server.d.mts.map +1 -0
  456. package/dist/shared/types/server.mjs +1 -0
  457. package/dist/shared/types/state.d.mts +15 -0
  458. package/dist/shared/types/state.d.mts.map +1 -0
  459. package/dist/shared/types/state.mjs +1 -0
  460. package/dist/shared/types/system.d.mts +18 -0
  461. package/dist/shared/types/system.d.mts.map +1 -0
  462. package/dist/shared/types/system.mjs +1 -0
  463. package/package.json +146 -34
  464. package/types/next.d.ts +6 -0
  465. package/index.d.ts +0 -2
  466. package/index.js +0 -3
@@ -0,0 +1,103 @@
1
+ import { FormatConfig } from "../../shared/types/public/config.mjs";
2
+
3
+ //#region src/server/compile/document-assets.d.ts
4
+ /** Reserved co-location folder: `documents/<name>/assets/` travels with the document. */
5
+ declare const DOCUMENT_ASSETS_DIR_NAME = "assets";
6
+ /**
7
+ * Everything that can contribute files to one document's asset set:
8
+ * the shared assets dir, the document's own `./assets/` folder, and the
9
+ * Vite-emitted output (hashed images and fonts). The shared assets dir and the
10
+ * Vite-emitted output both live in the bundle's shared `shared-assets/` dir;
11
+ * the document's `./assets/` lands under `<doc>/assets/`. On filename clash the
12
+ * per-document folder wins.
13
+ */
14
+ interface DocumentAssetSources {
15
+ sharedAssetsDir: string | null;
16
+ documentAssetsDir: string | null;
17
+ /** The shared Vite-emitted dir (hashed images + fonts), or null when absent. */
18
+ emittedDir: string | null;
19
+ }
20
+ interface ResolveSourcesArgs {
21
+ /** The document's entry file path — its `assets/` sibling is the per-doc folder. */
22
+ entryFilePath: string;
23
+ config: FormatConfig;
24
+ outDir: string;
25
+ sharedAssetsOutDirName: string;
26
+ }
27
+ declare function resolveDocumentAssetSources(args: ResolveSourcesArgs): Promise<DocumentAssetSources>;
28
+ interface StaticAssetsResult {
29
+ /** Zip entry names — the document's known-asset set. Empty when no assets. */
30
+ known: string[];
31
+ /** The merged archive, or undefined when the document has no assets. */
32
+ zip: Uint8Array | undefined;
33
+ }
34
+ /**
35
+ * Build one document's merged `assets.zip` (static mode): the full merged set,
36
+ * with no filtering by rendered HTML — any variant renders from the same zip.
37
+ *
38
+ * Standalone by design: callable without emitting any JS wrapper, so HTML
39
+ * output (`format compile --output=html`) can reuse the same artefact.
40
+ */
41
+ declare function buildDocumentStaticAssets(sources: DocumentAssetSources, stagingDir: string): Promise<StaticAssetsResult>;
42
+ interface CompiledDynamicAssetEntry {
43
+ /** The known-asset path (URL map key) this file backs. */
44
+ knownPath: string;
45
+ /** Absolute path of the file in the compiled outDir. */
46
+ sourcePath: string;
47
+ /** '/'-separated path for emission into a consumer bundle, mirroring the outDir layout. */
48
+ emitPath: string;
49
+ }
50
+ /**
51
+ * Turn a compiled document's dynamic-mode URL map into per-file emit entries,
52
+ * for consumers that re-host the assets (the unplugin, Next.js). The map value
53
+ * is each file's location relative to the document's `index.js`, so it already
54
+ * encodes the on-disk path — no need to re-scan the output or re-infer which
55
+ * dir a file came from. `<doc>/assets/x` → emitted under the document; a
56
+ * `../shared-assets/x` value → emitted under the shared dir, shared across docs.
57
+ */
58
+ declare function dynamicAssetEmitEntries(args: {
59
+ outDir: string;
60
+ documentName: string;
61
+ urlMap: Record<string, string>;
62
+ }): CompiledDynamicAssetEntry[];
63
+ interface DynamicAssetsResult {
64
+ /** The document's known-asset set (map keys). Empty when no assets. */
65
+ known: string[];
66
+ /**
67
+ * Known-asset path → URL relative to the document's `index.js`. The wrapper
68
+ * resolves each against `import.meta.url` at render time.
69
+ */
70
+ urlMap: Record<string, string>;
71
+ }
72
+ /**
73
+ * Materialise the dynamic-mode shared asset layout once per build and return the
74
+ * shared portion of every document's URL map (relative to a document dir). Both
75
+ * the `sharedAssetsDir` contents and the Vite-emitted output (hashed images +
76
+ * fonts) live in the bundle's `shared-assets/` dir, so they are shared across
77
+ * documents and never duplicated.
78
+ *
79
+ * Their map keys differ by how the rendered HTML references them: author files
80
+ * from `sharedAssetsDir` are referenced by their bare path (e.g. `cube.svg`),
81
+ * while Vite rewrites its emitted references to include the dir (e.g.
82
+ * `shared-assets/chart-abc.png`). We snapshot the Vite-emitted files *before*
83
+ * copying `sharedAssetsDir` in, so the two are never confused.
84
+ */
85
+ declare function materialiseSharedDynamicAssets(args: {
86
+ config: FormatConfig;
87
+ outDir: string;
88
+ sharedAssetsOutDirName: string;
89
+ }): Promise<Record<string, string>>;
90
+ /**
91
+ * Materialise one document's own runtime asset layout (dynamic mode) and return
92
+ * its full URL map. The document's `./assets/` folder is copied to
93
+ * `<documentOutDir>/assets/**` (bare keys, document-local urls); the shared
94
+ * entries are merged in on top with the per-document folder winning on clash.
95
+ */
96
+ declare function buildDocumentDynamicAssets(args: {
97
+ documentAssetsDir: string | null;
98
+ documentOutDir: string;
99
+ sharedUrlMap: Record<string, string>;
100
+ }): Promise<DynamicAssetsResult>;
101
+ //#endregion
102
+ export { CompiledDynamicAssetEntry, DOCUMENT_ASSETS_DIR_NAME, DocumentAssetSources, DynamicAssetsResult, StaticAssetsResult, buildDocumentDynamicAssets, buildDocumentStaticAssets, dynamicAssetEmitEntries, materialiseSharedDynamicAssets, resolveDocumentAssetSources };
103
+ //# sourceMappingURL=document-assets.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-assets.d.mts","names":[],"sources":["../../../src/server/compile/document-assets.ts"],"sourcesContent":[],"mappings":";;;;cASa,wBAAA;AAAb;AAUA;AAKC;AAUD;;;;;AA2EiB,UA1FA,oBAAA,CA8FX;EAUgB,eAAA,EAAA,MAAA,GAAA,IAAyB;EACrC,iBAAA,EAAA,MAAA,GAAA,IAAA;EAEC;EAAR,UAAA,EAAA,MAAA,GAAA,IAAA;;AAmBH,UAvHU,kBAAA,CAuHO;EAiBD;EAiBC,aAAA,EAAA,MAAA;EAuBK,MAAA,EA7Kb,YA6Ka;EACb,MAAA,EAAA,MAAA;EAGG,sBAAA,EAAA,MAAA;;AAAD,iBA5KW,2BAAA,CA4KX,IAAA,EA5K6C,kBA4K7C,CAAA,EA5KkE,OA4KlE,CA5K0E,oBA4K1E,CAAA;AAwCW,UAzIL,kBAAA,CAyI+B;EAGjC;EACH,KAAA,EAAA,MAAA,EAAA;EAAR;EAAO,GAAA,EAzIL,UAyIK,GAAA,SAAA;;;;;;;;;iBA/HW,yBAAA,UACZ,2CAEP,QAAQ;UAmBM,yBAAA;;;;;;;;;;;;;;;;iBAiBD,uBAAA;;;UAGP;IACL;UAaa,mBAAA;;;;;;;UAOR;;;;;;;;;;;;;;;iBAgBa,8BAAA;UACb;;;IAGL,QAAQ;;;;;;;iBAwCU,0BAAA;;;gBAGP;IACX,QAAQ"}
@@ -0,0 +1,184 @@
1
+ import { getSharedAssetsDir } from "../project/paths.mjs";
2
+ import { checkDir } from "../utils/check-dir.mjs";
3
+ import "../utils/index.mjs";
4
+ import { basename, dirname, join, relative, resolve } from "node:path";
5
+ import { cp, mkdir, readdir, rm, stat } from "node:fs/promises";
6
+ import { isSystemJunkFile, zipDir } from "@format.dev/zip";
7
+
8
+ //#region src/server/compile/document-assets.ts
9
+ /** Reserved co-location folder: `documents/<name>/assets/` travels with the document. */
10
+ const DOCUMENT_ASSETS_DIR_NAME = "assets";
11
+ async function resolveDocumentAssetSources(args) {
12
+ const { entryFilePath, config, outDir, sharedAssetsOutDirName } = args;
13
+ const sharedAssetsDir = getSharedAssetsDir(config);
14
+ const documentAssetsDir = join(dirname(entryFilePath), DOCUMENT_ASSETS_DIR_NAME);
15
+ const emittedDir = resolve(outDir, sharedAssetsOutDirName);
16
+ const [sharedOk, perDocOk, emittedOk] = await Promise.all([
17
+ checkDir(sharedAssetsDir),
18
+ checkDir(documentAssetsDir),
19
+ checkDir(emittedDir)
20
+ ]);
21
+ return {
22
+ sharedAssetsDir: sharedOk.isDirectory ? sharedAssetsDir : null,
23
+ documentAssetsDir: perDocOk.isDirectory ? documentAssetsDir : null,
24
+ emittedDir: emittedOk.isDirectory ? emittedDir : null
25
+ };
26
+ }
27
+ /**
28
+ * Recursively list a directory's files as '/'-separated paths relative to it.
29
+ *
30
+ * Walks by hand with `stat` (not `readdir({ recursive: true })`) so it descends
31
+ * through symlinked directories. Asset roots are often wired up with symlinks —
32
+ * a shared `assets/` dir linked into a project, for example — and those files
33
+ * must still be discovered and shipped.
34
+ */
35
+ async function listFiles(dir) {
36
+ const walk = async (current) => {
37
+ const entries = await readdir(current, { withFileTypes: true }).catch(() => []);
38
+ return (await Promise.all(entries.map(async (entry) => {
39
+ const entryPath = join(current, entry.name);
40
+ const stats = await stat(entryPath).catch(() => null);
41
+ if (!stats) return [];
42
+ if (stats.isDirectory()) return walk(entryPath);
43
+ return stats.isFile() && !isSystemJunkFile(entry.name) ? [entryPath] : [];
44
+ }))).flat();
45
+ };
46
+ return (await walk(dir)).map((file) => relative(dir, file).split("\\").join("/")).sort();
47
+ }
48
+ /**
49
+ * Copy the document-scoped sources (shared assets dir, then the per-document
50
+ * `./assets/` folder on top — last write wins) into `destDir`.
51
+ */
52
+ async function overlayDocumentSources(sources, destDir) {
53
+ await mkdir(destDir, { recursive: true });
54
+ if (sources.sharedAssetsDir) await cp(sources.sharedAssetsDir, destDir, {
55
+ recursive: true,
56
+ force: true,
57
+ dereference: true
58
+ });
59
+ if (sources.documentAssetsDir) await cp(sources.documentAssetsDir, destDir, {
60
+ recursive: true,
61
+ force: true,
62
+ dereference: true
63
+ });
64
+ }
65
+ /**
66
+ * Build one document's merged `assets.zip` (static mode): the full merged set,
67
+ * with no filtering by rendered HTML — any variant renders from the same zip.
68
+ *
69
+ * Standalone by design: callable without emitting any JS wrapper, so HTML
70
+ * output (`format compile --output=html`) can reuse the same artefact.
71
+ */
72
+ async function buildDocumentStaticAssets(sources, stagingDir) {
73
+ await rm(stagingDir, {
74
+ recursive: true,
75
+ force: true
76
+ });
77
+ await overlayDocumentSources(sources, stagingDir);
78
+ if (sources.emittedDir) {
79
+ const emittedName = sources.emittedDir.split("\\").join("/").split("/").pop();
80
+ await cp(sources.emittedDir, join(stagingDir, emittedName), {
81
+ recursive: true,
82
+ force: true,
83
+ dereference: true
84
+ });
85
+ }
86
+ try {
87
+ return {
88
+ known: await listFiles(stagingDir),
89
+ zip: await zipDir(stagingDir)
90
+ };
91
+ } finally {
92
+ await rm(stagingDir, {
93
+ recursive: true,
94
+ force: true
95
+ }).catch(() => {});
96
+ }
97
+ }
98
+ /**
99
+ * Turn a compiled document's dynamic-mode URL map into per-file emit entries,
100
+ * for consumers that re-host the assets (the unplugin, Next.js). The map value
101
+ * is each file's location relative to the document's `index.js`, so it already
102
+ * encodes the on-disk path — no need to re-scan the output or re-infer which
103
+ * dir a file came from. `<doc>/assets/x` → emitted under the document; a
104
+ * `../shared-assets/x` value → emitted under the shared dir, shared across docs.
105
+ */
106
+ function dynamicAssetEmitEntries(args) {
107
+ const { outDir, documentName, urlMap } = args;
108
+ const documentOutDir = join(outDir, documentName);
109
+ return Object.entries(urlMap).map(([knownPath, url]) => {
110
+ const sourcePath = resolve(documentOutDir, url);
111
+ return {
112
+ knownPath,
113
+ sourcePath,
114
+ emitPath: relative(outDir, sourcePath).split("\\").join("/")
115
+ };
116
+ });
117
+ }
118
+ /**
119
+ * Materialise the dynamic-mode shared asset layout once per build and return the
120
+ * shared portion of every document's URL map (relative to a document dir). Both
121
+ * the `sharedAssetsDir` contents and the Vite-emitted output (hashed images +
122
+ * fonts) live in the bundle's `shared-assets/` dir, so they are shared across
123
+ * documents and never duplicated.
124
+ *
125
+ * Their map keys differ by how the rendered HTML references them: author files
126
+ * from `sharedAssetsDir` are referenced by their bare path (e.g. `cube.svg`),
127
+ * while Vite rewrites its emitted references to include the dir (e.g.
128
+ * `shared-assets/chart-abc.png`). We snapshot the Vite-emitted files *before*
129
+ * copying `sharedAssetsDir` in, so the two are never confused.
130
+ */
131
+ async function materialiseSharedDynamicAssets(args) {
132
+ const { config, outDir, sharedAssetsOutDirName } = args;
133
+ const sharedAssetsOutDir = resolve(outDir, sharedAssetsOutDirName);
134
+ const sharedName = basename(sharedAssetsOutDir);
135
+ const sharedAssetsSource = getSharedAssetsDir(config);
136
+ const [sharedSourceOk, emittedOk] = await Promise.all([checkDir(sharedAssetsSource), checkDir(sharedAssetsOutDir)]);
137
+ const sharedAssetsDir = sharedSourceOk.isDirectory ? sharedAssetsSource : null;
138
+ const emittedDir = emittedOk.isDirectory ? sharedAssetsOutDir : null;
139
+ const urlMap = {};
140
+ const emittedRels = emittedDir ? await listFiles(emittedDir) : [];
141
+ for (const rel of emittedRels) urlMap[`${sharedName}/${rel}`] = `../${sharedName}/${rel}`;
142
+ if (sharedAssetsDir) {
143
+ await mkdir(sharedAssetsOutDir, { recursive: true });
144
+ await cp(sharedAssetsDir, sharedAssetsOutDir, {
145
+ recursive: true,
146
+ force: true,
147
+ dereference: true
148
+ });
149
+ for (const rel of await listFiles(sharedAssetsDir)) urlMap[rel] = `../${sharedName}/${rel}`;
150
+ }
151
+ return urlMap;
152
+ }
153
+ /**
154
+ * Materialise one document's own runtime asset layout (dynamic mode) and return
155
+ * its full URL map. The document's `./assets/` folder is copied to
156
+ * `<documentOutDir>/assets/**` (bare keys, document-local urls); the shared
157
+ * entries are merged in on top with the per-document folder winning on clash.
158
+ */
159
+ async function buildDocumentDynamicAssets(args) {
160
+ const { documentAssetsDir, documentOutDir, sharedUrlMap } = args;
161
+ const runtimeAssetsDir = join(documentOutDir, DOCUMENT_ASSETS_DIR_NAME);
162
+ await rm(runtimeAssetsDir, {
163
+ recursive: true,
164
+ force: true
165
+ });
166
+ const urlMap = { ...sharedUrlMap };
167
+ if (documentAssetsDir) {
168
+ await mkdir(runtimeAssetsDir, { recursive: true });
169
+ await cp(documentAssetsDir, runtimeAssetsDir, {
170
+ recursive: true,
171
+ force: true,
172
+ dereference: true
173
+ });
174
+ for (const rel of await listFiles(runtimeAssetsDir)) urlMap[rel] = `./${DOCUMENT_ASSETS_DIR_NAME}/${rel}`;
175
+ }
176
+ return {
177
+ known: Object.keys(urlMap).sort(),
178
+ urlMap
179
+ };
180
+ }
181
+
182
+ //#endregion
183
+ export { DOCUMENT_ASSETS_DIR_NAME, buildDocumentDynamicAssets, buildDocumentStaticAssets, dynamicAssetEmitEntries, materialiseSharedDynamicAssets, resolveDocumentAssetSources };
184
+ //# sourceMappingURL=document-assets.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-assets.mjs","names":["urlMap: Record<string, string>"],"sources":["../../../src/server/compile/document-assets.ts"],"sourcesContent":["import type { FormatConfig } from '../../shared/types'\n\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport { cp, mkdir, readdir, rm, stat } from 'node:fs/promises'\nimport { zipDir, isSystemJunkFile } from '@format.dev/zip'\nimport { getSharedAssetsDir } from '../project/paths'\nimport { checkDir } from '../utils'\n\n/** Reserved co-location folder: `documents/<name>/assets/` travels with the document. */\nexport const DOCUMENT_ASSETS_DIR_NAME = 'assets'\n\n/**\n * Everything that can contribute files to one document's asset set:\n * the shared assets dir, the document's own `./assets/` folder, and the\n * Vite-emitted output (hashed images and fonts). The shared assets dir and the\n * Vite-emitted output both live in the bundle's shared `shared-assets/` dir;\n * the document's `./assets/` lands under `<doc>/assets/`. On filename clash the\n * per-document folder wins.\n */\nexport interface DocumentAssetSources {\n\tsharedAssetsDir: string | null\n\tdocumentAssetsDir: string | null\n\t/** The shared Vite-emitted dir (hashed images + fonts), or null when absent. */\n\temittedDir: string | null\n}\n\ninterface ResolveSourcesArgs {\n\t/** The document's entry file path — its `assets/` sibling is the per-doc folder. */\n\tentryFilePath: string\n\tconfig: FormatConfig\n\toutDir: string\n\tsharedAssetsOutDirName: string\n}\n\nexport async function resolveDocumentAssetSources(args: ResolveSourcesArgs): Promise<DocumentAssetSources> {\n\tconst { entryFilePath, config, outDir, sharedAssetsOutDirName } = args\n\n\tconst sharedAssetsDir = getSharedAssetsDir(config)\n\tconst documentAssetsDir = join(dirname(entryFilePath), DOCUMENT_ASSETS_DIR_NAME)\n\tconst emittedDir = resolve(outDir, sharedAssetsOutDirName)\n\n\tconst [sharedOk, perDocOk, emittedOk] = await Promise.all([\n\t\tcheckDir(sharedAssetsDir),\n\t\tcheckDir(documentAssetsDir),\n\t\tcheckDir(emittedDir)\n\t])\n\n\treturn {\n\t\tsharedAssetsDir: sharedOk.isDirectory ? sharedAssetsDir : null,\n\t\tdocumentAssetsDir: perDocOk.isDirectory ? documentAssetsDir : null,\n\t\temittedDir: emittedOk.isDirectory ? emittedDir : null\n\t}\n}\n\n/**\n * Recursively list a directory's files as '/'-separated paths relative to it.\n *\n * Walks by hand with `stat` (not `readdir({ recursive: true })`) so it descends\n * through symlinked directories. Asset roots are often wired up with symlinks —\n * a shared `assets/` dir linked into a project, for example — and those files\n * must still be discovered and shipped.\n */\nasync function listFiles(dir: string): Promise<string[]> {\n\tconst walk = async (current: string): Promise<string[]> => {\n\t\tconst entries = await readdir(current, { withFileTypes: true }).catch(() => [])\n\n\t\tconst nested = await Promise.all(\n\t\t\tentries.map(async entry => {\n\t\t\t\tconst entryPath = join(current, entry.name)\n\t\t\t\tconst stats = await stat(entryPath).catch(() => null)\n\n\t\t\t\tif (!stats) {\n\t\t\t\t\treturn []\n\t\t\t\t}\n\n\t\t\t\tif (stats.isDirectory()) {\n\t\t\t\t\treturn walk(entryPath)\n\t\t\t\t}\n\n\t\t\t\tconst isShippableFile = stats.isFile() && !isSystemJunkFile(entry.name)\n\n\t\t\t\treturn isShippableFile ? [entryPath] : []\n\t\t\t})\n\t\t)\n\n\t\treturn nested.flat()\n\t}\n\n\tconst files = await walk(dir)\n\n\treturn files.map(file => relative(dir, file).split('\\\\').join('/')).sort()\n}\n\n/**\n * Copy the document-scoped sources (shared assets dir, then the per-document\n * `./assets/` folder on top — last write wins) into `destDir`.\n */\nasync function overlayDocumentSources(sources: DocumentAssetSources, destDir: string) {\n\tawait mkdir(destDir, { recursive: true })\n\n\tif (sources.sharedAssetsDir) {\n\t\tawait cp(sources.sharedAssetsDir, destDir, { recursive: true, force: true, dereference: true })\n\t}\n\n\tif (sources.documentAssetsDir) {\n\t\tawait cp(sources.documentAssetsDir, destDir, { recursive: true, force: true, dereference: true })\n\t}\n}\n\nexport interface StaticAssetsResult {\n\t/** Zip entry names — the document's known-asset set. Empty when no assets. */\n\tknown: string[]\n\t/** The merged archive, or undefined when the document has no assets. */\n\tzip: Uint8Array | undefined\n}\n\n/**\n * Build one document's merged `assets.zip` (static mode): the full merged set,\n * with no filtering by rendered HTML — any variant renders from the same zip.\n *\n * Standalone by design: callable without emitting any JS wrapper, so HTML\n * output (`format compile --output=html`) can reuse the same artefact.\n */\nexport async function buildDocumentStaticAssets(\n\tsources: DocumentAssetSources,\n\tstagingDir: string\n): Promise<StaticAssetsResult> {\n\tawait rm(stagingDir, { recursive: true, force: true })\n\tawait overlayDocumentSources(sources, stagingDir)\n\n\tif (sources.emittedDir) {\n\t\tconst emittedName = sources.emittedDir.split('\\\\').join('/').split('/').pop()!\n\t\tawait cp(sources.emittedDir, join(stagingDir, emittedName), { recursive: true, force: true, dereference: true })\n\t}\n\n\ttry {\n\t\tconst known = await listFiles(stagingDir)\n\t\tconst zip = await zipDir(stagingDir)\n\n\t\treturn { known, zip }\n\t} finally {\n\t\tawait rm(stagingDir, { recursive: true, force: true }).catch(() => {})\n\t}\n}\n\nexport interface CompiledDynamicAssetEntry {\n\t/** The known-asset path (URL map key) this file backs. */\n\tknownPath: string\n\t/** Absolute path of the file in the compiled outDir. */\n\tsourcePath: string\n\t/** '/'-separated path for emission into a consumer bundle, mirroring the outDir layout. */\n\temitPath: string\n}\n\n/**\n * Turn a compiled document's dynamic-mode URL map into per-file emit entries,\n * for consumers that re-host the assets (the unplugin, Next.js). The map value\n * is each file's location relative to the document's `index.js`, so it already\n * encodes the on-disk path — no need to re-scan the output or re-infer which\n * dir a file came from. `<doc>/assets/x` → emitted under the document; a\n * `../shared-assets/x` value → emitted under the shared dir, shared across docs.\n */\nexport function dynamicAssetEmitEntries(args: {\n\toutDir: string\n\tdocumentName: string\n\turlMap: Record<string, string>\n}): CompiledDynamicAssetEntry[] {\n\tconst { outDir, documentName, urlMap } = args\n\n\tconst documentOutDir = join(outDir, documentName)\n\n\treturn Object.entries(urlMap).map(([knownPath, url]) => {\n\t\tconst sourcePath = resolve(documentOutDir, url)\n\t\tconst emitPath = relative(outDir, sourcePath).split('\\\\').join('/')\n\n\t\treturn { knownPath, sourcePath, emitPath }\n\t})\n}\n\nexport interface DynamicAssetsResult {\n\t/** The document's known-asset set (map keys). Empty when no assets. */\n\tknown: string[]\n\t/**\n\t * Known-asset path → URL relative to the document's `index.js`. The wrapper\n\t * resolves each against `import.meta.url` at render time.\n\t */\n\turlMap: Record<string, string>\n}\n\n/**\n * Materialise the dynamic-mode shared asset layout once per build and return the\n * shared portion of every document's URL map (relative to a document dir). Both\n * the `sharedAssetsDir` contents and the Vite-emitted output (hashed images +\n * fonts) live in the bundle's `shared-assets/` dir, so they are shared across\n * documents and never duplicated.\n *\n * Their map keys differ by how the rendered HTML references them: author files\n * from `sharedAssetsDir` are referenced by their bare path (e.g. `cube.svg`),\n * while Vite rewrites its emitted references to include the dir (e.g.\n * `shared-assets/chart-abc.png`). We snapshot the Vite-emitted files *before*\n * copying `sharedAssetsDir` in, so the two are never confused.\n */\nexport async function materialiseSharedDynamicAssets(args: {\n\tconfig: FormatConfig\n\toutDir: string\n\tsharedAssetsOutDirName: string\n}): Promise<Record<string, string>> {\n\tconst { config, outDir, sharedAssetsOutDirName } = args\n\n\tconst sharedAssetsOutDir = resolve(outDir, sharedAssetsOutDirName)\n\tconst sharedName = basename(sharedAssetsOutDir)\n\n\tconst sharedAssetsSource = getSharedAssetsDir(config)\n\tconst [sharedSourceOk, emittedOk] = await Promise.all([checkDir(sharedAssetsSource), checkDir(sharedAssetsOutDir)])\n\n\tconst sharedAssetsDir = sharedSourceOk.isDirectory ? sharedAssetsSource : null\n\tconst emittedDir = emittedOk.isDirectory ? sharedAssetsOutDir : null\n\n\tconst urlMap: Record<string, string> = {}\n\n\t// Vite emits straight into the shared dir, so its current contents are the\n\t// emitted files — snapshot them before the sharedAssetsDir copy lands on top.\n\tconst emittedRels = emittedDir ? await listFiles(emittedDir) : []\n\n\tfor (const rel of emittedRels) {\n\t\turlMap[`${sharedName}/${rel}`] = `../${sharedName}/${rel}`\n\t}\n\n\tif (sharedAssetsDir) {\n\t\tawait mkdir(sharedAssetsOutDir, { recursive: true })\n\t\tawait cp(sharedAssetsDir, sharedAssetsOutDir, { recursive: true, force: true, dereference: true })\n\n\t\tfor (const rel of await listFiles(sharedAssetsDir)) {\n\t\t\turlMap[rel] = `../${sharedName}/${rel}`\n\t\t}\n\t}\n\n\treturn urlMap\n}\n\n/**\n * Materialise one document's own runtime asset layout (dynamic mode) and return\n * its full URL map. The document's `./assets/` folder is copied to\n * `<documentOutDir>/assets/**` (bare keys, document-local urls); the shared\n * entries are merged in on top with the per-document folder winning on clash.\n */\nexport async function buildDocumentDynamicAssets(args: {\n\tdocumentAssetsDir: string | null\n\tdocumentOutDir: string\n\tsharedUrlMap: Record<string, string>\n}): Promise<DynamicAssetsResult> {\n\tconst { documentAssetsDir, documentOutDir, sharedUrlMap } = args\n\n\tconst runtimeAssetsDir = join(documentOutDir, DOCUMENT_ASSETS_DIR_NAME)\n\n\tawait rm(runtimeAssetsDir, { recursive: true, force: true })\n\n\tconst urlMap: Record<string, string> = { ...sharedUrlMap }\n\n\tif (documentAssetsDir) {\n\t\tawait mkdir(runtimeAssetsDir, { recursive: true })\n\t\tawait cp(documentAssetsDir, runtimeAssetsDir, { recursive: true, force: true, dereference: true })\n\n\t\tfor (const rel of await listFiles(runtimeAssetsDir)) {\n\t\t\turlMap[rel] = `./${DOCUMENT_ASSETS_DIR_NAME}/${rel}`\n\t\t}\n\t}\n\n\treturn { known: Object.keys(urlMap).sort(), urlMap }\n}\n"],"mappings":"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"}
@@ -0,0 +1,53 @@
1
+ //#region src/server/compile/finalize-document-html.d.ts
2
+ /**
3
+ * Raised when the SDK that rendered a document and the compiler finalising it
4
+ * come from different Format releases.
5
+ *
6
+ * A distinct class because the fix is a distinct action — bring the installed
7
+ * Format packages to one release — and because the alternative is the failure
8
+ * this check exists to prevent: output produced by two releases, stamped as
9
+ * though one release produced all of it, and diagnosed months later against a
10
+ * release that never rendered any of it.
11
+ */
12
+ declare class ProducerVersionMismatchError extends Error {
13
+ readonly documentSdk: string;
14
+ readonly documentEngine: string | undefined;
15
+ readonly compilerSdk: string;
16
+ readonly compilerEngine: string;
17
+ constructor(args: {
18
+ documentSdk: string;
19
+ documentEngine?: string;
20
+ compilerSdk: string;
21
+ compilerEngine: string;
22
+ });
23
+ }
24
+ interface FinalizeDocumentHtmlArgs {
25
+ html: string;
26
+ /** J: the release this compiler belongs to, written as `data-sdk`. */
27
+ sdk: string;
28
+ /** E: the released engine that release targets, written as `data-engine`. */
29
+ engine: string;
30
+ /** Collected document CSS. Empty or omitted emits no style tag. */
31
+ css?: string;
32
+ }
33
+ /**
34
+ * Stamp a rendered document with this compiler's release numbers, and inject
35
+ * the collected CSS.
36
+ *
37
+ * Throws `ProducerVersionMismatchError` when the document already names a
38
+ * different producing release. The check runs before anything is written, so a
39
+ * mismatched document leaves this function unchanged rather than half-stamped.
40
+ */
41
+ declare function finalizeDocumentHtml(args: FinalizeDocumentHtmlArgs): string;
42
+ /**
43
+ * Rewrite the engine version onto an already-finalised document, leaving
44
+ * `data-sdk` alone.
45
+ *
46
+ * Studio calls this to preview against a locally built engine. Only the engine
47
+ * changes: `data-sdk` says which release built the document, and that is still
48
+ * true when a local engine renders it.
49
+ */
50
+ declare function restampDocumentEngine(html: string, engine: string): string;
51
+ //#endregion
52
+ export { ProducerVersionMismatchError, finalizeDocumentHtml, restampDocumentEngine };
53
+ //# sourceMappingURL=finalize-document-html.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalize-document-html.d.mts","names":[],"sources":["../../../src/server/compile/finalize-document-html.ts"],"sourcesContent":[],"mappings":";;AAsDA;AAwBC;AA8GD;AA8CA;;;;;;cApLa,4BAAA,SAAqC,KAAA;;;;;;;;;;;;UA0BxC,wBAAA;;;;;;;;;;;;;;;;;iBA4GM,oBAAA,OAA2B;;;;;;;;;iBA8C3B,qBAAA"}
@@ -0,0 +1,132 @@
1
+ import { _defineProperty } from "../../_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.mjs";
2
+ import { parseFragment } from "parse5";
3
+
4
+ //#region src/server/compile/finalize-document-html.ts
5
+ /** The two attributes this module owns, in the order it writes them. */
6
+ const GENERATED = ["data-sdk", "data-engine"];
7
+ function getAttr(node, name) {
8
+ return (node.attrs?.find((candidate) => candidate.name === name))?.value;
9
+ }
10
+ /**
11
+ * Raised when the SDK that rendered a document and the compiler finalising it
12
+ * come from different Format releases.
13
+ *
14
+ * A distinct class because the fix is a distinct action — bring the installed
15
+ * Format packages to one release — and because the alternative is the failure
16
+ * this check exists to prevent: output produced by two releases, stamped as
17
+ * though one release produced all of it, and diagnosed months later against a
18
+ * release that never rendered any of it.
19
+ */
20
+ var ProducerVersionMismatchError = class extends Error {
21
+ constructor(args) {
22
+ const engines = args.documentEngine !== void 0 && args.documentEngine !== args.compilerEngine ? ` and targets engine ${args.documentEngine} where this compiler targets ${args.compilerEngine}` : "";
23
+ super(`This document was rendered by Format ${args.documentSdk}${engines}, and is being compiled by Format ${args.compilerSdk}. Format will not stamp one release's number onto another release's output. Bring every @format.dev/* package to one version — \`format update\` does it — and compile again.`);
24
+ _defineProperty(this, "documentSdk", void 0);
25
+ _defineProperty(this, "documentEngine", void 0);
26
+ _defineProperty(this, "compilerSdk", void 0);
27
+ _defineProperty(this, "compilerEngine", void 0);
28
+ this.name = "ProducerVersionMismatchError";
29
+ this.documentSdk = args.documentSdk;
30
+ this.documentEngine = args.documentEngine;
31
+ this.compilerSdk = args.compilerSdk;
32
+ this.compilerEngine = args.compilerEngine;
33
+ }
34
+ };
35
+ /**
36
+ * The one `<template data-type="document">` at the top of the fragment.
37
+ *
38
+ * Returns null when the html holds no document template, or when parse5 could
39
+ * not report where its opening tag ends — in both cases the caller returns the
40
+ * html untouched, because there is nowhere to write.
41
+ */
42
+ function findDocumentTemplate(html) {
43
+ const documents = (parseFragment(html, { sourceCodeLocationInfo: true }).childNodes ?? []).filter((node) => node.tagName === "template" && getAttr(node, "data-type") === "document");
44
+ if (documents.length === 0) return null;
45
+ if (documents.length > 1) throw new Error(`Expected a single root document template, found ${documents.length}. A Format document must have exactly one top-level <template data-type="document">.`);
46
+ const [documentNode] = documents;
47
+ const startTag = documentNode.sourceCodeLocation?.startTag;
48
+ if (!startTag) return null;
49
+ const attributeAt = {};
50
+ for (const [name, at] of Object.entries(documentNode.sourceCodeLocation?.attrs ?? {})) attributeAt[name] = {
51
+ from: at.startOffset - startTag.startOffset,
52
+ to: at.endOffset - startTag.startOffset
53
+ };
54
+ return {
55
+ tag: html.slice(startTag.startOffset, startTag.endOffset),
56
+ startOffset: startTag.startOffset,
57
+ endOffset: startTag.endOffset,
58
+ sdk: getAttr(documentNode, "data-sdk"),
59
+ engine: getAttr(documentNode, "data-engine"),
60
+ attributeAt
61
+ };
62
+ }
63
+ /**
64
+ * The opening tag with `names` cut out of it, at the offsets the parser gave.
65
+ *
66
+ * Removed back to front so an earlier removal does not move a later offset, and
67
+ * the space in front of each attribute goes with it so the tag does not
68
+ * accumulate gaps.
69
+ */
70
+ function withoutAttributes(document, names) {
71
+ const spans = names.map((name) => document.attributeAt[name]).filter((at) => at !== void 0).sort((a, b) => b.from - a.from);
72
+ let tag = document.tag;
73
+ for (const at of spans) {
74
+ const from = /\s/.test(tag[at.from - 1] ?? "") ? at.from - 1 : at.from;
75
+ tag = tag.slice(0, from) + tag.slice(at.to);
76
+ }
77
+ return tag;
78
+ }
79
+ /**
80
+ * Stamp a rendered document with this compiler's release numbers, and inject
81
+ * the collected CSS.
82
+ *
83
+ * Throws `ProducerVersionMismatchError` when the document already names a
84
+ * different producing release. The check runs before anything is written, so a
85
+ * mismatched document leaves this function unchanged rather than half-stamped.
86
+ */
87
+ function finalizeDocumentHtml(args) {
88
+ const { html, sdk, engine, css = "" } = args;
89
+ if (!html) return html;
90
+ const document = findDocumentTemplate(html);
91
+ if (!document) return html;
92
+ const authored = document.sdk?.trim();
93
+ if (authored && (authored !== sdk || (document.engine?.trim() ?? engine) !== engine)) throw new ProducerVersionMismatchError({
94
+ documentSdk: authored,
95
+ documentEngine: document.engine?.trim(),
96
+ compilerSdk: sdk,
97
+ compilerEngine: engine
98
+ });
99
+ const styles = css.trim();
100
+ const styleTag = styles ? `<style>${styles}</style>` : "";
101
+ return html.slice(0, document.startOffset) + stampProducer(document, sdk, engine) + styleTag + html.slice(document.endOffset);
102
+ }
103
+ /**
104
+ * Rewrite the engine version onto an already-finalised document, leaving
105
+ * `data-sdk` alone.
106
+ *
107
+ * Studio calls this to preview against a locally built engine. Only the engine
108
+ * changes: `data-sdk` says which release built the document, and that is still
109
+ * true when a local engine renders it.
110
+ */
111
+ function restampDocumentEngine(html, engine) {
112
+ if (!html) return html;
113
+ const document = findDocumentTemplate(html);
114
+ if (!document) return html;
115
+ const stamped = withoutAttributes(document, ["data-engine"]).replace(/^<template/i, `<template data-engine="${engine}"`);
116
+ return html.slice(0, document.startOffset) + stamped + html.slice(document.endOffset);
117
+ }
118
+ /**
119
+ * Write both version attributes into the opening tag, replacing whatever was
120
+ * there.
121
+ *
122
+ * Inserted at the front, in the order React and Vue emit them, so a document
123
+ * that went through an SDK and a document that did not are byte-identical about
124
+ * the part that names their provenance.
125
+ */
126
+ function stampProducer(document, sdk, engine) {
127
+ return withoutAttributes(document, GENERATED).replace(/^<template/i, `<template data-sdk="${sdk}" data-engine="${engine}"`);
128
+ }
129
+
130
+ //#endregion
131
+ export { ProducerVersionMismatchError, finalizeDocumentHtml, restampDocumentEngine };
132
+ //# sourceMappingURL=finalize-document-html.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalize-document-html.mjs","names":["attributeAt: DocumentOpenTag['attributeAt']"],"sources":["../../../src/server/compile/finalize-document-html.ts"],"sourcesContent":["import { parseFragment } from 'parse5'\n\n// One parse over the rendered document to apply Studio's output concerns: the\n// release that produced it on `data-sdk`, the target engine version on\n// `data-engine`, and the collected CSS (external/global stylesheets in compile,\n// the render worker's css map in dev) as a document-level `<style>`. The engine\n// treats a `<style>` placed directly under `<Document>` as global styles — built\n// once into a `format-document` @layer and shared into every layout — so the\n// document's opening tag is the injection point for all three, and a single\n// parse locates it once.\n//\n// The two version attributes are generated, never authored. What an SDK already\n// wrote is checked rather than replaced: a document React or Vue stamped names\n// the release that rendered it, and a compiler from a different release\n// overwriting that stamp would relabel mixed output as though one coherent\n// release produced it. A document carrying no `data-sdk` was authored as HTML,\n// which is a supported input, so it takes this compiler's numbers.\n\ninterface Parse5Location {\n\tstartOffset: number\n\tendOffset: number\n}\n\ninterface Parse5Attr {\n\tname: string\n\tvalue: string\n}\n\ninterface Parse5Node {\n\tnodeName: string\n\ttagName?: string\n\tattrs?: Parse5Attr[]\n\tchildNodes?: Parse5Node[]\n\tsourceCodeLocation?: { startTag?: Parse5Location; attrs?: Record<string, Parse5Location> } | null\n}\n\n/** The two attributes this module owns, in the order it writes them. */\nconst GENERATED = ['data-sdk', 'data-engine'] as const\n\nfunction getAttr(node: Parse5Node, name: string): string | undefined {\n\tconst attr = node.attrs?.find(candidate => candidate.name === name)\n\treturn attr?.value\n}\n\n/**\n * Raised when the SDK that rendered a document and the compiler finalising it\n * come from different Format releases.\n *\n * A distinct class because the fix is a distinct action — bring the installed\n * Format packages to one release — and because the alternative is the failure\n * this check exists to prevent: output produced by two releases, stamped as\n * though one release produced all of it, and diagnosed months later against a\n * release that never rendered any of it.\n */\nexport class ProducerVersionMismatchError extends Error {\n\treadonly documentSdk: string\n\treadonly documentEngine: string | undefined\n\treadonly compilerSdk: string\n\treadonly compilerEngine: string\n\n\tconstructor(args: { documentSdk: string; documentEngine?: string; compilerSdk: string; compilerEngine: string }) {\n\t\tconst engines =\n\t\t\targs.documentEngine !== undefined && args.documentEngine !== args.compilerEngine\n\t\t\t\t? ` and targets engine ${args.documentEngine} where this compiler targets ${args.compilerEngine}`\n\t\t\t\t: ''\n\n\t\tsuper(\n\t\t\t`This document was rendered by Format ${args.documentSdk}${engines}, and is being compiled by Format ` +\n\t\t\t\t`${args.compilerSdk}. Format will not stamp one release's number onto another release's output. ` +\n\t\t\t\t'Bring every @format.dev/* package to one version — `format update` does it — and compile again.'\n\t\t)\n\n\t\tthis.name = 'ProducerVersionMismatchError'\n\t\tthis.documentSdk = args.documentSdk\n\t\tthis.documentEngine = args.documentEngine\n\t\tthis.compilerSdk = args.compilerSdk\n\t\tthis.compilerEngine = args.compilerEngine\n\t}\n}\n\ninterface FinalizeDocumentHtmlArgs {\n\thtml: string\n\t/** J: the release this compiler belongs to, written as `data-sdk`. */\n\tsdk: string\n\t/** E: the released engine that release targets, written as `data-engine`. */\n\tengine: string\n\t/** Collected document CSS. Empty or omitted emits no style tag. */\n\tcss?: string\n}\n\n/** The document template's opening tag, and where it sits in the html. */\ninterface DocumentOpenTag {\n\ttag: string\n\tstartOffset: number\n\tendOffset: number\n\tsdk: string | undefined\n\tengine: string | undefined\n\t/**\n\t * Where each attribute of the tag actually is, relative to the tag's start.\n\t *\n\t * Used to remove an attribute by cutting it out at the offsets the parser\n\t * reported. A regular expression cannot do this: `data-sdk=\"0.1.0\"` written\n\t * inside a title as an example matches one, and stripping that match deletes\n\t * part of the title. The parser already knows which occurrence is an attribute\n\t * and which is text, so the answer is taken from it rather than re-derived.\n\t */\n\tattributeAt: Record<string, { from: number; to: number }>\n}\n\n/**\n * The one `<template data-type=\"document\">` at the top of the fragment.\n *\n * Returns null when the html holds no document template, or when parse5 could\n * not report where its opening tag ends — in both cases the caller returns the\n * html untouched, because there is nowhere to write.\n */\nfunction findDocumentTemplate(html: string): DocumentOpenTag | null {\n\tconst fragment = parseFragment(html, { sourceCodeLocationInfo: true }) as unknown as Parse5Node\n\n\tconst documents = (fragment.childNodes ?? []).filter(\n\t\tnode => node.tagName === 'template' && getAttr(node, 'data-type') === 'document'\n\t)\n\n\tif (documents.length === 0) {\n\t\treturn null\n\t}\n\n\tif (documents.length > 1) {\n\t\tthrow new Error(\n\t\t\t`Expected a single root document template, found ${documents.length}. ` +\n\t\t\t\t'A Format document must have exactly one top-level <template data-type=\"document\">.'\n\t\t)\n\t}\n\n\tconst [documentNode] = documents\n\tconst startTag = documentNode.sourceCodeLocation?.startTag\n\n\tif (!startTag) {\n\t\treturn null\n\t}\n\n\tconst attributeAt: DocumentOpenTag['attributeAt'] = {}\n\n\tfor (const [name, at] of Object.entries(documentNode.sourceCodeLocation?.attrs ?? {})) {\n\t\tattributeAt[name] = { from: at.startOffset - startTag.startOffset, to: at.endOffset - startTag.startOffset }\n\t}\n\n\treturn {\n\t\ttag: html.slice(startTag.startOffset, startTag.endOffset),\n\t\tstartOffset: startTag.startOffset,\n\t\tendOffset: startTag.endOffset,\n\t\tsdk: getAttr(documentNode, 'data-sdk'),\n\t\tengine: getAttr(documentNode, 'data-engine'),\n\t\tattributeAt\n\t}\n}\n\n/**\n * The opening tag with `names` cut out of it, at the offsets the parser gave.\n *\n * Removed back to front so an earlier removal does not move a later offset, and\n * the space in front of each attribute goes with it so the tag does not\n * accumulate gaps.\n */\nfunction withoutAttributes(document: DocumentOpenTag, names: readonly string[]): string {\n\tconst spans = names\n\t\t.map(name => document.attributeAt[name])\n\t\t.filter((at): at is { from: number; to: number } => at !== undefined)\n\t\t.sort((a, b) => b.from - a.from)\n\n\tlet tag = document.tag\n\n\tfor (const at of spans) {\n\t\tconst from = /\\s/.test(tag[at.from - 1] ?? '') ? at.from - 1 : at.from\n\t\ttag = tag.slice(0, from) + tag.slice(at.to)\n\t}\n\n\treturn tag\n}\n\n/**\n * Stamp a rendered document with this compiler's release numbers, and inject\n * the collected CSS.\n *\n * Throws `ProducerVersionMismatchError` when the document already names a\n * different producing release. The check runs before anything is written, so a\n * mismatched document leaves this function unchanged rather than half-stamped.\n */\nexport function finalizeDocumentHtml(args: FinalizeDocumentHtmlArgs): string {\n\tconst { html, sdk, engine, css = '' } = args\n\n\tif (!html) {\n\t\treturn html\n\t}\n\n\tconst document = findDocumentTemplate(html)\n\n\tif (!document) {\n\t\treturn html\n\t}\n\n\t// An SDK-rendered document names its own producer. Equal is the only\n\t// acceptable answer; a document that names no producer was authored as HTML\n\t// and takes this compiler's numbers.\n\tconst authored = document.sdk?.trim()\n\n\tif (authored && (authored !== sdk || (document.engine?.trim() ?? engine) !== engine)) {\n\t\tthrow new ProducerVersionMismatchError({\n\t\t\tdocumentSdk: authored,\n\t\t\tdocumentEngine: document.engine?.trim(),\n\t\t\tcompilerSdk: sdk,\n\t\t\tcompilerEngine: engine\n\t\t})\n\t}\n\n\tconst styles = css.trim()\n\tconst styleTag = styles ? `<style>${styles}</style>` : ''\n\n\treturn (\n\t\thtml.slice(0, document.startOffset) +\n\t\tstampProducer(document, sdk, engine) +\n\t\tstyleTag +\n\t\thtml.slice(document.endOffset)\n\t)\n}\n\n/**\n * Rewrite the engine version onto an already-finalised document, leaving\n * `data-sdk` alone.\n *\n * Studio calls this to preview against a locally built engine. Only the engine\n * changes: `data-sdk` says which release built the document, and that is still\n * true when a local engine renders it.\n */\nexport function restampDocumentEngine(html: string, engine: string): string {\n\tif (!html) {\n\t\treturn html\n\t}\n\n\tconst document = findDocumentTemplate(html)\n\n\tif (!document) {\n\t\treturn html\n\t}\n\n\tconst stamped = withoutAttributes(document, ['data-engine']).replace(\n\t\t/^<template/i,\n\t\t`<template data-engine=\"${engine}\"`\n\t)\n\n\treturn html.slice(0, document.startOffset) + stamped + html.slice(document.endOffset)\n}\n\n/**\n * Write both version attributes into the opening tag, replacing whatever was\n * there.\n *\n * Inserted at the front, in the order React and Vue emit them, so a document\n * that went through an SDK and a document that did not are byte-identical about\n * the part that names their provenance.\n */\nfunction stampProducer(document: DocumentOpenTag, sdk: string, engine: string): string {\n\treturn withoutAttributes(document, GENERATED).replace(\n\t\t/^<template/i,\n\t\t`<template data-sdk=\"${sdk}\" data-engine=\"${engine}\"`\n\t)\n}\n"],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ //#region src/server/compile/generated/adaptorHtml.mjs?raw
2
+ var adaptorHtml_default = "//#region rolldown:runtime\nvar __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);\n\n//#endregion\n//#region ../../node_modules/.pnpm/eta@3.5.0/node_modules/eta/dist/browser.umd.js\nvar require_browser_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {\n (function(t, e) {\n \"object\" == typeof exports && \"undefined\" != typeof module ? e(exports) : \"function\" == typeof define && define.amd ? define([\"exports\"], e) : e((t || self).eta = {});\n })(exports, function(t) {\n function e() {\n return e = Object.assign ? Object.assign.bind() : function(t$1) {\n for (var e$1 = 1; e$1 < arguments.length; e$1++) {\n var n$1 = arguments[e$1];\n for (var r$1 in n$1) Object.prototype.hasOwnProperty.call(n$1, r$1) && (t$1[r$1] = n$1[r$1]);\n }\n return t$1;\n }, e.apply(this, arguments);\n }\n function n(t$1, e$1) {\n t$1.prototype = Object.create(e$1.prototype), t$1.prototype.constructor = t$1, i(t$1, e$1);\n }\n function r(t$1) {\n return r = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t$2) {\n return t$2.__proto__ || Object.getPrototypeOf(t$2);\n }, r(t$1);\n }\n function i(t$1, e$1) {\n return i = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t$2, e$2) {\n return t$2.__proto__ = e$2, t$2;\n }, i(t$1, e$1);\n }\n function a(t$1, e$1, n$1) {\n return a = function() {\n if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n if (Reflect.construct.sham) return !1;\n if (\"function\" == typeof Proxy) return !0;\n try {\n return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})), !0;\n } catch (t$2) {\n return !1;\n }\n }() ? Reflect.construct.bind() : function(t$2, e$2, n$2) {\n var r$1 = [null];\n r$1.push.apply(r$1, e$2);\n var a$1 = new (Function.bind.apply(t$2, r$1))();\n return n$2 && i(a$1, n$2.prototype), a$1;\n }, a.apply(null, arguments);\n }\n function s(t$1) {\n var e$1 = \"function\" == typeof Map ? /* @__PURE__ */ new Map() : void 0;\n return s = function(t$2) {\n if (null === t$2 || -1 === Function.toString.call(t$2).indexOf(\"[native code]\")) return t$2;\n if (\"function\" != typeof t$2) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== e$1) {\n if (e$1.has(t$2)) return e$1.get(t$2);\n e$1.set(t$2, n$1);\n }\n function n$1() {\n return a(t$2, arguments, r(this).constructor);\n }\n return n$1.prototype = Object.create(t$2.prototype, { constructor: {\n value: n$1,\n enumerable: !1,\n writable: !0,\n configurable: !0\n } }), i(n$1, t$2);\n }, s(t$1);\n }\n var o = /* @__PURE__ */ function() {\n function t$1(t$2) {\n this.cache = void 0, this.cache = t$2;\n }\n var n$1 = t$1.prototype;\n return n$1.define = function(t$2, e$1) {\n this.cache[t$2] = e$1;\n }, n$1.get = function(t$2) {\n return this.cache[t$2];\n }, n$1.remove = function(t$2) {\n delete this.cache[t$2];\n }, n$1.reset = function() {\n this.cache = {};\n }, n$1.load = function(t$2) {\n this.cache = e({}, this.cache, t$2);\n }, t$1;\n }(), c = /* @__PURE__ */ function(t$1) {\n function e$1(e$2) {\n var n$1;\n return (n$1 = t$1.call(this, e$2) || this).name = \"Eta Error\", n$1;\n }\n return n(e$1, t$1), e$1;\n }(/* @__PURE__ */ s(Error)), l = /* @__PURE__ */ function(t$1) {\n function e$1(e$2) {\n var n$1;\n return (n$1 = t$1.call(this, e$2) || this).name = \"EtaParser Error\", n$1;\n }\n return n(e$1, t$1), e$1;\n }(c), u = /* @__PURE__ */ function(t$1) {\n function e$1(e$2) {\n var n$1;\n return (n$1 = t$1.call(this, e$2) || this).name = \"EtaRuntime Error\", n$1;\n }\n return n(e$1, t$1), e$1;\n }(c), f = /* @__PURE__ */ function(t$1) {\n function e$1(e$2) {\n var n$1;\n return (n$1 = t$1.call(this, e$2) || this).name = \"EtaNameResolution Error\", n$1;\n }\n return n(e$1, t$1), e$1;\n }(c);\n function h(t$1, e$1, n$1) {\n var r$1 = e$1.slice(0, n$1).split(/\\n/), i$1 = r$1.length, a$1 = r$1[i$1 - 1].length + 1;\n throw t$1 += \" at line \" + i$1 + \" col \" + a$1 + \":\\n\\n \" + e$1.split(/\\n/)[i$1 - 1] + \"\\n \" + Array(a$1).join(\" \") + \"^\", new l(t$1);\n }\n function p(t$1, e$1, n$1, r$1) {\n var i$1 = e$1.split(\"\\n\"), a$1 = Math.max(n$1 - 3, 0), s$1 = Math.min(i$1.length, n$1 + 3), o$1 = r$1, c$1 = i$1.slice(a$1, s$1).map(function(t$2, e$2) {\n var r$2 = e$2 + a$1 + 1;\n return (r$2 == n$1 ? \" >> \" : \" \") + r$2 + \"| \" + t$2;\n }).join(\"\\n\"), l$1 = new u((o$1 ? o$1 + \":\" + n$1 + \"\\n\" : \"line \" + n$1 + \"\\n\") + c$1 + \"\\n\\n\" + t$1.message);\n throw l$1.name = t$1.name, l$1;\n }\n var d = function() {\n return Promise.resolve();\n }.constructor;\n function g(t$1, e$1) {\n var n$1 = this.config, r$1 = e$1 && e$1.async ? d : Function;\n try {\n return new r$1(n$1.varName, \"options\", this.compileToString.call(this, t$1, e$1));\n } catch (n$2) {\n throw n$2 instanceof SyntaxError ? new l(\"Bad template syntax\\n\\n\" + n$2.message + \"\\n\" + Array(n$2.message.length + 1).join(\"=\") + \"\\n\" + this.compileToString.call(this, t$1, e$1) + \"\\n\") : n$2;\n }\n }\n function y(t$1, e$1) {\n var n$1 = this.config, r$1 = e$1 && e$1.async, i$1 = this.compileBody, a$1 = this.parse.call(this, t$1), s$1 = n$1.functionHeader + \"\\nlet include = (template, data) => this.render(template, data, options);\\nlet includeAsync = (template, data) => this.renderAsync(template, data, options);\\n\\nlet __eta = {res: \\\"\\\", e: this.config.escapeFunction, f: this.config.filterFunction\" + (n$1.debug ? \", line: 1, templateStr: \\\"\" + t$1.replace(/\\\\|\"/g, \"\\\\$&\").replace(/\\r\\n|\\n|\\r/g, \"\\\\n\") + \"\\\"\" : \"\") + \"};\\n\\nfunction layout(path, data) {\\n __eta.layout = path;\\n __eta.layoutData = data;\\n}\" + (n$1.debug ? \"try {\" : \"\") + (n$1.useWith ? \"with(\" + n$1.varName + \"||{}){\" : \"\") + \"\\n\\n\" + i$1.call(this, a$1) + \"\\nif (__eta.layout) {\\n __eta.res = \" + (r$1 ? \"await includeAsync\" : \"include\") + \" (__eta.layout, {...\" + n$1.varName + \", body: __eta.res, ...__eta.layoutData});\\n}\\n\" + (n$1.useWith ? \"}\" : \"\") + (n$1.debug ? \"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }\" : \"\") + \"\\nreturn __eta.res;\\n\";\n if (n$1.plugins) for (var o$1 = 0; o$1 < n$1.plugins.length; o$1++) {\n var c$1 = n$1.plugins[o$1];\n c$1.processFnString && (s$1 = c$1.processFnString(s$1, n$1));\n }\n return s$1;\n }\n function v(t$1) {\n for (var e$1 = this.config, n$1 = 0, r$1 = t$1.length, i$1 = \"\"; n$1 < r$1; n$1++) {\n var a$1 = t$1[n$1];\n if (\"string\" == typeof a$1) i$1 += \"__eta.res+='\" + a$1 + \"'\\n\";\n else {\n var s$1 = a$1.t, o$1 = a$1.val || \"\";\n e$1.debug && (i$1 += \"__eta.line=\" + a$1.lineNo + \"\\n\"), \"r\" === s$1 ? (e$1.autoFilter && (o$1 = \"__eta.f(\" + o$1 + \")\"), i$1 += \"__eta.res+=\" + o$1 + \"\\n\") : \"i\" === s$1 ? (e$1.autoFilter && (o$1 = \"__eta.f(\" + o$1 + \")\"), e$1.autoEscape && (o$1 = \"__eta.e(\" + o$1 + \")\"), i$1 += \"__eta.res+=\" + o$1 + \"\\n\") : \"e\" === s$1 && (i$1 += o$1 + \"\\n\");\n }\n }\n return i$1;\n }\n var m = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n \"\\\"\": \"&quot;\",\n \"'\": \"&#39;\"\n };\n function x(t$1) {\n return m[t$1];\n }\n var _ = {\n autoEscape: !0,\n autoFilter: !1,\n autoTrim: [!1, \"nl\"],\n cache: !1,\n cacheFilepaths: !0,\n debug: !1,\n escapeFunction: function(t$1) {\n var e$1 = String(t$1);\n return /[&<>\"']/.test(e$1) ? e$1.replace(/[&<>\"']/g, x) : e$1;\n },\n filterFunction: function(t$1) {\n return String(t$1);\n },\n functionHeader: \"\",\n parse: {\n exec: \"\",\n interpolate: \"=\",\n raw: \"~\"\n },\n plugins: [],\n rmWhitespace: !1,\n tags: [\"<%\", \"%>\"],\n useWith: !1,\n varName: \"it\",\n defaultExtension: \".eta\"\n }, b = /`(?:\\\\[\\s\\S]|\\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\\${)[^\\\\`])*`/g, w = /'(?:\\\\[\\s\\w\"'\\\\`]|[^\\n\\r'\\\\])*?'/g, S = /\"(?:\\\\[\\s\\w\"'\\\\`]|[^\\n\\r\"\\\\])*?\"/g;\n function E(t$1) {\n return t$1.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }\n function F(t$1, e$1) {\n return t$1.slice(0, e$1).split(\"\\n\").length;\n }\n function O(t$1) {\n var e$1 = this.config, n$1 = [], r$1 = !1, i$1 = 0, a$1 = e$1.parse;\n if (e$1.plugins) for (var s$1 = 0; s$1 < e$1.plugins.length; s$1++) {\n var o$1 = e$1.plugins[s$1];\n o$1.processTemplate && (t$1 = o$1.processTemplate(t$1, e$1));\n }\n function c$1(t$2, i$2) {\n t$2 && (t$2 = function(t$3, e$2, n$2, r$2) {\n var i$3, a$2;\n return Array.isArray(e$2.autoTrim) ? (i$3 = e$2.autoTrim[1], a$2 = e$2.autoTrim[0]) : i$3 = a$2 = e$2.autoTrim, (n$2 || !1 === n$2) && (i$3 = n$2), (r$2 || !1 === r$2) && (a$2 = r$2), a$2 || i$3 ? \"slurp\" === i$3 && \"slurp\" === a$2 ? t$3.trim() : (\"_\" === i$3 || \"slurp\" === i$3 ? t$3 = t$3.trimStart() : \"-\" !== i$3 && \"nl\" !== i$3 || (t$3 = t$3.replace(/^(?:\\r\\n|\\n|\\r)/, \"\")), \"_\" === a$2 || \"slurp\" === a$2 ? t$3 = t$3.trimEnd() : \"-\" !== a$2 && \"nl\" !== a$2 || (t$3 = t$3.replace(/(?:\\r\\n|\\n|\\r)$/, \"\")), t$3) : t$3;\n }(t$2, e$1, r$1, i$2), t$2 && (t$2 = t$2.replace(/\\\\|'/g, \"\\\\$&\").replace(/\\r\\n|\\n|\\r/g, \"\\\\n\"), n$1.push(t$2)));\n }\n e$1.rmWhitespace && (t$1 = t$1.replace(/[\\r\\n]+/g, \"\\n\").replace(/^\\s+|\\s+$/gm, \"\")), b.lastIndex = 0, w.lastIndex = 0, S.lastIndex = 0;\n for (var l$1, u$1 = [\n a$1.exec,\n a$1.interpolate,\n a$1.raw\n ].reduce(function(t$2, e$2) {\n return t$2 && e$2 ? t$2 + \"|\" + E(e$2) : e$2 ? E(e$2) : t$2;\n }, \"\"), f$1 = new RegExp(E(e$1.tags[0]) + \"(-|_)?\\\\s*(\" + u$1 + \")?\\\\s*\", \"g\"), p$1 = new RegExp(\"'|\\\"|`|\\\\/\\\\*|(\\\\s*(-|_)?\" + E(e$1.tags[1]) + \")\", \"g\"); l$1 = f$1.exec(t$1);) {\n var d$1 = t$1.slice(i$1, l$1.index);\n i$1 = l$1[0].length + l$1.index;\n var g$1 = l$1[2] || \"\";\n c$1(d$1, l$1[1]), p$1.lastIndex = i$1;\n for (var y$1 = void 0, v$1 = !1; y$1 = p$1.exec(t$1);) {\n if (y$1[1]) {\n var m$1 = t$1.slice(i$1, y$1.index);\n f$1.lastIndex = i$1 = p$1.lastIndex, r$1 = y$1[2], v$1 = {\n t: g$1 === a$1.exec ? \"e\" : g$1 === a$1.raw ? \"r\" : g$1 === a$1.interpolate ? \"i\" : \"\",\n val: m$1\n };\n break;\n }\n var x$1 = y$1[0];\n if (\"/*\" === x$1) {\n var _$1 = t$1.indexOf(\"*/\", p$1.lastIndex);\n -1 === _$1 && h(\"unclosed comment\", t$1, y$1.index), p$1.lastIndex = _$1;\n } else \"'\" === x$1 ? (w.lastIndex = y$1.index, w.exec(t$1) ? p$1.lastIndex = w.lastIndex : h(\"unclosed string\", t$1, y$1.index)) : \"\\\"\" === x$1 ? (S.lastIndex = y$1.index, S.exec(t$1) ? p$1.lastIndex = S.lastIndex : h(\"unclosed string\", t$1, y$1.index)) : \"`\" === x$1 && (b.lastIndex = y$1.index, b.exec(t$1) ? p$1.lastIndex = b.lastIndex : h(\"unclosed string\", t$1, y$1.index));\n }\n v$1 ? (e$1.debug && (v$1.lineNo = F(t$1, l$1.index)), n$1.push(v$1)) : h(\"unclosed tag\", t$1, l$1.index);\n }\n if (c$1(t$1.slice(i$1, t$1.length), !1), e$1.plugins) for (var O$1 = 0; O$1 < e$1.plugins.length; O$1++) {\n var I$1 = e$1.plugins[O$1];\n I$1.processAST && (n$1 = I$1.processAST(n$1, e$1));\n }\n return n$1;\n }\n function I(t$1, e$1) {\n var n$1 = e$1 && e$1.async ? this.templatesAsync : this.templatesSync;\n if (this.resolvePath && this.readFile && !t$1.startsWith(\"@\")) {\n var r$1 = e$1.filepath, i$1 = n$1.get(r$1);\n if (this.config.cache && i$1) return i$1;\n var a$1 = this.readFile(r$1), s$1 = this.compile(a$1, e$1);\n return this.config.cache && n$1.define(r$1, s$1), s$1;\n }\n var o$1 = n$1.get(t$1);\n if (o$1) return o$1;\n throw new f(\"Failed to get template '\" + t$1 + \"'\");\n }\n function A(t$1, n$1, r$1) {\n var i$1, a$1 = e({}, r$1, { async: !1 });\n return \"string\" == typeof t$1 ? (this.resolvePath && this.readFile && !t$1.startsWith(\"@\") && (a$1.filepath = this.resolvePath(t$1, a$1)), i$1 = I.call(this, t$1, a$1)) : i$1 = t$1, i$1.call(this, n$1, a$1);\n }\n function P(t$1, n$1, r$1) {\n var i$1, a$1 = e({}, r$1, { async: !0 });\n \"string\" == typeof t$1 ? (this.resolvePath && this.readFile && !t$1.startsWith(\"@\") && (a$1.filepath = this.resolvePath(t$1, a$1)), i$1 = I.call(this, t$1, a$1)) : i$1 = t$1;\n var s$1 = i$1.call(this, n$1, a$1);\n return Promise.resolve(s$1);\n }\n function T(t$1, e$1) {\n var n$1 = this.compile(t$1, { async: !1 });\n return A.call(this, n$1, e$1);\n }\n function j(t$1, e$1) {\n var n$1 = this.compile(t$1, { async: !0 });\n return P.call(this, n$1, e$1);\n }\n t.Eta = /* @__PURE__ */ function(t$1) {\n function e$1() {\n return t$1.apply(this, arguments) || this;\n }\n return n(e$1, t$1), e$1;\n }(/* @__PURE__ */ function() {\n function t$1(t$2) {\n this.config = void 0, this.RuntimeErr = p, this.compile = g, this.compileToString = y, this.compileBody = v, this.parse = O, this.render = A, this.renderAsync = P, this.renderString = T, this.renderStringAsync = j, this.filepathCache = {}, this.templatesSync = new o({}), this.templatesAsync = new o({}), this.resolvePath = null, this.readFile = null, this.config = t$2 ? e({}, _, t$2) : e({}, _);\n }\n var n$1 = t$1.prototype;\n return n$1.configure = function(t$2) {\n this.config = e({}, this.config, t$2);\n }, n$1.withConfig = function(t$2) {\n return e({}, this, { config: e({}, this.config, t$2) });\n }, n$1.loadTemplate = function(t$2, e$1, n$2) {\n if (\"string\" == typeof e$1) (n$2 && n$2.async ? this.templatesAsync : this.templatesSync).define(t$2, this.compile(e$1, n$2));\n else {\n var r$1 = this.templatesSync;\n (\"AsyncFunction\" === e$1.constructor.name || n$2 && n$2.async) && (r$1 = this.templatesAsync), r$1.define(t$2, e$1);\n }\n }, t$1;\n }());\n });\n}));\n\n//#endregion\n//#region src/server/compile/adaptors/html-partials.ts\nvar import_browser_umd = require_browser_umd();\n/**\n* Partial keys are posix-style paths relative to the document entry. Leading\n* `..` segments are kept so a partial can reference a sibling directory and\n* still resolve to the same key the loader emitted.\n*/\nfunction normalizePartialPath(path) {\n const segments = [];\n for (const segment of path.split(\"/\")) {\n if (!segment || segment === \".\") continue;\n if (segment === \"..\" && segments.length > 0 && segments[segments.length - 1] !== \"..\") {\n segments.pop();\n continue;\n }\n segments.push(segment);\n }\n return segments.join(\"/\");\n}\nfunction resolvePartialPath(name, baseFilePath) {\n const baseDir = baseFilePath ? baseFilePath.split(\"/\").slice(0, -1).join(\"/\") : \"\";\n return normalizePartialPath(baseDir ? `${baseDir}/${name}` : name);\n}\nfunction isHtmlDocumentModule(value) {\n return typeof value === \"object\" && value !== null && typeof value.template === \"string\";\n}\n\n//#endregion\n//#region src/server/compile/adaptors/html.ts\n/**\n* Eta instance that resolves `include()` names against the document's bundled\n* partials map instead of the filesystem, so includes work identically in the\n* dev worker, at compile time, and inside consumer bundles. `resolvePath` and\n* `readFile` are assigned as instance properties because the Node build of Eta\n* binds its own in the constructor (and the browser build has none).\n*/\nvar DocumentEta = class extends import_browser_umd.Eta {\n constructor(partials) {\n super({ varName: \"data\" });\n this.resolvePath = (templatePath, options) => resolvePartialPath(templatePath, options?.filepath);\n this.readFile = (path) => {\n const template = partials[path];\n if (template === void 0) {\n const known = Object.keys(partials);\n const hint = known.length > 0 ? ` Known partials: ${known.join(\", \")}` : \"\";\n throw new Error(`Could not find included template '${path}'.${hint}`);\n }\n return template;\n };\n }\n};\nvar html_default = {\n create({ Component, data }) {\n if (isHtmlDocumentModule(Component)) return new DocumentEta(Component.partials ?? {}).renderString(Component.template, data);\n return new import_browser_umd.Eta({ varName: \"data\" }).renderString(Component, data);\n },\n render({ element }) {\n return element;\n }\n};\n\n//#endregion\nexport { html_default as default };";
3
+
4
+ //#endregion
5
+ export { adaptorHtml_default as default };
6
+ //# sourceMappingURL=adaptorHtml.mjs.map