nuxt-ai-ready 2.5.2 → 3.0.0

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 (282) hide show
  1. package/README.md +13 -12
  2. package/dist/chunks/agent-skills.mjs +35 -12
  3. package/dist/chunks/prerender.mjs +35 -24
  4. package/dist/cli.mjs +5 -2
  5. package/dist/module.d.mts +4 -0
  6. package/dist/module.json +2 -2
  7. package/dist/module.mjs +8 -4
  8. package/dist/runtime/app/index.d.ts +3 -0
  9. package/dist/runtime/app/index.js +2 -0
  10. package/dist/runtime/cache-control.d.ts +2 -0
  11. package/dist/runtime/cache-control.js +11 -0
  12. package/dist/runtime/llms-txt-utils.js +1 -1
  13. package/dist/runtime/server/db/context.d.ts +13 -0
  14. package/dist/runtime/server/db/drizzle/client.d.ts +6 -7
  15. package/dist/runtime/server/db/drizzle/client.js +13 -2
  16. package/dist/runtime/server/db/drizzle/providers/bun.d.ts +2 -2
  17. package/dist/runtime/server/db/drizzle/providers/bun.js +2 -2
  18. package/dist/runtime/server/db/drizzle/providers/d1.d.ts +2 -2
  19. package/dist/runtime/server/db/drizzle/providers/d1.js +3 -2
  20. package/dist/runtime/server/db/drizzle/providers/libsql.d.ts +2 -2
  21. package/dist/runtime/server/db/drizzle/providers/libsql.js +2 -2
  22. package/dist/runtime/server/db/drizzle/providers/neon.d.ts +2 -2
  23. package/dist/runtime/server/db/drizzle/providers/neon.js +2 -2
  24. package/dist/runtime/server/db/drizzle/providers/node-sqlite.d.ts +2 -2
  25. package/dist/runtime/server/db/drizzle/providers/node-sqlite.js +2 -2
  26. package/dist/runtime/server/db/drizzle/providers/postgres.d.ts +2 -2
  27. package/dist/runtime/server/db/drizzle/providers/postgres.js +2 -2
  28. package/dist/runtime/server/db/drizzle/queries.d.ts +27 -27
  29. package/dist/runtime/server/db/drizzle/queries.js +6 -5
  30. package/dist/runtime/server/db/drizzle/raw.d.ts +2 -6
  31. package/dist/runtime/server/db/index.d.ts +1 -1
  32. package/dist/runtime/server/db/index.js +1 -1
  33. package/dist/runtime/server/db/queries.d.ts +36 -36
  34. package/dist/runtime/server/db/queries.js +8 -9
  35. package/dist/runtime/server/db/seed.d.ts +2 -2
  36. package/dist/runtime/server/db/seed.js +4 -3
  37. package/dist/runtime/server/db/shared.d.ts +8 -0
  38. package/dist/runtime/server/db/shared.js +8 -2
  39. package/dist/runtime/server/index.d.ts +2 -0
  40. package/dist/runtime/server/index.js +17 -0
  41. package/dist/runtime/server/mcp/tools/get-page-markdown.js +1 -1
  42. package/dist/runtime/server/mcp/tools/list-pages.js +1 -1
  43. package/dist/runtime/server/mcp/tools/search-pages.js +1 -1
  44. package/dist/runtime/server/middleware/markdown.js +3 -3
  45. package/dist/runtime/server/middleware/markdown.prerender.js +1 -1
  46. package/dist/runtime/server/plugins/db-lifecycle-nitro3.d.ts +2 -0
  47. package/dist/runtime/server/plugins/db-lifecycle-nitro3.js +16 -0
  48. package/dist/runtime/server/plugins/html-capture.prerender.js +6 -4
  49. package/dist/runtime/server/plugins/link-header-nitro3.d.ts +2 -0
  50. package/dist/runtime/server/plugins/link-header-nitro3.js +20 -0
  51. package/dist/runtime/server/plugins/link-header.d.ts +6 -0
  52. package/dist/runtime/server/plugins/link-header.js +7 -11
  53. package/dist/runtime/server/plugins/markdown-negotiation.js +8 -1
  54. package/dist/runtime/server/plugins/sitemap-seeder.js +3 -3
  55. package/dist/runtime/server/routes/agent-skills-artifact.d.ts +1 -1
  56. package/dist/runtime/server/routes/agent-skills-artifact.js +10 -10
  57. package/dist/runtime/server/routes/agent-skills-index.d.ts +1 -1
  58. package/dist/runtime/server/routes/agent-skills-index.js +7 -6
  59. package/dist/runtime/server/routes/ai-catalog.d.ts +2 -1
  60. package/dist/runtime/server/routes/ai-catalog.js +7 -8
  61. package/dist/runtime/server/routes/api-catalog.d.ts +3 -1
  62. package/dist/runtime/server/routes/api-catalog.js +12 -12
  63. package/dist/runtime/server/routes/llms-full.txt.get.js +1 -1
  64. package/dist/runtime/server/routes/mcp-server-card.d.ts +1 -1
  65. package/dist/runtime/server/routes/mcp-server-card.js +7 -8
  66. package/dist/runtime/server/utils/checkStale.d.ts +2 -2
  67. package/dist/runtime/server/utils/cloudflare-prerendered.d.ts +3 -0
  68. package/dist/runtime/server/utils/cloudflare-prerendered.js +23 -0
  69. package/dist/runtime/server/utils/cloudflare.d.ts +5 -5
  70. package/dist/runtime/server/utils/cloudflare.js +31 -7
  71. package/dist/runtime/server/utils/content-negotiation.d.ts +5 -3
  72. package/dist/runtime/server/utils/content-negotiation.js +8 -7
  73. package/dist/runtime/server/utils/context.d.ts +3 -3
  74. package/dist/runtime/server/utils/context.js +1 -1
  75. package/dist/runtime/server/utils/discovery-response.d.ts +2 -0
  76. package/dist/runtime/server/utils/link-header.d.ts +5 -3
  77. package/dist/runtime/server/utils/link-header.js +26 -2
  78. package/dist/runtime/server/utils/markdown-request.d.ts +4 -3
  79. package/dist/runtime/server/utils/markdown-request.js +15 -13
  80. package/dist/runtime/server/utils/negotiation-decision.d.ts +4 -0
  81. package/dist/runtime/server/utils/negotiation-decision.js +6 -5
  82. package/dist/runtime/server/utils/negotiation-response.d.ts +1 -1
  83. package/dist/runtime/server/utils/negotiation-response.js +63 -23
  84. package/dist/runtime/server/utils/prerender-html.d.ts +2 -1
  85. package/dist/runtime/server/utils/prerender-html.js +3 -1
  86. package/dist/runtime/types.d.ts +15 -7
  87. package/dist/shared/nuxt-ai-ready.B3hAuOLQ.mjs +29 -0
  88. package/dist/shared/{nuxt-ai-ready.CLSWou20.mjs → nuxt-ai-ready.C34F0LJo.mjs} +560 -219
  89. package/package.json +85 -20
  90. package/skills/nuxt-ai-ready/SKILL.md +26 -12
  91. package/skills/nuxt-ai-ready/references/runtime-indexing.md +7 -6
  92. package/dist/runtime/server/db/drizzle/providers/sqlite.d.ts +0 -8
  93. package/dist/runtime/server/db/drizzle/providers/sqlite.js +0 -15
  94. package/node_modules/@mdream/js/LICENSE.md +0 -9
  95. package/node_modules/@mdream/js/README.md +0 -792
  96. package/node_modules/@mdream/js/bin/mdream.mjs +0 -2
  97. package/node_modules/@mdream/js/dist/_chunks/const.mjs +0 -134
  98. package/node_modules/@mdream/js/dist/_chunks/index.d.mts +0 -9
  99. package/node_modules/@mdream/js/dist/_chunks/markdown-processor.mjs +0 -1968
  100. package/node_modules/@mdream/js/dist/_chunks/minimal.d.mts +0 -6
  101. package/node_modules/@mdream/js/dist/_chunks/parse.mjs +0 -2756
  102. package/node_modules/@mdream/js/dist/_chunks/plugins.mjs +0 -725
  103. package/node_modules/@mdream/js/dist/_chunks/resolve-plugins.mjs +0 -44
  104. package/node_modules/@mdream/js/dist/_chunks/stream.mjs +0 -37
  105. package/node_modules/@mdream/js/dist/_chunks/types.d.mts +0 -473
  106. package/node_modules/@mdream/js/dist/cli.d.mts +0 -1
  107. package/node_modules/@mdream/js/dist/cli.mjs +0 -32
  108. package/node_modules/@mdream/js/dist/core.d.mts +0 -15
  109. package/node_modules/@mdream/js/dist/core.mjs +0 -28
  110. package/node_modules/@mdream/js/dist/index.d.mts +0 -4
  111. package/node_modules/@mdream/js/dist/index.mjs +0 -58
  112. package/node_modules/@mdream/js/dist/llms-txt.d.mts +0 -86
  113. package/node_modules/@mdream/js/dist/llms-txt.mjs +0 -308
  114. package/node_modules/@mdream/js/dist/negotiate.d.mts +0 -35
  115. package/node_modules/@mdream/js/dist/negotiate.mjs +0 -121
  116. package/node_modules/@mdream/js/dist/parse.d.mts +0 -90
  117. package/node_modules/@mdream/js/dist/parse.mjs +0 -2
  118. package/node_modules/@mdream/js/dist/plugins.d.mts +0 -85
  119. package/node_modules/@mdream/js/dist/plugins.mjs +0 -2
  120. package/node_modules/@mdream/js/dist/preset/minimal.d.mts +0 -2
  121. package/node_modules/@mdream/js/dist/preset/minimal.mjs +0 -33
  122. package/node_modules/@mdream/js/dist/splitter.d.mts +0 -18
  123. package/node_modules/@mdream/js/dist/splitter.mjs +0 -194
  124. package/node_modules/@mdream/js/package.json +0 -103
  125. package/node_modules/cac/LICENSE +0 -21
  126. package/node_modules/cac/README.md +0 -492
  127. package/node_modules/cac/dist/index.d.ts +0 -196
  128. package/node_modules/cac/dist/index.js +0 -638
  129. package/node_modules/cac/package.json +0 -72
  130. package/node_modules/mdream/LICENSE.md +0 -9
  131. package/node_modules/mdream/README.md +0 -1091
  132. package/node_modules/mdream/bin/mdream.mjs +0 -46
  133. package/node_modules/mdream/dist/browser.d.mts +0 -105
  134. package/node_modules/mdream/dist/browser.mjs +0 -262
  135. package/node_modules/mdream/dist/edge.d.mts +0 -100
  136. package/node_modules/mdream/dist/edge.mjs +0 -250
  137. package/node_modules/mdream/dist/iife.js +0 -605
  138. package/node_modules/mdream/dist/index.d.mts +0 -89
  139. package/node_modules/mdream/dist/index.mjs +0 -184
  140. package/node_modules/mdream/dist/wasm.d.mts +0 -100
  141. package/node_modules/mdream/dist/wasm.mjs +0 -140
  142. package/node_modules/mdream/dist/worker.d.mts +0 -101
  143. package/node_modules/mdream/dist/worker.mjs +0 -217
  144. package/node_modules/mdream/napi/index.d.mts +0 -127
  145. package/node_modules/mdream/napi/index.d.ts +0 -127
  146. package/node_modules/mdream/napi/index.mjs +0 -725
  147. package/node_modules/mdream/napi/rust.android-arm-eabi.node +0 -0
  148. package/node_modules/mdream/napi/rust.android-arm64.node +0 -0
  149. package/node_modules/mdream/napi/rust.darwin-arm64.node +0 -0
  150. package/node_modules/mdream/napi/rust.darwin-x64.node +0 -0
  151. package/node_modules/mdream/napi/rust.freebsd-x64.node +0 -0
  152. package/node_modules/mdream/napi/rust.linux-arm-gnueabihf.node +0 -0
  153. package/node_modules/mdream/napi/rust.linux-arm64-gnu.node +0 -0
  154. package/node_modules/mdream/napi/rust.linux-arm64-musl.node +0 -0
  155. package/node_modules/mdream/napi/rust.linux-x64-gnu.node +0 -0
  156. package/node_modules/mdream/napi/rust.linux-x64-musl.node +0 -0
  157. package/node_modules/mdream/napi/rust.wasi.cjs +0 -2144
  158. package/node_modules/mdream/napi/rust.wasm32-wasi.wasm +0 -0
  159. package/node_modules/mdream/napi/rust.win32-arm64-msvc.node +0 -0
  160. package/node_modules/mdream/napi/rust.win32-x64-msvc.node +0 -0
  161. package/node_modules/mdream/node_modules/@emnapi/core/LICENSE +0 -21
  162. package/node_modules/mdream/node_modules/@emnapi/core/README.md +0 -1
  163. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.d.ts +0 -392
  164. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.d.ts +0 -392
  165. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.js +0 -8351
  166. package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.js +0 -7268
  167. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.d.ts +0 -5
  168. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.js +0 -843
  169. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.d.ts +0 -4
  170. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.js +0 -3
  171. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.d.ts +0 -5
  172. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.js +0 -1010
  173. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.d.ts +0 -5
  174. package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.js +0 -1446
  175. package/node_modules/mdream/node_modules/@emnapi/core/package.json +0 -39
  176. package/node_modules/mdream/node_modules/@emnapi/core/rollup.config.js +0 -60
  177. package/node_modules/mdream/node_modules/@emnapi/runtime/LICENSE +0 -21
  178. package/node_modules/mdream/node_modules/@emnapi/runtime/README.md +0 -1
  179. package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.d.ts +0 -833
  180. package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js +0 -2306
  181. package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js.map +0 -1
  182. package/node_modules/mdream/node_modules/@emnapi/runtime/index.cjs +0 -63
  183. package/node_modules/mdream/node_modules/@emnapi/runtime/package.json +0 -39
  184. package/node_modules/mdream/node_modules/@emnapi/runtime/rollup.config.js +0 -25
  185. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/LICENSE +0 -21
  186. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/README.md +0 -203
  187. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +0 -236
  188. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +0 -1086
  189. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/package.json +0 -35
  190. package/node_modules/mdream/node_modules/@emnapi/wasi-threads/rollup.config.js +0 -6
  191. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +0 -1472
  192. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +0 -1470
  193. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +0 -237
  194. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs.js +0 -18260
  195. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +0 -317
  196. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/package.json +0 -67
  197. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.cjs +0 -39
  198. package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.js +0 -36
  199. package/node_modules/mdream/node_modules/@tybys/wasm-util/LICENSE +0 -21
  200. package/node_modules/mdream/node_modules/@tybys/wasm-util/README.md +0 -193
  201. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +0 -11
  202. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +0 -423
  203. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +0 -2932
  204. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +0 -2932
  205. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +0 -1
  206. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.js +0 -2954
  207. package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +0 -1
  208. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +0 -158
  209. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/index.js +0 -13
  210. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +0 -46
  211. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/load.js +0 -97
  212. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/memory.js +0 -35
  213. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +0 -103
  214. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +0 -268
  215. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +0 -3
  216. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +0 -192
  217. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +0 -316
  218. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +0 -1599
  219. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +0 -141
  220. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +0 -220
  221. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +0 -128
  222. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +0 -13
  223. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +0 -153
  224. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +0 -9
  225. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +0 -39
  226. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +0 -89
  227. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +0 -28
  228. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +0 -97
  229. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +0 -256
  230. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +0 -1
  231. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +0 -186
  232. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +0 -310
  233. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +0 -1593
  234. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +0 -135
  235. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +0 -216
  236. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +0 -113
  237. package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +0 -9
  238. package/node_modules/mdream/node_modules/@tybys/wasm-util/package.json +0 -58
  239. package/node_modules/mdream/node_modules/tslib/CopyrightNotice.txt +0 -15
  240. package/node_modules/mdream/node_modules/tslib/LICENSE.txt +0 -12
  241. package/node_modules/mdream/node_modules/tslib/README.md +0 -164
  242. package/node_modules/mdream/node_modules/tslib/SECURITY.md +0 -41
  243. package/node_modules/mdream/node_modules/tslib/modules/index.d.ts +0 -38
  244. package/node_modules/mdream/node_modules/tslib/modules/index.js +0 -70
  245. package/node_modules/mdream/node_modules/tslib/modules/package.json +0 -3
  246. package/node_modules/mdream/node_modules/tslib/package.json +0 -47
  247. package/node_modules/mdream/node_modules/tslib/tslib.d.ts +0 -460
  248. package/node_modules/mdream/node_modules/tslib/tslib.es6.html +0 -1
  249. package/node_modules/mdream/node_modules/tslib/tslib.es6.js +0 -402
  250. package/node_modules/mdream/node_modules/tslib/tslib.es6.mjs +0 -401
  251. package/node_modules/mdream/node_modules/tslib/tslib.html +0 -1
  252. package/node_modules/mdream/node_modules/tslib/tslib.js +0 -484
  253. package/node_modules/mdream/package.json +0 -110
  254. package/node_modules/mdream/skills/mdream/SKILL.md +0 -124
  255. package/node_modules/mdream/skills/mdream/references/runtimes.md +0 -49
  256. package/node_modules/mdream/wasm/mdream_edge.d.ts +0 -90
  257. package/node_modules/mdream/wasm/mdream_edge.js +0 -517
  258. package/node_modules/mdream/wasm/mdream_edge_bg.wasm +0 -0
  259. package/node_modules/mdream/wasm/mdream_edge_bg.wasm.d.ts +0 -20
  260. package/node_modules/mdream/wasm/package.json +0 -17
  261. package/node_modules/mdream/wasm-bundler/mdream_edge.d.ts +0 -45
  262. package/node_modules/mdream/wasm-bundler/mdream_edge.js +0 -13
  263. package/node_modules/mdream/wasm-bundler/mdream_edge_bg.js +0 -413
  264. package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm +0 -0
  265. package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm.d.ts +0 -20
  266. package/node_modules/mdream/wasm-bundler/package.json +0 -19
  267. package/node_modules/pathe/LICENSE +0 -70
  268. package/node_modules/pathe/README.md +0 -73
  269. package/node_modules/pathe/dist/index.cjs +0 -39
  270. package/node_modules/pathe/dist/index.d.cts +0 -47
  271. package/node_modules/pathe/dist/index.d.mts +0 -47
  272. package/node_modules/pathe/dist/index.d.ts +0 -47
  273. package/node_modules/pathe/dist/index.mjs +0 -19
  274. package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +0 -266
  275. package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -249
  276. package/node_modules/pathe/dist/utils.cjs +0 -82
  277. package/node_modules/pathe/dist/utils.d.cts +0 -32
  278. package/node_modules/pathe/dist/utils.d.mts +0 -32
  279. package/node_modules/pathe/dist/utils.d.ts +0 -32
  280. package/node_modules/pathe/dist/utils.mjs +0 -77
  281. package/node_modules/pathe/package.json +0 -61
  282. package/node_modules/pathe/utils.d.ts +0 -1
@@ -1,316 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.relative = exports.resolve = void 0;
4
- const util_1 = require("./util");
5
- const CHAR_DOT = 46; /* . */
6
- const CHAR_FORWARD_SLASH = 47; /* / */
7
- const CHAR_BACKWARD_SLASH = 92; /* \ */
8
- const CHAR_COLON = 58; /* : */
9
- const CHAR_UPPERCASE_A = 65; /* A */
10
- const CHAR_UPPERCASE_Z = 90; /* Z */
11
- const CHAR_LOWERCASE_A = 97; /* a */
12
- const CHAR_LOWERCASE_Z = 122; /* z */
13
- function isPathSeparatorWin(code) {
14
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
15
- }
16
- function isWindowsDeviceRoot(code) {
17
- return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
18
- (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
19
- }
20
- const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
21
- /**
22
- * Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
23
- * semantics enough for the WASI shim's needs (drive-letter absolutes
24
- * + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
25
- *
26
- * Why this is needed: on Windows, `FileDescriptor.realPath` is the
27
- * host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
28
- * backslash form `D:\…`. The POSIX-only `resolveImpl` below only
29
- * treats `/` as a separator, reads `D` as non-`/`, decides realPath
30
- * is "relative", and produces a garbage joined path. Downstream
31
- * `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
32
- * sees a permanent failure. This function gives us the correct
33
- * Windows-style resolution without taking a Node-only `path` import
34
- * (which would break browser bundles of this package).
35
- *
36
- * Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
37
- * trimmed to what WASI realpath resolution actually exercises.
38
- */
39
- function resolveWin32(args) {
40
- let resolvedDevice = '';
41
- let resolvedTail = '';
42
- let resolvedAbsolute = false;
43
- for (let i = args.length - 1; i >= -1; i--) {
44
- let path;
45
- if (i >= 0) {
46
- path = args[i];
47
- (0, util_1.validateString)(path, 'path');
48
- if (path.length === 0)
49
- continue;
50
- }
51
- else if (resolvedDevice.length === 0) {
52
- path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
53
- ? process.cwd()
54
- : '';
55
- }
56
- else {
57
- // Look up per-drive cwd via the `=X:` env var convention; fall back
58
- // to the global cwd if absent.
59
- const envKey = `=${resolvedDevice}`;
60
- const env = (typeof process !== 'undefined') ? process.env : undefined;
61
- path = (env && typeof env[envKey] === 'string')
62
- ? env[envKey]
63
- : (typeof process !== 'undefined' && typeof process.cwd === 'function')
64
- ? process.cwd()
65
- : '';
66
- if (path === undefined ||
67
- (path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
68
- path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
69
- path = `${resolvedDevice}\\`;
70
- }
71
- }
72
- const len = path.length;
73
- let rootEnd = 0;
74
- let device = '';
75
- let isAbsolute = false;
76
- const code = path.charCodeAt(0);
77
- if (len === 1) {
78
- if (isPathSeparatorWin(code)) {
79
- rootEnd = 1;
80
- isAbsolute = true;
81
- }
82
- }
83
- else if (isPathSeparatorWin(code)) {
84
- isAbsolute = true;
85
- if (isPathSeparatorWin(path.charCodeAt(1))) {
86
- // UNC path: `\\server\share\…`
87
- let j = 2;
88
- let last = j;
89
- while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
90
- j++;
91
- if (j < len && j !== last) {
92
- const firstPart = path.slice(last, j);
93
- last = j;
94
- while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
95
- j++;
96
- if (j < len && j !== last) {
97
- last = j;
98
- while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
99
- j++;
100
- if (j === len || j !== last) {
101
- device = `\\\\${firstPart}\\${path.slice(last, j)}`;
102
- rootEnd = j;
103
- }
104
- }
105
- }
106
- }
107
- else {
108
- rootEnd = 1;
109
- }
110
- }
111
- else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
112
- device = path.slice(0, 2);
113
- rootEnd = 2;
114
- if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
115
- isAbsolute = true;
116
- rootEnd = 3;
117
- }
118
- }
119
- if (device.length > 0) {
120
- if (resolvedDevice.length > 0) {
121
- if (device.toLowerCase() !== resolvedDevice.toLowerCase())
122
- continue;
123
- }
124
- else {
125
- resolvedDevice = device;
126
- }
127
- }
128
- if (resolvedAbsolute) {
129
- if (resolvedDevice.length > 0)
130
- break;
131
- }
132
- else {
133
- resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
134
- resolvedAbsolute = isAbsolute;
135
- if (isAbsolute && resolvedDevice.length > 0)
136
- break;
137
- }
138
- }
139
- resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
140
- return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
141
- }
142
- function isPosixPathSeparator(code) {
143
- return code === CHAR_FORWARD_SLASH;
144
- }
145
- function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
146
- let res = '';
147
- let lastSegmentLength = 0;
148
- let lastSlash = -1;
149
- let dots = 0;
150
- let code = 0;
151
- for (let i = 0; i <= path.length; ++i) {
152
- if (i < path.length) {
153
- code = path.charCodeAt(i);
154
- }
155
- else if (isPathSeparator(code)) {
156
- break;
157
- }
158
- else {
159
- code = CHAR_FORWARD_SLASH;
160
- }
161
- if (isPathSeparator(code)) {
162
- if (lastSlash === i - 1 || dots === 1) {
163
- // NOOP
164
- }
165
- else if (dots === 2) {
166
- if (res.length < 2 || lastSegmentLength !== 2 ||
167
- res.charCodeAt(res.length - 1) !== CHAR_DOT ||
168
- res.charCodeAt(res.length - 2) !== CHAR_DOT) {
169
- if (res.length > 2) {
170
- const lastSlashIndex = res.indexOf(separator);
171
- if (lastSlashIndex === -1) {
172
- res = '';
173
- lastSegmentLength = 0;
174
- }
175
- else {
176
- res = res.slice(0, lastSlashIndex);
177
- lastSegmentLength =
178
- res.length - 1 - res.indexOf(separator);
179
- }
180
- lastSlash = i;
181
- dots = 0;
182
- continue;
183
- }
184
- else if (res.length !== 0) {
185
- res = '';
186
- lastSegmentLength = 0;
187
- lastSlash = i;
188
- dots = 0;
189
- continue;
190
- }
191
- }
192
- if (allowAboveRoot) {
193
- res += res.length > 0 ? `${separator}..` : '..';
194
- lastSegmentLength = 2;
195
- }
196
- }
197
- else {
198
- if (res.length > 0) {
199
- res += `${separator}${path.slice(lastSlash + 1, i)}`;
200
- }
201
- else {
202
- res = path.slice(lastSlash + 1, i);
203
- }
204
- lastSegmentLength = i - lastSlash - 1;
205
- }
206
- lastSlash = i;
207
- dots = 0;
208
- }
209
- else if (code === CHAR_DOT && dots !== -1) {
210
- ++dots;
211
- }
212
- else {
213
- dots = -1;
214
- }
215
- }
216
- return res;
217
- }
218
- function resolve(...args) {
219
- // On Windows, host paths are `D:\…` style. The POSIX-only resolver
220
- // below treats `D` as a non-`/` character and produces garbage; route
221
- // to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
222
- // run the original code path unchanged — `_isWin32` is constant-folded
223
- // away on those targets.
224
- if (_isWin32)
225
- return resolveWin32(args);
226
- let resolvedPath = '';
227
- let resolvedAbsolute = false;
228
- for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
229
- const path = i >= 0 ? args[i] : '/';
230
- (0, util_1.validateString)(path, 'path');
231
- // Skip empty entries
232
- if (path.length === 0) {
233
- continue;
234
- }
235
- resolvedPath = `${path}/${resolvedPath}`;
236
- resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
237
- }
238
- // At this point the path should be resolved to a full absolute path, but
239
- // handle relative paths to be safe (might happen when process.cwd() fails)
240
- // Normalize the path
241
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator);
242
- if (resolvedAbsolute) {
243
- return `/${resolvedPath}`;
244
- }
245
- return resolvedPath.length > 0 ? resolvedPath : '.';
246
- }
247
- exports.resolve = resolve;
248
- function relative(from, to) {
249
- (0, util_1.validateString)(from, 'from');
250
- (0, util_1.validateString)(to, 'to');
251
- if (from === to)
252
- return '';
253
- // Trim leading forward slashes.
254
- from = resolve(from);
255
- to = resolve(to);
256
- if (from === to)
257
- return '';
258
- const fromStart = 1;
259
- const fromEnd = from.length;
260
- const fromLen = fromEnd - fromStart;
261
- const toStart = 1;
262
- const toLen = to.length - toStart;
263
- // Compare paths to find the longest common path from root
264
- const length = (fromLen < toLen ? fromLen : toLen);
265
- let lastCommonSep = -1;
266
- let i = 0;
267
- for (; i < length; i++) {
268
- const fromCode = from.charCodeAt(fromStart + i);
269
- if (fromCode !== to.charCodeAt(toStart + i)) {
270
- break;
271
- }
272
- else if (fromCode === CHAR_FORWARD_SLASH) {
273
- lastCommonSep = i;
274
- }
275
- }
276
- if (i === length) {
277
- if (toLen > length) {
278
- if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {
279
- // We get here if `from` is the exact base path for `to`.
280
- // For example: from='/foo/bar'; to='/foo/bar/baz'
281
- return to.slice(toStart + i + 1);
282
- }
283
- if (i === 0) {
284
- // We get here if `from` is the root
285
- // For example: from='/'; to='/foo'
286
- return to.slice(toStart + i);
287
- }
288
- }
289
- else if (fromLen > length) {
290
- if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {
291
- // We get here if `to` is the exact base path for `from`.
292
- // For example: from='/foo/bar/baz'; to='/foo/bar'
293
- lastCommonSep = i;
294
- }
295
- else if (i === 0) {
296
- // We get here if `to` is the root.
297
- // For example: from='/foo/bar'; to='/'
298
- lastCommonSep = 0;
299
- }
300
- }
301
- }
302
- let out = '';
303
- // Generate the relative path based on the path difference between `to`
304
- // and `from`.
305
- for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
306
- if (i === fromEnd ||
307
- from.charCodeAt(i) === CHAR_FORWARD_SLASH) {
308
- out += out.length === 0 ? '..' : '/..';
309
- }
310
- }
311
- // Lastly, append the rest of the destination (`to`) path that comes after
312
- // the common path parts.
313
- return `${out}${to.slice(toStart + lastCommonSep)}`;
314
- }
315
- exports.relative = relative;
316
- //# sourceMappingURL=path.js.map