@eagleoutice/flowr 2.10.9 → 2.11.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 (417) hide show
  1. package/README.md +116 -38
  2. package/abstract-interpretation/absint-visitor.js +6 -3
  3. package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
  4. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
  5. package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
  6. package/abstract-interpretation/domains/interval-domain.d.ts +1 -1
  7. package/abstract-interpretation/domains/interval-domain.js +1 -1
  8. package/abstract-interpretation/domains/lattice.d.ts +1 -1
  9. package/abstract-interpretation/domains/partial-product-domain.d.ts +1 -1
  10. package/abstract-interpretation/domains/partial-product-domain.js +2 -2
  11. package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
  12. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  13. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +1 -1
  14. package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
  15. package/abstract-interpretation/domains/singleton-domain.d.ts +1 -1
  16. package/abstract-interpretation/domains/singleton-domain.js +1 -1
  17. package/abstract-interpretation/domains/state-abstract-domain.d.ts +1 -1
  18. package/abstract-interpretation/domains/state-abstract-domain.js +2 -2
  19. package/abstract-interpretation/unsupported-functions.d.ts +3 -2
  20. package/abstract-interpretation/unsupported-functions.js +38 -28
  21. package/cli/benchmark-app.js +2 -1
  22. package/cli/common/options.d.ts +2 -108
  23. package/cli/common/options.js +3 -27
  24. package/cli/common/script.js +3 -2
  25. package/cli/common/scripts-info.d.ts +2 -123
  26. package/cli/common/scripts-info.js +0 -17
  27. package/cli/flowr-main-options.d.ts +5 -0
  28. package/cli/flowr-main-options.js +10 -0
  29. package/cli/flowr.js +48 -11
  30. package/cli/repl/commands/repl-cfg.js +9 -9
  31. package/cli/repl/commands/repl-commands.js +5 -0
  32. package/cli/repl/commands/repl-dataflow.js +31 -24
  33. package/cli/repl/commands/repl-main.d.ts +6 -0
  34. package/cli/repl/commands/repl-normalize.js +15 -12
  35. package/cli/repl/commands/repl-parse.js +1 -1
  36. package/cli/repl/commands/repl-query.js +4 -5
  37. package/cli/repl/commands/repl-quit.js +2 -1
  38. package/cli/repl/core.d.ts +11 -0
  39. package/cli/repl/core.js +101 -3
  40. package/cli/repl/execute.js +3 -2
  41. package/cli/repl/parser/slice-query-parser.d.ts +16 -0
  42. package/cli/repl/parser/slice-query-parser.js +52 -0
  43. package/cli/repl/print-version.d.ts +3 -1
  44. package/cli/repl/print-version.js +21 -2
  45. package/cli/repl/server/connection.d.ts +3 -0
  46. package/cli/repl/server/connection.js +65 -31
  47. package/cli/repl/server/messages/message-analysis.d.ts +10 -0
  48. package/cli/repl/server/messages/message-analysis.js +6 -2
  49. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  50. package/cli/script-core/summarizer-core.js +13 -32
  51. package/cli/wiki.d.ts +3 -1
  52. package/cli/wiki.js +6 -1
  53. package/config.d.ts +22 -10
  54. package/config.js +33 -7
  55. package/control-flow/diff-cfg.d.ts +1 -1
  56. package/control-flow/diff-cfg.js +1 -1
  57. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  58. package/control-flow/simple-visitor.js +6 -5
  59. package/control-flow/useless-loop.js +2 -2
  60. package/core/print/dataflow-printer.d.ts +2 -2
  61. package/core/print/dataflow-printer.js +2 -2
  62. package/core/steps/all/static-slicing/00-slice.js +1 -1
  63. package/data/pkgdb/pkgdb-latest.json.br +0 -0
  64. package/data/pkgdb/pkgdb-tiny.json.br +0 -0
  65. package/dataflow/environments/append.d.ts +2 -2
  66. package/dataflow/environments/append.js +4 -10
  67. package/dataflow/environments/apply-kill.d.ts +21 -0
  68. package/dataflow/environments/apply-kill.js +155 -0
  69. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  70. package/dataflow/environments/built-in-proc-name.js +4 -0
  71. package/dataflow/environments/built-in.d.ts +4 -0
  72. package/dataflow/environments/built-in.js +4 -0
  73. package/dataflow/environments/default-builtin-config.d.ts +183 -67
  74. package/dataflow/environments/default-builtin-config.js +358 -147
  75. package/dataflow/environments/environment.d.ts +49 -31
  76. package/dataflow/environments/environment.js +144 -25
  77. package/dataflow/environments/identifier.d.ts +65 -2
  78. package/dataflow/environments/identifier.js +37 -2
  79. package/dataflow/environments/overwrite.js +2 -10
  80. package/dataflow/environments/reference-to-maybe.d.ts +2 -0
  81. package/dataflow/environments/reference-to-maybe.js +56 -11
  82. package/dataflow/environments/resolve-by-name.d.ts +1 -1
  83. package/dataflow/environments/resolve-by-name.js +23 -9
  84. package/dataflow/environments/scoping.d.ts +9 -2
  85. package/dataflow/environments/scoping.js +15 -2
  86. package/dataflow/eval/values/general.js +4 -0
  87. package/dataflow/extractor.js +35 -4
  88. package/dataflow/graph/df-helper.d.ts +14 -0
  89. package/dataflow/graph/df-helper.js +41 -0
  90. package/dataflow/graph/graph.d.ts +4 -1
  91. package/dataflow/graph/graph.js +6 -2
  92. package/dataflow/info.d.ts +27 -1
  93. package/dataflow/internal/linker.d.ts +5 -1
  94. package/dataflow/internal/linker.js +34 -9
  95. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -5
  96. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -0
  97. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -8
  98. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +7 -13
  99. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +9 -48
  100. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -47
  101. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +17 -0
  102. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +7 -2
  103. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
  104. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +61 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +9 -0
  106. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +37 -3
  107. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +391 -21
  108. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +13 -0
  109. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +58 -0
  110. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
  111. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +3 -2
  112. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +132 -25
  113. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +9 -10
  114. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +25 -0
  115. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +94 -0
  116. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +11 -4
  117. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +30 -0
  118. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +279 -0
  119. package/dataflow/internal/process/functions/call/known-call-handling.js +4 -3
  120. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
  121. package/dataflow/internal/process/functions/call/named-call-handling.js +23 -0
  122. package/dataflow/origin/dfg-get-origin.d.ts +1 -1
  123. package/dataflow/origin/dfg-get-origin.js +1 -1
  124. package/dataflow/processor.d.ts +6 -0
  125. package/documentation/data/faq/faqs.d.ts +2 -1
  126. package/documentation/data/faq/faqs.js +78 -57
  127. package/documentation/data/interface/doc-writing-code.js +4 -80
  128. package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
  129. package/documentation/data/server/doc-data-server-messages.js +15 -7
  130. package/documentation/doc-readme.js +15 -15
  131. package/documentation/doc-util/doc-cfg.d.ts +3 -1
  132. package/documentation/doc-util/doc-cfg.js +3 -3
  133. package/documentation/doc-util/doc-dfg.d.ts +3 -1
  134. package/documentation/doc-util/doc-dfg.js +3 -3
  135. package/documentation/doc-util/doc-files.d.ts +3 -1
  136. package/documentation/doc-util/doc-files.js +9 -6
  137. package/documentation/doc-util/doc-normalized-ast.d.ts +3 -1
  138. package/documentation/doc-util/doc-normalized-ast.js +2 -2
  139. package/documentation/doc-util/doc-query.d.ts +2 -1
  140. package/documentation/doc-util/doc-query.js +2 -2
  141. package/documentation/doc-util/doc-repl.js +1 -0
  142. package/documentation/doc-util/doc-structure.js +1 -2
  143. package/documentation/doc-util/doc-types.d.ts +6 -6
  144. package/documentation/doc-util/doc-types.js +11 -9
  145. package/documentation/issue-linting-rule.js +1 -2
  146. package/documentation/wiki-analyzer.js +9 -9
  147. package/documentation/wiki-cfg.js +40 -41
  148. package/documentation/wiki-core.js +121 -32
  149. package/documentation/wiki-create-linting-rules.d.ts +6 -0
  150. package/documentation/wiki-create-linting-rules.js +95 -0
  151. package/documentation/wiki-dataflow-graph.js +112 -77
  152. package/documentation/wiki-engine.js +1 -2
  153. package/documentation/wiki-faq.d.ts +2 -1
  154. package/documentation/wiki-faq.js +4 -4
  155. package/documentation/wiki-interface.js +22 -8
  156. package/documentation/wiki-linter.d.ts +1 -1
  157. package/documentation/wiki-linter.js +16 -6
  158. package/documentation/wiki-linting-and-testing.js +2 -2
  159. package/documentation/wiki-mk/doc-context.d.ts +3 -3
  160. package/documentation/wiki-mk/doc-maker.d.ts +2 -0
  161. package/documentation/wiki-mk/doc-maker.js +7 -1
  162. package/documentation/wiki-normalized-ast.js +5 -5
  163. package/documentation/wiki-onboarding.d.ts +2 -1
  164. package/documentation/wiki-onboarding.js +5 -5
  165. package/documentation/wiki-overview.js +4 -17
  166. package/documentation/wiki-package-database.d.ts +9 -0
  167. package/documentation/wiki-package-database.js +63 -0
  168. package/documentation/wiki-query.js +86 -84
  169. package/documentation/wiki-search.js +4 -5
  170. package/documentation/wiki-setup.js +6 -7
  171. package/gas.d.ts +74 -0
  172. package/gas.js +18 -0
  173. package/linter/linter-executor.js +2 -8
  174. package/linter/linter-format.d.ts +4 -11
  175. package/linter/linter-rules.d.ts +111 -86
  176. package/linter/linter-rules.js +9 -1
  177. package/linter/rules/absolute-path.d.ts +2 -7
  178. package/linter/rules/absolute-path.js +8 -5
  179. package/linter/rules/dataframe-access-validation.d.ts +1 -6
  180. package/linter/rules/dataframe-access-validation.js +8 -6
  181. package/linter/rules/dead-code.d.ts +2 -11
  182. package/linter/rules/dead-code.js +16 -11
  183. package/linter/rules/deprecated-functions.d.ts +3 -3
  184. package/linter/rules/file-path-validity.d.ts +1 -6
  185. package/linter/rules/file-path-validity.js +5 -5
  186. package/linter/rules/function-finder-util.d.ts +7 -11
  187. package/linter/rules/function-finder-util.js +9 -6
  188. package/linter/rules/naming-convention.d.ts +2 -7
  189. package/linter/rules/naming-convention.js +3 -2
  190. package/linter/rules/network-functions.d.ts +2 -7
  191. package/linter/rules/network-functions.js +14 -12
  192. package/linter/rules/no-leaked-credentials.d.ts +36 -0
  193. package/linter/rules/no-leaked-credentials.js +75 -0
  194. package/linter/rules/problematic-inputs.d.ts +1 -8
  195. package/linter/rules/problematic-inputs.js +5 -4
  196. package/linter/rules/roxygen-arguments.d.ts +2 -7
  197. package/linter/rules/roxygen-arguments.js +13 -20
  198. package/linter/rules/seeded-randomness.d.ts +2 -7
  199. package/linter/rules/seeded-randomness.js +7 -4
  200. package/linter/rules/software-has-license.d.ts +31 -0
  201. package/linter/rules/software-has-license.js +46 -0
  202. package/linter/rules/software-has-tests.d.ts +38 -0
  203. package/linter/rules/software-has-tests.js +48 -0
  204. package/linter/rules/stop-with-call-arg.d.ts +2 -7
  205. package/linter/rules/stop-with-call-arg.js +3 -2
  206. package/linter/rules/undefined-symbol.d.ts +39 -0
  207. package/linter/rules/undefined-symbol.js +80 -0
  208. package/linter/rules/unused-definition.d.ts +3 -8
  209. package/linter/rules/unused-definition.js +7 -5
  210. package/linter/rules/useless-loop.d.ts +2 -7
  211. package/linter/rules/useless-loop.js +5 -2
  212. package/package.json +5 -5
  213. package/project/cache/flowr-analyzer-cache.d.ts +2 -0
  214. package/project/cache/flowr-analyzer-cache.js +9 -1
  215. package/project/context/flowr-analyzer-context.d.ts +13 -14
  216. package/project/context/flowr-analyzer-context.js +4 -0
  217. package/project/context/flowr-analyzer-dependencies-context.d.ts +16 -8
  218. package/project/context/flowr-analyzer-dependencies-context.js +36 -4
  219. package/project/context/flowr-analyzer-environment-context.d.ts +2 -4
  220. package/project/context/flowr-analyzer-environment-context.js +3 -4
  221. package/project/context/flowr-analyzer-files-context.d.ts +13 -0
  222. package/project/context/flowr-analyzer-files-context.js +12 -2
  223. package/project/context/flowr-analyzer-gas-context.d.ts +28 -0
  224. package/project/context/flowr-analyzer-gas-context.js +101 -0
  225. package/project/context/flowr-file.d.ts +2 -0
  226. package/project/context/flowr-file.js +2 -0
  227. package/project/flowr-analyzer-builder.js +3 -0
  228. package/project/flowr-analyzer.d.ts +2 -1
  229. package/project/flowr-analyzer.js +3 -1
  230. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +13 -15
  231. package/project/plugins/file-plugins/files/flowr-namespace-file.js +36 -13
  232. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +13 -7
  233. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +56 -11
  234. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +27 -0
  235. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +41 -0
  236. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
  237. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +2 -2
  238. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -1
  239. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +5 -5
  240. package/project/plugins/flowr-analyzer-plugin.d.ts +15 -8
  241. package/project/plugins/flowr-analyzer-plugin.js +14 -7
  242. package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.d.ts +19 -0
  243. package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.js +35 -0
  244. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +18 -0
  245. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +62 -0
  246. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +63 -0
  247. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +174 -0
  248. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
  249. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +6 -0
  250. package/project/plugins/package-version-plugins/package.d.ts +3 -0
  251. package/project/plugins/package-version-plugins/package.js +12 -0
  252. package/project/plugins/package-version-plugins/pkgdb.d.ts +133 -0
  253. package/project/plugins/package-version-plugins/pkgdb.js +370 -0
  254. package/project/plugins/plugin-registry.d.ts +5 -1
  255. package/project/plugins/plugin-registry.js +10 -1
  256. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +22 -0
  257. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +47 -0
  258. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +1 -1
  259. package/queries/catalog/call-context-query/call-context-query-executor.js +62 -8
  260. package/queries/catalog/call-context-query/call-context-query-format.d.ts +4 -2
  261. package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
  262. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +8 -0
  263. package/queries/catalog/dependencies-query/dependencies-query-executor.js +31 -3
  264. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -1
  265. package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
  266. package/queries/catalog/dependencies-query/function-info/function-info.d.ts +1 -1
  267. package/queries/catalog/dependencies-query/function-info/other-path-functions.d.ts +2 -0
  268. package/queries/catalog/dependencies-query/function-info/other-path-functions.js +27 -0
  269. package/queries/catalog/dependencies-query/function-info/read-functions.js +5 -4
  270. package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
  271. package/queries/catalog/dependencies-query/function-info/test-functions.js +18 -177
  272. package/queries/catalog/dependencies-query/function-info/visualize-functions.js +3 -1
  273. package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
  274. package/queries/catalog/dice-query/dice-query-executor.d.ts +8 -0
  275. package/queries/catalog/dice-query/dice-query-executor.js +52 -0
  276. package/queries/catalog/dice-query/dice-query-format.d.ts +53 -0
  277. package/queries/catalog/dice-query/dice-query-format.js +102 -0
  278. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  279. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
  280. package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -0
  281. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
  282. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -0
  283. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
  284. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -0
  285. package/queries/catalog/linter-query/linter-query-executor.js +8 -0
  286. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
  287. package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
  288. package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
  289. package/queries/catalog/origin-query/origin-query-format.js +1 -0
  290. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
  291. package/queries/catalog/provenance-query/provenance-query-format.js +1 -0
  292. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
  293. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -0
  294. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  295. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -0
  296. package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
  297. package/queries/query.d.ts +18 -1
  298. package/queries/query.js +3 -1
  299. package/r-bridge/data/data.d.ts +7 -2
  300. package/r-bridge/data/data.js +8 -2
  301. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +0 -1
  302. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -1
  303. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
  304. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +1 -1
  305. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
  306. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +13 -4
  307. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +55 -44
  308. package/r-bridge/parser.js +2 -9
  309. package/r-bridge/shell.d.ts +8 -1
  310. package/r-bridge/shell.js +26 -7
  311. package/search/flowr-search-builder.d.ts +2 -2
  312. package/search/flowr-search-builder.js +1 -1
  313. package/search/flowr-search-filters.d.ts +30 -9
  314. package/search/flowr-search-filters.js +26 -21
  315. package/search/search-executor/search-enrichers.d.ts +601 -1
  316. package/search/search-executor/search-enrichers.js +30 -6
  317. package/slicing/static/static-slicer.d.ts +39 -11
  318. package/slicing/static/static-slicer.js +44 -14
  319. package/util/collections/queue.d.ts +16 -0
  320. package/util/collections/queue.js +38 -0
  321. package/util/log.d.ts +1 -1
  322. package/util/log.js +1 -1
  323. package/util/mermaid/dfg.d.ts +2 -2
  324. package/util/mermaid/dfg.js +2 -2
  325. package/util/mermaid/mermaid.d.ts +4 -0
  326. package/util/mermaid/mermaid.js +8 -1
  327. package/util/objects.d.ts +9 -0
  328. package/util/objects.js +54 -0
  329. package/util/proc.d.ts +6 -0
  330. package/util/proc.js +20 -0
  331. package/util/version.js +10 -2
  332. package/cli/common/features.d.ts +0 -9
  333. package/cli/common/features.js +0 -35
  334. package/cli/script-core/statistics-core.d.ts +0 -6
  335. package/cli/script-core/statistics-core.js +0 -103
  336. package/cli/script-core/statistics-helper-core.d.ts +0 -6
  337. package/cli/script-core/statistics-helper-core.js +0 -85
  338. package/cli/statistics-app.d.ts +0 -11
  339. package/cli/statistics-app.js +0 -16
  340. package/cli/statistics-helper-app.d.ts +0 -11
  341. package/cli/statistics-helper-app.js +0 -14
  342. package/statistics/features/common-syntax-probability.d.ts +0 -38
  343. package/statistics/features/common-syntax-probability.js +0 -169
  344. package/statistics/features/feature.d.ts +0 -179
  345. package/statistics/features/feature.js +0 -38
  346. package/statistics/features/post-processing.d.ts +0 -18
  347. package/statistics/features/post-processing.js +0 -26
  348. package/statistics/features/supported/assignments/assignments.d.ts +0 -12
  349. package/statistics/features/supported/assignments/assignments.js +0 -56
  350. package/statistics/features/supported/assignments/post-process.d.ts +0 -6
  351. package/statistics/features/supported/assignments/post-process.js +0 -126
  352. package/statistics/features/supported/comments/comments.d.ts +0 -18
  353. package/statistics/features/supported/comments/comments.js +0 -143
  354. package/statistics/features/supported/comments/post-process.d.ts +0 -6
  355. package/statistics/features/supported/comments/post-process.js +0 -51
  356. package/statistics/features/supported/control-flow/control-flow.d.ts +0 -17
  357. package/statistics/features/supported/control-flow/control-flow.js +0 -69
  358. package/statistics/features/supported/control-flow/post-process.d.ts +0 -6
  359. package/statistics/features/supported/control-flow/post-process.js +0 -66
  360. package/statistics/features/supported/data-access/data-access.d.ts +0 -15
  361. package/statistics/features/supported/data-access/data-access.js +0 -122
  362. package/statistics/features/supported/data-access/post-process.d.ts +0 -6
  363. package/statistics/features/supported/data-access/post-process.js +0 -108
  364. package/statistics/features/supported/defined-functions/defined-functions.d.ts +0 -34
  365. package/statistics/features/supported/defined-functions/defined-functions.js +0 -145
  366. package/statistics/features/supported/defined-functions/post-process.d.ts +0 -6
  367. package/statistics/features/supported/defined-functions/post-process.js +0 -168
  368. package/statistics/features/supported/expression-list/post-process.d.ts +0 -6
  369. package/statistics/features/supported/expression-list/post-process.js +0 -45
  370. package/statistics/features/supported/expression-list/statistics-expression-list.d.ts +0 -9
  371. package/statistics/features/supported/expression-list/statistics-expression-list.js +0 -37
  372. package/statistics/features/supported/loops/loops.d.ts +0 -20
  373. package/statistics/features/supported/loops/loops.js +0 -81
  374. package/statistics/features/supported/loops/post-process.d.ts +0 -6
  375. package/statistics/features/supported/loops/post-process.js +0 -73
  376. package/statistics/features/supported/used-functions/post-process.d.ts +0 -6
  377. package/statistics/features/supported/used-functions/post-process.js +0 -176
  378. package/statistics/features/supported/used-functions/used-functions.d.ts +0 -24
  379. package/statistics/features/supported/used-functions/used-functions.js +0 -99
  380. package/statistics/features/supported/used-packages/post-process.d.ts +0 -6
  381. package/statistics/features/supported/used-packages/post-process.js +0 -122
  382. package/statistics/features/supported/used-packages/used-packages.d.ts +0 -16
  383. package/statistics/features/supported/used-packages/used-packages.js +0 -140
  384. package/statistics/features/supported/values/post-process.d.ts +0 -6
  385. package/statistics/features/supported/values/post-process.js +0 -73
  386. package/statistics/features/supported/values/values.d.ts +0 -14
  387. package/statistics/features/supported/values/values.js +0 -111
  388. package/statistics/features/supported/variables/post-process.d.ts +0 -15
  389. package/statistics/features/supported/variables/post-process.js +0 -126
  390. package/statistics/features/supported/variables/variables.d.ts +0 -15
  391. package/statistics/features/supported/variables/variables.js +0 -62
  392. package/statistics/meta-statistics.d.ts +0 -32
  393. package/statistics/meta-statistics.js +0 -16
  394. package/statistics/output/file-provider.d.ts +0 -36
  395. package/statistics/output/file-provider.js +0 -96
  396. package/statistics/output/print-stats.d.ts +0 -29
  397. package/statistics/output/print-stats.js +0 -81
  398. package/statistics/output/statistics-file.d.ts +0 -36
  399. package/statistics/output/statistics-file.js +0 -68
  400. package/statistics/statistics.d.ts +0 -29
  401. package/statistics/statistics.js +0 -108
  402. package/statistics/summarizer/auto-detect.d.ts +0 -5
  403. package/statistics/summarizer/auto-detect.js +0 -34
  404. package/statistics/summarizer/first-phase/process.d.ts +0 -6
  405. package/statistics/summarizer/first-phase/process.js +0 -81
  406. package/statistics/summarizer/post-process/clusterer.d.ts +0 -25
  407. package/statistics/summarizer/post-process/clusterer.js +0 -40
  408. package/statistics/summarizer/post-process/file-based-count.d.ts +0 -16
  409. package/statistics/summarizer/post-process/file-based-count.js +0 -47
  410. package/statistics/summarizer/post-process/histogram.d.ts +0 -57
  411. package/statistics/summarizer/post-process/histogram.js +0 -126
  412. package/statistics/summarizer/post-process/post-process-output.d.ts +0 -14
  413. package/statistics/summarizer/post-process/post-process-output.js +0 -102
  414. package/statistics/summarizer/second-phase/process.d.ts +0 -15
  415. package/statistics/summarizer/second-phase/process.js +0 -118
  416. package/statistics/summarizer/summarizer.d.ts +0 -34
  417. package/statistics/summarizer/summarizer.js +0 -141
@@ -4,7 +4,6 @@ exports.WikiEngine = void 0;
4
4
  const shell_1 = require("../r-bridge/shell");
5
5
  const shell_executor_1 = require("../r-bridge/shell-executor");
6
6
  const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
7
- const doc_files_1 = require("./doc-util/doc-files");
8
7
  const doc_structure_1 = require("./doc-util/doc-structure");
9
8
  const doc_maker_1 = require("./wiki-mk/doc-maker");
10
9
  /**
@@ -26,7 +25,7 @@ is synchronous, faster, and no longer needs an R installation, but requires the
26
25
  To allow users of R to freely choose their backend between the R interpreter and the tree-sitter parser,
27
26
  we provide the concept of engines.
28
27
 
29
- Engines can be loaded with [flowR's configuration file](${doc_files_1.FlowrWikiBaseRef}/Interface#configuring-flowr). Additionally, they
28
+ Engines can be loaded with ${ctx.linkPage('wiki/Interface', "flowR's configuration file", 'configuring-flowr')}. Additionally, they
30
29
  are exposed with some command line options (e.g., when using the docker image of flowR):
31
30
 
32
31
  - ${ctx.cliOption('flowr', 'engine.r-shell.disabled', false)} to disable the ${ctx.link(shell_1.RShell)} engine
@@ -1,8 +1,9 @@
1
+ import type { DocMakerArgs } from './wiki-mk/doc-maker';
1
2
  import { DocMaker } from './wiki-mk/doc-maker';
2
3
  /**
3
4
  * https://github.com/flowr-analysis/flowr/wiki/FAQ
4
5
  */
5
6
  export declare class WikiFaq extends DocMaker<'wiki/FAQ.md'> {
6
7
  constructor();
7
- text(): string;
8
+ text({ ctx }: DocMakerArgs): string;
8
9
  }
@@ -10,10 +10,10 @@ class WikiFaq extends doc_maker_1.DocMaker {
10
10
  constructor() {
11
11
  super('wiki/FAQ.md', module.filename, 'frequently asked questions');
12
12
  }
13
- text() {
14
- const faqs = (0, faqs_1.registerFaqs)();
15
- return `
16
- ${faqs.toMarkdown()}
13
+ text({ ctx }) {
14
+ const faqs = (0, faqs_1.registerFaqs)(ctx);
15
+ return `
16
+ ${faqs.toMarkdown()}
17
17
  `.trim();
18
18
  }
19
19
  }
@@ -8,6 +8,7 @@ const doc_server_message_1 = require("./doc-util/doc-server-message");
8
8
  const doc_data_server_messages_1 = require("./data/server/doc-data-server-messages");
9
9
  const doc_code_1 = require("./doc-util/doc-code");
10
10
  const retriever_1 = require("../r-bridge/retriever");
11
+ const core_1 = require("../cli/repl/core");
11
12
  const doc_docker_1 = require("./doc-util/doc-docker");
12
13
  const doc_repl_1 = require("./doc-util/doc-repl");
13
14
  const doc_dfg_1 = require("./doc-util/doc-dfg");
@@ -21,10 +22,10 @@ const doc_maker_1 = require("./wiki-mk/doc-maker");
21
22
  const doc_writing_code_1 = require("./data/interface/doc-writing-code");
22
23
  const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
23
24
  const flowr_analyzer_1 = require("../project/flowr-analyzer");
24
- async function explainServer(parser) {
25
- (0, doc_data_server_messages_1.documentAllServerMessages)();
25
+ async function explainServer(parser, ctx) {
26
+ (0, doc_data_server_messages_1.documentAllServerMessages)(ctx);
26
27
  return `
27
- As explained in the [Overview](${doc_files_1.FlowrWikiBaseRef}/Overview), you can simply run the [TCP](https://de.wikipedia.org/wiki/Transmission_Control_Protocol)&nbsp;server by adding the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'server', true)} flag (and, due to the interactive mode, exit with the conventional <kbd>CTRL</kbd>+<kbd>C</kbd>).
28
+ As explained in the ${ctx.linkPage('wiki/Overview', 'Overview')}, you can simply run the [TCP](https://de.wikipedia.org/wiki/Transmission_Control_Protocol)&nbsp;server by adding the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'server', true)} flag (and, due to the interactive mode, exit with the conventional <kbd>CTRL</kbd>+<kbd>C</kbd>).
28
29
  Currently, every connection is handled by the same underlying \`${shell_1.RShell.name}\` - so the server is not designed to handle many clients at a time.
29
30
  Additionally, the server is not well guarded against attacks (e.g., you can theoretically spawn an arbitrary number of&nbsp;${shell_1.RShell.name} sessions on the target machine).
30
31
 
@@ -34,8 +35,7 @@ ${(0, doc_structure_1.block)({
34
35
  type: 'NOTE',
35
36
  content: `
36
37
  The default ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'server', false)} uses a simple [TCP](https://de.wikipedia.org/wiki/Transmission_Control_Protocol)
37
- connection. If you want _flowR_ to expose a [WebSocket](https://de.wikipedia.org/wiki/WebSocket) server instead, add the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'ws', false)} flag (i.e., ${(0, doc_cli_option_1.multipleCliOptions)('flowr', 'server', 'ws')}) when starting _flowR_ from the command line.
38
- `
38
+ connection. If you want _flowR_ to expose a [WebSocket](https://de.wikipedia.org/wiki/WebSocket) server instead, add the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'ws', false)} flag (i.e., ${(0, doc_cli_option_1.multipleCliOptions)('flowr', 'server', 'ws')}) when starting _flowR_ from the command line.`
39
39
  })}
40
40
 
41
41
  ${await (0, doc_server_message_1.printServerMessages)(parser)}
@@ -168,6 +168,11 @@ Many commands that allow for an R-expression (like ${ctx.replCmd('dataflow*')})
168
168
  if the argument starts with \`${retriever_1.fileProtocol}\`.
169
169
  If you are working from the root directory of the _flowR_ repository, the following gives you the parsed AST of the example file using the ${ctx.replCmd('parse')} command:
170
170
 
171
+ > **Watch mode**: Replace \`${retriever_1.fileProtocol}\` with \`${core_1.watchProtocol}\` to enter watch mode.
172
+ > flowR runs the command immediately and then re-runs it every time the file (or any file inside the folder) changes.
173
+ > Enter any other command to leave watch mode.
174
+ > For example: \`:df ${core_1.watchProtocol}analysis.R\`
175
+
171
176
  ${await (0, doc_repl_1.documentReplSession)(parser, [{
172
177
  command: `:parse ${retriever_1.fileProtocol}test/testfiles/example.R`,
173
178
  description: `Retrieve the parsed AST of the example file.
@@ -207,7 +212,7 @@ function explainConfigFile(ctx) {
207
212
  When running _flowR_, you may want to specify some behaviors with a dedicated configuration file.
208
213
  By default, flowR looks for a file named \`${flowr_main_options_1.defaultConfigFile}\` in the current working directory (or any higher directory).
209
214
  You can also specify a different file with ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'config-file')} or pass the configuration inline using ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'config-json')}.
210
- To inspect the current configuration, you can run flowr with the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')} flag, or use the \`config\` [Query](${doc_files_1.FlowrWikiBaseRef}/Query%20API).
215
+ To inspect the current configuration, you can run flowr with the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')} flag, or use the \`config\` ${ctx.linkPage('wiki/Query API', 'Query')}.
211
216
  Within the REPL this works by running the following:
212
217
 
213
218
  ${(0, doc_code_1.codeBlock)('shell', ':query @config')}
@@ -221,7 +226,7 @@ The following summarizes the configuration options:
221
226
  You may use this to overwrite _flowR_'s handling of built-in function and even completely clear the preset definitions shipped with flowR.
222
227
  See [Configure BuiltIn Semantics](#configure-builtin-semantics) for more information.
223
228
  - \`solver\`: allows to configure how _flowR_ resolves variables and their values (currently we support: ${Object.values(config_1.VariableResolve).map(v => `\`${v}\``).join(', ')}), as well as if pointer analysis should be active.
224
- - \`engines\`: allows to configure the engines used by _flowR_ to interact with R code. See the [Engines wiki page](${doc_files_1.FlowrWikiBaseRef}/Engines) for more information.
229
+ - \`engines\`: allows to configure the engines used by _flowR_ to interact with R code. See the ${ctx.linkPage('wiki/Engines', 'Engines wiki page')} for more information.
225
230
  - \`defaultEngine\`: allows to specify the default engine to use for interacting with R code. If not set, an arbitrary engine from the specified list will be used.
226
231
  - \`abstractInterpretation\`: allows to configure how _flowR_ performs abstract interpretation, although we currently only support data frame shape inference through abstract interpretation.
227
232
  - \`defaultPlugins\`: allows to configure which plugins to load by default when creating a new ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} instance.
@@ -258,6 +263,8 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
258
263
  variables: config_1.VariableResolve.Alias,
259
264
  evalStrings: true,
260
265
  trackEnvironments: true,
266
+ eagerlyLoadPackages: false,
267
+ eagerlyLoadPackageDatabase: false,
261
268
  resolveSource: {
262
269
  dropPaths: config_1.DropPathsOption.No,
263
270
  ignoreCapitalization: true,
@@ -278,6 +285,13 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
278
285
  maxReadLines: 1_000_000
279
286
  }
280
287
  }
288
+ },
289
+ gas: {
290
+ thresholds: {
291
+ memory: { problematic: 0.7, critical: 0.9 },
292
+ timeMs: { problematic: 100_000, critical: 120_000 }
293
+ },
294
+ features: {}
281
295
  }
282
296
  }, null, 2))}
283
297
 
@@ -349,7 +363,7 @@ ${(0, doc_writing_code_1.explainWritingCode)(shell, ctx)}
349
363
  <a id='communicating-with-the-server'></a>
350
364
  ## 💬 Communicating with the Server
351
365
 
352
- ${await explainServer(shell)}
366
+ ${await explainServer(shell, ctx)}
353
367
  `;
354
368
  }
355
369
  }
@@ -5,5 +5,5 @@ import { DocMaker } from './wiki-mk/doc-maker';
5
5
  */
6
6
  export declare class WikiLinter extends DocMaker<'wiki/Linter.md'> {
7
7
  constructor();
8
- protected text({ treeSitter }: DocMakerArgs): Promise<string>;
8
+ protected text({ treeSitter, ctx }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -129,6 +129,10 @@ function(x) {
129
129
  eval(x)
130
130
  }
131
131
  `, tagTypes);
132
+ rule(knownParser, 'software-has-license', 'SoftwareHasLicenseConfig', 'SOFTWARE_HAS_LICENSE', 'lint-software-has-license', 'cat("a project without a license")', tagTypes);
133
+ rule(knownParser, 'software-has-tests', 'SoftwareHasTestsConfig', 'SOFTWARE_HAS_TESTS', 'lint-software-has-tests', 'cat("hello")', tagTypes);
134
+ rule(knownParser, 'no-leaked-credentials', 'NoLeakedCredentialsConfig', 'NO_LEAKED_CREDENTIALS', 'lint-no-leaked-credentials', 'password <- "s3cr3t"', tagTypes);
135
+ rule(knownParser, 'undefined-symbol', 'UndefinedSymbolConfig', 'UNDEFINED_SYMBOL', 'lint-undefined-symbol', 'undefined_helper(42)', tagTypes);
132
136
  function rule(parser, name, configType, ruleType, testfile, example, types) {
133
137
  const rule = linter_rules_1.LintingRules[name];
134
138
  const tags = rule.info.tags.toSorted((a, b) => {
@@ -202,10 +206,11 @@ function getAllLintingRulesWitCertainty(certainty) {
202
206
  function linkToRule(name) {
203
207
  return `[${name}](${doc_files_1.FlowrWikiBaseRef}/${encodeURIComponent(getPageNameForLintingRule(name).replaceAll(' ', '-'))})`;
204
208
  }
205
- async function getTextMainPage(knownParser, tagTypes) {
209
+ async function getTextMainPage(knownParser, tagTypes, ctx) {
206
210
  const rules = registerRules(knownParser, tagTypes.info);
207
211
  return `
208
- This page describes the flowR linter, which is a tool that utilizes flowR's dataflow analysis to find common issues in R scripts. The linter can currently be used through the linter [query](${doc_files_1.FlowrWikiBaseRef}/Query%20API).
212
+ This page describes the flowR linter, which is a tool that utilizes flowR's dataflow analysis to find common issues in R scripts. The linter can currently be used through the linter ${ctx.linkPage('wiki/Query API', 'query')}.
213
+ Some rules also draw on the ${ctx.linkPage('wiki/Package Database', 'package database')}.
209
214
  For example:
210
215
 
211
216
  ${await (async () => {
@@ -224,6 +229,11 @@ ${res}
224
229
 
225
230
  ${(0, doc_structure_1.section)('Linting Rules', 2, 'linting-rules')}
226
231
 
232
+ ${(0, doc_structure_1.block)({
233
+ type: 'NOTE',
234
+ content: `If you want to add a new linting rule, see ${ctx.linkPage('wiki/Create Linting Rules')}.`
235
+ })}
236
+
227
237
  The following linting rules are available:
228
238
 
229
239
  ${await (async () => {
@@ -276,13 +286,13 @@ async function getRulesPages(knownParser, tagTypes) {
276
286
  return result;
277
287
  }
278
288
  /** Maps file-names to their content, the 'main' file is named 'main' */
279
- async function getTexts(parser) {
289
+ async function getTexts(parser, ctx) {
280
290
  const tagTypes = (0, doc_types_1.getTypesFromFolder)({
281
291
  rootFolder: path_1.default.resolve('./src/linter/'),
282
292
  inlineTypes: doc_types_1.mermaidHide
283
293
  });
284
294
  return {
285
- 'main': await getTextMainPage(parser, tagTypes),
295
+ 'main': await getTextMainPage(parser, tagTypes, ctx),
286
296
  ...await getRulesPages(parser, tagTypes)
287
297
  };
288
298
  }
@@ -293,8 +303,8 @@ class WikiLinter extends doc_maker_1.DocMaker {
293
303
  constructor() {
294
304
  super('wiki/Linter.md', module.filename, 'linter');
295
305
  }
296
- async text({ treeSitter }) {
297
- const texts = await getTexts(treeSitter);
306
+ async text({ treeSitter, ctx }) {
307
+ const texts = await getTexts(treeSitter, ctx);
298
308
  for (const [file, content] of Object.entries(texts)) {
299
309
  if (file === 'main') {
300
310
  continue; // main is printed below
@@ -104,7 +104,7 @@ The set of currently supported capabilities and their IDs can be found in ${(0,
104
104
 
105
105
  The resulting labels are used in the test report that is generated as part of the test output.
106
106
  They group tests by the capabilities they test and allow the report to display how many tests ensure that any given capability is properly supported.
107
- The report can be found on the wiki's [capabilities page](${doc_files_1.FlowrWikiBaseRef}/Capabilities).
107
+ The report can be found on the wiki's ${ctx.linkPage('wiki/Capabilities', 'capabilities page')}.
108
108
 
109
109
  To add new labels, simply add them to the relevant section in ${(0, doc_files_1.getFilePathMd)('../r-bridge/data/data.ts')} as part of a pull request.
110
110
 
@@ -214,7 +214,7 @@ We explain the most important workflows in the following:
214
214
  - reporting code coverage
215
215
  - running the [linter](#linting) and reporting its results
216
216
  - deploying the documentation to [GitHub Pages](${doc_files_1.FlowrSiteBaseRef}/doc/)
217
- - [release.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/release.yaml) is responsible for creating a new release, only to be run by repository owners. Furthermore, it adds the new docker image to [docker hub](${doc_files_1.FlowrDockerRef}).
217
+ - [release.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/release.yaml) is responsible for creating a new release, only to be run by repository owners. Furthermore, it adds the new docker image to ${ctx.linkPage('flowr:docker', 'docker hub')}.
218
218
  - [broken-links-and-wiki.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/broken-links-and-wiki.yaml) repeatedly tests that all links are not dead!
219
219
 
220
220
  <a id='linting'></a>
@@ -130,8 +130,8 @@ export interface GeneralDocContext {
130
130
  * ```
131
131
  *
132
132
  * Creates a (markdown) link to the `myMethod` member of the `MyClass` class in the code base.
133
- * @see {@link GeneralWikiContext#link|link} - for the underlying impl.
134
- * @see {@link GeneralWikiContext#linkO|linkO} - to link using an object reference instead of a class and member name (e.g. for helper objects).
133
+ * @see {@link GeneralDocContext#link|link} - for the underlying impl.
134
+ * @see {@link GeneralDocContext#linkO|linkO} - to link using an object reference instead of a class and member name (e.g. for helper objects).
135
135
  */
136
136
  linkM<T extends NamedPrototype>(cls: T, element: ProtoKeys<T> | StaticKeys<T>, fmt?: LinkFormat & {
137
137
  hideClass?: boolean;
@@ -152,7 +152,7 @@ export interface GeneralDocContext {
152
152
  * ```
153
153
  * Creates a (markdown) link to the `registerPluginMaker` function in the code base
154
154
  * using the file path as link name.
155
- * @see {@link GeneralWikiContext#link|link} - to create a link with a custom name/using the type name by default.
155
+ * @see {@link GeneralDocContext#link|link} - to create a link with a custom name/using the type name by default.
156
156
  * @see {@link linkFile} - for the underlying impl.
157
157
  */
158
158
  linkFile(element: ElementIdOrRef): string;
@@ -28,6 +28,8 @@ export declare enum WikiChangeType {
28
28
  UnimportantChange = 1,
29
29
  Identical = 2
30
30
  }
31
+ /** Strips `\r` so generated files stay consistent regardless of OS/checkout settings. */
32
+ export declare function normalizeLineEndings(text: string): string;
31
33
  export interface DocMakerLike<Target extends string = string> {
32
34
  make(args: DocMakerArgs & DocMakerOutputArgs): Promise<boolean>;
33
35
  getTarget(): Target;
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DocMaker = exports.WikiChangeType = void 0;
4
+ exports.normalizeLineEndings = normalizeLineEndings;
4
5
  var WikiChangeType;
5
6
  (function (WikiChangeType) {
6
7
  WikiChangeType[WikiChangeType["Changed"] = 0] = "Changed";
7
8
  WikiChangeType[WikiChangeType["UnimportantChange"] = 1] = "UnimportantChange";
8
9
  WikiChangeType[WikiChangeType["Identical"] = 2] = "Identical";
9
10
  })(WikiChangeType || (exports.WikiChangeType = WikiChangeType = {}));
11
+ /** Strips `\r` so generated files stay consistent regardless of OS/checkout settings. */
12
+ function normalizeLineEndings(text) {
13
+ return text.replace(/\r\n/g, '\n');
14
+ }
10
15
  const DefaultReplacementPatterns = [
11
16
  // eslint-disable-next-line no-irregular-whitespace -- we may produce it in output
12
17
  [/\d+(\.\d+)?( |\s*)?ms/g, ''],
@@ -77,7 +82,7 @@ class DocMaker {
77
82
  async make(args) {
78
83
  this.currentArgs = args;
79
84
  this.writtenSubfiles = new Set();
80
- const newText = (this.printHeader ? (await args.ctx.header(this.filename, this.purpose)) + '\n' : '') + await this.text(args);
85
+ const newText = normalizeLineEndings((this.printHeader ? (await args.ctx.header(this.filename, this.purpose)) + '\n' : '') + await this.text(args));
81
86
  if (args.force || this.didUpdate(this.target, newText, args.readFileSync(this.target)?.toString()) === WikiChangeType.Changed) {
82
87
  args.writeFileSync(this.target, newText);
83
88
  return true;
@@ -91,6 +96,7 @@ class DocMaker {
91
96
  if (!this.currentArgs) {
92
97
  throw new Error('DocMaker: writeSubFile called outside of make()');
93
98
  }
99
+ data = normalizeLineEndings(data);
94
100
  if (this.currentArgs.force || this.didUpdate(path, data, this.currentArgs.readFileSync(path)?.toString()) === WikiChangeType.Changed) {
95
101
  this.currentArgs.writeFileSync(path.toString(), data);
96
102
  this.writtenSubfiles.add(path.toString());
@@ -60,12 +60,12 @@ ${(0, doc_code_1.codeBlock)('r', 'x <- 2 * 3 + 1')}
60
60
  Each node in the AST contains the type, the id, and the lexeme (if applicable).
61
61
  Each edge is labeled with the type of the parent-child relationship (the "role").
62
62
 
63
- ${await (0, doc_normalized_ast_1.printNormalizedAstForCode)(treeSitter, 'x <- 2 * 3 + 1', { showCode: false, prefix: 'flowchart LR\n' })}
63
+ ${await (0, doc_normalized_ast_1.printNormalizedAstForCode)(treeSitter, 'x <- 2 * 3 + 1', { showCode: false, prefix: 'flowchart LR\n', ctx })}
64
64
 
65
65
  > [!TIP]
66
66
  > If you want to investigate the normalized AST,
67
- > you can either use the [Visual Studio Code extension](${doc_files_1.FlowrGithubBaseRef}/vscode-flowr) or the ${(0, doc_cli_option_1.getReplCommand)('normalize*')}
68
- > command in the REPL (see the [Interface wiki page](${doc_files_1.FlowrWikiBaseRef}/Interface) for more information).
67
+ > you can either use the [Visual Studio Code extension](${doc_files_1.FlowrGithubBaseRef}/vscode-flowr) or the ${(0, doc_cli_option_1.getReplCommand)('normalize*')}
68
+ > command in the REPL (see the ${ctx.linkPage('wiki/Interface', 'Interface wiki page')} for more information).
69
69
 
70
70
  Indicative of the normalization is the root ${ctx.link(r_project_1.RProject)} node, which is present in every normalized AST
71
71
  and provides the ${ctx.link(r_expression_list_1.RExpressionList)} nodes for each file in the project.
@@ -91,7 +91,7 @@ ${(0, doc_code_1.codeBlock)('mermaid', ctx.mermaid(model_1.RNode))}
91
91
  Node types are controlled by the ${ctx.link('RType')} enum (see ${(0, doc_files_1.getFilePathMd)('../r-bridge/lang-4.x/ast/model/type.ts')}),
92
92
  which is used to distinguish between different types of nodes.
93
93
  Additionally, every AST node is generic with respect to the \`Info\` type which allows for arbitrary decorations (e.g., parent inforamtion or dataflow constraints).
94
- Most notably, the \`info\` field holds the \`id\` of the node, which is used to reference the node in the [dataflow graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph).
94
+ Most notably, the \`info\` field holds the \`id\` of the node, which is used to reference the node in the ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graph')}.
95
95
 
96
96
  In summary, we have the following types:
97
97
 
@@ -109,7 +109,7 @@ The following segments intend to give you an overview of how to work with the no
109
109
 
110
110
  ## How to Get a Normalized AST
111
111
 
112
- As explained alongside the [Interface](${doc_files_1.FlowrWikiBaseRef}/Interface#creating-flowr-analyses) wiki page, you can use an instance of
112
+ As explained alongside the ${ctx.linkPage('wiki/Interface', 'Interface', 'creating-flowr-analyses')} wiki page, you can use an instance of
113
113
  ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} to get the ${ctx.link('NormalizedAst')}:
114
114
 
115
115
  ${ctx.code(simpleNormalizedAst, { dropLinesStart: 1, dropLinesEnd: 2, hideDefinedAt: true })}
@@ -1,8 +1,9 @@
1
+ import type { DocMakerArgs } from './wiki-mk/doc-maker';
1
2
  import { DocMaker } from './wiki-mk/doc-maker';
2
3
  /**
3
4
  * https://github.com/flowr-analysis/flowr/wiki/Onboarding
4
5
  */
5
6
  export declare class WikiOnboarding extends DocMaker<'wiki/Onboarding.md'> {
6
7
  constructor();
7
- text(): string;
8
+ text({ ctx }: DocMakerArgs): string;
8
9
  }
@@ -11,16 +11,16 @@ class WikiOnboarding extends doc_maker_1.DocMaker {
11
11
  constructor() {
12
12
  super('wiki/Onboarding.md', module.filename, 'developer onboarding process');
13
13
  }
14
- text() {
14
+ text({ ctx }) {
15
15
  return `To get started developing on *flowR*, we recommend carefully reading the following pages:
16
- - 💻 [Setting up the *flowR* development environment](${doc_files_1.FlowrWikiBaseRef}/Setup#%EF%B8%8F-building-from-scratch).\\
17
- This page explains how to install **R** and **Node.js**.
16
+ - 💻 ${ctx.linkPage('wiki/Setup', 'Setting up the *flowR* development environment', '-building-from-scratch')}.\\
17
+ This page explains how to install **R** and **Node.js**.
18
18
  - 💖 [Contributing guidelines](${doc_files_1.FlowrGithubBaseRef}/flowr/tree/main/.github/CONTRIBUTING.md).\\
19
19
  This page also includes information about how to set up **git-lfs** and several **git hooks**.
20
20
 
21
- If you have any questions, please check out the [FAQ](${doc_files_1.FlowrWikiBaseRef}/FAQ) first, but if the question
21
+ If you have any questions, please check out the ${ctx.linkPage('wiki/FAQ')} first, but if the question
22
22
  is not answered there (or in the wiki in general), feel free to ask a question.
23
- The [FAQ](${doc_files_1.FlowrWikiBaseRef}/FAQ) also includes information about how you can configure your editor.
23
+ The ${ctx.linkPage('wiki/FAQ')} also includes information about how you can configure your editor.
24
24
 
25
25
  ## ⌛ TL;DR
26
26
 
@@ -28,7 +28,6 @@ for instructions on how to install _flowR_.
28
28
  - [Generate Static Slices](#generate-static-slices)
29
29
  - [Benchmark the Slicer](#benchmark-the-slicer)
30
30
  - [Summarizing the Benchmark Results](#summarizing-the-benchmark-results)
31
- - [Generate Usage Statistics of R Code](#generate-usage-statistics-of-r-code)
32
31
  <!-- TOC -->
33
32
 
34
33
  ## _flowR_'s Modules
@@ -38,15 +37,13 @@ for instructions on how to install _flowR_.
38
37
  Primarily, _flowR_ provides a dataflow analysis framework for the [*R*](https://www.r-project.org/) programming language.
39
38
  Its subcomponents (like the custom ${ctx.link(shell_1.RShell)}) or the internals of the static ${ctx.link(graph_1.DataflowGraph)})
40
39
  are not important if you simply wish to use _flowR_.
41
- If you wish to use _flowR_, check out one of its extensions (e.g., the [VS Code extension](${doc_files_1.FlowrVsCode})),
40
+ If you wish to use _flowR_, check out one of its extensions (e.g., the ${ctx.linkPage('flowr:vscode', 'VS Code extension')}),
42
41
  the [REPL and server interfaces](#using-_flowr_-from-the-outside) or its coding API with the
43
42
  ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)}.
44
43
 
45
- The benchmark module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer.
44
+ The benchmark module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer.
46
45
  It is available with the [\`benchmark\`](#benchmark-the-slicer) script.
47
46
 
48
- The statistics module is mostly independent of the slicer and can be used to analyze R files regarding their use of function definitions, assignments, and more. It is used to identify common patterns in R code and is available with the [\`statistics\`](#generate-usage-statistics-of-r-code) script.
49
-
50
47
  The [core](https://github.com/flowr-analysis/flowr/tree/main/src/core) module contains _flowR_'s read-eval-print loop (REPL) and
51
48
  _flowR_'s server. Furthermore, it contains the root definitions of how _flowR_ slices (see the ${ctx.linkPage('wiki/Interface')} wiki page for more information).
52
49
 
@@ -61,8 +58,8 @@ _flowR_ itself has two main ways to operate:
61
58
  - as a [**server**](#the-server) which processes analysis and slicing requests (${ctx.cliOption('flowr', 'server')} option)
62
59
  - as a [**read-eval-print loop** (REPL)](#the-read-eval-print-loop-repl) that can be accessed directly from the command line (default option)
63
60
 
64
- Besides these two ways, there is a [Visual Studio Code extension](${doc_files_1.FlowrVsCode}) that allows you to use _flowR_ directly from within the editor (it is available on [open-vsx](${doc_files_1.FlowrPositron}) as well).
65
- Similarly, we offer an [Addin for RStudio](${doc_files_1.FlowrRStudioAddin}), as well as an [R package](${doc_files_1.FlowrRAdapter}).
61
+ Besides these two ways, there is a ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')} that allows you to use _flowR_ directly from within the editor (it is available on ${ctx.linkPage('flowr:positron', 'open-vsx')} as well).
62
+ Similarly, we offer an ${ctx.linkPage('flowr:rstudio-addin', 'Addin for RStudio')}, as well as an ${ctx.linkPage('flowr:radapter', 'R package')}.
66
63
 
67
64
  🐳️ If you use the docker-version, simply starting the docker container in interactive mode drops you right into the REPL (\`docker run -it --rm eagleoutice/flowr:latest\`), while launching with the ${ctx.cliOption('flowr', 'server')} argument starts the server (\`docker run -it --rm eagleoutice/flowr:latest --server\`).\\
68
65
  ⚒️ If you compile the _flowR_ sources yourself, you can access _flowR_ by the main script \`npm run flowr\` or in the development mode \`npm run main-dev\`.
@@ -230,16 +227,6 @@ For more options, run the following from the \`cli\` directory:
230
227
 
231
228
  \`\`\`shell
232
229
  npm run summarizer -- --help
233
- \`\`\`
234
-
235
- ### Generate Usage Statistics of R Code
236
-
237
- If you want to reproduce the statistics as presented in the original [master's thesis](http://dx.doi.org/10.18725/OPARU-50107), see the corresponding [wiki page](https://github.com/flowr-analysis/flowr/wiki/Thesis#how-to-reproduce-the-statistics-from-the-masters-thesis).
238
-
239
- For more information, run the following from the \`cli\` directory:
240
-
241
- \`\`\`shell
242
- npm run stats -- --help
243
230
  \`\`\`
244
231
  `.trim();
245
232
  }
@@ -0,0 +1,9 @@
1
+ import type { DocMakerArgs } from './wiki-mk/doc-maker';
2
+ import { DocMaker } from './wiki-mk/doc-maker';
3
+ /**
4
+ * https://github.com/flowr-analysis/flowr/wiki/Package-Database
5
+ */
6
+ export declare class WikiPackageDatabase extends DocMaker<'wiki/Package Database.md'> {
7
+ constructor();
8
+ text({ ctx }: DocMakerArgs): string;
9
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WikiPackageDatabase = void 0;
4
+ const doc_maker_1 = require("./wiki-mk/doc-maker");
5
+ const doc_files_1 = require("./doc-util/doc-files");
6
+ const pkgdb_1 = require("../project/plugins/package-version-plugins/pkgdb");
7
+ const flowr_analyzer_package_versions_pkgdb_plugin_1 = require("../project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin");
8
+ const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
9
+ /** point the resolver at your own database (a file path or http(s) URL) */
10
+ function usePackageDatabase(parser) {
11
+ const pkgdb = new flowr_analyzer_package_versions_pkgdb_plugin_1.FlowrAnalyzerPackageVersionsPkgDbPlugin('/path/to/pkgdb-all.json.br');
12
+ return new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().setParser(parser).registerPlugins(pkgdb).build();
13
+ }
14
+ /** link a built-in plugin key (e.g. `versions:pkgdb`) to its registration */
15
+ function pluginLink(key) {
16
+ return `[\`${key}\`](${doc_files_1.RemoteFlowrFilePathBaseRef}src/project/plugins/plugin-registry.ts)`;
17
+ }
18
+ /**
19
+ * https://github.com/flowr-analysis/flowr/wiki/Package-Database
20
+ */
21
+ class WikiPackageDatabase extends doc_maker_1.DocMaker {
22
+ constructor() {
23
+ super('wiki/Package Database.md', module.filename, 'bundled CRAN package database that resolves `library()` calls');
24
+ }
25
+ text({ ctx }) {
26
+ return `
27
+ # Package Database
28
+
29
+ flowR ships a database of CRAN package exports so it can resolve calls into the packages you load.
30
+ After \`library(ggplot2)\`, a call to \`ggplot()\` resolves to \`ggplot2::ggplot\`. This also backs
31
+ qualified names (a bare \`map()\` after \`library(purrr)\` is \`purrr::map\`, not the \`maps\` plot), the
32
+ ${ctx.linkPage('wiki/Query API', 'dependencies and call-context queries')}, and the ${ctx.linkPage('wiki/Linter', '`undefined-symbol` rule')}.
33
+
34
+ ## Configuration
35
+
36
+ The exports come from ${pluginLink('versions:pkgdb')}, which reads the bundled database (on by default;
37
+ see ${ctx.linkPage('wiki/Interface', 'configuring flowR', 'configuring-flowr')}).
38
+
39
+ *Which* version's exports are resolved is decided by the version-reading plugins that pin the packages
40
+ used in a project. These are only examples - more may be registered:
41
+
42
+ - ${pluginLink('versions:description')} reads a package's \`DESCRIPTION\` (\`Depends\` / \`Imports\`, ${(0, doc_files_1.linkFlowRSourceFile)('src/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.ts')}).
43
+ - ${pluginLink('versions:renv')} and ${pluginLink('versions:rv')} read a project's \`renv.lock\` / \`rv.lock\`
44
+ to pin exact versions (${(0, doc_files_1.linkFlowRSourceFile)('src/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.ts')}).
45
+
46
+ So \`library(pkg)\` resolves the pinned version's exports. To override or extend the bundle, hand
47
+ ${pluginLink('versions:pkgdb')} extra sources (file paths, parsed objects, or \`http(s)\` URLs).
48
+
49
+ ${ctx.code(usePackageDatabase, { dropLinesStart: 1 })}
50
+
51
+ File sources load lazily on the first package load, so scripts without \`library()\`/\`use()\` calls never
52
+ pay for parsing them (set \`solver.eagerlyLoadPackageDatabase\` to mount the database up front instead).
53
+ For a URL source call ${ctx.linkM(flowr_analyzer_package_versions_pkgdb_plugin_1.FlowrAnalyzerPackageVersionsPkgDbPlugin, 'preload', { hideClass: true, codeFont: true })} (\`await pkgdb.preload()\`) before analysis to download it.
54
+
55
+ ## Format
56
+
57
+ One JSON object (\`flowr-pkgdb\`, schema ${pkgdb_1.PkgDbSchema}) with a pooled string table.
58
+ Reader and writer both live in ${(0, doc_files_1.linkFlowRSourceFile)('src/project/plugins/package-version-plugins/pkgdb.ts')}.
59
+ `.trim();
60
+ }
61
+ }
62
+ exports.WikiPackageDatabase = WikiPackageDatabase;
63
+ //# sourceMappingURL=wiki-package-database.js.map