@hyperfrontend/project-scope 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +3 -4
  3. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.cjs.js +7 -0
  4. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.esm.js +5 -0
  5. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.cjs.js +13 -0
  6. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.esm.js +8 -0
  7. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.cjs.js +10 -0
  8. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/date/index.esm.js +8 -0
  9. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.cjs.js +6 -0
  10. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.esm.js +5 -0
  11. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.cjs.js +7 -0
  12. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.esm.js +5 -0
  13. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.cjs.js +6 -0
  14. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.esm.js +5 -0
  15. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.cjs.js +9 -0
  16. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/math/index.esm.js +6 -0
  17. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.cjs.js +7 -0
  18. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.esm.js +7 -0
  19. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.cjs.js +15 -0
  20. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.esm.js +9 -0
  21. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.cjs.js +6 -0
  22. package/_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.esm.js +5 -0
  23. package/_dependencies/@hyperfrontend/logging/index.cjs.js +191 -0
  24. package/_dependencies/@hyperfrontend/logging/index.d.ts +151 -0
  25. package/_dependencies/@hyperfrontend/logging/index.esm.js +186 -0
  26. package/_shared/core/cache/index.cjs.js +135 -0
  27. package/_shared/core/cache/index.esm.js +128 -0
  28. package/_shared/core/errors/structured-errors/index.cjs.js +28 -0
  29. package/_shared/core/errors/structured-errors/index.esm.js +23 -0
  30. package/_shared/core/fs/stat/index.cjs.js +46 -0
  31. package/_shared/core/fs/stat/index.esm.js +40 -0
  32. package/_shared/core/path/join/index.cjs.js +13 -0
  33. package/_shared/core/path/join/index.esm.js +10 -0
  34. package/_shared/core/path/normalize/index.cjs.js +37 -0
  35. package/_shared/core/path/normalize/index.esm.js +31 -0
  36. package/_shared/core/path/resolve/index.cjs.js +47 -0
  37. package/_shared/core/path/resolve/index.esm.js +41 -0
  38. package/_shared/core/path/segments/index.cjs.js +38 -0
  39. package/_shared/core/path/segments/index.esm.js +31 -0
  40. package/_shared/core/patterns/glob/index.cjs.js +145 -0
  41. package/_shared/core/patterns/glob/index.esm.js +136 -0
  42. package/_shared/core/platform/detect/index.cjs.js +103 -0
  43. package/_shared/core/platform/detect/index.esm.js +95 -0
  44. package/_shared/core/platform/line-endings/index.cjs.js +52 -0
  45. package/_shared/core/platform/line-endings/index.esm.js +44 -0
  46. package/_shared/project/config/patterns/index.cjs.js +172 -0
  47. package/_shared/project/config/patterns/index.esm.js +169 -0
  48. package/_shared/tech/monorepo/pnpm-workspaces/index.cjs.js +33 -0
  49. package/_shared/tech/monorepo/pnpm-workspaces/index.esm.js +31 -0
  50. package/_shared/tech/shared-utils/detector-helpers/index.cjs.js +48 -0
  51. package/_shared/tech/shared-utils/detector-helpers/index.esm.js +43 -0
  52. package/_shared/vfs/types/index.cjs.js +14 -0
  53. package/_shared/vfs/types/index.esm.js +12 -0
  54. package/cli/index.cjs.js +1702 -1910
  55. package/cli/index.d.ts +273 -7
  56. package/cli/index.d.ts.map +1 -1
  57. package/cli/index.esm.js +1586 -1794
  58. package/core/encoding/index.cjs.js +86 -401
  59. package/core/encoding/index.d.ts +186 -3
  60. package/core/encoding/index.d.ts.map +1 -1
  61. package/core/encoding/index.esm.js +78 -392
  62. package/core/fs/index.cjs.js +231 -581
  63. package/core/fs/index.d.ts +479 -6
  64. package/core/fs/index.d.ts.map +1 -1
  65. package/core/fs/index.esm.js +221 -571
  66. package/core/index.cjs.js +518 -1748
  67. package/core/index.d.ts +486 -9
  68. package/core/index.d.ts.map +1 -1
  69. package/core/index.esm.js +501 -1728
  70. package/core/path/index.cjs.js +6 -234
  71. package/core/path/index.d.ts +306 -5
  72. package/core/path/index.d.ts.map +1 -1
  73. package/core/path/index.esm.js +4 -232
  74. package/core/platform/index.cjs.js +5 -216
  75. package/core/platform/index.d.ts +185 -3
  76. package/core/platform/index.d.ts.map +1 -1
  77. package/core/platform/index.esm.js +3 -212
  78. package/heuristics/dependencies/index.cjs.js +95 -492
  79. package/heuristics/dependencies/index.d.ts +99 -2
  80. package/heuristics/dependencies/index.d.ts.map +1 -1
  81. package/heuristics/dependencies/index.esm.js +69 -466
  82. package/heuristics/entry-points/index.cjs.js +91 -795
  83. package/heuristics/entry-points/index.d.ts +123 -2
  84. package/heuristics/entry-points/index.d.ts.map +1 -1
  85. package/heuristics/entry-points/index.esm.js +72 -776
  86. package/heuristics/framework/index.cjs.js +1481 -1410
  87. package/heuristics/framework/index.d.ts +104 -2
  88. package/heuristics/framework/index.d.ts.map +1 -1
  89. package/heuristics/framework/index.esm.js +1417 -1346
  90. package/heuristics/index.cjs.js +3206 -3301
  91. package/heuristics/index.d.ts +4 -5
  92. package/heuristics/index.d.ts.map +1 -1
  93. package/heuristics/index.esm.js +3231 -3326
  94. package/heuristics/project-type/index.cjs.js +1487 -1437
  95. package/heuristics/project-type/index.d.ts +64 -2
  96. package/heuristics/project-type/index.d.ts.map +1 -1
  97. package/heuristics/project-type/index.esm.js +1416 -1366
  98. package/index.cjs.js +3044 -3533
  99. package/index.d.ts +44 -10
  100. package/index.d.ts.map +1 -1
  101. package/index.esm.js +2900 -3377
  102. package/models/index.cjs.js +0 -1
  103. package/models/index.d.ts +20 -14
  104. package/models/index.d.ts.map +1 -1
  105. package/models/index.esm.js +0 -1
  106. package/nx/index.cjs.js +163 -577
  107. package/nx/index.d.ts +279 -4
  108. package/nx/index.d.ts.map +1 -1
  109. package/nx/index.esm.js +145 -554
  110. package/package.json +13 -12
  111. package/project/config/index.cjs.js +122 -1062
  112. package/project/config/index.d.ts +202 -4
  113. package/project/config/index.d.ts.map +1 -1
  114. package/project/config/index.esm.js +105 -1043
  115. package/project/index.cjs.js +323 -1100
  116. package/project/index.d.ts +4 -5
  117. package/project/index.d.ts.map +1 -1
  118. package/project/index.esm.js +302 -1076
  119. package/project/package/index.cjs.js +191 -472
  120. package/project/package/index.d.ts +280 -3
  121. package/project/package/index.d.ts.map +1 -1
  122. package/project/package/index.esm.js +178 -458
  123. package/project/root/index.cjs.js +107 -416
  124. package/project/root/index.d.ts +83 -2
  125. package/project/root/index.d.ts.map +1 -1
  126. package/project/root/index.esm.js +96 -405
  127. package/project/traversal/index.cjs.js +94 -621
  128. package/project/traversal/index.d.ts +165 -3
  129. package/project/traversal/index.d.ts.map +1 -1
  130. package/project/traversal/index.esm.js +80 -607
  131. package/tech/backend/index.cjs.js +221 -507
  132. package/tech/backend/index.d.ts +205 -8
  133. package/tech/backend/index.d.ts.map +1 -1
  134. package/tech/backend/index.esm.js +200 -486
  135. package/tech/build/index.cjs.js +348 -635
  136. package/tech/build/index.d.ts +276 -10
  137. package/tech/build/index.d.ts.map +1 -1
  138. package/tech/build/index.esm.js +326 -613
  139. package/tech/frontend/index.cjs.js +505 -684
  140. package/tech/frontend/index.d.ts +379 -15
  141. package/tech/frontend/index.d.ts.map +1 -1
  142. package/tech/frontend/index.esm.js +481 -660
  143. package/tech/index.cjs.js +1580 -1420
  144. package/tech/index.d.ts +55 -32
  145. package/tech/index.d.ts.map +1 -1
  146. package/tech/index.esm.js +1513 -1353
  147. package/tech/legacy/index.cjs.js +97 -448
  148. package/tech/legacy/index.d.ts +125 -7
  149. package/tech/legacy/index.d.ts.map +1 -1
  150. package/tech/legacy/index.esm.js +79 -430
  151. package/tech/linting/index.cjs.js +136 -522
  152. package/tech/linting/index.d.ts +129 -7
  153. package/tech/linting/index.d.ts.map +1 -1
  154. package/tech/linting/index.esm.js +116 -502
  155. package/tech/monorepo/index.cjs.js +244 -572
  156. package/tech/monorepo/index.d.ts +241 -10
  157. package/tech/monorepo/index.d.ts.map +1 -1
  158. package/tech/monorepo/index.esm.js +224 -552
  159. package/tech/testing/index.cjs.js +214 -570
  160. package/tech/testing/index.d.ts +176 -8
  161. package/tech/testing/index.d.ts.map +1 -1
  162. package/tech/testing/index.esm.js +196 -552
  163. package/tech/types/index.cjs.js +121 -505
  164. package/tech/types/index.d.ts +120 -2
  165. package/tech/types/index.d.ts.map +1 -1
  166. package/tech/types/index.esm.js +99 -483
  167. package/vfs/index.cjs.js +647 -1142
  168. package/vfs/index.d.ts +360 -6
  169. package/vfs/index.d.ts.map +1 -1
  170. package/vfs/index.esm.js +672 -1167
  171. package/ARCHITECTURE.md +0 -370
  172. package/analyze.d.ts +0 -33
  173. package/analyze.d.ts.map +0 -1
  174. package/cli/commands/analyze.d.ts +0 -28
  175. package/cli/commands/analyze.d.ts.map +0 -1
  176. package/cli/commands/config.d.ts +0 -27
  177. package/cli/commands/config.d.ts.map +0 -1
  178. package/cli/commands/deps.d.ts +0 -24
  179. package/cli/commands/deps.d.ts.map +0 -1
  180. package/cli/commands/tree.d.ts +0 -36
  181. package/cli/commands/tree.d.ts.map +0 -1
  182. package/cli/index.cjs.js.map +0 -1
  183. package/cli/index.esm.js.map +0 -1
  184. package/cli/run.d.ts +0 -25
  185. package/cli/run.d.ts.map +0 -1
  186. package/cli/types.d.ts +0 -55
  187. package/cli/types.d.ts.map +0 -1
  188. package/core/cache.d.ts +0 -158
  189. package/core/cache.d.ts.map +0 -1
  190. package/core/encoding/convert.d.ts +0 -32
  191. package/core/encoding/convert.d.ts.map +0 -1
  192. package/core/encoding/detect.d.ts +0 -91
  193. package/core/encoding/detect.d.ts.map +0 -1
  194. package/core/encoding/index.cjs.js.map +0 -1
  195. package/core/encoding/index.esm.js.map +0 -1
  196. package/core/errors/structured-errors.d.ts +0 -66
  197. package/core/errors/structured-errors.d.ts.map +0 -1
  198. package/core/fs/directory.d.ts +0 -91
  199. package/core/fs/directory.d.ts.map +0 -1
  200. package/core/fs/index.cjs.js.map +0 -1
  201. package/core/fs/index.esm.js.map +0 -1
  202. package/core/fs/read.d.ts +0 -94
  203. package/core/fs/read.d.ts.map +0 -1
  204. package/core/fs/stat.d.ts +0 -58
  205. package/core/fs/stat.d.ts.map +0 -1
  206. package/core/fs/traversal.d.ts +0 -26
  207. package/core/fs/traversal.d.ts.map +0 -1
  208. package/core/fs/write.d.ts +0 -75
  209. package/core/fs/write.d.ts.map +0 -1
  210. package/core/index.cjs.js.map +0 -1
  211. package/core/index.esm.js.map +0 -1
  212. package/core/logger.d.ts +0 -111
  213. package/core/logger.d.ts.map +0 -1
  214. package/core/path/index.cjs.js.map +0 -1
  215. package/core/path/index.esm.js.map +0 -1
  216. package/core/path/join.d.ts +0 -17
  217. package/core/path/join.d.ts.map +0 -1
  218. package/core/path/normalize.d.ts +0 -37
  219. package/core/path/normalize.d.ts.map +0 -1
  220. package/core/path/resolve.d.ts +0 -52
  221. package/core/path/resolve.d.ts.map +0 -1
  222. package/core/path/segments.d.ts +0 -59
  223. package/core/path/segments.d.ts.map +0 -1
  224. package/core/patterns/glob.d.ts +0 -42
  225. package/core/patterns/glob.d.ts.map +0 -1
  226. package/core/platform/detect.d.ts +0 -66
  227. package/core/platform/detect.d.ts.map +0 -1
  228. package/core/platform/index.cjs.js.map +0 -1
  229. package/core/platform/index.esm.js.map +0 -1
  230. package/core/platform/line-endings.d.ts +0 -48
  231. package/core/platform/line-endings.d.ts.map +0 -1
  232. package/heuristics/dependencies/analyze.d.ts +0 -77
  233. package/heuristics/dependencies/analyze.d.ts.map +0 -1
  234. package/heuristics/dependencies/index.cjs.js.map +0 -1
  235. package/heuristics/dependencies/index.esm.js.map +0 -1
  236. package/heuristics/entry-points/discover.d.ts +0 -113
  237. package/heuristics/entry-points/discover.d.ts.map +0 -1
  238. package/heuristics/entry-points/index.cjs.js.map +0 -1
  239. package/heuristics/entry-points/index.esm.js.map +0 -1
  240. package/heuristics/framework/identify.d.ts +0 -84
  241. package/heuristics/framework/identify.d.ts.map +0 -1
  242. package/heuristics/framework/index.cjs.js.map +0 -1
  243. package/heuristics/framework/index.esm.js.map +0 -1
  244. package/heuristics/index.cjs.js.map +0 -1
  245. package/heuristics/index.esm.js.map +0 -1
  246. package/heuristics/project-type/detect.d.ts +0 -61
  247. package/heuristics/project-type/detect.d.ts.map +0 -1
  248. package/heuristics/project-type/index.cjs.js.map +0 -1
  249. package/heuristics/project-type/index.esm.js.map +0 -1
  250. package/index.cjs.js.map +0 -1
  251. package/index.esm.js.map +0 -1
  252. package/models/index.cjs.js.map +0 -1
  253. package/models/index.esm.js.map +0 -1
  254. package/nx/detect.d.ts +0 -105
  255. package/nx/detect.d.ts.map +0 -1
  256. package/nx/devkit-loader.d.ts +0 -62
  257. package/nx/devkit-loader.d.ts.map +0 -1
  258. package/nx/index.cjs.js.map +0 -1
  259. package/nx/index.esm.js.map +0 -1
  260. package/nx/project-config.d.ts +0 -111
  261. package/nx/project-config.d.ts.map +0 -1
  262. package/project/config/detect.d.ts +0 -77
  263. package/project/config/detect.d.ts.map +0 -1
  264. package/project/config/index.cjs.js.map +0 -1
  265. package/project/config/index.esm.js.map +0 -1
  266. package/project/config/parse.d.ts +0 -53
  267. package/project/config/parse.d.ts.map +0 -1
  268. package/project/config/patterns.d.ts +0 -31
  269. package/project/config/patterns.d.ts.map +0 -1
  270. package/project/index.cjs.js.map +0 -1
  271. package/project/index.esm.js.map +0 -1
  272. package/project/package/dependencies.d.ts +0 -101
  273. package/project/package/dependencies.d.ts.map +0 -1
  274. package/project/package/index.cjs.js.map +0 -1
  275. package/project/package/index.esm.js.map +0 -1
  276. package/project/package/read.d.ts +0 -67
  277. package/project/package/read.d.ts.map +0 -1
  278. package/project/root/detect.d.ts +0 -65
  279. package/project/root/detect.d.ts.map +0 -1
  280. package/project/root/index.cjs.js.map +0 -1
  281. package/project/root/index.esm.js.map +0 -1
  282. package/project/traversal/index.cjs.js.map +0 -1
  283. package/project/traversal/index.esm.js.map +0 -1
  284. package/project/traversal/search.d.ts +0 -59
  285. package/project/traversal/search.d.ts.map +0 -1
  286. package/project/traversal/walk.d.ts +0 -63
  287. package/project/traversal/walk.d.ts.map +0 -1
  288. package/tech/backend/detect-all.d.ts +0 -13
  289. package/tech/backend/detect-all.d.ts.map +0 -1
  290. package/tech/backend/express.d.ts +0 -11
  291. package/tech/backend/express.d.ts.map +0 -1
  292. package/tech/backend/fastify.d.ts +0 -11
  293. package/tech/backend/fastify.d.ts.map +0 -1
  294. package/tech/backend/hono.d.ts +0 -11
  295. package/tech/backend/hono.d.ts.map +0 -1
  296. package/tech/backend/index.cjs.js.map +0 -1
  297. package/tech/backend/index.esm.js.map +0 -1
  298. package/tech/backend/koa.d.ts +0 -11
  299. package/tech/backend/koa.d.ts.map +0 -1
  300. package/tech/backend/nestjs.d.ts +0 -11
  301. package/tech/backend/nestjs.d.ts.map +0 -1
  302. package/tech/backend/types.d.ts +0 -31
  303. package/tech/backend/types.d.ts.map +0 -1
  304. package/tech/build/babel.d.ts +0 -13
  305. package/tech/build/babel.d.ts.map +0 -1
  306. package/tech/build/detect-all.d.ts +0 -13
  307. package/tech/build/detect-all.d.ts.map +0 -1
  308. package/tech/build/esbuild.d.ts +0 -11
  309. package/tech/build/esbuild.d.ts.map +0 -1
  310. package/tech/build/index.cjs.js.map +0 -1
  311. package/tech/build/index.esm.js.map +0 -1
  312. package/tech/build/parcel.d.ts +0 -13
  313. package/tech/build/parcel.d.ts.map +0 -1
  314. package/tech/build/rollup.d.ts +0 -13
  315. package/tech/build/rollup.d.ts.map +0 -1
  316. package/tech/build/swc.d.ts +0 -13
  317. package/tech/build/swc.d.ts.map +0 -1
  318. package/tech/build/types.d.ts +0 -31
  319. package/tech/build/types.d.ts.map +0 -1
  320. package/tech/build/vite.d.ts +0 -13
  321. package/tech/build/vite.d.ts.map +0 -1
  322. package/tech/build/webpack.d.ts +0 -13
  323. package/tech/build/webpack.d.ts.map +0 -1
  324. package/tech/frontend/angular.d.ts +0 -11
  325. package/tech/frontend/angular.d.ts.map +0 -1
  326. package/tech/frontend/astro.d.ts +0 -11
  327. package/tech/frontend/astro.d.ts.map +0 -1
  328. package/tech/frontend/detect-all.d.ts +0 -13
  329. package/tech/frontend/detect-all.d.ts.map +0 -1
  330. package/tech/frontend/gatsby.d.ts +0 -11
  331. package/tech/frontend/gatsby.d.ts.map +0 -1
  332. package/tech/frontend/index.cjs.js.map +0 -1
  333. package/tech/frontend/index.esm.js.map +0 -1
  334. package/tech/frontend/nextjs.d.ts +0 -11
  335. package/tech/frontend/nextjs.d.ts.map +0 -1
  336. package/tech/frontend/nuxt.d.ts +0 -11
  337. package/tech/frontend/nuxt.d.ts.map +0 -1
  338. package/tech/frontend/qwik.d.ts +0 -11
  339. package/tech/frontend/qwik.d.ts.map +0 -1
  340. package/tech/frontend/react.d.ts +0 -11
  341. package/tech/frontend/react.d.ts.map +0 -1
  342. package/tech/frontend/remix.d.ts +0 -11
  343. package/tech/frontend/remix.d.ts.map +0 -1
  344. package/tech/frontend/solid.d.ts +0 -11
  345. package/tech/frontend/solid.d.ts.map +0 -1
  346. package/tech/frontend/svelte.d.ts +0 -11
  347. package/tech/frontend/svelte.d.ts.map +0 -1
  348. package/tech/frontend/sveltekit.d.ts +0 -11
  349. package/tech/frontend/sveltekit.d.ts.map +0 -1
  350. package/tech/frontend/types.d.ts +0 -35
  351. package/tech/frontend/types.d.ts.map +0 -1
  352. package/tech/frontend/vue.d.ts +0 -11
  353. package/tech/frontend/vue.d.ts.map +0 -1
  354. package/tech/index.cjs.js.map +0 -1
  355. package/tech/index.esm.js.map +0 -1
  356. package/tech/legacy/angularjs.d.ts +0 -12
  357. package/tech/legacy/angularjs.d.ts.map +0 -1
  358. package/tech/legacy/backbone.d.ts +0 -11
  359. package/tech/legacy/backbone.d.ts.map +0 -1
  360. package/tech/legacy/detect-all.d.ts +0 -13
  361. package/tech/legacy/detect-all.d.ts.map +0 -1
  362. package/tech/legacy/ember.d.ts +0 -11
  363. package/tech/legacy/ember.d.ts.map +0 -1
  364. package/tech/legacy/index.cjs.js.map +0 -1
  365. package/tech/legacy/index.esm.js.map +0 -1
  366. package/tech/legacy/jquery.d.ts +0 -11
  367. package/tech/legacy/jquery.d.ts.map +0 -1
  368. package/tech/legacy/types.d.ts +0 -33
  369. package/tech/legacy/types.d.ts.map +0 -1
  370. package/tech/linting/biome.d.ts +0 -11
  371. package/tech/linting/biome.d.ts.map +0 -1
  372. package/tech/linting/detect-all.d.ts +0 -13
  373. package/tech/linting/detect-all.d.ts.map +0 -1
  374. package/tech/linting/eslint.d.ts +0 -13
  375. package/tech/linting/eslint.d.ts.map +0 -1
  376. package/tech/linting/index.cjs.js.map +0 -1
  377. package/tech/linting/index.esm.js.map +0 -1
  378. package/tech/linting/prettier.d.ts +0 -13
  379. package/tech/linting/prettier.d.ts.map +0 -1
  380. package/tech/linting/stylelint.d.ts +0 -13
  381. package/tech/linting/stylelint.d.ts.map +0 -1
  382. package/tech/linting/types.d.ts +0 -31
  383. package/tech/linting/types.d.ts.map +0 -1
  384. package/tech/monorepo/detect-all.d.ts +0 -13
  385. package/tech/monorepo/detect-all.d.ts.map +0 -1
  386. package/tech/monorepo/index.cjs.js.map +0 -1
  387. package/tech/monorepo/index.esm.js.map +0 -1
  388. package/tech/monorepo/lerna.d.ts +0 -11
  389. package/tech/monorepo/lerna.d.ts.map +0 -1
  390. package/tech/monorepo/npm-workspaces.d.ts +0 -11
  391. package/tech/monorepo/npm-workspaces.d.ts.map +0 -1
  392. package/tech/monorepo/nx.d.ts +0 -11
  393. package/tech/monorepo/nx.d.ts.map +0 -1
  394. package/tech/monorepo/pnpm-workspaces.d.ts +0 -9
  395. package/tech/monorepo/pnpm-workspaces.d.ts.map +0 -1
  396. package/tech/monorepo/rush.d.ts +0 -11
  397. package/tech/monorepo/rush.d.ts.map +0 -1
  398. package/tech/monorepo/turborepo.d.ts +0 -11
  399. package/tech/monorepo/turborepo.d.ts.map +0 -1
  400. package/tech/monorepo/types.d.ts +0 -39
  401. package/tech/monorepo/types.d.ts.map +0 -1
  402. package/tech/monorepo/yarn-workspaces.d.ts +0 -11
  403. package/tech/monorepo/yarn-workspaces.d.ts.map +0 -1
  404. package/tech/shared-utils/detector-helpers.d.ts +0 -52
  405. package/tech/shared-utils/detector-helpers.d.ts.map +0 -1
  406. package/tech/shared-utils/types.d.ts +0 -41
  407. package/tech/shared-utils/types.d.ts.map +0 -1
  408. package/tech/testing/cypress.d.ts +0 -13
  409. package/tech/testing/cypress.d.ts.map +0 -1
  410. package/tech/testing/detect-all.d.ts +0 -13
  411. package/tech/testing/detect-all.d.ts.map +0 -1
  412. package/tech/testing/index.cjs.js.map +0 -1
  413. package/tech/testing/index.esm.js.map +0 -1
  414. package/tech/testing/jest.d.ts +0 -13
  415. package/tech/testing/jest.d.ts.map +0 -1
  416. package/tech/testing/mocha.d.ts +0 -13
  417. package/tech/testing/mocha.d.ts.map +0 -1
  418. package/tech/testing/playwright.d.ts +0 -13
  419. package/tech/testing/playwright.d.ts.map +0 -1
  420. package/tech/testing/types.d.ts +0 -35
  421. package/tech/testing/types.d.ts.map +0 -1
  422. package/tech/testing/vitest.d.ts +0 -13
  423. package/tech/testing/vitest.d.ts.map +0 -1
  424. package/tech/types/detectors.d.ts +0 -67
  425. package/tech/types/detectors.d.ts.map +0 -1
  426. package/tech/types/index.cjs.js.map +0 -1
  427. package/tech/types/index.esm.js.map +0 -1
  428. package/vfs/commit.d.ts +0 -32
  429. package/vfs/commit.d.ts.map +0 -1
  430. package/vfs/diff.d.ts +0 -73
  431. package/vfs/diff.d.ts.map +0 -1
  432. package/vfs/factory.d.ts +0 -37
  433. package/vfs/factory.d.ts.map +0 -1
  434. package/vfs/fs-tree.d.ts +0 -13
  435. package/vfs/fs-tree.d.ts.map +0 -1
  436. package/vfs/index.cjs.js.map +0 -1
  437. package/vfs/index.esm.js.map +0 -1
  438. package/vfs/types.d.ts +0 -179
  439. package/vfs/types.d.ts.map +0 -1
@@ -1,714 +1,27 @@
1
1
  'use strict';
2
2
 
3
- var node_path = require('node:path');
4
- var node_fs = require('node:fs');
5
-
6
- /**
7
- * Known configuration file patterns organized by type.
8
- */
9
- const CONFIG_PATTERNS = {
10
- 'package.json': {
11
- patterns: ['package.json'],
12
- format: 'json',
13
- description: 'NPM package manifest',
14
- },
15
- 'package-lock.json': {
16
- patterns: ['package-lock.json'],
17
- format: 'json',
18
- description: 'NPM lockfile',
19
- },
20
- 'pnpm-lock.yaml': {
21
- patterns: ['pnpm-lock.yaml'],
22
- format: 'yaml',
23
- description: 'PNPM lockfile',
24
- },
25
- 'yarn.lock': {
26
- patterns: ['yarn.lock'],
27
- format: 'text',
28
- description: 'Yarn lockfile',
29
- },
30
- '.npmrc': {
31
- patterns: ['.npmrc'],
32
- format: 'ini',
33
- description: 'NPM configuration',
34
- sensitive: true,
35
- },
36
- tsconfig: {
37
- patterns: ['tsconfig.json', 'tsconfig.*.json'],
38
- format: 'jsonc',
39
- description: 'TypeScript configuration',
40
- canExtend: true,
41
- },
42
- nx: {
43
- patterns: ['nx.json'],
44
- format: 'json',
45
- description: 'NX workspace configuration',
46
- },
47
- 'project.json': {
48
- patterns: ['project.json', '**/project.json'],
49
- format: 'json',
50
- description: 'NX project configuration',
51
- },
52
- 'workspace.json': {
53
- patterns: ['workspace.json'],
54
- format: 'json',
55
- description: 'NX workspace projects (deprecated)',
56
- },
57
- turbo: {
58
- patterns: ['turbo.json'],
59
- format: 'jsonc',
60
- description: 'TurboRepo configuration',
61
- },
62
- lerna: {
63
- patterns: ['lerna.json'],
64
- format: 'json',
65
- description: 'Lerna configuration',
66
- },
67
- webpack: {
68
- patterns: ['webpack.config.js', 'webpack.config.ts', 'webpack.config.cjs', 'webpack.config.mjs'],
69
- format: 'js',
70
- description: 'Webpack configuration',
71
- },
72
- rollup: {
73
- patterns: ['rollup.config.js', 'rollup.config.ts', 'rollup.config.mjs'],
74
- format: 'js',
75
- description: 'Rollup configuration',
76
- },
77
- vite: {
78
- patterns: ['vite.config.js', 'vite.config.ts', 'vite.config.mjs'],
79
- format: 'js',
80
- description: 'Vite configuration',
81
- },
82
- esbuild: {
83
- patterns: ['esbuild.config.js', 'esbuild.config.ts', 'esbuild.config.mjs'],
84
- format: 'js',
85
- description: 'esbuild configuration',
86
- },
87
- babel: {
88
- patterns: ['babel.config.js', 'babel.config.json', '.babelrc', '.babelrc.js', '.babelrc.json'],
89
- format: 'json',
90
- description: 'Babel configuration',
91
- },
92
- swc: {
93
- patterns: ['.swcrc'],
94
- format: 'json',
95
- description: 'SWC configuration',
96
- },
97
- jest: {
98
- patterns: ['jest.config.js', 'jest.config.ts', 'jest.config.mjs'],
99
- description: 'Jest configuration',
100
- },
101
- vitest: {
102
- patterns: ['vitest.config.js', 'vitest.config.ts'],
103
- description: 'Vitest configuration',
104
- },
105
- cypress: {
106
- patterns: ['cypress.config.js', 'cypress.config.ts'],
107
- description: 'Cypress configuration',
108
- },
109
- playwright: {
110
- patterns: ['playwright.config.js', 'playwright.config.ts'],
111
- description: 'Playwright configuration',
112
- },
113
- next: {
114
- patterns: ['next.config.js', 'next.config.mjs', 'next.config.ts'],
115
- format: 'js',
116
- description: 'Next.js configuration',
117
- },
118
- angular: {
119
- patterns: ['angular.json'],
120
- format: 'json',
121
- description: 'Angular CLI configuration',
122
- },
123
- nuxt: {
124
- patterns: ['nuxt.config.js', 'nuxt.config.ts'],
125
- format: 'js',
126
- description: 'Nuxt.js configuration',
127
- },
128
- svelte: {
129
- patterns: ['svelte.config.js', 'svelte.config.ts'],
130
- format: 'js',
131
- description: 'SvelteKit configuration',
132
- },
133
- astro: {
134
- patterns: ['astro.config.js', 'astro.config.ts', 'astro.config.mjs'],
135
- format: 'js',
136
- description: 'Astro configuration',
137
- },
138
- eslint: {
139
- patterns: [
140
- 'eslint.config.js',
141
- 'eslint.config.cjs',
142
- 'eslint.config.mjs',
143
- '.eslintrc',
144
- '.eslintrc.js',
145
- '.eslintrc.json',
146
- '.eslintrc.yml',
147
- ],
148
- format: 'js',
149
- description: 'ESLint configuration',
150
- },
151
- prettier: {
152
- patterns: ['prettier.config.js', 'prettier.config.cjs', '.prettierrc', '.prettierrc.js', '.prettierrc.json', '.prettierrc.yml'],
153
- format: 'json',
154
- description: 'Prettier configuration',
155
- },
156
- env: {
157
- patterns: ['.env', '.env.*', '*.env'],
158
- format: 'dotenv',
159
- description: 'Environment variables',
160
- sensitive: true,
161
- },
162
- '.gitignore': {
163
- patterns: ['.gitignore'],
164
- format: 'text',
165
- description: 'Git ignore patterns',
166
- },
167
- '.gitattributes': {
168
- patterns: ['.gitattributes'],
169
- format: 'text',
170
- description: 'Git attributes',
171
- },
172
- };
173
- /**
174
- * Get patterns for specific config types.
175
- *
176
- * @param types - Array of config types to get patterns for
177
- * @returns Array of file patterns
178
- */
179
- function getConfigPatternsByType(types) {
180
- return types.flatMap((type) => CONFIG_PATTERNS[type]?.patterns ?? []);
181
- }
182
-
183
- /**
184
- * Safe copies of Object built-in methods.
185
- *
186
- * These references are captured at module initialization time to protect against
187
- * prototype pollution attacks. Import only what you need for tree-shaking.
188
- *
189
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/object
190
- */
191
- const _Object = globalThis.Object;
192
- /**
193
- * (Safe copy) Prevents modification of existing property attributes and values,
194
- * and prevents the addition of new properties.
195
- */
196
- const freeze = _Object.freeze;
197
- /**
198
- * (Safe copy) Returns the names of the enumerable string properties and methods of an object.
199
- */
200
- const keys = _Object.keys;
201
- /**
202
- * (Safe copy) Returns an array of key/values of the enumerable own properties of an object.
203
- */
204
- const entries = _Object.entries;
205
- /**
206
- * (Safe copy) Adds one or more properties to an object, and/or modifies attributes of existing properties.
207
- */
208
- const defineProperties = _Object.defineProperties;
209
-
210
- /**
211
- * Safe copies of Map built-in via factory function.
212
- *
213
- * Since constructors cannot be safely captured via Object.assign, this module
214
- * provides a factory function that uses Reflect.construct internally.
215
- *
216
- * These references are captured at module initialization time to protect against
217
- * prototype pollution attacks. Import only what you need for tree-shaking.
218
- *
219
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/map
220
- */
221
- const _Map = globalThis.Map;
222
- const _Reflect$2 = globalThis.Reflect;
223
- /**
224
- * (Safe copy) Creates a new Map using the captured Map constructor.
225
- * Use this instead of `new Map()`.
226
- *
227
- * @param iterable - Optional iterable of key-value pairs.
228
- * @returns A new Map instance.
229
- */
230
- const createMap = (iterable) => _Reflect$2.construct(_Map, iterable ? [iterable] : []);
231
-
232
- /**
233
- * Safe copies of Set built-in via factory function.
234
- *
235
- * Since constructors cannot be safely captured via Object.assign, this module
236
- * provides a factory function that uses Reflect.construct internally.
237
- *
238
- * These references are captured at module initialization time to protect against
239
- * prototype pollution attacks. Import only what you need for tree-shaking.
240
- *
241
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/set
242
- */
243
- const _Set = globalThis.Set;
244
- const _Reflect$1 = globalThis.Reflect;
245
- /**
246
- * (Safe copy) Creates a new Set using the captured Set constructor.
247
- * Use this instead of `new Set()`.
248
- *
249
- * @param iterable - Optional iterable of values.
250
- * @returns A new Set instance.
251
- */
252
- const createSet = (iterable) => _Reflect$1.construct(_Set, iterable ? [iterable] : []);
253
-
254
- /**
255
- * Global registry of all caches for bulk operations.
256
- */
257
- const cacheRegistry = createSet();
258
- /**
259
- * Create a cache with optional TTL and size limits.
260
- *
261
- * The cache provides a simple key-value store with:
262
- * - Optional TTL (time-to-live) for automatic expiration
263
- * - Optional maxSize for limiting cache size with FIFO eviction
264
- * - Lazy expiration (entries are checked on access)
265
- *
266
- * @param options - Cache configuration options
267
- * @returns Cache instance
268
- *
269
- * @example
270
- * ```typescript
271
- * // Basic cache
272
- * const cache = createCache<string, number>()
273
- * cache.set('answer', 42)
274
- * cache.get('answer') // 42
275
- *
276
- * // Cache with TTL (expires after 60 seconds)
277
- * const ttlCache = createCache<string, object>({ ttl: 60000 })
278
- *
279
- * // Cache with max size (evicts oldest when full)
280
- * const lruCache = createCache<string, object>({ maxSize: 100 })
281
- *
282
- * // Combined options
283
- * const configCache = createCache<string, object>({
284
- * ttl: 30000,
285
- * maxSize: 50
286
- * })
287
- * ```
288
- */
289
- function createCache(options) {
290
- const { ttl, maxSize } = options ?? {};
291
- const store = createMap();
292
- const insertionOrder = [];
293
- /**
294
- * Check if an entry is expired.
295
- *
296
- * @param entry - Cache entry to check
297
- * @returns True if entry is expired
298
- */
299
- function isExpired(entry) {
300
- if (ttl === undefined)
301
- return false;
302
- // eslint-disable-next-line workspace/no-unsafe-builtin-methods -- Date.now() is needed for Jest fake timers compatibility
303
- return Date.now() - entry.timestamp > ttl;
304
- }
305
- /**
306
- * Evict oldest entries to make room for new ones.
307
- */
308
- function evictIfNeeded() {
309
- if (maxSize === undefined)
310
- return;
311
- while (store.size >= maxSize && insertionOrder.length > 0) {
312
- const oldestKey = insertionOrder.shift();
313
- if (oldestKey !== undefined) {
314
- store.delete(oldestKey);
315
- }
316
- }
317
- }
318
- /**
319
- * Remove key from insertion order tracking.
320
- *
321
- * @param key - Key to remove from order tracking
322
- */
323
- function removeFromOrder(key) {
324
- const index = insertionOrder.indexOf(key);
325
- if (index !== -1) {
326
- insertionOrder.splice(index, 1);
327
- }
328
- }
329
- const cache = {
330
- get(key) {
331
- const entry = store.get(key);
332
- if (!entry)
333
- return undefined;
334
- if (isExpired(entry)) {
335
- store.delete(key);
336
- removeFromOrder(key);
337
- return undefined;
338
- }
339
- return entry.value;
340
- },
341
- set(key, value) {
342
- if (store.has(key)) {
343
- removeFromOrder(key);
344
- }
345
- else {
346
- evictIfNeeded();
347
- }
348
- // eslint-disable-next-line workspace/no-unsafe-builtin-methods -- Date.now() is needed for Jest fake timers compatibility
349
- store.set(key, { value, timestamp: Date.now() });
350
- insertionOrder.push(key);
351
- },
352
- has(key) {
353
- const entry = store.get(key);
354
- if (!entry)
355
- return false;
356
- if (isExpired(entry)) {
357
- store.delete(key);
358
- removeFromOrder(key);
359
- return false;
360
- }
361
- return true;
362
- },
363
- delete(key) {
364
- removeFromOrder(key);
365
- return store.delete(key);
366
- },
367
- clear() {
368
- store.clear();
369
- insertionOrder.length = 0;
370
- },
371
- size() {
372
- return store.size;
373
- },
374
- keys() {
375
- return [...insertionOrder];
376
- },
377
- };
378
- cacheRegistry.add(cache);
379
- return freeze(cache);
380
- }
381
-
382
- /**
383
- * Safe copies of Error built-ins via factory functions.
384
- *
385
- * Since constructors cannot be safely captured via Object.assign, this module
386
- * provides factory functions that use Reflect.construct internally.
387
- *
388
- * These references are captured at module initialization time to protect against
389
- * prototype pollution attacks. Import only what you need for tree-shaking.
390
- *
391
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/error
392
- */
393
- const _Error = globalThis.Error;
394
- const _Reflect = globalThis.Reflect;
395
- /**
396
- * (Safe copy) Creates a new Error using the captured Error constructor.
397
- * Use this instead of `new Error()`.
398
- *
399
- * @param message - Optional error message.
400
- * @param options - Optional error options.
401
- * @returns A new Error instance.
402
- */
403
- const createError = (message, options) => _Reflect.construct(_Error, [message, options]);
404
-
405
- /**
406
- * Safe copies of JSON built-in methods.
407
- *
408
- * These references are captured at module initialization time to protect against
409
- * prototype pollution attacks. Import only what you need for tree-shaking.
410
- *
411
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/json
412
- */
413
- const _JSON = globalThis.JSON;
414
- /**
415
- * (Safe copy) Converts a JavaScript Object Notation (JSON) string into an object.
416
- */
417
- const parse = _JSON.parse;
418
- /**
419
- * (Safe copy) Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
420
- */
421
- const stringify = _JSON.stringify;
422
-
423
- /**
424
- * Safe copies of Array built-in static methods.
425
- *
426
- * These references are captured at module initialization time to protect against
427
- * prototype pollution attacks. Import only what you need for tree-shaking.
428
- *
429
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/array
430
- */
431
- const _Array = globalThis.Array;
432
- /**
433
- * (Safe copy) Determines whether the passed value is an Array.
434
- */
435
- const isArray = _Array.isArray;
436
-
437
- /**
438
- * Safe copies of Console built-in methods.
439
- *
440
- * These references are captured at module initialization time to protect against
441
- * prototype pollution attacks. Import only what you need for tree-shaking.
442
- *
443
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/console
444
- */
445
- const _console = globalThis.console;
446
- /**
447
- * (Safe copy) Outputs a message to the console.
448
- */
449
- const log = _console.log.bind(_console);
450
- /**
451
- * (Safe copy) Outputs a warning message to the console.
452
- */
453
- const warn = _console.warn.bind(_console);
454
- /**
455
- * (Safe copy) Outputs an error message to the console.
456
- */
457
- const error = _console.error.bind(_console);
458
- /**
459
- * (Safe copy) Outputs an informational message to the console.
460
- */
461
- const info = _console.info.bind(_console);
462
- /**
463
- * (Safe copy) Outputs a debug message to the console.
464
- */
465
- const debug = _console.debug.bind(_console);
466
- /**
467
- * (Safe copy) Outputs a stack trace to the console.
468
- */
469
- _console.trace.bind(_console);
470
- /**
471
- * (Safe copy) Displays an interactive listing of the properties of a specified object.
472
- */
473
- _console.dir.bind(_console);
474
- /**
475
- * (Safe copy) Displays tabular data as a table.
476
- */
477
- _console.table.bind(_console);
478
- /**
479
- * (Safe copy) Writes an error message to the console if the assertion is false.
480
- */
481
- _console.assert.bind(_console);
482
- /**
483
- * (Safe copy) Clears the console.
484
- */
485
- _console.clear.bind(_console);
486
- /**
487
- * (Safe copy) Logs the number of times that this particular call to count() has been called.
488
- */
489
- _console.count.bind(_console);
490
- /**
491
- * (Safe copy) Resets the counter used with console.count().
492
- */
493
- _console.countReset.bind(_console);
494
- /**
495
- * (Safe copy) Creates a new inline group in the console.
496
- */
497
- _console.group.bind(_console);
498
- /**
499
- * (Safe copy) Creates a new inline group in the console that is initially collapsed.
500
- */
501
- _console.groupCollapsed.bind(_console);
502
- /**
503
- * (Safe copy) Exits the current inline group.
504
- */
505
- _console.groupEnd.bind(_console);
506
- /**
507
- * (Safe copy) Starts a timer with a name specified as an input parameter.
508
- */
509
- _console.time.bind(_console);
510
- /**
511
- * (Safe copy) Stops a timer that was previously started.
512
- */
513
- _console.timeEnd.bind(_console);
514
- /**
515
- * (Safe copy) Logs the current value of a timer that was previously started.
516
- */
517
- _console.timeLog.bind(_console);
518
-
519
- const registeredClasses = [];
520
-
521
- /**
522
- * Returns the data type of the target.
523
- * Uses native `typeof` operator, however, makes distinction between `null`, `array`, and `object`.
524
- * Also, when classes are registered via `registerClass`, it checks if objects are instance of any known registered class.
525
- *
526
- * @param target - The target to get the data type of.
527
- * @returns The data type of the target.
528
- */
529
- const getType = (target) => {
530
- if (target === null)
531
- return 'null';
532
- const nativeDataType = typeof target;
533
- if (nativeDataType === 'object') {
534
- if (isArray(target))
535
- return 'array';
536
- for (const registeredClass of registeredClasses) {
537
- if (target instanceof registeredClass)
538
- return registeredClass.name;
539
- }
540
- }
541
- return nativeDataType;
542
- };
543
-
544
- /* eslint-disable @typescript-eslint/no-explicit-any */
545
- /**
546
- * Creates a wrapper function that only executes the wrapped function if the condition function returns true.
547
- *
548
- * @param func - The function to be conditionally executed.
549
- * @param conditionFunc - A function that returns a boolean, determining if `func` should be executed.
550
- * @returns A wrapped version of `func` that executes conditionally.
551
- */
552
- function createConditionalExecutionFunction(func, conditionFunc) {
553
- return function (...args) {
554
- if (conditionFunc()) {
555
- return func(...args);
556
- }
557
- };
558
- }
559
-
560
- /* eslint-disable @typescript-eslint/no-explicit-any */
561
- /**
562
- * Creates a wrapper function that silently ignores any errors thrown by the wrapped void function.
563
- * This function is specifically for wrapping functions that do not return a value (void functions).
564
- * Exceptions are swallowed without any logging or handling.
565
- *
566
- * @param func - The void function to be wrapped.
567
- * @returns A wrapped version of the input function that ignores errors.
568
- */
569
- function createErrorIgnoringFunction(func) {
570
- return function (...args) {
571
- try {
572
- func(...args);
573
- }
574
- catch {
575
- // Deliberately swallowing/ignoring the exception
576
- }
577
- };
578
- }
579
-
580
- /* eslint-disable @typescript-eslint/no-unused-vars */
581
- /**
582
- * A no-operation function (noop) that does nothing regardless of the arguments passed.
583
- * It is designed to be as permissive as possible in its typing without using the `Function` keyword.
584
- *
585
- * @param args - Any arguments passed to the function (ignored)
586
- */
587
- const noop = (...args) => {
588
- // Intentionally does nothing
589
- };
590
-
591
- const logLevels = ['none', 'error', 'warn', 'log', 'info', 'debug'];
592
- const priority = {
593
- error: 4,
594
- warn: 3,
595
- log: 2,
596
- info: 1,
597
- debug: 0,
598
- };
599
- /**
600
- * Validates whether a given string is a valid log level.
601
- *
602
- * @param level - The log level to validate
603
- * @returns True if the level is valid, false otherwise
604
- */
605
- function isValidLogLevel(level) {
606
- return logLevels.includes(level);
607
- }
608
- /**
609
- * Creates a log level configuration manager for controlling logging behavior.
610
- * Provides methods to get, set, and evaluate log levels based on priority.
611
- *
612
- * @param level - The initial log level (defaults to 'error')
613
- * @returns A configuration object with log level management methods
614
- * @throws {Error} When the provided level is not a valid log level
615
- */
616
- function createLogLevelConfig(level = 'error') {
617
- if (!isValidLogLevel(level)) {
618
- throw createError('Cannot create log level configuration with a valid default log level');
619
- }
620
- const state = { level };
621
- const getLogLevel = () => state.level;
622
- const setLogLevel = (level) => {
623
- if (!isValidLogLevel(level)) {
624
- throw createError(`Cannot set value '${level}' level. Expected levels are ${logLevels}.`);
625
- }
626
- state.level = level;
627
- };
628
- const shouldLog = (level) => {
629
- if (state.level === 'none' || level === 'none' || !isValidLogLevel(level)) {
630
- return false;
631
- }
632
- return priority[level] >= priority[state.level];
633
- };
634
- return freeze({
635
- getLogLevel,
636
- setLogLevel,
637
- shouldLog,
638
- });
639
- }
640
-
641
- /**
642
- * Creates a logger instance with configurable log level filtering.
643
- * Each log function is wrapped to respect the current log level setting.
644
- *
645
- * @param error - Function to handle error-level logs (required)
646
- * @param warn - Function to handle warning-level logs (optional, defaults to noop)
647
- * @param log - Function to handle standard logs (optional, defaults to noop)
648
- * @param info - Function to handle info-level logs (optional, defaults to noop)
649
- * @param debug - Function to handle debug-level logs (optional, defaults to noop)
650
- * @returns A frozen logger object with log methods and level control
651
- * @throws {ErrorLevelFn} When any provided log function is invalid
652
- */
653
- function createLogger(error, warn = noop, log = noop, info = noop, debug = noop) {
654
- if (notValidLogFn(error)) {
655
- throw createError(notFnMsg('error'));
656
- }
657
- if (notValidLogFn(warn)) {
658
- throw createError(notFnMsg('warn'));
659
- }
660
- if (notValidLogFn(log)) {
661
- throw createError(notFnMsg('log'));
662
- }
663
- if (notValidLogFn(info)) {
664
- throw createError(notFnMsg('info'));
665
- }
666
- if (notValidLogFn(debug)) {
667
- throw createError(notFnMsg('debug'));
668
- }
669
- const { setLogLevel, getLogLevel, shouldLog } = createLogLevelConfig();
670
- const wrapLogFn = (fn, level) => {
671
- if (fn === noop)
672
- return fn;
673
- const condition = () => shouldLog(level);
674
- return createConditionalExecutionFunction(createErrorIgnoringFunction(fn), condition);
675
- };
676
- return freeze({
677
- error: wrapLogFn(error, 'error'),
678
- warn: wrapLogFn(warn, 'warn'),
679
- log: wrapLogFn(log, 'log'),
680
- info: wrapLogFn(info, 'info'),
681
- debug: wrapLogFn(debug, 'debug'),
682
- setLogLevel,
683
- getLogLevel,
684
- });
685
- }
686
- /**
687
- * Validates whether a given value is a valid log function.
688
- *
689
- * @param fn - The value to validate
690
- * @returns True if the value is not a function (invalid), false if it is valid
691
- */
692
- function notValidLogFn(fn) {
693
- return getType(fn) !== 'function' && fn !== noop;
694
- }
695
- /**
696
- * Generates an error message for invalid log function parameters.
697
- *
698
- * @param label - The name of the log function that failed validation
699
- * @returns A formatted error message string
700
- */
701
- function notFnMsg(label) {
702
- return `Cannot create a logger when ${label} is not a function`;
703
- }
704
-
705
- createLogger(error, warn, log, info, debug);
3
+ const node_path = require('node:path');
4
+ const index_cjs_js$2 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/object/index.cjs.js');
5
+ const index_cjs_js$1 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/map/index.cjs.js');
6
+ const index_cjs_js = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/set/index.cjs.js');
7
+ const node_fs = require('node:fs');
8
+ const index_cjs_js$5 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/array/index.cjs.js');
9
+ const index_cjs_js$4 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/console/index.cjs.js');
10
+ const index_cjs_js$6 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/json/index.cjs.js');
11
+ const index_cjs_js$3 = require('../../_dependencies/@hyperfrontend/logging/index.cjs.js');
12
+ const index_cjs_js$7 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/error/index.cjs.js');
13
+ const index_cjs_js$8 = require('../../_dependencies/@hyperfrontend/immutable-api-utils/built-in-copy/number/index.cjs.js');
14
+ const { isDirectory, exists } = require('../../_shared/core/fs/stat/index.cjs.js');
15
+ const { createConfigError } = require('../../_shared/core/errors/structured-errors/index.cjs.js');
16
+ const { createCache } = require('../../_shared/core/cache/index.cjs.js');
17
+ const { matchGlobPattern } = require('../../_shared/core/patterns/glob/index.cjs.js');
18
+ const { CONFIG_PATTERNS, getConfigPatternsByType } = require('../../_shared/project/config/patterns/index.cjs.js');
706
19
 
707
20
  /**
708
21
  * Global log level registry.
709
22
  * Tracks all created scoped loggers to allow global log level changes.
710
23
  */
711
- const loggerRegistry = createSet();
24
+ const loggerRegistry = index_cjs_js.createSet();
712
25
  /** Redacted placeholder for sensitive values */
713
26
  const REDACTED = '[REDACTED]';
714
27
  /**
@@ -742,17 +55,24 @@ function isSensitiveKey(key) {
742
55
  *
743
56
  * @param obj - Object to sanitize
744
57
  * @returns New object with sensitive values redacted
58
+ *
59
+ * @example Sanitizing sensitive data
60
+ * ```typescript
61
+ * const config = { apiKey: 'secret123', endpoint: 'https://api.example.com' }
62
+ * const safe = sanitize(config)
63
+ * // => { apiKey: '[REDACTED]', endpoint: 'https://api.example.com' }
64
+ * ```
745
65
  */
746
66
  function sanitize(obj) {
747
67
  if (obj === null || obj === undefined) {
748
68
  return obj;
749
69
  }
750
- if (isArray(obj)) {
70
+ if (index_cjs_js$5.isArray(obj)) {
751
71
  return obj.map((item) => sanitize(item));
752
72
  }
753
73
  if (typeof obj === 'object') {
754
74
  const result = {};
755
- for (const [key, value] of entries(obj)) {
75
+ for (const [key, value] of index_cjs_js$2.entries(obj)) {
756
76
  if (isSensitiveKey(key)) {
757
77
  result[key] = REDACTED;
758
78
  }
@@ -777,9 +97,9 @@ function sanitize(obj) {
777
97
  */
778
98
  function formatMessage(namespace, message, meta) {
779
99
  const prefix = `[${namespace}]`;
780
- if (meta && keys(meta).length > 0) {
100
+ if (meta && index_cjs_js$2.keys(meta).length > 0) {
781
101
  const sanitizedMeta = sanitize(meta);
782
- return `${prefix} ${message} ${stringify(sanitizedMeta)}`;
102
+ return `${prefix} ${message} ${index_cjs_js$6.stringify(sanitizedMeta)}`;
783
103
  }
784
104
  return `${prefix} ${message}`;
785
105
  }
@@ -792,7 +112,7 @@ function formatMessage(namespace, message, meta) {
792
112
  * @param options - Logger configuration options
793
113
  * @returns A configured scoped logger instance
794
114
  *
795
- * @example
115
+ * @example Creating a scoped logger
796
116
  * ```typescript
797
117
  * const logger = createScopedLogger('project-scope')
798
118
  * logger.setLogLevel('debug')
@@ -811,9 +131,9 @@ function createScopedLogger(namespace, options = {}) {
811
131
  const processedMeta = sanitizeSecrets && meta ? sanitize(meta) : meta;
812
132
  baseFn(formatMessage(namespace, message, processedMeta));
813
133
  };
814
- const baseLogger = createLogger(createLogFn(error), createLogFn(warn), createLogFn(log), createLogFn(info), createLogFn(debug));
134
+ const baseLogger = index_cjs_js$3.createLogger(createLogFn(index_cjs_js$4.error), createLogFn(index_cjs_js$4.warn), createLogFn(index_cjs_js$4.log), createLogFn(index_cjs_js$4.info), createLogFn(index_cjs_js$4.debug));
815
135
  baseLogger.setLogLevel(level);
816
- const scopedLogger = freeze({
136
+ const scopedLogger = index_cjs_js$2.freeze({
817
137
  error: (message, meta) => baseLogger.error(message, meta),
818
138
  warn: (message, meta) => baseLogger.warn(message, meta),
819
139
  log: (message, meta) => baseLogger.log(message, meta),
@@ -829,7 +149,7 @@ function createScopedLogger(namespace, options = {}) {
829
149
  * Default logger instance for the project-scope library.
830
150
  * Use this for general logging within the library.
831
151
  *
832
- * @example
152
+ * @example Using the default logger
833
153
  * ```typescript
834
154
  * import { logger } from '@hyperfrontend/project-scope/core'
835
155
  *
@@ -847,10 +167,19 @@ const fsLogger = createScopedLogger('project-scope:fs');
847
167
  * @param code - The category code for this type of filesystem failure
848
168
  * @param context - Additional context including path, operation, and cause
849
169
  * @returns A configured Error object with code and context properties
170
+ *
171
+ * @example Creating a file system error
172
+ * ```typescript
173
+ * throw createFileSystemError(
174
+ * 'Cannot read file',
175
+ * 'FS_READ_ERROR',
176
+ * { path: './missing.txt', operation: 'read' }
177
+ * )
178
+ * ```
850
179
  */
851
180
  function createFileSystemError(message, code, context) {
852
- const error = createError(message);
853
- defineProperties(error, {
181
+ const error = index_cjs_js$7.createError(message);
182
+ index_cjs_js$2.defineProperties(error, {
854
183
  code: { value: code, enumerable: true },
855
184
  context: { value: context, enumerable: true },
856
185
  });
@@ -864,7 +193,7 @@ function createFileSystemError(message, code, context) {
864
193
  * @returns File contents as string
865
194
  * @throws {Error} If file doesn't exist or can't be read
866
195
  *
867
- * @example
196
+ * @example Reading file contents
868
197
  * ```typescript
869
198
  * import { readFileContent } from '@hyperfrontend/project-scope'
870
199
  *
@@ -891,6 +220,14 @@ function readFileContent(filePath, encoding = 'utf-8') {
891
220
  * @param filePath - Path to file
892
221
  * @param encoding - File encoding (default: utf-8)
893
222
  * @returns File contents or null if file doesn't exist
223
+ *
224
+ * @example Reading file if it exists
225
+ * ```typescript
226
+ * const content = readFileIfExists('./optional-config.json')
227
+ * if (content) {
228
+ * // File existed, use content
229
+ * }
230
+ * ```
894
231
  */
895
232
  function readFileIfExists(filePath, encoding = 'utf-8') {
896
233
  if (!node_fs.existsSync(filePath)) {
@@ -904,56 +241,6 @@ function readFileIfExists(filePath, encoding = 'utf-8') {
904
241
  }
905
242
  }
906
243
 
907
- createScopedLogger('project-scope:fs:write');
908
-
909
- /**
910
- * Get file stats with error handling.
911
- *
912
- * @param filePath - Path to file
913
- * @param followSymlinks - Whether to follow symlinks (default: true)
914
- * @returns File stats or null if path doesn't exist
915
- */
916
- function getFileStat(filePath, followSymlinks = true) {
917
- if (!node_fs.existsSync(filePath)) {
918
- return null;
919
- }
920
- try {
921
- const stat = followSymlinks ? node_fs.statSync(filePath) : node_fs.lstatSync(filePath);
922
- return {
923
- isFile: stat.isFile(),
924
- isDirectory: stat.isDirectory(),
925
- isSymlink: stat.isSymbolicLink(),
926
- size: stat.size,
927
- created: stat.birthtime,
928
- modified: stat.mtime,
929
- accessed: stat.atime,
930
- mode: stat.mode,
931
- };
932
- }
933
- catch {
934
- return null;
935
- }
936
- }
937
- /**
938
- * Check if path is a directory.
939
- *
940
- * @param dirPath - Path to check
941
- * @returns True if path is a directory
942
- */
943
- function isDirectory(dirPath) {
944
- const stats = getFileStat(dirPath);
945
- return stats?.isDirectory ?? false;
946
- }
947
- /**
948
- * Check if path exists.
949
- *
950
- * @param filePath - Path to check
951
- * @returns True if path exists
952
- */
953
- function exists(filePath) {
954
- return node_fs.existsSync(filePath);
955
- }
956
-
957
244
  const fsDirLogger = createScopedLogger('project-scope:fs:dir');
958
245
  /**
959
246
  * List immediate contents of a directory.
@@ -962,7 +249,7 @@ const fsDirLogger = createScopedLogger('project-scope:fs:dir');
962
249
  * @returns Array of entries with metadata for each file/directory
963
250
  * @throws {Error} If directory doesn't exist or isn't a directory
964
251
  *
965
- * @example
252
+ * @example Listing directory contents
966
253
  * ```typescript
967
254
  * import { readDirectory } from '@hyperfrontend/project-scope'
968
255
  *
@@ -1005,197 +292,7 @@ function readDirectory(dirPath) {
1005
292
 
1006
293
  createScopedLogger('project-scope:fs:traversal');
1007
294
 
1008
- /**
1009
- * Match path against glob pattern using safe character iteration.
1010
- * Avoids regex to prevent ReDoS attacks.
1011
- *
1012
- * Supported patterns:
1013
- * - * matches any characters except /
1014
- * - ** matches any characters including /
1015
- * - ? matches exactly one character except /
1016
- * - {a,b,c} matches any of the alternatives
1017
- *
1018
- * @param path - The filesystem path to test against the pattern
1019
- * @param pattern - The glob pattern to match against
1020
- * @returns True if path matches pattern
1021
- *
1022
- * @example
1023
- * ```typescript
1024
- * import { matchGlobPattern } from '@hyperfrontend/project-scope'
1025
- *
1026
- * matchGlobPattern('src/utils/helper.ts', '\*\*\/*.ts') // true
1027
- * matchGlobPattern('test.spec.ts', '\*.spec.ts') // true
1028
- * matchGlobPattern('config.json', '\*.{json,yaml}') // true
1029
- * matchGlobPattern('src/index.ts', 'src/\*.ts') // true
1030
- * ```
1031
- */
1032
- function matchGlobPattern(path, pattern) {
1033
- return matchSegments(path.split('/'), pattern.split('/'), 0, 0);
1034
- }
1035
- /**
1036
- * Internal recursive function to match path segments against pattern segments.
1037
- *
1038
- * @param pathParts - Array of path segments split by '/'
1039
- * @param patternParts - Array of pattern segments split by '/'
1040
- * @param pathIdx - Current index in pathParts being examined
1041
- * @param patternIdx - Current index in patternParts being examined
1042
- * @returns True if remaining segments match
1043
- */
1044
- function matchSegments(pathParts, patternParts, pathIdx, patternIdx) {
1045
- if (pathIdx === pathParts.length && patternIdx === patternParts.length) {
1046
- return true;
1047
- }
1048
- if (patternIdx >= patternParts.length) {
1049
- return false;
1050
- }
1051
- const patternPart = patternParts[patternIdx];
1052
- if (patternPart === '**') {
1053
- for (let i = pathIdx; i <= pathParts.length; i++) {
1054
- if (matchSegments(pathParts, patternParts, i, patternIdx + 1)) {
1055
- return true;
1056
- }
1057
- }
1058
- return false;
1059
- }
1060
- if (pathIdx >= pathParts.length) {
1061
- return false;
1062
- }
1063
- const pathPart = pathParts[pathIdx];
1064
- if (matchSegment(pathPart, patternPart)) {
1065
- return matchSegments(pathParts, patternParts, pathIdx + 1, patternIdx + 1);
1066
- }
1067
- return false;
1068
- }
1069
- /**
1070
- * Match a single path segment against a pattern segment.
1071
- * Handles *, ?, and {a,b,c} patterns.
1072
- *
1073
- * @param text - The path segment text to match
1074
- * @param pattern - The pattern segment to match against
1075
- * @returns True if the text matches the pattern
1076
- */
1077
- function matchSegment(text, pattern) {
1078
- let textIdx = 0;
1079
- let patternIdx = 0;
1080
- while (patternIdx < pattern.length) {
1081
- const char = pattern[patternIdx];
1082
- if (char === '*') {
1083
- patternIdx++;
1084
- if (patternIdx === pattern.length) {
1085
- return true;
1086
- }
1087
- for (let i = textIdx; i <= text.length; i++) {
1088
- if (matchSegmentFrom(text, i, pattern, patternIdx)) {
1089
- return true;
1090
- }
1091
- }
1092
- return false;
1093
- }
1094
- else if (char === '?') {
1095
- if (textIdx >= text.length) {
1096
- return false;
1097
- }
1098
- textIdx++;
1099
- patternIdx++;
1100
- }
1101
- else if (char === '{') {
1102
- const closeIdx = findClosingBrace(pattern, patternIdx);
1103
- if (closeIdx === -1) {
1104
- if (textIdx >= text.length || text[textIdx] !== char) {
1105
- return false;
1106
- }
1107
- textIdx++;
1108
- patternIdx++;
1109
- }
1110
- else {
1111
- const alternatives = extractAlternatives(pattern.slice(patternIdx + 1, closeIdx));
1112
- for (const alt of alternatives) {
1113
- if (matchSegmentFrom(text, textIdx, text.slice(0, textIdx) + alt + pattern.slice(closeIdx + 1), textIdx)) {
1114
- return true;
1115
- }
1116
- }
1117
- return false;
1118
- }
1119
- }
1120
- else {
1121
- if (textIdx >= text.length || text[textIdx] !== char) {
1122
- return false;
1123
- }
1124
- textIdx++;
1125
- patternIdx++;
1126
- }
1127
- }
1128
- return textIdx === text.length;
1129
- }
1130
- /**
1131
- * Helper to match from a specific position.
1132
- *
1133
- * @param text - The full text being matched
1134
- * @param textIdx - The starting index in text to match from
1135
- * @param pattern - The full pattern being matched
1136
- * @param patternIdx - The starting index in pattern to match from
1137
- * @returns True if the text matches the pattern from the given positions
1138
- */
1139
- function matchSegmentFrom(text, textIdx, pattern, patternIdx) {
1140
- const remainingText = text.slice(textIdx);
1141
- const remainingPattern = pattern.slice(patternIdx);
1142
- return matchSegment(remainingText, remainingPattern);
1143
- }
1144
- /**
1145
- * Find closing brace for {a,b,c} pattern.
1146
- *
1147
- * @param pattern - The pattern string to search within
1148
- * @param startIdx - The index of the opening brace
1149
- * @returns The index of the matching closing brace, or -1 if not found
1150
- */
1151
- function findClosingBrace(pattern, startIdx) {
1152
- let depth = 0;
1153
- for (let i = startIdx; i < pattern.length; i++) {
1154
- if (pattern[i] === '{') {
1155
- depth++;
1156
- }
1157
- else if (pattern[i] === '}') {
1158
- depth--;
1159
- if (depth === 0) {
1160
- return i;
1161
- }
1162
- }
1163
- }
1164
- return -1;
1165
- }
1166
- /**
1167
- * Extract alternatives from {a,b,c} pattern content.
1168
- *
1169
- * @param content - The content between braces (without the braces themselves)
1170
- * @returns Array of alternative strings split by commas at depth 0
1171
- */
1172
- function extractAlternatives(content) {
1173
- const alternatives = [];
1174
- let current = '';
1175
- let depth = 0;
1176
- for (let i = 0; i < content.length; i++) {
1177
- const char = content[i];
1178
- if (char === '{') {
1179
- depth++;
1180
- current += char;
1181
- }
1182
- else if (char === '}') {
1183
- depth--;
1184
- current += char;
1185
- }
1186
- else if (char === ',' && depth === 0) {
1187
- alternatives.push(current);
1188
- current = '';
1189
- }
1190
- else {
1191
- current += char;
1192
- }
1193
- }
1194
- if (current) {
1195
- alternatives.push(current);
1196
- }
1197
- return alternatives;
1198
- }
295
+ createScopedLogger('project-scope:fs:write');
1199
296
 
1200
297
  const walkLogger = createScopedLogger('project-scope:project:walk');
1201
298
  /**
@@ -1262,6 +359,18 @@ function matchPattern(path, pattern) {
1262
359
  * @param startPath - Root directory to begin traversal
1263
360
  * @param visitor - Callback function invoked for each file system entry
1264
361
  * @param options - Configuration for traversal behavior
362
+ *
363
+ * @example Walking a directory tree
364
+ * ```typescript
365
+ * import { walkDirectory } from '@hyperfrontend/project-scope'
366
+ *
367
+ * const tsFiles: string[] = []
368
+ * walkDirectory('./src', (entry) => {
369
+ * if (entry.isFile && entry.name.endsWith('.ts')) {
370
+ * tsFiles.push(entry.relativePath)
371
+ * }
372
+ * }, { maxDepth: 5, respectGitignore: true })
373
+ * ```
1265
374
  */
1266
375
  function walkDirectory(startPath, visitor, options) {
1267
376
  walkLogger.debug('Starting directory walk', {
@@ -1358,7 +467,7 @@ function matchesPatterns(path, patterns) {
1358
467
  * @param options - Configuration for search behavior
1359
468
  * @returns List of relative file paths that match the patterns
1360
469
  *
1361
- * @example
470
+ * @example Finding files by pattern
1362
471
  * ```typescript
1363
472
  * import { findFiles } from '@hyperfrontend/project-scope'
1364
473
  *
@@ -1376,7 +485,7 @@ function matchesPatterns(path, patterns) {
1376
485
  * ```
1377
486
  */
1378
487
  function findFiles(startPath, patterns, options) {
1379
- const normalizedPatterns = isArray(patterns) ? patterns : [patterns];
488
+ const normalizedPatterns = index_cjs_js$5.isArray(patterns) ? patterns : [patterns];
1380
489
  searchLogger.debug('Finding files', { startPath, patterns: normalizedPatterns, maxResults: options?.maxResults });
1381
490
  const results = [];
1382
491
  const maxResults = options?.maxResults ?? Infinity;
@@ -1413,7 +522,7 @@ const configDetectionCache = createCache({ ttl: 30000, maxSize: 50 });
1413
522
  * @param options - Detection options
1414
523
  * @returns Array of detected configuration files
1415
524
  *
1416
- * @example
525
+ * @example Detecting configuration files
1417
526
  * ```typescript
1418
527
  * import { detectConfigs } from '@hyperfrontend/project-scope'
1419
528
  *
@@ -1432,7 +541,7 @@ const configDetectionCache = createCache({ ttl: 30000, maxSize: 50 });
1432
541
  * ```
1433
542
  */
1434
543
  function detectConfigs(rootPath, types, options) {
1435
- const typesToCheck = types ?? keys(CONFIG_PATTERNS);
544
+ const typesToCheck = types ?? index_cjs_js$2.keys(CONFIG_PATTERNS);
1436
545
  const results = [];
1437
546
  const maxDepth = options?.maxDepth ?? 10;
1438
547
  const includeHidden = options?.includeHidden ?? true;
@@ -1493,6 +602,14 @@ function detectConfigs(rootPath, types, options) {
1493
602
  * Clear the config detection cache.
1494
603
  *
1495
604
  * Useful for testing or when the project files have changed.
605
+ *
606
+ * @example Clearing the config detection cache
607
+ * ```typescript
608
+ * import { clearConfigDetectionCache } from '@hyperfrontend/project-scope'
609
+ *
610
+ * // Reset cache after modifying config files
611
+ * clearConfigDetectionCache()
612
+ * ```
1496
613
  */
1497
614
  function clearConfigDetectionCache() {
1498
615
  configDetectionCache.clear();
@@ -1503,6 +620,17 @@ function clearConfigDetectionCache() {
1503
620
  * @param rootPath - Project root directory
1504
621
  * @param type - Config type to find
1505
622
  * @returns Full path to config file or null if not found
623
+ *
624
+ * @example Finding a specific config file
625
+ * ```typescript
626
+ * import { findConfigFile } from '@hyperfrontend/project-scope'
627
+ *
628
+ * const tsConfig = findConfigFile('/project', 'typescript')
629
+ * // => '/project/tsconfig.json'
630
+ *
631
+ * const eslint = findConfigFile('/project', 'eslint')
632
+ * // => '/project/.eslintrc.js' or null if not found
633
+ * ```
1506
634
  */
1507
635
  function findConfigFile(rootPath, type) {
1508
636
  const info = CONFIG_PATTERNS[type];
@@ -1526,72 +654,6 @@ function findConfigFile(rootPath, type) {
1526
654
  }
1527
655
  return null;
1528
656
  }
1529
- /**
1530
- * Get all known config file patterns for a given configuration type.
1531
- *
1532
- * @param type - Configuration type identifier
1533
- * @returns Array of glob patterns for matching config files
1534
- */
1535
- function getConfigPaths(type) {
1536
- const info = CONFIG_PATTERNS[type];
1537
- return info?.patterns ?? [];
1538
- }
1539
-
1540
- /**
1541
- * Safe copies of Number built-in methods and constants.
1542
- *
1543
- * These references are captured at module initialization time to protect against
1544
- * prototype pollution attacks. Import only what you need for tree-shaking.
1545
- *
1546
- * @module @hyperfrontend/immutable-api-utils/built-in-copy/number
1547
- */
1548
- const _parseInt = globalThis.parseInt;
1549
- const _parseFloat = globalThis.parseFloat;
1550
- /**
1551
- * (Safe copy) Parses a string and returns an integer.
1552
- */
1553
- const parseInt = _parseInt;
1554
- /**
1555
- * (Safe copy) Parses a string and returns a floating point number.
1556
- */
1557
- const parseFloat = _parseFloat;
1558
-
1559
- /**
1560
- * Create a structured error with code and optional context.
1561
- *
1562
- * @param message - The human-readable error message
1563
- * @param code - The machine-readable error code for programmatic handling
1564
- * @param context - Additional contextual information about the error
1565
- * @returns Structured error instance with code and context properties
1566
- *
1567
- * @example
1568
- * ```typescript
1569
- * import { createStructuredError } from '@hyperfrontend/project-scope'
1570
- *
1571
- * throw createStructuredError(
1572
- * 'Configuration file not found',
1573
- * 'CONFIG_NOT_FOUND',
1574
- * { path: './config.json', searched: ['./config.json', './settings.json'] }
1575
- * )
1576
- * ```
1577
- */
1578
- function createStructuredError(message, code, context) {
1579
- const error = createError(message);
1580
- error.code = code;
1581
- error.context = context ?? {};
1582
- return error;
1583
- }
1584
- /**
1585
- * Create a configuration-related error.
1586
- *
1587
- * @param message - The human-readable error message
1588
- * @param code - The machine-readable error code for programmatic handling
1589
- * @param context - Additional contextual information (e.g., file path, config key)
1590
- * @returns Structured error instance tagged with type 'config'
1591
- */
1592
- function createConfigError(message, code, context) {
1593
- return createStructuredError(message, code, { ...context, type: 'config' });
1594
- }
1595
657
 
1596
658
  /**
1597
659
  * Detect config type from file name.
@@ -1602,7 +664,7 @@ function createConfigError(message, code, context) {
1602
664
  */
1603
665
  function detectConfigType(filePath) {
1604
666
  const fileName = node_path.basename(filePath);
1605
- for (const [type, info] of entries(CONFIG_PATTERNS)) {
667
+ for (const [type, info] of index_cjs_js$2.entries(CONFIG_PATTERNS)) {
1606
668
  for (const pattern of info.patterns) {
1607
669
  if (matchGlobPattern(fileName, pattern)) {
1608
670
  return type;
@@ -1723,10 +785,10 @@ function parseSimpleYaml(content) {
1723
785
  result[key] = null;
1724
786
  }
1725
787
  else if (/^-?\d+$/.test(value)) {
1726
- result[key] = parseInt(value, 10);
788
+ result[key] = index_cjs_js$8.parseInt(value, 10);
1727
789
  }
1728
790
  else if (/^-?\d+\.\d+$/.test(value)) {
1729
- result[key] = parseFloat(value);
791
+ result[key] = index_cjs_js$8.parseFloat(value);
1730
792
  }
1731
793
  else {
1732
794
  result[key] = value.replace(/^["']|["']$/g, '');
@@ -1804,16 +866,28 @@ function parseDotenv(content) {
1804
866
  * @param type - Category of configuration (e.g., typescript, eslint)
1805
867
  * @param format - Whether to strip comments (jsonc) or parse strictly (json)
1806
868
  * @returns Configuration object with parsed data and extends references
869
+ *
870
+ * @example Parsing JSON configuration
871
+ * ```typescript
872
+ * import { parseJsonConfig } from '@hyperfrontend/project-scope'
873
+ *
874
+ * const config = parseJsonConfig(
875
+ * 'tsconfig.json',
876
+ * '{ "extends": "./base.json", "compilerOptions": {} }',
877
+ * 'typescript'
878
+ * )
879
+ * // => { type: 'typescript', path: 'tsconfig.json', data: {...}, extends: ['./base.json'] }
880
+ * ```
1807
881
  */
1808
882
  function parseJsonConfig(filePath, content, type, format = 'json') {
1809
883
  const cleanContent = format === 'jsonc' ? stripJsonComments(content) : content;
1810
884
  try {
1811
- const data = parse(cleanContent);
885
+ const data = index_cjs_js$6.parse(cleanContent);
1812
886
  let extendsPath;
1813
887
  if (typeof data['extends'] === 'string') {
1814
888
  extendsPath = [data['extends']];
1815
889
  }
1816
- else if (isArray(data['extends'])) {
890
+ else if (index_cjs_js$5.isArray(data['extends'])) {
1817
891
  extendsPath = data['extends'];
1818
892
  }
1819
893
  return {
@@ -1839,6 +913,14 @@ function parseJsonConfig(filePath, content, type, format = 'json') {
1839
913
  * @param content - Raw file content to parse
1840
914
  * @param type - Category of configuration (e.g., github-actions, docker-compose)
1841
915
  * @returns Configuration object with parsed YAML data
916
+ *
917
+ * @example Parsing YAML configuration
918
+ * ```typescript
919
+ * import { parseYamlConfig } from '@hyperfrontend/project-scope'
920
+ *
921
+ * const config = parseYamlConfig('.github/workflows/ci.yml', yamlContent, 'github-actions')
922
+ * // => { type: 'github-actions', path: '...', format: 'yaml', data: {...} }
923
+ * ```
1842
924
  */
1843
925
  function parseYamlConfig(filePath, content, type) {
1844
926
  const data = parseSimpleYaml(content);
@@ -1855,6 +937,14 @@ function parseYamlConfig(filePath, content, type) {
1855
937
  * @param filePath - Path to config file
1856
938
  * @param type - Optional config type (auto-detected if not provided)
1857
939
  * @returns Parsed configuration
940
+ *
941
+ * @example Parsing a configuration file
942
+ * ```typescript
943
+ * import { parseConfig } from '@hyperfrontend/project-scope'
944
+ *
945
+ * const tsConfig = parseConfig('/project/tsconfig.json')
946
+ * const eslintConfig = parseConfig('/project/.eslintrc.yml', 'eslint')
947
+ * ```
1858
948
  */
1859
949
  function parseConfig(filePath, type) {
1860
950
  const content = readFileContent(filePath);
@@ -1899,42 +989,12 @@ function parseConfig(filePath, type) {
1899
989
  };
1900
990
  }
1901
991
  }
1902
- /**
1903
- * Read and parse config file if it exists.
1904
- *
1905
- * @param configPath - Path to config file
1906
- * @returns Parsed config or null if file doesn't exist
1907
- */
1908
- function readConfigIfExists(configPath) {
1909
- const content = readFileIfExists(configPath);
1910
- if (!content)
1911
- return null;
1912
- try {
1913
- const format = detectFormat(configPath);
1914
- switch (format) {
1915
- case 'json':
1916
- return parse(content);
1917
- case 'jsonc':
1918
- return parse(stripJsonComments(content));
1919
- case 'yaml':
1920
- return parseSimpleYaml(content);
1921
- default:
1922
- return null;
1923
- }
1924
- }
1925
- catch {
1926
- return null;
1927
- }
1928
- }
1929
992
 
1930
993
  exports.CONFIG_PATTERNS = CONFIG_PATTERNS;
1931
994
  exports.clearConfigDetectionCache = clearConfigDetectionCache;
1932
995
  exports.detectConfigs = detectConfigs;
1933
996
  exports.findConfigFile = findConfigFile;
1934
- exports.getConfigPaths = getConfigPaths;
1935
997
  exports.getConfigPatternsByType = getConfigPatternsByType;
1936
998
  exports.parseConfig = parseConfig;
1937
999
  exports.parseJsonConfig = parseJsonConfig;
1938
1000
  exports.parseYamlConfig = parseYamlConfig;
1939
- exports.readConfigIfExists = readConfigIfExists;
1940
- //# sourceMappingURL=index.cjs.js.map