@eagleoutice/flowr 2.11.1 → 2.12.1

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 (264) hide show
  1. package/README.md +187 -257
  2. package/abstract-interpretation/absint-visitor.d.ts +1 -0
  3. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -1
  4. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  5. package/abstract-interpretation/domains/set-upper-bound-domain.js +6 -2
  6. package/benchmark/slicer.d.ts +1 -1
  7. package/benchmark/slicer.js +3 -1
  8. package/benchmark/summarizer/second-phase/graph.js +5 -0
  9. package/cli/common/options.d.ts +8 -0
  10. package/cli/common/options.js +2 -0
  11. package/cli/common/scripts-info.d.ts +8 -0
  12. package/cli/repl/commands/repl-commands.d.ts +1 -0
  13. package/cli/repl/commands/repl-commands.js +66 -15
  14. package/cli/repl/commands/repl-dataflow.js +48 -4
  15. package/cli/repl/commands/repl-main.d.ts +2 -0
  16. package/cli/repl/commands/repl-main.js +5 -0
  17. package/cli/repl/commands/repl-query.d.ts +4 -1
  18. package/cli/repl/commands/repl-query.js +72 -22
  19. package/cli/repl/commands/repl-signature.d.ts +7 -0
  20. package/cli/repl/commands/repl-signature.js +119 -0
  21. package/cli/repl/core.d.ts +8 -1
  22. package/cli/repl/core.js +46 -6
  23. package/cli/repl/ghost-hint.d.ts +37 -0
  24. package/cli/repl/ghost-hint.js +72 -0
  25. package/cli/repl/parser/slice-query-parser.d.ts +11 -1
  26. package/cli/repl/parser/slice-query-parser.js +45 -16
  27. package/cli/repl/print-version.d.ts +2 -4
  28. package/cli/repl/print-version.js +41 -23
  29. package/cli/repl/server/connection.js +19 -17
  30. package/cli/slicer-app.d.ts +2 -0
  31. package/cli/slicer-app.js +3 -3
  32. package/cli/wiki.d.ts +2 -2
  33. package/cli/wiki.js +2 -2
  34. package/config.d.ts +63 -2
  35. package/config.js +64 -8
  36. package/control-flow/cfg-dead-code.js +0 -1
  37. package/control-flow/control-flow-graph.js +6 -6
  38. package/control-flow/diff-cfg.js +2 -2
  39. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  40. package/core/print/slice-diff-ansi.js +8 -8
  41. package/core/steps/all/core/20-dataflow.d.ts +2 -2
  42. package/core/steps/all/static-slicing/00-slice.d.ts +5 -0
  43. package/core/steps/all/static-slicing/00-slice.js +1 -1
  44. package/core/steps/all/static-slicing/10-reconstruct.d.ts +7 -0
  45. package/core/steps/all/static-slicing/10-reconstruct.js +6 -2
  46. package/core/steps/pipeline/default-pipelines.d.ts +20 -16
  47. package/data/r-base-packages.generated.d.ts +44 -0
  48. package/data/r-base-packages.generated.js +32 -0
  49. package/data/r-base-primitives.generated.d.ts +1 -0
  50. package/data/r-base-primitives.generated.js +15 -0
  51. package/data/sigdb/sigdb.remote.json +112 -0
  52. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  53. package/dataflow/environments/built-in-proc-name.js +4 -0
  54. package/dataflow/environments/built-in.d.ts +14 -4
  55. package/dataflow/environments/built-in.js +13 -2
  56. package/dataflow/environments/data-masking-functions.d.ts +12 -0
  57. package/dataflow/environments/data-masking-functions.js +46 -0
  58. package/dataflow/environments/default-builtin-config.d.ts +72 -19
  59. package/dataflow/environments/default-builtin-config.js +48 -14
  60. package/dataflow/environments/diff.js +1 -1
  61. package/dataflow/environments/environment.js +1 -2
  62. package/dataflow/environments/identifier.d.ts +11 -4
  63. package/dataflow/environments/identifier.js +28 -10
  64. package/dataflow/environments/resolve-by-name.js +16 -2
  65. package/dataflow/extractor.js +6 -3
  66. package/dataflow/graph/call-graph.d.ts +2 -2
  67. package/dataflow/graph/df-helper.d.ts +4 -4
  68. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  69. package/dataflow/graph/edge.d.ts +3 -3
  70. package/dataflow/graph/edge.js +3 -3
  71. package/dataflow/graph/graph-helper.d.ts +2 -2
  72. package/dataflow/internal/linker.js +1 -1
  73. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +7 -0
  74. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +20 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +1 -0
  76. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -49
  77. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -1
  78. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +7 -1
  79. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +19 -0
  80. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +111 -6
  81. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +13 -0
  82. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -3
  83. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +9 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +19 -0
  85. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +12 -4
  86. package/dataflow/internal/process/functions/call/common.js +8 -1
  87. package/dataflow/internal/process/functions/call/default-call-handling.js +6 -0
  88. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +17 -0
  89. package/dataflow/internal/process/functions/call/known-call-handling.js +32 -0
  90. package/dataflow/internal/process/functions/call/named-call-handling.js +29 -7
  91. package/dataflow/internal/process/functions/process-argument.js +12 -1
  92. package/dataflow/internal/process/process-named-call.d.ts +18 -1
  93. package/dataflow/internal/process/process-named-call.js +94 -0
  94. package/dataflow/processor.d.ts +18 -0
  95. package/documentation/data/faq/faqs.js +5 -1
  96. package/documentation/doc-capabilities.js +1 -1
  97. package/documentation/doc-util/doc-cli-option.d.ts +10 -0
  98. package/documentation/doc-util/doc-cli-option.js +23 -0
  99. package/documentation/doc-util/doc-dfg.js +2 -1
  100. package/documentation/doc-util/doc-query.d.ts +9 -3
  101. package/documentation/doc-util/doc-query.js +9 -4
  102. package/documentation/wiki-dataflow-graph.js +8 -5
  103. package/documentation/wiki-interface.js +4 -2
  104. package/documentation/wiki-linter.js +1 -1
  105. package/documentation/wiki-linting-and-testing.js +4 -1
  106. package/documentation/wiki-mk/doc-context.d.ts +14 -0
  107. package/documentation/wiki-mk/doc-context.js +3 -0
  108. package/documentation/wiki-mk/doc-maker.js +3 -1
  109. package/documentation/wiki-query.js +36 -15
  110. package/documentation/wiki-setup.js +10 -7
  111. package/documentation/wiki-signature-database.d.ts +16 -0
  112. package/documentation/wiki-signature-database.js +293 -0
  113. package/linter/linter-format.d.ts +7 -0
  114. package/linter/linter-rules.d.ts +10 -9
  115. package/linter/rules/naming-convention.d.ts +1 -0
  116. package/linter/rules/naming-convention.js +2 -0
  117. package/linter/rules/no-leaked-credentials.js +1 -2
  118. package/linter/rules/roxygen-arguments.js +18 -5
  119. package/linter/rules/stop-with-call-arg.js +2 -2
  120. package/linter/rules/undefined-symbol-util.d.ts +36 -0
  121. package/linter/rules/undefined-symbol-util.js +149 -0
  122. package/linter/rules/undefined-symbol.d.ts +58 -17
  123. package/linter/rules/undefined-symbol.js +143 -33
  124. package/linter/rules/unused-definition.d.ts +8 -1
  125. package/linter/rules/unused-definition.js +126 -1
  126. package/package.json +22 -10
  127. package/project/context/abstract-flowr-analyzer-context.js +7 -1
  128. package/project/context/flowr-analyzer-context.d.ts +8 -0
  129. package/project/context/flowr-analyzer-context.js +10 -0
  130. package/project/context/flowr-analyzer-dependencies-context.d.ts +28 -4
  131. package/project/context/flowr-analyzer-dependencies-context.js +51 -2
  132. package/project/context/flowr-analyzer-files-context.d.ts +1 -0
  133. package/project/context/flowr-analyzer-files-context.js +2 -1
  134. package/project/context/flowr-analyzer-functions-context.js +1 -1
  135. package/project/context/flowr-file.d.ts +5 -0
  136. package/project/context/flowr-file.js +5 -0
  137. package/project/flowr-analyzer-builder.js +12 -2
  138. package/project/plugins/file-plugins/files/flowr-description-file.js +6 -3
  139. package/project/plugins/file-plugins/files/flowr-namespace-file.js +9 -3
  140. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -3
  141. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +26 -0
  142. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +39 -0
  143. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  144. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -2
  145. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -0
  146. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +18 -2
  147. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +19 -0
  148. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +120 -0
  149. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +518 -0
  150. package/project/plugins/package-version-plugins/package.d.ts +5 -3
  151. package/project/plugins/package-version-plugins/package.js +27 -25
  152. package/project/plugins/plugin-registry.d.ts +3 -2
  153. package/project/plugins/plugin-registry.js +4 -2
  154. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +7 -2
  155. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +3 -1
  156. package/project/sigdb/build.d.ts +131 -0
  157. package/project/sigdb/build.js +628 -0
  158. package/project/sigdb/codec.d.ts +51 -0
  159. package/project/sigdb/codec.js +122 -0
  160. package/project/sigdb/decode.d.ts +58 -0
  161. package/project/sigdb/decode.js +129 -0
  162. package/project/sigdb/decompress.d.ts +44 -0
  163. package/project/sigdb/decompress.js +176 -0
  164. package/project/sigdb/hash.d.ts +9 -0
  165. package/project/sigdb/hash.js +54 -0
  166. package/project/sigdb/index-format.d.ts +40 -0
  167. package/project/sigdb/index-format.js +28 -0
  168. package/project/sigdb/manifest.d.ts +68 -0
  169. package/project/sigdb/manifest.js +146 -0
  170. package/project/sigdb/reader.d.ts +250 -0
  171. package/project/sigdb/reader.js +692 -0
  172. package/project/sigdb/schema.d.ts +196 -0
  173. package/project/sigdb/schema.js +33 -0
  174. package/project/sigdb/sigdb-download.d.ts +65 -0
  175. package/project/sigdb/sigdb-download.js +237 -0
  176. package/project/sigdb/signature-match.d.ts +26 -0
  177. package/project/sigdb/signature-match.js +40 -0
  178. package/project/sigdb/version.d.ts +20 -0
  179. package/project/sigdb/version.js +55 -0
  180. package/queries/catalog/absint-query/absint-query-executor.d.ts +6 -0
  181. package/queries/catalog/absint-query/absint-query-executor.js +63 -0
  182. package/queries/catalog/absint-query/absint-query-format.d.ts +37 -0
  183. package/queries/catalog/absint-query/absint-query-format.js +102 -0
  184. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -3
  185. package/queries/catalog/config-query/config-query-format.d.ts +3 -1
  186. package/queries/catalog/config-query/config-query-format.js +68 -9
  187. package/queries/catalog/dataflow-query/dataflow-query-format.js +11 -1
  188. package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
  189. package/queries/catalog/linter-query/linter-query-executor.d.ts +2 -0
  190. package/queries/catalog/linter-query/linter-query-executor.js +6 -1
  191. package/queries/catalog/linter-query/linter-query-format.d.ts +2 -1
  192. package/queries/catalog/linter-query/linter-query-format.js +40 -8
  193. package/queries/catalog/project-query/project-query-executor.d.ts +15 -0
  194. package/queries/catalog/project-query/project-query-executor.js +96 -4
  195. package/queries/catalog/project-query/project-query-format.d.ts +44 -0
  196. package/queries/catalog/project-query/project-query-format.js +33 -2
  197. package/queries/catalog/signature-query/signature-query-executor.d.ts +29 -0
  198. package/queries/catalog/signature-query/signature-query-executor.js +461 -0
  199. package/queries/catalog/signature-query/signature-query-format.d.ts +138 -0
  200. package/queries/catalog/signature-query/signature-query-format.js +76 -0
  201. package/queries/catalog/signature-query/signature-query-render.d.ts +15 -0
  202. package/queries/catalog/signature-query/signature-query-render.js +155 -0
  203. package/queries/catalog/static-slice-query/static-slice-query-executor.js +9 -3
  204. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +10 -0
  205. package/queries/catalog/static-slice-query/static-slice-query-format.js +19 -1
  206. package/queries/query-print.js +5 -0
  207. package/queries/query.d.ts +15 -5
  208. package/queries/query.js +7 -4
  209. package/r-bridge/init.js +5 -1
  210. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +10 -0
  211. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +55 -0
  212. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +16 -0
  213. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +27 -0
  214. package/r-bridge/lang-4.x/ast/parser/json/format.js +89 -2
  215. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -4
  216. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +2 -1
  217. package/r-bridge/parser.d.ts +2 -0
  218. package/r-bridge/retriever.js +4 -1
  219. package/r-bridge/roxygen2/documentation-provider.js +2 -1
  220. package/r-bridge/shell.d.ts +5 -0
  221. package/r-bridge/shell.js +17 -1
  222. package/reconstruct/inline/source-inline-map.d.ts +48 -0
  223. package/reconstruct/inline/source-inline-map.js +94 -0
  224. package/reconstruct/reconstruct.d.ts +19 -2
  225. package/reconstruct/reconstruct.js +79 -16
  226. package/search/search-executor/search-generators.js +5 -22
  227. package/search/search-executor/search-transformer.js +10 -6
  228. package/slicing/criterion/parse.d.ts +28 -4
  229. package/slicing/criterion/parse.js +133 -18
  230. package/slicing/static/slice-call.d.ts +24 -1
  231. package/slicing/static/slice-call.js +90 -0
  232. package/slicing/static/static-slicer.d.ts +7 -0
  233. package/slicing/static/static-slicer.js +38 -3
  234. package/util/collections/arrays.d.ts +4 -5
  235. package/util/collections/arrays.js +7 -18
  236. package/util/hash.d.ts +14 -0
  237. package/util/hash.js +31 -0
  238. package/util/mermaid/dfg.d.ts +7 -2
  239. package/util/mermaid/dfg.js +53 -13
  240. package/util/r-base-packages.d.ts +19 -0
  241. package/util/r-base-packages.js +72 -0
  242. package/util/r-license.js +2 -10
  243. package/util/r-version.d.ts +45 -15
  244. package/util/r-version.js +97 -36
  245. package/util/range.d.ts +15 -0
  246. package/util/range.js +39 -0
  247. package/util/schema.d.ts +10 -0
  248. package/util/schema.js +22 -0
  249. package/util/text/ansi.d.ts +3 -0
  250. package/util/text/ansi.js +10 -0
  251. package/util/text/args.js +1 -2
  252. package/util/version.js +28 -8
  253. package/data/pkgdb/pkgdb-latest.json.br +0 -0
  254. package/data/pkgdb/pkgdb-tiny.json.br +0 -0
  255. package/documentation/wiki-package-database.d.ts +0 -9
  256. package/documentation/wiki-package-database.js +0 -63
  257. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +0 -63
  258. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +0 -176
  259. package/project/plugins/package-version-plugins/pkgdb.d.ts +0 -133
  260. package/project/plugins/package-version-plugins/pkgdb.js +0 -370
  261. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +0 -6
  262. package/queries/catalog/df-shape-query/df-shape-query-executor.js +0 -58
  263. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +0 -27
  264. package/queries/catalog/df-shape-query/df-shape-query-format.js +0 -56
@@ -32,6 +32,8 @@ export interface OutputFormatter {
32
32
  format(input: string, options?: FormatOptions): string;
33
33
  getFormatString(options?: FormatOptions): string;
34
34
  reset(): string;
35
+ /** render `text` as a link to `url` in whatever form this output supports (OSC 8, markdown, or plain text) */
36
+ hyperlink(text: string, url: string): string;
35
37
  }
36
38
  export declare const voidFormatter: OutputFormatter;
37
39
  export declare const markdownFormatter: OutputFormatter;
@@ -57,6 +59,7 @@ export declare function ansiInfo(s: string, f?: OutputFormatter): string;
57
59
  export declare const escape = "\u001B[";
58
60
  export declare const ansiFormatter: {
59
61
  reset(): string;
62
+ hyperlink(text: string, url: string): string;
60
63
  format(input: string, options?: FormatOptions): string;
61
64
  getFormatString(options?: FormatOptions): string;
62
65
  };
package/util/text/ansi.js CHANGED
@@ -22,6 +22,9 @@ exports.voidFormatter = new class {
22
22
  reset() {
23
23
  return '';
24
24
  }
25
+ hyperlink(text, _url) {
26
+ return text;
27
+ }
25
28
  }();
26
29
  exports.markdownFormatter = new class {
27
30
  format(input, options) {
@@ -52,6 +55,9 @@ exports.markdownFormatter = new class {
52
55
  reset() {
53
56
  return '';
54
57
  }
58
+ hyperlink(text, url) {
59
+ return `[${text}](${url})`;
60
+ }
55
61
  }();
56
62
  /**
57
63
  * This does not work if the {@link setFormatter|formatter} is void. Tries to format the text with a bold font weight.
@@ -83,6 +89,10 @@ exports.ansiFormatter = {
83
89
  reset() {
84
90
  return `${exports.escape}0${colorSuffix}`;
85
91
  },
92
+ hyperlink(text, url) {
93
+ // OSC 8 hyperlink, BEL-terminated (\x07) -- more widely supported than the ST form (Konsole, tmux, ...)
94
+ return `\x1b]8;;${url}\x07${text}\x1b]8;;\x07`;
95
+ },
86
96
  format(input, options) {
87
97
  return `${this.getFormatString(options)}${input}${this.reset()}`;
88
98
  },
package/util/text/args.js CHANGED
@@ -24,7 +24,6 @@ function splitAtEscapeSensitive(inputString, escapeQuote = true, split = ' ') {
24
24
  let escaped = false;
25
25
  for (let i = 0; i < inputString.length; i++) {
26
26
  const c = inputString[i];
27
- const sub = inputString.slice(i);
28
27
  if (escaped) {
29
28
  escaped = false;
30
29
  switch (c) {
@@ -51,7 +50,7 @@ function splitAtEscapeSensitive(inputString, escapeQuote = true, split = ' ') {
51
50
  }
52
51
  else if (!inQuotes
53
52
  && current !== ''
54
- && (split instanceof RegExp ? split.test(sub) : inputString.slice(i, i + split.length) === split)) {
53
+ && (split instanceof RegExp ? split.test(inputString.slice(i)) : inputString.slice(i, i + split.length) === split)) {
55
54
  args.push(current);
56
55
  current = '';
57
56
  }
package/util/version.js CHANGED
@@ -5,8 +5,11 @@ exports.retrieveVersionInformation = retrieveVersionInformation;
5
5
  exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
+ const sigdb_download_1 = require("../project/sigdb/sigdb-download");
8
9
  // this is automatically replaced with the current version by release-it
9
- const version = '2.11.1';
10
+ const version = '2.12.1';
11
+ // this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
12
+ const versionDate = '2026-07-15T07:13:44Z';
10
13
  /**
11
14
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
15
  */
@@ -40,15 +43,32 @@ async function retrieveVersionInformation(input) {
40
43
  async function printVersionInformation(output, input) {
41
44
  const { flowr, r, engine } = await retrieveVersionInformation(input);
42
45
  const faint = (s) => output.formatter.format(s, { style: 2 /* FontStyles.Faint */ });
43
- output.stdout(`Engine: ${engine}`);
44
- output.stdout(` flowR: ${flowr}`);
45
- // gray out R when it is not actually available
46
- output.stdout((r === 'none' || r === 'unknown') ? faint(` R: ${r}`) : ` R: ${r}`);
46
+ const rReason = r === 'none' ? ' (no R interpreter available)'
47
+ : r === 'unknown' ? (engine === 'tree-sitter' ? ' (not queried, using the tree-sitter engine)' : ' (could not be determined)')
48
+ : '';
49
+ const flowrValue = versionRegex.test(flowr) ? output.formatter.hyperlink(flowr, `https://github.com/flowr-analysis/flowr/releases/tag/v${flowr}`) : flowr;
50
+ const rows = [
51
+ ['engine', engine],
52
+ ['flowR', `${flowrValue} ${faint(`(${versionDate})`)}`],
53
+ ['R', `${r}${rReason}`, r === 'none' || r === 'unknown']
54
+ ];
47
55
  if (typeof input !== 'function' && 'inspectContext' in input) {
48
56
  // reads the current analyzer, so it reflects the databases in use (and adapts to config changes)
49
- const dbs = input.inspectContext().deps.loadedPackageDatabases();
50
- const line = ` package databases: ${dbs.length === 0 ? 'none' : dbs.map(d => `${d.scope} (v${d.version}, ${d.date})`).join(', ')}`;
51
- output.stdout(dbs.length === 0 ? faint(line) : line);
57
+ const ctx = input.inspectContext();
58
+ const setting = ctx.config.solver.sigdb.assumedRVersion ?? 'auto';
59
+ rows.push(['assumed R', `${ctx.resolvedRVersion} ${faint(`(solver.sigdb.assumedRVersion = "${setting}")`)}`]);
60
+ const dbs = ctx.deps.loadedPackageDatabases();
61
+ const sigDbUrl = (0, sigdb_download_1.sigDbRemoteRelease)()?.url;
62
+ const describe = (d) => {
63
+ const entry = `${d.scope} (v${d.version}, ${d.date}${d.format ? `, ${d.format}` : ''})`;
64
+ return sigDbUrl ? output.formatter.hyperlink(entry, sigDbUrl) : entry;
65
+ };
66
+ rows.push(['databases', dbs.length === 0 ? 'none' : dbs.map(describe).join(', '), dbs.length === 0]);
67
+ }
68
+ const width = Math.max(...rows.map(([label]) => label.length));
69
+ for (const [label, value, faded] of rows) {
70
+ const line = `${label.padEnd(width)} : ${value}`;
71
+ output.stdout(faded ? faint(line) : line);
52
72
  }
53
73
  }
54
74
  //# sourceMappingURL=version.js.map
Binary file
Binary file
@@ -1,9 +0,0 @@
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
- }
@@ -1,63 +0,0 @@
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.pkgdb.eagerlyLoad\` to mount the database up front, or \`solver.pkgdb.enabled: false\` to switch it off entirely).
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
@@ -1,63 +0,0 @@
1
- import { FlowrAnalyzerPackageVersionsPlugin, type PkgDbLoadedInfo } from './flowr-analyzer-package-versions-plugin';
2
- import { SemVer } from 'semver';
3
- import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
4
- import { PkgDatabase, type PkgDb } from './pkgdb';
5
- /** the plugin's instance name (pass to `unregisterPlugins` to disable the default pkgdb resolver) */
6
- export declare const PkgDbPluginName = "flowr-analyzer-package-versions-pkgdb-plugin";
7
- export declare const pkgDbLog: import("tslog").Logger<import("tslog").ILogObj>;
8
- /** a database, a parsed object, or a local file path */
9
- export type PkgDbSource = PkgDatabase | PkgDb | string;
10
- /**
11
- * The database flattens S3 methods into the export list, so we recover the `generic -> classes` map for
12
- * dispatch: an export `generic.class` is a method when the `generic` is itself exported (e.g. `print.foo`).
13
- */
14
- export declare function reconstructS3Generics(exported: readonly string[]): Map<string, string[]>;
15
- /**
16
- * Resolves `library(pkg)` / `use(pkg, fn)` from precomputed `flowr-pkgdb` databases: the one bundled
17
- * with flowR plus any extra sources (constructor args or `$FLOWR_PKGDB`). Extra sources are consulted
18
- * first, so they override the bundle; packages only in the bundle still resolve. Everything is loaded
19
- * lazily on the first miss (never touched if a project uses no external packages). On by default; opt
20
- * out via `unregisterPlugins(PkgDbPluginName)` or `$FLOWR_DISABLE_DEFAULT_PKGDB`.
21
- *
22
- * A source may be an `http(s)` URL to a downloadable summary; call {@link preload} once at the
23
- * analyzer boundary to fetch it, so resolution falls through to it for packages not in the bundle.
24
- */
25
- export declare class FlowrAnalyzerPackageVersionsPkgDbPlugin extends FlowrAnalyzerPackageVersionsPlugin {
26
- readonly name = "flowr-analyzer-package-versions-pkgdb-plugin";
27
- readonly description = "Resolves library exports from precomputed flowr-pkgdb databases.";
28
- readonly version: SemVer;
29
- /**
30
- * Process-wide cache of parsed file databases, keyed by their source path, so a flowR session parses
31
- * each file once. Parsing the bundled database is ~25ms and a fresh plugin instance is created per
32
- * analyzer, so without this every analysis touching a `library()` call would re-parse the multi-MB file.
33
- */
34
- private static readonly fileCache;
35
- private readonly extraSources;
36
- private databases;
37
- constructor(...sources: PkgDbSource[]);
38
- process(ctx: FlowrAnalyzerContext): void;
39
- /** Mount the databases up front (see `solver.pkgdb.eagerlyLoad`) instead of on the first library load. */
40
- preloadDatabasesSync(): void;
41
- /** metadata of the databases currently loaded (the synchronously available, non-URL sources) */
42
- loadedDatabases(): PkgDbLoadedInfo[];
43
- /**
44
- * Sources in priority order: explicit constructor sources, then `$FLOWR_PKGDB`, then the bundled
45
- * default. The bundled default is skipped when `$FLOWR_DISABLE_DEFAULT_PKGDB` is set (explicit
46
- * sources are always honored) - the env opt-out for the shipped database.
47
- */
48
- private sources;
49
- private static isUrl;
50
- /** synchronously loaded databases; remote (URL) summaries are only added by {@link preload}. */
51
- private loadDatabases;
52
- /**
53
- * Download and load every source, including remote (URL) summaries. Call this once at the
54
- * analyzer boundary to let `library()` resolution fall through to additional downloaded databases
55
- * (e.g. the full `all` summary or a richer `latest`). Without it, only local sources are used.
56
- */
57
- preload(): Promise<void>;
58
- private load;
59
- private mustLoad;
60
- /** Load a file source once per session, reusing the parsed database across analyzer instances. */
61
- private static loadFileCached;
62
- private resolve;
63
- }
@@ -1,176 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FlowrAnalyzerPackageVersionsPkgDbPlugin = exports.pkgDbLog = exports.PkgDbPluginName = void 0;
7
- exports.reconstructS3Generics = reconstructS3Generics;
8
- const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-package-versions-plugin");
9
- const semver_1 = require("semver");
10
- const path_1 = __importDefault(require("path"));
11
- const package_1 = require("./package");
12
- const pkgdb_1 = require("./pkgdb");
13
- const log_1 = require("../../../util/log");
14
- /** the plugin's instance name (pass to `unregisterPlugins` to disable the default pkgdb resolver) */
15
- exports.PkgDbPluginName = 'flowr-analyzer-package-versions-pkgdb-plugin';
16
- exports.pkgDbLog = log_1.log.getSubLogger({ name: exports.PkgDbPluginName });
17
- /** additional sources from `$FLOWR_PKGDB` (path-delimiter separated), highest priority after explicit ones */
18
- function envSources() {
19
- const env = typeof process !== 'undefined' ? process.env?.FLOWR_PKGDB : undefined;
20
- return env ? env.split(path_1.default.delimiter).filter(s => s.length > 0) : [];
21
- }
22
- /**
23
- * The database flattens S3 methods into the export list, so we recover the `generic -> classes` map for
24
- * dispatch: an export `generic.class` is a method when the `generic` is itself exported (e.g. `print.foo`).
25
- */
26
- function reconstructS3Generics(exported) {
27
- const names = new Set(exported);
28
- const generics = new Map();
29
- for (const name of exported) {
30
- const dot = name.indexOf('.');
31
- const generic = dot > 0 ? name.slice(0, dot) : undefined;
32
- if (generic !== undefined && names.has(generic)) {
33
- const classes = generics.get(generic) ?? [];
34
- classes.push(name.slice(dot + 1));
35
- generics.set(generic, classes);
36
- }
37
- }
38
- return generics;
39
- }
40
- /**
41
- * Resolves `library(pkg)` / `use(pkg, fn)` from precomputed `flowr-pkgdb` databases: the one bundled
42
- * with flowR plus any extra sources (constructor args or `$FLOWR_PKGDB`). Extra sources are consulted
43
- * first, so they override the bundle; packages only in the bundle still resolve. Everything is loaded
44
- * lazily on the first miss (never touched if a project uses no external packages). On by default; opt
45
- * out via `unregisterPlugins(PkgDbPluginName)` or `$FLOWR_DISABLE_DEFAULT_PKGDB`.
46
- *
47
- * A source may be an `http(s)` URL to a downloadable summary; call {@link preload} once at the
48
- * analyzer boundary to fetch it, so resolution falls through to it for packages not in the bundle.
49
- */
50
- class FlowrAnalyzerPackageVersionsPkgDbPlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
51
- name = exports.PkgDbPluginName;
52
- description = 'Resolves library exports from precomputed flowr-pkgdb databases.';
53
- version = new semver_1.SemVer('0.1.0');
54
- /**
55
- * Process-wide cache of parsed file databases, keyed by their source path, so a flowR session parses
56
- * each file once. Parsing the bundled database is ~25ms and a fresh plugin instance is created per
57
- * analyzer, so without this every analysis touching a `library()` call would re-parse the multi-MB file.
58
- */
59
- static fileCache = new Map();
60
- extraSources;
61
- databases;
62
- constructor(...sources) {
63
- super();
64
- this.extraSources = sources;
65
- }
66
- process(ctx) {
67
- this.databases = undefined; // reload on (re)registration so config/source changes take effect
68
- if (ctx.config.solver.pkgdb.enabled) {
69
- ctx.deps.addLazyResolver((name, existing) => this.resolve(name, existing));
70
- }
71
- }
72
- /** Mount the databases up front (see `solver.pkgdb.eagerlyLoad`) instead of on the first library load. */
73
- preloadDatabasesSync() {
74
- this.loadDatabases();
75
- }
76
- /** metadata of the databases currently loaded (the synchronously available, non-URL sources) */
77
- loadedDatabases() {
78
- return this.loadDatabases().map(db => ({ scope: db.scope, version: db.content.version, date: db.content.date }));
79
- }
80
- /**
81
- * Sources in priority order: explicit constructor sources, then `$FLOWR_PKGDB`, then the bundled
82
- * default. The bundled default is skipped when `$FLOWR_DISABLE_DEFAULT_PKGDB` is set (explicit
83
- * sources are always honored) - the env opt-out for the shipped database.
84
- */
85
- sources() {
86
- const disableBundled = typeof process !== 'undefined' && process.env?.FLOWR_DISABLE_DEFAULT_PKGDB;
87
- const bundled = disableBundled ? undefined : (0, pkgdb_1.defaultPkgDbPath)(); // richest bundled tier (all > latest > tiny)
88
- return [...this.extraSources, ...envSources(), ...(bundled ? [bundled] : [])];
89
- }
90
- static isUrl(s) {
91
- return typeof s === 'string' && /^https?:\/\//.test(s);
92
- }
93
- /** synchronously loaded databases; remote (URL) summaries are only added by {@link preload}. */
94
- loadDatabases() {
95
- if (this.databases === undefined) {
96
- this.databases = this.sources()
97
- .filter(s => !FlowrAnalyzerPackageVersionsPkgDbPlugin.isUrl(s))
98
- .map(s => this.load(s))
99
- .filter((d) => d !== undefined);
100
- }
101
- return this.databases;
102
- }
103
- /**
104
- * Download and load every source, including remote (URL) summaries. Call this once at the
105
- * analyzer boundary to let `library()` resolution fall through to additional downloaded databases
106
- * (e.g. the full `all` summary or a richer `latest`). Without it, only local sources are used.
107
- */
108
- async preload() {
109
- const dbs = [];
110
- for (const source of this.sources()) {
111
- try {
112
- dbs.push(FlowrAnalyzerPackageVersionsPkgDbPlugin.isUrl(source) ? await pkgdb_1.PkgDatabase.fromUrl(source) : this.mustLoad(source));
113
- }
114
- catch (e) {
115
- exports.pkgDbLog.warn(`Could not load pkgdb source: ${e.message}`);
116
- }
117
- }
118
- this.databases = dbs;
119
- }
120
- load(source) {
121
- try {
122
- return this.mustLoad(source);
123
- }
124
- catch (e) {
125
- exports.pkgDbLog.warn(`Could not load pkgdb source: ${e.message}`);
126
- return undefined;
127
- }
128
- }
129
- mustLoad(source) {
130
- if (source instanceof pkgdb_1.PkgDatabase) {
131
- return source;
132
- }
133
- if (typeof source !== 'string') {
134
- return pkgdb_1.PkgDatabase.fromObject(source);
135
- }
136
- return FlowrAnalyzerPackageVersionsPkgDbPlugin.loadFileCached(source);
137
- }
138
- /** Load a file source once per session, reusing the parsed database across analyzer instances. */
139
- static loadFileCached(file) {
140
- const cache = FlowrAnalyzerPackageVersionsPkgDbPlugin.fileCache;
141
- let db = cache.get(file);
142
- if (db === undefined) {
143
- db = pkgdb_1.PkgDatabase.fromFileSync(file);
144
- cache.set(file, db);
145
- }
146
- return db;
147
- }
148
- resolve(name, existing) {
149
- const pinned = existing?.derivedVersion ? (0, semver_1.minVersion)(existing.derivedVersion)?.version : undefined;
150
- for (const db of this.loadDatabases()) {
151
- const info = db.lookup(name, pinned);
152
- if (!info) {
153
- continue;
154
- }
155
- if (pinned && info.version !== pinned) {
156
- exports.pkgDbLog.warn(`project pins ${name}@${pinned} but the export database only has ${info.version}; analyzing with ${info.version}`);
157
- }
158
- else if (!pinned) {
159
- exports.pkgDbLog.debug(`no pinned version for ${name}; using ${info.version}`);
160
- }
161
- const namespaceInfo = {
162
- exportedSymbols: info.exported,
163
- exportedFunctions: [],
164
- exportS3Generics: reconstructS3Generics(info.exported),
165
- exportedPatterns: [],
166
- importedPackages: new Map(),
167
- loadsWithSideEffects: false,
168
- callable: info.exported
169
- };
170
- return new package_1.Package({ name, namespaceInfo });
171
- }
172
- return undefined;
173
- }
174
- }
175
- exports.FlowrAnalyzerPackageVersionsPkgDbPlugin = FlowrAnalyzerPackageVersionsPkgDbPlugin;
176
- //# sourceMappingURL=flowr-analyzer-package-versions-pkgdb-plugin.js.map
@@ -1,133 +0,0 @@
1
- export declare const PkgDbMagic = "flowr-pkgdb";
2
- export declare const PkgDbSchema = 4;
3
- export declare const DefaultCranBase = "https://cran.r-project.org/src/contrib/";
4
- export type PkgDbItem = number | string;
5
- export type PkgDbLatestEntry = [version: string, exported: PkgDbItem[]];
6
- /** one version in the `all` scope: `[version, exported, internal?, deprecated?]` of `lists` indices */
7
- export type PkgDbAllVersion = [string, number] | [string, number, number] | [string, number, number, number];
8
- /** `all`-scope package: `[latest, versions, nonCranVersions?]` (all arrays, no keys) */
9
- export type PkgDbAllEntry = [string, PkgDbAllVersion[]] | [string, PkgDbAllVersion[], string[]];
10
- /** optional definition location `[fileIndex, line]` indexing the `files` pool */
11
- export type PkgDbLoc = readonly [fileIndex: number, line: number];
12
- export interface PkgDbContent {
13
- version: number;
14
- date: string;
15
- hash: string;
16
- generated: number;
17
- packages: number;
18
- versions: number;
19
- }
20
- interface PkgDbCommon {
21
- format: string;
22
- schema: number;
23
- content: PkgDbContent;
24
- cranBase?: string;
25
- strings: string[];
26
- archived?: string[];
27
- noncran?: string[];
28
- }
29
- export interface PkgDbLatest extends PkgDbCommon {
30
- scope: 'latest';
31
- pkgs: Record<string, PkgDbLatestEntry>;
32
- }
33
- export interface PkgDbAll extends PkgDbCommon {
34
- scope: 'all';
35
- lists: PkgDbItem[][];
36
- pkgs: Record<string, PkgDbAllEntry>;
37
- /** optional file-path pool for {@link locs} */
38
- files?: string[];
39
- /** optional definition locations of the latest version: `pkg -> identifier -> [fileIndex, line]` */
40
- locs?: Record<string, Record<string, PkgDbLoc>>;
41
- }
42
- export type PkgDb = PkgDbLatest | PkgDbAll;
43
- /** a definition location surfaced from the `all` scope when the database carries them */
44
- export interface PkgDbDefinitionLocation {
45
- file: string;
46
- line: number;
47
- }
48
- /** the resolved identifiers of one package version */
49
- export interface LibraryExports {
50
- version: string;
51
- exported: string[];
52
- /** defined-but-not-exported identifiers (only available in the `all` scope) */
53
- internal: string[];
54
- deprecated: string[];
55
- cran: boolean;
56
- cranUrl?: string;
57
- /** definition location per identifier, if the database carries them (`all` scope, latest version) */
58
- locations?: ReadonlyMap<string, PkgDbDefinitionLocation>;
59
- }
60
- /** Reconstruct the CRAN source blob link; the newest non-archived version lives under `src/contrib`, every other under `Archive`. */
61
- export declare function cranBlobUrl(cranBase: string, pkg: string, version: string, opts: {
62
- latest: string;
63
- archived: boolean;
64
- cran: boolean;
65
- }): string | undefined;
66
- /** Validate the structural invariants of a decoded database, throwing a descriptive error on failure. */
67
- export declare function validatePkgDb(o: unknown): asserts o is PkgDb;
68
- export type PkgDbScope = 'all' | 'latest' | 'tiny';
69
- /**
70
- * Location of a bundled database, found by walking up from several roots (this module,
71
- * `$FLOWR_PKGDB_DIR`, the working directory) across the dev (`src`) and build (`dist`) layouts. With
72
- * no `scope` it returns the richest available tier (brotli, then gzip, then plain json). Node only
73
- * (needs `fs`); pass `searchRoots` to override where it looks.
74
- */
75
- export declare function defaultPkgDbPath(scope?: PkgDbScope, searchRoots?: readonly string[]): string | undefined;
76
- /** classified identifiers of one package version, fed to {@link PkgDbBuilder} */
77
- export interface VersionExports {
78
- exported: readonly string[];
79
- internal: readonly string[];
80
- deprecated: readonly string[];
81
- cran: boolean;
82
- /** optional definition location per identifier: `name -> [file, line]` (emitted only in the `all` scope) */
83
- locations?: ReadonlyMap<string, readonly [file: string, line: number]>;
84
- }
85
- /**
86
- * Serializes a {@link PkgDb}. Accumulate per-version exports with {@link addPackage}/{@link addVersion},
87
- * then {@link build} a scope. The multi-use string pool is computed per scope; the `latest` scope may
88
- * be pruned to the most-downloaded packages. This is the counterpart of {@link PkgDatabase} (the reader).
89
- */
90
- export declare class PkgDbBuilder {
91
- private readonly raw;
92
- private versionCount;
93
- addPackage(name: string, opts: {
94
- latest: string;
95
- archived?: boolean;
96
- downloads?: number;
97
- }): void;
98
- addVersion(name: string, version: string, exports: VersionExports): void;
99
- private relevant;
100
- private buildPool;
101
- build(scope: 'latest' | 'all', meta: {
102
- version: number;
103
- date: string;
104
- generated: number;
105
- cranBase?: string;
106
- minDownloads?: number;
107
- topN?: number;
108
- }): PkgDb;
109
- }
110
- export declare class PkgDatabase {
111
- private readonly db;
112
- private readonly archived;
113
- private readonly noncran;
114
- constructor(db: PkgDb);
115
- get content(): PkgDbContent;
116
- get scope(): 'latest' | 'all';
117
- /** parse an already-loaded object (validates the schema, throwing a descriptive error on failure) */
118
- static fromObject(obj: unknown): PkgDatabase;
119
- /** portable async load from raw bytes (gzip auto-detected) */
120
- static fromBytes(bytes: Uint8Array): Promise<PkgDatabase>;
121
- /** portable async load from a URL (works in Node 18+, browser and VS Code) */
122
- static fromUrl(url: string): Promise<PkgDatabase>;
123
- /** synchronous load from a local file (Node only; brotli by `.br`, else gzip auto-detected, else plain) */
124
- static fromFileSync(file: string): PkgDatabase;
125
- has(pkg: string): boolean;
126
- private decode;
127
- private result;
128
- /** definition locations of the latest version, if the (`all`-scope) database carries them */
129
- private locations;
130
- /** look up the identifiers of a package (defaulting to its latest version) */
131
- lookup(pkg: string, version?: string): LibraryExports | undefined;
132
- }
133
- export {};