@veryfront/ext-content-mdx 0.1.985

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 (341) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +2 -0
  3. package/README.md +42 -0
  4. package/esm/_dnt.polyfills.d.ts +18 -0
  5. package/esm/_dnt.polyfills.d.ts.map +1 -0
  6. package/esm/_dnt.polyfills.js +15 -0
  7. package/esm/_dnt.shims.d.ts +12 -0
  8. package/esm/_dnt.shims.d.ts.map +1 -0
  9. package/esm/_dnt.shims.js +68 -0
  10. package/esm/deno.d.ts +427 -0
  11. package/esm/deno.d.ts.map +1 -0
  12. package/esm/deno.js +512 -0
  13. package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts +33 -0
  14. package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.js +48 -0
  16. package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts +64 -0
  17. package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.js +1371 -0
  19. package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts +44 -0
  20. package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.js +117 -0
  22. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts +3 -0
  23. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.js +103 -0
  25. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts +3 -0
  26. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.js +32 -0
  28. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts +3 -0
  29. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.js +96 -0
  31. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts +3 -0
  32. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.js +159 -0
  34. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts +3 -0
  35. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.js +14 -0
  37. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts +3 -0
  38. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.js +10 -0
  40. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts +3 -0
  41. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.js +22 -0
  43. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts +3 -0
  44. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.js +29 -0
  46. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts +3 -0
  47. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.js +19 -0
  49. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts +3 -0
  50. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.js +30 -0
  52. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts +3 -0
  53. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.js +10 -0
  55. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts +3 -0
  56. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.js +14 -0
  58. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts +3 -0
  59. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.js +9 -0
  61. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts +3 -0
  62. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.js +81 -0
  64. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts +3 -0
  65. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts.map +1 -0
  66. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.js +20 -0
  67. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts +32 -0
  68. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts.map +1 -0
  69. package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.js +6 -0
  70. package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts +4 -0
  71. package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.js +13 -0
  73. package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts +76 -0
  74. package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.js +91 -0
  76. package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.d.ts +3 -0
  77. package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.d.ts.map +1 -0
  78. package/esm/extensions/ext-content-mdx/src/compiler/markdown-compile.js +99 -0
  79. package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.d.ts +3 -0
  80. package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.d.ts.map +1 -0
  81. package/esm/extensions/ext-content-mdx/src/compiler/mdx-compile.js +53 -0
  82. package/esm/extensions/ext-content-mdx/src/index.d.ts +31 -0
  83. package/esm/extensions/ext-content-mdx/src/index.d.ts.map +1 -0
  84. package/esm/extensions/ext-content-mdx/src/index.js +56 -0
  85. package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.d.ts +4 -0
  86. package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.d.ts.map +1 -0
  87. package/esm/extensions/ext-content-mdx/src/plugins/plugin-loader.js +18 -0
  88. package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.d.ts +20 -0
  89. package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.d.ts.map +1 -0
  90. package/esm/extensions/ext-content-mdx/src/plugins/rehype-node-positions.js +45 -0
  91. package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.d.ts +4 -0
  92. package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.d.ts.map +1 -0
  93. package/esm/extensions/ext-content-mdx/src/plugins/remark-headings.js +69 -0
  94. package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.d.ts +14 -0
  95. package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.d.ts.map +1 -0
  96. package/esm/extensions/ext-content-mdx/src/plugins/remark-mdx-utils.js +191 -0
  97. package/esm/package.json +3 -0
  98. package/esm/src/config/defaults.d.ts +39 -0
  99. package/esm/src/config/defaults.d.ts.map +1 -0
  100. package/esm/src/config/defaults.js +65 -0
  101. package/esm/src/errors/error-registry/agent.d.ts +18 -0
  102. package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
  103. package/esm/src/errors/error-registry/agent.js +60 -0
  104. package/esm/src/errors/error-registry/boundary.d.ts +16 -0
  105. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
  106. package/esm/src/errors/error-registry/boundary.js +52 -0
  107. package/esm/src/errors/error-registry/build.d.ts +20 -0
  108. package/esm/src/errors/error-registry/build.d.ts.map +1 -0
  109. package/esm/src/errors/error-registry/build.js +68 -0
  110. package/esm/src/errors/error-registry/config.d.ts +22 -0
  111. package/esm/src/errors/error-registry/config.d.ts.map +1 -0
  112. package/esm/src/errors/error-registry/config.js +70 -0
  113. package/esm/src/errors/error-registry/deploy.d.ts +12 -0
  114. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
  115. package/esm/src/errors/error-registry/deploy.js +36 -0
  116. package/esm/src/errors/error-registry/dev.d.ts +14 -0
  117. package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
  118. package/esm/src/errors/error-registry/dev.js +44 -0
  119. package/esm/src/errors/error-registry/general.d.ts +29 -0
  120. package/esm/src/errors/error-registry/general.d.ts.map +1 -0
  121. package/esm/src/errors/error-registry/general.js +92 -0
  122. package/esm/src/errors/error-registry/module.d.ts +16 -0
  123. package/esm/src/errors/error-registry/module.d.ts.map +1 -0
  124. package/esm/src/errors/error-registry/module.js +52 -0
  125. package/esm/src/errors/error-registry/route.d.ts +16 -0
  126. package/esm/src/errors/error-registry/route.d.ts.map +1 -0
  127. package/esm/src/errors/error-registry/route.js +52 -0
  128. package/esm/src/errors/error-registry/runtime.d.ts +18 -0
  129. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
  130. package/esm/src/errors/error-registry/runtime.js +60 -0
  131. package/esm/src/errors/error-registry/server.d.ts +39 -0
  132. package/esm/src/errors/error-registry/server.d.ts.map +1 -0
  133. package/esm/src/errors/error-registry/server.js +129 -0
  134. package/esm/src/errors/error-registry-helpers.d.ts +6 -0
  135. package/esm/src/errors/error-registry-helpers.d.ts.map +1 -0
  136. package/esm/src/errors/error-registry-helpers.js +9 -0
  137. package/esm/src/errors/error-registry.d.ts +114 -0
  138. package/esm/src/errors/error-registry.d.ts.map +1 -0
  139. package/esm/src/errors/error-registry.js +60 -0
  140. package/esm/src/errors/types.d.ts +84 -0
  141. package/esm/src/errors/types.d.ts.map +1 -0
  142. package/esm/src/errors/types.js +69 -0
  143. package/esm/src/errors/veryfront-error.d.ts +149 -0
  144. package/esm/src/errors/veryfront-error.d.ts.map +1 -0
  145. package/esm/src/errors/veryfront-error.js +61 -0
  146. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +13 -0
  147. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +1 -0
  148. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +55 -0
  149. package/esm/src/observability/tracing/api-shim.d.ts +178 -0
  150. package/esm/src/observability/tracing/api-shim.d.ts.map +1 -0
  151. package/esm/src/observability/tracing/api-shim.js +241 -0
  152. package/esm/src/observability/tracing/otlp-setup.d.ts +56 -0
  153. package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -0
  154. package/esm/src/observability/tracing/otlp-setup.js +206 -0
  155. package/esm/src/observability/tracing/telemetry-env.d.ts +3 -0
  156. package/esm/src/observability/tracing/telemetry-env.d.ts.map +1 -0
  157. package/esm/src/observability/tracing/telemetry-env.js +10 -0
  158. package/esm/src/platform/adapters/base.d.ts +188 -0
  159. package/esm/src/platform/adapters/base.d.ts.map +1 -0
  160. package/esm/src/platform/adapters/base.js +15 -0
  161. package/esm/src/platform/compat/constants.d.ts +13 -0
  162. package/esm/src/platform/compat/constants.d.ts.map +1 -0
  163. package/esm/src/platform/compat/constants.js +12 -0
  164. package/esm/src/platform/compat/dynamic-import.d.ts +11 -0
  165. package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -0
  166. package/esm/src/platform/compat/dynamic-import.js +10 -0
  167. package/esm/src/platform/compat/fs.d.ts +71 -0
  168. package/esm/src/platform/compat/fs.d.ts.map +1 -0
  169. package/esm/src/platform/compat/fs.js +277 -0
  170. package/esm/src/platform/compat/path/basic-operations.d.ts +9 -0
  171. package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -0
  172. package/esm/src/platform/compat/path/basic-operations.js +56 -0
  173. package/esm/src/platform/compat/path/index.d.ts +13 -0
  174. package/esm/src/platform/compat/path/index.d.ts.map +1 -0
  175. package/esm/src/platform/compat/path/index.js +11 -0
  176. package/esm/src/platform/compat/path/parse-format.d.ts +4 -0
  177. package/esm/src/platform/compat/path/parse-format.d.ts.map +1 -0
  178. package/esm/src/platform/compat/path/parse-format.js +26 -0
  179. package/esm/src/platform/compat/path/resolution.d.ts +6 -0
  180. package/esm/src/platform/compat/path/resolution.d.ts.map +1 -0
  181. package/esm/src/platform/compat/path/resolution.js +121 -0
  182. package/esm/src/platform/compat/path/runtime.d.ts +8 -0
  183. package/esm/src/platform/compat/path/runtime.d.ts.map +1 -0
  184. package/esm/src/platform/compat/path/runtime.js +20 -0
  185. package/esm/src/platform/compat/path/security.d.ts +2 -0
  186. package/esm/src/platform/compat/path/security.d.ts.map +1 -0
  187. package/esm/src/platform/compat/path/security.js +24 -0
  188. package/esm/src/platform/compat/path/types.d.ts +22 -0
  189. package/esm/src/platform/compat/path/types.d.ts.map +1 -0
  190. package/esm/src/platform/compat/path/types.js +1 -0
  191. package/esm/src/platform/compat/path/url-conversion.d.ts +3 -0
  192. package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -0
  193. package/esm/src/platform/compat/path/url-conversion.js +45 -0
  194. package/esm/src/platform/compat/process/command.d.ts +31 -0
  195. package/esm/src/platform/compat/process/command.d.ts.map +1 -0
  196. package/esm/src/platform/compat/process/command.js +194 -0
  197. package/esm/src/platform/compat/process/env.d.ts +35 -0
  198. package/esm/src/platform/compat/process/env.d.ts.map +1 -0
  199. package/esm/src/platform/compat/process/env.js +194 -0
  200. package/esm/src/platform/compat/process/lifecycle.d.ts +99 -0
  201. package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -0
  202. package/esm/src/platform/compat/process/lifecycle.js +327 -0
  203. package/esm/src/platform/compat/process/runtime-process.d.ts +10 -0
  204. package/esm/src/platform/compat/process/runtime-process.d.ts.map +1 -0
  205. package/esm/src/platform/compat/process/runtime-process.js +25 -0
  206. package/esm/src/platform/compat/process.d.ts +5 -0
  207. package/esm/src/platform/compat/process.d.ts.map +1 -0
  208. package/esm/src/platform/compat/process.js +4 -0
  209. package/esm/src/platform/compat/runtime.d.ts +51 -0
  210. package/esm/src/platform/compat/runtime.d.ts.map +1 -0
  211. package/esm/src/platform/compat/runtime.js +101 -0
  212. package/esm/src/platform/compat/std/front-matter-yaml.d.ts +13 -0
  213. package/esm/src/platform/compat/std/front-matter-yaml.d.ts.map +1 -0
  214. package/esm/src/platform/compat/std/front-matter-yaml.js +28 -0
  215. package/esm/src/transforms/import-rewriter/url-builder.d.ts +70 -0
  216. package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -0
  217. package/esm/src/transforms/import-rewriter/url-builder.js +152 -0
  218. package/esm/src/transforms/md/utils.d.ts +14 -0
  219. package/esm/src/transforms/md/utils.d.ts.map +1 -0
  220. package/esm/src/transforms/md/utils.js +17 -0
  221. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +6 -0
  222. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -0
  223. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +48 -0
  224. package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts +10 -0
  225. package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts.map +1 -0
  226. package/esm/src/transforms/mdx/compiler/import-rewriter.js +87 -0
  227. package/esm/src/utils/base64url.d.ts +6 -0
  228. package/esm/src/utils/base64url.d.ts.map +1 -0
  229. package/esm/src/utils/base64url.js +12 -0
  230. package/esm/src/utils/bundle-manifest.d.ts +63 -0
  231. package/esm/src/utils/bundle-manifest.d.ts.map +1 -0
  232. package/esm/src/utils/bundle-manifest.js +96 -0
  233. package/esm/src/utils/constants/buffers.d.ts +24 -0
  234. package/esm/src/utils/constants/buffers.d.ts.map +1 -0
  235. package/esm/src/utils/constants/buffers.js +23 -0
  236. package/esm/src/utils/constants/build.d.ts +8 -0
  237. package/esm/src/utils/constants/build.d.ts.map +1 -0
  238. package/esm/src/utils/constants/build.js +7 -0
  239. package/esm/src/utils/constants/cache.d.ts +74 -0
  240. package/esm/src/utils/constants/cache.d.ts.map +1 -0
  241. package/esm/src/utils/constants/cache.js +133 -0
  242. package/esm/src/utils/constants/cdn.d.ts +29 -0
  243. package/esm/src/utils/constants/cdn.d.ts.map +1 -0
  244. package/esm/src/utils/constants/cdn.js +58 -0
  245. package/esm/src/utils/constants/crypto.d.ts +10 -0
  246. package/esm/src/utils/constants/crypto.d.ts.map +1 -0
  247. package/esm/src/utils/constants/crypto.js +9 -0
  248. package/esm/src/utils/constants/env.d.ts +16 -0
  249. package/esm/src/utils/constants/env.d.ts.map +1 -0
  250. package/esm/src/utils/constants/env.js +20 -0
  251. package/esm/src/utils/constants/hash.d.ts +5 -0
  252. package/esm/src/utils/constants/hash.d.ts.map +1 -0
  253. package/esm/src/utils/constants/hash.js +4 -0
  254. package/esm/src/utils/constants/hmr.d.ts +24 -0
  255. package/esm/src/utils/constants/hmr.d.ts.map +1 -0
  256. package/esm/src/utils/constants/hmr.js +26 -0
  257. package/esm/src/utils/constants/html.d.ts +13 -0
  258. package/esm/src/utils/constants/html.d.ts.map +1 -0
  259. package/esm/src/utils/constants/html.js +12 -0
  260. package/esm/src/utils/constants/http.d.ts +77 -0
  261. package/esm/src/utils/constants/http.d.ts.map +1 -0
  262. package/esm/src/utils/constants/http.js +76 -0
  263. package/esm/src/utils/constants/index.d.ts +23 -0
  264. package/esm/src/utils/constants/index.d.ts.map +1 -0
  265. package/esm/src/utils/constants/index.js +22 -0
  266. package/esm/src/utils/constants/limits.d.ts +27 -0
  267. package/esm/src/utils/constants/limits.d.ts.map +1 -0
  268. package/esm/src/utils/constants/limits.js +26 -0
  269. package/esm/src/utils/constants/metrics.d.ts +10 -0
  270. package/esm/src/utils/constants/metrics.d.ts.map +1 -0
  271. package/esm/src/utils/constants/metrics.js +34 -0
  272. package/esm/src/utils/constants/network.d.ts +23 -0
  273. package/esm/src/utils/constants/network.d.ts.map +1 -0
  274. package/esm/src/utils/constants/network.js +27 -0
  275. package/esm/src/utils/constants/priorities.d.ts +31 -0
  276. package/esm/src/utils/constants/priorities.d.ts.map +1 -0
  277. package/esm/src/utils/constants/priorities.js +30 -0
  278. package/esm/src/utils/constants/retry.d.ts +14 -0
  279. package/esm/src/utils/constants/retry.d.ts.map +1 -0
  280. package/esm/src/utils/constants/retry.js +13 -0
  281. package/esm/src/utils/constants/security.d.ts +16 -0
  282. package/esm/src/utils/constants/security.d.ts.map +1 -0
  283. package/esm/src/utils/constants/security.js +15 -0
  284. package/esm/src/utils/constants/server.d.ts +107 -0
  285. package/esm/src/utils/constants/server.d.ts.map +1 -0
  286. package/esm/src/utils/constants/server.js +120 -0
  287. package/esm/src/utils/feature-flags.d.ts +7 -0
  288. package/esm/src/utils/feature-flags.d.ts.map +1 -0
  289. package/esm/src/utils/feature-flags.js +8 -0
  290. package/esm/src/utils/hash-utils.d.ts +19 -0
  291. package/esm/src/utils/hash-utils.d.ts.map +1 -0
  292. package/esm/src/utils/hash-utils.js +42 -0
  293. package/esm/src/utils/import-lockfile.d.ts +52 -0
  294. package/esm/src/utils/import-lockfile.d.ts.map +1 -0
  295. package/esm/src/utils/import-lockfile.js +187 -0
  296. package/esm/src/utils/index.d.ts +27 -0
  297. package/esm/src/utils/index.d.ts.map +1 -0
  298. package/esm/src/utils/index.js +25 -0
  299. package/esm/src/utils/logger/components.d.ts +73 -0
  300. package/esm/src/utils/logger/components.d.ts.map +1 -0
  301. package/esm/src/utils/logger/components.js +81 -0
  302. package/esm/src/utils/logger/core.d.ts +73 -0
  303. package/esm/src/utils/logger/core.d.ts.map +1 -0
  304. package/esm/src/utils/logger/core.js +143 -0
  305. package/esm/src/utils/logger/index.d.ts +10 -0
  306. package/esm/src/utils/logger/index.d.ts.map +1 -0
  307. package/esm/src/utils/logger/index.js +9 -0
  308. package/esm/src/utils/logger/logger.d.ts +166 -0
  309. package/esm/src/utils/logger/logger.d.ts.map +1 -0
  310. package/esm/src/utils/logger/logger.js +445 -0
  311. package/esm/src/utils/logger/redact.d.ts +74 -0
  312. package/esm/src/utils/logger/redact.d.ts.map +1 -0
  313. package/esm/src/utils/logger/redact.js +294 -0
  314. package/esm/src/utils/logger/request-context.d.ts +27 -0
  315. package/esm/src/utils/logger/request-context.d.ts.map +1 -0
  316. package/esm/src/utils/logger/request-context.js +28 -0
  317. package/esm/src/utils/memoize.d.ts +19 -0
  318. package/esm/src/utils/memoize.d.ts.map +1 -0
  319. package/esm/src/utils/memoize.js +72 -0
  320. package/esm/src/utils/parallel.d.ts +25 -0
  321. package/esm/src/utils/parallel.d.ts.map +1 -0
  322. package/esm/src/utils/parallel.js +91 -0
  323. package/esm/src/utils/path-utils.d.ts +34 -0
  324. package/esm/src/utils/path-utils.d.ts.map +1 -0
  325. package/esm/src/utils/path-utils.js +138 -0
  326. package/esm/src/utils/perf-timer.d.ts +11 -0
  327. package/esm/src/utils/perf-timer.d.ts.map +1 -0
  328. package/esm/src/utils/perf-timer.js +114 -0
  329. package/esm/src/utils/platform.d.ts +9 -0
  330. package/esm/src/utils/platform.d.ts.map +1 -0
  331. package/esm/src/utils/platform.js +20 -0
  332. package/esm/src/utils/runtime-guards.d.ts +29 -0
  333. package/esm/src/utils/runtime-guards.d.ts.map +1 -0
  334. package/esm/src/utils/runtime-guards.js +23 -0
  335. package/esm/src/utils/version-constant.d.ts +3 -0
  336. package/esm/src/utils/version-constant.d.ts.map +1 -0
  337. package/esm/src/utils/version-constant.js +4 -0
  338. package/esm/src/utils/version.d.ts +17 -0
  339. package/esm/src/utils/version.d.ts.map +1 -0
  340. package/esm/src/utils/version.js +36 -0
  341. package/package.json +80 -0
@@ -0,0 +1,188 @@
1
+ /***********************
2
+ * Runtime identifier for platform-specific code paths
3
+ ***********************/
4
+ export type RuntimeId = "deno" | "node" | "bun" | "cloudflare" | "memory";
5
+ /**
6
+ * Core runtime adapter interface
7
+ *
8
+ * Provides a unified abstraction over runtime-specific APIs (Deno, Node.js, Bun, Cloudflare Workers).
9
+ * All platform-specific code should go through this adapter to ensure cross-platform compatibility.
10
+ */
11
+ export interface RuntimeAdapter {
12
+ /** Unique identifier for this runtime */
13
+ readonly id: RuntimeId;
14
+ /** Human-readable name for logging */
15
+ readonly name: string;
16
+ /** Runtime capabilities for feature detection */
17
+ readonly capabilities: RuntimeCapabilities;
18
+ /** Filesystem operations */
19
+ fs: FileSystemAdapter;
20
+ /** Environment variable access */
21
+ env: EnvironmentAdapter;
22
+ /** HTTP server operations */
23
+ server: ServerAdapter;
24
+ serve(handler: (request: Request) => Promise<Response> | Response, options: ServeOptions): Promise<Server>;
25
+ /** Shell operations (sync fs for CLI) */
26
+ shell?: ShellAdapter;
27
+ /** Key-value store (Cloudflare KV, Deno KV) */
28
+ kv?: KVStoreAdapter;
29
+ /** File watcher (not available on Workers) */
30
+ watcher?: FileWatcherAdapter;
31
+ /** Initialize the adapter (called once before first use) */
32
+ initialize?(): Promise<void>;
33
+ /** Clean shutdown (close connections, etc.) */
34
+ shutdown?(): Promise<void>;
35
+ }
36
+ /**
37
+ * Runtime capabilities for feature detection
38
+ */
39
+ export interface RuntimeCapabilities {
40
+ /** Native TypeScript support without compilation */
41
+ typescript: boolean;
42
+ /** Native JSX/TSX support */
43
+ jsx: boolean;
44
+ /** HTTP/2 server support */
45
+ http2: boolean;
46
+ /** WebSocket support */
47
+ websocket: boolean;
48
+ /** Web Workers / Worker threads support */
49
+ workers: boolean;
50
+ /** File system watching */
51
+ fileWatching: boolean;
52
+ /** Shell command execution */
53
+ shell: boolean;
54
+ /** Key-value store available */
55
+ kvStore: boolean;
56
+ /** Writable filesystem (false for Workers without KV) */
57
+ writableFs: boolean;
58
+ }
59
+ export interface ServerAdapter {
60
+ upgradeWebSocket(request: Request): WebSocketUpgrade;
61
+ }
62
+ export interface WebSocketConnection {
63
+ readonly readyState: number;
64
+ send(data: string | ArrayBuffer): void;
65
+ close(code?: number, reason?: string): void;
66
+ addEventListener(type: string, listener: EventListener, options?: AddEventListenerOptions): void;
67
+ removeEventListener(type: string, listener: EventListener): void;
68
+ }
69
+ declare const WEBSOCKET_UPGRADE_RESPONSE_KIND = "websocket-upgrade";
70
+ export interface WebSocketUpgradeResponse {
71
+ readonly kind: typeof WEBSOCKET_UPGRADE_RESPONSE_KIND;
72
+ readonly status: 101;
73
+ readonly statusText: string;
74
+ readonly headers: Headers;
75
+ readonly body: null;
76
+ }
77
+ export interface WebSocketUpgrade {
78
+ socket: WebSocketConnection;
79
+ response: Response | WebSocketUpgradeResponse;
80
+ }
81
+ export declare function createWebSocketUpgradeResponse(input?: {
82
+ headers?: HeadersInit;
83
+ statusText?: string;
84
+ }): WebSocketUpgradeResponse;
85
+ export declare function isWebSocketUpgradeResponse(value: unknown): value is WebSocketUpgradeResponse;
86
+ export interface ServeOptions {
87
+ port?: number;
88
+ hostname?: string;
89
+ signal?: AbortSignal;
90
+ onListen?: (params: {
91
+ hostname: string;
92
+ port: number;
93
+ }) => void;
94
+ }
95
+ export interface Server {
96
+ stop(): Promise<void>;
97
+ addr: {
98
+ hostname: string;
99
+ port: number;
100
+ };
101
+ }
102
+ export interface FileSystemAdapter {
103
+ readFile(path: string): Promise<string>;
104
+ /** Read raw bytes when binary-safe access is required */
105
+ readFileBytes?(path: string): Promise<Uint8Array>;
106
+ writeFile(path: string, content: string): Promise<void>;
107
+ exists(path: string): Promise<boolean>;
108
+ readDir(path: string): AsyncIterable<DirEntry>;
109
+ stat(path: string): Promise<FileInfo>;
110
+ mkdir(path: string, options?: {
111
+ recursive?: boolean;
112
+ }): Promise<void>;
113
+ remove(path: string, options?: {
114
+ recursive?: boolean;
115
+ }): Promise<void>;
116
+ makeTempDir(prefix: string): Promise<string>;
117
+ watch(paths: string | string[], options?: WatchOptions): FileWatcher;
118
+ /** Resolve a file path with extension fallback (e.g., pages/test → pages/test.mdx) */
119
+ resolveFile?(basePath: string, options?: ResolveFileOptions): Promise<string | null>;
120
+ /** Refresh remote source snapshots when a preview render detects stale cached content. */
121
+ refreshSourceSnapshot?(reason?: string): Promise<void>;
122
+ }
123
+ export interface ResolveFileOptions {
124
+ allowPagesPrefix?: boolean;
125
+ }
126
+ export interface DirEntry {
127
+ name: string;
128
+ isFile: boolean;
129
+ isDirectory: boolean;
130
+ isSymlink: boolean;
131
+ }
132
+ export interface FileInfo {
133
+ size: number;
134
+ isFile: boolean;
135
+ isDirectory: boolean;
136
+ isSymlink: boolean;
137
+ mtime: Date | null;
138
+ }
139
+ export interface EnvironmentAdapter {
140
+ get(key: string): string | undefined;
141
+ set(key: string, value: string): void;
142
+ toObject(): Record<string, string>;
143
+ }
144
+ export interface WatchOptions {
145
+ recursive?: boolean;
146
+ signal?: AbortSignal;
147
+ }
148
+ export type FileChangeKind = "create" | "modify" | "delete" | "any";
149
+ export interface FileChangeEvent {
150
+ kind: FileChangeKind;
151
+ paths: string[];
152
+ }
153
+ export interface FileWatcher extends AsyncIterable<FileChangeEvent> {
154
+ close(): void;
155
+ /**
156
+ * Resolves once the watcher's internal loop has fully stopped, including
157
+ * any in-flight filesystem operations. close() only signals shutdown;
158
+ * await this to guarantee no pending async ops remain (e.g. before test
159
+ * sanitizer checks or process exit).
160
+ */
161
+ done?: Promise<void>;
162
+ }
163
+ export interface ShellAdapter {
164
+ statSync(path: string): {
165
+ isFile: boolean;
166
+ isDirectory: boolean;
167
+ };
168
+ readFileSync(path: string): string;
169
+ }
170
+ /**
171
+ * Key-value store adapter for Cloudflare KV, Deno KV, etc.
172
+ */
173
+ export interface KVStoreAdapter {
174
+ get(key: string): Promise<string | null>;
175
+ set(key: string, value: string, options?: {
176
+ expirationTtl?: number;
177
+ }): Promise<void>;
178
+ delete(key: string): Promise<void>;
179
+ list(prefix?: string): AsyncIterable<string>;
180
+ }
181
+ /**
182
+ * File watcher adapter for development mode
183
+ */
184
+ export interface FileWatcherAdapter {
185
+ watch(paths: string | string[], options?: WatchOptions): FileWatcher;
186
+ }
187
+ export {};
188
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/adapters/base.ts"],"names":[],"mappings":"AAAA;;yBAEyB;AACzB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,GAAG,QAAQ,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IAEvB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAE3C,4BAA4B;IAC5B,EAAE,EAAE,iBAAiB,CAAC;IAEtB,kCAAkC;IAClC,GAAG,EAAE,kBAAkB,CAAC;IAExB,6BAA6B;IAC7B,MAAM,EAAE,aAAa,CAAC;IAEtB,KAAK,CACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,EAC3D,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,+CAA+C;IAC/C,EAAE,CAAC,EAAE,cAAc,CAAC;IAEpB,8CAA8C;IAC9C,OAAO,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AAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACtE"}
@@ -0,0 +1,15 @@
1
+ const WEBSOCKET_UPGRADE_RESPONSE_KIND = "websocket-upgrade";
2
+ export function createWebSocketUpgradeResponse(input = {}) {
3
+ return {
4
+ kind: WEBSOCKET_UPGRADE_RESPONSE_KIND,
5
+ status: 101,
6
+ statusText: input.statusText ?? "Switching Protocols",
7
+ headers: new Headers(input.headers),
8
+ body: null,
9
+ };
10
+ }
11
+ export function isWebSocketUpgradeResponse(value) {
12
+ return typeof value === "object" && value !== null &&
13
+ value.kind === WEBSOCKET_UPGRADE_RESPONSE_KIND &&
14
+ value.status === 101;
15
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Platform-level constants that don't depend on configuration.
3
+ * These are simple values used by HTTP servers and adapters.
4
+ *
5
+ * Note: config/defaults.ts re-exports DEFAULT_PORT for higher layers.
6
+ */
7
+ export declare const DEFAULT_PORT = 3000;
8
+ export declare const LOCALHOST: {
9
+ readonly IPV4: "127.0.0.1";
10
+ readonly IPV6: "::1";
11
+ readonly HOSTNAME: "localhost";
12
+ };
13
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,SAAS;;;;CAIZ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Platform-level constants that don't depend on configuration.
3
+ * These are simple values used by HTTP servers and adapters.
4
+ *
5
+ * Note: config/defaults.ts re-exports DEFAULT_PORT for higher layers.
6
+ */
7
+ export const DEFAULT_PORT = 3000;
8
+ export const LOCALHOST = {
9
+ IPV4: "127.0.0.1",
10
+ IPV6: "::1",
11
+ HOSTNAME: "localhost",
12
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Opaque dynamic import helper.
3
+ *
4
+ * Uses `new Function` to hide the `import()` call from static analysis
5
+ * by bundlers and `deno compile`, preventing them from tracing into
6
+ * the imported specifier.
7
+ *
8
+ * @module platform/compat
9
+ */
10
+ export declare const dynamicImport: <T = unknown>(specifier: string) => Promise<T>;
11
+ //# sourceMappingURL=dynamic-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-import.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/dynamic-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,EAA4D,CACpF,CAAC,GAAG,OAAO,EAEX,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Opaque dynamic import helper.
3
+ *
4
+ * Uses `new Function` to hide the `import()` call from static analysis
5
+ * by bundlers and `deno compile`, preventing them from tracing into
6
+ * the imported specifier.
7
+ *
8
+ * @module platform/compat
9
+ */
10
+ export const dynamicImport = new Function("specifier", "return import(specifier)");
@@ -0,0 +1,71 @@
1
+ import type { FileInfo } from "../adapters/base.js";
2
+ /** Public API contract for file system. */
3
+ export interface FileSystem {
4
+ readTextFile(path: string): Promise<string>;
5
+ readFile(path: string): Promise<Uint8Array>;
6
+ writeTextFile(path: string, data: string): Promise<void>;
7
+ writeFile(path: string, data: Uint8Array): Promise<void>;
8
+ exists(path: string): Promise<boolean>;
9
+ stat(path: string): Promise<FileInfo>;
10
+ mkdir(path: string, options?: {
11
+ recursive?: boolean;
12
+ }): Promise<void>;
13
+ readDir(path: string): AsyncIterable<{
14
+ name: string;
15
+ isFile: boolean;
16
+ isDirectory: boolean;
17
+ }>;
18
+ remove(path: string, options?: {
19
+ recursive?: boolean;
20
+ }): Promise<void>;
21
+ makeTempDir(options?: {
22
+ prefix?: string;
23
+ }): Promise<string>;
24
+ chmod(path: string, mode: number): Promise<void>;
25
+ }
26
+ /** Create file system. */
27
+ export declare function createFileSystem(): FileSystem;
28
+ /** Read a file as text. */
29
+ export declare function readTextFile(path: string): Promise<string>;
30
+ /** Read a file as bytes. */
31
+ export declare function readFile(path: string): Promise<Uint8Array>;
32
+ /** Write text to a file. */
33
+ export declare function writeTextFile(path: string, data: string): Promise<void>;
34
+ /** Write bytes to a file. */
35
+ export declare function writeFile(path: string, data: Uint8Array): Promise<void>;
36
+ /** Check whether a path exists. */
37
+ export declare function exists(path: string): Promise<boolean>;
38
+ /** Read file metadata. */
39
+ export declare function stat(path: string): Promise<FileInfo>;
40
+ /** Create a directory. */
41
+ export declare function mkdir(path: string, options?: {
42
+ recursive?: boolean;
43
+ }): Promise<void>;
44
+ /** Remove a file or directory. */
45
+ export declare function remove(path: string, options?: {
46
+ recursive?: boolean;
47
+ }): Promise<void>;
48
+ /** Read directory entries. */
49
+ export declare function readDir(path: string): AsyncIterable<{
50
+ name: string;
51
+ isFile: boolean;
52
+ isDirectory: boolean;
53
+ }>;
54
+ /** Create temp dir. */
55
+ export declare function makeTempDir(options?: {
56
+ prefix?: string;
57
+ }): Promise<string>;
58
+ /** Change file permissions. */
59
+ export declare function chmod(path: string, mode: number): Promise<void>;
60
+ export declare function symlink(target: string, path: string): Promise<void>;
61
+ /**
62
+ * Resolve a path to its canonical absolute form, following symlinks.
63
+ * Throws if the path does not exist. Useful for containment checks where a
64
+ * symlink could otherwise escape an intended directory.
65
+ */
66
+ export declare function realPath(path: string): Promise<string>;
67
+ /** Error shape for is not found. */
68
+ export declare function isNotFoundError(error: unknown): boolean;
69
+ /** Error shape for is already exists. */
70
+ export declare function isAlreadyExistsError(error: unknown): boolean;
71
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/fs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAgBpD,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC9F,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;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AA8B;AAC9B,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,GACX,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC,CAExE;AAED,uBAAuB;AACvB,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1E;AAED,+BAA+B;AAC/B,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzE;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5D;AAWD,oCAAoC;AACpC,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAWvD;AAED,yCAAyC;AACzC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI5D"}
@@ -0,0 +1,277 @@
1
+ import * as dntShim from "../../../_dnt.shims.js";
2
+ import { createError, toError } from "../../errors/veryfront-error.js";
3
+ import { isBun, isDeno, isNode } from "./runtime.js";
4
+ /**
5
+ * Typed accessor for the Deno global.
6
+ *
7
+ * This is pure typing only — it reads no environment variables and performs no
8
+ * side effects, so this module stays importable without `--allow-env`. It
9
+ * exists to retire the `@ts-ignore` comments that were previously required to
10
+ * access `Deno.*` APIs from runtime-agnostic compat code.
11
+ */
12
+ function denoGlobal() {
13
+ return dntShim.dntGlobalThis.Deno;
14
+ }
15
+ class NodeFileSystem {
16
+ fs;
17
+ os;
18
+ path;
19
+ initialized = false;
20
+ async ensureInitialized() {
21
+ if (this.initialized)
22
+ return;
23
+ if (!isNode && !isBun) {
24
+ throw toError(createError({
25
+ type: "not_supported",
26
+ message: "Node.js fs modules not available",
27
+ feature: "Node.js",
28
+ }));
29
+ }
30
+ const [fsModule, osModule, pathModule] = await Promise.all([
31
+ import("node:fs/promises"),
32
+ import("node:os"),
33
+ import("node:path"),
34
+ ]);
35
+ this.fs = fsModule;
36
+ this.os = osModule;
37
+ this.path = pathModule;
38
+ this.initialized = true;
39
+ }
40
+ getFs() {
41
+ if (!this.fs)
42
+ throw new Error("NodeFileSystem not initialized");
43
+ return this.fs;
44
+ }
45
+ getOs() {
46
+ if (!this.os)
47
+ throw new Error("NodeFileSystem not initialized");
48
+ return this.os;
49
+ }
50
+ getPath() {
51
+ if (!this.path)
52
+ throw new Error("NodeFileSystem not initialized");
53
+ return this.path;
54
+ }
55
+ async readTextFile(path) {
56
+ await this.ensureInitialized();
57
+ return this.getFs().readFile(path, { encoding: "utf8" });
58
+ }
59
+ async readFile(path) {
60
+ await this.ensureInitialized();
61
+ return this.getFs().readFile(path);
62
+ }
63
+ async writeTextFile(path, data) {
64
+ await this.ensureInitialized();
65
+ await this.getFs().writeFile(path, data, { encoding: "utf8" });
66
+ }
67
+ async writeFile(path, data) {
68
+ await this.ensureInitialized();
69
+ await this.getFs().writeFile(path, data);
70
+ }
71
+ async exists(path) {
72
+ await this.ensureInitialized();
73
+ try {
74
+ await this.getFs().access(path);
75
+ return true;
76
+ }
77
+ catch (error) {
78
+ if (error?.code === "ENOENT")
79
+ return false;
80
+ throw error;
81
+ }
82
+ }
83
+ async stat(path) {
84
+ await this.ensureInitialized();
85
+ const stat = await this.getFs().stat(path);
86
+ return {
87
+ isFile: stat.isFile(),
88
+ isDirectory: stat.isDirectory(),
89
+ isSymlink: stat.isSymbolicLink(),
90
+ size: stat.size,
91
+ mtime: stat.mtime,
92
+ };
93
+ }
94
+ async mkdir(path, options) {
95
+ await this.ensureInitialized();
96
+ await this.getFs().mkdir(path, { recursive: options?.recursive ?? false });
97
+ }
98
+ async *readDir(path) {
99
+ await this.ensureInitialized();
100
+ const entries = await this.getFs().readdir(path, { withFileTypes: true });
101
+ for (const entry of entries) {
102
+ yield { name: entry.name, isFile: entry.isFile(), isDirectory: entry.isDirectory() };
103
+ }
104
+ }
105
+ async remove(path, options) {
106
+ await this.ensureInitialized();
107
+ const recursive = options?.recursive ?? false;
108
+ await this.getFs().rm(path, { recursive, force: recursive });
109
+ }
110
+ async makeTempDir(options) {
111
+ await this.ensureInitialized();
112
+ const tempDir = this.getPath().join(this.getOs().tmpdir(), `${options?.prefix ?? "tmp-"}${dntShim.crypto.randomUUID().slice(0, 8)}`);
113
+ await this.getFs().mkdir(tempDir, { recursive: true });
114
+ return tempDir;
115
+ }
116
+ async chmod(path, mode) {
117
+ await this.ensureInitialized();
118
+ try {
119
+ await this.getFs().chmod(path, mode);
120
+ }
121
+ catch {
122
+ // Ignore errors on Windows where chmod is not fully supported.
123
+ // Intentionally not logged: this low-level compat module must stay
124
+ // importable without `--allow-env` (the logger reads env at import).
125
+ }
126
+ }
127
+ }
128
+ class DenoFileSystem {
129
+ readTextFile(path) {
130
+ return denoGlobal().readTextFile(path);
131
+ }
132
+ readFile(path) {
133
+ return denoGlobal().readFile(path);
134
+ }
135
+ async writeTextFile(path, data) {
136
+ await denoGlobal().writeTextFile(path, data);
137
+ }
138
+ async writeFile(path, data) {
139
+ await denoGlobal().writeFile(path, data);
140
+ }
141
+ async exists(path) {
142
+ try {
143
+ await denoGlobal().stat(path);
144
+ return true;
145
+ }
146
+ catch (error) {
147
+ if (error instanceof denoGlobal().errors.NotFound)
148
+ return false;
149
+ throw error;
150
+ }
151
+ }
152
+ async stat(path) {
153
+ const stat = await denoGlobal().stat(path);
154
+ return {
155
+ isFile: stat.isFile,
156
+ isDirectory: stat.isDirectory,
157
+ isSymlink: stat.isSymlink,
158
+ size: stat.size,
159
+ mtime: stat.mtime,
160
+ };
161
+ }
162
+ async mkdir(path, options) {
163
+ await denoGlobal().mkdir(path, { recursive: options?.recursive ?? false });
164
+ }
165
+ async *readDir(path) {
166
+ for await (const entry of denoGlobal().readDir(path)) {
167
+ yield { name: entry.name, isFile: entry.isFile, isDirectory: entry.isDirectory };
168
+ }
169
+ }
170
+ async remove(path, options) {
171
+ await denoGlobal().remove(path, { recursive: options?.recursive ?? false });
172
+ }
173
+ makeTempDir(options) {
174
+ return denoGlobal().makeTempDir({ prefix: options?.prefix });
175
+ }
176
+ async chmod(path, mode) {
177
+ try {
178
+ await denoGlobal().chmod(path, mode);
179
+ }
180
+ catch (_) {
181
+ /* expected: chmod is not fully supported on Windows */
182
+ }
183
+ }
184
+ }
185
+ /** Create file system. */
186
+ export function createFileSystem() {
187
+ return isDeno ? new DenoFileSystem() : new NodeFileSystem();
188
+ }
189
+ let _fs = null;
190
+ function getFs() {
191
+ _fs ??= createFileSystem();
192
+ return _fs;
193
+ }
194
+ /** Read a file as text. */
195
+ export function readTextFile(path) {
196
+ return getFs().readTextFile(path);
197
+ }
198
+ /** Read a file as bytes. */
199
+ export function readFile(path) {
200
+ return getFs().readFile(path);
201
+ }
202
+ /** Write text to a file. */
203
+ export function writeTextFile(path, data) {
204
+ return getFs().writeTextFile(path, data);
205
+ }
206
+ /** Write bytes to a file. */
207
+ export function writeFile(path, data) {
208
+ return getFs().writeFile(path, data);
209
+ }
210
+ /** Check whether a path exists. */
211
+ export function exists(path) {
212
+ return getFs().exists(path);
213
+ }
214
+ /** Read file metadata. */
215
+ export function stat(path) {
216
+ return getFs().stat(path);
217
+ }
218
+ /** Create a directory. */
219
+ export function mkdir(path, options) {
220
+ return getFs().mkdir(path, options);
221
+ }
222
+ /** Remove a file or directory. */
223
+ export function remove(path, options) {
224
+ return getFs().remove(path, options);
225
+ }
226
+ /** Read directory entries. */
227
+ export function readDir(path) {
228
+ return getFs().readDir(path);
229
+ }
230
+ /** Create temp dir. */
231
+ export function makeTempDir(options) {
232
+ return getFs().makeTempDir(options);
233
+ }
234
+ /** Change file permissions. */
235
+ export function chmod(path, mode) {
236
+ return getFs().chmod(path, mode);
237
+ }
238
+ export async function symlink(target, path) {
239
+ if (isDeno) {
240
+ await denoGlobal().symlink(target, path);
241
+ return;
242
+ }
243
+ const fs = await import("node:fs/promises");
244
+ await fs.symlink(target, path);
245
+ }
246
+ /**
247
+ * Resolve a path to its canonical absolute form, following symlinks.
248
+ * Throws if the path does not exist. Useful for containment checks where a
249
+ * symlink could otherwise escape an intended directory.
250
+ */
251
+ export async function realPath(path) {
252
+ if (isDeno) {
253
+ return await denoGlobal().realPath(path);
254
+ }
255
+ const fs = await import("node:fs/promises");
256
+ return await fs.realpath(path);
257
+ }
258
+ /** Error shape for is not found. */
259
+ export function isNotFoundError(error) {
260
+ const NotFound = dntShim.dntGlobalThis.Deno?.errors?.NotFound;
261
+ if (isDeno && NotFound && error instanceof NotFound)
262
+ return true;
263
+ if (error?.code === "ENOENT")
264
+ return true;
265
+ if (error instanceof Error && error.name === "VeryfrontError" &&
266
+ error.slug === "file-not-found") {
267
+ return true;
268
+ }
269
+ return false;
270
+ }
271
+ /** Error shape for is already exists. */
272
+ export function isAlreadyExistsError(error) {
273
+ const AlreadyExists = dntShim.dntGlobalThis.Deno?.errors?.AlreadyExists;
274
+ if (isDeno && AlreadyExists && error instanceof AlreadyExists)
275
+ return true;
276
+ return error?.code === "EEXIST";
277
+ }
@@ -0,0 +1,9 @@
1
+ /** Join path segments. */
2
+ export declare function join(...paths: string[]): string;
3
+ /** Return the parent directory path. */
4
+ export declare function dirname(path: string): string;
5
+ /** Return the last path segment. */
6
+ export declare function basename(path: string, ext?: string): string;
7
+ /** Return the file extension for a path. */
8
+ export declare function extname(path: string): string;
9
+ //# sourceMappingURL=basic-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic-operations.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/basic-operations.ts"],"names":[],"mappings":"AAWA,0BAA0B;AAC1B,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAS/C;AAED,wCAAwC;AACxC,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ5C;AAED,oCAAoC;AACpC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAiB3D;AAED,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5C"}