@eagleoutice/flowr 2.12.2 → 2.13.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 (319) hide show
  1. package/README.md +38 -91
  2. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +3 -3
  3. package/abstract-interpretation/data-frame/dataframe-domain.js +14 -6
  4. package/abstract-interpretation/data-frame/semantics.js +12 -16
  5. package/abstract-interpretation/domains/abstract-domain.d.ts +46 -44
  6. package/abstract-interpretation/domains/abstract-domain.js +146 -6
  7. package/abstract-interpretation/domains/bounded-set-domain.d.ts +16 -25
  8. package/abstract-interpretation/domains/bounded-set-domain.js +22 -69
  9. package/abstract-interpretation/domains/interval-domain.d.ts +27 -36
  10. package/abstract-interpretation/domains/interval-domain.js +111 -146
  11. package/abstract-interpretation/domains/lattice.d.ts +3 -3
  12. package/abstract-interpretation/domains/multi-value-state-domain.js +3 -3
  13. package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -19
  14. package/abstract-interpretation/domains/partial-product-domain.js +21 -54
  15. package/abstract-interpretation/domains/positive-interval-domain.d.ts +8 -12
  16. package/abstract-interpretation/domains/positive-interval-domain.js +21 -50
  17. package/abstract-interpretation/domains/product-domain.d.ts +1 -1
  18. package/abstract-interpretation/domains/product-domain.js +4 -4
  19. package/abstract-interpretation/domains/set-range-domain.d.ts +60 -56
  20. package/abstract-interpretation/domains/set-range-domain.js +141 -200
  21. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +17 -23
  22. package/abstract-interpretation/domains/set-upper-bound-domain.js +59 -103
  23. package/abstract-interpretation/domains/singleton-domain.d.ts +15 -18
  24. package/abstract-interpretation/domains/singleton-domain.js +33 -72
  25. package/abstract-interpretation/domains/state-abstract-domain.d.ts +12 -16
  26. package/abstract-interpretation/domains/state-abstract-domain.js +36 -126
  27. package/abstract-interpretation/domains/state-domain-like.d.ts +2 -2
  28. package/abstract-interpretation/domains/value-abstract-domain.d.ts +120 -0
  29. package/abstract-interpretation/domains/{satisfiable-domain.js → value-abstract-domain.js} +14 -2
  30. package/benchmark/slicer.d.ts +2 -2
  31. package/benchmark/slicer.js +6 -5
  32. package/cli/common/options.d.ts +10 -0
  33. package/cli/common/options.js +2 -0
  34. package/cli/common/scripts-info.d.ts +10 -0
  35. package/cli/flowr-main-options.d.ts +4 -0
  36. package/cli/flowr-main-options.js +5 -0
  37. package/cli/flowr.d.ts +5 -0
  38. package/cli/flowr.js +15 -7
  39. package/cli/repl/commands/repl-query.js +42 -20
  40. package/cli/repl/commands/repl-signature.js +2 -2
  41. package/cli/repl/core.d.ts +14 -5
  42. package/cli/repl/core.js +32 -17
  43. package/cli/repl/parser/slice-query-parser.d.ts +69 -8
  44. package/cli/repl/parser/slice-query-parser.js +82 -13
  45. package/cli/repl/path-input.d.ts +6 -0
  46. package/cli/repl/path-input.js +41 -0
  47. package/cli/repl/print-version.js +3 -5
  48. package/cli/slicer-app.d.ts +2 -0
  49. package/cli/slicer-app.js +2 -1
  50. package/config.d.ts +54 -6
  51. package/config.js +133 -12
  52. package/control-flow/control-flow-graph.d.ts +3 -2
  53. package/control-flow/control-flow-graph.js +34 -14
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
  55. package/control-flow/semantic-cfg-guided-visitor.js +3 -0
  56. package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
  57. package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
  58. package/data/r-base-packages.generated.d.ts +1 -1
  59. package/data/r-base-packages.generated.js +3 -3
  60. package/data/sigdb/sigdb.remote.json +53 -53
  61. package/dataflow/environments/built-in-proc-name.d.ts +2 -0
  62. package/dataflow/environments/built-in-proc-name.js +2 -0
  63. package/dataflow/environments/built-in.d.ts +2 -0
  64. package/dataflow/environments/built-in.js +2 -0
  65. package/dataflow/environments/default-builtin-config.d.ts +3 -5
  66. package/dataflow/environments/default-builtin-config.js +2 -2
  67. package/dataflow/environments/environment.d.ts +9 -0
  68. package/dataflow/environments/environment.js +28 -7
  69. package/dataflow/environments/identifier.d.ts +1 -2
  70. package/dataflow/environments/identifier.js +1 -5
  71. package/dataflow/extractor.js +1 -2
  72. package/dataflow/graph/dataflowgraph-builder.js +42 -3
  73. package/dataflow/graph/df-helper.d.ts +15 -0
  74. package/dataflow/graph/df-helper.js +20 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
  76. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
  77. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
  78. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
  79. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
  80. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
  81. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
  82. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
  83. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
  84. package/documentation/data/faq/faqs.js +12 -1
  85. package/documentation/doc-readme.js +1 -1
  86. package/documentation/doc-util/doc-files.d.ts +2 -2
  87. package/documentation/doc-util/doc-files.js +4 -7
  88. package/documentation/doc-util/doc-query.d.ts +12 -9
  89. package/documentation/doc-util/doc-query.js +63 -28
  90. package/documentation/wiki-absint.js +1 -4
  91. package/documentation/wiki-analyzer.js +8 -3
  92. package/documentation/wiki-cfg.js +3 -2
  93. package/documentation/wiki-dataflow-graph.js +14 -4
  94. package/documentation/wiki-interface.js +29 -16
  95. package/documentation/wiki-mk/doc-maker.js +1 -1
  96. package/documentation/wiki-query.js +189 -30
  97. package/documentation/wiki-signature-database.d.ts +1 -1
  98. package/documentation/wiki-signature-database.js +53 -27
  99. package/linter/linter-output.d.ts +24 -0
  100. package/linter/linter-output.js +117 -0
  101. package/linter/linter-rules.d.ts +2 -4
  102. package/linter/rules/dataframe-access-validation.js +4 -4
  103. package/linter/rules/deprecated-functions.d.ts +2 -4
  104. package/linter/rules/deprecated-functions.js +58 -3
  105. package/linter/rules/undefined-symbol.js +18 -10
  106. package/linter/rules/unused-definition.js +24 -0
  107. package/package.json +5 -2
  108. package/project/context/flowr-analyzer-context.d.ts +59 -1
  109. package/project/context/flowr-analyzer-context.js +118 -3
  110. package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
  111. package/project/context/flowr-analyzer-dependencies-context.js +33 -3
  112. package/project/context/flowr-analyzer-files-context.d.ts +32 -0
  113. package/project/context/flowr-analyzer-files-context.js +132 -14
  114. package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
  115. package/project/context/flowr-analyzer-loading-order-context.js +20 -0
  116. package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
  117. package/project/context/flowr-analyzer-meta-context.js +64 -23
  118. package/project/context/flowr-file.d.ts +7 -0
  119. package/project/context/flowr-file.js +7 -0
  120. package/project/context/project-kind.d.ts +22 -0
  121. package/project/context/project-kind.js +27 -0
  122. package/project/dependency-version-space.d.ts +166 -0
  123. package/project/dependency-version-space.js +564 -0
  124. package/project/flowr-analyzer-builder.js +1 -1
  125. package/project/flowr-analyzer.d.ts +4 -0
  126. package/project/flowr-analyzer.js +5 -0
  127. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
  128. package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
  129. package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
  130. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
  131. package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
  132. package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
  133. package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
  134. package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
  135. package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
  136. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
  137. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
  138. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
  139. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
  140. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
  141. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
  142. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
  143. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
  144. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
  145. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
  146. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
  147. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
  148. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
  149. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
  150. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
  151. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
  152. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
  153. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
  154. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
  155. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
  156. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
  157. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
  158. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
  159. package/project/plugins/flowr-analyzer-plugin.js +5 -0
  160. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
  161. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
  162. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
  163. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
  164. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
  165. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
  166. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
  167. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
  168. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
  169. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
  170. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
  171. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
  172. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  173. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
  174. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
  175. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
  176. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
  177. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
  178. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
  179. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
  180. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
  181. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
  182. package/project/plugins/package-version-plugins/package.d.ts +4 -1
  183. package/project/plugins/package-version-plugins/package.js +8 -5
  184. package/project/plugins/plugin-registry.d.ts +11 -3
  185. package/project/plugins/plugin-registry.js +24 -5
  186. package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
  187. package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
  188. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
  189. package/project/sigdb/build.js +12 -2
  190. package/project/sigdb/decode.d.ts +7 -0
  191. package/project/sigdb/decode.js +35 -4
  192. package/project/sigdb/decompress.d.ts +2 -0
  193. package/project/sigdb/decompress.js +5 -0
  194. package/project/sigdb/manifest.d.ts +5 -0
  195. package/project/sigdb/manifest.js +37 -6
  196. package/project/sigdb/reader.d.ts +82 -2
  197. package/project/sigdb/reader.js +226 -14
  198. package/project/sigdb/schema.d.ts +31 -5
  199. package/project/sigdb/schema.js +7 -3
  200. package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
  201. package/project/sigdb/sigdb-version.js +119 -0
  202. package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
  203. package/queries/catalog/absint-query/absint-query-format.js +2 -0
  204. package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
  205. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
  206. package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
  207. package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
  208. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
  209. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
  210. package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
  211. package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
  212. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
  213. package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
  214. package/queries/catalog/config-query/config-query-executor.js +15 -6
  215. package/queries/catalog/config-query/config-query-format.d.ts +18 -4
  216. package/queries/catalog/config-query/config-query-format.js +246 -96
  217. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
  218. package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
  219. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
  220. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
  221. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
  222. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
  223. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
  224. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
  225. package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
  226. package/queries/catalog/dice-query/dice-query-executor.js +6 -9
  227. package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
  228. package/queries/catalog/dice-query/dice-query-format.js +10 -6
  229. package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
  230. package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
  231. package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
  232. package/queries/catalog/files-query/files-query-format.d.ts +2 -0
  233. package/queries/catalog/files-query/files-query-format.js +2 -0
  234. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
  235. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +277 -0
  236. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +119 -0
  237. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +331 -0
  238. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
  239. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
  240. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
  241. package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
  242. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
  243. package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
  244. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
  245. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
  246. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
  247. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
  248. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
  249. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
  250. package/queries/catalog/linter-query/linter-query-executor.js +11 -2
  251. package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
  252. package/queries/catalog/linter-query/linter-query-format.js +44 -21
  253. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
  254. package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
  255. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
  256. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
  257. package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
  258. package/queries/catalog/origin-query/origin-query-format.js +2 -0
  259. package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
  260. package/queries/catalog/project-query/project-query-executor.js +19 -62
  261. package/queries/catalog/project-query/project-query-format.d.ts +7 -18
  262. package/queries/catalog/project-query/project-query-format.js +3 -18
  263. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
  264. package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
  265. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
  266. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
  267. package/queries/catalog/search-query/search-query-format.d.ts +1 -0
  268. package/queries/catalog/search-query/search-query-format.js +1 -0
  269. package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
  270. package/queries/catalog/signature-query/signature-query-executor.js +267 -57
  271. package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
  272. package/queries/catalog/signature-query/signature-query-format.js +41 -5
  273. package/queries/catalog/signature-query/signature-query-render.js +48 -6
  274. package/queries/catalog/slice-query-options.d.ts +49 -0
  275. package/queries/catalog/slice-query-options.js +50 -0
  276. package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
  277. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
  278. package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
  279. package/queries/query-print.js +3 -1
  280. package/queries/query.d.ts +63 -3
  281. package/queries/query.js +9 -2
  282. package/r-bridge/data/data.d.ts +16 -0
  283. package/r-bridge/data/data.js +20 -0
  284. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
  285. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  286. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  287. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
  288. package/reconstruct/reconstruct.d.ts +18 -1
  289. package/reconstruct/reconstruct.js +42 -19
  290. package/slicing/criterion/parse.d.ts +4 -0
  291. package/slicing/criterion/parse.js +4 -0
  292. package/slicing/static/slice-call.js +17 -9
  293. package/slicing/static/static-slicer.d.ts +1 -1
  294. package/slicing/static/static-slicer.js +5 -4
  295. package/util/files.d.ts +19 -1
  296. package/util/files.js +45 -3
  297. package/util/glob.d.ts +19 -0
  298. package/util/glob.js +67 -0
  299. package/util/log.d.ts +12 -0
  300. package/util/log.js +17 -1
  301. package/util/logic.d.ts +6 -0
  302. package/util/logic.js +31 -1
  303. package/util/mermaid/dfg.js +17 -12
  304. package/util/mermaid/mermaid.js +2 -2
  305. package/util/objects.d.ts +5 -0
  306. package/util/objects.js +8 -0
  307. package/util/r-version.d.ts +9 -1
  308. package/util/r-version.js +27 -2
  309. package/util/schema.d.ts +16 -0
  310. package/util/schema.js +89 -4
  311. package/util/text/ansi.d.ts +4 -0
  312. package/util/text/ansi.js +27 -3
  313. package/util/text/strings.d.ts +9 -0
  314. package/util/text/strings.js +29 -0
  315. package/util/version.js +79 -6
  316. package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
  317. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
  318. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
  319. package/project/sigdb/version.js +0 -55
@@ -10,7 +10,7 @@ export declare const descriptionFileLog: import("tslog").Logger<import("tslog").
10
10
  */
11
11
  export declare class FlowrAnalyzerDescriptionFilePlugin extends FlowrAnalyzerFilePlugin {
12
12
  readonly name = "flowr-analyzer-description-file-plugin";
13
- readonly description = "This plugin provides support for DESCRIPTION files and extracts their content into key-value(s) pairs.";
13
+ readonly description = "Reads DESCRIPTION files into key-value pairs.";
14
14
  readonly version: SemVer;
15
15
  private readonly pattern;
16
16
  /**
@@ -14,7 +14,7 @@ const DescriptionFilePattern = /^DESCRIPTION(\.(txt|in))?$/i;
14
14
  */
15
15
  class FlowrAnalyzerDescriptionFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
16
16
  name = 'flowr-analyzer-description-file-plugin';
17
- description = 'This plugin provides support for DESCRIPTION files and extracts their content into key-value(s) pairs.';
17
+ description = 'Reads DESCRIPTION files into key-value pairs.';
18
18
  version = new semver_1.SemVer('0.1.0');
19
19
  pattern;
20
20
  /**
@@ -26,7 +26,7 @@ class FlowrAnalyzerFilePlugin extends flowr_analyzer_plugin_1.FlowrAnalyzerPlugi
26
26
  exports.FlowrAnalyzerFilePlugin = FlowrAnalyzerFilePlugin;
27
27
  class DefaultFlowrAnalyzerFilePlugin extends FlowrAnalyzerFilePlugin {
28
28
  name = 'default-file-plugin';
29
- description = 'This is the default file plugin that does nothing (but assigning default .r/.R files).';
29
+ description = 'Assigns the default .r/.R files, nothing else.';
30
30
  version = new semver_1.SemVer('0.0.0');
31
31
  applies() {
32
32
  return true;
@@ -9,7 +9,7 @@ import type { FlowrFileProvider } from '../../context/flowr-file';
9
9
  */
10
10
  export declare class FlowrAnalyzerMetaInstFilesPlugin extends FlowrAnalyzerFilePlugin {
11
11
  readonly name = "flowr-analyzer-inst-files-plugin";
12
- readonly description = "This plugin provides support for loading installed files.";
12
+ readonly description = "Loads installed files.";
13
13
  readonly version: SemVer;
14
14
  private readonly pathPattern;
15
15
  /**
@@ -12,7 +12,7 @@ const InstPathPattern = /(^|\/)inst(\/|$)/;
12
12
  */
13
13
  class FlowrAnalyzerMetaInstFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
14
14
  name = 'flowr-analyzer-inst-files-plugin';
15
- description = 'This plugin provides support for loading installed files.';
15
+ description = 'Loads installed files.';
16
16
  version = new semver_1.SemVer('0.1.0');
17
17
  pathPattern;
18
18
  /**
@@ -8,7 +8,7 @@ import type { FlowrFileProvider } from '../../context/flowr-file';
8
8
  */
9
9
  export declare class FlowrAnalyzerLicenseFilePlugin extends FlowrAnalyzerFilePlugin {
10
10
  readonly name = "flowr-analyzer-license-files-plugin";
11
- readonly description = "This plugin provides support for loading license files.";
11
+ readonly description = "Loads license files.";
12
12
  readonly version: SemVer;
13
13
  private readonly pathPattern;
14
14
  /**
@@ -11,7 +11,7 @@ const FileNamePattern = /license(\.md|\.txt)?$/i;
11
11
  */
12
12
  class FlowrAnalyzerLicenseFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
13
13
  name = 'flowr-analyzer-license-files-plugin';
14
- description = 'This plugin provides support for loading license files.';
14
+ description = 'Loads license files.';
15
15
  version = new semver_1.SemVer('0.1.0');
16
16
  pathPattern;
17
17
  /**
@@ -9,7 +9,7 @@ import { FlowrNamespaceFile } from './files/flowr-namespace-file';
9
9
  */
10
10
  export declare class FlowrAnalyzerNamespaceFilesPlugin extends FlowrAnalyzerFilePlugin {
11
11
  readonly name = "flowr-analyzer-namespace-file-plugin";
12
- readonly description = "This plugin provides support for NAMESPACE files and extracts their content into the NAMESPACEFormat.";
12
+ readonly description = "Reads NAMESPACE files into the NAMESPACE format.";
13
13
  readonly version: SemVer;
14
14
  private readonly pattern;
15
15
  /**
@@ -12,7 +12,7 @@ const NamespaceFilePattern = /^NAMESPACE(\.txt)?$/i;
12
12
  */
13
13
  class FlowrAnalyzerNamespaceFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
14
14
  name = 'flowr-analyzer-namespace-file-plugin';
15
- description = 'This plugin provides support for NAMESPACE files and extracts their content into the NAMESPACEFormat.';
15
+ description = 'Reads NAMESPACE files into the NAMESPACE format.';
16
16
  version = new semver_1.SemVer('0.1.0');
17
17
  pattern;
18
18
  /**
@@ -10,7 +10,7 @@ import { FlowrNewsFile } from './files/flowr-news-file';
10
10
  */
11
11
  export declare class FlowrAnalyzerNewsFilePlugin extends FlowrAnalyzerFilePlugin {
12
12
  readonly name = "flowr-analyzer-news-file-plugin";
13
- readonly description = "This plugin provides support for NEWS files and extracts their content into version chunks.";
13
+ readonly description = "Reads NEWS files into version chunks.";
14
14
  readonly version: SemVer;
15
15
  private readonly pattern;
16
16
  /**
@@ -13,7 +13,7 @@ const NewsFilePattern = /^NEWS(\.(rd|md))?$/i;
13
13
  */
14
14
  class FlowrAnalyzerNewsFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
15
15
  name = 'flowr-analyzer-news-file-plugin';
16
- description = 'This plugin provides support for NEWS files and extracts their content into version chunks.';
16
+ description = 'Reads NEWS files into version chunks.';
17
17
  version = new semver_1.SemVer('0.1.0');
18
18
  pattern;
19
19
  /**
@@ -0,0 +1,26 @@
1
+ import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
2
+ import { SemVer } from 'semver';
3
+ import type { PathLike } from 'fs';
4
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
+ import { type FlowrFileProvider } from '../../context/flowr-file';
6
+ import { FlowrRDAFile } from './files/flowr-rda-file';
7
+ /**
8
+ * This plugin provides support for R workspace files (`.rda`/`.RData`), exposing their top-level objects.
9
+ * @see https://rdrr.io/r/base/load.html
10
+ */
11
+ export declare class FlowrAnalyzerRdaFilePlugin extends FlowrAnalyzerFilePlugin {
12
+ readonly name = "flowr-analyzer-rda-file-plugin";
13
+ readonly description = "Reads RDA/RData workspace files into their contained R objects.";
14
+ readonly version: SemVer;
15
+ private readonly pattern;
16
+ /**
17
+ * Creates a new instance of the RDA file plugin.
18
+ * @param filePattern - The pattern to identify RDA files, see {@link RdaFilePattern} for the default pattern.
19
+ */
20
+ constructor(filePattern?: RegExp);
21
+ applies(file: PathLike): boolean;
22
+ /**
23
+ * Processes the given file, assigning it the {@link FileRole.Data} role.
24
+ */
25
+ process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): FlowrRDAFile;
26
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerRdaFilePlugin = void 0;
4
+ const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
+ const semver_1 = require("semver");
6
+ const flowr_file_1 = require("../../context/flowr-file");
7
+ const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
+ const flowr_rda_file_1 = require("./files/flowr-rda-file");
9
+ const RdaFilePattern = /\.(rda|rdata)$/i;
10
+ /**
11
+ * This plugin provides support for R workspace files (`.rda`/`.RData`), exposing their top-level objects.
12
+ * @see https://rdrr.io/r/base/load.html
13
+ */
14
+ class FlowrAnalyzerRdaFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
15
+ name = 'flowr-analyzer-rda-file-plugin';
16
+ description = 'Reads RDA/RData workspace files into their contained R objects.';
17
+ version = new semver_1.SemVer('0.1.0');
18
+ pattern;
19
+ /**
20
+ * Creates a new instance of the RDA file plugin.
21
+ * @param filePattern - The pattern to identify RDA files, see {@link RdaFilePattern} for the default pattern.
22
+ */
23
+ constructor(filePattern = RdaFilePattern) {
24
+ super();
25
+ this.pattern = filePattern;
26
+ }
27
+ applies(file) {
28
+ return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
29
+ }
30
+ /**
31
+ * Processes the given file, assigning it the {@link FileRole.Data} role.
32
+ */
33
+ process(_ctx, file) {
34
+ return flowr_rda_file_1.FlowrRDAFile.from(file, flowr_file_1.FileRole.Data);
35
+ }
36
+ }
37
+ exports.FlowrAnalyzerRdaFilePlugin = FlowrAnalyzerRdaFilePlugin;
38
+ //# sourceMappingURL=flowr-analyzer-rda-file-plugin.js.map
@@ -0,0 +1,17 @@
1
+ import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
2
+ import { SemVer } from 'semver';
3
+ import type { PathLike } from 'fs';
4
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
+ import type { FlowrFileProvider } from '../../context/flowr-file';
6
+ /** `Rprofile.site` is the site-wide, `.Rprofile` the user/project profile. */
7
+ export declare const RprofileFilePattern: RegExp;
8
+ /** {@link FlowrAnalyzerLoadingOrderRprofilePlugin} moves the tagged files to the front of the loading order. */
9
+ export declare class FlowrAnalyzerRprofileFilePlugin extends FlowrAnalyzerFilePlugin {
10
+ readonly name = "flowr-analyzer-rprofile-file-plugin";
11
+ readonly description = "Marks R startup profiles (.Rprofile, Rprofile.site).";
12
+ readonly version: SemVer;
13
+ private readonly pathPattern;
14
+ constructor(pathPattern?: RegExp);
15
+ applies(file: PathLike): boolean;
16
+ process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): [FlowrFileProvider, true];
17
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerRprofileFilePlugin = exports.RprofileFilePattern = void 0;
4
+ const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
+ const semver_1 = require("semver");
6
+ const flowr_file_1 = require("../../context/flowr-file");
7
+ const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
+ /** `Rprofile.site` is the site-wide, `.Rprofile` the user/project profile. */
9
+ exports.RprofileFilePattern = /^(\.Rprofile|Rprofile\.site)$/i;
10
+ /** {@link FlowrAnalyzerLoadingOrderRprofilePlugin} moves the tagged files to the front of the loading order. */
11
+ class FlowrAnalyzerRprofileFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
12
+ name = 'flowr-analyzer-rprofile-file-plugin';
13
+ description = 'Marks R startup profiles (.Rprofile, Rprofile.site).';
14
+ version = new semver_1.SemVer('0.1.0');
15
+ pathPattern;
16
+ constructor(pathPattern = exports.RprofileFilePattern) {
17
+ super();
18
+ this.pathPattern = pathPattern;
19
+ }
20
+ applies(file) {
21
+ return this.pathPattern.test((0, built_in_source_1.platformBasename)(file.toString()));
22
+ }
23
+ process(_ctx, file) {
24
+ file.assignRole(flowr_file_1.FileRole.Startup);
25
+ file.assignRole(flowr_file_1.FileRole.Source);
26
+ return [file, true];
27
+ }
28
+ }
29
+ exports.FlowrAnalyzerRprofileFilePlugin = FlowrAnalyzerRprofileFilePlugin;
30
+ //# sourceMappingURL=flowr-analyzer-rprofile-file-plugin.js.map
@@ -0,0 +1,22 @@
1
+ import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
2
+ import { SemVer } from 'semver';
3
+ import type { PathLike } from 'fs';
4
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
+ import type { FlowrFileProvider } from '../../context/flowr-file';
6
+ /**
7
+ * Tags an rv project's `rproject.toml` with the {@link FileRole.Manifest} role and lifts it to a
8
+ * {@link FlowrRProjectFile}, so the meta plugin reading it can look it up by role.
9
+ */
10
+ export declare class FlowrAnalyzerRProjectFilePlugin extends FlowrAnalyzerFilePlugin {
11
+ readonly name = "flowr-analyzer-rproject-file-plugin";
12
+ readonly description = "Marks the rproject.toml manifest of an rv project.";
13
+ readonly version: SemVer;
14
+ private readonly pathPattern;
15
+ /**
16
+ * Creates a new instance of the rproject file plugin.
17
+ * @param pathPattern - The pattern to identify the manifest, see {@link RProjectFilePattern} for the default.
18
+ */
19
+ constructor(pathPattern?: RegExp);
20
+ applies(file: PathLike): boolean;
21
+ process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): [FlowrFileProvider, true];
22
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerRProjectFilePlugin = void 0;
4
+ const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
+ const semver_1 = require("semver");
6
+ const flowr_file_1 = require("../../context/flowr-file");
7
+ const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
+ const flowr_rproject_file_1 = require("./files/flowr-rproject-file");
9
+ /** The manifest of an rv project. */
10
+ const RProjectFilePattern = /^rproject\.toml$/i;
11
+ /**
12
+ * Tags an rv project's `rproject.toml` with the {@link FileRole.Manifest} role and lifts it to a
13
+ * {@link FlowrRProjectFile}, so the meta plugin reading it can look it up by role.
14
+ */
15
+ class FlowrAnalyzerRProjectFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
16
+ name = 'flowr-analyzer-rproject-file-plugin';
17
+ description = 'Marks the rproject.toml manifest of an rv project.';
18
+ version = new semver_1.SemVer('0.1.0');
19
+ pathPattern;
20
+ /**
21
+ * Creates a new instance of the rproject file plugin.
22
+ * @param pathPattern - The pattern to identify the manifest, see {@link RProjectFilePattern} for the default.
23
+ */
24
+ constructor(pathPattern = RProjectFilePattern) {
25
+ super();
26
+ this.pathPattern = pathPattern;
27
+ }
28
+ applies(file) {
29
+ return this.pathPattern.test((0, built_in_source_1.platformBasename)(file.toString()));
30
+ }
31
+ process(_ctx, file) {
32
+ return [flowr_rproject_file_1.FlowrRProjectFile.from(file, flowr_file_1.FileRole.Manifest), true];
33
+ }
34
+ }
35
+ exports.FlowrAnalyzerRProjectFilePlugin = FlowrAnalyzerRProjectFilePlugin;
36
+ //# sourceMappingURL=flowr-analyzer-rproject-file-plugin.js.map
@@ -9,7 +9,7 @@ import type { FlowrFileProvider } from '../../context/flowr-file';
9
9
  */
10
10
  export declare class FlowrAnalyzerMetaTestFilesPlugin extends FlowrAnalyzerFilePlugin {
11
11
  readonly name = "flowr-analyzer-test-files-plugin";
12
- readonly description = "This plugin provides support for loading test files.";
12
+ readonly description = "Loads test files.";
13
13
  readonly version: SemVer;
14
14
  private readonly pathPattern;
15
15
  /**
@@ -12,7 +12,7 @@ const TestPathPattern = /tests?/i;
12
12
  */
13
13
  class FlowrAnalyzerMetaTestFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
14
14
  name = 'flowr-analyzer-test-files-plugin';
15
- description = 'This plugin provides support for loading test files.';
15
+ description = 'Loads test files.';
16
16
  version = new semver_1.SemVer('0.1.0');
17
17
  pathPattern;
18
18
  /**
@@ -9,7 +9,7 @@ import type { FlowrFileProvider } from '../../context/flowr-file';
9
9
  */
10
10
  export declare class FlowrAnalyzerMetaVignetteFilesPlugin extends FlowrAnalyzerFilePlugin {
11
11
  readonly name = "flowr-analyzer-vignette-files-plugin";
12
- readonly description = "This plugin provides support for loading vignette files.";
12
+ readonly description = "Loads vignette files.";
13
13
  readonly version: SemVer;
14
14
  private readonly pathPattern;
15
15
  /**
@@ -12,7 +12,7 @@ const VignettePathPattern = /vignettes?/i;
12
12
  */
13
13
  class FlowrAnalyzerMetaVignetteFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
14
14
  name = 'flowr-analyzer-vignette-files-plugin';
15
- description = 'This plugin provides support for loading vignette files.';
15
+ description = 'Loads vignette files.';
16
16
  version = new semver_1.SemVer('0.1.0');
17
17
  pathPattern;
18
18
  /**
@@ -4,13 +4,12 @@ import type { PathLike } from 'fs';
4
4
  import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
5
  import type { FlowrFileProvider } from '../../context/flowr-file';
6
6
  /**
7
- * Tags a project's virtual-environment lockfiles (e.g. `renv.lock`, `rv.lock`) with the
8
- * {@link FileRole.VirtualEnv} role, so the version plugins that read them (renv/rv) can look them up
9
- * by role instead of scanning every project file.
7
+ * Tags a project's virtual-environment lockfiles with the {@link FileRole.VirtualEnv} role, so the version
8
+ * plugins that read them can look them up by role instead of scanning every project file.
10
9
  */
11
10
  export declare class FlowrAnalyzerVirtualEnvFilePlugin extends FlowrAnalyzerFilePlugin {
12
11
  readonly name = "flowr-analyzer-virtualenv-files-plugin";
13
- readonly description = "This plugin marks virtual-environment lockfiles (renv.lock, rv.lock).";
12
+ readonly description = "Marks virtual-environment lockfiles (renv.lock, rv.lock).";
14
13
  readonly version: SemVer;
15
14
  private readonly pathPattern;
16
15
  /**
@@ -5,16 +5,15 @@ const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
5
  const semver_1 = require("semver");
6
6
  const flowr_file_1 = require("../../context/flowr-file");
7
7
  const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
- /** Lockfiles pinning a project's package environment (`renv.lock`, `rv.lock`). */
9
- const VirtualEnvFilePattern = /^(renv|rv)\.lock$/i;
8
+ /** Lockfiles pinning a project's package environment (`renv.lock`, `rv.lock`, `packrat.lock`). */
9
+ const VirtualEnvFilePattern = /^(renv|rv|packrat)\.lock$/i;
10
10
  /**
11
- * Tags a project's virtual-environment lockfiles (e.g. `renv.lock`, `rv.lock`) with the
12
- * {@link FileRole.VirtualEnv} role, so the version plugins that read them (renv/rv) can look them up
13
- * by role instead of scanning every project file.
11
+ * Tags a project's virtual-environment lockfiles with the {@link FileRole.VirtualEnv} role, so the version
12
+ * plugins that read them can look them up by role instead of scanning every project file.
14
13
  */
15
14
  class FlowrAnalyzerVirtualEnvFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
16
15
  name = 'flowr-analyzer-virtualenv-files-plugin';
17
- description = 'This plugin marks virtual-environment lockfiles (renv.lock, rv.lock).';
16
+ description = 'Marks virtual-environment lockfiles (renv.lock, rv.lock).';
18
17
  version = new semver_1.SemVer('0.1.0');
19
18
  pathPattern;
20
19
  /**
@@ -75,6 +75,11 @@ class FlowrAnalyzerPlugin {
75
75
  processor(context, args) {
76
76
  const now = Date.now();
77
77
  try {
78
+ // record activation before running: many plugins contribute by mutating the context and return `void`, so
79
+ // a return value is not a reliable signal -- a plugin activated if its processor ran for this analysis
80
+ if (context.config.repl.showPlugins) {
81
+ context.activatedPlugins.add(this.constructor.name);
82
+ }
78
83
  const result = this.process(context, args);
79
84
  const duration = Date.now() - now;
80
85
  (0, log_1.expensiveTrace)(generalPluginLog, () => `Plugin ${this.name} (v${this.version.format()}, ${this.type}) executed in ${duration}ms.`);
@@ -8,7 +8,7 @@ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context'
8
8
  */
9
9
  export declare class FlowrAnalyzerLoadingOrderDescriptionFilePlugin extends FlowrAnalyzerLoadingOrderPlugin {
10
10
  readonly name = "flowr-analyzer-package-version-description-file-plugin";
11
- readonly description = "This plugin determines loading order based on the Collate field in DESCRIPTION files.";
11
+ readonly description = "Orders the files by the Collate field of a DESCRIPTION file.";
12
12
  readonly version: SemVer;
13
13
  process(ctx: FlowrAnalyzerContext): void;
14
14
  }
@@ -12,7 +12,7 @@ const flowr_file_1 = require("../../context/flowr-file");
12
12
  */
13
13
  class FlowrAnalyzerLoadingOrderDescriptionFilePlugin extends flowr_analyzer_loading_order_plugin_1.FlowrAnalyzerLoadingOrderPlugin {
14
14
  name = 'flowr-analyzer-package-version-description-file-plugin';
15
- description = 'This plugin determines loading order based on the Collate field in DESCRIPTION files.';
15
+ description = 'Orders the files by the Collate field of a DESCRIPTION file.';
16
16
  version = new semver_1.SemVer('0.1.0');
17
17
  process(ctx) {
18
18
  const descFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.Description);
@@ -0,0 +1,14 @@
1
+ import { SemVer } from 'semver';
2
+ import { FlowrAnalyzerLoadingOrderPlugin } from './flowr-analyzer-loading-order-plugin';
3
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
4
+ export declare const implicitSourcesLog: import("tslog").Logger<import("tslog").ILogObj>;
5
+ /**
6
+ * Orders the files given by `project.implicitSources`, which is already specialized for the project kind.
7
+ * Files that are no implicit sources stay in front, as the implicit entry points consume them.
8
+ */
9
+ export declare class FlowrAnalyzerLoadingOrderImplicitSourcesPlugin extends FlowrAnalyzerLoadingOrderPlugin {
10
+ readonly name = "flowr-analyzer-loading-order-implicit-sources-plugin";
11
+ readonly description = "Orders the files a framework loads implicitly, as configured by project.implicitSources.";
12
+ readonly version: SemVer;
13
+ process(ctx: FlowrAnalyzerContext): void;
14
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerLoadingOrderImplicitSourcesPlugin = exports.implicitSourcesLog = void 0;
4
+ const semver_1 = require("semver");
5
+ const flowr_analyzer_loading_order_plugin_1 = require("./flowr-analyzer-loading-order-plugin");
6
+ const log_1 = require("../../../util/log");
7
+ const glob_1 = require("../../../util/glob");
8
+ exports.implicitSourcesLog = log_1.log.getSubLogger({ name: 'loading-order-implicit-sources' });
9
+ /**
10
+ * Orders the files given by `project.implicitSources`, which is already specialized for the project kind.
11
+ * Files that are no implicit sources stay in front, as the implicit entry points consume them.
12
+ */
13
+ class FlowrAnalyzerLoadingOrderImplicitSourcesPlugin extends flowr_analyzer_loading_order_plugin_1.FlowrAnalyzerLoadingOrderPlugin {
14
+ name = 'flowr-analyzer-loading-order-implicit-sources-plugin';
15
+ description = 'Orders the files a framework loads implicitly, as configured by project.implicitSources.';
16
+ version = new semver_1.SemVer('0.1.0');
17
+ process(ctx) {
18
+ const kind = ctx.projectKind();
19
+ const implicit = ctx.config.project.implicitSources;
20
+ if (!implicit || implicit.length === 0) {
21
+ return;
22
+ }
23
+ const unordered = ctx.files.loadingOrder.getUnorderedRequests();
24
+ const files = unordered.filter(r => r.request === 'file');
25
+ /* node sets keep insertion order! */
26
+ const ordered = new Set();
27
+ const unmatched = [];
28
+ for (const entry of implicit) {
29
+ const matches = (0, glob_1.globMatcher)(entry);
30
+ let matched = false;
31
+ for (const file of files) {
32
+ if (matches(file.content)) {
33
+ ordered.add(file);
34
+ matched = true;
35
+ }
36
+ }
37
+ if (!matched) {
38
+ unmatched.push(`'${entry}'`);
39
+ }
40
+ }
41
+ if (unmatched.length > 0) {
42
+ exports.implicitSourcesLog.warn(`No file of the ${kind} project matches the implicit source(s) ${unmatched.join(', ')}, ignoring them.`);
43
+ }
44
+ if (ordered.size === 0) {
45
+ return;
46
+ }
47
+ const rest = unordered.filter(r => !ordered.has(r));
48
+ exports.implicitSourcesLog.debug(`Ordering implicit sources of ${kind} project: ${[...ordered].map(s => s.content).join(', ')}`);
49
+ ctx.files.loadingOrder.addGuess([...rest, ...ordered]);
50
+ }
51
+ }
52
+ exports.FlowrAnalyzerLoadingOrderImplicitSourcesPlugin = FlowrAnalyzerLoadingOrderImplicitSourcesPlugin;
53
+ //# sourceMappingURL=flowr-analyzer-loading-order-implicit-sources-plugin.js.map
@@ -24,7 +24,7 @@ exports.FlowrAnalyzerLoadingOrderPlugin = FlowrAnalyzerLoadingOrderPlugin;
24
24
  */
25
25
  class DefaultFlowrAnalyzerLoadingOrderPlugin extends FlowrAnalyzerLoadingOrderPlugin {
26
26
  name = 'default-loading-order-plugin';
27
- description = 'This is the default loading order plugin that does nothing.';
27
+ description = 'Does nothing, the default loading order plugin.';
28
28
  version = new semver_1.SemVer('0.0.0');
29
29
  process() {
30
30
  /* we always *have* to have a loading order, this plugin does not have to guess to rely on chronological order */
@@ -0,0 +1,15 @@
1
+ import { SemVer } from 'semver';
2
+ import { FlowrAnalyzerLoadingOrderPlugin } from './flowr-analyzer-loading-order-plugin';
3
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
4
+ /**
5
+ * Moves the R startup profiles ({@link FileRole.Startup}, tagged by {@link FlowrAnalyzerRprofileFilePlugin})
6
+ * to the front of the loading order, as R evaluates them before any project code.
7
+ *
8
+ * This refines the orders the other loading-order plugins produced, so register it after them.
9
+ */
10
+ export declare class FlowrAnalyzerLoadingOrderRprofilePlugin extends FlowrAnalyzerLoadingOrderPlugin {
11
+ readonly name = "flowr-analyzer-loading-order-rprofile-plugin";
12
+ readonly description = "Loads the R startup profiles (.Rprofile, Rprofile.site) before any project code.";
13
+ readonly version: SemVer;
14
+ process(ctx: FlowrAnalyzerContext): void;
15
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowrAnalyzerLoadingOrderRprofilePlugin = void 0;
4
+ const semver_1 = require("semver");
5
+ const flowr_analyzer_loading_order_plugin_1 = require("./flowr-analyzer-loading-order-plugin");
6
+ const flowr_file_1 = require("../../context/flowr-file");
7
+ /** `Rprofile.site` is evaluated before the project's `.Rprofile`, mirroring R's startup sequence. */
8
+ function startupRank(path) {
9
+ return /Rprofile\.site$/i.test(path) ? 0 : 1;
10
+ }
11
+ /**
12
+ * Moves the R startup profiles ({@link FileRole.Startup}, tagged by {@link FlowrAnalyzerRprofileFilePlugin})
13
+ * to the front of the loading order, as R evaluates them before any project code.
14
+ *
15
+ * This refines the orders the other loading-order plugins produced, so register it after them.
16
+ */
17
+ class FlowrAnalyzerLoadingOrderRprofilePlugin extends flowr_analyzer_loading_order_plugin_1.FlowrAnalyzerLoadingOrderPlugin {
18
+ name = 'flowr-analyzer-loading-order-rprofile-plugin';
19
+ description = 'Loads the R startup profiles (.Rprofile, Rprofile.site) before any project code.';
20
+ version = new semver_1.SemVer('0.1.0');
21
+ process(ctx) {
22
+ const startup = new Set(ctx.files.getFilesByRole(flowr_file_1.FileRole.Startup).map(f => f.path()));
23
+ if (startup.size === 0) {
24
+ return;
25
+ }
26
+ const requests = ctx.files.loadingOrder.getUnorderedRequests()
27
+ .filter((r) => r.request === 'file' && startup.has(r.content))
28
+ .sort((a, b) => startupRank(a.content) - startupRank(b.content));
29
+ ctx.files.loadingOrder.prependToOrder(requests);
30
+ }
31
+ }
32
+ exports.FlowrAnalyzerLoadingOrderRprofilePlugin = FlowrAnalyzerLoadingOrderRprofilePlugin;
33
+ //# sourceMappingURL=flowr-analyzer-loading-order-rprofile-plugin.js.map
@@ -6,7 +6,7 @@ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context'
6
6
  */
7
7
  export declare class FlowrAnalyzerMetaDescriptionFilePlugin extends FlowrAnalyzerPackageVersionsPlugin {
8
8
  readonly name = "flowr-analyzer-meta-file-plugin";
9
- readonly description = "This plugin does extract package meta information from R DESCRIPTION files.";
9
+ readonly description = "Extracts package meta information from DESCRIPTION files.";
10
10
  readonly version: SemVer;
11
11
  process(ctx: FlowrAnalyzerContext): void;
12
12
  }
@@ -5,12 +5,13 @@ const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-packa
5
5
  const flowr_analyzer_description_file_plugin_1 = require("../file-plugins/flowr-analyzer-description-file-plugin");
6
6
  const semver_1 = require("semver");
7
7
  const flowr_file_1 = require("../../context/flowr-file");
8
+ const flowr_analyzer_meta_context_1 = require("../../context/flowr-analyzer-meta-context");
8
9
  /**
9
10
  * This plugin extracts package meta information from R `DESCRIPTION` files.
10
11
  */
11
12
  class FlowrAnalyzerMetaDescriptionFilePlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
12
13
  name = 'flowr-analyzer-meta-file-plugin';
13
- description = 'This plugin does extract package meta information from R DESCRIPTION files.';
14
+ description = 'Extracts package meta information from DESCRIPTION files.';
14
15
  version = new semver_1.SemVer('0.1.0');
15
16
  process(ctx) {
16
17
  const descFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.Description);
@@ -24,18 +25,22 @@ class FlowrAnalyzerMetaDescriptionFilePlugin extends flowr_analyzer_package_vers
24
25
  /** this will do the caching etc. for me */
25
26
  const deps = descFiles[0];
26
27
  const pkg = deps.packageName();
27
- if (pkg) {
28
- ctx.meta.setNamespace(pkg);
29
- ctx.meta.setProjectName(pkg);
30
- }
31
- const ver = deps.version();
32
- if (ver) {
33
- ctx.meta.setProjectVersion(ver);
34
- }
35
- const title = deps.packageTitle();
36
- if (title) {
37
- ctx.meta.setProjectTitle(title);
38
- }
28
+ ctx.meta.contribute({
29
+ name: pkg,
30
+ // a DESCRIPTION marks a real package, so its name is also the namespace `a::b` resolves against
31
+ namespace: pkg,
32
+ version: deps.version(),
33
+ title: deps.packageTitle(),
34
+ authors: deps.authors(),
35
+ encoding: deps.content().get('Encoding')?.[0],
36
+ licenses: deps.license(),
37
+ declares: {
38
+ imports: deps.imports(),
39
+ depends: deps.depends(),
40
+ suggests: deps.suggests(),
41
+ linkingTo: deps.linkingTo()
42
+ }
43
+ }, flowr_analyzer_meta_context_1.MetaPriority.Description);
39
44
  }
40
45
  }
41
46
  exports.FlowrAnalyzerMetaDescriptionFilePlugin = FlowrAnalyzerMetaDescriptionFilePlugin;
@@ -0,0 +1,13 @@
1
+ import { FlowrAnalyzerPackageVersionsPlugin } from './flowr-analyzer-package-versions-plugin';
2
+ import { SemVer } from 'semver';
3
+ import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
4
+ /**
5
+ * Extracts the project metadata and the declared dependencies from the `rproject.toml` of an rv project.
6
+ * The name is contributed without a namespace: an rv project is no package, so `a::b` must not resolve against it.
7
+ */
8
+ export declare class FlowrAnalyzerMetaRProjectFilePlugin extends FlowrAnalyzerPackageVersionsPlugin {
9
+ readonly name = "flowr-analyzer-meta-rproject-file-plugin";
10
+ readonly description = "Extracts project meta information and dependencies from an rproject.toml.";
11
+ readonly version: SemVer;
12
+ process(ctx: FlowrAnalyzerContext): void;
13
+ }