@eagleoutice/flowr 2.11.1 → 2.12.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 (255) hide show
  1. package/README.md +193 -263
  2. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -1
  3. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  4. package/abstract-interpretation/domains/set-upper-bound-domain.js +6 -2
  5. package/benchmark/slicer.d.ts +1 -1
  6. package/benchmark/slicer.js +3 -1
  7. package/benchmark/summarizer/second-phase/graph.js +5 -0
  8. package/cli/common/options.d.ts +8 -0
  9. package/cli/common/options.js +2 -0
  10. package/cli/common/scripts-info.d.ts +8 -0
  11. package/cli/repl/commands/repl-commands.d.ts +1 -0
  12. package/cli/repl/commands/repl-commands.js +66 -15
  13. package/cli/repl/commands/repl-dataflow.js +48 -4
  14. package/cli/repl/commands/repl-main.d.ts +2 -0
  15. package/cli/repl/commands/repl-main.js +5 -0
  16. package/cli/repl/commands/repl-query.d.ts +4 -1
  17. package/cli/repl/commands/repl-query.js +72 -22
  18. package/cli/repl/commands/repl-signature.d.ts +7 -0
  19. package/cli/repl/commands/repl-signature.js +119 -0
  20. package/cli/repl/core.d.ts +8 -1
  21. package/cli/repl/core.js +46 -6
  22. package/cli/repl/ghost-hint.d.ts +37 -0
  23. package/cli/repl/ghost-hint.js +72 -0
  24. package/cli/repl/parser/slice-query-parser.d.ts +11 -1
  25. package/cli/repl/parser/slice-query-parser.js +45 -16
  26. package/cli/repl/print-version.d.ts +2 -4
  27. package/cli/repl/print-version.js +41 -23
  28. package/cli/repl/server/connection.js +19 -17
  29. package/cli/slicer-app.d.ts +2 -0
  30. package/cli/slicer-app.js +3 -3
  31. package/cli/wiki.d.ts +2 -2
  32. package/cli/wiki.js +2 -2
  33. package/config.d.ts +63 -2
  34. package/config.js +64 -8
  35. package/control-flow/cfg-dead-code.js +0 -1
  36. package/control-flow/control-flow-graph.js +6 -6
  37. package/control-flow/diff-cfg.js +2 -2
  38. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  39. package/core/print/slice-diff-ansi.js +8 -8
  40. package/core/steps/all/core/20-dataflow.d.ts +2 -2
  41. package/core/steps/all/static-slicing/00-slice.d.ts +5 -0
  42. package/core/steps/all/static-slicing/00-slice.js +1 -1
  43. package/core/steps/all/static-slicing/10-reconstruct.d.ts +7 -0
  44. package/core/steps/all/static-slicing/10-reconstruct.js +6 -2
  45. package/core/steps/pipeline/default-pipelines.d.ts +20 -16
  46. package/data/r-base-packages.generated.d.ts +44 -0
  47. package/data/r-base-packages.generated.js +32 -0
  48. package/data/r-base-primitives.generated.d.ts +1 -0
  49. package/data/r-base-primitives.generated.js +15 -0
  50. package/data/sigdb/sigdb.remote.json +112 -0
  51. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  52. package/dataflow/environments/built-in-proc-name.js +4 -0
  53. package/dataflow/environments/built-in.d.ts +14 -4
  54. package/dataflow/environments/built-in.js +13 -2
  55. package/dataflow/environments/data-masking-functions.d.ts +12 -0
  56. package/dataflow/environments/data-masking-functions.js +46 -0
  57. package/dataflow/environments/default-builtin-config.d.ts +72 -19
  58. package/dataflow/environments/default-builtin-config.js +48 -14
  59. package/dataflow/environments/diff.js +1 -1
  60. package/dataflow/environments/environment.js +1 -2
  61. package/dataflow/environments/identifier.d.ts +11 -4
  62. package/dataflow/environments/identifier.js +28 -10
  63. package/dataflow/environments/resolve-by-name.js +16 -2
  64. package/dataflow/extractor.js +6 -3
  65. package/dataflow/graph/call-graph.d.ts +2 -2
  66. package/dataflow/graph/df-helper.d.ts +4 -4
  67. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  68. package/dataflow/graph/edge.d.ts +3 -3
  69. package/dataflow/graph/edge.js +3 -3
  70. package/dataflow/graph/graph-helper.d.ts +2 -2
  71. package/dataflow/internal/linker.js +1 -1
  72. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +7 -0
  73. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +20 -0
  74. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +1 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -49
  76. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -1
  77. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +7 -1
  78. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +19 -0
  79. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +111 -6
  80. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +13 -0
  81. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -3
  82. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +9 -0
  83. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +19 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +12 -4
  85. package/dataflow/internal/process/functions/call/common.js +8 -1
  86. package/dataflow/internal/process/functions/call/default-call-handling.js +6 -0
  87. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +17 -0
  88. package/dataflow/internal/process/functions/call/known-call-handling.js +32 -0
  89. package/dataflow/internal/process/functions/call/named-call-handling.js +29 -7
  90. package/dataflow/internal/process/functions/process-argument.js +12 -1
  91. package/dataflow/internal/process/process-named-call.d.ts +18 -1
  92. package/dataflow/internal/process/process-named-call.js +94 -0
  93. package/dataflow/processor.d.ts +18 -0
  94. package/documentation/data/faq/faqs.js +5 -1
  95. package/documentation/doc-capabilities.js +1 -1
  96. package/documentation/doc-util/doc-cli-option.d.ts +10 -0
  97. package/documentation/doc-util/doc-cli-option.js +23 -0
  98. package/documentation/doc-util/doc-dfg.js +2 -1
  99. package/documentation/doc-util/doc-query.d.ts +9 -3
  100. package/documentation/doc-util/doc-query.js +9 -4
  101. package/documentation/wiki-dataflow-graph.js +8 -5
  102. package/documentation/wiki-interface.js +3 -1
  103. package/documentation/wiki-linter.js +1 -1
  104. package/documentation/wiki-linting-and-testing.js +4 -1
  105. package/documentation/wiki-mk/doc-context.d.ts +14 -0
  106. package/documentation/wiki-mk/doc-context.js +3 -0
  107. package/documentation/wiki-mk/doc-maker.js +3 -1
  108. package/documentation/wiki-query.js +19 -1
  109. package/documentation/wiki-setup.js +10 -7
  110. package/documentation/wiki-signature-database.d.ts +16 -0
  111. package/documentation/wiki-signature-database.js +293 -0
  112. package/linter/linter-format.d.ts +7 -0
  113. package/linter/linter-rules.d.ts +10 -9
  114. package/linter/rules/naming-convention.d.ts +1 -0
  115. package/linter/rules/naming-convention.js +2 -0
  116. package/linter/rules/no-leaked-credentials.js +1 -2
  117. package/linter/rules/roxygen-arguments.js +18 -5
  118. package/linter/rules/stop-with-call-arg.js +2 -2
  119. package/linter/rules/undefined-symbol-util.d.ts +36 -0
  120. package/linter/rules/undefined-symbol-util.js +149 -0
  121. package/linter/rules/undefined-symbol.d.ts +58 -17
  122. package/linter/rules/undefined-symbol.js +143 -33
  123. package/linter/rules/unused-definition.d.ts +8 -1
  124. package/linter/rules/unused-definition.js +126 -1
  125. package/package.json +22 -10
  126. package/project/context/abstract-flowr-analyzer-context.js +7 -1
  127. package/project/context/flowr-analyzer-context.d.ts +8 -0
  128. package/project/context/flowr-analyzer-context.js +10 -0
  129. package/project/context/flowr-analyzer-dependencies-context.d.ts +28 -4
  130. package/project/context/flowr-analyzer-dependencies-context.js +51 -2
  131. package/project/context/flowr-analyzer-files-context.d.ts +1 -0
  132. package/project/context/flowr-analyzer-files-context.js +2 -1
  133. package/project/context/flowr-analyzer-functions-context.js +1 -1
  134. package/project/context/flowr-file.d.ts +5 -0
  135. package/project/context/flowr-file.js +5 -0
  136. package/project/flowr-analyzer-builder.js +12 -2
  137. package/project/plugins/file-plugins/files/flowr-description-file.js +6 -3
  138. package/project/plugins/file-plugins/files/flowr-namespace-file.js +9 -3
  139. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -3
  140. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +26 -0
  141. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +39 -0
  142. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  143. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -2
  144. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -0
  145. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +18 -2
  146. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +19 -0
  147. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +120 -0
  148. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +518 -0
  149. package/project/plugins/package-version-plugins/package.d.ts +5 -3
  150. package/project/plugins/package-version-plugins/package.js +27 -25
  151. package/project/plugins/plugin-registry.d.ts +3 -2
  152. package/project/plugins/plugin-registry.js +4 -2
  153. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +7 -2
  154. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +3 -1
  155. package/project/sigdb/build.d.ts +131 -0
  156. package/project/sigdb/build.js +628 -0
  157. package/project/sigdb/codec.d.ts +51 -0
  158. package/project/sigdb/codec.js +122 -0
  159. package/project/sigdb/decode.d.ts +58 -0
  160. package/project/sigdb/decode.js +129 -0
  161. package/project/sigdb/decompress.d.ts +44 -0
  162. package/project/sigdb/decompress.js +176 -0
  163. package/project/sigdb/hash.d.ts +9 -0
  164. package/project/sigdb/hash.js +54 -0
  165. package/project/sigdb/index-format.d.ts +40 -0
  166. package/project/sigdb/index-format.js +28 -0
  167. package/project/sigdb/manifest.d.ts +68 -0
  168. package/project/sigdb/manifest.js +146 -0
  169. package/project/sigdb/reader.d.ts +250 -0
  170. package/project/sigdb/reader.js +692 -0
  171. package/project/sigdb/schema.d.ts +196 -0
  172. package/project/sigdb/schema.js +33 -0
  173. package/project/sigdb/sigdb-download.d.ts +65 -0
  174. package/project/sigdb/sigdb-download.js +237 -0
  175. package/project/sigdb/signature-match.d.ts +26 -0
  176. package/project/sigdb/signature-match.js +40 -0
  177. package/project/sigdb/version.d.ts +20 -0
  178. package/project/sigdb/version.js +55 -0
  179. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -3
  180. package/queries/catalog/config-query/config-query-format.d.ts +3 -1
  181. package/queries/catalog/config-query/config-query-format.js +68 -9
  182. package/queries/catalog/dataflow-query/dataflow-query-format.js +11 -1
  183. package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
  184. package/queries/catalog/linter-query/linter-query-executor.d.ts +2 -0
  185. package/queries/catalog/linter-query/linter-query-executor.js +6 -1
  186. package/queries/catalog/linter-query/linter-query-format.d.ts +2 -1
  187. package/queries/catalog/linter-query/linter-query-format.js +40 -8
  188. package/queries/catalog/project-query/project-query-executor.d.ts +15 -0
  189. package/queries/catalog/project-query/project-query-executor.js +96 -4
  190. package/queries/catalog/project-query/project-query-format.d.ts +44 -0
  191. package/queries/catalog/project-query/project-query-format.js +33 -2
  192. package/queries/catalog/signature-query/signature-query-executor.d.ts +29 -0
  193. package/queries/catalog/signature-query/signature-query-executor.js +461 -0
  194. package/queries/catalog/signature-query/signature-query-format.d.ts +138 -0
  195. package/queries/catalog/signature-query/signature-query-format.js +76 -0
  196. package/queries/catalog/signature-query/signature-query-render.d.ts +15 -0
  197. package/queries/catalog/signature-query/signature-query-render.js +155 -0
  198. package/queries/catalog/static-slice-query/static-slice-query-executor.js +9 -3
  199. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +10 -0
  200. package/queries/catalog/static-slice-query/static-slice-query-format.js +19 -1
  201. package/queries/query-print.js +5 -0
  202. package/queries/query.d.ts +10 -1
  203. package/queries/query.js +5 -2
  204. package/r-bridge/init.js +5 -1
  205. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +10 -0
  206. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +55 -0
  207. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +16 -0
  208. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +27 -0
  209. package/r-bridge/lang-4.x/ast/parser/json/format.js +89 -2
  210. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -4
  211. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +2 -1
  212. package/r-bridge/parser.d.ts +2 -0
  213. package/r-bridge/retriever.js +4 -1
  214. package/r-bridge/roxygen2/documentation-provider.js +2 -1
  215. package/r-bridge/shell.d.ts +5 -0
  216. package/r-bridge/shell.js +17 -1
  217. package/reconstruct/inline/source-inline-map.d.ts +48 -0
  218. package/reconstruct/inline/source-inline-map.js +94 -0
  219. package/reconstruct/reconstruct.d.ts +19 -2
  220. package/reconstruct/reconstruct.js +79 -16
  221. package/search/search-executor/search-generators.js +5 -22
  222. package/search/search-executor/search-transformer.js +10 -6
  223. package/slicing/criterion/parse.d.ts +22 -4
  224. package/slicing/criterion/parse.js +125 -18
  225. package/slicing/static/slice-call.d.ts +24 -1
  226. package/slicing/static/slice-call.js +90 -0
  227. package/slicing/static/static-slicer.d.ts +7 -0
  228. package/slicing/static/static-slicer.js +38 -3
  229. package/util/collections/arrays.d.ts +4 -5
  230. package/util/collections/arrays.js +7 -18
  231. package/util/hash.d.ts +14 -0
  232. package/util/hash.js +31 -0
  233. package/util/mermaid/dfg.d.ts +7 -2
  234. package/util/mermaid/dfg.js +53 -13
  235. package/util/r-base-packages.d.ts +19 -0
  236. package/util/r-base-packages.js +72 -0
  237. package/util/r-license.js +2 -10
  238. package/util/r-version.d.ts +45 -15
  239. package/util/r-version.js +97 -36
  240. package/util/range.d.ts +15 -0
  241. package/util/range.js +39 -0
  242. package/util/schema.d.ts +10 -0
  243. package/util/schema.js +22 -0
  244. package/util/text/ansi.d.ts +3 -0
  245. package/util/text/ansi.js +10 -0
  246. package/util/text/args.js +1 -2
  247. package/util/version.js +28 -8
  248. package/data/pkgdb/pkgdb-latest.json.br +0 -0
  249. package/data/pkgdb/pkgdb-tiny.json.br +0 -0
  250. package/documentation/wiki-package-database.d.ts +0 -9
  251. package/documentation/wiki-package-database.js +0 -63
  252. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +0 -63
  253. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +0 -176
  254. package/project/plugins/package-version-plugins/pkgdb.d.ts +0 -133
  255. package/project/plugins/package-version-plugins/pkgdb.js +0 -370
@@ -1,7 +1,7 @@
1
1
  import type { FlowrAnalyzerPlugin } from './flowr-analyzer-plugin';
2
2
  import { FlowrAnalyzerDescriptionFilePlugin } from './file-plugins/flowr-analyzer-description-file-plugin';
3
3
  import { FlowrAnalyzerPackageVersionsDescriptionFilePlugin } from './package-version-plugins/flowr-analyzer-package-versions-description-file-plugin';
4
- import { FlowrAnalyzerPackageVersionsPkgDbPlugin } from './package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin';
4
+ import { FlowrAnalyzerPackageVersionsSigDbPlugin } from './package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin';
5
5
  import { FlowrAnalyzerPackageVersionsRenvPlugin, FlowrAnalyzerPackageVersionsRvPlugin } from './package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin';
6
6
  import { FlowrAnalyzerLoadingOrderDescriptionFilePlugin } from './loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin';
7
7
  import { FlowrAnalyzerRmdFilePlugin } from './file-plugins/notebooks/flowr-analyzer-rmd-file-plugin';
@@ -11,6 +11,7 @@ import { FlowrAnalyzerNamespaceFilesPlugin } from './file-plugins/flowr-analyzer
11
11
  import { FlowrAnalyzerNewsFilePlugin } from './file-plugins/flowr-analyzer-news-file-plugin';
12
12
  import { FlowrAnalyzerMetaVignetteFilesPlugin } from './file-plugins/flowr-analyzer-vignette-file-plugin';
13
13
  import { FlowrAnalyzerMetaTestFilesPlugin } from './file-plugins/flowr-analyzer-test-file-plugin';
14
+ import { FlowrAnalyzerMetaInstFilesPlugin } from './file-plugins/flowr-analyzer-inst-file-plugin';
14
15
  import { FlowrAnalyzerLicenseFilePlugin } from './file-plugins/flowr-analyzer-license-file-plugin';
15
16
  import { FlowrAnalyzerVirtualEnvFilePlugin } from './file-plugins/flowr-analyzer-virtualenv-file-plugin';
16
17
  import { FlowrAnalyzerMetaDescriptionFilePlugin } from './package-version-plugins/flowr-analyzer-meta-description-file-plugin';
@@ -19,7 +20,7 @@ import { FlowrAnalyzerGitignoreProjectDiscoveryPlugin } from './project-discover
19
20
  /**
20
21
  * The built-in Flowr Analyzer plugins that are always available.
21
22
  */
22
- export declare const BuiltInPlugins: [["file:description", typeof FlowrAnalyzerDescriptionFilePlugin], ["versions:description", typeof FlowrAnalyzerPackageVersionsDescriptionFilePlugin], ["versions:pkgdb", typeof FlowrAnalyzerPackageVersionsPkgDbPlugin], ["versions:renv", typeof FlowrAnalyzerPackageVersionsRenvPlugin], ["versions:rv", typeof FlowrAnalyzerPackageVersionsRvPlugin], ["loading-order:description", typeof FlowrAnalyzerLoadingOrderDescriptionFilePlugin], ["meta:description", typeof FlowrAnalyzerMetaDescriptionFilePlugin], ["files:vignette", typeof FlowrAnalyzerMetaVignetteFilesPlugin], ["files:test", typeof FlowrAnalyzerMetaTestFilesPlugin], ["file:rmd", typeof FlowrAnalyzerRmdFilePlugin], ["file:qmd", typeof FlowrAnalyzerQmdFilePlugin], ["file:rnw", typeof FlowrAnalyzerSweaveFilePlugin], ["file:ipynb", typeof FlowrAnalyzerJupyterFilePlugin], ["file:namespace", typeof FlowrAnalyzerNamespaceFilesPlugin], ["file:news", typeof FlowrAnalyzerNewsFilePlugin], ["file:license", typeof FlowrAnalyzerLicenseFilePlugin], ["file:virtualenv", typeof FlowrAnalyzerVirtualEnvFilePlugin], ["project-discovery:gitignore", typeof FlowrAnalyzerGitignoreProjectDiscoveryPlugin]];
23
+ export declare const BuiltInPlugins: [["file:description", typeof FlowrAnalyzerDescriptionFilePlugin], ["versions:description", typeof FlowrAnalyzerPackageVersionsDescriptionFilePlugin], ["versions:sigdb", typeof FlowrAnalyzerPackageVersionsSigDbPlugin], ["versions:renv", typeof FlowrAnalyzerPackageVersionsRenvPlugin], ["versions:rv", typeof FlowrAnalyzerPackageVersionsRvPlugin], ["loading-order:description", typeof FlowrAnalyzerLoadingOrderDescriptionFilePlugin], ["meta:description", typeof FlowrAnalyzerMetaDescriptionFilePlugin], ["files:vignette", typeof FlowrAnalyzerMetaVignetteFilesPlugin], ["files:test", typeof FlowrAnalyzerMetaTestFilesPlugin], ["files:inst", typeof FlowrAnalyzerMetaInstFilesPlugin], ["file:rmd", typeof FlowrAnalyzerRmdFilePlugin], ["file:qmd", typeof FlowrAnalyzerQmdFilePlugin], ["file:rnw", typeof FlowrAnalyzerSweaveFilePlugin], ["file:ipynb", typeof FlowrAnalyzerJupyterFilePlugin], ["file:namespace", typeof FlowrAnalyzerNamespaceFilesPlugin], ["file:news", typeof FlowrAnalyzerNewsFilePlugin], ["file:license", typeof FlowrAnalyzerLicenseFilePlugin], ["file:virtualenv", typeof FlowrAnalyzerVirtualEnvFilePlugin], ["project-discovery:gitignore", typeof FlowrAnalyzerGitignoreProjectDiscoveryPlugin]];
23
24
  export type BuiltInFlowrPluginName = typeof BuiltInPlugins[number][0];
24
25
  export type BuiltInFlowrPluginArgs<N extends BuiltInFlowrPluginName> = N extends typeof BuiltInPlugins[number][0] ? ConstructorParameters<Extract<typeof BuiltInPlugins[number], [N, PluginProducer]>[1]> : never;
25
26
  type PluginProducer = new (...args: never[]) => FlowrAnalyzerPlugin;
@@ -6,7 +6,7 @@ exports.getPlugin = getPlugin;
6
6
  exports.makePlugin = makePlugin;
7
7
  const flowr_analyzer_description_file_plugin_1 = require("./file-plugins/flowr-analyzer-description-file-plugin");
8
8
  const flowr_analyzer_package_versions_description_file_plugin_1 = require("./package-version-plugins/flowr-analyzer-package-versions-description-file-plugin");
9
- const flowr_analyzer_package_versions_pkgdb_plugin_1 = require("./package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin");
9
+ const flowr_analyzer_package_versions_sigdb_plugin_1 = require("./package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin");
10
10
  const flowr_analyzer_package_versions_lockfile_plugin_1 = require("./package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin");
11
11
  const flowr_analyzer_loading_order_description_file_plugin_1 = require("./loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin");
12
12
  const flowr_analyzer_rmd_file_plugin_1 = require("./file-plugins/notebooks/flowr-analyzer-rmd-file-plugin");
@@ -17,6 +17,7 @@ const flowr_analyzer_namespace_files_plugin_1 = require("./file-plugins/flowr-an
17
17
  const flowr_analyzer_news_file_plugin_1 = require("./file-plugins/flowr-analyzer-news-file-plugin");
18
18
  const flowr_analyzer_vignette_file_plugin_1 = require("./file-plugins/flowr-analyzer-vignette-file-plugin");
19
19
  const flowr_analyzer_test_file_plugin_1 = require("./file-plugins/flowr-analyzer-test-file-plugin");
20
+ const flowr_analyzer_inst_file_plugin_1 = require("./file-plugins/flowr-analyzer-inst-file-plugin");
20
21
  const flowr_analyzer_license_file_plugin_1 = require("./file-plugins/flowr-analyzer-license-file-plugin");
21
22
  const flowr_analyzer_virtualenv_file_plugin_1 = require("./file-plugins/flowr-analyzer-virtualenv-file-plugin");
22
23
  const flowr_analyzer_meta_description_file_plugin_1 = require("./package-version-plugins/flowr-analyzer-meta-description-file-plugin");
@@ -28,13 +29,14 @@ const flowr_analyzer_gitignore_project_discovery_plugin_1 = require("./project-d
28
29
  exports.BuiltInPlugins = [
29
30
  ['file:description', flowr_analyzer_description_file_plugin_1.FlowrAnalyzerDescriptionFilePlugin],
30
31
  ['versions:description', flowr_analyzer_package_versions_description_file_plugin_1.FlowrAnalyzerPackageVersionsDescriptionFilePlugin],
31
- ['versions:pkgdb', flowr_analyzer_package_versions_pkgdb_plugin_1.FlowrAnalyzerPackageVersionsPkgDbPlugin],
32
+ ['versions:sigdb', flowr_analyzer_package_versions_sigdb_plugin_1.FlowrAnalyzerPackageVersionsSigDbPlugin],
32
33
  ['versions:renv', flowr_analyzer_package_versions_lockfile_plugin_1.FlowrAnalyzerPackageVersionsRenvPlugin],
33
34
  ['versions:rv', flowr_analyzer_package_versions_lockfile_plugin_1.FlowrAnalyzerPackageVersionsRvPlugin],
34
35
  ['loading-order:description', flowr_analyzer_loading_order_description_file_plugin_1.FlowrAnalyzerLoadingOrderDescriptionFilePlugin],
35
36
  ['meta:description', flowr_analyzer_meta_description_file_plugin_1.FlowrAnalyzerMetaDescriptionFilePlugin],
36
37
  ['files:vignette', flowr_analyzer_vignette_file_plugin_1.FlowrAnalyzerMetaVignetteFilesPlugin],
37
38
  ['files:test', flowr_analyzer_test_file_plugin_1.FlowrAnalyzerMetaTestFilesPlugin],
39
+ ['files:inst', flowr_analyzer_inst_file_plugin_1.FlowrAnalyzerMetaInstFilesPlugin],
38
40
  ['file:rmd', flowr_analyzer_rmd_file_plugin_1.FlowrAnalyzerRmdFilePlugin],
39
41
  ['file:qmd', flowr_analyzer_qmd_file_plugin_1.FlowrAnalyzerQmdFilePlugin],
40
42
  ['file:rnw', flowr_analyzer_sweave_file_plugin_1.FlowrAnalyzerSweaveFilePlugin],
@@ -9,7 +9,12 @@ const semver_1 = require("semver");
9
9
  const retriever_1 = require("../../../r-bridge/retriever");
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const fs_1 = __importDefault(require("fs"));
12
- const ignore_1 = __importDefault(require("ignore"));
12
+ /** Lazily loaded on first use so `ignore` is only required when the gitignore plugin actually runs. */
13
+ let ignoreFactory;
14
+ function loadIgnore() {
15
+ // eslint-disable-next-line @typescript-eslint/no-require-imports -- loaded on demand, see above
16
+ return ignoreFactory ??= require('ignore');
17
+ }
13
18
  /**
14
19
  * Decorator around any {@link FlowrAnalyzerProjectDiscoveryPlugin} that filters discovered files
15
20
  * by the rules in a `.gitignore` file found at the project root.
@@ -28,7 +33,7 @@ class FlowrAnalyzerGitignoreProjectDiscoveryPlugin extends flowr_analyzer_projec
28
33
  this.inner = inner;
29
34
  }
30
35
  process(context, args) {
31
- const ig = (0, ignore_1.default)();
36
+ const ig = loadIgnore()();
32
37
  const gitignorePath = path_1.default.join(args.content, '.gitignore');
33
38
  if (fs_1.default.existsSync(gitignorePath)) {
34
39
  ig.add(fs_1.default.readFileSync(gitignorePath, 'utf-8'));
@@ -25,7 +25,9 @@ class FlowrAnalyzerProjectDiscoveryPlugin extends flowr_analyzer_plugin_1.FlowrA
25
25
  }
26
26
  exports.FlowrAnalyzerProjectDiscoveryPlugin = FlowrAnalyzerProjectDiscoveryPlugin;
27
27
  const discoverRSourcesRegex = /\.(r|rmd|ipynb|qmd|rnw)$/i;
28
- const ignorePathsWith = /(\.git|\.svn|\.hg|rv|renv|packrat|node_modules|__pycache__|\.Rproj\.user)/i;
28
+ // matched against a single directory-entry name (see getAllFilesSync), so anchor it: a bare substring like `rv`
29
+ // would otherwise wrongly ignore legitimate directories such as `rvest`, `survey`, or a random temp-dir suffix.
30
+ const ignorePathsWith = /^(\.git|\.svn|\.hg|rv|renv|packrat|node_modules|__pycache__|\.Rproj\.user)$/i;
29
31
  const excludeRequestsForPaths = /vignettes?|tests?|revdep|inst|data/i;
30
32
  /**
31
33
  * This is the default dummy implementation of the {@link FlowrAnalyzerProjectDiscoveryPlugin}.
@@ -0,0 +1,131 @@
1
+ import { SigDbMagic, SigDbSchema, type PkgBlob, type SigDb, type SigDbFeatures, type SigDbPkgMeta, type SigDbShard, type SigDbTier, type SigVersionInfo } from './schema';
2
+ import { type SigDbIndex, type SigShardIndexWire } from './index-format';
3
+ import { type SigDbManifest, type SigDbShardRef, type SigDbDictRef } from './manifest';
4
+ /** per-package metadata handed to {@link SigDbBuilder.addPackage} (everything but `latest` defaults) */
5
+ export interface AddPackageOptions {
6
+ readonly latest: string;
7
+ readonly archived?: boolean;
8
+ readonly downloads?: number;
9
+ readonly core?: boolean;
10
+ }
11
+ /**
12
+ * Accumulates analyzed functions and serializes a {@link SigDb}. Feed it with {@link addPackage} and
13
+ * {@link addVersion}, then {@link build}. Pooling (dictionary, per-package blobs, whole-package dedup,
14
+ * frequency reordering) happens in {@link build} so the result is deterministic for identical inputs.
15
+ */
16
+ export declare class SigDbBuilder {
17
+ private readonly raw;
18
+ addPackage(name: string, opts: AddPackageOptions): void;
19
+ addVersion(name: string, version: string, info: SigVersionInfo): void;
20
+ /** the package names once, alphabetically -- the stable build order, computed a single time (see {@link selectPackages}) */
21
+ private sortedNames;
22
+ private namesCache;
23
+ /** the package names to include, in build (sorted) order, honoring the R-core policy and popularity shard */
24
+ private selectPackages;
25
+ /**
26
+ * Build one {@link SigDb} bundle. `tier: 'current'` keeps only each package's latest version (small,
27
+ * fast to load); `tier: 'full'` keeps every version. `topN` + `shard` further restrict to the most-
28
+ * downloaded packages (`'top'`) or the remainder (`'rest'`), so a database can be split into several
29
+ * small shards routed by a {@link SigDbManifest}.
30
+ */
31
+ build(opts: SigDbBuildOptions): SigDb;
32
+ /**
33
+ * Build several shards that all reindex into a **single shared string dictionary** (stored once, not
34
+ * per shard). All shards' blobs are pooled into one dictionary and frequency-sorted together, so the
35
+ * dictionary loads once and no strings are duplicated across shards. Package metadata is likewise
36
+ * collected once. This is the compact, fast-loading counterpart of calling {@link build} per shard.
37
+ */
38
+ buildSharded(opts: Omit<SigDbBuildOptions, 'tier' | 'shard' | 'topN'>, specs: readonly ShardSpec[]): ShardedSigDb;
39
+ }
40
+ /** a shard to build: a temporal tier, optionally restricted to a popularity shard and/or the R-core packages */
41
+ export interface ShardSpec {
42
+ tier?: SigDbTier;
43
+ shard?: SigDbShard;
44
+ topN?: number;
45
+ core?: CorePolicy;
46
+ }
47
+ /** the id of a shard, e.g. `base-current`, `current-top` or `full` */
48
+ export declare function shardId(spec: ShardSpec): string;
49
+ /** one shard produced by {@link SigDbBuilder.buildSharded}: blobs referencing the shared dictionary */
50
+ export interface SigShard {
51
+ id: string;
52
+ tier: SigDbTier;
53
+ shard?: SigDbShard;
54
+ topN?: number;
55
+ core?: CorePolicy;
56
+ blobs: PkgBlob[];
57
+ pkgs: Record<string, number>;
58
+ versions: number;
59
+ functions: number;
60
+ /** hash over this shard's blobs + pkgs (the dictionary is hashed separately) */
61
+ hash: string;
62
+ }
63
+ /** several shards sharing one dictionary + one package-metadata map */
64
+ export interface ShardedSigDb {
65
+ format: typeof SigDbMagic;
66
+ schema: typeof SigDbSchema;
67
+ scope: 'signatures';
68
+ date: string;
69
+ generated: number;
70
+ cranBase?: string;
71
+ features: Required<SigDbFeatures>;
72
+ /** the single shared string dictionary */
73
+ strings: string[];
74
+ dictHash: string;
75
+ /** package name to metadata, shared by every shard */
76
+ meta: Record<string, SigDbPkgMeta>;
77
+ shards: SigShard[];
78
+ }
79
+ /** options for {@link SigDbBuilder.build} */
80
+ export interface SigDbBuildOptions {
81
+ /** dataset date `YYYY-MM-DD` */
82
+ date: string;
83
+ /** build timestamp (ms since epoch) */
84
+ generated: number;
85
+ /** CRAN base url (only stored when non-default) */
86
+ cranBase?: string;
87
+ /** renumber the string dictionary by frequency for better compression (default: true) */
88
+ optimizeStrings?: boolean;
89
+ /** temporal tier (default `full`) */
90
+ tier?: SigDbTier;
91
+ /** with {@link SigDbBuildOptions.topN}: include only the top-N most-downloaded packages (`top`) or the rest (`rest`) */
92
+ shard?: SigDbShard;
93
+ /** download-rank cutoff for {@link SigDbBuildOptions.shard} */
94
+ topN?: number;
95
+ /** restrict to R-core / base packages (`only`) or exclude them (`exclude`); default: no restriction */
96
+ core?: CorePolicy;
97
+ /** which information to store (default: everything) */
98
+ features?: SigDbFeatures;
99
+ }
100
+ /** how a shard treats R-core / base packages: keep only them, exclude them, or don't care */
101
+ export type CorePolicy = 'only' | 'exclude';
102
+ export interface CompressOptions {
103
+ /** zstd compression level (1..22) for the `.zst` output (default 19) */
104
+ level?: number;
105
+ /** brotli quality for the `.br` output; 11 is smallest but slow, lower is much faster for a small size cost */
106
+ brotliQuality?: number;
107
+ /** brotli window bits (10..30); above 24 enables the non-standard large-window mode (reader must opt in) */
108
+ brotliLgwin?: number;
109
+ }
110
+ /** Write `<outBase>.sigs.ndjson` (+ `.br`, `.zst` when supported, `.idx`) -- a single self-contained bundle (its own dictionary). */
111
+ export declare function writeSignatureDb(outBase: string, db: SigDb, compress?: CompressOptions): Promise<SigDbIndex>;
112
+ /** the extension of a standalone shared-dictionary file */
113
+ export declare const SigDbDictExt: ".dict.sigs.ndjson";
114
+ /** Write a shared string dictionary to `<outBase>.dict.sigs.ndjson` (+ `.br`/`.zst`). Returns where its lines sit. */
115
+ export declare function writeDictionary(outBase: string, id: string, strings: readonly string[], compress?: CompressOptions): Promise<SigDbDictRef>;
116
+ /** Write one blob-only shard (references a shared dictionary) to `<outBase>.<id>.sigs.ndjson` (+ `.br`/`.zst`). */
117
+ export declare function writeShardBundle(outBase: string, shard: SigShard, cranBase: string | undefined, compress?: CompressOptions): Promise<SigShardIndexWire>;
118
+ /** options for {@link writeShardedDatabase} */
119
+ export interface ShardedWriteOptions extends CompressOptions {
120
+ /** assemble a clean copy-into-flowR folder holding just the compressed shards, the dictionary and the manifest */
121
+ pack?: string;
122
+ /** invoked after each shard file is written (for progress logging) */
123
+ onShard?: (shard: SigShard, ref: SigDbShardRef) => void;
124
+ }
125
+ /**
126
+ * Write a {@link ShardedSigDb}: one shared dictionary file, one blob-only file per shard, and a
127
+ * {@link SigDbManifest} that embeds each shard's index and references the shared dictionary by id. Every
128
+ * shard reindexes into that single dictionary (stored once, not per shard). A reader needs only the compressed
129
+ * files plus the manifest -- no `.idx` sidecars. With `pack`, also assembles a clean copy-into-flowR folder.
130
+ */
131
+ export declare function writeShardedDatabase(outBase: string, db: ShardedSigDb, manifestFile: string, opts?: ShardedWriteOptions): Promise<SigDbManifest>;