@eagleoutice/flowr 2.13.1 → 2.13.2

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 (74) hide show
  1. package/cli/flowr.js +21 -5
  2. package/cli/repl/commands/repl-commands.js +11 -9
  3. package/cli/repl/commands/repl-query.js +1 -1
  4. package/cli/repl/commands/repl-signature.js +8 -1
  5. package/cli/repl/core.js +13 -10
  6. package/cli/repl/print-version.js +1 -1
  7. package/cli/repl/server/connection.d.ts +1 -1
  8. package/cli/repl/server/net.js +15 -0
  9. package/config.d.ts +29 -0
  10. package/config.js +54 -2
  11. package/data/sigdb/sigdb.remote.json +1 -1
  12. package/dataflow/environments/identifier.d.ts +9 -8
  13. package/dataflow/environments/identifier.js +21 -13
  14. package/dataflow/eval/resolve/resolve-working-directory.d.ts +29 -0
  15. package/dataflow/eval/resolve/resolve-working-directory.js +168 -0
  16. package/dataflow/extractor.js +2 -1
  17. package/dataflow/graph/df-helper.d.ts +3 -2
  18. package/dataflow/graph/df-helper.js +11 -15
  19. package/dataflow/graph/diff-dataflow-graph.js +1 -1
  20. package/dataflow/graph/graph-helper.js +2 -6
  21. package/dataflow/graph/graph.d.ts +24 -0
  22. package/dataflow/graph/graph.js +25 -1
  23. package/documentation/wiki-linter.js +1 -0
  24. package/documentation/wiki-mk/doc-context.d.ts +10 -0
  25. package/documentation/wiki-mk/doc-context.js +3 -0
  26. package/documentation/wiki-signature-database.js +16 -6
  27. package/linter/linter-rules.d.ts +24 -2
  28. package/linter/linter-rules.js +3 -1
  29. package/linter/rules/absolute-path.d.ts +4 -4
  30. package/linter/rules/absolute-path.js +7 -5
  31. package/linter/rules/file-path-validity.d.ts +1 -1
  32. package/linter/rules/file-path-validity.js +48 -8
  33. package/linter/rules/function-finder-util.d.ts +2 -1
  34. package/linter/rules/syntactically-valid.d.ts +58 -0
  35. package/linter/rules/syntactically-valid.js +203 -0
  36. package/linter/rules/undefined-symbol.js +3 -2
  37. package/package.json +5 -4
  38. package/project/context/classify-project-kind.d.ts +40 -0
  39. package/project/context/classify-project-kind.js +76 -0
  40. package/project/context/flowr-analyzer-dependencies-context.d.ts +23 -4
  41. package/project/context/flowr-analyzer-dependencies-context.js +23 -1
  42. package/project/context/flowr-analyzer-files-context.d.ts +10 -8
  43. package/project/context/flowr-analyzer-files-context.js +26 -67
  44. package/project/context/flowr-file.d.ts +5 -0
  45. package/project/context/flowr-file.js +5 -0
  46. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +12 -4
  47. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +25 -10
  48. package/project/plugins/plugin-registry.d.ts +2 -1
  49. package/project/plugins/plugin-registry.js +4 -1
  50. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +57 -2
  51. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +150 -28
  52. package/project/sigdb/decompress.d.ts +1 -1
  53. package/project/sigdb/decompress.js +4 -1
  54. package/project/sigdb/manifest.js +60 -26
  55. package/project/sigdb/sigdb-download.d.ts +6 -7
  56. package/project/sigdb/sigdb-download.js +30 -9
  57. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +0 -10
  58. package/queries/catalog/dependencies-query/dependencies-query-format.js +0 -106
  59. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
  60. package/queries/catalog/linter-query/linter-query-format.js +9 -2
  61. package/queries/catalog/signature-query/signature-query-executor.js +3 -0
  62. package/queries/catalog/signature-query/signature-query-render.js +4 -4
  63. package/queries/query.js +9 -2
  64. package/r-bridge/data/data.d.ts +5 -0
  65. package/r-bridge/data/data.js +6 -0
  66. package/r-bridge/retriever.js +6 -1
  67. package/r-bridge/shell.js +5 -0
  68. package/search/flowr-search-filters.d.ts +2 -1
  69. package/util/files.d.ts +6 -4
  70. package/util/files.js +30 -8
  71. package/util/mermaid/dfg.js +1 -1
  72. package/util/text/ansi.d.ts +7 -3
  73. package/util/text/ansi.js +8 -5
  74. package/util/version.js +4 -4
package/util/files.js CHANGED
@@ -54,17 +54,28 @@ const log_1 = require("./log");
54
54
  const n_readlines_1 = __importDefault(require("n-readlines"));
55
55
  /**
56
56
  * Retrieves all files in the given directory recursively
57
- * @param dir - Directory path to start the search from
58
- * @param suffix - Suffix of the files to be retrieved
57
+ * @param dir - Directory path to start the search from
58
+ * @param suffix - Suffix of the files to be retrieved
59
+ * @param throwOnError - If `true`, a directory that cannot be read aborts the traversal; otherwise it is logged and skipped (the default)
59
60
  * Based on {@link https://stackoverflow.com/a/45130990}
60
61
  * @see {@link getAllFilesSync} for a synchronous version.
61
62
  */
62
- async function* getAllFiles(dir, suffix = /.*/) {
63
- const entries = await fs_1.promises.readdir(dir, { withFileTypes: true, recursive: false });
63
+ async function* getAllFiles(dir, suffix = /.*/, throwOnError = false) {
64
+ let entries;
65
+ try {
66
+ entries = await fs_1.promises.readdir(dir, { withFileTypes: true, recursive: false });
67
+ }
68
+ catch (e) {
69
+ if (throwOnError) {
70
+ throw e;
71
+ }
72
+ log_1.log.warn(`Skipping '${dir}' during file discovery: ${e instanceof Error ? e.message : String(e)}`);
73
+ return;
74
+ }
64
75
  for (const subEntries of entries) {
65
76
  const res = path_1.default.resolve(dir, subEntries.name);
66
77
  if (subEntries.isDirectory()) {
67
- yield* getAllFiles(res, suffix);
78
+ yield* getAllFiles(res, suffix, throwOnError);
68
79
  }
69
80
  else if (suffix.test(subEntries.name)) {
70
81
  yield res;
@@ -78,15 +89,26 @@ async function* getAllFiles(dir, suffix = /.*/) {
78
89
  * @param ignoreDirs - Directories to skip, tested against the posix path relative to `dir`
79
90
  * (e.g. `packrat/lib`), so a pattern can address nested directories
80
91
  * @param relativeTo - The path to which the returned paths are relative (used for `ignoreDirs`), defaults to `dir`
92
+ * @param throwOnError - If `true`, a directory that cannot be read aborts the traversal; otherwise it is logged and skipped (the default)
81
93
  * @see {@link getAllFiles} - for an asynchronous version.
82
94
  */
83
- function* getAllFilesSync(dir, suffix = /.*/, ignoreDirs = undefined, relativeTo = dir) {
84
- const entries = fs_1.default.readdirSync(dir, { withFileTypes: true, recursive: false });
95
+ function* getAllFilesSync(dir, suffix = /.*/, ignoreDirs = undefined, relativeTo = dir, throwOnError = false) {
96
+ let entries;
97
+ try {
98
+ entries = fs_1.default.readdirSync(dir, { withFileTypes: true, recursive: false });
99
+ }
100
+ catch (e) {
101
+ if (throwOnError) {
102
+ throw e;
103
+ }
104
+ log_1.log.warn(`Skipping '${dir}' during file discovery: ${e instanceof Error ? e.message : String(e)}`);
105
+ return;
106
+ }
85
107
  for (const subEntries of entries) {
86
108
  const res = path_1.default.resolve(dir, subEntries.name);
87
109
  if (subEntries.isDirectory()) {
88
110
  if (!ignoreDirs?.test(toPosixPath(path_1.default.relative(relativeTo, res)))) {
89
- yield* getAllFilesSync(res, suffix, ignoreDirs, relativeTo);
111
+ yield* getAllFilesSync(res, suffix, ignoreDirs, relativeTo, throwOnError);
90
112
  }
91
113
  }
92
114
  else if (suffix.test(subEntries.name)) {
@@ -184,7 +184,7 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark, includeOnlyIds) {
184
184
  const lexeme = node?.lexeme ?? (node?.type === type_1.RType.ExpressionList ? node?.grouping?.[0]?.lexeme : '') ?? '??';
185
185
  let display = lexeme;
186
186
  if (fCall && (0, vertex_1.isFunctionCallVertex)(info)) {
187
- const q = identifier_1.Identifier.toQualified((0, dfg_get_origin_1.getOriginInDfg)(mermaid.rootGraph, origId), mermaid.qualifyBaseR === false ? undefined : info.name);
187
+ const q = identifier_1.Identifier.toQualified((0, dfg_get_origin_1.getOriginInDfg)(mermaid.rootGraph, origId), info.name, mermaid.qualifyBaseR !== false);
188
188
  const qs = q !== undefined ? identifier_1.Identifier.toString(q) : undefined;
189
189
  if (qs !== undefined && qs !== lexeme) {
190
190
  display = qs;
@@ -32,8 +32,12 @@ 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
+ /**
36
+ * Render `text` as a link to `url` in whatever form this output supports (OSC 8, markdown, or plain text).
37
+ * When a live hyperlink cannot be rendered, the raw `url` is shown so the target is not lost; pass
38
+ * `force` to always emit just the short `text` label instead.
39
+ */
40
+ hyperlink(text: string, url: string, force?: boolean): string;
37
41
  }
38
42
  export declare const voidFormatter: OutputFormatter;
39
43
  export declare const markdownFormatter: OutputFormatter;
@@ -63,7 +67,7 @@ export declare const escape = "\u001B[";
63
67
  export declare function supportsHyperlinks(): boolean;
64
68
  export declare const ansiFormatter: {
65
69
  reset(): string;
66
- hyperlink(text: string, url: string): string;
70
+ hyperlink(text: string, url: string, force?: boolean): string;
67
71
  format(input: string, options?: FormatOptions): string;
68
72
  getFormatString(options?: FormatOptions): string;
69
73
  };
package/util/text/ansi.js CHANGED
@@ -24,8 +24,8 @@ exports.voidFormatter = new class {
24
24
  reset() {
25
25
  return '';
26
26
  }
27
- hyperlink(text, _url) {
28
- return text;
27
+ hyperlink(text, url, force = false) {
28
+ return force ? text : url;
29
29
  }
30
30
  }();
31
31
  exports.markdownFormatter = new class {
@@ -57,7 +57,7 @@ exports.markdownFormatter = new class {
57
57
  reset() {
58
58
  return '';
59
59
  }
60
- hyperlink(text, url) {
60
+ hyperlink(text, url, _force = false) {
61
61
  return `[${text}](${url})`;
62
62
  }
63
63
  }();
@@ -114,8 +114,11 @@ exports.ansiFormatter = {
114
114
  reset() {
115
115
  return `${exports.escape}0${colorSuffix}`;
116
116
  },
117
- hyperlink(text, url) {
118
- return supportsHyperlinks() ? `\x1b]8;;${url}\x07${text}\x1b]8;;\x07` : text;
117
+ hyperlink(text, url, force = false) {
118
+ if (supportsHyperlinks()) {
119
+ return `\x1b]8;;${url}\x07${text}\x1b]8;;\x07`;
120
+ }
121
+ return force ? text : url;
119
122
  },
120
123
  format(input, options) {
121
124
  return `${this.getFormatString(options)}${input}${this.reset()}`;
package/util/version.js CHANGED
@@ -42,7 +42,7 @@ const assert_1 = require("./assert");
42
42
  const sigdb_download_1 = require("../project/sigdb/sigdb-download");
43
43
  const doc_files_1 = require("../documentation/doc-util/doc-files");
44
44
  // this is automatically replaced with the current version by release-it
45
- const version = '2.13.1';
45
+ const version = '2.13.2';
46
46
  // this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
47
47
  const versionDate = '2026-07-15T07:13:44Z';
48
48
  /**
@@ -81,7 +81,7 @@ async function printVersionInformation(output, input, engineOnly = false) {
81
81
  const rReason = r === 'none' ? ' (no R interpreter available)'
82
82
  : r === 'unknown' ? (engine === 'tree-sitter' ? ' (not queried, using the tree-sitter engine)' : ' (could not be determined)')
83
83
  : '';
84
- const flowrValue = versionRegex.test(flowr) ? output.formatter.hyperlink(flowr, `https://github.com/flowr-analysis/flowr/releases/tag/v${flowr}`) : flowr;
84
+ const flowrValue = versionRegex.test(flowr) ? output.formatter.hyperlink(flowr, `https://github.com/flowr-analysis/flowr/releases/tag/v${flowr}`, true) : flowr;
85
85
  const rows = [];
86
86
  const pluginLines = [];
87
87
  if (!engineOnly) {
@@ -97,7 +97,7 @@ async function printVersionInformation(output, input, engineOnly = false) {
97
97
  const sigDbUrl = (0, sigdb_download_1.sigDbRemoteRelease)()?.url;
98
98
  const describe = (d) => {
99
99
  const entry = `${d.scope} (v${d.version}, ${d.date}${d.format ? `, ${d.format}` : ''})`;
100
- return sigDbUrl ? output.formatter.hyperlink(entry, sigDbUrl) : entry;
100
+ return sigDbUrl ? output.formatter.hyperlink(entry, sigDbUrl, true) : entry;
101
101
  };
102
102
  rows.push(['databases', dbs.length === 0 ? 'none' : dbs.map(describe).join(', '), dbs.length === 0]);
103
103
  // the registered plugins, grouped by prefix; collected here and printed after the table (below) so the
@@ -127,7 +127,7 @@ async function printVersionInformation(output, input, engineOnly = false) {
127
127
  const labelWidth = Math.max(...[...byPrefix.keys()].map(p => p.length));
128
128
  const header = `registered plugins (${names.length})`;
129
129
  const hint = trace ? ' (faint = did not activate)' : ' (set +repl.showPlugins=true to track activation)';
130
- pluginLines.push(`${(0, ansi_1.bold)(osc8 ? output.formatter.hyperlink(header, wiki) : header, output.formatter)}:${dim(hint)}`);
130
+ pluginLines.push(`${(0, ansi_1.bold)(output.formatter.hyperlink(header, wiki, true), output.formatter)}:${dim(hint)}`);
131
131
  for (const [prefix, suffixes] of [...byPrefix].sort((a, b) => a[0].localeCompare(b[0]))) {
132
132
  pluginLines.push(` ${(0, ansi_1.bold)(prefix, output.formatter)}:${' '.repeat(labelWidth - prefix.length)} ${[...suffixes].sort((a, b) => a.localeCompare(b)).map(s => render(`${prefix}:${s}`, s)).join(', ')}`);
133
133
  }