@eagleoutice/flowr 2.13.3 → 2.13.5
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 +32 -32
- package/abstract-interpretation/absint-visitor.js +2 -2
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +1 -1
- package/abstract-interpretation/unsupported-functions.js +1 -1
- package/cli/repl/core.js +10 -2
- package/config.d.ts +4 -1
- package/config.js +10 -1
- package/control-flow/cfg-dead-code.js +91 -15
- package/control-flow/extract-cfg.js +93 -8
- package/control-flow/semantic-cfg-guided-visitor.js +2 -0
- package/dataflow/environments/built-in-config.d.ts +6 -3
- package/dataflow/environments/built-in-eval-name.d.ts +20 -0
- package/dataflow/environments/built-in-eval-name.js +25 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in-props.d.ts +175 -0
- package/dataflow/environments/built-in-props.js +207 -0
- package/dataflow/environments/built-in.d.ts +28 -20
- package/dataflow/environments/built-in.js +39 -8
- package/dataflow/environments/default-builtin-config.d.ts +1094 -86
- package/dataflow/environments/default-builtin-config.js +496 -212
- package/dataflow/environments/identifier.d.ts +25 -1
- package/dataflow/environments/identifier.js +24 -2
- package/dataflow/environments/query-fn-props.d.ts +102 -0
- package/dataflow/environments/query-fn-props.js +188 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +2 -0
- package/dataflow/eval/resolve/alias-tracking.js +12 -2
- package/dataflow/eval/resolve/match-arguments.d.ts +15 -0
- package/dataflow/eval/resolve/match-arguments.js +77 -0
- package/dataflow/eval/resolve/resolve-numbers.d.ts +202 -0
- package/dataflow/eval/resolve/resolve-numbers.js +163 -0
- package/dataflow/eval/resolve/resolve-operators.d.ts +60 -0
- package/dataflow/eval/resolve/resolve-operators.js +115 -0
- package/dataflow/eval/resolve/resolve-strings.d.ts +98 -0
- package/dataflow/eval/resolve/resolve-strings.js +116 -0
- package/dataflow/eval/resolve/resolve.d.ts +5 -23
- package/dataflow/eval/resolve/resolve.js +56 -87
- package/dataflow/fn/higher-order-function.js +3 -3
- package/dataflow/fn/recursive-function.js +1 -1
- package/dataflow/graph/df-helper.js +1 -1
- package/dataflow/graph/vertex.d.ts +32 -25
- package/dataflow/graph/vertex.js +40 -36
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +14 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +28 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +41 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +14 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +45 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +62 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +63 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +29 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +35 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +46 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +3 -1
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +24 -0
- package/dataflow/internal/process/functions/process-parameter.js +2 -1
- package/documentation/data/faq/faqs.js +11 -0
- package/documentation/doc-util/doc-types.js +1 -1
- package/documentation/wiki-analyzer.js +75 -0
- package/documentation/wiki-core.js +65 -16
- package/documentation/wiki-interface.js +3 -0
- package/linter/linter-rules.d.ts +10 -11
- package/linter/rules/absolute-path.js +1 -1
- package/linter/rules/deprecated-functions.js +5 -3
- package/linter/rules/function-finder-util.d.ts +2 -2
- package/linter/rules/function-finder-util.js +11 -4
- package/linter/rules/network-functions.d.ts +25 -5
- package/linter/rules/network-functions.js +51 -11
- package/linter/rules/no-leaked-credentials.js +1 -1
- package/linter/rules/problematic-inputs.d.ts +1 -1
- package/linter/rules/problematic-inputs.js +7 -1
- package/linter/rules/seeded-randomness.d.ts +5 -8
- package/linter/rules/seeded-randomness.js +17 -9
- package/linter/rules/undefined-symbol.js +1 -1
- package/linter/rules/unused-definition.js +15 -10
- package/linter/rules/useless-loop.js +1 -1
- package/package.json +3 -2
- package/project/cache/flowr-analyzer-cache.d.ts +4 -3
- package/project/cache/flowr-analyzer-cache.js +32 -13
- package/project/cache/flowr-cache.d.ts +39 -12
- package/project/cache/flowr-cache.js +5 -3
- package/project/context/flowr-analyzer-context.d.ts +8 -1
- package/project/context/flowr-analyzer-context.js +11 -1
- package/project/context/flowr-analyzer-dependencies-context.d.ts +4 -2
- package/project/context/flowr-analyzer-dependencies-context.js +15 -1
- package/project/context/flowr-analyzer-files-context.d.ts +8 -4
- package/project/context/flowr-analyzer-files-context.js +20 -1
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +33 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.js +63 -0
- package/project/context/flowr-analyzer-meta-context.d.ts +3 -1
- package/project/context/flowr-analyzer-meta-context.js +14 -0
- package/project/context/flowr-file.d.ts +25 -3
- package/project/context/flowr-file.js +24 -2
- package/project/dependency-version-space.d.ts +37 -0
- package/project/dependency-version-space.js +118 -26
- package/project/flowr-analyzer.d.ts +6 -0
- package/project/flowr-analyzer.js +6 -2
- package/project/incremental/incremental-parse/edit-computation.d.ts +7 -0
- package/project/incremental/incremental-parse/edit-computation.js +61 -0
- package/project/incremental/incremental-parse/incremental-parse.d.ts +12 -0
- package/project/incremental/incremental-parse/incremental-parse.js +37 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +1 -1
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +57 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +121 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -2
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +33 -0
- package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +53 -0
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -3
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.d.ts +27 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.js +47 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +7 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +31 -3
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +10 -4
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +17 -4
- package/project/plugins/plugin-registry.d.ts +4 -4
- package/project/plugins/plugin-registry.js +7 -4
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +4 -4
- package/project/sigdb/reader.d.ts +7 -0
- package/project/sigdb/reader.js +12 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -1
- package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +10 -0
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +41 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +14 -13
- package/queries/catalog/dependencies-query/function-info/write-functions.js +28 -36
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +33 -3
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +31 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +9 -2
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +9 -10
- package/queries/catalog/input-sources-query/input-source-functions.js +23 -394
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +11 -6
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +28 -10
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +14 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.js +24 -0
- package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -1
- package/queries/catalog/signature-query/signature-query-executor.js +79 -3
- package/queries/catalog/signature-query/signature-query-format.d.ts +27 -0
- package/queries/catalog/signature-query/signature-query-render.js +21 -3
- 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.d.ts +6 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +21 -2
- package/r-bridge/parser.d.ts +11 -1
- package/r-bridge/parser.js +7 -4
- package/r-bridge/shell-executor.d.ts +1 -0
- package/r-bridge/shell-executor.js +1 -0
- package/r-bridge/shell.d.ts +1 -0
- package/r-bridge/shell.js +1 -0
- package/reconstruct/inline/source-inline-map.js +1 -1
- package/search/flowr-search-filters.d.ts +1 -6
- package/search/flowr-search-filters.js +1 -8
- package/search/search-executor/search-enrichers.d.ts +2 -0
- package/search/search-executor/search-enrichers.js +29 -12
- package/util/mermaid/dfg.js +1 -1
- package/util/version.js +1 -1
- package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +0 -31
- package/project/plugins/file-plugins/files/flowr-rproject-file.js +0 -66
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +0 -22
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +0 -36
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +0 -13
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +0 -32
|
@@ -39,6 +39,8 @@ export interface PackageSignatureSource {
|
|
|
39
39
|
packageNames(): string[];
|
|
40
40
|
/** whether the package is an R-core / base package (its versions are the R releases it shipped with) */
|
|
41
41
|
isBaseR(pkg: string): boolean;
|
|
42
|
+
/** how often the package was downloaded when the database was built, the popularity {@link SigDbPkgMeta} records */
|
|
43
|
+
downloads(pkg: string): number;
|
|
42
44
|
/** for a base package, the R versions it was part of core (ascending); `undefined` otherwise */
|
|
43
45
|
coreVersions(pkg: string): RVersion[] | undefined;
|
|
44
46
|
/** the release date of a package version (defaulting to the newest release), or `undefined` if unknown */
|
|
@@ -99,6 +101,7 @@ export declare class MergedSignatureSource implements PackageSignatureSource {
|
|
|
99
101
|
dependencies(pkg: string, version?: string): ResolvedDependency[] | undefined;
|
|
100
102
|
packageNames(): string[];
|
|
101
103
|
isBaseR(pkg: string): boolean;
|
|
104
|
+
downloads(pkg: string): number;
|
|
102
105
|
coreVersions(pkg: string): RVersion[] | undefined;
|
|
103
106
|
releaseDate(pkg: string, version?: string): Date | undefined;
|
|
104
107
|
releaseDates(pkg: string): VersionRelease[];
|
|
@@ -181,6 +184,8 @@ export declare class SigDatabase implements PackageSignatureSource {
|
|
|
181
184
|
dependencies(pkg: string, version?: string): ResolvedDependency[] | undefined;
|
|
182
185
|
/** whether this is an R-core / base package (its versions are the R releases it shipped with; see {@link SigDbPkgMeta}) */
|
|
183
186
|
isBaseR(pkg: string): boolean;
|
|
187
|
+
/** the download count recorded for the package, `0` when this source does not carry it */
|
|
188
|
+
downloads(pkg: string): number;
|
|
184
189
|
/**
|
|
185
190
|
* The R versions a base package was part of core, in ascending R-version order (exactly its stored
|
|
186
191
|
* versions). `undefined` for a non-base package. E.g. `mva` returns `…1.9.1`, `parallel` `2.14.0…`.
|
|
@@ -278,6 +283,8 @@ export declare class SigDatabaseSet implements PackageSignatureSource {
|
|
|
278
283
|
dependencies(pkg: string, version?: string): ResolvedDependency[] | undefined;
|
|
279
284
|
/** whether this is an R-core / base package (see {@link SigDatabase.isBaseR}); O(1) via the hoisted metadata */
|
|
280
285
|
isBaseR(pkg: string): boolean;
|
|
286
|
+
/** the download count of the package; O(1) via the hoisted metadata, so no shard has to be unpacked for it */
|
|
287
|
+
downloads(pkg: string): number;
|
|
281
288
|
/** the R versions a base package was part of core (ascending); `undefined` if not a base package */
|
|
282
289
|
coreVersions(pkg: string): RVersion[] | undefined;
|
|
283
290
|
/** every known release of a package (version + date), ascending, read once from the most complete shard */
|
package/project/sigdb/reader.js
CHANGED
|
@@ -210,6 +210,9 @@ class MergedSignatureSource {
|
|
|
210
210
|
isBaseR(pkg) {
|
|
211
211
|
return this.sources.some(s => s.has(pkg) && s.isBaseR(pkg));
|
|
212
212
|
}
|
|
213
|
+
downloads(pkg) {
|
|
214
|
+
return Math.max(0, ...this.sources.map(s => s.downloads(pkg)));
|
|
215
|
+
}
|
|
213
216
|
coreVersions(pkg) {
|
|
214
217
|
return this.sources.find(s => s.has(pkg))?.coreVersions(pkg);
|
|
215
218
|
}
|
|
@@ -442,6 +445,10 @@ class SigDatabase {
|
|
|
442
445
|
isBaseR(pkg) {
|
|
443
446
|
return this.index.meta[pkg]?.[3] === 1;
|
|
444
447
|
}
|
|
448
|
+
/** the download count recorded for the package, `0` when this source does not carry it */
|
|
449
|
+
downloads(pkg) {
|
|
450
|
+
return this.index.meta[pkg]?.[2] ?? 0;
|
|
451
|
+
}
|
|
445
452
|
/**
|
|
446
453
|
* The R versions a base package was part of core, in ascending R-version order (exactly its stored
|
|
447
454
|
* versions). `undefined` for a non-base package. E.g. `mva` returns `…1.9.1`, `parallel` `2.14.0…`.
|
|
@@ -757,6 +764,11 @@ class SigDatabaseSet {
|
|
|
757
764
|
}
|
|
758
765
|
return this.route(pkg).some(i => this.shard(i).isBaseR(pkg));
|
|
759
766
|
}
|
|
767
|
+
/** the download count of the package; O(1) via the hoisted metadata, so no shard has to be unpacked for it */
|
|
768
|
+
downloads(pkg) {
|
|
769
|
+
const meta = this.manifest.meta?.[pkg];
|
|
770
|
+
return meta ? meta[2] : Math.max(0, ...this.route(pkg).map(i => this.shard(i).downloads(pkg)));
|
|
771
|
+
}
|
|
760
772
|
/** the R versions a base package was part of core (ascending); `undefined` if not a base package */
|
|
761
773
|
coreVersions(pkg) {
|
|
762
774
|
if (!this.isBaseR(pkg)) {
|
|
@@ -147,7 +147,7 @@ function identifyLinkToLastCallRelationSync(from, cfg, graph, { callName, cascad
|
|
|
147
147
|
(node) => knownCalls.get(node) :
|
|
148
148
|
(node) => {
|
|
149
149
|
const v = graph.getVertex(node);
|
|
150
|
-
return
|
|
150
|
+
return vertex_1.FunctionCallVertex.is(v) ? v : undefined;
|
|
151
151
|
};
|
|
152
152
|
(0, simple_visitor_1.visitCfgInReverseOrder)(cfg, [from], node => {
|
|
153
153
|
/* we ignore the start id as it cannot be the last call */
|
|
@@ -21,7 +21,7 @@ async function identifyLinkToNestedRelation(from, analyzer, { callName, ignoreIf
|
|
|
21
21
|
const cg = await analyzer.callGraph();
|
|
22
22
|
const subCg = call_graph_1.CallGraph.computeSubCallGraph(cg, new Set([from]));
|
|
23
23
|
for (const [, t] of subCg.vertices(true)) {
|
|
24
|
-
if (!
|
|
24
|
+
if (!vertex_1.FunctionCallVertex.is(t)) {
|
|
25
25
|
continue;
|
|
26
26
|
}
|
|
27
27
|
if (test(identifier_1.Identifier.toString(t.name))) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FunctionInfo } from './function-info';
|
|
2
|
+
import type { CallProps } from '../../../../dataflow/environments/built-in-props';
|
|
3
|
+
/**
|
|
4
|
+
* The built-ins that carry all of `props` and name the resource they act on, as entries of a dependency
|
|
5
|
+
* category. This is what the {@link DefaultBuiltinConfig} already states, so only the functions it does not
|
|
6
|
+
* know (most package functions) and the ones needing more than a resource argument (`ignoreIf`, `linkTo`,
|
|
7
|
+
* a default, ...) have to be written down in the category itself. Names in `except` stay with whoever
|
|
8
|
+
* wrote them down.
|
|
9
|
+
*/
|
|
10
|
+
export declare function functionInfosFromProps(props: CallProps, except: readonly FunctionInfo[]): FunctionInfo[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.functionInfosFromProps = functionInfosFromProps;
|
|
4
|
+
const built_in_props_1 = require("../../../../dataflow/environments/built-in-props");
|
|
5
|
+
const default_builtin_config_1 = require("../../../../dataflow/environments/default-builtin-config");
|
|
6
|
+
const query_fn_props_1 = require("../../../../dataflow/environments/query-fn-props");
|
|
7
|
+
const identifier_1 = require("../../../../dataflow/environments/identifier");
|
|
8
|
+
/** what an entry links to, like `sink` for `cat`: the link reports it already, so it is not an entry of its own */
|
|
9
|
+
function linkTargets(f) {
|
|
10
|
+
return (f.linkTo ?? []).flatMap(l => typeof l.callName === 'string' ? [l.callName]
|
|
11
|
+
: Array.isArray(l.callName) ? l.callName.map(n => identifier_1.Identifier.getName(n)) : []);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The built-ins that carry all of `props` and name the resource they act on, as entries of a dependency
|
|
15
|
+
* category. This is what the {@link DefaultBuiltinConfig} already states, so only the functions it does not
|
|
16
|
+
* know (most package functions) and the ones needing more than a resource argument (`ignoreIf`, `linkTo`,
|
|
17
|
+
* a default, ...) have to be written down in the category itself. Names in `except` stay with whoever
|
|
18
|
+
* wrote them down.
|
|
19
|
+
*/
|
|
20
|
+
function functionInfosFromProps(props, except) {
|
|
21
|
+
const taken = new Set(except.flatMap(f => [f.name, ...linkTargets(f)]));
|
|
22
|
+
const found = [];
|
|
23
|
+
for (const d of default_builtin_config_1.DefaultBuiltinConfig) {
|
|
24
|
+
const info = d.type !== 'constant' ? d.config : undefined;
|
|
25
|
+
if (info?.props === undefined || (info.props & props) !== props || info.sig === undefined) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const argIdx = info.sig.findIndex(([, p]) => (p & built_in_props_1.ArgProp.Resource) !== 0);
|
|
29
|
+
if (argIdx < 0) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
for (const id of (0, query_fn_props_1.builtInNames)(d)) {
|
|
33
|
+
const name = identifier_1.Identifier.getName(id);
|
|
34
|
+
if (!taken.has(name)) {
|
|
35
|
+
found.push({ package: identifier_1.Identifier.getNamespace(id), name, argIdx, argName: info.sig[argIdx][0], resolveValue: true });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return found;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=derived-functions.js.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReadFunctions = void 0;
|
|
4
|
-
|
|
4
|
+
const built_in_props_1 = require("../../../../dataflow/environments/built-in-props");
|
|
5
|
+
const derived_functions_1 = require("./derived-functions");
|
|
6
|
+
const other_path_functions_1 = require("./other-path-functions");
|
|
7
|
+
const ReadFunctionsWithMore = [
|
|
5
8
|
{ package: 'base', name: 'parse', argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
6
9
|
{ package: 'base', name: 'read.table', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-set', additionalArgs: { argSet: { argName: 'text' } } },
|
|
7
10
|
{ package: 'utils', name: 'read.csv', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-set', additionalArgs: { argSet: { argName: 'text' } } },
|
|
@@ -9,22 +12,16 @@ exports.ReadFunctions = [
|
|
|
9
12
|
{ package: 'utils', name: 'read.delim', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-set', additionalArgs: { argSet: { argName: 'text' } } },
|
|
10
13
|
{ package: 'utils', name: 'read.delim2', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-set', additionalArgs: { argSet: { argName: 'text' } } },
|
|
11
14
|
{ package: 'base', name: 'read.dcf', argIdx: 0, argName: 'file', resolveValue: true },
|
|
12
|
-
{ package: 'base', name: 'scan', argIdx: 0, argName: 'file', resolveValue: true },
|
|
13
15
|
{ package: 'utils', name: 'read.fwf', argIdx: 0, argName: 'file', resolveValue: true },
|
|
14
16
|
{ package: 'base', name: 'file', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
15
17
|
{ package: 'base', name: 'url', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
16
|
-
{ package: 'base', name: '
|
|
17
|
-
{ package: 'base', name: '
|
|
18
|
-
{ package: 'base', name: 'bzfile', argIdx: 1, argName: 'open', resolveValue: true },
|
|
18
|
+
{ package: 'base', name: 'gzfile', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
19
|
+
{ package: 'base', name: 'bzfile', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
19
20
|
{ package: 'utils', name: 'download.file', argIdx: 0, argName: 'url', resolveValue: true },
|
|
20
|
-
{ package: 'base', name: 'pipe', argIdx: 1, argName: 'open', resolveValue: true },
|
|
21
|
-
{ package: 'base', name: 'fifo', argIdx: 1, argName: 'open', resolveValue: true },
|
|
22
|
-
{ package: 'base', name: 'unz', argIdx: 1, argName: 'open', resolveValue: true },
|
|
21
|
+
{ package: 'base', name: 'pipe', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
22
|
+
{ package: 'base', name: 'fifo', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
23
|
+
{ package: 'base', name: 'unz', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-write', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
23
24
|
{ package: 'base', name: 'matrix', argIdx: 0, argName: 'data', resolveValue: true },
|
|
24
|
-
{ package: 'base', name: 'readRDS', argIdx: 0, argName: 'file', resolveValue: true },
|
|
25
|
-
{ package: 'base', name: 'readLines', argIdx: 0, argName: 'con', resolveValue: true },
|
|
26
|
-
{ package: 'base', name: 'readChar', argIdx: 0, argName: 'con', resolveValue: true },
|
|
27
|
-
{ package: 'base', name: 'readBin', argIdx: 0, argName: 'con', resolveValue: true },
|
|
28
25
|
{ package: 'base', name: 'readRenviron', argIdx: 0, argName: 'path', resolveValue: true },
|
|
29
26
|
{ package: 'readr', name: 'read_csv', argIdx: 0, argName: 'file', resolveValue: true },
|
|
30
27
|
{ package: 'readr', name: 'read_csv2', argIdx: 0, argName: 'file', resolveValue: true },
|
|
@@ -78,7 +75,7 @@ exports.ReadFunctions = [
|
|
|
78
75
|
{ package: 'readxl', name: 'read_excel', argIdx: 0, argName: 'path', resolveValue: true },
|
|
79
76
|
{ package: 'readxl', name: 'read_xls', argIdx: 0, argName: 'path', resolveValue: true },
|
|
80
77
|
{ package: 'readxl', name: 'read_xlsx', argIdx: 0, argName: 'path', resolveValue: true },
|
|
81
|
-
{ package: 'sf', name: '
|
|
78
|
+
{ package: 'sf', name: 'read_sf', argIdx: 0, argName: 'dsn', resolveValue: true },
|
|
82
79
|
{ package: 'sf', name: 'st_read', argIdx: 0, argName: 'dsn', resolveValue: true },
|
|
83
80
|
{ package: 'rgdal', name: 'readOGR', argIdx: 0, argName: 'dsn', resolveValue: true },
|
|
84
81
|
{ package: 'rgdal', name: 'ogrInfo', argIdx: 0, argName: 'dsn', resolveValue: true },
|
|
@@ -138,4 +135,8 @@ exports.ReadFunctions = [
|
|
|
138
135
|
/* shinyjs - loads an external JavaScript file */
|
|
139
136
|
{ package: 'shinyjs', name: 'extendShinyjs', argIdx: 0, argName: 'script', resolveValue: true, ignoreIf: 'arg-missing' }
|
|
140
137
|
];
|
|
138
|
+
exports.ReadFunctions = [
|
|
139
|
+
...ReadFunctionsWithMore,
|
|
140
|
+
...(0, derived_functions_1.functionInfosFromProps)(built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, [...ReadFunctionsWithMore, ...other_path_functions_1.OtherPathFunctions])
|
|
141
|
+
];
|
|
141
142
|
//# sourceMappingURL=read-functions.js.map
|
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WriteFunctions = void 0;
|
|
4
4
|
const function_info_1 = require("./function-info");
|
|
5
|
+
const built_in_props_1 = require("../../../../dataflow/environments/built-in-props");
|
|
6
|
+
const derived_functions_1 = require("./derived-functions");
|
|
7
|
+
const other_path_functions_1 = require("./other-path-functions");
|
|
8
|
+
const read_functions_1 = require("./read-functions");
|
|
5
9
|
const OutputRedirects = [
|
|
6
10
|
{ type: 'link-to-last-call', callName: 'sink', attachLinkInfo: { argIdx: 0, argName: 'file', when: function_info_1.DependencyInfoLinkConstraint.IfUnknown, resolveValue: true } }
|
|
7
11
|
];
|
|
8
|
-
|
|
9
|
-
{ package: 'base', name: 'save', argName: 'file', resolveValue: true },
|
|
10
|
-
{ package: 'base', name: 'save.image', argIdx: 1, argName: 'file', resolveValue: true, defaultValue: '.RData' },
|
|
11
|
-
{ package: 'base', name: 'write', argIdx: 1, argName: 'file', resolveValue: true },
|
|
12
|
-
{ package: 'base', name: 'dput', argIdx: 1, argName: 'file', resolveValue: true },
|
|
12
|
+
const WriteFunctionsWithMore = [
|
|
13
|
+
{ package: 'base', name: 'save.image', argIdx: 0, argName: 'file', resolveValue: true, defaultValue: '.RData' },
|
|
13
14
|
{ package: 'base', name: 'dump', argIdx: 1, argName: 'file', resolveValue: true },
|
|
14
|
-
{ package: 'utils', name: 'write.table', argIdx: 1, argName: 'file', resolveValue: true },
|
|
15
15
|
{ package: 'utils', name: 'write.csv', argIdx: 1, argName: 'file', resolveValue: true },
|
|
16
|
-
{ package: 'base', name: 'saveRDS', argIdx: 1, argName: 'file', resolveValue: true },
|
|
17
16
|
{
|
|
18
17
|
package: 'base',
|
|
19
18
|
name: 'try',
|
|
@@ -33,12 +32,9 @@ exports.WriteFunctions = [
|
|
|
33
32
|
{ package: 'base', name: 'message', linkTo: OutputRedirects, resolveValue: false },
|
|
34
33
|
{ package: 'base', name: 'warning', linkTo: OutputRedirects, resolveValue: false },
|
|
35
34
|
{ package: 'rlang', name: 'warn', linkTo: OutputRedirects, resolveValue: false },
|
|
36
|
-
{ package: 'rlang', name: '
|
|
35
|
+
{ package: 'rlang', name: 'inform', linkTo: OutputRedirects, resolveValue: false },
|
|
37
36
|
{ package: 'cli', name: 'cli_warn', linkTo: OutputRedirects, resolveValue: false },
|
|
38
37
|
{ package: 'cli', name: 'cli_abort', linkTo: OutputRedirects, resolveValue: false },
|
|
39
|
-
{ package: 'base', name: 'writeLines', argIdx: 1, argName: 'con', resolveValue: true },
|
|
40
|
-
{ package: 'base', name: 'writeChar', argIdx: 1, argName: 'con', resolveValue: true },
|
|
41
|
-
{ package: 'base', name: 'writeBin', argIdx: 1, argName: 'con', resolveValue: true },
|
|
42
38
|
{ package: 'base', name: 'file', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-read', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
43
39
|
{ package: 'base', name: 'url', argIdx: 0, argName: 'description', resolveValue: true, ignoreIf: 'mode-only-read', additionalArgs: { mode: { argIdx: 1, argName: 'open', resolveValue: true } } },
|
|
44
40
|
{ package: 'readr', name: 'write_csv', argIdx: 1, argName: 'file', resolveValue: true },
|
|
@@ -51,11 +47,10 @@ exports.WriteFunctions = [
|
|
|
51
47
|
{ package: 'readr', name: 'write_log', argIdx: 1, argName: 'file', resolveValue: true },
|
|
52
48
|
{ package: 'readr', name: 'write_lines', argIdx: 1, argName: 'file', resolveValue: true },
|
|
53
49
|
{ package: 'readr', name: 'write_rds', argIdx: 1, argName: 'file', resolveValue: true },
|
|
54
|
-
{ package: '
|
|
55
|
-
{ package: '
|
|
56
|
-
{ package: '
|
|
57
|
-
{ package: '
|
|
58
|
-
{ package: 'heaven', name: 'write_xpt', argIdx: 1, argName: 'file', resolveValue: true },
|
|
50
|
+
{ package: 'haven', name: 'write_sas', argIdx: 1, argName: 'file', resolveValue: true },
|
|
51
|
+
{ package: 'haven', name: 'write_sav', argIdx: 1, argName: 'file', resolveValue: true },
|
|
52
|
+
{ package: 'haven', name: 'write_dta', argIdx: 1, argName: 'file', resolveValue: true },
|
|
53
|
+
{ package: 'haven', name: 'write_xpt', argIdx: 1, argName: 'file', resolveValue: true },
|
|
59
54
|
{ package: 'feather', name: 'write_feather', argIdx: 1, argName: 'file', resolveValue: true },
|
|
60
55
|
{ package: 'foreign', name: 'write.arff', argIdx: 1, argName: 'file', resolveValue: true },
|
|
61
56
|
{ package: 'foreign', name: 'write.dbf', argIdx: 1, argName: 'file', resolveValue: true },
|
|
@@ -63,25 +58,20 @@ exports.WriteFunctions = [
|
|
|
63
58
|
{ package: 'foreign', name: 'write.foreign', argIdx: 1, argName: 'file', resolveValue: true },
|
|
64
59
|
{ package: 'xlsx', name: 'write.xlsx', argIdx: 1, argName: 'file', resolveValue: true },
|
|
65
60
|
{ package: 'xlsx', name: 'write.xlsx2', argIdx: 1, argName: 'file', resolveValue: true },
|
|
66
|
-
{ package: '
|
|
67
|
-
{ package: '
|
|
68
|
-
{ package: '
|
|
69
|
-
{ package: '
|
|
70
|
-
{ package: '
|
|
71
|
-
{ package: '
|
|
72
|
-
{ package: '
|
|
73
|
-
{ package: '
|
|
74
|
-
{ package: '
|
|
75
|
-
{ package: 'graphics', name: 'svg', argIdx: 0, argName: 'file', resolveValue: true },
|
|
76
|
-
{ package: 'graphics', name: 'bmp', argIdx: 0, argName: 'file', resolveValue: true },
|
|
77
|
-
{ package: 'graphics', name: 'tiff', argIdx: 0, argName: 'file', resolveValue: true },
|
|
78
|
-
{ package: 'graphics', name: 'X11', argIdx: 0, argName: 'file', resolveValue: true },
|
|
79
|
-
{ package: 'graphics', name: 'quartz', argIdx: 0, argName: 'file', resolveValue: true },
|
|
61
|
+
{ package: 'grDevices', name: 'jpeg', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
62
|
+
{ package: 'grDevices', name: 'png', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
63
|
+
{ package: 'grDevices', name: 'windows', argIdx: 0, argName: 'file', resolveValue: true },
|
|
64
|
+
{ package: 'grDevices', name: 'cairo_pdf', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
65
|
+
{ package: 'grDevices', name: 'svg', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
66
|
+
{ package: 'grDevices', name: 'bmp', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
67
|
+
{ package: 'grDevices', name: 'tiff', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
68
|
+
{ package: 'grDevices', name: 'X11', argIdx: 0, argName: 'file', resolveValue: true },
|
|
69
|
+
{ package: 'grDevices', name: 'quartz', argIdx: 0, argName: 'file', resolveValue: true },
|
|
80
70
|
{ package: 'car', name: 'Export', argIdx: 0, argName: 'file', resolveValue: true },
|
|
81
71
|
{ package: 'LIM', name: 'PrintMat', linkTo: OutputRedirects, resolveValue: true },
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
{
|
|
72
|
+
// write_spss/write_stata moved sjmisc -> sjlabelled, so do not pin a namespace (match either); write_sas also lives in haven
|
|
73
|
+
{ name: 'write_spss', argIdx: 1, argName: 'path', resolveValue: true },
|
|
74
|
+
{ name: 'write_stata', argIdx: 1, argName: 'path', resolveValue: true },
|
|
85
75
|
{ package: 'ape', name: 'write.tree', argIdx: 1, argName: 'file', resolveValue: true },
|
|
86
76
|
{ package: 'ape', name: 'write.nexus', argIdx: 1, argName: 'file', resolveValue: true },
|
|
87
77
|
{ package: 'ape', name: 'write.phyloXML', argIdx: 1, argName: 'file', resolveValue: true },
|
|
@@ -98,12 +88,10 @@ exports.WriteFunctions = [
|
|
|
98
88
|
{ package: 'visNetwork', name: 'visSave', argIdx: 1, argName: 'file', resolveValue: true },
|
|
99
89
|
{ package: 'DiagrammeR', name: 'save_graph', argIdx: 1, argName: 'file', resolveValue: true },
|
|
100
90
|
{ package: 'DiagrammeR', name: 'export_graph', argName: 'file_name', resolveValue: true },
|
|
101
|
-
{ package: '
|
|
91
|
+
{ package: 'ggplot2', name: 'ggsave', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
102
92
|
{ package: 'cowplot', name: 'ggsave2', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
103
93
|
{ package: 'tinyplot', name: 'tinyplot', argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
104
94
|
{ package: 'tinyplot', name: 'plt', argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
105
|
-
{ package: 'rasterpdf', name: 'raster_pdf', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
106
|
-
{ package: 'rasterpdf', name: 'agg_pdf', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
107
95
|
{ package: 'highcharter', name: 'hc_exporting', argName: 'filename', resolveValue: true },
|
|
108
96
|
{ package: 'jsonlite', name: 'write_json', argIdx: 1, argName: 'path', resolveValue: true },
|
|
109
97
|
{ package: 'rpolars', name: 'sink_ipc', argIdx: 0, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
@@ -142,4 +130,8 @@ exports.WriteFunctions = [
|
|
|
142
130
|
{ package: 'seewave', name: 'savewav', argName: 'filename', resolveValue: true, defaultValue: '<wave-name>' },
|
|
143
131
|
{ package: 'audio', name: 'save.wave', argIdx: 1, argName: 'where', resolveValue: true }
|
|
144
132
|
];
|
|
133
|
+
exports.WriteFunctions = [
|
|
134
|
+
...WriteFunctionsWithMore,
|
|
135
|
+
...(0, derived_functions_1.functionInfosFromProps)(built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, [...WriteFunctionsWithMore, ...other_path_functions_1.OtherPathFunctions, ...read_functions_1.ReadFunctions])
|
|
136
|
+
];
|
|
145
137
|
//# sourceMappingURL=write-functions.js.map
|
|
@@ -4,7 +4,10 @@ exports.executeGuessDepVersionsQuery = executeGuessDepVersionsQuery;
|
|
|
4
4
|
const guess_dep_versions_query_format_1 = require("./guess-dep-versions-query-format");
|
|
5
5
|
const r_version_1 = require("../../../util/r-version");
|
|
6
6
|
const objects_1 = require("../../../util/objects");
|
|
7
|
+
const visualize_functions_1 = require("../dependencies-query/function-info/visualize-functions");
|
|
7
8
|
const dependency_version_space_1 = require("../../../project/dependency-version-space");
|
|
9
|
+
/** flowR's curated builtin-library function to package map (e.g. `ggplot` to `ggplot2`), disambiguating an orphan call several packages re-export */
|
|
10
|
+
const BuiltinLibraryByFunction = new Map(visualize_functions_1.VisualizeFunctions.filter(f => f.package !== undefined).map(f => [f.name, f.package]));
|
|
8
11
|
/** the sources `query` disables: `clean` is sugar for disabling `declared`+`transitive`, `disabled` adds any others by name */
|
|
9
12
|
function disabledSources(query) {
|
|
10
13
|
if (!query.clean && !query.disabled?.length) {
|
|
@@ -99,7 +102,7 @@ function rangeString(survivors, nonContiguous, unsatisfiable, declaredRange, dec
|
|
|
99
102
|
return survivors.length <= cap ? survivors.join(', ') : `${min}...${max} (${survivors.length} discrete)`;
|
|
100
103
|
}
|
|
101
104
|
/** build the reported guess for one package from its already-computed surviving versions and provenance */
|
|
102
|
-
function guessPackage(name, cap, surviving, evidence, { used, linkedWith, coupledWith }) {
|
|
105
|
+
function guessPackage(name, cap, surviving, evidence, { used, linkedWith, coupledWith, orphanFunctions, orphanAlternatives }) {
|
|
103
106
|
const { declaredRange, declaredConstraints, unsatisfiable } = surviving;
|
|
104
107
|
const survivors = surviving.survivors.map(e => e.ver);
|
|
105
108
|
const preSignature = surviving.preSignature.map(e => e.ver);
|
|
@@ -121,6 +124,10 @@ function guessPackage(name, cap, surviving, evidence, { used, linkedWith, couple
|
|
|
121
124
|
unsatisfiable: unsatisfiable ? true : undefined,
|
|
122
125
|
linkedWith: linkedWith && linkedWith.length > 0 ? linkedWith : undefined,
|
|
123
126
|
coupledWith: coupledWith && coupledWith.length > 0 ? coupledWith : undefined,
|
|
127
|
+
known: surviving.known ? undefined : false,
|
|
128
|
+
orphan: orphanFunctions && orphanFunctions.length > 0 ? true : undefined,
|
|
129
|
+
orphanFunctions: orphanFunctions && orphanFunctions.length > 0 ? orphanFunctions : undefined,
|
|
130
|
+
orphanAlternatives: orphanAlternatives && orphanAlternatives.length > 0 ? orphanAlternatives : undefined,
|
|
124
131
|
used
|
|
125
132
|
});
|
|
126
133
|
}
|
|
@@ -150,9 +157,14 @@ async function executeGuessDepVersionsQuery({ analyzer }, queries) {
|
|
|
150
157
|
}
|
|
151
158
|
// bound base packages by R only when the version is genuinely known; in `auto` mode with nothing detected, base tries every R release
|
|
152
159
|
const rVersion = ctx.rVersionKnown ? (ctx.meta.getRVersion() ?? ctx.resolvedRVersion) : undefined;
|
|
153
|
-
const usage = (0, dependency_version_space_1.collectUsage)((await analyzer.dataflow()).graph, deps);
|
|
154
160
|
// the analyzed package guesses versions for its dependencies, not for itself
|
|
155
161
|
const self = ctx.meta.getNamespace();
|
|
162
|
+
const graph = (await analyzer.dataflow()).graph;
|
|
163
|
+
const usage = (0, dependency_version_space_1.collectUsage)(graph, deps);
|
|
164
|
+
// fold orphan calls (`ggplot()` with ggplot2 neither declared nor loaded) into usage; a package the project does
|
|
165
|
+
// not already know is flagged for downstream attachment (see collectOrphanUsage)
|
|
166
|
+
const known = new Set([...deps.getDependencies().map(d => d.name), ...deps.declaredPackageNames()]);
|
|
167
|
+
const orphans = (0, dependency_version_space_1.collectOrphanUsage)(graph, deps, usage, pkg => known.has(pkg), { self, builtinLibraryOf: name => BuiltinLibraryByFunction.get(name) });
|
|
156
168
|
const sorted = (query.packages && query.packages.length > 0 ? [...query.packages] : (0, dependency_version_space_1.defaultTargets)(deps, usage)).filter(name => name !== self).sort();
|
|
157
169
|
const disabled = disabledSources(query);
|
|
158
170
|
const space = new dependency_version_space_1.VersionSpace({ deps, usage, cutoff, rVersion, disabled });
|
|
@@ -222,13 +234,31 @@ async function executeGuessDepVersionsQuery({ analyzer }, queries) {
|
|
|
222
234
|
coupledWith.set(pkg, [...coupledWith.get(pkg) ?? [], c.always ? partner : `${partner} (partial)`]);
|
|
223
235
|
}
|
|
224
236
|
}
|
|
237
|
+
// the packages an orphan could have meant instead, resolved in a space of their own so that reporting them
|
|
238
|
+
// does not turn them into dependencies of the project; built only when an orphan actually had a choice
|
|
239
|
+
const altSpace = orphans.alternativeUsage.size > 0
|
|
240
|
+
? new dependency_version_space_1.VersionSpace({ deps, usage: orphans.alternativeUsage, cutoff, rVersion, disabled }) : undefined;
|
|
241
|
+
const orphanAlternatives = (pkg) => (orphans.alternatives.get(pkg) ?? []).map(alt => {
|
|
242
|
+
const s = altSpace.survivors(alt, []);
|
|
243
|
+
const versions = s.survivors.map(e => e.ver);
|
|
244
|
+
return (0, objects_1.compactRecord)({
|
|
245
|
+
package: alt,
|
|
246
|
+
range: rangeString(versions, false, s.unsatisfiable, s.declaredRange, s.declaredConstraints, cap),
|
|
247
|
+
minVersion: versions[0],
|
|
248
|
+
maxVersion: versions[versions.length - 1],
|
|
249
|
+
candidateCount: versions.length,
|
|
250
|
+
totalVersions: s.total
|
|
251
|
+
});
|
|
252
|
+
});
|
|
225
253
|
const dependencies = [];
|
|
226
254
|
const ordered = [];
|
|
227
255
|
for (const g of guessedAll) {
|
|
228
256
|
dependencies.push(guessPackage(g.name, cap, g.surviving, g.evidence, {
|
|
229
257
|
used: usage.has(g.name),
|
|
230
258
|
linkedWith: linkedWith.get(g.name),
|
|
231
|
-
coupledWith: coupledWith.get(g.name)
|
|
259
|
+
coupledWith: coupledWith.get(g.name),
|
|
260
|
+
orphanFunctions: [...orphans.attributed.get(g.name) ?? []].sort(),
|
|
261
|
+
orphanAlternatives: orphanAlternatives(g.name)
|
|
232
262
|
}));
|
|
233
263
|
const oc = query.explode ? (0, dependency_version_space_1.orderedCandidatesOf)(space.resolve(g.name).src, g.name, g.surviving, query.explode.prefer?.[g.name], explodeOrder) : undefined;
|
|
234
264
|
if (oc) {
|
|
@@ -56,6 +56,16 @@ export type GuessEvidenceSource = ConstraintSource;
|
|
|
56
56
|
* it can answer "it must be `>= 4.2.0` because ...". This is the resolver's {@link DerivedConstraint}.
|
|
57
57
|
*/
|
|
58
58
|
export type GuessVersionEvidence = DerivedConstraint;
|
|
59
|
+
/** one package an orphan call could have meant instead, with the versions of it that fit those calls */
|
|
60
|
+
export interface OrphanAlternativeView {
|
|
61
|
+
readonly package: string;
|
|
62
|
+
/** the version range of this package that would accept the orphan calls, in the notation {@link GuessedDependency.range} uses */
|
|
63
|
+
readonly range: string;
|
|
64
|
+
readonly minVersion?: string;
|
|
65
|
+
readonly maxVersion?: string;
|
|
66
|
+
readonly candidateCount: number;
|
|
67
|
+
readonly totalVersions: number;
|
|
68
|
+
}
|
|
59
69
|
/** the guessed version range of one dependency */
|
|
60
70
|
export interface GuessedDependency {
|
|
61
71
|
readonly package: string;
|
|
@@ -93,6 +103,27 @@ export interface GuessedDependency {
|
|
|
93
103
|
* no direct `zoo::`/`library(zoo)` call.
|
|
94
104
|
*/
|
|
95
105
|
readonly used?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Set to `false` when the signature database has no record of the package at all (e.g. a Bioconductor package),
|
|
108
|
+
* distinguishing it from one the database carries but cannot constrain. Such a package has no `minVersion`/`maxVersion`
|
|
109
|
+
* and never appears in {@link GuessDepVersionsQueryResult.assignments}, so a consumer should resolve it by other means.
|
|
110
|
+
*/
|
|
111
|
+
readonly known?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Set when this package was inferred purely from *orphan* calls: bare calls (`ggplot()`) that flowR could not
|
|
114
|
+
* resolve and that no loaded package defines, but whose name is exported by exactly this one package in the
|
|
115
|
+
* signature database. The symbol would be undefined were the package not loaded, so a downstream handler may
|
|
116
|
+
* attach `library(package)`. See {@link orphanFunctions} for the calls that implicated it.
|
|
117
|
+
*/
|
|
118
|
+
readonly orphan?: boolean;
|
|
119
|
+
/** the undefined orphan function names that inferred this package (only set when {@link orphan}), e.g. `['ggplot']` */
|
|
120
|
+
readonly orphanFunctions?: readonly string[];
|
|
121
|
+
/**
|
|
122
|
+
* The other packages that export the {@link orphanFunctions}, each with the versions of it that would fit the
|
|
123
|
+
* calls. Attributing an orphan is a guess: the most downloaded exporter wins, and these are the ones it beat,
|
|
124
|
+
* so whoever reads the result can pick another. Ordered as the guess ranked them, best first.
|
|
125
|
+
*/
|
|
126
|
+
readonly orphanAlternatives?: readonly OrphanAlternativeView[];
|
|
96
127
|
}
|
|
97
128
|
export interface GuessDepVersionsQueryResult extends BaseQueryResult {
|
|
98
129
|
readonly dependencies: readonly GuessedDependency[];
|
|
@@ -278,9 +278,11 @@ exports.GuessDepVersionsQueryDefinition = {
|
|
|
278
278
|
const coupled = dep.coupledWith ?? [];
|
|
279
279
|
const groupTag = (dep.base ? ' ' + (0, ansi_1.italic)('[base]', formatter)
|
|
280
280
|
: dep.linkedWith ? ' ' + (0, ansi_1.italic)(`[linked: ${dep.linkedWith.join(', ')}]`, formatter) : '')
|
|
281
|
-
+ (coupled.length > 0 ? ' ' + (0, ansi_1.italic)(`[coupled: ${truncatedList(coupled, 3)}]`, formatter) : '')
|
|
281
|
+
+ (coupled.length > 0 ? ' ' + (0, ansi_1.italic)(`[coupled: ${truncatedList(coupled, 3)}]`, formatter) : '')
|
|
282
|
+
+ (dep.orphan ? ' ' + (0, ansi_1.color)(`[orphan: attach library(${dep.package}) for ${truncatedList(dep.orphanFunctions ?? [], 3)}]`, 3 /* Colors.Yellow */, formatter) : '');
|
|
282
283
|
const anyVersion = coupled.length > 0 ? '(any version on its own)' : '(any version)';
|
|
283
|
-
const note = dep.
|
|
284
|
+
const note = dep.known === false ? ' ' + (0, ansi_1.color)('(not in database)', 1 /* Colors.Red */, formatter)
|
|
285
|
+
: dep.base ? '' : dep.used === false ? ' ' + (0, ansi_1.faint)('(not called)', formatter) : !isConstrained(dep) && dep.totalVersions ? ' ' + (0, ansi_1.faint)(anyVersion, formatter) : '';
|
|
284
286
|
const tag = groupTag + note;
|
|
285
287
|
const range = dep.unsatisfiable ? (0, ansi_1.color)('unsatisfiable', 1 /* Colors.Red */, formatter) : (0, ansi_1.bold)(dep.range, formatter);
|
|
286
288
|
const count = dep.totalVersions !== undefined ? `${dep.candidateCount}/${dep.totalVersions} versions` : `${dep.candidateCount} candidate${dep.candidateCount === 1 ? '' : 's'}`;
|
|
@@ -288,6 +290,11 @@ exports.GuessDepVersionsQueryDefinition = {
|
|
|
288
290
|
const dbGe = versionBound(tightestBound(avail, '>='))?.ver, dbLe = versionBound(tightestBound(avail, '<='))?.ver;
|
|
289
291
|
const dbRange = dbGe !== undefined && dbLe !== undefined ? `, db ${dbGe} - ${dbLe}` : '';
|
|
290
292
|
result.push(` ${(0, ansi_1.bold)('━ ' + dep.package, formatter)}${tag} ${range} ${(0, ansi_1.faint)('(' + count + dbRange + ')', formatter)}`);
|
|
293
|
+
if (dep.orphanAlternatives?.length) {
|
|
294
|
+
// attributing an orphan is a guess, so name the exporters it beat and what each of them would fit
|
|
295
|
+
const alts = dep.orphanAlternatives.map(a => `${a.package} ${a.range}`);
|
|
296
|
+
result.push(` ${(0, ansi_1.italic)('or instead', formatter)}: ${truncatedList(alts, 4)}`);
|
|
297
|
+
}
|
|
291
298
|
// only enforced evidence sets the tightest bound; a partial one narrows nothing and must not hide a real bound
|
|
292
299
|
const enforced = dep.evidence.filter(e => !e.partial);
|
|
293
300
|
const tightestGe = versionBound(tightestBound(enforced, '>='))?.ver;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { LinkedInputEntryPoint, LinkedInputObject, NarrowingFunction } from './simple-input-classifier';
|
|
2
|
+
import { BuiltInIndex } from '../../../dataflow/environments/query-fn-props';
|
|
3
3
|
/**
|
|
4
4
|
* Objects that a framework binds for its users, without a definition visible in the code.
|
|
5
5
|
* The `withParams` and `requires` guards keep ordinary functions that happen to have a parameter of the same
|
|
@@ -7,16 +7,15 @@ import type { LinkedInputEntryPoint, LinkedInputObject } from './simple-input-cl
|
|
|
7
7
|
* @see {@link LinkedInputObject}
|
|
8
8
|
*/
|
|
9
9
|
export declare const LinkedInputObjects: readonly LinkedInputObject[];
|
|
10
|
+
/**
|
|
11
|
+
* The functions whose result is bounded no matter what flows in, read back from the {@link CallProp.Narrows}
|
|
12
|
+
* built-ins: with an {@link ArgProp.Bounds} parameter the result is one of that argument's values (`match.arg`
|
|
13
|
+
* and its `choices`), without one it is a count, an index, or a logical of the call's own making. Label a
|
|
14
|
+
* built-in `Narrows` (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
15
|
+
*/
|
|
16
|
+
export declare function narrowingFunctions(index?: BuiltInIndex): readonly NarrowingFunction[];
|
|
10
17
|
/**
|
|
11
18
|
* Calls that hand a function to a framework which binds its parameters by position.
|
|
12
19
|
* @see {@link LinkedInputEntryPoint}
|
|
13
20
|
*/
|
|
14
21
|
export declare const LinkedInputEntryPoints: readonly LinkedInputEntryPoint[];
|
|
15
|
-
export declare const PureFunctions: Identifier[];
|
|
16
|
-
export declare const SystemFunctions: Identifier[];
|
|
17
|
-
export declare const FfiFunctions: Identifier[];
|
|
18
|
-
export declare const LangFunctions: Identifier[];
|
|
19
|
-
export declare const OptionsFunctions: Identifier[];
|
|
20
|
-
export declare const UserFunctions: Identifier[];
|
|
21
|
-
/** R functions that produce temporary file/directory paths (sub-type of {@link InputType.File}). */
|
|
22
|
-
export declare const TempFileFunctions: Identifier[];
|