@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
@@ -0,0 +1,518 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.FlowrAnalyzerPackageVersionsSigDbPlugin = exports.sigDbLog = exports.SigDbPluginName = void 0;
40
+ exports.reconstructS3Generics = reconstructS3Generics;
41
+ const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-package-versions-plugin");
42
+ const semver_1 = require("semver");
43
+ const path_1 = __importDefault(require("path"));
44
+ const package_1 = require("./package");
45
+ const reader_1 = require("../../sigdb/reader");
46
+ const schema_1 = require("../../sigdb/schema");
47
+ const manifest_1 = require("../../sigdb/manifest");
48
+ const decompress_1 = require("../../sigdb/decompress");
49
+ const codec_1 = require("../../sigdb/codec");
50
+ const log_1 = require("../../../util/log");
51
+ const flowr_file_1 = require("../../context/flowr-file");
52
+ const config_1 = require("../../../config");
53
+ const r_version_1 = require("../../../util/r-version");
54
+ const r_base_packages_1 = require("../../../util/r-base-packages");
55
+ /** the plugin's instance name (pass to `unregisterPlugins` to disable the default sigdb resolver) */
56
+ exports.SigDbPluginName = 'flowr-analyzer-package-versions-sigdb-plugin';
57
+ /** map a resolved source's compressed extension to a codec name for display (`undefined` extension is a plain file) */
58
+ function codecNameOf(ext) {
59
+ switch (ext) {
60
+ case '.zst': return 'zstd';
61
+ case '.br': return 'brotli';
62
+ case '.gz': return 'gzip';
63
+ default: return 'plain';
64
+ }
65
+ }
66
+ /** the codec name of a manifest's resolved shard + dict sources, or `mixed` when they do not all agree */
67
+ function manifestFormat(set) {
68
+ const paths = [
69
+ ...set.manifest.shards.map(s => s.path),
70
+ ...(set.manifest.dicts?.map(d => d.path) ?? [])
71
+ ];
72
+ const codecs = new Set(paths.map(p => codecNameOf((0, codec_1.compressedExtOf)((0, decompress_1.resolveSource)(set.baseDir, p)))));
73
+ return codecs.size === 1 ? [...codecs][0] : 'mixed';
74
+ }
75
+ /** describe one loaded source for `:version` / diagnostics: a single bundle, a sharded set, or an in-memory source */
76
+ function describeLoadedDatabase(src) {
77
+ if (src instanceof reader_1.SigDatabase) {
78
+ return { scope: 'signatures', version: src.content?.version ?? 0, date: src.content?.date ?? '', hash: src.content?.hash ?? '' };
79
+ }
80
+ if (src instanceof reader_1.SigDatabaseSet) {
81
+ // the scope (base/current/history) is the leading segment of the manifest's own shard/dict filenames
82
+ const file = src.manifest.dicts?.[0]?.path ?? src.manifest.shards[0]?.path ?? '';
83
+ const scope = file.split('.')[0] || 'signatures';
84
+ return { scope, version: src.manifest.schema, date: src.manifest.date, hash: src.manifest.shards.map(s => s.hash).join(','), format: manifestFormat(src) };
85
+ }
86
+ // an in-memory source carries no bundle version/date
87
+ return { scope: 'signatures', version: 0, date: '', hash: src.packageNames().join(',') };
88
+ }
89
+ exports.sigDbLog = log_1.log.getSubLogger({ name: exports.SigDbPluginName });
90
+ /** additional sources from `$FLOWR_SIGDB` (path-delimiter separated), consulted after the explicit ones */
91
+ function envSources() {
92
+ const env = typeof process !== 'undefined' ? process.env?.FLOWR_SIGDB : undefined;
93
+ return env ? env.split(path_1.default.delimiter).filter(s => s.length > 0) : [];
94
+ }
95
+ /**
96
+ * The database flattens S3 methods into the export list, so we recover the `generic -> classes` map for
97
+ * dispatch: an export `generic.class` is a method when the `generic` is itself exported (e.g. `print.foo`).
98
+ */
99
+ function reconstructS3Generics(exported) {
100
+ const names = new Set(exported);
101
+ const generics = new Map();
102
+ for (const name of exported) {
103
+ const dot = name.indexOf('.');
104
+ const generic = dot > 0 ? name.slice(0, dot) : undefined;
105
+ if (generic !== undefined && names.has(generic)) {
106
+ const classes = generics.get(generic) ?? [];
107
+ classes.push(name.slice(dot + 1));
108
+ generics.set(generic, classes);
109
+ }
110
+ }
111
+ return generics;
112
+ }
113
+ /**
114
+ * Resolves `library(pkg)` / `use(pkg, fn)` from precomputed `flowr-sigdb` databases via the
115
+ * {@link PackageSignatureSource} contract. For an R-core package it picks the version shipped with the assumed
116
+ * R release (`solver.sigdb.assumedRVersion`), so `library(stats)` attaches that release's exports. Plain-file
117
+ * sources load lazily; a `.br` or manifest source is mounted by {@link preload}. On by default.
118
+ */
119
+ class FlowrAnalyzerPackageVersionsSigDbPlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
120
+ name = exports.SigDbPluginName;
121
+ description = 'Resolves library exports (and versioned base R) from precomputed flowr-sigdb databases.';
122
+ version = new semver_1.SemVer('0.1.0');
123
+ extraSources;
124
+ sources;
125
+ /** the `additionalPaths` the current {@link sources} were assembled with, so a later config resolves a rebuild */
126
+ sourcesKey;
127
+ analyzerCtx;
128
+ /** cached reverse index `export name -> packages exporting it`, built once per source set (see {@link packagesExporting}) */
129
+ exportIndex;
130
+ /** `pkg@assumedR` keys already reported via {@link baseVersionFor}'s fallback, so the info is logged once */
131
+ baseFallbacksLogged = new Set();
132
+ /** installed package versions for `versionSelection: 'system'`, read once from R (see {@link warmInstalledVersions}) */
133
+ installedVersions;
134
+ /** guards the one-time async warm-up of {@link installedVersions} */
135
+ installedVersionsPromise;
136
+ /** invalidate the assembled source list and derived caches (after a source or config change) */
137
+ resetAssembled() {
138
+ this.sources = undefined;
139
+ this.sourcesKey = undefined;
140
+ this.exportIndex = undefined;
141
+ }
142
+ constructor(...sources) {
143
+ super();
144
+ this.extraSources = sources;
145
+ }
146
+ /**
147
+ * Dynamically add signature sources after construction (opened instances, plain `.sigs.ndjson`, or `.br`/
148
+ * manifest paths). Added sources take precedence over the bundled default, so they can override or extend it.
149
+ */
150
+ addSource(...sources) {
151
+ this.extraSources.push(...sources);
152
+ this.resetAssembled(); // invalidate the caches so the next resolve picks the new sources up
153
+ }
154
+ process(ctx) {
155
+ this.resetAssembled(); // reload on (re)registration so config/source changes take effect (shared bundles are reused)
156
+ this.analyzerCtx = ctx;
157
+ if ((0, config_1.isSigDbEnabled)(ctx.config)) {
158
+ ctx.deps.addLazyResolver((name, existing) => this.resolve(name, existing));
159
+ if (ctx.config.solver.sigdb.warmInBackground) {
160
+ this.startBackgroundWarm();
161
+ }
162
+ if (ctx.config.solver.sigdb.autoSync) {
163
+ this.startBackgroundSync(ctx);
164
+ }
165
+ if (ctx.config.solver.sigdb.versionSelection === config_1.VersionSelection.System) {
166
+ this.warmInstalledVersions();
167
+ }
168
+ }
169
+ }
170
+ syncPromise;
171
+ /**
172
+ * Opt-in (`solver.sigdb.autoSync`) startup re-sync.
173
+ * If the committed `sigdb.remote.json` link file lists shards whose cached copies are missing or hash-mismatched,
174
+ * this will sync them.
175
+ */
176
+ startBackgroundSync(ctx) {
177
+ if (this.syncPromise !== undefined) {
178
+ return;
179
+ }
180
+ this.syncPromise = (async () => {
181
+ // dynamic import: sigdb-download pulls in node http/https, keep it off the hot load path
182
+ const dl = await Promise.resolve().then(() => __importStar(require('../../sigdb/sigdb-download')));
183
+ if (!dl.sigDbNeedsSync()) {
184
+ return;
185
+ }
186
+ exports.sigDbLog.info('sigdb: committed link file changed -- re-syncing shards in the background');
187
+ const { files } = await dl.downloadFullSigDb({
188
+ repo: ctx.config.solver.sigdb.downloadRepo,
189
+ onProgress: msg => exports.sigDbLog.info(`sigdb sync: ${msg}`)
190
+ });
191
+ for (const manifest of files.filter(f => /\.manifest\.json(\.br)?$/.test(f))) {
192
+ await ctx.deps.addDatabaseSource(manifest);
193
+ }
194
+ })().catch((e) => {
195
+ exports.sigDbLog.warn(`background sigdb sync failed (keeping the cached shards): ${e.message}`);
196
+ });
197
+ }
198
+ warmPromise;
199
+ /**
200
+ * Warm the hot shards (base + most-downloaded packages) of any sharded source in a background task, so the
201
+ * first `library()` lookup no longer blocks on decompression. Idempotent.
202
+ */
203
+ startBackgroundWarm() {
204
+ if (this.warmPromise !== undefined) {
205
+ return;
206
+ }
207
+ this.warmPromise = (async () => {
208
+ for (const src of this.loadSources()) {
209
+ if (src instanceof reader_1.SigDatabaseSet) {
210
+ await src.preloadShards(s => s.tier === 'current' && s.shard !== 'rest');
211
+ }
212
+ }
213
+ })().catch((e) => {
214
+ exports.sigDbLog.warn(`background sigdb warm failed: ${e.message}`);
215
+ });
216
+ }
217
+ /**
218
+ * Read the system's installed package versions once (for `versionSelection: 'system'`), off the hot path. Only
219
+ * an R-backed parser exposes `installedPackageVersions`; a tree-sitter (no-R) parser skips this, so `system`
220
+ * gracefully falls back to `newest` in {@link resolve}. Idempotent; failures leave the map empty (same fallback).
221
+ */
222
+ warmInstalledVersions() {
223
+ if (this.installedVersionsPromise !== undefined || this.installedVersions !== undefined) {
224
+ return;
225
+ }
226
+ const info = this.analyzerCtx?.analyzer?.parserInformation();
227
+ if (!info || !('installedPackageVersions' in info) || typeof info.installedPackageVersions !== 'function') {
228
+ return; // no R available: system selection falls back to newest
229
+ }
230
+ this.installedVersionsPromise = info.installedPackageVersions()
231
+ .then(versions => {
232
+ this.installedVersions = versions;
233
+ })
234
+ .catch((e) => {
235
+ this.installedVersions = new Map();
236
+ exports.sigDbLog.warn(`sigdb: could not read installed package versions for system version selection, falling back to newest: ${e.message}`);
237
+ });
238
+ }
239
+ /** Mount the databases up front instead of on the first library load (see `solver.sigdb.eagerlyLoad`). */
240
+ preloadDatabasesSync() {
241
+ this.loadSources();
242
+ }
243
+ /** whether any loaded source carries a versioned base-R package (so base namespaces can be attached eagerly) */
244
+ providesBaseRPackages() {
245
+ const base = (0, r_base_packages_1.baseRPackages)();
246
+ return this.loadSources().some(src => base.some(p => src.has(p) && src.isBaseR(p)));
247
+ }
248
+ signatureSources(config) {
249
+ return this.loadSources(config);
250
+ }
251
+ loadedDatabases() {
252
+ return this.loadSources().map(describeLoadedDatabase);
253
+ }
254
+ /**
255
+ * Packages in the loaded sources (respecting `self`-package exclusion) that export `name`. Backed by a
256
+ * reverse index built once per source set, so repeated hint lookups (e.g. from the `undefined-symbol` linter)
257
+ * do not re-scan every package. The first call still pays one full pass over the sources.
258
+ */
259
+ packagesExporting(name) {
260
+ if (!(0, config_1.isSigDbEnabled)(this.analyzerCtx?.config)) {
261
+ return [];
262
+ }
263
+ this.exportIndex ??= this.buildExportIndex();
264
+ return this.exportIndex.get(name) ?? [];
265
+ }
266
+ /** one pass over every loaded source building `export name -> packages`, honoring self-package exclusion */
267
+ buildExportIndex() {
268
+ const index = new Map();
269
+ for (const src of this.loadSources()) {
270
+ for (const pkg of src.packageNames()) {
271
+ if (this.isSelfPackage(pkg)) {
272
+ continue;
273
+ }
274
+ for (const exp of src.lookup(pkg)?.exported ?? []) {
275
+ const owners = index.get(exp);
276
+ if (owners === undefined) {
277
+ index.set(exp, [pkg]);
278
+ }
279
+ else if (!owners.includes(pkg)) {
280
+ owners.push(pkg);
281
+ }
282
+ }
283
+ }
284
+ }
285
+ return index;
286
+ }
287
+ /**
288
+ * The raw sources in priority order: explicit constructor sources, `$FLOWR_SIGDB`, then **every** bundled
289
+ * database discovered in the data dirs (see {@link defaultSigDbPaths}) -- so an extra bundle dropped next to
290
+ * the default (e.g. a downloaded full-history one) is mounted automatically. All bundled defaults are skipped
291
+ * when `$FLOWR_DISABLE_DEFAULT_SIGDB` is set; explicit sources are always honored.
292
+ */
293
+ rawSources(config) {
294
+ const sources = [...this.extraSources, ...envSources()];
295
+ const disableBundled = typeof process !== 'undefined' && process.env?.FLOWR_DISABLE_DEFAULT_SIGDB;
296
+ if (!disableBundled) {
297
+ // `additionalPaths` from the config are prioritized
298
+ const extra = (config ?? this.analyzerCtx?.config)?.solver.sigdb.additionalPaths ?? [];
299
+ sources.push(...(0, manifest_1.defaultSigDbPaths)(extra));
300
+ sources.push(...extra.filter(p => /\.(manifest\.json|sigs\.ndjson)(\.br|\.gz)?$/.test(p)));
301
+ }
302
+ return sources;
303
+ }
304
+ /** synchronously openable sources (instances + plain `.sigs.ndjson`); `.br`/manifests are added by {@link preload}. */
305
+ loadSources(config) {
306
+ const cfg = config ?? this.analyzerCtx?.config;
307
+ // `solver.sigdb.enabled: false` disables the database for this analyzer only: drop any loaded sources so it
308
+ // frees memory and every consumer (resolve, base-R link, queries) sees nothing -- other analyzers are untouched.
309
+ // An absent config is the pre-analysis query path (default enabled), so only an explicit `false` disables.
310
+ if (cfg !== undefined && !(0, config_1.isSigDbEnabled)(cfg)) {
311
+ if (this.sources !== undefined) {
312
+ this.resetAssembled();
313
+ }
314
+ return [];
315
+ }
316
+ // a query may run before an analysis has set `analyzerCtx`, memoizing sources without the config's
317
+ // `additionalPaths`; re-key on them so the config-aware call rebuilds rather than reusing the stale set
318
+ const key = (cfg?.solver.sigdb.additionalPaths ?? []).join('\0');
319
+ if (this.sources === undefined || this.sourcesKey !== key) {
320
+ this.sourcesKey = key;
321
+ this.sources = this.rawSources(config)
322
+ .map(s => this.loadSync(s))
323
+ .filter((s) => s !== undefined);
324
+ }
325
+ return this.sources;
326
+ }
327
+ loadSync(source) {
328
+ if (typeof source !== 'string') {
329
+ return source;
330
+ }
331
+ try {
332
+ const opened = (0, reader_1.getSharedSigSourceSync)(source);
333
+ if (opened === undefined) {
334
+ exports.sigDbLog.warn(`sigdb source ${source} needs preload() (only plain ${schema_1.SigDbExt} files and manifests open synchronously)`);
335
+ }
336
+ return opened;
337
+ }
338
+ catch (e) {
339
+ exports.sigDbLog.warn(`Could not load sigdb source: ${e.message}`);
340
+ }
341
+ return undefined;
342
+ }
343
+ /**
344
+ * Open every source, including compressed bundles (`.br`/`.gz`) and manifests (`*.manifest.json`).
345
+ * Call once at the analyzer boundary so resolution can fall through to them.
346
+ */
347
+ async preload() {
348
+ for (const source of this.rawSources()) {
349
+ if (typeof source !== 'string') {
350
+ continue;
351
+ }
352
+ try {
353
+ await (0, reader_1.getSharedSigSource)(source);
354
+ }
355
+ catch (e) {
356
+ exports.sigDbLog.warn(`Could not load sigdb source: ${e.message}`);
357
+ }
358
+ }
359
+ this.resetAssembled();
360
+ }
361
+ async addDatabaseSource(source) {
362
+ this.addSource(source);
363
+ await this.preload();
364
+ }
365
+ /** Whether the given name is the analyzed project itself (so we must not shadow its own definitions). */
366
+ isSelfPackage(name) {
367
+ const desc = this.analyzerCtx?.files.getFilesByRole(flowr_file_1.FileRole.Description) ?? [];
368
+ return desc.some(d => d.packageName() === name);
369
+ }
370
+ /**
371
+ * For a base package, the newest core version `<=` the assumed R version (see
372
+ * {@link FlowrAnalyzerContext.resolvedRVersion}). If the assumed version predates every recorded core
373
+ * release, the closest supported one (the earliest) is used and the substitution is logged once as info.
374
+ */
375
+ baseVersionFor(src, name) {
376
+ const versions = src.coreVersions(name);
377
+ if (!versions || versions.length === 0) {
378
+ return undefined;
379
+ }
380
+ const target = this.analyzerCtx?.resolvedRVersion ?? (0, config_1.resolveAssumedRVersion)(undefined);
381
+ let chosen; // versions are ascending; keep the newest core release <= target
382
+ for (const v of versions) {
383
+ if (r_version_1.RVersion.compare(v.str, target) <= 0) {
384
+ chosen = v;
385
+ }
386
+ }
387
+ if (chosen === undefined) {
388
+ // the assumed R version is older than the earliest recorded core release: fall back to the closest one
389
+ chosen = versions[0];
390
+ const key = `${name}@${target}`;
391
+ if (!this.baseFallbacksLogged.has(key)) {
392
+ this.baseFallbacksLogged.add(key);
393
+ exports.sigDbLog.info(`Assumed R version ${target} predates the earliest recorded core release of ${name}; falling back to the closest supported version ${chosen.str}.`);
394
+ }
395
+ }
396
+ return chosen.str;
397
+ }
398
+ resolve(name, existing) {
399
+ if (this.isSelfPackage(name)) {
400
+ return undefined;
401
+ }
402
+ const sigdb = this.analyzerCtx?.config.solver.sigdb;
403
+ const override = sigdb?.versionOverrides?.[name];
404
+ const selection = sigdb?.versionSelection ?? config_1.VersionSelection.Newest;
405
+ const range = existing?.derivedVersion;
406
+ let fallback;
407
+ for (const src of this.loadSources()) {
408
+ if (!src.has(name)) {
409
+ continue;
410
+ }
411
+ // base R always resolves against the assumed R version, independent of override/selection
412
+ if (src.isBaseR(name)) {
413
+ const info = src.lookup(name, this.baseVersionFor(src, name)) ?? src.lookup(name);
414
+ if (info && (range === undefined || r_version_1.RRange.satisfies(info.version, range))) {
415
+ return this.toResolvedPackage(name, info);
416
+ }
417
+ fallback ??= info;
418
+ continue;
419
+ }
420
+ // a per-package override wins over both the constraint and the newest/oldest/system policy
421
+ if (override !== undefined) {
422
+ const info = src.lookup(name, override);
423
+ if (info) {
424
+ return this.toResolvedPackage(name, info);
425
+ }
426
+ fallback ??= src.lookup(name);
427
+ continue;
428
+ }
429
+ const info = this.selectVersion(src, name, range, selection);
430
+ if (info) {
431
+ return this.toResolvedPackage(name, info);
432
+ }
433
+ fallback ??= src.lookup(name); // only a version outside the constraint is stored; keep it as a last resort
434
+ }
435
+ if (fallback !== undefined) {
436
+ const constraint = override !== undefined ? `override ${override}` : (range?.raw ?? 'a version');
437
+ exports.sigDbLog.warn(`project constrains ${name} to ${constraint} but the signature database only has ${fallback.version}; analyzing with ${fallback.version}`);
438
+ return this.toResolvedPackage(name, fallback);
439
+ }
440
+ return undefined;
441
+ }
442
+ /** the concrete export view for a non-base package under the active {@link VersionSelection} policy, or `undefined` if none satisfies */
443
+ selectVersion(src, name, range, selection) {
444
+ if (selection === config_1.VersionSelection.System) {
445
+ const installed = this.installedVersions?.get(name);
446
+ const info = installed !== undefined ? src.lookup(name, installed) : undefined;
447
+ if (info) {
448
+ return info; // the version that actually runs on this system (even if outside the declared constraint)
449
+ }
450
+ // not installed, not in the db, or no R available: fall through to newest-satisfying
451
+ }
452
+ if (selection === config_1.VersionSelection.Oldest) {
453
+ return this.oldestSatisfying(src, name, range);
454
+ }
455
+ return this.newestSatisfying(src, name, range);
456
+ }
457
+ /**
458
+ * Newest version satisfying the constraint. Fast path: prefer the source's latest (no history decompression for
459
+ * the common `>=` case) and accept it when it satisfies; only otherwise enumerate the stored versions and pick
460
+ * the highest satisfying one (e.g. an upper-bound or exact-old pin).
461
+ */
462
+ newestSatisfying(src, name, range) {
463
+ const pinned = range ? (0, semver_1.minVersion)(range)?.version : undefined;
464
+ const info = src.lookup(name, pinned) ?? src.lookup(name);
465
+ if (info && (range === undefined || r_version_1.RRange.satisfies(info.version, range))) {
466
+ return info;
467
+ }
468
+ if (range !== undefined) {
469
+ const versions = this.availableVersions(src, name);
470
+ for (let i = versions.length - 1; i >= 0; i--) {
471
+ if (r_version_1.RRange.satisfies(versions[i], range)) {
472
+ return src.lookup(name, versions[i]);
473
+ }
474
+ }
475
+ }
476
+ return undefined;
477
+ }
478
+ /** Lowest stored version satisfying the constraint (using the store's actual R-form version strings). */
479
+ oldestSatisfying(src, name, range) {
480
+ for (const version of this.availableVersions(src, name)) { // ascending
481
+ if (range === undefined || r_version_1.RRange.satisfies(version, range)) {
482
+ return src.lookup(name, version);
483
+ }
484
+ }
485
+ return undefined;
486
+ }
487
+ /** the versions the source can answer for a package (dated releases, base-R core releases, and the latest), ascending */
488
+ availableVersions(src, pkg) {
489
+ const set = new Set();
490
+ for (const r of src.releaseDates(pkg)) {
491
+ set.add(r.version.str);
492
+ }
493
+ for (const v of src.coreVersions(pkg) ?? []) {
494
+ set.add(v.str);
495
+ }
496
+ const latest = src.latestVersion(pkg);
497
+ if (latest) {
498
+ set.add(latest.str);
499
+ }
500
+ return [...set].sort((a, b) => r_version_1.RVersion.compare(a, b));
501
+ }
502
+ /** build the resolved {@link Package} (namespace + version) from a source's export view */
503
+ toResolvedPackage(name, info) {
504
+ const exported = info.exported.slice();
505
+ const namespaceInfo = {
506
+ exportedSymbols: exported,
507
+ exportedFunctions: [],
508
+ exportS3Generics: reconstructS3Generics(exported),
509
+ exportedPatterns: [],
510
+ importedPackages: new Map(),
511
+ loadsWithSideEffects: false,
512
+ callable: exported
513
+ };
514
+ return new package_1.Package({ name, namespaceInfo, resolvedVersion: info.version });
515
+ }
516
+ }
517
+ exports.FlowrAnalyzerPackageVersionsSigDbPlugin = FlowrAnalyzerPackageVersionsSigDbPlugin;
518
+ //# sourceMappingURL=flowr-analyzer-package-versions-sigdb-plugin.js.map
@@ -7,6 +7,8 @@ export type PackageOptions = {
7
7
  dependencies?: Package[];
8
8
  namespaceInfo?: NamespaceInfo;
9
9
  versionConstraints?: Range[];
10
+ /** the concrete version the exports were resolved from (e.g. the package database entry), for information only */
11
+ resolvedVersion?: string;
10
12
  };
11
13
  export declare class Package {
12
14
  name: string;
@@ -15,6 +17,7 @@ export declare class Package {
15
17
  dependencies?: Package[];
16
18
  namespaceInfo?: NamespaceInfo;
17
19
  versionConstraints: Range[];
20
+ resolvedVersion?: string;
18
21
  constructor(info: {
19
22
  name: string;
20
23
  } & PackageOptions);
@@ -24,8 +27,7 @@ export declare class Package {
24
27
  s3For(generic: string): string[];
25
28
  mergeInPlace(other: Package): void;
26
29
  addInfo(info: PackageOptions): void;
27
- getInfo(): this;
28
30
  deriveVersion(): Range | undefined;
29
- static parsePackageVersionRange(constraint?: string, version?: string): Range | undefined;
30
- static funcIdentif(dependency: string, func: string): string;
31
+ static parsePkgVersionRange(constraint?: string, version?: string): Range | undefined;
32
+ static functionIdentifier(dependency: string, func: string): string;
31
33
  }
@@ -5,6 +5,7 @@ const assert_1 = require("../../../util/assert");
5
5
  const flowr_namespace_file_1 = require("../file-plugins/files/flowr-namespace-file");
6
6
  const flowr_file_1 = require("../../context/flowr-file");
7
7
  const r_version_1 = require("../../../util/r-version");
8
+ const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
8
9
  class Package {
9
10
  name;
10
11
  derivedVersion;
@@ -12,6 +13,7 @@ class Package {
12
13
  dependencies;
13
14
  namespaceInfo;
14
15
  versionConstraints = [];
16
+ resolvedVersion;
15
17
  constructor(info) {
16
18
  this.name = info.name;
17
19
  this.addInfo(info);
@@ -27,16 +29,23 @@ class Package {
27
29
  if (!this.namespaceInfo) {
28
30
  return false;
29
31
  }
30
- if (name.includes('.')) {
31
- const [genericSplit, classSplit] = name.split('.');
32
- const classes = this.namespaceInfo.exportS3Generics.get(genericSplit);
33
- return classes ? classes.includes(classSplit) : false;
34
- }
32
+ // an explicit `generic`/`className` pair -> S3 method lookup
35
33
  if (className) {
36
34
  const classes = this.namespaceInfo.exportS3Generics.get(name);
37
35
  return classes ? classes.includes(className) : false;
38
36
  }
39
- return this.namespaceInfo.exportedFunctions.includes(name) || this.namespaceInfo.exportedSymbols.includes(name);
37
+ // a directly exported symbol/function - this also covers dotted plain exports such as
38
+ // `solve.QP`, `as.Date` or `read.csv` that are not S3 methods
39
+ if (this.namespaceInfo.exportedFunctions.includes(name) || this.namespaceInfo.exportedSymbols.includes(name)) {
40
+ return true;
41
+ }
42
+ // otherwise it may be an S3 method `generic.class` whose exported generic reconstructs it
43
+ if (name.includes('.')) {
44
+ const dot = name.indexOf('.');
45
+ const classes = this.namespaceInfo.exportS3Generics.get(name.slice(0, dot));
46
+ return classes ? classes.includes(name.slice(dot + 1)) : false;
47
+ }
48
+ return false;
40
49
  }
41
50
  s3For(generic) {
42
51
  return this.namespaceInfo?.exportS3Generics.get(generic) ?? [];
@@ -47,20 +56,16 @@ class Package {
47
56
  type: other.type,
48
57
  dependencies: other.dependencies,
49
58
  namespaceInfo: other.namespaceInfo,
50
- versionConstraints: other.versionConstraints
59
+ versionConstraints: other.versionConstraints,
60
+ resolvedVersion: other.resolvedVersion
51
61
  });
52
62
  }
53
63
  addInfo(info) {
54
- const { type, dependencies, namespaceInfo, versionConstraints } = info;
55
- if (type !== undefined) {
56
- this.type = type;
57
- }
58
- if (dependencies !== undefined) {
59
- this.dependencies = dependencies;
60
- }
61
- if (namespaceInfo !== undefined) {
62
- this.namespaceInfo = namespaceInfo;
63
- }
64
+ const { type, dependencies, namespaceInfo, versionConstraints, resolvedVersion } = info;
65
+ this.resolvedVersion = resolvedVersion ?? this.resolvedVersion;
66
+ this.type = type ?? this.type;
67
+ this.dependencies = dependencies ?? this.dependencies;
68
+ this.namespaceInfo = namespaceInfo ?? this.namespaceInfo;
64
69
  if (versionConstraints !== undefined) {
65
70
  this.derivedVersion ??= versionConstraints[0];
66
71
  for (const constraint of versionConstraints) {
@@ -72,24 +77,21 @@ class Package {
72
77
  }
73
78
  }
74
79
  }
75
- getInfo() {
76
- return this;
77
- }
78
80
  deriveVersion() {
79
81
  return this.versionConstraints.length > 0
80
- ? (0, r_version_1.parseRRange)(this.versionConstraints.map(c => c.raw).join(' '))
82
+ ? r_version_1.RRange.parse(this.versionConstraints.map(c => c.raw).join(' '))
81
83
  : undefined;
82
84
  }
83
- static parsePackageVersionRange(constraint, version) {
85
+ static parsePkgVersionRange(constraint, version) {
84
86
  if (version) {
85
- return constraint ? (0, r_version_1.parseRRange)(constraint + version) : (0, r_version_1.parseRRange)(version);
87
+ return constraint ? r_version_1.RRange.parse(constraint + version) : r_version_1.RRange.parse(version);
86
88
  }
87
89
  else {
88
90
  return undefined;
89
91
  }
90
92
  }
91
- static funcIdentif(dependency, func) {
92
- return `${dependency}:${func}`;
93
+ static functionIdentifier(dependency, func) {
94
+ return node_id_1.NodeId.pkgFnName(dependency, func);
93
95
  }
94
96
  }
95
97
  exports.Package = Package;