@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.
- package/cli/flowr.js +21 -5
- package/cli/repl/commands/repl-commands.js +11 -9
- package/cli/repl/commands/repl-query.js +1 -1
- package/cli/repl/commands/repl-signature.js +8 -1
- package/cli/repl/core.js +13 -10
- package/cli/repl/print-version.js +1 -1
- package/cli/repl/server/connection.d.ts +1 -1
- package/cli/repl/server/net.js +15 -0
- package/config.d.ts +29 -0
- package/config.js +54 -2
- package/data/sigdb/sigdb.remote.json +1 -1
- package/dataflow/environments/identifier.d.ts +9 -8
- package/dataflow/environments/identifier.js +21 -13
- package/dataflow/eval/resolve/resolve-working-directory.d.ts +29 -0
- package/dataflow/eval/resolve/resolve-working-directory.js +168 -0
- package/dataflow/extractor.js +2 -1
- package/dataflow/graph/df-helper.d.ts +3 -2
- package/dataflow/graph/df-helper.js +11 -15
- package/dataflow/graph/diff-dataflow-graph.js +1 -1
- package/dataflow/graph/graph-helper.js +2 -6
- package/dataflow/graph/graph.d.ts +24 -0
- package/dataflow/graph/graph.js +25 -1
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-mk/doc-context.d.ts +10 -0
- package/documentation/wiki-mk/doc-context.js +3 -0
- package/documentation/wiki-signature-database.js +16 -6
- package/linter/linter-rules.d.ts +24 -2
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +4 -4
- package/linter/rules/absolute-path.js +7 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/file-path-validity.js +48 -8
- package/linter/rules/function-finder-util.d.ts +2 -1
- package/linter/rules/syntactically-valid.d.ts +58 -0
- package/linter/rules/syntactically-valid.js +203 -0
- package/linter/rules/undefined-symbol.js +3 -2
- package/package.json +5 -4
- package/project/context/classify-project-kind.d.ts +40 -0
- package/project/context/classify-project-kind.js +76 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +23 -4
- package/project/context/flowr-analyzer-dependencies-context.js +23 -1
- package/project/context/flowr-analyzer-files-context.d.ts +10 -8
- package/project/context/flowr-analyzer-files-context.js +26 -67
- package/project/context/flowr-file.d.ts +5 -0
- package/project/context/flowr-file.js +5 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +12 -4
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +25 -10
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +4 -1
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +57 -2
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +150 -28
- package/project/sigdb/decompress.d.ts +1 -1
- package/project/sigdb/decompress.js +4 -1
- package/project/sigdb/manifest.js +60 -26
- package/project/sigdb/sigdb-download.d.ts +6 -7
- package/project/sigdb/sigdb-download.js +30 -9
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +0 -10
- package/queries/catalog/dependencies-query/dependencies-query-format.js +0 -106
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
- package/queries/catalog/linter-query/linter-query-format.js +9 -2
- package/queries/catalog/signature-query/signature-query-executor.js +3 -0
- package/queries/catalog/signature-query/signature-query-render.js +4 -4
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/retriever.js +6 -1
- package/r-bridge/shell.js +5 -0
- package/search/flowr-search-filters.d.ts +2 -1
- package/util/files.d.ts +6 -4
- package/util/files.js +30 -8
- package/util/mermaid/dfg.js +1 -1
- package/util/text/ansi.d.ts +7 -3
- package/util/text/ansi.js +8 -5
- 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
|
|
58
|
-
* @param suffix
|
|
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
|
-
|
|
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
|
-
|
|
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)) {
|
package/util/mermaid/dfg.js
CHANGED
|
@@ -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
|
|
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;
|
package/util/text/ansi.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
36
|
-
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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}
|
|
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)(
|
|
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
|
}
|