@eagleoutice/flowr 2.10.10 → 2.11.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.
- package/README.md +35 -27
- package/cli/common/options.d.ts +2 -108
- package/cli/common/options.js +3 -27
- package/cli/common/scripts-info.d.ts +2 -123
- package/cli/common/scripts-info.js +0 -17
- package/cli/flowr-main-options.d.ts +5 -0
- package/cli/flowr-main-options.js +10 -0
- package/cli/flowr.js +2 -2
- package/cli/repl/commands/repl-commands.js +7 -6
- package/cli/repl/print-version.d.ts +3 -1
- package/cli/repl/print-version.js +21 -2
- package/cli/repl/server/connection.d.ts +2 -0
- package/cli/repl/server/connection.js +40 -31
- package/cli/script-core/summarizer-core.js +13 -32
- package/cli/wiki.d.ts +2 -1
- package/cli/wiki.js +2 -0
- package/config.d.ts +9 -0
- package/config.js +10 -0
- package/control-flow/semantic-cfg-guided-visitor.js +1 -0
- package/core/steps/pipeline/default-pipelines.d.ts +146 -146
- package/data/pkgdb/pkgdb-latest.json.br +0 -0
- package/data/pkgdb/pkgdb-tiny.json.br +0 -0
- package/dataflow/environments/append.d.ts +1 -2
- package/dataflow/environments/append.js +3 -10
- package/dataflow/environments/apply-kill.d.ts +21 -0
- package/dataflow/environments/apply-kill.js +155 -0
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in.d.ts +2 -0
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +63 -3
- package/dataflow/environments/default-builtin-config.js +40 -8
- package/dataflow/environments/environment.d.ts +49 -32
- package/dataflow/environments/environment.js +133 -18
- package/dataflow/environments/identifier.d.ts +10 -0
- package/dataflow/environments/identifier.js +23 -0
- package/dataflow/environments/overwrite.js +2 -10
- package/dataflow/environments/resolve-by-name.d.ts +1 -1
- package/dataflow/environments/resolve-by-name.js +10 -2
- package/dataflow/environments/scoping.d.ts +9 -2
- package/dataflow/environments/scoping.js +15 -2
- package/dataflow/extractor.js +23 -2
- package/dataflow/graph/df-helper.d.ts +8 -0
- package/dataflow/graph/df-helper.js +8 -0
- package/dataflow/graph/graph.d.ts +4 -1
- package/dataflow/graph/graph.js +5 -1
- package/dataflow/info.d.ts +26 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +7 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +9 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -47
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +17 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +8 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +9 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +37 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +391 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +131 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +25 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +94 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +10 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +30 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +279 -0
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +17 -0
- package/documentation/data/faq/faqs.js +3 -0
- package/documentation/data/interface/doc-writing-code.js +4 -80
- package/documentation/doc-util/doc-structure.js +1 -2
- package/documentation/wiki-core.js +2 -1
- package/documentation/wiki-dataflow-graph.js +35 -1
- package/documentation/wiki-interface.js +2 -2
- package/documentation/wiki-linter.js +2 -0
- package/documentation/wiki-overview.js +1 -14
- package/documentation/wiki-package-database.d.ts +9 -0
- package/documentation/wiki-package-database.js +63 -0
- package/documentation/wiki-query.js +1 -0
- package/linter/linter-rules.d.ts +23 -0
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.js +2 -1
- package/linter/rules/undefined-symbol.d.ts +39 -0
- package/linter/rules/undefined-symbol.js +80 -0
- package/package.json +4 -4
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +9 -1
- package/project/context/flowr-analyzer-dependencies-context.d.ts +16 -8
- package/project/context/flowr-analyzer-dependencies-context.js +39 -4
- package/project/context/flowr-analyzer-environment-context.d.ts +2 -4
- package/project/context/flowr-analyzer-environment-context.js +3 -4
- package/project/context/flowr-analyzer-files-context.d.ts +1 -0
- package/project/context/flowr-file.d.ts +2 -0
- package/project/context/flowr-file.js +2 -0
- package/project/flowr-analyzer-builder.js +3 -0
- package/project/flowr-analyzer.d.ts +2 -1
- package/project/flowr-analyzer.js +3 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +13 -15
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +36 -13
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +27 -0
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +41 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +63 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +176 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +6 -0
- package/project/plugins/package-version-plugins/package.d.ts +3 -0
- package/project/plugins/package-version-plugins/package.js +12 -0
- package/project/plugins/package-version-plugins/pkgdb.d.ts +133 -0
- package/project/plugins/package-version-plugins/pkgdb.js +370 -0
- package/project/plugins/plugin-registry.d.ts +4 -1
- package/project/plugins/plugin-registry.js +7 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +8 -0
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +8 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +31 -3
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/other-path-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/other-path-functions.js +27 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +5 -4
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +3 -1
- package/queries/catalog/linter-query/linter-query-executor.js +1 -0
- package/r-bridge/data/data.d.ts +2 -2
- package/r-bridge/data/data.js +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +13 -4
- package/search/search-executor/search-enrichers.d.ts +1 -1
- package/search/search-executor/search-enrichers.js +7 -4
- package/util/mermaid/mermaid.d.ts +4 -0
- package/util/mermaid/mermaid.js +8 -1
- package/util/text/ansi.d.ts +10 -1
- package/util/text/ansi.js +17 -4
- package/util/version.js +10 -2
- package/cli/common/features.d.ts +0 -9
- package/cli/common/features.js +0 -35
- package/cli/script-core/statistics-core.d.ts +0 -6
- package/cli/script-core/statistics-core.js +0 -104
- package/cli/script-core/statistics-helper-core.d.ts +0 -6
- package/cli/script-core/statistics-helper-core.js +0 -86
- package/cli/statistics-app.d.ts +0 -11
- package/cli/statistics-app.js +0 -16
- package/cli/statistics-helper-app.d.ts +0 -11
- package/cli/statistics-helper-app.js +0 -14
- package/statistics/features/common-syntax-probability.d.ts +0 -38
- package/statistics/features/common-syntax-probability.js +0 -169
- package/statistics/features/feature.d.ts +0 -179
- package/statistics/features/feature.js +0 -38
- package/statistics/features/post-processing.d.ts +0 -18
- package/statistics/features/post-processing.js +0 -26
- package/statistics/features/supported/assignments/assignments.d.ts +0 -12
- package/statistics/features/supported/assignments/assignments.js +0 -56
- package/statistics/features/supported/assignments/post-process.d.ts +0 -6
- package/statistics/features/supported/assignments/post-process.js +0 -126
- package/statistics/features/supported/comments/comments.d.ts +0 -18
- package/statistics/features/supported/comments/comments.js +0 -143
- package/statistics/features/supported/comments/post-process.d.ts +0 -6
- package/statistics/features/supported/comments/post-process.js +0 -51
- package/statistics/features/supported/control-flow/control-flow.d.ts +0 -17
- package/statistics/features/supported/control-flow/control-flow.js +0 -69
- package/statistics/features/supported/control-flow/post-process.d.ts +0 -6
- package/statistics/features/supported/control-flow/post-process.js +0 -66
- package/statistics/features/supported/data-access/data-access.d.ts +0 -15
- package/statistics/features/supported/data-access/data-access.js +0 -122
- package/statistics/features/supported/data-access/post-process.d.ts +0 -6
- package/statistics/features/supported/data-access/post-process.js +0 -108
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +0 -34
- package/statistics/features/supported/defined-functions/defined-functions.js +0 -145
- package/statistics/features/supported/defined-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/defined-functions/post-process.js +0 -168
- package/statistics/features/supported/expression-list/post-process.d.ts +0 -6
- package/statistics/features/supported/expression-list/post-process.js +0 -45
- package/statistics/features/supported/expression-list/statistics-expression-list.d.ts +0 -9
- package/statistics/features/supported/expression-list/statistics-expression-list.js +0 -37
- package/statistics/features/supported/loops/loops.d.ts +0 -20
- package/statistics/features/supported/loops/loops.js +0 -81
- package/statistics/features/supported/loops/post-process.d.ts +0 -6
- package/statistics/features/supported/loops/post-process.js +0 -73
- package/statistics/features/supported/used-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/used-functions/post-process.js +0 -176
- package/statistics/features/supported/used-functions/used-functions.d.ts +0 -24
- package/statistics/features/supported/used-functions/used-functions.js +0 -99
- package/statistics/features/supported/used-packages/post-process.d.ts +0 -6
- package/statistics/features/supported/used-packages/post-process.js +0 -122
- package/statistics/features/supported/used-packages/used-packages.d.ts +0 -16
- package/statistics/features/supported/used-packages/used-packages.js +0 -140
- package/statistics/features/supported/values/post-process.d.ts +0 -6
- package/statistics/features/supported/values/post-process.js +0 -73
- package/statistics/features/supported/values/values.d.ts +0 -14
- package/statistics/features/supported/values/values.js +0 -111
- package/statistics/features/supported/variables/post-process.d.ts +0 -15
- package/statistics/features/supported/variables/post-process.js +0 -126
- package/statistics/features/supported/variables/variables.d.ts +0 -15
- package/statistics/features/supported/variables/variables.js +0 -62
- package/statistics/meta-statistics.d.ts +0 -32
- package/statistics/meta-statistics.js +0 -16
- package/statistics/output/file-provider.d.ts +0 -36
- package/statistics/output/file-provider.js +0 -96
- package/statistics/output/print-stats.d.ts +0 -29
- package/statistics/output/print-stats.js +0 -81
- package/statistics/output/statistics-file.d.ts +0 -36
- package/statistics/output/statistics-file.js +0 -68
- package/statistics/statistics.d.ts +0 -29
- package/statistics/statistics.js +0 -108
- package/statistics/summarizer/auto-detect.d.ts +0 -5
- package/statistics/summarizer/auto-detect.js +0 -34
- package/statistics/summarizer/first-phase/process.d.ts +0 -6
- package/statistics/summarizer/first-phase/process.js +0 -81
- package/statistics/summarizer/post-process/clusterer.d.ts +0 -25
- package/statistics/summarizer/post-process/clusterer.js +0 -40
- package/statistics/summarizer/post-process/file-based-count.d.ts +0 -16
- package/statistics/summarizer/post-process/file-based-count.js +0 -47
- package/statistics/summarizer/post-process/histogram.d.ts +0 -57
- package/statistics/summarizer/post-process/histogram.js +0 -126
- package/statistics/summarizer/post-process/post-process-output.d.ts +0 -14
- package/statistics/summarizer/post-process/post-process-output.js +0 -102
- package/statistics/summarizer/second-phase/process.d.ts +0 -15
- package/statistics/summarizer/second-phase/process.js +0 -118
- package/statistics/summarizer/summarizer.d.ts +0 -34
- package/statistics/summarizer/summarizer.js +0 -141
|
@@ -5,8 +5,7 @@ const environment_1 = require("../../dataflow/environments/environment");
|
|
|
5
5
|
const built_in_config_1 = require("../../dataflow/environments/built-in-config");
|
|
6
6
|
const fingerprint_1 = require("../../slicing/static/fingerprint");
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* It creates the built-in environment based on the configuration provided in the {@link FlowrAnalyzerContext}.
|
|
8
|
+
* Provides the built-in environment, created from the {@link FlowrAnalyzerContext} configuration.
|
|
10
9
|
*/
|
|
11
10
|
class FlowrAnalyzerEnvironmentContext {
|
|
12
11
|
name = 'flowr-analyzer-environment-context';
|
|
@@ -29,7 +28,7 @@ class FlowrAnalyzerEnvironmentContext {
|
|
|
29
28
|
}
|
|
30
29
|
makeCleanEnv() {
|
|
31
30
|
return {
|
|
32
|
-
current: new environment_1.Environment(this.builtInEnv),
|
|
31
|
+
current: new environment_1.Environment(this.builtInEnv).asGlobal(),
|
|
33
32
|
level: 0
|
|
34
33
|
};
|
|
35
34
|
}
|
|
@@ -41,7 +40,7 @@ class FlowrAnalyzerEnvironmentContext {
|
|
|
41
40
|
}
|
|
42
41
|
makeCleanEnvWithEmptyBuiltIns() {
|
|
43
42
|
return {
|
|
44
|
-
current: new environment_1.Environment(this.emptyBuiltInEnv),
|
|
43
|
+
current: new environment_1.Environment(this.emptyBuiltInEnv).asGlobal(),
|
|
45
44
|
level: 0
|
|
46
45
|
};
|
|
47
46
|
}
|
|
@@ -25,6 +25,7 @@ export type RoleBasedFiles = {
|
|
|
25
25
|
[FileRole.Vignette]: FlowrFileProvider[];
|
|
26
26
|
[FileRole.Test]: FlowrFileProvider[];
|
|
27
27
|
[FileRole.License]: FlowrFileProvider[];
|
|
28
|
+
[FileRole.VirtualEnv]: FlowrFileProvider[];
|
|
28
29
|
[FileRole.Source]: FlowrFileProvider[];
|
|
29
30
|
[FileRole.Data]: FlowrFileProvider[];
|
|
30
31
|
[FileRole.Other]: FlowrFileProvider[];
|
|
@@ -25,6 +25,8 @@ export declare enum FileRole {
|
|
|
25
25
|
Data = "data",
|
|
26
26
|
/** Signals separate license files, but please note, that DESCRIPTION files may contain license info too */
|
|
27
27
|
License = "license",
|
|
28
|
+
/** Files describing a project's virtual/pinned package environment, e.g., `renv.lock` or `rv.lock`. */
|
|
29
|
+
VirtualEnv = "virtual-env",
|
|
28
30
|
/**
|
|
29
31
|
* Catch-all for any file that provides usable R source code to incorporate into the analysis.
|
|
30
32
|
* Please note, that the loading order/inclusion and even potential relevance of these source files
|
|
@@ -26,6 +26,8 @@ var FileRole;
|
|
|
26
26
|
FileRole["Data"] = "data";
|
|
27
27
|
/** Signals separate license files, but please note, that DESCRIPTION files may contain license info too */
|
|
28
28
|
FileRole["License"] = "license";
|
|
29
|
+
/** Files describing a project's virtual/pinned package environment, e.g., `renv.lock` or `rv.lock`. */
|
|
30
|
+
FileRole["VirtualEnv"] = "virtual-env";
|
|
29
31
|
/**
|
|
30
32
|
* Catch-all for any file that provides usable R source code to incorporate into the analysis.
|
|
31
33
|
* Please note, that the loading order/inclusion and even potential relevance of these source files
|
|
@@ -159,6 +159,9 @@ class FlowrAnalyzerBuilder {
|
|
|
159
159
|
buildSync() {
|
|
160
160
|
(0, assert_1.guard)(this.parser !== undefined, 'No parser set, please use the setParser or setEngine method to set a parser before building the analyzer');
|
|
161
161
|
const context = new flowr_analyzer_context_1.FlowrAnalyzerContext(this.flowrConfig, this.plugins);
|
|
162
|
+
if (this.flowrConfig.solver.pkgdb.enabled && this.flowrConfig.solver.pkgdb.eagerlyLoad) {
|
|
163
|
+
context.deps.eagerlyLoadPackageDatabases();
|
|
164
|
+
}
|
|
162
165
|
const cache = flowr_analyzer_cache_1.FlowrAnalyzerCache.create({
|
|
163
166
|
parser: this.parser,
|
|
164
167
|
context,
|
|
@@ -197,7 +197,8 @@ export declare class FlowrAnalyzer<Parser extends KnownParser = KnownParser> imp
|
|
|
197
197
|
query<Types extends SupportedQueryTypes = SupportedQueryTypes>(query: Queries<Types>): Promise<QueryResults<Types>>;
|
|
198
198
|
runSearch<Search extends FlowrSearchLike>(search: Search): Promise<GetSearchElements<SearchOutput<Search>>>;
|
|
199
199
|
/**
|
|
200
|
-
*
|
|
200
|
+
* Free the cached analyses (including any WASM-backed parse trees) and close the parser.
|
|
201
|
+
* Closing is only required for an RShell/remote engine, but this also frees the cached parse trees.
|
|
201
202
|
*/
|
|
202
203
|
close(): boolean | void;
|
|
203
204
|
}
|
|
@@ -146,9 +146,11 @@ class FlowrAnalyzer {
|
|
|
146
146
|
return (0, flowr_search_executor_1.runSearch)(search, this);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* Free the cached analyses (including any WASM-backed parse trees) and close the parser.
|
|
150
|
+
* Closing is only required for an RShell/remote engine, but this also frees the cached parse trees.
|
|
150
151
|
*/
|
|
151
152
|
close() {
|
|
153
|
+
this.cache.reset();
|
|
152
154
|
return this.parser?.close();
|
|
153
155
|
}
|
|
154
156
|
}
|
|
@@ -10,10 +10,8 @@ export interface NamespaceInfo {
|
|
|
10
10
|
exportedPatterns: string[];
|
|
11
11
|
importedPackages: Map<string, string[] | 'all'>;
|
|
12
12
|
loadsWithSideEffects: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* about which parts are only active with given conditions!
|
|
16
|
-
*/
|
|
13
|
+
callable: string[];
|
|
14
|
+
/** Present only in complex parsed NAMESPACE files. Maps conditions to the parts they gate. */
|
|
17
15
|
conditional?: Map<RNode<ParentInformation>, NamespaceInfo>;
|
|
18
16
|
}
|
|
19
17
|
export interface NamespaceFormat {
|
|
@@ -21,20 +19,15 @@ export interface NamespaceFormat {
|
|
|
21
19
|
[packageName: string]: NamespaceInfo;
|
|
22
20
|
}
|
|
23
21
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Decorates a text file to expose its content as a {@link NamespaceFormat}.
|
|
23
|
+
* Simple parsing is quicker but does not support `if`/other R constructs.
|
|
26
24
|
*/
|
|
27
25
|
export declare class FlowrNamespaceFile extends FlowrFile<NamespaceFormat> {
|
|
28
26
|
private readonly wrapped;
|
|
29
27
|
private readonly ctx;
|
|
30
|
-
/**
|
|
31
|
-
* Prefer the static {@link FlowrNamespaceFile.from} method to create instances of this class as it will not re-create if already a namespace file
|
|
32
|
-
* and handle role assignments.
|
|
33
|
-
*/
|
|
28
|
+
/** Prefer {@link FlowrNamespaceFile.from}, which avoids re-wrapping and handles roles. */
|
|
34
29
|
constructor(file: FlowrFileProvider, ctx?: FlowrAnalyzerContext);
|
|
35
|
-
/**
|
|
36
|
-
* Creates a {@link FlowrNamespaceFile} from a given {@link NamespaceFormat}, path and optional roles. This is useful if you already have the namespace content parsed and want to create a namespace file instance without re-parsing.
|
|
37
|
-
*/
|
|
30
|
+
/** Creates a {@link FlowrNamespaceFile} from an already-parsed {@link NamespaceFormat}. */
|
|
38
31
|
static fromNamespaceFormat(fmt: NamespaceFormat, path: string, roles?: FileRole[]): FlowrNamespaceFile;
|
|
39
32
|
/**
|
|
40
33
|
* Loads and parses the content of the wrapped file in the {@link NamespaceFormat}.
|
|
@@ -50,8 +43,7 @@ export declare class FlowrNamespaceFile extends FlowrFile<NamespaceFormat> {
|
|
|
50
43
|
*/
|
|
51
44
|
isExported(name: string, pkg?: string): boolean | RNode<ParentInformation>[];
|
|
52
45
|
/**
|
|
53
|
-
*
|
|
54
|
-
* and handles role assignments.
|
|
46
|
+
* Lifts a file to a {@link FlowrNamespaceFile}, reusing it if already one and assigning roles.
|
|
55
47
|
* @param file - The file to lift or return if already a namespace file
|
|
56
48
|
* @param ctx - An optional analyzer context to use for complex parsing
|
|
57
49
|
* @param role - An optional role to assign to the file
|
|
@@ -73,3 +65,9 @@ export declare function isExportedInNamespaceFormat(this: void, fmt: NamespaceFo
|
|
|
73
65
|
* @param nsInfo - The namespace info to check in
|
|
74
66
|
*/
|
|
75
67
|
export declare function isExportedInInfo(this: void, name: string, nsInfo: NamespaceInfo): boolean | RNode<ParentInformation>[];
|
|
68
|
+
/** All exported names of a namespace that can be referenced (functions, symbols, patterns and S3 methods as `generic.class`). */
|
|
69
|
+
export declare function getExportedNames(info: NamespaceInfo): string[];
|
|
70
|
+
/** The names a package makes callable: the explicitly configured {@link NamespaceInfo#callable} subset, or all exports (see {@link getExportedNames}) by default. */
|
|
71
|
+
export declare function getCallables(info: NamespaceInfo): string[];
|
|
72
|
+
/** Sets the given list of strings as callable functions */
|
|
73
|
+
export declare function setCallable(info: NamespaceInfo, func: string[]): NamespaceInfo;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FlowrNamespaceFile = void 0;
|
|
4
4
|
exports.isExportedInNamespaceFormat = isExportedInNamespaceFormat;
|
|
5
5
|
exports.isExportedInInfo = isExportedInInfo;
|
|
6
|
+
exports.getExportedNames = getExportedNames;
|
|
7
|
+
exports.getCallables = getCallables;
|
|
8
|
+
exports.setCallable = setCallable;
|
|
6
9
|
const flowr_file_1 = require("../../../context/flowr-file");
|
|
7
10
|
const resolve_args_1 = require("../../../../abstract-interpretation/data-frame/resolve-args");
|
|
8
11
|
const retriever_1 = require("../../../../r-bridge/retriever");
|
|
@@ -15,24 +18,19 @@ const make_argument_1 = require("../../../../dataflow/internal/process/functions
|
|
|
15
18
|
const range_1 = require("../../../../util/range");
|
|
16
19
|
const r_regex_1 = require("../../../../util/r-regex");
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
21
|
+
* Decorates a text file to expose its content as a {@link NamespaceFormat}.
|
|
22
|
+
* Simple parsing is quicker but does not support `if`/other R constructs.
|
|
20
23
|
*/
|
|
21
24
|
class FlowrNamespaceFile extends flowr_file_1.FlowrFile {
|
|
22
25
|
wrapped;
|
|
23
26
|
ctx;
|
|
24
|
-
/**
|
|
25
|
-
* Prefer the static {@link FlowrNamespaceFile.from} method to create instances of this class as it will not re-create if already a namespace file
|
|
26
|
-
* and handle role assignments.
|
|
27
|
-
*/
|
|
27
|
+
/** Prefer {@link FlowrNamespaceFile.from}, which avoids re-wrapping and handles roles. */
|
|
28
28
|
constructor(file, ctx) {
|
|
29
29
|
super(file.path(), file.roles);
|
|
30
30
|
this.wrapped = file;
|
|
31
31
|
this.ctx = ctx;
|
|
32
32
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Creates a {@link FlowrNamespaceFile} from a given {@link NamespaceFormat}, path and optional roles. This is useful if you already have the namespace content parsed and want to create a namespace file instance without re-parsing.
|
|
35
|
-
*/
|
|
33
|
+
/** Creates a {@link FlowrNamespaceFile} from an already-parsed {@link NamespaceFormat}. */
|
|
36
34
|
static fromNamespaceFormat(fmt, path, roles) {
|
|
37
35
|
const file = new FlowrNamespaceFile(new flowr_file_1.FlowrTextFile(path, roles));
|
|
38
36
|
file.setContent(fmt);
|
|
@@ -57,8 +55,7 @@ class FlowrNamespaceFile extends flowr_file_1.FlowrFile {
|
|
|
57
55
|
return isExportedInNamespaceFormat(fmt, name, pkg);
|
|
58
56
|
}
|
|
59
57
|
/**
|
|
60
|
-
*
|
|
61
|
-
* and handles role assignments.
|
|
58
|
+
* Lifts a file to a {@link FlowrNamespaceFile}, reusing it if already one and assigning roles.
|
|
62
59
|
* @param file - The file to lift or return if already a namespace file
|
|
63
60
|
* @param ctx - An optional analyzer context to use for complex parsing
|
|
64
61
|
* @param role - An optional role to assign to the file
|
|
@@ -99,7 +96,6 @@ function isExportedInInfo(name, nsInfo) {
|
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
|
-
// pattern
|
|
103
99
|
for (const pattern of nsInfo.exportedPatterns) {
|
|
104
100
|
const regex = (0, r_regex_1.parseRRegexPattern)(pattern);
|
|
105
101
|
if (regex.test(name)) {
|
|
@@ -107,7 +103,6 @@ function isExportedInInfo(name, nsInfo) {
|
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
105
|
if (nsInfo.conditional) {
|
|
110
|
-
// nested with recursion
|
|
111
106
|
for (const [cond, info] of nsInfo.conditional) {
|
|
112
107
|
const res = isExportedInInfo(name, info);
|
|
113
108
|
if (res === true) {
|
|
@@ -196,6 +191,30 @@ function parseNamespaceComplex(file, ctx) {
|
|
|
196
191
|
}
|
|
197
192
|
});
|
|
198
193
|
}
|
|
194
|
+
/** All exported names of a namespace that can be referenced (functions, symbols, patterns and S3 methods as `generic.class`). */
|
|
195
|
+
function getExportedNames(info) {
|
|
196
|
+
const s3 = [];
|
|
197
|
+
for (const [g, methods] of info.exportS3Generics) {
|
|
198
|
+
for (const m of methods) {
|
|
199
|
+
s3.push(`${g}.${m}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return [...new Set([...info.exportedSymbols, ...info.exportedFunctions, ...info.exportedPatterns, ...s3])];
|
|
203
|
+
}
|
|
204
|
+
/** The names a package makes callable: the explicitly configured {@link NamespaceInfo#callable} subset, or all exports (see {@link getExportedNames}) by default. */
|
|
205
|
+
function getCallables(info) {
|
|
206
|
+
return info.callable.length > 0 ? info.callable : getExportedNames(info);
|
|
207
|
+
}
|
|
208
|
+
/** Sets the given list of strings as callable functions */
|
|
209
|
+
function setCallable(info, func) {
|
|
210
|
+
const all = new Set(getExportedNames(info));
|
|
211
|
+
for (const f of func) {
|
|
212
|
+
if (all.has(f)) {
|
|
213
|
+
info.callable.push(f);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return info;
|
|
217
|
+
}
|
|
199
218
|
function handleConditionCall(idMap, cond, thenBranch, elseBranch) {
|
|
200
219
|
const g = getEmptyNamespaceFormat();
|
|
201
220
|
const condMap = g.current.conditional ?? new Map();
|
|
@@ -302,6 +321,7 @@ function handleUseDynLibCall(g, args) {
|
|
|
302
321
|
exportS3Generics: new Map(),
|
|
303
322
|
exportedPatterns: [],
|
|
304
323
|
importedPackages: new Map(),
|
|
324
|
+
callable: [],
|
|
305
325
|
loadsWithSideEffects: false,
|
|
306
326
|
};
|
|
307
327
|
}
|
|
@@ -325,6 +345,7 @@ function getEmptyNamespaceFormat() {
|
|
|
325
345
|
exportS3Generics: new Map(),
|
|
326
346
|
exportedPatterns: [],
|
|
327
347
|
importedPackages: new Map(),
|
|
348
|
+
callable: [],
|
|
328
349
|
loadsWithSideEffects: false,
|
|
329
350
|
},
|
|
330
351
|
};
|
|
@@ -388,6 +409,7 @@ function mergeNamespaceInfo(target, source) {
|
|
|
388
409
|
}
|
|
389
410
|
}
|
|
390
411
|
return {
|
|
412
|
+
callable: [...target.callable, ...source.callable],
|
|
391
413
|
exportedSymbols: [...target.exportedSymbols, ...source.exportedSymbols],
|
|
392
414
|
exportedFunctions: [...target.exportedFunctions, ...source.exportedFunctions],
|
|
393
415
|
exportS3Generics: mergedS3Generics,
|
|
@@ -447,6 +469,7 @@ function parseNamespaceSimple(file) {
|
|
|
447
469
|
exportS3Generics: new Map(),
|
|
448
470
|
exportedPatterns: [],
|
|
449
471
|
importedPackages: new Map(),
|
|
472
|
+
callable: [],
|
|
450
473
|
loadsWithSideEffects: false,
|
|
451
474
|
};
|
|
452
475
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import type { PathLike } from 'fs';
|
|
4
|
+
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
5
|
+
import type { FlowrFileProvider } from '../../context/flowr-file';
|
|
6
|
+
/**
|
|
7
|
+
* Tags a project's virtual-environment lockfiles (e.g. `renv.lock`, `rv.lock`) with the
|
|
8
|
+
* {@link FileRole.VirtualEnv} role, so the version plugins that read them (renv/rv) can look them up
|
|
9
|
+
* by role instead of scanning every project file.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FlowrAnalyzerVirtualEnvFilePlugin extends FlowrAnalyzerFilePlugin {
|
|
12
|
+
readonly name = "flowr-analyzer-virtualenv-files-plugin";
|
|
13
|
+
readonly description = "This plugin marks virtual-environment lockfiles (renv.lock, rv.lock).";
|
|
14
|
+
readonly version: SemVer;
|
|
15
|
+
private readonly pathPattern;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of the virtual-environment file plugin.
|
|
18
|
+
* @param pathPattern - The pattern to identify lockfiles, see {@link VirtualEnvFilePattern} for the default.
|
|
19
|
+
*/
|
|
20
|
+
constructor(pathPattern?: RegExp);
|
|
21
|
+
applies(file: PathLike): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Processes the given file, assigning it the {@link FileRole.VirtualEnv} role. The file may still be
|
|
24
|
+
* relevant to other plugins, so this returns the `true` flag to keep the loader chain going.
|
|
25
|
+
*/
|
|
26
|
+
process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): [FlowrFileProvider, true];
|
|
27
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrAnalyzerVirtualEnvFilePlugin = void 0;
|
|
4
|
+
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
const flowr_file_1 = require("../../context/flowr-file");
|
|
7
|
+
const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
8
|
+
/** Lockfiles pinning a project's package environment (`renv.lock`, `rv.lock`). */
|
|
9
|
+
const VirtualEnvFilePattern = /^(renv|rv)\.lock$/i;
|
|
10
|
+
/**
|
|
11
|
+
* Tags a project's virtual-environment lockfiles (e.g. `renv.lock`, `rv.lock`) with the
|
|
12
|
+
* {@link FileRole.VirtualEnv} role, so the version plugins that read them (renv/rv) can look them up
|
|
13
|
+
* by role instead of scanning every project file.
|
|
14
|
+
*/
|
|
15
|
+
class FlowrAnalyzerVirtualEnvFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
|
|
16
|
+
name = 'flowr-analyzer-virtualenv-files-plugin';
|
|
17
|
+
description = 'This plugin marks virtual-environment lockfiles (renv.lock, rv.lock).';
|
|
18
|
+
version = new semver_1.SemVer('0.1.0');
|
|
19
|
+
pathPattern;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new instance of the virtual-environment file plugin.
|
|
22
|
+
* @param pathPattern - The pattern to identify lockfiles, see {@link VirtualEnvFilePattern} for the default.
|
|
23
|
+
*/
|
|
24
|
+
constructor(pathPattern = VirtualEnvFilePattern) {
|
|
25
|
+
super();
|
|
26
|
+
this.pathPattern = pathPattern;
|
|
27
|
+
}
|
|
28
|
+
applies(file) {
|
|
29
|
+
return this.pathPattern.test((0, built_in_source_1.platformBasename)(file.toString()));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Processes the given file, assigning it the {@link FileRole.VirtualEnv} role. The file may still be
|
|
33
|
+
* relevant to other plugins, so this returns the `true` flag to keep the loader chain going.
|
|
34
|
+
*/
|
|
35
|
+
process(_ctx, file) {
|
|
36
|
+
file.assignRole(flowr_file_1.FileRole.VirtualEnv);
|
|
37
|
+
return [file, true];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.FlowrAnalyzerVirtualEnvFilePlugin = FlowrAnalyzerVirtualEnvFilePlugin;
|
|
41
|
+
//# sourceMappingURL=flowr-analyzer-virtualenv-file-plugin.js.map
|
package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FlowrAnalyzerPackageVersionsPlugin } from './flowr-analyzer-package-versions-plugin';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
4
|
+
export declare const lockfileLog: import("tslog").Logger<import("tslog").ILogObj>;
|
|
5
|
+
/** Reads package versions from an `renv.lock` (JSON). renv pins are exact. */
|
|
6
|
+
export declare class FlowrAnalyzerPackageVersionsRenvPlugin extends FlowrAnalyzerPackageVersionsPlugin {
|
|
7
|
+
readonly name = "flowr-analyzer-package-versions-renv-plugin";
|
|
8
|
+
readonly description = "Extracts package versions from an renv.lock lockfile.";
|
|
9
|
+
readonly version: SemVer;
|
|
10
|
+
process(ctx: FlowrAnalyzerContext): void;
|
|
11
|
+
}
|
|
12
|
+
/** Reads package versions from an `rv.lock` (the resolved rv project lockfile, TOML). */
|
|
13
|
+
export declare class FlowrAnalyzerPackageVersionsRvPlugin extends FlowrAnalyzerPackageVersionsPlugin {
|
|
14
|
+
readonly name = "flowr-analyzer-package-versions-rv-plugin";
|
|
15
|
+
readonly description = "Extracts package versions from an rv.lock lockfile.";
|
|
16
|
+
readonly version: SemVer;
|
|
17
|
+
process(ctx: FlowrAnalyzerContext): void;
|
|
18
|
+
}
|
package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrAnalyzerPackageVersionsRvPlugin = exports.FlowrAnalyzerPackageVersionsRenvPlugin = exports.lockfileLog = void 0;
|
|
4
|
+
const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-package-versions-plugin");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
const package_1 = require("./package");
|
|
7
|
+
const flowr_file_1 = require("../../context/flowr-file");
|
|
8
|
+
const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
9
|
+
const log_1 = require("../../../util/log");
|
|
10
|
+
exports.lockfileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-package-versions-lockfile-plugin' });
|
|
11
|
+
/** The {@link FileRole.VirtualEnv} lockfiles named `name` (e.g. `renv.lock`), collected by role like the DESCRIPTION reader. */
|
|
12
|
+
function virtualEnvFiles(ctx, name) {
|
|
13
|
+
return ctx.files.getFilesByRole(flowr_file_1.FileRole.VirtualEnv).filter(f => (0, built_in_source_1.platformBasename)(f.path()) === name);
|
|
14
|
+
}
|
|
15
|
+
function pin(ctx, name, version) {
|
|
16
|
+
const range = package_1.Package.parsePackageVersionRange(undefined, version);
|
|
17
|
+
ctx.deps.addDependency(new package_1.Package({ name, versionConstraints: range ? [range] : undefined }));
|
|
18
|
+
}
|
|
19
|
+
/** Reads package versions from an `renv.lock` (JSON). renv pins are exact. */
|
|
20
|
+
class FlowrAnalyzerPackageVersionsRenvPlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
|
|
21
|
+
name = 'flowr-analyzer-package-versions-renv-plugin';
|
|
22
|
+
description = 'Extracts package versions from an renv.lock lockfile.';
|
|
23
|
+
version = new semver_1.SemVer('0.1.0');
|
|
24
|
+
process(ctx) {
|
|
25
|
+
for (const file of virtualEnvFiles(ctx, 'renv.lock')) {
|
|
26
|
+
let lock;
|
|
27
|
+
try {
|
|
28
|
+
lock = JSON.parse(file.content().toString());
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
exports.lockfileLog.warn(`Could not parse renv.lock: ${e.message}`);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
for (const [pkg, meta] of Object.entries(lock.Packages ?? {})) {
|
|
35
|
+
if (typeof meta?.Version === 'string') {
|
|
36
|
+
pin(ctx, pkg, meta.Version);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.FlowrAnalyzerPackageVersionsRenvPlugin = FlowrAnalyzerPackageVersionsRenvPlugin;
|
|
43
|
+
/** Reads package versions from an `rv.lock` (the resolved rv project lockfile, TOML). */
|
|
44
|
+
class FlowrAnalyzerPackageVersionsRvPlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
|
|
45
|
+
name = 'flowr-analyzer-package-versions-rv-plugin';
|
|
46
|
+
description = 'Extracts package versions from an rv.lock lockfile.';
|
|
47
|
+
version = new semver_1.SemVer('0.1.0');
|
|
48
|
+
process(ctx) {
|
|
49
|
+
for (const file of virtualEnvFiles(ctx, 'rv.lock')) {
|
|
50
|
+
// rv.lock is TOML with repeated `[[packages]]` tables carrying `name`/`version`
|
|
51
|
+
for (const block of file.content().toString().split(/\[\[packages\]\]/).slice(1)) {
|
|
52
|
+
const name = /^\s*name\s*=\s*"([^"]+)"/m.exec(block)?.[1];
|
|
53
|
+
const version = /^\s*version\s*=\s*"([^"]+)"/m.exec(block)?.[1];
|
|
54
|
+
if (name && version) {
|
|
55
|
+
pin(ctx, name, version);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.FlowrAnalyzerPackageVersionsRvPlugin = FlowrAnalyzerPackageVersionsRvPlugin;
|
|
62
|
+
//# sourceMappingURL=flowr-analyzer-package-versions-lockfile-plugin.js.map
|
package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
}
|