@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
@@ -13,7 +13,18 @@ const flowr_file_1 = require("./flowr-file");
13
13
  const log_1 = require("../../util/log");
14
14
  const fs_1 = __importDefault(require("fs"));
15
15
  const path_1 = __importDefault(require("path"));
16
+ const files_1 = require("../../util/files");
17
+ const project_kind_1 = require("./project-kind");
16
18
  const fileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-files-context' });
19
+ const notebookExtension = /\.(ipynb|rmd|qmd|rnw)$/;
20
+ const shinyDescriptionTypes = new Set(['shiny', 'shiny-app', 'shinyapp']);
21
+ /** the (lower-cased) file names a shiny app is assembled from; the app is `app.r`, or the `ui.r`+`server.r` pair */
22
+ const shinyEntryFiles = new Set(['app.r', 'ui.r', 'server.r', 'global.r']);
23
+ /**
24
+ * Evidence that a file actually is part of a shiny app rather than just sharing a name: a load of the shiny stack
25
+ * or a call to one of its entry points. Kept broad enough to also catch `bslib`/`shinydashboard`/`golem` apps.
26
+ */
27
+ const shinyUsage = /(?:library|require|requireNamespace|loadNamespace)\s*\(\s*['"]?(?:shiny|bslib|shinydashboard|shinyMobile|golem|flexdashboard)\b|\b(?:shinyApp|shinyServer|shinyUI|runApp|fluidPage|fluidRow|navbarPage|bootstrapPage|fillPage|dashboardPage|page_fluid|page_sidebar|page_navbar|pageWithSidebar)\s*\(/;
17
28
  function wrapFile(file, roles) {
18
29
  if (typeof file === 'string') {
19
30
  return new flowr_file_1.FlowrTextFile(file, roles);
@@ -43,6 +54,12 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
43
54
  discoveryPlugins;
44
55
  /* files that are part of the analysis, e.g. source files */
45
56
  byRole = Object.fromEntries(Object.values(flowr_file_1.FileRole).map(k => [k, []]));
57
+ /** cached {@link projectKind}, invalidated whenever the files change (added or reset) */
58
+ projectKindCache = undefined;
59
+ requestedRoots = [];
60
+ /** cached {@link root}, fixed on first use as the ids built from it have to stay stable */
61
+ rootCache = undefined;
62
+ rootResolved = false;
46
63
  constructor(loadingOrder, plugins, fileLoaders) {
47
64
  super(loadingOrder.getAttachedContext(), flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin(), []);
48
65
  this.discoveryPlugins = plugins;
@@ -55,12 +72,30 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
55
72
  this.consideredFiles.length = 0;
56
73
  this.inlineFiles.length = 0;
57
74
  this.byRole = Object.fromEntries(Object.values(flowr_file_1.FileRole).map(k => [k, []]));
75
+ this.projectKindCache = undefined;
76
+ this.requestedRoots.length = 0;
77
+ this.rootCache = undefined;
78
+ this.rootResolved = false;
79
+ }
80
+ /** The directory the analysis was asked about: a `project`'s folder, or the one holding the requested file(s). */
81
+ root() {
82
+ if (!this.rootResolved) {
83
+ this.rootResolved = true;
84
+ this.rootCache = (0, files_1.commonDirectory)(this.requestedRoots);
85
+ }
86
+ return this.rootCache;
87
+ }
88
+ /** The path of `filePath` seen from the {@link root}, see {@link relativeTo}. */
89
+ relativePath(filePath) {
90
+ const root = this.root();
91
+ return root === undefined ? filePath : (0, files_1.relativeTo)(root, filePath);
58
92
  }
59
93
  /**
60
94
  * Record that a file has been considered during dataflow analysis.
61
95
  */
62
96
  addConsideredFile(path) {
63
97
  this.consideredFiles.push(path);
98
+ this.projectKindCache = undefined;
64
99
  }
65
100
  /**
66
101
  * Get all files that have been considered during dataflow analysis.
@@ -68,6 +103,82 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
68
103
  consideredFilesList() {
69
104
  return this.consideredFiles;
70
105
  }
106
+ projectKind() {
107
+ return this.projectKindCache ??= this.classifyProject();
108
+ }
109
+ classifyProject() {
110
+ const descriptions = this.getFilesByRole(flowr_file_1.FileRole.Description);
111
+ // an explicit `Type: shiny` in the DESCRIPTION settles it without looking at any source
112
+ if (descriptions.some(d => shinyDescriptionTypes.has(d.type() ?? ''))) {
113
+ return project_kind_1.ProjectKind.ShinyApp;
114
+ }
115
+ // the readable entry files by (lower-cased) name, plus every known file name for the coarser checks below
116
+ const entries = new Map();
117
+ const names = new Set();
118
+ for (const f of this.getAllFiles()) {
119
+ const name = path_1.default.basename(f.path()).toLowerCase();
120
+ names.add(name);
121
+ if (shinyEntryFiles.has(name)) {
122
+ entries.set(name, f);
123
+ }
124
+ }
125
+ const pending = this.loadingOrder.getUnorderedRequests()
126
+ .filter(r => r.request === 'file').map(r => r.content);
127
+ for (const p of [...pending, ...this.consideredFiles]) {
128
+ const name = path_1.default.basename(p).toLowerCase();
129
+ names.add(name);
130
+ if (shinyEntryFiles.has(name) && !entries.has(name)) {
131
+ entries.set(name, this.getFileByPath(p) ?? new flowr_file_1.FlowrTextFile(p));
132
+ }
133
+ }
134
+ if (this.isShinyApp(names, entries)) {
135
+ return project_kind_1.ProjectKind.ShinyApp;
136
+ }
137
+ if (descriptions.length > 0) {
138
+ return project_kind_1.ProjectKind.Package;
139
+ }
140
+ if (names.size === 0) {
141
+ return project_kind_1.ProjectKind.Unknown;
142
+ }
143
+ for (const name of names) {
144
+ if (notebookExtension.test(name)) {
145
+ return project_kind_1.ProjectKind.Notebook;
146
+ }
147
+ }
148
+ let rSources = 0;
149
+ for (const name of names) {
150
+ if (name.endsWith('.r')) {
151
+ rSources++;
152
+ }
153
+ }
154
+ return rSources <= 1 ? project_kind_1.ProjectKind.Script : project_kind_1.ProjectKind.Project;
155
+ }
156
+ /**
157
+ * Whether the project is a shiny app: it has the canonical entry files (a single `app.R`, or the `ui.R`+`server.R`
158
+ * pair -- a lone `server.R` is not enough) and one of them actually loads or calls the shiny stack. The usage
159
+ * check keeps a coincidental `ui.R`/`server.R` pair from being mistaken for an app; only when none of the entry
160
+ * files can be read do we fall back to trusting the file names alone.
161
+ */
162
+ isShinyApp(names, entries) {
163
+ if (!names.has('app.r') && !(names.has('ui.r') && names.has('server.r'))) {
164
+ return false;
165
+ }
166
+ let couldRead = false;
167
+ for (const f of entries.values()) {
168
+ let content;
169
+ try {
170
+ content = f.content().toString();
171
+ }
172
+ catch {
173
+ continue;
174
+ }
175
+ couldRead = true;
176
+ if (shinyUsage.test(content)) {
177
+ return true;
178
+ }
179
+ }
180
+ return !couldRead;
181
+ }
71
182
  /**
72
183
  * Add multiple requests to the context. This is just a convenience method that calls {@link addRequest} for each request.
73
184
  */
@@ -82,9 +193,14 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
82
193
  */
83
194
  addRequest(request) {
84
195
  if (request.request !== 'project') {
196
+ if (request.request === 'file') {
197
+ this.requestedRoots.push(path_1.default.dirname(request.content));
198
+ }
85
199
  this.loadingOrder.addRequest(request);
200
+ this.projectKindCache = undefined;
86
201
  return;
87
202
  }
203
+ this.requestedRoots.push(request.content);
88
204
  const active = this.discoveryPlugins.length > 0
89
205
  ? this.discoveryPlugins
90
206
  : [flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin()];
@@ -125,6 +241,7 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
125
241
  this.byRole[r].push(f);
126
242
  }
127
243
  }
244
+ this.projectKindCache = undefined;
128
245
  return f;
129
246
  }
130
247
  hasCached(path) {
@@ -200,24 +317,25 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
200
317
  }
201
318
  return fFinal;
202
319
  }
320
+ /** Resolve the file at `path`, loading it from disk through the {@link FlowrAnalyzerFilePlugin}s if unknown. */
321
+ resolveFile(path) {
322
+ const file = this.files.get(path);
323
+ if (file !== undefined && file !== null) {
324
+ return file;
325
+ }
326
+ if (this.ctx.config.project.resolveUnknownPathsOnDisk) {
327
+ fileLog.debug(`File ${path} not found in context, trying to load from disk.`);
328
+ if (fs_1.default.existsSync(path)) {
329
+ return this.addFile(new flowr_file_1.FlowrTextFile(path));
330
+ }
331
+ }
332
+ return undefined;
333
+ }
203
334
  resolveRequest(r) {
204
335
  if (r.request === 'text') {
205
336
  return { r };
206
337
  }
207
- const file = this.files.get(r.content);
208
- if (file === undefined && this.ctx.config.project.resolveUnknownPathsOnDisk) {
209
- fileLog.debug(`File ${r.content} not found in context, trying to load from disk.`);
210
- if (fs_1.default.existsSync(r.content)) {
211
- const loadedFile = this.addFile(new flowr_file_1.FlowrTextFile(r.content));
212
- return {
213
- r: {
214
- request: 'text',
215
- content: loadedFile.content().toString(),
216
- },
217
- path: loadedFile.path()
218
- };
219
- }
220
- }
338
+ const file = this.resolveFile(r.content);
221
339
  (0, assert_1.guard)(file !== undefined && file !== null, `File ${r.content} not found in context.`);
222
340
  const content = file.content();
223
341
  return {
@@ -69,6 +69,12 @@ export declare class FlowrAnalyzerLoadingOrderContext extends AbstractFlowrAnaly
69
69
  * In case you have a certain order, use the `certain` flag to indicate this -- but please take care of *really* being certain!
70
70
  */
71
71
  addGuess(guess: readonly RParseRequest[], certain?: boolean): void;
72
+ /**
73
+ * Move `requests` to the front of every order known so far, keeping their relative order.
74
+ * Use this for files R evaluates before anything else (e.g. `.Rprofile`), as it refines the
75
+ * existing orders instead of competing with them like {@link addGuess} would.
76
+ */
77
+ prependToOrder(requests: readonly RParseRequest[]): void;
72
78
  currentGuesses(): readonly (readonly RParseRequest[])[];
73
79
  currentKnownOrder(): readonly RParseRequest[] | undefined;
74
80
  peekLoadingOrder(): readonly RParseRequest[] | undefined;
@@ -76,6 +76,26 @@ class FlowrAnalyzerLoadingOrderContext extends abstract_flowr_analyzer_context_1
76
76
  this.guesses.push(guess);
77
77
  }
78
78
  }
79
+ /**
80
+ * Move `requests` to the front of every order known so far, keeping their relative order.
81
+ * Use this for files R evaluates before anything else (e.g. `.Rprofile`), as it refines the
82
+ * existing orders instead of competing with them like {@link addGuess} would.
83
+ */
84
+ prependToOrder(requests) {
85
+ if (requests.length === 0) {
86
+ return;
87
+ }
88
+ const front = (order) => [...requests, ...order.filter(r => !requests.includes(r))];
89
+ if (this.knownOrder) {
90
+ this.knownOrder = front(this.knownOrder);
91
+ }
92
+ for (let i = 0; i < this.guesses.length; i++) {
93
+ this.guesses[i] = front(this.guesses[i]);
94
+ }
95
+ if (!this.knownOrder && this.guesses.length === 0) {
96
+ this.addGuess(front(this.unordered));
97
+ }
98
+ }
79
99
  currentGuesses() {
80
100
  return this.guesses;
81
101
  }
@@ -1,4 +1,55 @@
1
1
  import type { SemVer } from 'semver';
2
+ import type { RAuthorInfo } from '../../util/r-author';
3
+ import type { RLicenseElementInfo } from '../../util/r-license';
4
+ import type { Package } from '../plugins/package-version-plugins/package';
5
+ /**
6
+ * How much a {@link ProjectMetaFields | contribution} is trusted, in case several sources disagree.
7
+ * A higher value wins; among equal values the first contribution stays.
8
+ */
9
+ export declare enum MetaPriority {
10
+ /** derived from a lockfile, e.g. the `r_version` of an `rv.lock` */
11
+ Lockfile = 0,
12
+ /** declared in a project manifest, e.g. an `rproject.toml` */
13
+ Manifest = 1,
14
+ /** declared in a `DESCRIPTION` file, which identifies an actual R package */
15
+ Description = 2
16
+ }
17
+ /**
18
+ * The packages a project declares, grouped as a `DESCRIPTION` groups them. A source without such groups
19
+ * (an `rproject.toml` just lists `dependencies`) reports them as {@link DeclaredPackages#imports}.
20
+ */
21
+ export interface DeclaredPackages {
22
+ imports?: readonly Package[];
23
+ depends?: readonly Package[];
24
+ suggests?: readonly Package[];
25
+ linkingTo?: readonly Package[];
26
+ }
27
+ /** The project metadata a plugin may contribute, see {@link FlowrAnalyzerMetaContext#contribute}. */
28
+ export interface ProjectMetaFields {
29
+ /** the project name, e.g. the `Package` of a `DESCRIPTION` or the `[project] name` of an `rproject.toml` */
30
+ name?: string;
31
+ /** the human-readable project title */
32
+ title?: string;
33
+ /** the project version */
34
+ version?: SemVer & {
35
+ str: string;
36
+ };
37
+ /** the R version the project targets, e.g. the `r_version` of an `rproject.toml` */
38
+ rVersion?: string;
39
+ /**
40
+ * The namespace `a::b` resolves against. Only set this for a real R package: a plain project
41
+ * (e.g. an rv project) has a name but no namespace, and claiming one changes symbol resolution.
42
+ */
43
+ namespace?: string;
44
+ /** the project authors */
45
+ authors?: RAuthorInfo[];
46
+ /** the encoding the project's files are written in */
47
+ encoding?: string;
48
+ /** the project licenses */
49
+ licenses?: RLicenseElementInfo[];
50
+ /** the packages the project declares, used to report on them; what is loadable lives in the dependency context */
51
+ declares?: DeclaredPackages;
52
+ }
2
53
  export interface ReadOnlyFlowrAnalyzerMetaContext {
3
54
  /**
4
55
  * The name of this context.
@@ -18,34 +69,65 @@ export interface ReadOnlyFlowrAnalyzerMetaContext {
18
69
  getProjectVersion(): SemVer & {
19
70
  str: string;
20
71
  } | undefined;
72
+ /**
73
+ * Get the R version the project targets, if any source declares one.
74
+ */
75
+ getRVersion(): string | undefined;
21
76
  /**
22
77
  * Get the project namespace.
23
78
  * Any symbol resolve like `a::b` will resolve against this, if `a` matches the namespace.
24
79
  */
25
80
  getNamespace(): string | undefined;
81
+ /**
82
+ * Get the project authors.
83
+ */
84
+ getAuthors(): RAuthorInfo[] | undefined;
85
+ /**
86
+ * Get the encoding the project's files are written in.
87
+ */
88
+ getEncoding(): string | undefined;
89
+ /**
90
+ * Get the project licenses.
91
+ */
92
+ getLicenses(): RLicenseElementInfo[] | undefined;
93
+ /**
94
+ * Get the packages the project declares, grouped by how they are declared.
95
+ */
96
+ getDeclaredPackages(): DeclaredPackages;
26
97
  }
27
98
  /**
28
99
  * This is the context responsible for managing the project metadata such as name, version, title, and namespace.
29
100
  *
101
+ * The metadata is source-agnostic: plugins {@link FlowrAnalyzerMetaContext#contribute | contribute} whatever their
102
+ * file declares (`DESCRIPTION`, `rproject.toml`, a lockfile, ...) and consumers read it from here rather than from
103
+ * any particular file. Conflicts are settled by {@link MetaPriority}, so contributions are order-independent.
104
+ *
30
105
  * If you are interested in inspecting this metadata, refer to {@link ReadOnlyFlowrAnalyzerMetaContext}.
31
106
  */
32
107
  export declare class FlowrAnalyzerMetaContext implements ReadOnlyFlowrAnalyzerMetaContext {
33
108
  readonly name = "flowr-analyzer-meta-context";
34
- private projectName;
35
- private projectTitle;
36
- private projectVersion;
37
- private namespace;
109
+ private readonly fields;
110
+ /** runs the plugins that contribute the metadata, as they only do so on demand */
111
+ private readonly ensureContributed;
112
+ constructor(ensureContributed?: () => void);
38
113
  reset(): void;
39
- setProjectName(name: string): void;
114
+ /**
115
+ * Contribute what a source declares about the project; `undefined` fields are ignored, so a plugin can pass
116
+ * whatever it happens to know.
117
+ * @param fields - the metadata to contribute
118
+ * @param priority - how much to trust these fields against other sources
119
+ */
120
+ contribute(fields: ProjectMetaFields, priority: MetaPriority): this;
121
+ private get;
40
122
  getProjectName(): string | undefined;
41
- setProjectTitle(title: string): void;
42
123
  getProjectTitle(): string | undefined;
43
- setProjectVersion(version: SemVer & {
44
- str: string;
45
- }): void;
46
124
  getProjectVersion(): SemVer & {
47
125
  str: string;
48
126
  } | undefined;
49
- setNamespace(namespace: string): void;
127
+ getRVersion(): string | undefined;
50
128
  getNamespace(): string | undefined;
129
+ getAuthors(): RAuthorInfo[] | undefined;
130
+ getEncoding(): string | undefined;
131
+ getLicenses(): RLicenseElementInfo[] | undefined;
132
+ getDeclaredPackages(): DeclaredPackages;
51
133
  }
@@ -1,46 +1,87 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowrAnalyzerMetaContext = void 0;
3
+ exports.FlowrAnalyzerMetaContext = exports.MetaPriority = void 0;
4
+ /**
5
+ * How much a {@link ProjectMetaFields | contribution} is trusted, in case several sources disagree.
6
+ * A higher value wins; among equal values the first contribution stays.
7
+ */
8
+ var MetaPriority;
9
+ (function (MetaPriority) {
10
+ /** derived from a lockfile, e.g. the `r_version` of an `rv.lock` */
11
+ MetaPriority[MetaPriority["Lockfile"] = 0] = "Lockfile";
12
+ /** declared in a project manifest, e.g. an `rproject.toml` */
13
+ MetaPriority[MetaPriority["Manifest"] = 1] = "Manifest";
14
+ /** declared in a `DESCRIPTION` file, which identifies an actual R package */
15
+ MetaPriority[MetaPriority["Description"] = 2] = "Description";
16
+ })(MetaPriority || (exports.MetaPriority = MetaPriority = {}));
4
17
  /**
5
18
  * This is the context responsible for managing the project metadata such as name, version, title, and namespace.
6
19
  *
20
+ * The metadata is source-agnostic: plugins {@link FlowrAnalyzerMetaContext#contribute | contribute} whatever their
21
+ * file declares (`DESCRIPTION`, `rproject.toml`, a lockfile, ...) and consumers read it from here rather than from
22
+ * any particular file. Conflicts are settled by {@link MetaPriority}, so contributions are order-independent.
23
+ *
7
24
  * If you are interested in inspecting this metadata, refer to {@link ReadOnlyFlowrAnalyzerMetaContext}.
8
25
  */
9
26
  class FlowrAnalyzerMetaContext {
10
27
  name = 'flowr-analyzer-meta-context';
11
- projectName;
12
- projectTitle;
13
- projectVersion;
14
- namespace;
28
+ fields = new Map();
29
+ /** runs the plugins that contribute the metadata, as they only do so on demand */
30
+ ensureContributed;
31
+ constructor(ensureContributed = () => { }) {
32
+ this.ensureContributed = ensureContributed;
33
+ }
15
34
  reset() {
16
- this.projectName = undefined;
17
- this.projectTitle = undefined;
18
- this.projectVersion = undefined;
19
- this.namespace = undefined;
35
+ this.fields.clear();
20
36
  }
21
- setProjectName(name) {
22
- this.projectName = name;
37
+ /**
38
+ * Contribute what a source declares about the project; `undefined` fields are ignored, so a plugin can pass
39
+ * whatever it happens to know.
40
+ * @param fields - the metadata to contribute
41
+ * @param priority - how much to trust these fields against other sources
42
+ */
43
+ contribute(fields, priority) {
44
+ for (const [key, value] of Object.entries(fields)) {
45
+ if (value === undefined) {
46
+ continue;
47
+ }
48
+ const have = this.fields.get(key);
49
+ if (have === undefined || priority > have.priority) {
50
+ this.fields.set(key, { value, priority });
51
+ }
52
+ }
53
+ return this;
23
54
  }
24
- getProjectName() {
25
- return this.projectName;
55
+ get(key) {
56
+ this.ensureContributed();
57
+ return this.fields.get(key)?.value;
26
58
  }
27
- setProjectTitle(title) {
28
- this.projectTitle = title;
59
+ getProjectName() {
60
+ return this.get('name');
29
61
  }
30
62
  getProjectTitle() {
31
- return this.projectTitle;
32
- }
33
- setProjectVersion(version) {
34
- this.projectVersion = version;
63
+ return this.get('title');
35
64
  }
36
65
  getProjectVersion() {
37
- return this.projectVersion;
66
+ return this.get('version');
38
67
  }
39
- setNamespace(namespace) {
40
- this.namespace = namespace;
68
+ getRVersion() {
69
+ return this.get('rVersion');
41
70
  }
42
71
  getNamespace() {
43
- return this.namespace;
72
+ return this.get('namespace');
73
+ }
74
+ getAuthors() {
75
+ return this.get('authors');
76
+ }
77
+ getEncoding() {
78
+ return this.get('encoding');
79
+ }
80
+ getLicenses() {
81
+ return this.get('licenses');
82
+ }
83
+ getDeclaredPackages() {
84
+ return this.get('declares') ?? {};
44
85
  }
45
86
  }
46
87
  exports.FlowrAnalyzerMetaContext = FlowrAnalyzerMetaContext;
@@ -32,6 +32,13 @@ export declare enum FileRole {
32
32
  License = "license",
33
33
  /** Files describing a project's virtual/pinned package environment, e.g., `renv.lock` or `rv.lock`. */
34
34
  VirtualEnv = "virtual-env",
35
+ /** A project manifest that is no `DESCRIPTION`, e.g. the `rproject.toml` of an rv project. */
36
+ Manifest = "manifest",
37
+ /**
38
+ * R sources evaluated at startup, before any project code (`.Rprofile`, `Rprofile.site`).
39
+ * These commonly bootstrap a package manager, e.g. by sourcing `packrat/init.R` or `renv/activate.R`.
40
+ */
41
+ Startup = "startup",
35
42
  /**
36
43
  * Catch-all for any file that provides usable R source code to incorporate into the analysis.
37
44
  * Please note, that the loading order/inclusion and even potential relevance of these source files
@@ -33,6 +33,13 @@ var FileRole;
33
33
  FileRole["License"] = "license";
34
34
  /** Files describing a project's virtual/pinned package environment, e.g., `renv.lock` or `rv.lock`. */
35
35
  FileRole["VirtualEnv"] = "virtual-env";
36
+ /** A project manifest that is no `DESCRIPTION`, e.g. the `rproject.toml` of an rv project. */
37
+ FileRole["Manifest"] = "manifest";
38
+ /**
39
+ * R sources evaluated at startup, before any project code (`.Rprofile`, `Rprofile.site`).
40
+ * These commonly bootstrap a package manager, e.g. by sourcing `packrat/init.R` or `renv/activate.R`.
41
+ */
42
+ FileRole["Startup"] = "startup";
36
43
  /**
37
44
  * Catch-all for any file that provides usable R source code to incorporate into the analysis.
38
45
  * Please note, that the loading order/inclusion and even potential relevance of these source files
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The kind of project that flowR is analyzing.
3
+ *
4
+ * This lives in its own module as the configuration refers to it (see `FlowrConfig.specializeConfig`) and the
5
+ * files context, which classifies it, pulls in the config itself.
6
+ * @module
7
+ */
8
+ /** The kind of project that flowR is analyzing, see {@link FlowrAnalyzerFilesContext#projectKind}. */
9
+ export declare enum ProjectKind {
10
+ /** An R package (has a `DESCRIPTION` file that does not mark it as a {@link ProjectKind.ShinyApp}). */
11
+ Package = "package",
12
+ /** A single R script. */
13
+ Script = "script",
14
+ /** A Shiny application (`Type: shiny` in the `DESCRIPTION`, `app.R`, or `ui.R` with `server.R`). */
15
+ ShinyApp = "shiny-app",
16
+ /** A notebook or literate document (`.ipynb`, `.Rmd`, `.qmd`, `.rnw`). */
17
+ Notebook = "notebook",
18
+ /** A multi-file project that is not a package. */
19
+ Project = "project",
20
+ /** The kind could not be determined (e.g. before the files are known). */
21
+ Unknown = "unknown"
22
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * The kind of project that flowR is analyzing.
4
+ *
5
+ * This lives in its own module as the configuration refers to it (see `FlowrConfig.specializeConfig`) and the
6
+ * files context, which classifies it, pulls in the config itself.
7
+ * @module
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ProjectKind = void 0;
11
+ /** The kind of project that flowR is analyzing, see {@link FlowrAnalyzerFilesContext#projectKind}. */
12
+ var ProjectKind;
13
+ (function (ProjectKind) {
14
+ /** An R package (has a `DESCRIPTION` file that does not mark it as a {@link ProjectKind.ShinyApp}). */
15
+ ProjectKind["Package"] = "package";
16
+ /** A single R script. */
17
+ ProjectKind["Script"] = "script";
18
+ /** A Shiny application (`Type: shiny` in the `DESCRIPTION`, `app.R`, or `ui.R` with `server.R`). */
19
+ ProjectKind["ShinyApp"] = "shiny-app";
20
+ /** A notebook or literate document (`.ipynb`, `.Rmd`, `.qmd`, `.rnw`). */
21
+ ProjectKind["Notebook"] = "notebook";
22
+ /** A multi-file project that is not a package. */
23
+ ProjectKind["Project"] = "project";
24
+ /** The kind could not be determined (e.g. before the files are known). */
25
+ ProjectKind["Unknown"] = "unknown";
26
+ })(ProjectKind || (exports.ProjectKind = ProjectKind = {}));
27
+ //# sourceMappingURL=project-kind.js.map