@eagleoutice/flowr 2.13.0 → 2.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/cli/common/options.d.ts +10 -0
- package/cli/common/options.js +2 -0
- package/cli/common/scripts-info.d.ts +10 -0
- package/cli/flowr.js +21 -5
- package/cli/repl/commands/repl-commands.d.ts +8 -0
- package/cli/repl/commands/repl-commands.js +27 -12
- package/cli/repl/commands/repl-query.js +9 -1
- package/cli/repl/commands/repl-signature.js +8 -1
- package/cli/repl/core.js +13 -10
- package/cli/repl/print-version.js +1 -1
- package/cli/repl/server/connection.d.ts +1 -1
- package/cli/repl/server/net.js +15 -0
- package/cli/slicer-app.d.ts +2 -0
- package/cli/slicer-app.js +2 -1
- package/config.d.ts +31 -0
- package/config.js +55 -2
- package/data/sigdb/sigdb.remote.json +1 -1
- package/dataflow/environments/identifier.d.ts +9 -8
- package/dataflow/environments/identifier.js +21 -13
- package/dataflow/eval/resolve/resolve-working-directory.d.ts +29 -0
- package/dataflow/eval/resolve/resolve-working-directory.js +168 -0
- package/dataflow/extractor.js +2 -1
- package/dataflow/graph/df-helper.d.ts +3 -2
- package/dataflow/graph/df-helper.js +11 -15
- package/dataflow/graph/diff-dataflow-graph.js +1 -1
- package/dataflow/graph/graph-helper.js +2 -6
- package/dataflow/graph/graph.d.ts +24 -0
- package/dataflow/graph/graph.js +25 -1
- package/documentation/wiki-interface.js +1 -0
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-mk/doc-context.d.ts +10 -0
- package/documentation/wiki-mk/doc-context.js +3 -0
- package/documentation/wiki-query.js +4 -3
- package/documentation/wiki-signature-database.js +16 -6
- package/linter/linter-rules.d.ts +24 -2
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +4 -4
- package/linter/rules/absolute-path.js +7 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/file-path-validity.js +48 -8
- package/linter/rules/function-finder-util.d.ts +2 -1
- package/linter/rules/syntactically-valid.d.ts +58 -0
- package/linter/rules/syntactically-valid.js +203 -0
- package/linter/rules/undefined-symbol.js +3 -2
- package/package.json +5 -4
- package/project/context/classify-project-kind.d.ts +40 -0
- package/project/context/classify-project-kind.js +76 -0
- package/project/context/flowr-analyzer-context.d.ts +2 -0
- package/project/context/flowr-analyzer-context.js +6 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +23 -4
- package/project/context/flowr-analyzer-dependencies-context.js +23 -1
- package/project/context/flowr-analyzer-files-context.d.ts +18 -8
- package/project/context/flowr-analyzer-files-context.js +66 -68
- package/project/context/flowr-file.d.ts +5 -0
- package/project/context/flowr-file.js +5 -0
- package/project/dependency-version-space.d.ts +3 -1
- package/project/dependency-version-space.js +26 -20
- package/project/flowr-analyzer.d.ts +3 -0
- package/project/flowr-analyzer.js +4 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +12 -4
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +25 -10
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +4 -1
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +57 -2
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +150 -28
- package/project/sigdb/decompress.d.ts +1 -1
- package/project/sigdb/decompress.js +4 -1
- package/project/sigdb/manifest.js +60 -26
- package/project/sigdb/sigdb-download.d.ts +6 -7
- package/project/sigdb/sigdb-download.js +30 -9
- package/queries/catalog/config-query/config-query-executor.js +3 -0
- package/queries/catalog/config-query/config-query-format.d.ts +5 -3
- package/queries/catalog/config-query/config-query-format.js +31 -21
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +0 -10
- package/queries/catalog/dependencies-query/dependencies-query-format.js +0 -106
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +21 -5
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +4 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +17 -3
- package/queries/catalog/linter-query/linter-query-format.js +9 -2
- package/queries/catalog/signature-query/signature-query-executor.js +3 -0
- package/queries/catalog/signature-query/signature-query-render.js +4 -4
- package/queries/query.d.ts +4 -4
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/retriever.js +6 -1
- package/r-bridge/shell.js +5 -0
- package/search/flowr-search-filters.d.ts +2 -1
- package/util/files.d.ts +6 -4
- package/util/files.js +30 -8
- package/util/mermaid/dfg.js +1 -1
- package/util/schema.d.ts +2 -0
- package/util/schema.js +13 -0
- package/util/text/ansi.d.ts +7 -3
- package/util/text/ansi.js +8 -5
- package/util/version.js +4 -4
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UNDEFINED_SYMBOL = void 0;
|
|
4
4
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
5
|
+
const graph_1 = require("../../dataflow/graph/graph");
|
|
5
6
|
const dfg_get_origin_1 = require("../../dataflow/origin/dfg-get-origin");
|
|
6
7
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
7
8
|
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
@@ -56,12 +57,12 @@ exports.UNDEFINED_SYMBOL = {
|
|
|
56
57
|
// findings as low-confidence (`mayBeProvidedByUnresolvedLibrary`) so the severity can be lowered
|
|
57
58
|
const unknownIds = new Set();
|
|
58
59
|
for (const e of graph.unknownSideEffects) {
|
|
59
|
-
unknownIds.add(
|
|
60
|
+
unknownIds.add(graph_1.UnknownSideEffect.id(e));
|
|
60
61
|
}
|
|
61
62
|
let unresolvedLibraryInScope = false;
|
|
62
63
|
if (unknownIds.size > 0) {
|
|
63
64
|
for (const [id, v] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
|
|
64
|
-
if (LibraryLoadFunctions.has(identifier_1.Identifier.getName(v.name)) && unknownIds.has(
|
|
65
|
+
if (LibraryLoadFunctions.has(identifier_1.Identifier.getName(v.name)) && unknownIds.has(id)) {
|
|
65
66
|
unresolvedLibraryInScope = true;
|
|
66
67
|
break;
|
|
67
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagleoutice/flowr",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.2",
|
|
4
4
|
"description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"setup:dev": "git lfs fetch && npm ci && git config --local core.hooksPath .githooks/ && git push --dry-run",
|
|
16
16
|
"main": "npm run build:bundle-flowr && node dist/src/cli/flowr.min.js",
|
|
17
17
|
"flowr": "npm run main --",
|
|
18
|
-
"flowr:dev": "npm run gen:base-packages && npm run main-dev --",
|
|
18
|
+
"flowr:dev": "npm run sync:sigdb && npm run gen:base-packages && npm run main-dev --",
|
|
19
19
|
"main-dev": "node -r ts-node/register --watch src/cli/flowr.ts",
|
|
20
20
|
"publish-library": "cp .npmignore package.json README.md LICENSE dist/src/ && cd dist/src && npm publish --access public",
|
|
21
21
|
"release": "npx release-it --ci",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"wiki:watch": "node -r ts-node/register --watch src/cli/wiki.ts --keep-alive",
|
|
30
30
|
"build": "npm run gen:base-packages && tsc --project . && npm run build:copy-data",
|
|
31
31
|
"gen:base-packages": "ts-node --transpile-only scripts/gen-base-packages.ts",
|
|
32
|
-
"sync:sigdb": "ts-node --transpile-only scripts/sigdb-
|
|
32
|
+
"sync:sigdb": "ts-node --transpile-only scripts/sigdb-sync.ts",
|
|
33
|
+
"gen:sigdb-remote": "ts-node --transpile-only scripts/sigdb-remote.ts",
|
|
33
34
|
"publish:sigdb": "ts-node scripts/publish-sigdb.ts",
|
|
34
35
|
"build:copy-data": "ts-node --transpile-only scripts/sigdb-copy.ts",
|
|
35
36
|
"build-dev": "npm run build && npm run build:copy-wasm",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"test-full": "npm run test:coverage -- --no-watch -- --make-summary --test-installation",
|
|
49
50
|
"performance-test": "func() { cd test/performance/ && bash run-all-suites.sh $1 $2 $3 $4; cd ../../; }; func",
|
|
50
51
|
"test:performance": "npm run performance-test --",
|
|
51
|
-
"test:docker": "func() { for df in scripts/Dockerfile scripts/Dockerfile-NoR; do echo \"=== building $df ===\";
|
|
52
|
+
"test:docker": "func() { b() { docker build ${1:+--network=$1} -t flowr-docker-test -f \"$2\" .; }; r() { docker run --rm ${1:+--network=$1} flowr-docker-test --version; }; for df in scripts/Dockerfile scripts/Dockerfile-NoR; do echo \"=== building $df ===\"; b '' \"$df\" || { echo '(retrying with --network=host: bridge networking unavailable)'; b host \"$df\"; } || return 1; echo \"=== smoke-testing $df ===\"; r '' || r host || return 1; done; }; func",
|
|
52
53
|
"detect-circular-deps": "npx madge --extensions ts,tsx --circular src/",
|
|
53
54
|
"checkup": "ts-node scripts/checkup-parallel.ts"
|
|
54
55
|
},
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ProjectKind } from './project-kind';
|
|
2
|
+
/** Lazily read a shiny-entry file's content; returns `undefined` when it cannot be read. */
|
|
3
|
+
export type ContentReader = () => string | undefined;
|
|
4
|
+
/** The evidence {@link classifyProjectKind} works from. */
|
|
5
|
+
export interface ProjectKindSignals {
|
|
6
|
+
/** lower-cased basenames of every file known so far */
|
|
7
|
+
readonly names: ReadonlySet<string>;
|
|
8
|
+
/** shiny-entry basename to a reader for its content */
|
|
9
|
+
readonly entries: ReadonlyMap<string, ContentReader>;
|
|
10
|
+
/** the lower-cased `Type:` of each known `DESCRIPTION` (`''` when absent) */
|
|
11
|
+
readonly descriptionTypes: readonly string[];
|
|
12
|
+
/** how many `DESCRIPTION` files are known */
|
|
13
|
+
readonly descriptionCount: number;
|
|
14
|
+
}
|
|
15
|
+
/** The configurable classification inputs, from `project.classification`. */
|
|
16
|
+
export interface ClassificationConfig {
|
|
17
|
+
readonly shinyDescriptionTypes?: readonly string[];
|
|
18
|
+
readonly shinyEntryFiles?: readonly string[];
|
|
19
|
+
readonly shinyUsagePattern?: string;
|
|
20
|
+
readonly notebookExtensions?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/** {@link ClassificationConfig} resolved to matchers, falling back to the built-in defaults. */
|
|
23
|
+
export interface ResolvedClassifyOptions {
|
|
24
|
+
readonly shinyDescriptionTypes: ReadonlySet<string>;
|
|
25
|
+
readonly shinyEntryFiles: ReadonlySet<string>;
|
|
26
|
+
readonly shinyUsage: RegExp;
|
|
27
|
+
readonly notebookExtension: RegExp;
|
|
28
|
+
}
|
|
29
|
+
/** Resolve {@link ClassificationConfig} into {@link ResolvedClassifyOptions}, using the built-in defaults for unset fields. */
|
|
30
|
+
export declare function resolveClassifyOptions(cfg?: ClassificationConfig): ResolvedClassifyOptions;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the project is a shiny app: it has the canonical entry files (a single `app.R`, or the `ui.R`+`server.R`
|
|
33
|
+
* pair) and one of them uses the shiny stack. When no entry file can be read we trust the file names alone.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isShinyAppSignals(names: ReadonlySet<string>, entries: ReadonlyMap<string, ContentReader>, shinyUsagePattern?: RegExp): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Classify the {@link ProjectKind} from the given {@link ProjectKindSignals}. Shiny apps are detected first (they
|
|
38
|
+
* often ship a `DESCRIPTION` too), then packages, then notebooks; the rest is a single-file `Script` or a `Project`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function classifyProjectKind(signals: ProjectKindSignals, opts?: ResolvedClassifyOptions): ProjectKind;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveClassifyOptions = resolveClassifyOptions;
|
|
4
|
+
exports.isShinyAppSignals = isShinyAppSignals;
|
|
5
|
+
exports.classifyProjectKind = classifyProjectKind;
|
|
6
|
+
const project_kind_1 = require("./project-kind");
|
|
7
|
+
/** default DESCRIPTION `Type:` values marking a shiny app */
|
|
8
|
+
const shinyDescriptionTypes = new Set(['shiny', 'shiny-app', 'shinyapp']);
|
|
9
|
+
/** default (lower-cased) file names a shiny app is assembled from */
|
|
10
|
+
const shinyEntryFiles = new Set(['app.r', 'ui.r', 'server.r', 'global.r']);
|
|
11
|
+
/** default evidence that a file is part of a shiny app (a load of the shiny stack or a call to one of its entry points) */
|
|
12
|
+
const shinyUsage = /(?:library|require|requireNamespace|loadNamespace)\s*\(\s*['"]?(?:shiny|bslib|shinydashboard|shinyMobile|golem|flexdashboard)\b|\b(?:shinyApp|shinyServer|shinyUI|runApp|fluidPage|fluidRow|navbarPage|bootstrapPage|fillPage|dashboardPage|page_fluid|page_sidebar|page_navbar|pageWithSidebar)\s*\(/;
|
|
13
|
+
/** default extensions marking a notebook / literate document */
|
|
14
|
+
const notebookExtension = /\.(ipynb|rmd|qmd|rnw)$/;
|
|
15
|
+
/** Resolve {@link ClassificationConfig} into {@link ResolvedClassifyOptions}, using the built-in defaults for unset fields. */
|
|
16
|
+
function resolveClassifyOptions(cfg) {
|
|
17
|
+
return {
|
|
18
|
+
shinyDescriptionTypes: cfg?.shinyDescriptionTypes ? new Set(cfg.shinyDescriptionTypes.map(s => s.toLowerCase())) : shinyDescriptionTypes,
|
|
19
|
+
shinyEntryFiles: cfg?.shinyEntryFiles ? new Set(cfg.shinyEntryFiles.map(s => s.toLowerCase())) : shinyEntryFiles,
|
|
20
|
+
shinyUsage: cfg?.shinyUsagePattern ? new RegExp(cfg.shinyUsagePattern) : shinyUsage,
|
|
21
|
+
notebookExtension: cfg?.notebookExtensions ? new RegExp(`\\.(${cfg.notebookExtensions.join('|')})$`, 'i') : notebookExtension
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const defaultClassifyOptions = resolveClassifyOptions();
|
|
25
|
+
/**
|
|
26
|
+
* Whether the project is a shiny app: it has the canonical entry files (a single `app.R`, or the `ui.R`+`server.R`
|
|
27
|
+
* pair) and one of them uses the shiny stack. When no entry file can be read we trust the file names alone.
|
|
28
|
+
*/
|
|
29
|
+
function isShinyAppSignals(names, entries, shinyUsagePattern = shinyUsage) {
|
|
30
|
+
if (!names.has('app.r') && !(names.has('ui.r') && names.has('server.r'))) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
let couldRead = false;
|
|
34
|
+
for (const read of entries.values()) {
|
|
35
|
+
const content = read();
|
|
36
|
+
if (content === undefined) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
couldRead = true;
|
|
40
|
+
if (shinyUsagePattern.test(content)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return !couldRead;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Classify the {@link ProjectKind} from the given {@link ProjectKindSignals}. Shiny apps are detected first (they
|
|
48
|
+
* often ship a `DESCRIPTION` too), then packages, then notebooks; the rest is a single-file `Script` or a `Project`.
|
|
49
|
+
*/
|
|
50
|
+
function classifyProjectKind(signals, opts = defaultClassifyOptions) {
|
|
51
|
+
if (signals.descriptionTypes.some(t => opts.shinyDescriptionTypes.has(t))) {
|
|
52
|
+
return project_kind_1.ProjectKind.ShinyApp;
|
|
53
|
+
}
|
|
54
|
+
if (isShinyAppSignals(signals.names, signals.entries, opts.shinyUsage)) {
|
|
55
|
+
return project_kind_1.ProjectKind.ShinyApp;
|
|
56
|
+
}
|
|
57
|
+
if (signals.descriptionCount > 0) {
|
|
58
|
+
return project_kind_1.ProjectKind.Package;
|
|
59
|
+
}
|
|
60
|
+
if (signals.names.size === 0) {
|
|
61
|
+
return project_kind_1.ProjectKind.Unknown;
|
|
62
|
+
}
|
|
63
|
+
for (const name of signals.names) {
|
|
64
|
+
if (opts.notebookExtension.test(name)) {
|
|
65
|
+
return project_kind_1.ProjectKind.Notebook;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let rSources = 0;
|
|
69
|
+
for (const name of signals.names) {
|
|
70
|
+
if (name.endsWith('.r')) {
|
|
71
|
+
rSources++;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return rSources <= 1 ? project_kind_1.ProjectKind.Script : project_kind_1.ProjectKind.Project;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=classify-project-kind.js.map
|
|
@@ -102,6 +102,8 @@ export declare class FlowrAnalyzerContext implements ReadOnlyFlowrAnalyzerContex
|
|
|
102
102
|
* invalidated separately (see {@link FlowrAnalyzer.updateConfig}), as the results were computed under the old config.
|
|
103
103
|
*/
|
|
104
104
|
updateConfig(update: DeepPartial<FlowrConfig>): void;
|
|
105
|
+
/** Discards every {@link updateConfig} override made so far, reverting {@link config} back to {@link baseConfig} (specialized for the project kind). */
|
|
106
|
+
resetConfig(): void;
|
|
105
107
|
/** The project kind the effective {@link config} is specialized for, plus the overrides it applies, or `undefined` when no specialization is in effect. */
|
|
106
108
|
configSpecialization(): {
|
|
107
109
|
readonly kind: ProjectKind;
|
|
@@ -114,6 +114,12 @@ class FlowrAnalyzerContext {
|
|
|
114
114
|
throw e;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
/** Discards every {@link updateConfig} override made so far, reverting {@link config} back to {@link baseConfig} (specialized for the project kind). */
|
|
118
|
+
resetConfig() {
|
|
119
|
+
this.runtimeOverrides = undefined;
|
|
120
|
+
this._effective = undefined;
|
|
121
|
+
this._effectiveOf = undefined;
|
|
122
|
+
}
|
|
117
123
|
/** The project kind the effective {@link config} is specialized for, plus the overrides it applies, or `undefined` when no specialization is in effect. */
|
|
118
124
|
configSpecialization() {
|
|
119
125
|
if (this.baseConfig.specializeConfig === undefined || this._classifying) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractFlowrAnalyzerContext } from './abstract-flowr-analyzer-context';
|
|
2
2
|
import { FlowrAnalyzerPackageVersionsPlugin, type SigDbLoadedInfo } from '../plugins/package-version-plugins/flowr-analyzer-package-versions-plugin';
|
|
3
|
-
import
|
|
3
|
+
import { Package } from '../plugins/package-version-plugins/package';
|
|
4
4
|
import type { PackageSignatureSource } from '../sigdb/reader';
|
|
5
5
|
import { Identifier } from '../../dataflow/environments/identifier';
|
|
6
6
|
import type { DecodedFunction } from '../sigdb/decode';
|
|
@@ -22,10 +22,14 @@ export interface ReadOnlyFlowrAnalyzerDependenciesContext {
|
|
|
22
22
|
* Get the dependency with the given name, if it exists.
|
|
23
23
|
*
|
|
24
24
|
* If the static dependencies have not yet been loaded, this may trigger a resolution step.
|
|
25
|
-
*
|
|
25
|
+
* Pass `version` to pin the resolution to a constraint (an exact version string, or a {@link Range}; uncached;
|
|
26
|
+
* `versionOverrides` config still wins, base-R stays tied to the assumed R version); otherwise the version
|
|
27
|
+
* comes from the declared constraints.
|
|
28
|
+
* @param name - The name of the dependency to get.
|
|
29
|
+
* @param version - Optional version constraint to pin the resolution to (exact version string or a {@link Range}).
|
|
26
30
|
* @returns The dependency with the given name, or undefined if it does not exist.
|
|
27
31
|
*/
|
|
28
|
-
getDependency(name: string): Readonly<Package> | undefined;
|
|
32
|
+
getDependency(name: string, version?: string | Range): Readonly<Package> | undefined;
|
|
29
33
|
/**
|
|
30
34
|
* The versions a dependency can possibly have, combining everything declared for it (a `DESCRIPTION` range,
|
|
31
35
|
* an `rproject.toml` entry, a lockfile pin, ...). `undefined` if the dependency is unknown, if nothing
|
|
@@ -44,6 +48,17 @@ export interface ReadOnlyFlowrAnalyzerDependenciesContext {
|
|
|
44
48
|
* Metadata of the signature databases the version plugins currently have loaded.
|
|
45
49
|
*/
|
|
46
50
|
loadedSignatureDatabases(): SigDbLoadedInfo[];
|
|
51
|
+
/**
|
|
52
|
+
* The identifying names (scopes, e.g. `base`/`current`/`history`) of the signature databases currently
|
|
53
|
+
* available, deduplicated. A simple view over {@link loadedSignatureDatabases} for checking what a project
|
|
54
|
+
* can resolve against; empty when the signature database is disabled or none is loaded.
|
|
55
|
+
*/
|
|
56
|
+
availableSignatureDatabases(): readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* Whether at least one signature database is available (i.e., {@link availableSignatureDatabases} is non-empty).
|
|
59
|
+
* Cheaper than materializing the list when only the presence matters.
|
|
60
|
+
*/
|
|
61
|
+
hasSignatureDatabase(): boolean;
|
|
47
62
|
/**
|
|
48
63
|
* The names of known packages that export `name` (from the version plugins' signature databases). Used to
|
|
49
64
|
* hint which `library()`/`::` might be missing for an otherwise-undefined symbol. Empty if no database is
|
|
@@ -76,6 +91,8 @@ export declare class FlowrAnalyzerDependenciesContext extends AbstractFlowrAnaly
|
|
|
76
91
|
/** Register a resolver consulted by {@link getDependency} to fill in a package's exports lazily. */
|
|
77
92
|
addLazyResolver(resolver: (name: string, existing?: Package) => Package | undefined): void;
|
|
78
93
|
loadedSignatureDatabases(): SigDbLoadedInfo[];
|
|
94
|
+
availableSignatureDatabases(): readonly string[];
|
|
95
|
+
hasSignatureDatabase(): boolean;
|
|
79
96
|
packagesExporting(name: string): readonly string[];
|
|
80
97
|
signatureSources(): readonly PackageSignatureSource[];
|
|
81
98
|
signatureOf(id: Identifier, version?: string): DecodedFunction | undefined;
|
|
@@ -99,7 +116,9 @@ export declare class FlowrAnalyzerDependenciesContext extends AbstractFlowrAnaly
|
|
|
99
116
|
*/
|
|
100
117
|
addDeclaredDependency(pkg: Package): this;
|
|
101
118
|
addDependency(pkg: Package): this;
|
|
102
|
-
getDependency(name: string): Package | undefined;
|
|
119
|
+
getDependency(name: string, version?: string | Range): Package | undefined;
|
|
120
|
+
/** Resolve `name` constrained to `range` via the plugins (uncached); falls back to the cached dependency. */
|
|
121
|
+
private resolvePinnedDependency;
|
|
103
122
|
inferredVersion(name: string): Range | undefined;
|
|
104
123
|
getDependencies(): Package[];
|
|
105
124
|
}
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FlowrAnalyzerDependenciesContext = void 0;
|
|
4
4
|
const abstract_flowr_analyzer_context_1 = require("./abstract-flowr-analyzer-context");
|
|
5
5
|
const flowr_analyzer_package_versions_plugin_1 = require("../plugins/package-version-plugins/flowr-analyzer-package-versions-plugin");
|
|
6
|
+
const package_1 = require("../plugins/package-version-plugins/package");
|
|
6
7
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
7
8
|
const config_1 = require("../../config");
|
|
9
|
+
const r_version_1 = require("../../util/r-version");
|
|
8
10
|
/**
|
|
9
11
|
* Manages the project's dependencies, their versions, and their interplay with {@link FlowrAnalyzerPackageVersionsPlugin}s.
|
|
10
12
|
*/
|
|
@@ -32,6 +34,12 @@ class FlowrAnalyzerDependenciesContext extends abstract_flowr_analyzer_context_1
|
|
|
32
34
|
}
|
|
33
35
|
return this.plugins.flatMap(p => p.loadedDatabases());
|
|
34
36
|
}
|
|
37
|
+
availableSignatureDatabases() {
|
|
38
|
+
return [...new Set(this.loadedSignatureDatabases().map(d => d.scope))];
|
|
39
|
+
}
|
|
40
|
+
hasSignatureDatabase() {
|
|
41
|
+
return (0, config_1.isSigDbEnabled)(this.ctx.config) && this.plugins.some(p => p.loadedDatabases().length > 0);
|
|
42
|
+
}
|
|
35
43
|
packagesExporting(name) {
|
|
36
44
|
if (!(0, config_1.isSigDbEnabled)(this.ctx.config)) {
|
|
37
45
|
return [];
|
|
@@ -129,10 +137,13 @@ class FlowrAnalyzerDependenciesContext extends abstract_flowr_analyzer_context_1
|
|
|
129
137
|
}
|
|
130
138
|
return this;
|
|
131
139
|
}
|
|
132
|
-
getDependency(name) {
|
|
140
|
+
getDependency(name, version) {
|
|
133
141
|
if (!this.staticsLoaded) {
|
|
134
142
|
this.resolveStaticDependencies();
|
|
135
143
|
}
|
|
144
|
+
if (version !== undefined) {
|
|
145
|
+
return this.resolvePinnedDependency(name, typeof version === 'string' ? r_version_1.RRange.parse('=' + version) : version);
|
|
146
|
+
}
|
|
136
147
|
const existing = this.dependencies.get(name);
|
|
137
148
|
// a package already carrying exports is complete; a version-only one is still enriched below
|
|
138
149
|
if (existing?.namespaceInfo || (!existing && this.resolvedMisses.has(name))) {
|
|
@@ -150,6 +161,17 @@ class FlowrAnalyzerDependenciesContext extends abstract_flowr_analyzer_context_1
|
|
|
150
161
|
}
|
|
151
162
|
return existing;
|
|
152
163
|
}
|
|
164
|
+
/** Resolve `name` constrained to `range` via the plugins (uncached); falls back to the cached dependency. */
|
|
165
|
+
resolvePinnedDependency(name, range) {
|
|
166
|
+
const pin = new package_1.Package({ name, derivedVersion: range });
|
|
167
|
+
for (const resolve of this.lazyResolvers) {
|
|
168
|
+
const resolved = resolve(name, pin);
|
|
169
|
+
if (resolved) {
|
|
170
|
+
return resolved;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return this.getDependency(name);
|
|
174
|
+
}
|
|
153
175
|
inferredVersion(name) {
|
|
154
176
|
const pkg = this.getDependency(name);
|
|
155
177
|
return pkg?.hasSatisfiableVersion() ? pkg.derivedVersion : undefined;
|
|
@@ -8,7 +8,7 @@ import type { FlowrDescriptionFile } from '../plugins/file-plugins/files/flowr-d
|
|
|
8
8
|
import type { FlowrNewsFile } from '../plugins/file-plugins/files/flowr-news-file';
|
|
9
9
|
import type { FlowrNamespaceFile } from '../plugins/file-plugins/files/flowr-namespace-file';
|
|
10
10
|
import type { FlowrRProjectFile } from '../plugins/file-plugins/files/flowr-rproject-file';
|
|
11
|
-
import { ProjectKind } from './project-kind';
|
|
11
|
+
import type { ProjectKind } from './project-kind';
|
|
12
12
|
/**
|
|
13
13
|
* This is a request to process a folder as a project, which will be expanded by the registered {@link FlowrAnalyzerProjectDiscoveryPlugin}s.
|
|
14
14
|
*/
|
|
@@ -31,6 +31,7 @@ export type RoleBasedFiles = {
|
|
|
31
31
|
[FileRole.License]: FlowrFileProvider[];
|
|
32
32
|
[FileRole.VirtualEnv]: FlowrFileProvider[];
|
|
33
33
|
[FileRole.Startup]: FlowrFileProvider[];
|
|
34
|
+
[FileRole.Environment]: FlowrFileProvider[];
|
|
34
35
|
[FileRole.Source]: FlowrFileProvider[];
|
|
35
36
|
[FileRole.Data]: FlowrFileProvider[];
|
|
36
37
|
[FileRole.Other]: FlowrFileProvider[];
|
|
@@ -93,6 +94,8 @@ export interface ReadOnlyFlowrAnalyzerFilesContext {
|
|
|
93
94
|
* @returns The actual path of the file if it exists, otherwise `undefined`.
|
|
94
95
|
*/
|
|
95
96
|
exists(path: string, ignoreCase: boolean): string | undefined;
|
|
97
|
+
/** The project root folder (common directory of the requested roots), or `undefined` if none was requested. */
|
|
98
|
+
root(): string | undefined;
|
|
96
99
|
/**
|
|
97
100
|
* Until parsers support multiple request types from the virtual context system,
|
|
98
101
|
* we resolve their contents.
|
|
@@ -112,6 +115,11 @@ export interface ReadOnlyFlowrAnalyzerFilesContext {
|
|
|
112
115
|
* {@link ProjectKind.Unknown}. The result is cached and invalidated whenever the files change.
|
|
113
116
|
*/
|
|
114
117
|
projectKind(): ProjectKind;
|
|
118
|
+
/**
|
|
119
|
+
* The root paths that were requested for analysis: the folder for a project request, or the containing
|
|
120
|
+
* folder for a single-file request. Useful to report back which inputs did not resolve to anything.
|
|
121
|
+
*/
|
|
122
|
+
getRequestedRoots(): readonly string[];
|
|
115
123
|
}
|
|
116
124
|
/**
|
|
117
125
|
* This is the analyzer file context to be modified by all plugins that affect the files.
|
|
@@ -132,6 +140,8 @@ export declare class FlowrAnalyzerFilesContext extends AbstractFlowrAnalyzerCont
|
|
|
132
140
|
/** cached {@link projectKind}, invalidated whenever the files change (added or reset) */
|
|
133
141
|
private projectKindCache;
|
|
134
142
|
private requestedRoots;
|
|
143
|
+
/** directories already scanned by {@link discoverImplicitSources}, so a sibling implicit source is not re-triggered for every file added from it */
|
|
144
|
+
private implicitSourceDirs;
|
|
135
145
|
/** cached {@link root}, fixed on first use as the ids built from it have to stay stable */
|
|
136
146
|
private rootCache;
|
|
137
147
|
private rootResolved;
|
|
@@ -150,14 +160,8 @@ export declare class FlowrAnalyzerFilesContext extends AbstractFlowrAnalyzerCont
|
|
|
150
160
|
*/
|
|
151
161
|
consideredFilesList(): readonly string[];
|
|
152
162
|
projectKind(): ProjectKind;
|
|
163
|
+
getRequestedRoots(): readonly string[];
|
|
153
164
|
private classifyProject;
|
|
154
|
-
/**
|
|
155
|
-
* Whether the project is a shiny app: it has the canonical entry files (a single `app.R`, or the `ui.R`+`server.R`
|
|
156
|
-
* pair -- a lone `server.R` is not enough) and one of them actually loads or calls the shiny stack. The usage
|
|
157
|
-
* check keeps a coincidental `ui.R`/`server.R` pair from being mistaken for an app; only when none of the entry
|
|
158
|
-
* files can be read do we fall back to trusting the file names alone.
|
|
159
|
-
*/
|
|
160
|
-
private isShinyApp;
|
|
161
165
|
/**
|
|
162
166
|
* Add multiple requests to the context. This is just a convenience method that calls {@link addRequest} for each request.
|
|
163
167
|
*/
|
|
@@ -167,6 +171,12 @@ export declare class FlowrAnalyzerFilesContext extends AbstractFlowrAnalyzerCont
|
|
|
167
171
|
* User-registered discovery plugins replace the built-in default; if none are registered, the default runs.
|
|
168
172
|
*/
|
|
169
173
|
private addRequest;
|
|
174
|
+
/**
|
|
175
|
+
* A single-file request otherwise skips project discovery entirely, so a sibling `project.implicitSources`
|
|
176
|
+
* entry (e.g. a shiny app's `s.R` next to the analyzed `t.R`) would never be found. If `implicitSources` is
|
|
177
|
+
* configured, scan `fileContent`'s directory once and add whatever matches.
|
|
178
|
+
*/
|
|
179
|
+
private discoverImplicitSources;
|
|
170
180
|
/**
|
|
171
181
|
* Add multiple files to the context. This is just a convenience method that calls {@link addFile} for each file.
|
|
172
182
|
*/
|
|
@@ -14,17 +14,9 @@ const log_1 = require("../../util/log");
|
|
|
14
14
|
const fs_1 = __importDefault(require("fs"));
|
|
15
15
|
const path_1 = __importDefault(require("path"));
|
|
16
16
|
const files_1 = require("../../util/files");
|
|
17
|
-
const
|
|
17
|
+
const glob_1 = require("../../util/glob");
|
|
18
|
+
const classify_project_kind_1 = require("./classify-project-kind");
|
|
18
19
|
const fileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-files-context' });
|
|
19
|
-
const notebookExtension = /\.(ipynb|rmd|qmd|rnw)$/;
|
|
20
|
-
const shinyDescriptionTypes = new Set(['shiny', 'shiny-app', 'shinyapp']);
|
|
21
|
-
/** the (lower-cased) file names a shiny app is assembled from; the app is `app.r`, or the `ui.r`+`server.r` pair */
|
|
22
|
-
const shinyEntryFiles = new Set(['app.r', 'ui.r', 'server.r', 'global.r']);
|
|
23
|
-
/**
|
|
24
|
-
* Evidence that a file actually is part of a shiny app rather than just sharing a name: a load of the shiny stack
|
|
25
|
-
* or a call to one of its entry points. Kept broad enough to also catch `bslib`/`shinydashboard`/`golem` apps.
|
|
26
|
-
*/
|
|
27
|
-
const shinyUsage = /(?:library|require|requireNamespace|loadNamespace)\s*\(\s*['"]?(?:shiny|bslib|shinydashboard|shinyMobile|golem|flexdashboard)\b|\b(?:shinyApp|shinyServer|shinyUI|runApp|fluidPage|fluidRow|navbarPage|bootstrapPage|fillPage|dashboardPage|page_fluid|page_sidebar|page_navbar|pageWithSidebar)\s*\(/;
|
|
28
20
|
function wrapFile(file, roles) {
|
|
29
21
|
if (typeof file === 'string') {
|
|
30
22
|
return new flowr_file_1.FlowrTextFile(file, roles);
|
|
@@ -57,6 +49,8 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
|
|
|
57
49
|
/** cached {@link projectKind}, invalidated whenever the files change (added or reset) */
|
|
58
50
|
projectKindCache = undefined;
|
|
59
51
|
requestedRoots = [];
|
|
52
|
+
/** directories already scanned by {@link discoverImplicitSources}, so a sibling implicit source is not re-triggered for every file added from it */
|
|
53
|
+
implicitSourceDirs = new Set();
|
|
60
54
|
/** cached {@link root}, fixed on first use as the ids built from it have to stay stable */
|
|
61
55
|
rootCache = undefined;
|
|
62
56
|
rootResolved = false;
|
|
@@ -104,22 +98,30 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
|
|
|
104
98
|
return this.consideredFiles;
|
|
105
99
|
}
|
|
106
100
|
projectKind() {
|
|
107
|
-
return this.projectKindCache ??= this.classifyProject();
|
|
101
|
+
return this.projectKindCache ??= this.ctx.config.project.useProjectType ?? this.classifyProject();
|
|
102
|
+
}
|
|
103
|
+
getRequestedRoots() {
|
|
104
|
+
return this.requestedRoots;
|
|
108
105
|
}
|
|
109
106
|
classifyProject() {
|
|
107
|
+
const opts = (0, classify_project_kind_1.resolveClassifyOptions)(this.ctx.config.project.classification);
|
|
110
108
|
const descriptions = this.getFilesByRole(flowr_file_1.FileRole.Description);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
const reader = (f) => () => {
|
|
110
|
+
try {
|
|
111
|
+
return f.content().toString();
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
// the readable entry files by (lower-cased) name, plus every known file name for the coarser checks
|
|
116
118
|
const entries = new Map();
|
|
117
119
|
const names = new Set();
|
|
118
120
|
for (const f of this.getAllFiles()) {
|
|
119
121
|
const name = path_1.default.basename(f.path()).toLowerCase();
|
|
120
122
|
names.add(name);
|
|
121
|
-
if (shinyEntryFiles.has(name)) {
|
|
122
|
-
entries.set(name, f);
|
|
123
|
+
if (opts.shinyEntryFiles.has(name)) {
|
|
124
|
+
entries.set(name, reader(f));
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
const pending = this.loadingOrder.getUnorderedRequests()
|
|
@@ -127,57 +129,16 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
|
|
|
127
129
|
for (const p of [...pending, ...this.consideredFiles]) {
|
|
128
130
|
const name = path_1.default.basename(p).toLowerCase();
|
|
129
131
|
names.add(name);
|
|
130
|
-
if (shinyEntryFiles.has(name) && !entries.has(name)) {
|
|
131
|
-
entries.set(name, this.getFileByPath(p) ?? new flowr_file_1.FlowrTextFile(p));
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (this.isShinyApp(names, entries)) {
|
|
135
|
-
return project_kind_1.ProjectKind.ShinyApp;
|
|
136
|
-
}
|
|
137
|
-
if (descriptions.length > 0) {
|
|
138
|
-
return project_kind_1.ProjectKind.Package;
|
|
139
|
-
}
|
|
140
|
-
if (names.size === 0) {
|
|
141
|
-
return project_kind_1.ProjectKind.Unknown;
|
|
142
|
-
}
|
|
143
|
-
for (const name of names) {
|
|
144
|
-
if (notebookExtension.test(name)) {
|
|
145
|
-
return project_kind_1.ProjectKind.Notebook;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
let rSources = 0;
|
|
149
|
-
for (const name of names) {
|
|
150
|
-
if (name.endsWith('.r')) {
|
|
151
|
-
rSources++;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return rSources <= 1 ? project_kind_1.ProjectKind.Script : project_kind_1.ProjectKind.Project;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Whether the project is a shiny app: it has the canonical entry files (a single `app.R`, or the `ui.R`+`server.R`
|
|
158
|
-
* pair -- a lone `server.R` is not enough) and one of them actually loads or calls the shiny stack. The usage
|
|
159
|
-
* check keeps a coincidental `ui.R`/`server.R` pair from being mistaken for an app; only when none of the entry
|
|
160
|
-
* files can be read do we fall back to trusting the file names alone.
|
|
161
|
-
*/
|
|
162
|
-
isShinyApp(names, entries) {
|
|
163
|
-
if (!names.has('app.r') && !(names.has('ui.r') && names.has('server.r'))) {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
let couldRead = false;
|
|
167
|
-
for (const f of entries.values()) {
|
|
168
|
-
let content;
|
|
169
|
-
try {
|
|
170
|
-
content = f.content().toString();
|
|
171
|
-
}
|
|
172
|
-
catch {
|
|
173
|
-
continue;
|
|
174
|
-
}
|
|
175
|
-
couldRead = true;
|
|
176
|
-
if (shinyUsage.test(content)) {
|
|
177
|
-
return true;
|
|
132
|
+
if (opts.shinyEntryFiles.has(name) && !entries.has(name)) {
|
|
133
|
+
entries.set(name, reader(this.getFileByPath(p) ?? new flowr_file_1.FlowrTextFile(p)));
|
|
178
134
|
}
|
|
179
135
|
}
|
|
180
|
-
return
|
|
136
|
+
return (0, classify_project_kind_1.classifyProjectKind)({
|
|
137
|
+
names,
|
|
138
|
+
entries,
|
|
139
|
+
descriptionTypes: descriptions.map(d => d.type() ?? ''),
|
|
140
|
+
descriptionCount: descriptions.length
|
|
141
|
+
}, opts);
|
|
181
142
|
}
|
|
182
143
|
/**
|
|
183
144
|
* Add multiple requests to the context. This is just a convenience method that calls {@link addRequest} for each request.
|
|
@@ -195,6 +156,7 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
|
|
|
195
156
|
if (request.request !== 'project') {
|
|
196
157
|
if (request.request === 'file') {
|
|
197
158
|
this.requestedRoots.push(path_1.default.dirname(request.content));
|
|
159
|
+
this.discoverImplicitSources(request.content);
|
|
198
160
|
}
|
|
199
161
|
this.loadingOrder.addRequest(request);
|
|
200
162
|
this.projectKindCache = undefined;
|
|
@@ -214,6 +176,41 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
|
|
|
214
176
|
}
|
|
215
177
|
}
|
|
216
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* A single-file request otherwise skips project discovery entirely, so a sibling `project.implicitSources`
|
|
181
|
+
* entry (e.g. a shiny app's `s.R` next to the analyzed `t.R`) would never be found. If `implicitSources` is
|
|
182
|
+
* configured, scan `fileContent`'s directory once and add whatever matches.
|
|
183
|
+
*/
|
|
184
|
+
discoverImplicitSources(fileContent) {
|
|
185
|
+
const implicit = this.ctx.config.project.implicitSources;
|
|
186
|
+
if (!implicit || implicit.length === 0) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const dir = path_1.default.dirname(fileContent);
|
|
190
|
+
if (this.implicitSourceDirs.has(dir)) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.implicitSourceDirs.add(dir);
|
|
194
|
+
if (!fs_1.default.existsSync(dir) || !fs_1.default.statSync(dir).isDirectory()) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const matchers = implicit.map(entry => (0, glob_1.globMatcher)(entry));
|
|
198
|
+
const active = this.discoveryPlugins.length > 0
|
|
199
|
+
? this.discoveryPlugins
|
|
200
|
+
: [flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin()];
|
|
201
|
+
for (const req of active.flatMap(p => p.processor(this.ctx, { request: 'project', content: dir }))) {
|
|
202
|
+
const filePath = (0, retriever_1.isParseRequest)(req) ? (req.request === 'file' ? req.content : undefined) : req.path();
|
|
203
|
+
if (filePath === undefined || filePath === fileContent || !matchers.some(m => m(filePath))) {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if ((0, retriever_1.isParseRequest)(req)) {
|
|
207
|
+
this.addRequest(req);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.addFile(req, req.roles);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
217
214
|
/**
|
|
218
215
|
* Add multiple files to the context. This is just a convenience method that calls {@link addFile} for each file.
|
|
219
216
|
*/
|
|
@@ -293,7 +290,8 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
|
|
|
293
290
|
}
|
|
294
291
|
return undefined;
|
|
295
292
|
}
|
|
296
|
-
catch {
|
|
293
|
+
catch (e) {
|
|
294
|
+
fileLog.warn(`Could not resolve '${p}': ${e instanceof Error ? e.message : String(e)}`);
|
|
297
295
|
return undefined;
|
|
298
296
|
}
|
|
299
297
|
}
|
|
@@ -39,6 +39,11 @@ export declare enum FileRole {
|
|
|
39
39
|
* These commonly bootstrap a package manager, e.g. by sourcing `packrat/init.R` or `renv/activate.R`.
|
|
40
40
|
*/
|
|
41
41
|
Startup = "startup",
|
|
42
|
+
/**
|
|
43
|
+
* Environment-variable definitions read at startup (`.Renviron`, `Renviron.site`). These are `KEY=value`
|
|
44
|
+
* files, not R source, so they are labeled but not parsed as R.
|
|
45
|
+
*/
|
|
46
|
+
Environment = "environment",
|
|
42
47
|
/**
|
|
43
48
|
* Catch-all for any file that provides usable R source code to incorporate into the analysis.
|
|
44
49
|
* Please note, that the loading order/inclusion and even potential relevance of these source files
|
|
@@ -40,6 +40,11 @@ var FileRole;
|
|
|
40
40
|
* These commonly bootstrap a package manager, e.g. by sourcing `packrat/init.R` or `renv/activate.R`.
|
|
41
41
|
*/
|
|
42
42
|
FileRole["Startup"] = "startup";
|
|
43
|
+
/**
|
|
44
|
+
* Environment-variable definitions read at startup (`.Renviron`, `Renviron.site`). These are `KEY=value`
|
|
45
|
+
* files, not R source, so they are labeled but not parsed as R.
|
|
46
|
+
*/
|
|
47
|
+
FileRole["Environment"] = "environment";
|
|
43
48
|
/**
|
|
44
49
|
* Catch-all for any file that provides usable R source code to incorporate into the analysis.
|
|
45
50
|
* Please note, that the loading order/inclusion and even potential relevance of these source files
|
|
@@ -142,11 +142,13 @@ export interface CountFactor {
|
|
|
142
142
|
export declare function countRunnableCombinations(hub: CountFactor | undefined, others: readonly CountFactor[]): number;
|
|
143
143
|
/** whether every requirement `pkg@ver` places on a co-guessed dependency is met by one of that partner's surviving versions */
|
|
144
144
|
export declare function versionMeetsPartners(src: PackageSignatureSource, pkg: string, ver: string, partnerSurvivors: ReadonlyMap<string, readonly string[]>, selfName: string, onReject?: (partner: string, constraint: string) => void): boolean;
|
|
145
|
+
/** an empty set, shared so callers that do not disable anything need not allocate one */
|
|
146
|
+
export declare const NoDisabledSources: ReadonlySet<ConstraintSource>;
|
|
145
147
|
/**
|
|
146
148
|
* Apply every constraint (declared, transitive, base-R, date, then signature usage) to a package's timeline. When an
|
|
147
149
|
* `observe` callback is given, emits the provenance of each constraint (including the signature lower bounds).
|
|
148
150
|
*/
|
|
149
|
-
export declare function survivingEntries(name: string, src: PackageSignatureSource | undefined, deps: ReadOnlyFlowrAnalyzerDependenciesContext, usage: PackageUsage | undefined, transitive: readonly TransitiveConstraint[], cutoff: Date | undefined, rVersion: string | undefined, observe?: ConstraintObserver,
|
|
151
|
+
export declare function survivingEntries(name: string, src: PackageSignatureSource | undefined, deps: ReadOnlyFlowrAnalyzerDependenciesContext, usage: PackageUsage | undefined, transitive: readonly TransitiveConstraint[], cutoff: Date | undefined, rVersion: string | undefined, observe?: ConstraintObserver, disabled?: ReadonlySet<ConstraintSource>, packageKey?: string): SurvivingEntries;
|
|
150
152
|
/** the sigdb package a target's version history is drawn from: `R` reuses `base` (their releases coincide), everything else is itself */
|
|
151
153
|
export declare function timelinePackageKey(name: string, sources: readonly PackageSignatureSource[]): string;
|
|
152
154
|
/** the ordered candidate list for one package, or `undefined` when nothing survives (shared by the query and the iterator) */
|