@hyperfrontend/project-scope 0.1.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 (391) hide show
  1. package/ARCHITECTURE.md +370 -0
  2. package/CHANGELOG.md +10 -0
  3. package/FUNDING.md +141 -0
  4. package/LICENSE.md +21 -0
  5. package/README.md +242 -0
  6. package/SECURITY.md +82 -0
  7. package/analyze.d.ts +33 -0
  8. package/analyze.d.ts.map +1 -0
  9. package/cli/commands/analyze.d.ts +20 -0
  10. package/cli/commands/analyze.d.ts.map +1 -0
  11. package/cli/commands/config.d.ts +20 -0
  12. package/cli/commands/config.d.ts.map +1 -0
  13. package/cli/commands/deps.d.ts +18 -0
  14. package/cli/commands/deps.d.ts.map +1 -0
  15. package/cli/commands/tree.d.ts +24 -0
  16. package/cli/commands/tree.d.ts.map +1 -0
  17. package/cli/index.cjs.js +6639 -0
  18. package/cli/index.cjs.js.map +1 -0
  19. package/cli/index.d.ts +7 -0
  20. package/cli/index.d.ts.map +1 -0
  21. package/cli/index.esm.js +6629 -0
  22. package/cli/index.esm.js.map +1 -0
  23. package/cli/run.d.ts +25 -0
  24. package/cli/run.d.ts.map +1 -0
  25. package/cli/types.d.ts +55 -0
  26. package/cli/types.d.ts.map +1 -0
  27. package/core/cache.d.ts +157 -0
  28. package/core/cache.d.ts.map +1 -0
  29. package/core/encoding/convert.d.ts +32 -0
  30. package/core/encoding/convert.d.ts.map +1 -0
  31. package/core/encoding/detect.d.ts +86 -0
  32. package/core/encoding/detect.d.ts.map +1 -0
  33. package/core/encoding/index.cjs.js +751 -0
  34. package/core/encoding/index.cjs.js.map +1 -0
  35. package/core/encoding/index.d.ts +3 -0
  36. package/core/encoding/index.d.ts.map +1 -0
  37. package/core/encoding/index.esm.js +736 -0
  38. package/core/encoding/index.esm.js.map +1 -0
  39. package/core/errors/structured-errors.d.ts +64 -0
  40. package/core/errors/structured-errors.d.ts.map +1 -0
  41. package/core/fs/directory.d.ts +88 -0
  42. package/core/fs/directory.d.ts.map +1 -0
  43. package/core/fs/index.cjs.js +1079 -0
  44. package/core/fs/index.cjs.js.map +1 -0
  45. package/core/fs/index.d.ts +6 -0
  46. package/core/fs/index.d.ts.map +1 -0
  47. package/core/fs/index.esm.js +1056 -0
  48. package/core/fs/index.esm.js.map +1 -0
  49. package/core/fs/read.d.ts +86 -0
  50. package/core/fs/read.d.ts.map +1 -0
  51. package/core/fs/stat.d.ts +58 -0
  52. package/core/fs/stat.d.ts.map +1 -0
  53. package/core/fs/traversal.d.ts +26 -0
  54. package/core/fs/traversal.d.ts.map +1 -0
  55. package/core/fs/write.d.ts +75 -0
  56. package/core/fs/write.d.ts.map +1 -0
  57. package/core/index.cjs.js +2376 -0
  58. package/core/index.cjs.js.map +1 -0
  59. package/core/index.d.ts +9 -0
  60. package/core/index.d.ts.map +1 -0
  61. package/core/index.esm.js +2286 -0
  62. package/core/index.esm.js.map +1 -0
  63. package/core/logger.d.ts +111 -0
  64. package/core/logger.d.ts.map +1 -0
  65. package/core/path/index.cjs.js +254 -0
  66. package/core/path/index.cjs.js.map +1 -0
  67. package/core/path/index.d.ts +5 -0
  68. package/core/path/index.d.ts.map +1 -0
  69. package/core/path/index.esm.js +233 -0
  70. package/core/path/index.esm.js.map +1 -0
  71. package/core/path/join.d.ts +17 -0
  72. package/core/path/join.d.ts.map +1 -0
  73. package/core/path/normalize.d.ts +37 -0
  74. package/core/path/normalize.d.ts.map +1 -0
  75. package/core/path/resolve.d.ts +52 -0
  76. package/core/path/resolve.d.ts.map +1 -0
  77. package/core/path/segments.d.ts +59 -0
  78. package/core/path/segments.d.ts.map +1 -0
  79. package/core/patterns/glob.d.ts +46 -0
  80. package/core/patterns/glob.d.ts.map +1 -0
  81. package/core/platform/detect.d.ts +66 -0
  82. package/core/platform/detect.d.ts.map +1 -0
  83. package/core/platform/index.cjs.js +241 -0
  84. package/core/platform/index.cjs.js.map +1 -0
  85. package/core/platform/index.d.ts +3 -0
  86. package/core/platform/index.d.ts.map +1 -0
  87. package/core/platform/index.esm.js +226 -0
  88. package/core/platform/index.esm.js.map +1 -0
  89. package/core/platform/line-endings.d.ts +48 -0
  90. package/core/platform/line-endings.d.ts.map +1 -0
  91. package/heuristics/dependencies/analyze.d.ts +77 -0
  92. package/heuristics/dependencies/analyze.d.ts.map +1 -0
  93. package/heuristics/dependencies/index.cjs.js +1126 -0
  94. package/heuristics/dependencies/index.cjs.js.map +1 -0
  95. package/heuristics/dependencies/index.d.ts +2 -0
  96. package/heuristics/dependencies/index.d.ts.map +1 -0
  97. package/heuristics/dependencies/index.esm.js +1122 -0
  98. package/heuristics/dependencies/index.esm.js.map +1 -0
  99. package/heuristics/entry-points/discover.d.ts +86 -0
  100. package/heuristics/entry-points/discover.d.ts.map +1 -0
  101. package/heuristics/entry-points/index.cjs.js +1581 -0
  102. package/heuristics/entry-points/index.cjs.js.map +1 -0
  103. package/heuristics/entry-points/index.d.ts +2 -0
  104. package/heuristics/entry-points/index.d.ts.map +1 -0
  105. package/heuristics/entry-points/index.esm.js +1577 -0
  106. package/heuristics/entry-points/index.esm.js.map +1 -0
  107. package/heuristics/framework/identify.d.ts +84 -0
  108. package/heuristics/framework/identify.d.ts.map +1 -0
  109. package/heuristics/framework/index.cjs.js +3618 -0
  110. package/heuristics/framework/index.cjs.js.map +1 -0
  111. package/heuristics/framework/index.d.ts +2 -0
  112. package/heuristics/framework/index.d.ts.map +1 -0
  113. package/heuristics/framework/index.esm.js +3614 -0
  114. package/heuristics/framework/index.esm.js.map +1 -0
  115. package/heuristics/index.cjs.js +4833 -0
  116. package/heuristics/index.cjs.js.map +1 -0
  117. package/heuristics/index.d.ts +5 -0
  118. package/heuristics/index.d.ts.map +1 -0
  119. package/heuristics/index.esm.js +4822 -0
  120. package/heuristics/index.esm.js.map +1 -0
  121. package/heuristics/project-type/detect.d.ts +61 -0
  122. package/heuristics/project-type/detect.d.ts.map +1 -0
  123. package/heuristics/project-type/index.cjs.js +3633 -0
  124. package/heuristics/project-type/index.cjs.js.map +1 -0
  125. package/heuristics/project-type/index.d.ts +2 -0
  126. package/heuristics/project-type/index.d.ts.map +1 -0
  127. package/heuristics/project-type/index.esm.js +3631 -0
  128. package/heuristics/project-type/index.esm.js.map +1 -0
  129. package/index.cjs.js +10255 -0
  130. package/index.cjs.js.map +1 -0
  131. package/index.d.ts +10 -0
  132. package/index.d.ts.map +1 -0
  133. package/index.esm.js +10006 -0
  134. package/index.esm.js.map +1 -0
  135. package/models/index.cjs.js +3 -0
  136. package/models/index.cjs.js.map +1 -0
  137. package/models/index.d.ts +176 -0
  138. package/models/index.d.ts.map +1 -0
  139. package/models/index.esm.js +2 -0
  140. package/models/index.esm.js.map +1 -0
  141. package/nx/detect.d.ts +105 -0
  142. package/nx/detect.d.ts.map +1 -0
  143. package/nx/devkit-loader.d.ts +62 -0
  144. package/nx/devkit-loader.d.ts.map +1 -0
  145. package/nx/index.cjs.js +1302 -0
  146. package/nx/index.cjs.js.map +1 -0
  147. package/nx/index.d.ts +4 -0
  148. package/nx/index.d.ts.map +1 -0
  149. package/nx/index.esm.js +1286 -0
  150. package/nx/index.esm.js.map +1 -0
  151. package/nx/project-config.d.ts +109 -0
  152. package/nx/project-config.d.ts.map +1 -0
  153. package/package.json +218 -0
  154. package/project/config/detect.d.ts +77 -0
  155. package/project/config/detect.d.ts.map +1 -0
  156. package/project/config/index.cjs.js +1982 -0
  157. package/project/config/index.cjs.js.map +1 -0
  158. package/project/config/index.d.ts +4 -0
  159. package/project/config/index.d.ts.map +1 -0
  160. package/project/config/index.esm.js +1971 -0
  161. package/project/config/index.esm.js.map +1 -0
  162. package/project/config/parse.d.ts +53 -0
  163. package/project/config/parse.d.ts.map +1 -0
  164. package/project/config/patterns.d.ts +31 -0
  165. package/project/config/patterns.d.ts.map +1 -0
  166. package/project/index.cjs.js +2585 -0
  167. package/project/index.cjs.js.map +1 -0
  168. package/project/index.d.ts +5 -0
  169. package/project/index.d.ts.map +1 -0
  170. package/project/index.esm.js +2549 -0
  171. package/project/index.esm.js.map +1 -0
  172. package/project/package/dependencies.d.ts +101 -0
  173. package/project/package/dependencies.d.ts.map +1 -0
  174. package/project/package/index.cjs.js +972 -0
  175. package/project/package/index.cjs.js.map +1 -0
  176. package/project/package/index.d.ts +3 -0
  177. package/project/package/index.d.ts.map +1 -0
  178. package/project/package/index.esm.js +957 -0
  179. package/project/package/index.esm.js.map +1 -0
  180. package/project/package/read.d.ts +66 -0
  181. package/project/package/read.d.ts.map +1 -0
  182. package/project/root/detect.d.ts +65 -0
  183. package/project/root/detect.d.ts.map +1 -0
  184. package/project/root/index.cjs.js +860 -0
  185. package/project/root/index.cjs.js.map +1 -0
  186. package/project/root/index.d.ts +2 -0
  187. package/project/root/index.d.ts.map +1 -0
  188. package/project/root/index.esm.js +853 -0
  189. package/project/root/index.esm.js.map +1 -0
  190. package/project/traversal/index.cjs.js +1179 -0
  191. package/project/traversal/index.cjs.js.map +1 -0
  192. package/project/traversal/index.d.ts +3 -0
  193. package/project/traversal/index.d.ts.map +1 -0
  194. package/project/traversal/index.esm.js +1173 -0
  195. package/project/traversal/index.esm.js.map +1 -0
  196. package/project/traversal/search.d.ts +59 -0
  197. package/project/traversal/search.d.ts.map +1 -0
  198. package/project/traversal/walk.d.ts +63 -0
  199. package/project/traversal/walk.d.ts.map +1 -0
  200. package/tech/backend/detect-all.d.ts +13 -0
  201. package/tech/backend/detect-all.d.ts.map +1 -0
  202. package/tech/backend/express.d.ts +11 -0
  203. package/tech/backend/express.d.ts.map +1 -0
  204. package/tech/backend/fastify.d.ts +11 -0
  205. package/tech/backend/fastify.d.ts.map +1 -0
  206. package/tech/backend/hono.d.ts +11 -0
  207. package/tech/backend/hono.d.ts.map +1 -0
  208. package/tech/backend/index.cjs.js +939 -0
  209. package/tech/backend/index.cjs.js.map +1 -0
  210. package/tech/backend/index.d.ts +8 -0
  211. package/tech/backend/index.d.ts.map +1 -0
  212. package/tech/backend/index.esm.js +931 -0
  213. package/tech/backend/index.esm.js.map +1 -0
  214. package/tech/backend/koa.d.ts +11 -0
  215. package/tech/backend/koa.d.ts.map +1 -0
  216. package/tech/backend/nestjs.d.ts +11 -0
  217. package/tech/backend/nestjs.d.ts.map +1 -0
  218. package/tech/backend/types.d.ts +31 -0
  219. package/tech/backend/types.d.ts.map +1 -0
  220. package/tech/build/babel.d.ts +13 -0
  221. package/tech/build/babel.d.ts.map +1 -0
  222. package/tech/build/detect-all.d.ts +13 -0
  223. package/tech/build/detect-all.d.ts.map +1 -0
  224. package/tech/build/esbuild.d.ts +11 -0
  225. package/tech/build/esbuild.d.ts.map +1 -0
  226. package/tech/build/index.cjs.js +1118 -0
  227. package/tech/build/index.cjs.js.map +1 -0
  228. package/tech/build/index.d.ts +10 -0
  229. package/tech/build/index.d.ts.map +1 -0
  230. package/tech/build/index.esm.js +1102 -0
  231. package/tech/build/index.esm.js.map +1 -0
  232. package/tech/build/parcel.d.ts +13 -0
  233. package/tech/build/parcel.d.ts.map +1 -0
  234. package/tech/build/rollup.d.ts +13 -0
  235. package/tech/build/rollup.d.ts.map +1 -0
  236. package/tech/build/swc.d.ts +13 -0
  237. package/tech/build/swc.d.ts.map +1 -0
  238. package/tech/build/types.d.ts +31 -0
  239. package/tech/build/types.d.ts.map +1 -0
  240. package/tech/build/vite.d.ts +13 -0
  241. package/tech/build/vite.d.ts.map +1 -0
  242. package/tech/build/webpack.d.ts +13 -0
  243. package/tech/build/webpack.d.ts.map +1 -0
  244. package/tech/frontend/angular.d.ts +11 -0
  245. package/tech/frontend/angular.d.ts.map +1 -0
  246. package/tech/frontend/astro.d.ts +11 -0
  247. package/tech/frontend/astro.d.ts.map +1 -0
  248. package/tech/frontend/detect-all.d.ts +13 -0
  249. package/tech/frontend/detect-all.d.ts.map +1 -0
  250. package/tech/frontend/gatsby.d.ts +11 -0
  251. package/tech/frontend/gatsby.d.ts.map +1 -0
  252. package/tech/frontend/index.cjs.js +1310 -0
  253. package/tech/frontend/index.cjs.js.map +1 -0
  254. package/tech/frontend/index.d.ts +15 -0
  255. package/tech/frontend/index.d.ts.map +1 -0
  256. package/tech/frontend/index.esm.js +1295 -0
  257. package/tech/frontend/index.esm.js.map +1 -0
  258. package/tech/frontend/nextjs.d.ts +11 -0
  259. package/tech/frontend/nextjs.d.ts.map +1 -0
  260. package/tech/frontend/nuxt.d.ts +11 -0
  261. package/tech/frontend/nuxt.d.ts.map +1 -0
  262. package/tech/frontend/qwik.d.ts +11 -0
  263. package/tech/frontend/qwik.d.ts.map +1 -0
  264. package/tech/frontend/react.d.ts +11 -0
  265. package/tech/frontend/react.d.ts.map +1 -0
  266. package/tech/frontend/remix.d.ts +11 -0
  267. package/tech/frontend/remix.d.ts.map +1 -0
  268. package/tech/frontend/solid.d.ts +11 -0
  269. package/tech/frontend/solid.d.ts.map +1 -0
  270. package/tech/frontend/svelte.d.ts +11 -0
  271. package/tech/frontend/svelte.d.ts.map +1 -0
  272. package/tech/frontend/sveltekit.d.ts +11 -0
  273. package/tech/frontend/sveltekit.d.ts.map +1 -0
  274. package/tech/frontend/types.d.ts +35 -0
  275. package/tech/frontend/types.d.ts.map +1 -0
  276. package/tech/frontend/vue.d.ts +11 -0
  277. package/tech/frontend/vue.d.ts.map +1 -0
  278. package/tech/index.cjs.js +3684 -0
  279. package/tech/index.cjs.js.map +1 -0
  280. package/tech/index.d.ts +96 -0
  281. package/tech/index.d.ts.map +1 -0
  282. package/tech/index.esm.js +3603 -0
  283. package/tech/index.esm.js.map +1 -0
  284. package/tech/legacy/angularjs.d.ts +12 -0
  285. package/tech/legacy/angularjs.d.ts.map +1 -0
  286. package/tech/legacy/backbone.d.ts +11 -0
  287. package/tech/legacy/backbone.d.ts.map +1 -0
  288. package/tech/legacy/detect-all.d.ts +13 -0
  289. package/tech/legacy/detect-all.d.ts.map +1 -0
  290. package/tech/legacy/ember.d.ts +11 -0
  291. package/tech/legacy/ember.d.ts.map +1 -0
  292. package/tech/legacy/index.cjs.js +903 -0
  293. package/tech/legacy/index.cjs.js.map +1 -0
  294. package/tech/legacy/index.d.ts +7 -0
  295. package/tech/legacy/index.d.ts.map +1 -0
  296. package/tech/legacy/index.esm.js +896 -0
  297. package/tech/legacy/index.esm.js.map +1 -0
  298. package/tech/legacy/jquery.d.ts +11 -0
  299. package/tech/legacy/jquery.d.ts.map +1 -0
  300. package/tech/legacy/types.d.ts +33 -0
  301. package/tech/legacy/types.d.ts.map +1 -0
  302. package/tech/linting/biome.d.ts +11 -0
  303. package/tech/linting/biome.d.ts.map +1 -0
  304. package/tech/linting/detect-all.d.ts +13 -0
  305. package/tech/linting/detect-all.d.ts.map +1 -0
  306. package/tech/linting/eslint.d.ts +13 -0
  307. package/tech/linting/eslint.d.ts.map +1 -0
  308. package/tech/linting/index.cjs.js +992 -0
  309. package/tech/linting/index.cjs.js.map +1 -0
  310. package/tech/linting/index.d.ts +7 -0
  311. package/tech/linting/index.d.ts.map +1 -0
  312. package/tech/linting/index.esm.js +982 -0
  313. package/tech/linting/index.esm.js.map +1 -0
  314. package/tech/linting/prettier.d.ts +13 -0
  315. package/tech/linting/prettier.d.ts.map +1 -0
  316. package/tech/linting/stylelint.d.ts +13 -0
  317. package/tech/linting/stylelint.d.ts.map +1 -0
  318. package/tech/linting/types.d.ts +31 -0
  319. package/tech/linting/types.d.ts.map +1 -0
  320. package/tech/monorepo/detect-all.d.ts +13 -0
  321. package/tech/monorepo/detect-all.d.ts.map +1 -0
  322. package/tech/monorepo/index.cjs.js +1021 -0
  323. package/tech/monorepo/index.cjs.js.map +1 -0
  324. package/tech/monorepo/index.d.ts +10 -0
  325. package/tech/monorepo/index.d.ts.map +1 -0
  326. package/tech/monorepo/index.esm.js +1011 -0
  327. package/tech/monorepo/index.esm.js.map +1 -0
  328. package/tech/monorepo/lerna.d.ts +11 -0
  329. package/tech/monorepo/lerna.d.ts.map +1 -0
  330. package/tech/monorepo/npm-workspaces.d.ts +11 -0
  331. package/tech/monorepo/npm-workspaces.d.ts.map +1 -0
  332. package/tech/monorepo/nx.d.ts +11 -0
  333. package/tech/monorepo/nx.d.ts.map +1 -0
  334. package/tech/monorepo/pnpm-workspaces.d.ts +9 -0
  335. package/tech/monorepo/pnpm-workspaces.d.ts.map +1 -0
  336. package/tech/monorepo/rush.d.ts +11 -0
  337. package/tech/monorepo/rush.d.ts.map +1 -0
  338. package/tech/monorepo/turborepo.d.ts +11 -0
  339. package/tech/monorepo/turborepo.d.ts.map +1 -0
  340. package/tech/monorepo/types.d.ts +39 -0
  341. package/tech/monorepo/types.d.ts.map +1 -0
  342. package/tech/monorepo/yarn-workspaces.d.ts +11 -0
  343. package/tech/monorepo/yarn-workspaces.d.ts.map +1 -0
  344. package/tech/shared-utils/detector-helpers.d.ts +52 -0
  345. package/tech/shared-utils/detector-helpers.d.ts.map +1 -0
  346. package/tech/shared-utils/types.d.ts +41 -0
  347. package/tech/shared-utils/types.d.ts.map +1 -0
  348. package/tech/testing/cypress.d.ts +13 -0
  349. package/tech/testing/cypress.d.ts.map +1 -0
  350. package/tech/testing/detect-all.d.ts +13 -0
  351. package/tech/testing/detect-all.d.ts.map +1 -0
  352. package/tech/testing/index.cjs.js +1031 -0
  353. package/tech/testing/index.cjs.js.map +1 -0
  354. package/tech/testing/index.d.ts +8 -0
  355. package/tech/testing/index.d.ts.map +1 -0
  356. package/tech/testing/index.esm.js +1018 -0
  357. package/tech/testing/index.esm.js.map +1 -0
  358. package/tech/testing/jest.d.ts +13 -0
  359. package/tech/testing/jest.d.ts.map +1 -0
  360. package/tech/testing/mocha.d.ts +13 -0
  361. package/tech/testing/mocha.d.ts.map +1 -0
  362. package/tech/testing/playwright.d.ts +13 -0
  363. package/tech/testing/playwright.d.ts.map +1 -0
  364. package/tech/testing/types.d.ts +35 -0
  365. package/tech/testing/types.d.ts.map +1 -0
  366. package/tech/testing/vitest.d.ts +13 -0
  367. package/tech/testing/vitest.d.ts.map +1 -0
  368. package/tech/types/detectors.d.ts +67 -0
  369. package/tech/types/detectors.d.ts.map +1 -0
  370. package/tech/types/index.cjs.js +1045 -0
  371. package/tech/types/index.cjs.js.map +1 -0
  372. package/tech/types/index.d.ts +2 -0
  373. package/tech/types/index.d.ts.map +1 -0
  374. package/tech/types/index.esm.js +1039 -0
  375. package/tech/types/index.esm.js.map +1 -0
  376. package/vfs/commit.d.ts +32 -0
  377. package/vfs/commit.d.ts.map +1 -0
  378. package/vfs/diff.d.ts +73 -0
  379. package/vfs/diff.d.ts.map +1 -0
  380. package/vfs/factory.d.ts +37 -0
  381. package/vfs/factory.d.ts.map +1 -0
  382. package/vfs/fs-tree.d.ts +13 -0
  383. package/vfs/fs-tree.d.ts.map +1 -0
  384. package/vfs/index.cjs.js +1600 -0
  385. package/vfs/index.cjs.js.map +1 -0
  386. package/vfs/index.d.ts +6 -0
  387. package/vfs/index.d.ts.map +1 -0
  388. package/vfs/index.esm.js +1590 -0
  389. package/vfs/index.esm.js.map +1 -0
  390. package/vfs/types.d.ts +178 -0
  391. package/vfs/types.d.ts.map +1 -0
@@ -0,0 +1,1286 @@
1
+ import { join as join$1, resolve, parse as parse$1, dirname, basename, relative } from 'node:path';
2
+ import { existsSync, readFileSync, statSync, lstatSync, readdirSync } from 'node:fs';
3
+
4
+ /**
5
+ * Safe copies of Error built-ins via factory functions.
6
+ *
7
+ * Since constructors cannot be safely captured via Object.assign, this module
8
+ * provides factory functions that use Reflect.construct internally.
9
+ *
10
+ * These references are captured at module initialization time to protect against
11
+ * prototype pollution attacks. Import only what you need for tree-shaking.
12
+ *
13
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/error
14
+ */
15
+ // Capture references at module initialization time
16
+ const _Error = globalThis.Error;
17
+ const _Reflect$2 = globalThis.Reflect;
18
+ /**
19
+ * (Safe copy) Creates a new Error using the captured Error constructor.
20
+ * Use this instead of `new Error()`.
21
+ *
22
+ * @param message - Optional error message.
23
+ * @param options - Optional error options.
24
+ * @returns A new Error instance.
25
+ */
26
+ const createError = (message, options) => _Reflect$2.construct(_Error, [message, options]);
27
+
28
+ /**
29
+ * Safe copies of JSON built-in methods.
30
+ *
31
+ * These references are captured at module initialization time to protect against
32
+ * prototype pollution attacks. Import only what you need for tree-shaking.
33
+ *
34
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/json
35
+ */
36
+ // Capture references at module initialization time
37
+ const _JSON = globalThis.JSON;
38
+ /**
39
+ * (Safe copy) Converts a JavaScript Object Notation (JSON) string into an object.
40
+ */
41
+ const parse = _JSON.parse;
42
+ /**
43
+ * (Safe copy) Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
44
+ */
45
+ const stringify = _JSON.stringify;
46
+
47
+ /**
48
+ * Safe copies of Object built-in methods.
49
+ *
50
+ * These references are captured at module initialization time to protect against
51
+ * prototype pollution attacks. Import only what you need for tree-shaking.
52
+ *
53
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/object
54
+ */
55
+ // Capture references at module initialization time
56
+ const _Object = globalThis.Object;
57
+ /**
58
+ * (Safe copy) Prevents modification of existing property attributes and values,
59
+ * and prevents the addition of new properties.
60
+ */
61
+ const freeze = _Object.freeze;
62
+ /**
63
+ * (Safe copy) Returns the names of the enumerable string properties and methods of an object.
64
+ */
65
+ const keys = _Object.keys;
66
+ /**
67
+ * (Safe copy) Returns an array of key/values of the enumerable own properties of an object.
68
+ */
69
+ const entries = _Object.entries;
70
+ /**
71
+ * (Safe copy) Returns an array of values of the enumerable own properties of an object.
72
+ */
73
+ const values = _Object.values;
74
+ /**
75
+ * (Safe copy) Adds one or more properties to an object, and/or modifies attributes of existing properties.
76
+ */
77
+ const defineProperties = _Object.defineProperties;
78
+
79
+ /**
80
+ * Safe copies of Array built-in static methods.
81
+ *
82
+ * These references are captured at module initialization time to protect against
83
+ * prototype pollution attacks. Import only what you need for tree-shaking.
84
+ *
85
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/array
86
+ */
87
+ // Capture references at module initialization time
88
+ const _Array = globalThis.Array;
89
+ /**
90
+ * (Safe copy) Determines whether the passed value is an Array.
91
+ */
92
+ const isArray = _Array.isArray;
93
+
94
+ /**
95
+ * Safe copies of Console built-in methods.
96
+ *
97
+ * These references are captured at module initialization time to protect against
98
+ * prototype pollution attacks. Import only what you need for tree-shaking.
99
+ *
100
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/console
101
+ */
102
+ // Capture references at module initialization time
103
+ const _console = globalThis.console;
104
+ /**
105
+ * (Safe copy) Outputs a message to the console.
106
+ */
107
+ const log = _console.log.bind(_console);
108
+ /**
109
+ * (Safe copy) Outputs a warning message to the console.
110
+ */
111
+ const warn = _console.warn.bind(_console);
112
+ /**
113
+ * (Safe copy) Outputs an error message to the console.
114
+ */
115
+ const error = _console.error.bind(_console);
116
+ /**
117
+ * (Safe copy) Outputs an informational message to the console.
118
+ */
119
+ const info = _console.info.bind(_console);
120
+ /**
121
+ * (Safe copy) Outputs a debug message to the console.
122
+ */
123
+ const debug = _console.debug.bind(_console);
124
+ /**
125
+ * (Safe copy) Outputs a stack trace to the console.
126
+ */
127
+ _console.trace.bind(_console);
128
+ /**
129
+ * (Safe copy) Displays an interactive listing of the properties of a specified object.
130
+ */
131
+ _console.dir.bind(_console);
132
+ /**
133
+ * (Safe copy) Displays tabular data as a table.
134
+ */
135
+ _console.table.bind(_console);
136
+ /**
137
+ * (Safe copy) Writes an error message to the console if the assertion is false.
138
+ */
139
+ _console.assert.bind(_console);
140
+ /**
141
+ * (Safe copy) Clears the console.
142
+ */
143
+ _console.clear.bind(_console);
144
+ /**
145
+ * (Safe copy) Logs the number of times that this particular call to count() has been called.
146
+ */
147
+ _console.count.bind(_console);
148
+ /**
149
+ * (Safe copy) Resets the counter used with console.count().
150
+ */
151
+ _console.countReset.bind(_console);
152
+ /**
153
+ * (Safe copy) Creates a new inline group in the console.
154
+ */
155
+ _console.group.bind(_console);
156
+ /**
157
+ * (Safe copy) Creates a new inline group in the console that is initially collapsed.
158
+ */
159
+ _console.groupCollapsed.bind(_console);
160
+ /**
161
+ * (Safe copy) Exits the current inline group.
162
+ */
163
+ _console.groupEnd.bind(_console);
164
+ /**
165
+ * (Safe copy) Starts a timer with a name specified as an input parameter.
166
+ */
167
+ _console.time.bind(_console);
168
+ /**
169
+ * (Safe copy) Stops a timer that was previously started.
170
+ */
171
+ _console.timeEnd.bind(_console);
172
+ /**
173
+ * (Safe copy) Logs the current value of a timer that was previously started.
174
+ */
175
+ _console.timeLog.bind(_console);
176
+
177
+ /**
178
+ * Safe copies of Set built-in via factory function.
179
+ *
180
+ * Since constructors cannot be safely captured via Object.assign, this module
181
+ * provides a factory function that uses Reflect.construct internally.
182
+ *
183
+ * These references are captured at module initialization time to protect against
184
+ * prototype pollution attacks. Import only what you need for tree-shaking.
185
+ *
186
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/set
187
+ */
188
+ // Capture references at module initialization time
189
+ const _Set = globalThis.Set;
190
+ const _Reflect$1 = globalThis.Reflect;
191
+ /**
192
+ * (Safe copy) Creates a new Set using the captured Set constructor.
193
+ * Use this instead of `new Set()`.
194
+ *
195
+ * @param iterable - Optional iterable of values.
196
+ * @returns A new Set instance.
197
+ */
198
+ const createSet = (iterable) => _Reflect$1.construct(_Set, iterable ? [iterable] : []);
199
+
200
+ const registeredClasses = [];
201
+
202
+ /**
203
+ * Returns the data type of the target.
204
+ * Uses native `typeof` operator, however, makes distinction between `null`, `array`, and `object`.
205
+ * Also, when classes are registered via `registerClass`, it checks if objects are instance of any known registered class.
206
+ *
207
+ * @param target - The target to get the data type of.
208
+ * @returns The data type of the target.
209
+ */
210
+ const getType = (target) => {
211
+ if (target === null)
212
+ return 'null';
213
+ const nativeDataType = typeof target;
214
+ if (nativeDataType === 'object') {
215
+ if (isArray(target))
216
+ return 'array';
217
+ for (const registeredClass of registeredClasses) {
218
+ if (target instanceof registeredClass)
219
+ return registeredClass.name;
220
+ }
221
+ }
222
+ return nativeDataType;
223
+ };
224
+
225
+ /**
226
+ * Safe copies of Map built-in via factory function.
227
+ *
228
+ * Since constructors cannot be safely captured via Object.assign, this module
229
+ * provides a factory function that uses Reflect.construct internally.
230
+ *
231
+ * These references are captured at module initialization time to protect against
232
+ * prototype pollution attacks. Import only what you need for tree-shaking.
233
+ *
234
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/map
235
+ */
236
+ // Capture references at module initialization time
237
+ const _Map = globalThis.Map;
238
+ const _Reflect = globalThis.Reflect;
239
+ /**
240
+ * (Safe copy) Creates a new Map using the captured Map constructor.
241
+ * Use this instead of `new Map()`.
242
+ *
243
+ * @param iterable - Optional iterable of key-value pairs.
244
+ * @returns A new Map instance.
245
+ */
246
+ const createMap = (iterable) => _Reflect.construct(_Map, iterable ? [iterable] : []);
247
+
248
+ /* eslint-disable @typescript-eslint/no-explicit-any */
249
+ /**
250
+ * Creates a wrapper function that only executes the wrapped function if the condition function returns true.
251
+ *
252
+ * @param func - The function to be conditionally executed.
253
+ * @param conditionFunc - A function that returns a boolean, determining if `func` should be executed.
254
+ * @returns A wrapped version of `func` that executes conditionally.
255
+ */
256
+ function createConditionalExecutionFunction(func, conditionFunc) {
257
+ return function (...args) {
258
+ if (conditionFunc()) {
259
+ return func(...args);
260
+ }
261
+ };
262
+ }
263
+
264
+ /* eslint-disable @typescript-eslint/no-explicit-any */
265
+ /**
266
+ * Creates a wrapper function that silently ignores any errors thrown by the wrapped void function.
267
+ * This function is specifically for wrapping functions that do not return a value (void functions).
268
+ * Exceptions are swallowed without any logging or handling.
269
+ *
270
+ * @param func - The void function to be wrapped.
271
+ * @returns A wrapped version of the input function that ignores errors.
272
+ */
273
+ function createErrorIgnoringFunction(func) {
274
+ return function (...args) {
275
+ try {
276
+ func(...args);
277
+ }
278
+ catch {
279
+ // Deliberately swallowing/ignoring the exception
280
+ }
281
+ };
282
+ }
283
+
284
+ /* eslint-disable @typescript-eslint/no-unused-vars */
285
+ /**
286
+ * A no-operation function (noop) that does nothing regardless of the arguments passed.
287
+ * It is designed to be as permissive as possible in its typing without using the `Function` keyword.
288
+ *
289
+ * @param args - Any arguments passed to the function (ignored)
290
+ */
291
+ const noop = (...args) => {
292
+ // Intentionally does nothing
293
+ };
294
+
295
+ const logLevels = ['none', 'error', 'warn', 'log', 'info', 'debug'];
296
+ const priority = {
297
+ error: 4,
298
+ warn: 3,
299
+ log: 2,
300
+ info: 1,
301
+ debug: 0,
302
+ };
303
+ /**
304
+ * Validates whether a given string is a valid log level.
305
+ *
306
+ * @param level - The log level to validate
307
+ * @returns True if the level is valid, false otherwise
308
+ */
309
+ function isValidLogLevel(level) {
310
+ return logLevels.includes(level);
311
+ }
312
+ /**
313
+ * Creates a log level configuration manager for controlling logging behavior.
314
+ * Provides methods to get, set, and evaluate log levels based on priority.
315
+ *
316
+ * @param level - The initial log level (defaults to 'error')
317
+ * @returns A configuration object with log level management methods
318
+ * @throws {Error} When the provided level is not a valid log level
319
+ */
320
+ function createLogLevelConfig(level = 'error') {
321
+ if (!isValidLogLevel(level)) {
322
+ throw createError('Cannot create log level configuration with a valid default log level');
323
+ }
324
+ const state = { level };
325
+ const getLogLevel = () => state.level;
326
+ const setLogLevel = (level) => {
327
+ if (!isValidLogLevel(level)) {
328
+ throw createError(`Cannot set value '${level}' level. Expected levels are ${logLevels}.`);
329
+ }
330
+ state.level = level;
331
+ };
332
+ const shouldLog = (level) => {
333
+ if (state.level === 'none' || level === 'none' || !isValidLogLevel(level)) {
334
+ return false;
335
+ }
336
+ return priority[level] >= priority[state.level];
337
+ };
338
+ return freeze({
339
+ getLogLevel,
340
+ setLogLevel,
341
+ shouldLog,
342
+ });
343
+ }
344
+
345
+ /**
346
+ * Creates a logger instance with configurable log level filtering.
347
+ * Each log function is wrapped to respect the current log level setting.
348
+ *
349
+ * @param error - Function to handle error-level logs (required)
350
+ * @param warn - Function to handle warning-level logs (optional, defaults to noop)
351
+ * @param log - Function to handle standard logs (optional, defaults to noop)
352
+ * @param info - Function to handle info-level logs (optional, defaults to noop)
353
+ * @param debug - Function to handle debug-level logs (optional, defaults to noop)
354
+ * @returns A frozen logger object with log methods and level control
355
+ * @throws {ErrorLevelFn} When any provided log function is invalid
356
+ */
357
+ function createLogger(error, warn = noop, log = noop, info = noop, debug = noop) {
358
+ if (notValidLogFn(error)) {
359
+ throw createError(notFnMsg('error'));
360
+ }
361
+ if (notValidLogFn(warn)) {
362
+ throw createError(notFnMsg('warn'));
363
+ }
364
+ if (notValidLogFn(log)) {
365
+ throw createError(notFnMsg('log'));
366
+ }
367
+ if (notValidLogFn(info)) {
368
+ throw createError(notFnMsg('info'));
369
+ }
370
+ if (notValidLogFn(debug)) {
371
+ throw createError(notFnMsg('debug'));
372
+ }
373
+ const { setLogLevel, getLogLevel, shouldLog } = createLogLevelConfig();
374
+ const wrapLogFn = (fn, level) => {
375
+ if (fn === noop)
376
+ return fn;
377
+ const condition = () => shouldLog(level);
378
+ return createConditionalExecutionFunction(createErrorIgnoringFunction(fn), condition);
379
+ };
380
+ return freeze({
381
+ error: wrapLogFn(error, 'error'),
382
+ warn: wrapLogFn(warn, 'warn'),
383
+ log: wrapLogFn(log, 'log'),
384
+ info: wrapLogFn(info, 'info'),
385
+ debug: wrapLogFn(debug, 'debug'),
386
+ setLogLevel,
387
+ getLogLevel,
388
+ });
389
+ }
390
+ /**
391
+ * Validates whether a given value is a valid log function.
392
+ *
393
+ * @param fn - The value to validate
394
+ * @returns True if the value is not a function (invalid), false if it is valid
395
+ */
396
+ function notValidLogFn(fn) {
397
+ return getType(fn) !== 'function' && fn !== noop;
398
+ }
399
+ /**
400
+ * Generates an error message for invalid log function parameters.
401
+ *
402
+ * @param label - The name of the log function that failed validation
403
+ * @returns A formatted error message string
404
+ */
405
+ function notFnMsg(label) {
406
+ return `Cannot create a logger when ${label} is not a function`;
407
+ }
408
+
409
+ createLogger(error, warn, log, info, debug);
410
+
411
+ /**
412
+ * Global log level registry.
413
+ * Tracks all created scoped loggers to allow global log level changes.
414
+ */
415
+ const loggerRegistry = createSet();
416
+ /** Redacted placeholder for sensitive values */
417
+ const REDACTED = '[REDACTED]';
418
+ /**
419
+ * Patterns that indicate a sensitive key name.
420
+ * Keys containing these patterns will have their values sanitized.
421
+ */
422
+ const SENSITIVE_KEY_PATTERNS = [
423
+ /token/i,
424
+ /key/i,
425
+ /password/i,
426
+ /secret/i,
427
+ /credential/i,
428
+ /auth/i,
429
+ /bearer/i,
430
+ /api[_-]?key/i,
431
+ /private/i,
432
+ /passphrase/i,
433
+ ];
434
+ /**
435
+ * Checks if a key name indicates sensitive data.
436
+ *
437
+ * @param key - Key name to check
438
+ * @returns True if the key indicates sensitive data
439
+ */
440
+ function isSensitiveKey(key) {
441
+ return SENSITIVE_KEY_PATTERNS.some((pattern) => pattern.test(key));
442
+ }
443
+ /**
444
+ * Sanitizes an object by replacing sensitive values with REDACTED.
445
+ * This function recursively processes nested objects and arrays.
446
+ *
447
+ * @param obj - Object to sanitize
448
+ * @returns New object with sensitive values redacted
449
+ */
450
+ function sanitize(obj) {
451
+ if (obj === null || obj === undefined) {
452
+ return obj;
453
+ }
454
+ if (isArray(obj)) {
455
+ return obj.map((item) => sanitize(item));
456
+ }
457
+ if (typeof obj === 'object') {
458
+ const result = {};
459
+ for (const [key, value] of entries(obj)) {
460
+ if (isSensitiveKey(key)) {
461
+ result[key] = REDACTED;
462
+ }
463
+ else if (typeof value === 'object' && value !== null) {
464
+ result[key] = sanitize(value);
465
+ }
466
+ else {
467
+ result[key] = value;
468
+ }
469
+ }
470
+ return result;
471
+ }
472
+ return obj;
473
+ }
474
+ /**
475
+ * Formats a log message with optional metadata.
476
+ *
477
+ * @param namespace - Logger namespace prefix
478
+ * @param message - Log message
479
+ * @param meta - Optional metadata object
480
+ * @returns Formatted log string
481
+ */
482
+ function formatMessage(namespace, message, meta) {
483
+ const prefix = `[${namespace}]`;
484
+ if (meta && keys(meta).length > 0) {
485
+ const sanitizedMeta = sanitize(meta);
486
+ return `${prefix} ${message} ${stringify(sanitizedMeta)}`;
487
+ }
488
+ return `${prefix} ${message}`;
489
+ }
490
+ /**
491
+ * Creates a scoped logger with namespace prefix and optional secret sanitization.
492
+ * All log messages will be prefixed with [namespace] and sensitive metadata
493
+ * values will be automatically redacted.
494
+ *
495
+ * @param namespace - Logger namespace (e.g., 'project-scope', 'analyze')
496
+ * @param options - Logger configuration options
497
+ * @returns A configured scoped logger instance
498
+ *
499
+ * @example
500
+ * ```typescript
501
+ * const logger = createScopedLogger('project-scope')
502
+ * logger.setLogLevel('debug')
503
+ *
504
+ * // Basic logging
505
+ * logger.info('Starting analysis', { path: './project' })
506
+ *
507
+ * // Sensitive data is automatically redacted
508
+ * logger.debug('Config loaded', { apiKey: 'secret123' })
509
+ * // Output: [project-scope] Config loaded {"apiKey":"[REDACTED]"}
510
+ * ```
511
+ */
512
+ function createScopedLogger(namespace, options = {}) {
513
+ const { level = 'error', sanitizeSecrets = true } = options;
514
+ // Create wrapper functions that add namespace prefix and sanitization
515
+ const createLogFn = (baseFn) => (message, meta) => {
516
+ const processedMeta = sanitizeSecrets && meta ? sanitize(meta) : meta;
517
+ baseFn(formatMessage(namespace, message, processedMeta));
518
+ };
519
+ // Create base logger with wrapped functions
520
+ const baseLogger = createLogger(createLogFn(error), createLogFn(warn), createLogFn(log), createLogFn(info), createLogFn(debug));
521
+ // Set initial log level (use global override if set)
522
+ baseLogger.setLogLevel(level);
523
+ const scopedLogger = freeze({
524
+ error: (message, meta) => baseLogger.error(message, meta),
525
+ warn: (message, meta) => baseLogger.warn(message, meta),
526
+ log: (message, meta) => baseLogger.log(message, meta),
527
+ info: (message, meta) => baseLogger.info(message, meta),
528
+ debug: (message, meta) => baseLogger.debug(message, meta),
529
+ setLogLevel: baseLogger.setLogLevel,
530
+ getLogLevel: baseLogger.getLogLevel,
531
+ });
532
+ // Register logger for global level management
533
+ loggerRegistry.add(scopedLogger);
534
+ return scopedLogger;
535
+ }
536
+ /**
537
+ * Default logger instance for the project-scope library.
538
+ * Use this for general logging within the library.
539
+ *
540
+ * @example
541
+ * ```typescript
542
+ * import { logger } from '@hyperfrontend/project-scope/core'
543
+ *
544
+ * logger.setLogLevel('debug')
545
+ * logger.debug('Analyzing project', { path: './src' })
546
+ * ```
547
+ */
548
+ createScopedLogger('project-scope');
549
+
550
+ createScopedLogger('project-scope:fs');
551
+ /**
552
+ * Create a file system error with code and context.
553
+ *
554
+ * @param message - The error message describing what went wrong
555
+ * @param code - The category code for this type of filesystem failure
556
+ * @param context - Additional context including path, operation, and cause
557
+ * @returns A configured Error object with code and context properties
558
+ */
559
+ function createFileSystemError(message, code, context) {
560
+ const error = createError(message);
561
+ defineProperties(error, {
562
+ code: { value: code, enumerable: true },
563
+ context: { value: context, enumerable: true },
564
+ });
565
+ return error;
566
+ }
567
+ /**
568
+ * Read file if exists, return null otherwise.
569
+ *
570
+ * @param filePath - Path to file
571
+ * @param encoding - File encoding (default: utf-8)
572
+ * @returns File contents or null if file doesn't exist
573
+ */
574
+ function readFileIfExists(filePath, encoding = 'utf-8') {
575
+ if (!existsSync(filePath)) {
576
+ return null;
577
+ }
578
+ try {
579
+ return readFileSync(filePath, { encoding });
580
+ }
581
+ catch {
582
+ return null;
583
+ }
584
+ }
585
+ /**
586
+ * Read and parse JSON file if exists, return null otherwise.
587
+ *
588
+ * @param filePath - Path to JSON file
589
+ * @returns Parsed JSON object or null if file doesn't exist or is invalid
590
+ */
591
+ function readJsonFileIfExists(filePath) {
592
+ if (!existsSync(filePath)) {
593
+ return null;
594
+ }
595
+ try {
596
+ const content = readFileSync(filePath, { encoding: 'utf-8' });
597
+ return parse(content);
598
+ }
599
+ catch {
600
+ return null;
601
+ }
602
+ }
603
+
604
+ createScopedLogger('project-scope:fs:write');
605
+
606
+ /**
607
+ * Get file stats with error handling.
608
+ *
609
+ * @param filePath - Path to file
610
+ * @param followSymlinks - Whether to follow symlinks (default: true)
611
+ * @returns File stats or null if path doesn't exist
612
+ */
613
+ function getFileStat(filePath, followSymlinks = true) {
614
+ if (!existsSync(filePath)) {
615
+ return null;
616
+ }
617
+ try {
618
+ const stat = followSymlinks ? statSync(filePath) : lstatSync(filePath);
619
+ return {
620
+ isFile: stat.isFile(),
621
+ isDirectory: stat.isDirectory(),
622
+ isSymlink: stat.isSymbolicLink(),
623
+ size: stat.size,
624
+ created: stat.birthtime,
625
+ modified: stat.mtime,
626
+ accessed: stat.atime,
627
+ mode: stat.mode,
628
+ };
629
+ }
630
+ catch {
631
+ return null;
632
+ }
633
+ }
634
+ /**
635
+ * Check if path is a directory.
636
+ *
637
+ * @param dirPath - Path to check
638
+ * @returns True if path is a directory
639
+ */
640
+ function isDirectory(dirPath) {
641
+ const stats = getFileStat(dirPath);
642
+ return stats?.isDirectory ?? false;
643
+ }
644
+ /**
645
+ * Check if path exists.
646
+ *
647
+ * @param filePath - Path to check
648
+ * @returns True if path exists
649
+ */
650
+ function exists(filePath) {
651
+ return existsSync(filePath);
652
+ }
653
+
654
+ const fsDirLogger = createScopedLogger('project-scope:fs:dir');
655
+ /**
656
+ * List immediate contents of a directory.
657
+ *
658
+ * @param dirPath - Absolute or relative path to the directory
659
+ * @returns Array of entries with metadata for each file/directory
660
+ * @throws {Error} If directory doesn't exist or isn't a directory
661
+ *
662
+ * @example
663
+ * ```typescript
664
+ * import { readDirectory } from '@hyperfrontend/project-scope'
665
+ *
666
+ * const entries = readDirectory('./src')
667
+ * for (const entry of entries) {
668
+ * console.log(entry.name, entry.isFile ? 'file' : 'directory')
669
+ * }
670
+ * ```
671
+ */
672
+ function readDirectory(dirPath) {
673
+ fsDirLogger.debug('Reading directory', { path: dirPath });
674
+ if (!existsSync(dirPath)) {
675
+ fsDirLogger.debug('Directory not found', { path: dirPath });
676
+ throw createFileSystemError(`Directory not found: ${dirPath}`, 'FS_NOT_FOUND', { path: dirPath, operation: 'readdir' });
677
+ }
678
+ if (!isDirectory(dirPath)) {
679
+ fsDirLogger.debug('Path is not a directory', { path: dirPath });
680
+ throw createFileSystemError(`Not a directory: ${dirPath}`, 'FS_NOT_A_DIRECTORY', { path: dirPath, operation: 'readdir' });
681
+ }
682
+ try {
683
+ const entries = readdirSync(dirPath, { withFileTypes: true });
684
+ fsDirLogger.debug('Directory read complete', { path: dirPath, entryCount: entries.length });
685
+ return entries.map((entry) => ({
686
+ name: entry.name,
687
+ path: join$1(dirPath, entry.name),
688
+ isFile: entry.isFile(),
689
+ isDirectory: entry.isDirectory(),
690
+ isSymlink: entry.isSymbolicLink(),
691
+ }));
692
+ }
693
+ catch (error) {
694
+ fsDirLogger.warn('Failed to read directory', { path: dirPath, error: error instanceof Error ? error.message : String(error) });
695
+ throw createFileSystemError(`Failed to read directory: ${dirPath}`, 'FS_READ_ERROR', {
696
+ path: dirPath,
697
+ operation: 'readdir',
698
+ cause: error,
699
+ });
700
+ }
701
+ }
702
+
703
+ /**
704
+ * Join path segments.
705
+ * Uses platform-specific separators (e.g., / or \).
706
+ *
707
+ * @param paths - Path segments to join
708
+ * @returns Joined path
709
+ */
710
+ function join(...paths) {
711
+ return join$1(...paths);
712
+ }
713
+
714
+ const fsTraversalLogger = createScopedLogger('project-scope:fs:traversal');
715
+ /**
716
+ * Generic upward directory traversal.
717
+ * Name avoids similarity to fs.readdir/fs.readdirSync.
718
+ *
719
+ * @param startPath - Starting directory
720
+ * @param predicate - Function to test each directory
721
+ * @returns First matching directory or null
722
+ */
723
+ function traverseUpward(startPath, predicate) {
724
+ fsTraversalLogger.debug('Starting upward traversal', { startPath });
725
+ let currentPath = resolve(startPath);
726
+ const rootPath = parse$1(currentPath).root;
727
+ while (currentPath !== rootPath) {
728
+ if (predicate(currentPath)) {
729
+ fsTraversalLogger.debug('Upward traversal found match', { startPath, foundPath: currentPath });
730
+ return currentPath;
731
+ }
732
+ currentPath = dirname(currentPath);
733
+ }
734
+ // Check root directory
735
+ if (predicate(rootPath)) {
736
+ fsTraversalLogger.debug('Upward traversal found match at root', { startPath, foundPath: rootPath });
737
+ return rootPath;
738
+ }
739
+ fsTraversalLogger.debug('Upward traversal found no match', { startPath });
740
+ return null;
741
+ }
742
+ /**
743
+ * Find directory containing any of the specified marker files.
744
+ *
745
+ * @param startPath - Starting directory
746
+ * @param markers - Array of marker file names to search for
747
+ * @returns First directory containing any marker, or null
748
+ */
749
+ function locateByMarkers(startPath, markers) {
750
+ fsTraversalLogger.debug('Locating by markers', { startPath, markers });
751
+ const result = traverseUpward(startPath, (dir) => markers.some((marker) => exists(join(dir, marker))));
752
+ if (result) {
753
+ fsTraversalLogger.debug('Found directory with marker', { startPath, foundPath: result });
754
+ }
755
+ return result;
756
+ }
757
+
758
+ const packageLogger = createScopedLogger('project-scope:project:package');
759
+ /**
760
+ * Verifies that a value is an object with only string values,
761
+ * used for validating dependency maps and script definitions.
762
+ *
763
+ * @param value - Value to check
764
+ * @returns True if value is a record of strings
765
+ */
766
+ function isStringRecord(value) {
767
+ if (typeof value !== 'object' || value === null)
768
+ return false;
769
+ return values(value).every((v) => typeof v === 'string');
770
+ }
771
+ /**
772
+ * Extracts and normalizes the workspaces field from package.json,
773
+ * supporting both array format and object with packages array.
774
+ *
775
+ * @param value - Raw workspaces value from package.json
776
+ * @returns Normalized workspace patterns or undefined if invalid
777
+ */
778
+ function parseWorkspaces(value) {
779
+ if (isArray(value) && value.every((v) => typeof v === 'string')) {
780
+ return value;
781
+ }
782
+ if (typeof value === 'object' && value !== null) {
783
+ const obj = value;
784
+ if (isArray(obj['packages'])) {
785
+ return { packages: obj['packages'] };
786
+ }
787
+ }
788
+ return undefined;
789
+ }
790
+ /**
791
+ * Validate and normalize package.json data.
792
+ *
793
+ * @param data - Raw parsed data
794
+ * @returns Validated package.json
795
+ */
796
+ function validatePackageJson(data) {
797
+ if (typeof data !== 'object' || data === null) {
798
+ throw createError('package.json must be an object');
799
+ }
800
+ const pkg = data;
801
+ return {
802
+ name: typeof pkg['name'] === 'string' ? pkg['name'] : undefined,
803
+ version: typeof pkg['version'] === 'string' ? pkg['version'] : undefined,
804
+ description: typeof pkg['description'] === 'string' ? pkg['description'] : undefined,
805
+ main: typeof pkg['main'] === 'string' ? pkg['main'] : undefined,
806
+ module: typeof pkg['module'] === 'string' ? pkg['module'] : undefined,
807
+ browser: typeof pkg['browser'] === 'string' ? pkg['browser'] : undefined,
808
+ types: typeof pkg['types'] === 'string' ? pkg['types'] : undefined,
809
+ bin: typeof pkg['bin'] === 'string' || isStringRecord(pkg['bin']) ? pkg['bin'] : undefined,
810
+ scripts: isStringRecord(pkg['scripts']) ? pkg['scripts'] : undefined,
811
+ dependencies: isStringRecord(pkg['dependencies']) ? pkg['dependencies'] : undefined,
812
+ devDependencies: isStringRecord(pkg['devDependencies']) ? pkg['devDependencies'] : undefined,
813
+ peerDependencies: isStringRecord(pkg['peerDependencies']) ? pkg['peerDependencies'] : undefined,
814
+ optionalDependencies: isStringRecord(pkg['optionalDependencies']) ? pkg['optionalDependencies'] : undefined,
815
+ workspaces: parseWorkspaces(pkg['workspaces']),
816
+ exports: typeof pkg['exports'] === 'object' ? pkg['exports'] : undefined,
817
+ engines: isStringRecord(pkg['engines']) ? pkg['engines'] : undefined,
818
+ ...pkg,
819
+ };
820
+ }
821
+ /**
822
+ * Attempts to read and parse package.json if it exists,
823
+ * returning null on missing file or parse failure.
824
+ *
825
+ * @param projectPath - Project directory path or path to package.json
826
+ * @returns Parsed package.json or null if not found
827
+ */
828
+ function readPackageJsonIfExists(projectPath) {
829
+ const packageJsonPath = projectPath.endsWith('package.json') ? projectPath : join$1(projectPath, 'package.json');
830
+ const content = readFileIfExists(packageJsonPath);
831
+ if (!content) {
832
+ packageLogger.debug('Package.json not found', { path: packageJsonPath });
833
+ return null;
834
+ }
835
+ try {
836
+ const validated = validatePackageJson(parse(content));
837
+ packageLogger.debug('Package.json loaded', { path: packageJsonPath, name: validated.name });
838
+ return validated;
839
+ }
840
+ catch {
841
+ packageLogger.debug('Failed to parse package.json, returning null', { path: packageJsonPath });
842
+ return null;
843
+ }
844
+ }
845
+
846
+ createScopedLogger('project-scope:root');
847
+ /**
848
+ * Generic root finder - walk up looking for any marker file.
849
+ *
850
+ * @param startPath - Starting path
851
+ * @param markers - Files to search for
852
+ * @returns Root directory path or null
853
+ */
854
+ function findRootDirectory(startPath, markers) {
855
+ return locateByMarkers(startPath, markers);
856
+ }
857
+
858
+ const nxLogger = createScopedLogger('project-scope:nx');
859
+ /**
860
+ * Files indicating NX workspace root.
861
+ */
862
+ const NX_CONFIG_FILES = ['nx.json', 'workspace.json'];
863
+ /**
864
+ * NX-specific project file.
865
+ */
866
+ const NX_PROJECT_FILE = 'project.json';
867
+ /**
868
+ * Check if directory is an NX workspace root.
869
+ *
870
+ * @param path - Directory path to check
871
+ * @returns True if the directory contains nx.json or workspace.json
872
+ *
873
+ * @example
874
+ * ```typescript
875
+ * import { isNxWorkspace } from '@hyperfrontend/project-scope'
876
+ *
877
+ * if (isNxWorkspace('./my-project')) {
878
+ * console.log('This is an NX monorepo')
879
+ * }
880
+ * ```
881
+ */
882
+ function isNxWorkspace(path) {
883
+ for (const configFile of NX_CONFIG_FILES) {
884
+ if (exists(join$1(path, configFile))) {
885
+ nxLogger.debug('NX workspace detected', { path, configFile });
886
+ return true;
887
+ }
888
+ }
889
+ nxLogger.debug('Not an NX workspace', { path });
890
+ return false;
891
+ }
892
+ /**
893
+ * Check if directory is an NX project.
894
+ *
895
+ * @param path - Directory path to check
896
+ * @returns True if the directory contains project.json
897
+ */
898
+ function isNxProject(path) {
899
+ const isProject = exists(join$1(path, NX_PROJECT_FILE));
900
+ nxLogger.debug('NX project check', { path, isProject });
901
+ return isProject;
902
+ }
903
+ /**
904
+ * Find NX workspace root from any path.
905
+ *
906
+ * @param startPath - Starting path to search from
907
+ * @returns Workspace root path or null if not found
908
+ *
909
+ * @example
910
+ * ```typescript
911
+ * import { findNxWorkspaceRoot } from '@hyperfrontend/project-scope'
912
+ *
913
+ * const root = findNxWorkspaceRoot('./libs/my-lib/src')
914
+ * if (root) {
915
+ * console.log('Workspace root:', root) // e.g., '/home/user/my-monorepo'
916
+ * }
917
+ * ```
918
+ */
919
+ function findNxWorkspaceRoot(startPath) {
920
+ nxLogger.debug('Finding NX workspace root', { startPath });
921
+ const result = findRootDirectory(startPath, NX_CONFIG_FILES);
922
+ if (result) {
923
+ nxLogger.debug('Found NX workspace root', { startPath, root: result });
924
+ }
925
+ else {
926
+ nxLogger.debug('NX workspace root not found', { startPath });
927
+ }
928
+ return result;
929
+ }
930
+ /**
931
+ * Detect NX version from package.json dependencies.
932
+ *
933
+ * @param workspacePath - Workspace root path
934
+ * @returns NX version string (without semver range) or null
935
+ */
936
+ function detectNxVersion(workspacePath) {
937
+ const packageJson = readPackageJsonIfExists(workspacePath);
938
+ if (packageJson) {
939
+ const nxVersion = packageJson.devDependencies?.['nx'] ?? packageJson.dependencies?.['nx'];
940
+ if (nxVersion) {
941
+ // Strip semver range characters (^, ~, >=, etc.)
942
+ return nxVersion.replace(/^[\^~>=<]+/, '');
943
+ }
944
+ }
945
+ return null;
946
+ }
947
+ /**
948
+ * Check if workspace is integrated (not standalone).
949
+ * Integrated repos typically have workspaceLayout, namedInputs, or targetDefaults.
950
+ *
951
+ * @param nxJson - Parsed nx.json configuration
952
+ * @returns True if the workspace is integrated
953
+ */
954
+ function isIntegratedRepo(nxJson) {
955
+ return nxJson.workspaceLayout !== undefined || nxJson.namedInputs !== undefined || nxJson.targetDefaults !== undefined;
956
+ }
957
+ /**
958
+ * Get comprehensive NX workspace information.
959
+ *
960
+ * @param workspacePath - Workspace root path
961
+ * @returns Workspace info or null if not an NX workspace
962
+ */
963
+ function getNxWorkspaceInfo(workspacePath) {
964
+ nxLogger.debug('Getting NX workspace info', { workspacePath });
965
+ if (!isNxWorkspace(workspacePath)) {
966
+ return null;
967
+ }
968
+ const nxJson = readJsonFileIfExists(join$1(workspacePath, 'nx.json'));
969
+ if (!nxJson) {
970
+ // Check for workspace.json as fallback (older NX)
971
+ const workspaceJson = readJsonFileIfExists(join$1(workspacePath, 'workspace.json'));
972
+ if (!workspaceJson) {
973
+ nxLogger.debug('No nx.json or workspace.json found', { workspacePath });
974
+ return null;
975
+ }
976
+ nxLogger.debug('Using legacy workspace.json', { workspacePath });
977
+ // Create minimal nx.json from workspace.json
978
+ return {
979
+ root: workspacePath,
980
+ version: detectNxVersion(workspacePath),
981
+ nxJson: {},
982
+ isIntegrated: true,
983
+ workspaceLayout: {
984
+ appsDir: 'apps',
985
+ libsDir: 'libs',
986
+ },
987
+ };
988
+ }
989
+ const info = {
990
+ root: workspacePath,
991
+ version: detectNxVersion(workspacePath),
992
+ nxJson,
993
+ isIntegrated: isIntegratedRepo(nxJson),
994
+ defaultProject: nxJson.defaultProject,
995
+ workspaceLayout: {
996
+ appsDir: nxJson.workspaceLayout?.appsDir ?? 'apps',
997
+ libsDir: nxJson.workspaceLayout?.libsDir ?? 'libs',
998
+ },
999
+ };
1000
+ nxLogger.debug('NX workspace info retrieved', {
1001
+ workspacePath,
1002
+ version: info.version,
1003
+ isIntegrated: info.isIntegrated,
1004
+ defaultProject: info.defaultProject,
1005
+ });
1006
+ return info;
1007
+ }
1008
+
1009
+ const devkitLogger = createScopedLogger('project-scope:nx:devkit');
1010
+ /** Cached load result to avoid repeated require attempts */
1011
+ let cachedResult = null;
1012
+ /**
1013
+ * Try to load `@nx/devkit` at runtime.
1014
+ * Uses dynamic require to avoid bundling `@nx/devkit` into our output.
1015
+ * Results are cached for subsequent calls.
1016
+ *
1017
+ * @returns DevkitLoadResult with availability status and devkit module or error
1018
+ */
1019
+ function tryLoadDevkit() {
1020
+ if (cachedResult !== null) {
1021
+ devkitLogger.debug('Returning cached devkit result', { available: cachedResult.available });
1022
+ return cachedResult;
1023
+ }
1024
+ devkitLogger.debug('Attempting to load @nx/devkit');
1025
+ try {
1026
+ // Dynamic require to avoid bundling
1027
+ const devkit = require('@nx/devkit');
1028
+ devkitLogger.debug('@nx/devkit loaded successfully');
1029
+ cachedResult = { available: true, devkit };
1030
+ }
1031
+ catch (error) {
1032
+ devkitLogger.debug('@nx/devkit not available', { error: error instanceof Error ? error.message : String(error) });
1033
+ cachedResult = {
1034
+ available: false,
1035
+ error: error instanceof Error ? error : createError(String(error)),
1036
+ };
1037
+ }
1038
+ return cachedResult;
1039
+ }
1040
+ /**
1041
+ * Check if `@nx/devkit` is available.
1042
+ *
1043
+ * @returns true if devkit can be loaded, false otherwise
1044
+ */
1045
+ function isDevkitAvailable() {
1046
+ return tryLoadDevkit().available;
1047
+ }
1048
+ /**
1049
+ * Get `@nx/devkit` module if available.
1050
+ * Throws if not available.
1051
+ *
1052
+ * @returns The `@nx/devkit` module with full type information
1053
+ * @throws {Error} If `@nx/devkit` is not available
1054
+ */
1055
+ function getDevkit() {
1056
+ const result = tryLoadDevkit();
1057
+ if (!result.available) {
1058
+ throw createError('@nx/devkit is not available. Install it as a dependency or use standalone mode.');
1059
+ }
1060
+ return result.devkit;
1061
+ }
1062
+ /**
1063
+ * Execute function with `@nx/devkit` if available, otherwise execute fallback.
1064
+ * This pattern allows graceful degradation when `@nx/devkit` is not installed.
1065
+ *
1066
+ * @param ifAvailable - Function to execute if `@nx/devkit` is available
1067
+ * @param fallback - Function to execute if `@nx/devkit` is not available
1068
+ * @returns Result from whichever function was executed
1069
+ *
1070
+ * @example
1071
+ * ```typescript
1072
+ * const tree = withDevkit(
1073
+ * (devkit) => devkit.createTree(),
1074
+ * () => new FsTree(process.cwd())
1075
+ * )
1076
+ * ```
1077
+ */
1078
+ function withDevkit(ifAvailable, fallback) {
1079
+ const result = tryLoadDevkit();
1080
+ if (result.available && result.devkit) {
1081
+ return ifAvailable(result.devkit);
1082
+ }
1083
+ return fallback();
1084
+ }
1085
+ /**
1086
+ * Reset the cached devkit load result.
1087
+ * Primarily useful for testing.
1088
+ *
1089
+ * @internal
1090
+ */
1091
+ function resetDevkitCache() {
1092
+ cachedResult = null;
1093
+ }
1094
+
1095
+ const nxConfigLogger = createScopedLogger('project-scope:nx:config');
1096
+ /**
1097
+ * Read project.json for an NX project.
1098
+ *
1099
+ * @param projectPath - Project directory path
1100
+ * @returns Parsed project.json or null if not found
1101
+ */
1102
+ function readProjectJson(projectPath) {
1103
+ const projectJsonPath = join$1(projectPath, NX_PROJECT_FILE);
1104
+ nxConfigLogger.debug('Reading project.json', { path: projectJsonPath });
1105
+ const result = readJsonFileIfExists(projectJsonPath);
1106
+ if (result) {
1107
+ nxConfigLogger.debug('Project.json loaded', { path: projectJsonPath, name: result.name });
1108
+ }
1109
+ else {
1110
+ nxConfigLogger.debug('Project.json not found', { path: projectJsonPath });
1111
+ }
1112
+ return result;
1113
+ }
1114
+ /**
1115
+ * Get project configuration from project.json or package.json nx field.
1116
+ *
1117
+ * @param projectPath - Project directory path
1118
+ * @param workspacePath - Workspace root path (for relative path calculation)
1119
+ * @returns Project configuration or null if not found
1120
+ */
1121
+ function getProjectConfig(projectPath, workspacePath) {
1122
+ nxConfigLogger.debug('Getting project config', { projectPath, workspacePath });
1123
+ // Try project.json first
1124
+ const projectJson = readProjectJson(projectPath);
1125
+ if (projectJson) {
1126
+ nxConfigLogger.debug('Using project.json config', { projectPath, name: projectJson.name });
1127
+ return {
1128
+ ...projectJson,
1129
+ root: projectJson.root ?? relative(workspacePath, projectPath),
1130
+ };
1131
+ }
1132
+ // Try to infer from package.json nx field
1133
+ const packageJson = readPackageJsonIfExists(projectPath);
1134
+ if (packageJson && typeof packageJson['nx'] === 'object') {
1135
+ nxConfigLogger.debug('Using package.json nx field', { projectPath, name: packageJson.name });
1136
+ const nxConfig = packageJson['nx'];
1137
+ return {
1138
+ name: packageJson.name,
1139
+ root: relative(workspacePath, projectPath),
1140
+ ...nxConfig,
1141
+ };
1142
+ }
1143
+ nxConfigLogger.debug('No project config found', { projectPath });
1144
+ return null;
1145
+ }
1146
+ /**
1147
+ * Recursively scan directory for project.json files.
1148
+ *
1149
+ * @param dirPath - Directory to scan
1150
+ * @param workspacePath - Workspace root path
1151
+ * @param projects - Map to add discovered projects to
1152
+ * @param maxDepth - Maximum recursion depth
1153
+ * @param currentDepth - Current recursion depth
1154
+ */
1155
+ function scanForProjects(dirPath, workspacePath, projects, maxDepth, currentDepth = 0) {
1156
+ if (currentDepth > maxDepth)
1157
+ return;
1158
+ try {
1159
+ const entries = readDirectory(dirPath);
1160
+ for (const entry of entries) {
1161
+ // Skip node_modules and hidden directories
1162
+ if (entry.name.startsWith('.') || entry.name === 'node_modules' || entry.name === 'dist') {
1163
+ continue;
1164
+ }
1165
+ const fullPath = join$1(dirPath, entry.name);
1166
+ if (entry.isDirectory) {
1167
+ // Check if this directory is an NX project
1168
+ if (isNxProject(fullPath)) {
1169
+ const config = getProjectConfig(fullPath, workspacePath);
1170
+ if (config) {
1171
+ const name = config.name || relative(workspacePath, fullPath).replace(/[\\/]/g, '-');
1172
+ projects.set(name, {
1173
+ ...config,
1174
+ name,
1175
+ root: relative(workspacePath, fullPath),
1176
+ });
1177
+ }
1178
+ }
1179
+ // Recursively scan subdirectories
1180
+ scanForProjects(fullPath, workspacePath, projects, maxDepth, currentDepth + 1);
1181
+ }
1182
+ }
1183
+ }
1184
+ catch {
1185
+ // Directory not readable, skip
1186
+ }
1187
+ }
1188
+ /**
1189
+ * Discover all NX projects in workspace.
1190
+ * Supports both workspace.json (older format) and project.json (newer format).
1191
+ *
1192
+ * @param workspacePath - Workspace root path
1193
+ * @returns Map of project name to configuration
1194
+ */
1195
+ function discoverNxProjects(workspacePath) {
1196
+ const projects = createMap();
1197
+ // Check for workspace.json (older NX format)
1198
+ const workspaceJson = readJsonFileIfExists(join$1(workspacePath, 'workspace.json'));
1199
+ if (workspaceJson?.projects) {
1200
+ for (const [name, config] of entries(workspaceJson.projects)) {
1201
+ if (typeof config === 'string') {
1202
+ // Path reference to project directory
1203
+ const projectPath = join$1(workspacePath, config);
1204
+ const projectConfig = getProjectConfig(projectPath, workspacePath);
1205
+ if (projectConfig) {
1206
+ projects.set(name, { ...projectConfig, name });
1207
+ }
1208
+ }
1209
+ else if (typeof config === 'object' && config !== null) {
1210
+ // Inline config
1211
+ projects.set(name, { name, ...config });
1212
+ }
1213
+ }
1214
+ return projects;
1215
+ }
1216
+ // Scan for project.json files (newer NX format)
1217
+ const workspaceInfo = getNxWorkspaceInfo(workspacePath);
1218
+ const appsDir = workspaceInfo?.workspaceLayout.appsDir ?? 'apps';
1219
+ const libsDir = workspaceInfo?.workspaceLayout.libsDir ?? 'libs';
1220
+ const searchDirs = [appsDir, libsDir];
1221
+ // Also check packages directory (common in some setups)
1222
+ if (exists(join$1(workspacePath, 'packages'))) {
1223
+ searchDirs.push('packages');
1224
+ }
1225
+ for (const dir of searchDirs) {
1226
+ const dirPath = join$1(workspacePath, dir);
1227
+ if (exists(dirPath) && isDirectory(dirPath)) {
1228
+ try {
1229
+ scanForProjects(dirPath, workspacePath, projects, 3);
1230
+ }
1231
+ catch {
1232
+ // Directory not accessible
1233
+ }
1234
+ }
1235
+ }
1236
+ // Also check root-level projects (standalone projects in monorepo root)
1237
+ if (isNxProject(workspacePath)) {
1238
+ const config = readProjectJson(workspacePath);
1239
+ if (config) {
1240
+ const name = config.name || basename(workspacePath);
1241
+ projects.set(name, {
1242
+ ...config,
1243
+ name,
1244
+ root: '.',
1245
+ });
1246
+ }
1247
+ }
1248
+ return projects;
1249
+ }
1250
+ /**
1251
+ * Build a simple project graph from discovered projects.
1252
+ * For full graph capabilities, use `@nx/devkit`.
1253
+ *
1254
+ * @param workspacePath - Workspace root path
1255
+ * @param projects - Existing configuration map to skip auto-discovery
1256
+ * @returns NxProjectGraph with nodes and dependencies
1257
+ */
1258
+ function buildSimpleProjectGraph(workspacePath, projects) {
1259
+ const projectMap = projects ?? discoverNxProjects(workspacePath);
1260
+ const nodes = {};
1261
+ const dependencies = {};
1262
+ for (const [name, config] of projectMap) {
1263
+ nodes[name] = {
1264
+ name,
1265
+ type: config.projectType ?? 'library',
1266
+ data: config,
1267
+ };
1268
+ dependencies[name] = [];
1269
+ // Add implicit dependencies
1270
+ if (config.implicitDependencies) {
1271
+ for (const dep of config.implicitDependencies) {
1272
+ // Skip negative dependencies (those starting with !)
1273
+ if (!dep.startsWith('!')) {
1274
+ dependencies[name].push({
1275
+ target: dep,
1276
+ type: 'implicit',
1277
+ });
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ return { nodes, dependencies };
1283
+ }
1284
+
1285
+ export { NX_CONFIG_FILES, NX_PROJECT_FILE, buildSimpleProjectGraph, discoverNxProjects, findNxWorkspaceRoot, getDevkit, getNxWorkspaceInfo, getProjectConfig, isDevkitAvailable, isNxProject, isNxWorkspace, readProjectJson, resetDevkitCache, tryLoadDevkit, withDevkit };
1286
+ //# sourceMappingURL=index.esm.js.map