@eagleoutice/flowr 2.12.3 → 2.13.0
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 +38 -91
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +3 -3
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -6
- package/abstract-interpretation/data-frame/semantics.js +12 -16
- package/abstract-interpretation/domains/abstract-domain.d.ts +46 -44
- package/abstract-interpretation/domains/abstract-domain.js +146 -6
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +16 -25
- package/abstract-interpretation/domains/bounded-set-domain.js +22 -69
- package/abstract-interpretation/domains/interval-domain.d.ts +27 -36
- package/abstract-interpretation/domains/interval-domain.js +111 -146
- package/abstract-interpretation/domains/lattice.d.ts +3 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +3 -3
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -19
- package/abstract-interpretation/domains/partial-product-domain.js +21 -54
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +8 -12
- package/abstract-interpretation/domains/positive-interval-domain.js +21 -50
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/product-domain.js +4 -4
- package/abstract-interpretation/domains/set-range-domain.d.ts +60 -56
- package/abstract-interpretation/domains/set-range-domain.js +141 -200
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +17 -23
- package/abstract-interpretation/domains/set-upper-bound-domain.js +59 -103
- package/abstract-interpretation/domains/singleton-domain.d.ts +15 -18
- package/abstract-interpretation/domains/singleton-domain.js +33 -72
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +12 -16
- package/abstract-interpretation/domains/state-abstract-domain.js +36 -126
- package/abstract-interpretation/domains/state-domain-like.d.ts +2 -2
- package/abstract-interpretation/domains/value-abstract-domain.d.ts +120 -0
- package/abstract-interpretation/domains/{satisfiable-domain.js → value-abstract-domain.js} +14 -2
- package/benchmark/slicer.d.ts +2 -2
- package/benchmark/slicer.js +6 -5
- 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-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +5 -0
- package/cli/flowr.d.ts +5 -0
- package/cli/flowr.js +15 -7
- package/cli/repl/commands/repl-query.js +42 -20
- package/cli/repl/commands/repl-signature.js +2 -2
- package/cli/repl/core.d.ts +14 -5
- package/cli/repl/core.js +32 -17
- package/cli/repl/parser/slice-query-parser.d.ts +69 -8
- package/cli/repl/parser/slice-query-parser.js +82 -13
- package/cli/repl/path-input.d.ts +6 -0
- package/cli/repl/path-input.js +41 -0
- package/cli/repl/print-version.js +3 -5
- package/cli/slicer-app.d.ts +2 -0
- package/cli/slicer-app.js +2 -1
- package/config.d.ts +54 -6
- package/config.js +133 -12
- package/control-flow/control-flow-graph.d.ts +3 -2
- package/control-flow/control-flow-graph.js +34 -14
- package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
- package/control-flow/semantic-cfg-guided-visitor.js +3 -0
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/data/sigdb/sigdb.remote.json +53 -53
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in.d.ts +2 -0
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +3 -5
- package/dataflow/environments/default-builtin-config.js +2 -2
- package/dataflow/environments/environment.d.ts +9 -0
- package/dataflow/environments/environment.js +28 -7
- package/dataflow/environments/identifier.d.ts +1 -2
- package/dataflow/environments/identifier.js +1 -5
- package/dataflow/extractor.js +1 -2
- package/dataflow/graph/dataflowgraph-builder.js +42 -3
- package/dataflow/graph/df-helper.d.ts +15 -0
- package/dataflow/graph/df-helper.js +20 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
- package/documentation/data/faq/faqs.js +12 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-files.d.ts +2 -2
- package/documentation/doc-util/doc-files.js +4 -7
- package/documentation/doc-util/doc-query.d.ts +12 -9
- package/documentation/doc-util/doc-query.js +63 -28
- package/documentation/wiki-absint.js +1 -4
- package/documentation/wiki-analyzer.js +8 -3
- package/documentation/wiki-cfg.js +3 -2
- package/documentation/wiki-dataflow-graph.js +14 -4
- package/documentation/wiki-interface.js +29 -16
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-query.js +189 -30
- package/documentation/wiki-signature-database.d.ts +1 -1
- package/documentation/wiki-signature-database.js +53 -27
- package/linter/linter-output.d.ts +24 -0
- package/linter/linter-output.js +117 -0
- package/linter/linter-rules.d.ts +2 -4
- package/linter/rules/dataframe-access-validation.js +4 -4
- package/linter/rules/deprecated-functions.d.ts +2 -4
- package/linter/rules/deprecated-functions.js +58 -3
- package/linter/rules/undefined-symbol.js +18 -10
- package/linter/rules/unused-definition.js +24 -0
- package/package.json +5 -2
- package/project/context/flowr-analyzer-context.d.ts +59 -1
- package/project/context/flowr-analyzer-context.js +118 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
- package/project/context/flowr-analyzer-dependencies-context.js +33 -3
- package/project/context/flowr-analyzer-files-context.d.ts +32 -0
- package/project/context/flowr-analyzer-files-context.js +132 -14
- package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
- package/project/context/flowr-analyzer-loading-order-context.js +20 -0
- package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
- package/project/context/flowr-analyzer-meta-context.js +64 -23
- package/project/context/flowr-file.d.ts +7 -0
- package/project/context/flowr-file.js +7 -0
- package/project/context/project-kind.d.ts +22 -0
- package/project/context/project-kind.js +27 -0
- package/project/dependency-version-space.d.ts +166 -0
- package/project/dependency-version-space.js +564 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/flowr-analyzer.d.ts +4 -0
- package/project/flowr-analyzer.js +5 -0
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
- package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
- package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
- package/project/plugins/flowr-analyzer-plugin.js +5 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
- package/project/plugins/package-version-plugins/package.d.ts +4 -1
- package/project/plugins/package-version-plugins/package.js +8 -5
- package/project/plugins/plugin-registry.d.ts +11 -3
- package/project/plugins/plugin-registry.js +24 -5
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
- package/project/sigdb/build.js +12 -2
- package/project/sigdb/decode.d.ts +7 -0
- package/project/sigdb/decode.js +35 -4
- package/project/sigdb/decompress.d.ts +2 -0
- package/project/sigdb/decompress.js +5 -0
- package/project/sigdb/manifest.d.ts +5 -0
- package/project/sigdb/manifest.js +37 -6
- package/project/sigdb/reader.d.ts +82 -2
- package/project/sigdb/reader.js +226 -14
- package/project/sigdb/schema.d.ts +31 -5
- package/project/sigdb/schema.js +7 -3
- package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
- package/project/sigdb/sigdb-version.js +119 -0
- package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
- package/queries/catalog/absint-query/absint-query-format.js +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
- package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
- package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
- package/queries/catalog/config-query/config-query-executor.js +15 -6
- package/queries/catalog/config-query/config-query-format.d.ts +18 -4
- package/queries/catalog/config-query/config-query-format.js +246 -96
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
- package/queries/catalog/dice-query/dice-query-executor.js +6 -9
- package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
- package/queries/catalog/dice-query/dice-query-format.js +10 -6
- package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
- package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
- package/queries/catalog/files-query/files-query-format.d.ts +2 -0
- package/queries/catalog/files-query/files-query-format.js +2 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +277 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +119 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +331 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
- package/queries/catalog/linter-query/linter-query-executor.js +11 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
- package/queries/catalog/linter-query/linter-query-format.js +44 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +2 -0
- package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
- package/queries/catalog/project-query/project-query-executor.js +19 -62
- package/queries/catalog/project-query/project-query-format.d.ts +7 -18
- package/queries/catalog/project-query/project-query-format.js +3 -18
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
- package/queries/catalog/search-query/search-query-format.d.ts +1 -0
- package/queries/catalog/search-query/search-query-format.js +1 -0
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
- package/queries/catalog/signature-query/signature-query-executor.js +267 -57
- package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
- package/queries/catalog/signature-query/signature-query-format.js +41 -5
- package/queries/catalog/signature-query/signature-query-render.js +48 -6
- package/queries/catalog/slice-query-options.d.ts +49 -0
- package/queries/catalog/slice-query-options.js +50 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
- package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
- package/queries/query-print.js +3 -1
- package/queries/query.d.ts +63 -3
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +16 -0
- package/r-bridge/data/data.js +20 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
- package/reconstruct/reconstruct.d.ts +18 -1
- package/reconstruct/reconstruct.js +42 -19
- package/slicing/criterion/parse.d.ts +4 -0
- package/slicing/criterion/parse.js +4 -0
- package/slicing/static/slice-call.js +17 -9
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +5 -4
- package/util/files.d.ts +19 -1
- package/util/files.js +45 -3
- package/util/glob.d.ts +19 -0
- package/util/glob.js +67 -0
- package/util/log.d.ts +12 -0
- package/util/log.js +17 -1
- package/util/logic.d.ts +6 -0
- package/util/logic.js +31 -1
- package/util/mermaid/dfg.js +17 -12
- package/util/mermaid/mermaid.js +2 -2
- package/util/objects.d.ts +5 -0
- package/util/objects.js +8 -0
- package/util/r-version.d.ts +9 -1
- package/util/r-version.js +27 -2
- package/util/schema.d.ts +16 -0
- package/util/schema.js +89 -4
- package/util/text/ansi.d.ts +4 -0
- package/util/text/ansi.js +27 -3
- package/util/text/strings.d.ts +9 -0
- package/util/text/strings.js +29 -0
- package/util/version.js +79 -6
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
- package/project/sigdb/version.js +0 -55
package/util/objects.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isObjectOrArray = isObjectOrArray;
|
|
4
|
+
exports.isPlainObject = isPlainObject;
|
|
4
5
|
exports.deepMergeObject = deepMergeObject;
|
|
5
6
|
exports.deepMergeObjectInPlace = deepMergeObjectInPlace;
|
|
6
7
|
exports.compactRecord = compactRecord;
|
|
@@ -14,6 +15,13 @@ const log_1 = require("./log");
|
|
|
14
15
|
function isObjectOrArray(item) {
|
|
15
16
|
return typeof item === 'object';
|
|
16
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* checks if `item` is a record with keys, i.e. an object that is neither `null` nor an array
|
|
20
|
+
* @see {@link isObjectOrArray} to allow arrays as well
|
|
21
|
+
*/
|
|
22
|
+
function isPlainObject(item) {
|
|
23
|
+
return typeof item === 'object' && item !== null && !Array.isArray(item);
|
|
24
|
+
}
|
|
17
25
|
function deepMergeObject(base, addon) {
|
|
18
26
|
if (!base) {
|
|
19
27
|
return addon;
|
package/util/r-version.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Range, SemVer } from 'semver';
|
|
2
|
+
/**
|
|
3
|
+
* A version written as its source string (e.g. `1.5-8`, `4.3.0`), as it appears in a `DESCRIPTION`, the signature
|
|
4
|
+
* database, or a bound. Distinct from a parsed {@link RVersion}: use {@link RVersion.parse}/{@link RVersion.compare}
|
|
5
|
+
* to order these. An alias for `string` that documents intent -- prefer it over a bare `string` for version values.
|
|
6
|
+
*/
|
|
7
|
+
export type VersionString = string;
|
|
2
8
|
/** A parsed R package version: a comparable {@link SemVer} that also keeps its original string as `.str`. */
|
|
3
9
|
export type RVersion = SemVer & {
|
|
4
10
|
str: string;
|
|
@@ -17,7 +23,7 @@ export declare const RVersion: {
|
|
|
17
23
|
* numerically, shorter versions padded with zeros (`0.4-9 < 0.4.10 < 1.0`). Negative/zero/positive for
|
|
18
24
|
* `a` less than/equal to/greater than `b`.
|
|
19
25
|
*/
|
|
20
|
-
readonly compare: (this: void, a: string, b: string) => number;
|
|
26
|
+
readonly compare: (this: void, a: string | undefined, b: string | undefined) => number;
|
|
21
27
|
/**
|
|
22
28
|
* Like {@link parse} but never undefined: a truly un-coercible version sorts as `0.0.0` while keeping its
|
|
23
29
|
* original string as `.str`, so it stays usable as a sort key.
|
|
@@ -27,6 +33,8 @@ export declare const RVersion: {
|
|
|
27
33
|
/** The highest of some version strings by R's `numeric_version` order (`0.9.0 < 0.10.0`); undefined if none. */
|
|
28
34
|
readonly highest: (this: void, versions: Iterable<string>) => string | undefined;
|
|
29
35
|
};
|
|
36
|
+
/** the release date of an R version, matched by its `major.minor`, or `undefined` for versions older than the table */
|
|
37
|
+
export declare function rReleaseDate(version: string): Date | undefined;
|
|
30
38
|
/** Helpers for R package version ranges (DESCRIPTION constraints like `>= 0.4-9`). */
|
|
31
39
|
export declare const RRange: {
|
|
32
40
|
/**
|
package/util/r-version.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RRange = exports.RVersion = void 0;
|
|
4
|
+
exports.rReleaseDate = rReleaseDate;
|
|
4
5
|
const semver_1 = require("semver");
|
|
5
6
|
function makeVersion(version, original) {
|
|
6
7
|
const semver = new semver_1.SemVer(version);
|
|
@@ -28,8 +29,15 @@ function normalizeVersion(version) {
|
|
|
28
29
|
comparator = comparatorMatch[1].replace('==', '=');
|
|
29
30
|
version = version.slice(comparatorMatch[1].length).trim();
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
// R separates version components by `.` or `-` alike (`7.3-65` is `7.3.65`, and above `7.3.0`), so a numeric
|
|
33
|
+
// part is a component wherever it stands; only a non-numeric tail is a SemVer pre-release
|
|
34
|
+
const parts = version.split(/[.-]/).filter(p => p.length > 0);
|
|
35
|
+
let numeric = 0;
|
|
36
|
+
while (numeric < parts.length && /^\d+$/.test(parts[numeric])) {
|
|
37
|
+
numeric++;
|
|
38
|
+
}
|
|
39
|
+
const mainVersionParts = parts.slice(0, numeric);
|
|
40
|
+
const preReleaseParts = parts.slice(numeric);
|
|
33
41
|
if (mainVersionParts.length > 3) {
|
|
34
42
|
const newPreReleasePart = mainVersionParts.splice(3).join('.');
|
|
35
43
|
preReleaseParts.unshift(newPreReleasePart);
|
|
@@ -98,6 +106,10 @@ exports.RVersion = {
|
|
|
98
106
|
* `a` less than/equal to/greater than `b`.
|
|
99
107
|
*/
|
|
100
108
|
compare(a, b) {
|
|
109
|
+
// an absent version sorts below any concrete one (so ascending order puts `undefined` first, descending last)
|
|
110
|
+
if (a === undefined || b === undefined) {
|
|
111
|
+
return a === b ? 0 : a === undefined ? -1 : 1;
|
|
112
|
+
}
|
|
101
113
|
const pa = a.split(/[.-]/), pb = b.split(/[.-]/);
|
|
102
114
|
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
103
115
|
const x = Number(pa[i] ?? 0) || 0, y = Number(pb[i] ?? 0) || 0;
|
|
@@ -132,6 +144,19 @@ exports.RVersion = {
|
|
|
132
144
|
return best;
|
|
133
145
|
}
|
|
134
146
|
};
|
|
147
|
+
/** release dates of R minor versions (`major.minor`); base R is stored undated in the sigdb, so this date-bounds it */
|
|
148
|
+
const RReleaseDates = {
|
|
149
|
+
'4.5': '2025-04-11', '4.4': '2024-04-24', '4.3': '2023-04-21', '4.2': '2022-04-22',
|
|
150
|
+
'4.1': '2021-05-18', '4.0': '2020-04-24', '3.6': '2019-04-26', '3.5': '2018-04-23',
|
|
151
|
+
'3.4': '2017-04-21', '3.3': '2016-05-03', '3.2': '2015-04-16', '3.1': '2014-04-10',
|
|
152
|
+
'3.0': '2013-04-03', '2.15': '2012-03-30', '2.14': '2011-10-31', '2.13': '2011-04-13'
|
|
153
|
+
};
|
|
154
|
+
/** the release date of an R version, matched by its `major.minor`, or `undefined` for versions older than the table */
|
|
155
|
+
function rReleaseDate(version) {
|
|
156
|
+
const m = /^(\d+)\.(\d+)/.exec(version);
|
|
157
|
+
const iso = m ? RReleaseDates[`${m[1]}.${m[2]}`] : undefined;
|
|
158
|
+
return iso ? new Date(iso) : undefined;
|
|
159
|
+
}
|
|
135
160
|
/** Helpers for R package version ranges (DESCRIPTION constraints like `>= 0.4-9`). */
|
|
136
161
|
exports.RRange = {
|
|
137
162
|
/**
|
package/util/schema.d.ts
CHANGED
|
@@ -14,6 +14,22 @@ export interface SchemaPathInfo {
|
|
|
14
14
|
export declare function descriptionPathInfo(description: Joi.Description, path: readonly string[]): SchemaPathInfo;
|
|
15
15
|
/** {@link descriptionPathInfo} straight from a schema (describes it once per call) */
|
|
16
16
|
export declare function schemaPathInfo(schema: Joi.Schema, path: readonly string[]): SchemaPathInfo;
|
|
17
|
+
/**
|
|
18
|
+
* The first path segment the schema does not accept, with the keys that ARE accepted there and the path to that
|
|
19
|
+
* point -- or `undefined` when the whole path is a settable key. Used to reject typo'd config keys. A `.pattern()`
|
|
20
|
+
* object accepts any key (validation continues into its value schema) and an `.unknown(true)` object (e.g. a
|
|
21
|
+
* `specializeConfig` entry, which may overwrite any config key) accepts any key, so neither is reported as unknown.
|
|
22
|
+
*/
|
|
23
|
+
export declare function firstUnknownSchemaSegment(description: Joi.Description, path: readonly string[]): {
|
|
24
|
+
readonly segment: string;
|
|
25
|
+
readonly available: readonly string[];
|
|
26
|
+
readonly at: readonly string[];
|
|
27
|
+
} | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The keys a schema {@link Joi.Description|description} offers below `path`, i.e. every option that may be set there.
|
|
30
|
+
* In contrast to the keys of a value, this covers the optional ones that are unset as well.
|
|
31
|
+
*/
|
|
32
|
+
export declare function descriptionPathKeys(description: Joi.Description, path: readonly string[]): string[];
|
|
17
33
|
/**
|
|
18
34
|
* Describes a Joi schema in a human-readable way.
|
|
19
35
|
*/
|
package/util/schema.js
CHANGED
|
@@ -2,20 +2,51 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.descriptionPathInfo = descriptionPathInfo;
|
|
4
4
|
exports.schemaPathInfo = schemaPathInfo;
|
|
5
|
+
exports.firstUnknownSchemaSegment = firstUnknownSchemaSegment;
|
|
6
|
+
exports.descriptionPathKeys = descriptionPathKeys;
|
|
5
7
|
exports.describeSchema = describeSchema;
|
|
6
8
|
exports.genericDescription = genericDescription;
|
|
7
9
|
exports.headerLine = headerLine;
|
|
8
10
|
exports.describeObject = describeObject;
|
|
9
11
|
const ansi_1 = require("./text/ansi");
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* A `.pattern()` object (`versionOverrides`, `specializeConfig`, ...) as `{ value, keyValids? }`: the value schema
|
|
14
|
+
* any key maps to, plus the keys the pattern restricts to when its key schema is a `.valid(...)` enum (e.g.
|
|
15
|
+
* `specializeConfig`'s ProjectKinds); `keyValids` is absent for a free-string key. `undefined` when not a pattern
|
|
16
|
+
* object. Only the first pattern is considered -- the config schema uses a single pattern per object.
|
|
17
|
+
*/
|
|
18
|
+
function patternObject(node) {
|
|
19
|
+
const patterns = node?.patterns;
|
|
20
|
+
if (!patterns || patterns.length === 0) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const allow = patterns[0].schema?.allow;
|
|
24
|
+
return allow && allow.length > 0 ? { value: patterns[0].rule, keyValids: allow } : { value: patterns[0].rule };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Descend one key into a Joi {@link Joi.Description|description}: an explicit sub-key, or -- for a `.pattern()`
|
|
28
|
+
* object -- the {@link patternObject|pattern's value schema}, since any key matches there.
|
|
29
|
+
*/
|
|
30
|
+
function descendDescription(node, key) {
|
|
31
|
+
return node?.keys?.[key] ?? patternObject(node)?.value;
|
|
32
|
+
}
|
|
33
|
+
/** walk a Joi schema {@link Joi.Description|description} down a key path (see {@link descendDescription}) */
|
|
34
|
+
function descendDescriptionPath(description, path) {
|
|
12
35
|
let node = description;
|
|
13
36
|
for (const key of path) {
|
|
14
|
-
node = node
|
|
37
|
+
node = descendDescription(node, key);
|
|
15
38
|
if (node === undefined) {
|
|
16
|
-
return
|
|
39
|
+
return undefined;
|
|
17
40
|
}
|
|
18
41
|
}
|
|
42
|
+
return node;
|
|
43
|
+
}
|
|
44
|
+
/** walk a Joi schema {@link Joi.Description|description} down a key path, returning the leaf's {@link SchemaPathInfo} (empty if the path does not exist) */
|
|
45
|
+
function descriptionPathInfo(description, path) {
|
|
46
|
+
const node = descendDescriptionPath(description, path);
|
|
47
|
+
if (node === undefined) {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
19
50
|
const allow = node.allow;
|
|
20
51
|
return {
|
|
21
52
|
type: node.type,
|
|
@@ -27,6 +58,60 @@ function descriptionPathInfo(description, path) {
|
|
|
27
58
|
function schemaPathInfo(schema, path) {
|
|
28
59
|
return descriptionPathInfo(schema.describe(), path);
|
|
29
60
|
}
|
|
61
|
+
/** Joi types that cannot have sub-keys, so a config path may not descend into them. */
|
|
62
|
+
const ScalarSchemaTypes = new Set(['boolean', 'number', 'string', 'array', 'date', 'binary', 'symbol', 'function']);
|
|
63
|
+
/**
|
|
64
|
+
* The first path segment the schema does not accept, with the keys that ARE accepted there and the path to that
|
|
65
|
+
* point -- or `undefined` when the whole path is a settable key. Used to reject typo'd config keys. A `.pattern()`
|
|
66
|
+
* object accepts any key (validation continues into its value schema) and an `.unknown(true)` object (e.g. a
|
|
67
|
+
* `specializeConfig` entry, which may overwrite any config key) accepts any key, so neither is reported as unknown.
|
|
68
|
+
*/
|
|
69
|
+
function firstUnknownSchemaSegment(description, path) {
|
|
70
|
+
let node = description;
|
|
71
|
+
for (let i = 0; i < path.length; i++) {
|
|
72
|
+
const explicit = node?.keys?.[path[i]];
|
|
73
|
+
if (explicit === undefined) {
|
|
74
|
+
const pattern = patternObject(node);
|
|
75
|
+
if (pattern !== undefined) {
|
|
76
|
+
if (pattern.keyValids !== undefined && !pattern.keyValids.includes(path[i])) {
|
|
77
|
+
return { segment: path[i], available: pattern.keyValids.map(v => String(v)), at: path.slice(0, i) };
|
|
78
|
+
}
|
|
79
|
+
node = pattern.value;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (node?.flags?.['unknown'] === true) {
|
|
84
|
+
return undefined; // `.unknown(true)`: any further key is accepted here
|
|
85
|
+
}
|
|
86
|
+
const keys = node?.keys;
|
|
87
|
+
if (keys === undefined) {
|
|
88
|
+
if (node?.type !== undefined && ScalarSchemaTypes.has(node.type)) {
|
|
89
|
+
return { segment: path[i], available: [], at: path.slice(0, i) };
|
|
90
|
+
}
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
const next = keys[path[i]];
|
|
94
|
+
if (next === undefined) {
|
|
95
|
+
return { segment: path[i], available: Object.keys(keys), at: path.slice(0, i) };
|
|
96
|
+
}
|
|
97
|
+
node = next;
|
|
98
|
+
}
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The keys a schema {@link Joi.Description|description} offers below `path`, i.e. every option that may be set there.
|
|
103
|
+
* In contrast to the keys of a value, this covers the optional ones that are unset as well.
|
|
104
|
+
*/
|
|
105
|
+
function descriptionPathKeys(description, path) {
|
|
106
|
+
const node = descendDescriptionPath(description, path);
|
|
107
|
+
if (node === undefined) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
const keys = Object.keys((node.keys ?? {}));
|
|
111
|
+
// a `.pattern()` object declares no keys, but a `.valid(...)` key schema restricts them to a known set
|
|
112
|
+
const valids = patternObject(node)?.keyValids?.map(v => String(v)) ?? [];
|
|
113
|
+
return [...keys, ...valids.filter(v => !keys.includes(v))];
|
|
114
|
+
}
|
|
30
115
|
/**
|
|
31
116
|
* Describes a Joi schema in a human-readable way.
|
|
32
117
|
*/
|
package/util/text/ansi.d.ts
CHANGED
|
@@ -52,11 +52,15 @@ export declare function color(s: string, c: Colors, f?: OutputFormatter, opts?:
|
|
|
52
52
|
bright?: boolean;
|
|
53
53
|
style?: FontStyles | readonly FontStyles[];
|
|
54
54
|
}): string;
|
|
55
|
+
/** Faint/dim ("grayed out") text. */
|
|
56
|
+
export declare function faint(s: string, f?: OutputFormatter, options?: FormatOptions): string;
|
|
55
57
|
/**
|
|
56
58
|
* This does not work if the {@link setFormatter|formatter} is void. Tries to format the text as informational message.
|
|
57
59
|
*/
|
|
58
60
|
export declare function ansiInfo(s: string, f?: OutputFormatter): string;
|
|
59
61
|
export declare const escape = "\u001B[";
|
|
62
|
+
/** best-effort, env-based OSC 8 hyperlink support (`FORCE_HYPERLINK`/`NO_HYPERLINK` override; unknown terminals are treated as unsupported) */
|
|
63
|
+
export declare function supportsHyperlinks(): boolean;
|
|
60
64
|
export declare const ansiFormatter: {
|
|
61
65
|
reset(): string;
|
|
62
66
|
hyperlink(text: string, url: string): string;
|
package/util/text/ansi.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.formatter = exports.ansiFormatter = exports.escape = exports.markdownFor
|
|
|
4
4
|
exports.italic = italic;
|
|
5
5
|
exports.bold = bold;
|
|
6
6
|
exports.color = color;
|
|
7
|
+
exports.faint = faint;
|
|
7
8
|
exports.ansiInfo = ansiInfo;
|
|
9
|
+
exports.supportsHyperlinks = supportsHyperlinks;
|
|
8
10
|
exports.setFormatter = setFormatter;
|
|
9
11
|
// noinspection JSUnusedGlobalSymbols
|
|
10
12
|
var ColorEffect;
|
|
@@ -32,7 +34,7 @@ exports.markdownFormatter = new class {
|
|
|
32
34
|
if (options.style === 1 /* FontStyles.Bold */) {
|
|
33
35
|
input = `**${input}**`;
|
|
34
36
|
}
|
|
35
|
-
else if (options.style === 3 /* FontStyles.Italic */) {
|
|
37
|
+
else if (options.style === 3 /* FontStyles.Italic */ || options.style === 2 /* FontStyles.Faint */) {
|
|
36
38
|
input = `_${input}_`;
|
|
37
39
|
}
|
|
38
40
|
else {
|
|
@@ -77,6 +79,10 @@ function bold(s, f = exports.formatter, options) {
|
|
|
77
79
|
function color(s, c, f = exports.formatter, opts) {
|
|
78
80
|
return f.format(s, { color: c, effect: ColorEffect.Foreground, ...opts });
|
|
79
81
|
}
|
|
82
|
+
/** Faint/dim ("grayed out") text. */
|
|
83
|
+
function faint(s, f = exports.formatter, options) {
|
|
84
|
+
return f.format(s, { style: 2 /* FontStyles.Faint */, ...options });
|
|
85
|
+
}
|
|
80
86
|
/**
|
|
81
87
|
* This does not work if the {@link setFormatter|formatter} is void. Tries to format the text as informational message.
|
|
82
88
|
*/
|
|
@@ -85,13 +91,31 @@ function ansiInfo(s, f = exports.formatter) {
|
|
|
85
91
|
}
|
|
86
92
|
exports.escape = '\x1b[';
|
|
87
93
|
const colorSuffix = 'm';
|
|
94
|
+
let hyperlinkSupport;
|
|
95
|
+
/** best-effort, env-based OSC 8 hyperlink support (`FORCE_HYPERLINK`/`NO_HYPERLINK` override; unknown terminals are treated as unsupported) */
|
|
96
|
+
function supportsHyperlinks() {
|
|
97
|
+
if (hyperlinkSupport !== undefined) {
|
|
98
|
+
return hyperlinkSupport;
|
|
99
|
+
}
|
|
100
|
+
const env = process.env;
|
|
101
|
+
if (env.FORCE_HYPERLINK !== undefined) {
|
|
102
|
+
return (hyperlinkSupport = env.FORCE_HYPERLINK !== '' && env.FORCE_HYPERLINK !== '0');
|
|
103
|
+
}
|
|
104
|
+
if (env.NO_HYPERLINK !== undefined || !process.stdout.isTTY) {
|
|
105
|
+
return (hyperlinkSupport = false);
|
|
106
|
+
}
|
|
107
|
+
const known = Boolean(env.WT_SESSION || env.KITTY_WINDOW_ID || env.KONSOLE_VERSION || env.DOMTERM)
|
|
108
|
+
|| (env.TERM_PROGRAM !== undefined && ['iTerm.app', 'WezTerm', 'vscode', 'ghostty', 'Hyper', 'rio'].includes(env.TERM_PROGRAM))
|
|
109
|
+
|| (env.VTE_VERSION !== undefined && Number(env.VTE_VERSION) >= 5000)
|
|
110
|
+
|| (env.TERM !== undefined && /kitty|wezterm|ghostty/i.test(env.TERM));
|
|
111
|
+
return (hyperlinkSupport = known);
|
|
112
|
+
}
|
|
88
113
|
exports.ansiFormatter = {
|
|
89
114
|
reset() {
|
|
90
115
|
return `${exports.escape}0${colorSuffix}`;
|
|
91
116
|
},
|
|
92
117
|
hyperlink(text, url) {
|
|
93
|
-
|
|
94
|
-
return `\x1b]8;;${url}\x07${text}\x1b]8;;\x07`;
|
|
118
|
+
return supportsHyperlinks() ? `\x1b]8;;${url}\x07${text}\x1b]8;;\x07` : text;
|
|
95
119
|
},
|
|
96
120
|
format(input, options) {
|
|
97
121
|
return `${this.getFormatString(options)}${input}${this.reset()}`;
|
package/util/text/strings.d.ts
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
* Check if the given string starts and ends with the given letter
|
|
3
3
|
*/
|
|
4
4
|
export declare function startAndEndsWith(str: string, letter: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Whether every character of `needle` appears in `hay` in order (a subsequence / fuzzy match).
|
|
7
|
+
*/
|
|
8
|
+
export declare function isSubsequence(needle: string, hay: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The `candidates` that start with `needle`, or -- if none do -- those that contain it as a
|
|
11
|
+
* {@link isSubsequence|subsequence} (case-insensitive). `needle` itself is never returned.
|
|
12
|
+
*/
|
|
13
|
+
export declare function matchByPrefixOrSubsequence(candidates: readonly string[], needle: string): string[];
|
|
5
14
|
/**
|
|
6
15
|
* Removes all whitespace in the given string
|
|
7
16
|
*/
|
package/util/text/strings.js
CHANGED
|
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.startAndEndsWith = startAndEndsWith;
|
|
7
|
+
exports.isSubsequence = isSubsequence;
|
|
8
|
+
exports.matchByPrefixOrSubsequence = matchByPrefixOrSubsequence;
|
|
7
9
|
exports.withoutWhitespace = withoutWhitespace;
|
|
8
10
|
exports.longestCommonPrefix = longestCommonPrefix;
|
|
9
11
|
exports.joinWithLast = joinWithLast;
|
|
@@ -19,6 +21,33 @@ const url_1 = require("url");
|
|
|
19
21
|
function startAndEndsWith(str, letter) {
|
|
20
22
|
return str.startsWith(letter) && str.endsWith(letter);
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Whether every character of `needle` appears in `hay` in order (a subsequence / fuzzy match).
|
|
26
|
+
*/
|
|
27
|
+
function isSubsequence(needle, hay) {
|
|
28
|
+
if (needle.length === 0) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
let i = 0;
|
|
32
|
+
for (const c of hay) {
|
|
33
|
+
if (c === needle[i] && ++i === needle.length) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The `candidates` that start with `needle`, or -- if none do -- those that contain it as a
|
|
41
|
+
* {@link isSubsequence|subsequence} (case-insensitive). `needle` itself is never returned.
|
|
42
|
+
*/
|
|
43
|
+
function matchByPrefixOrSubsequence(candidates, needle) {
|
|
44
|
+
const prefixed = candidates.filter(c => c.startsWith(needle) && c !== needle);
|
|
45
|
+
if (prefixed.length > 0) {
|
|
46
|
+
return prefixed;
|
|
47
|
+
}
|
|
48
|
+
const lower = needle.toLowerCase();
|
|
49
|
+
return candidates.filter(c => c !== needle && isSubsequence(lower, c.toLowerCase()));
|
|
50
|
+
}
|
|
22
51
|
/**
|
|
23
52
|
* Removes all whitespace in the given string
|
|
24
53
|
*/
|
package/util/version.js
CHANGED
|
@@ -1,13 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.flowrVersion = flowrVersion;
|
|
4
37
|
exports.retrieveVersionInformation = retrieveVersionInformation;
|
|
5
38
|
exports.printVersionInformation = printVersionInformation;
|
|
39
|
+
const ansi_1 = require("./text/ansi");
|
|
6
40
|
const semver_1 = require("semver");
|
|
7
41
|
const assert_1 = require("./assert");
|
|
8
42
|
const sigdb_download_1 = require("../project/sigdb/sigdb-download");
|
|
43
|
+
const doc_files_1 = require("../documentation/doc-util/doc-files");
|
|
9
44
|
// this is automatically replaced with the current version by release-it
|
|
10
|
-
const version = '2.
|
|
45
|
+
const version = '2.13.0';
|
|
11
46
|
// this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
|
|
12
47
|
const versionDate = '2026-07-15T07:13:44Z';
|
|
13
48
|
/**
|
|
@@ -42,34 +77,72 @@ async function retrieveVersionInformation(input) {
|
|
|
42
77
|
*/
|
|
43
78
|
async function printVersionInformation(output, input, engineOnly = false) {
|
|
44
79
|
const { flowr, r, engine } = await retrieveVersionInformation(input);
|
|
45
|
-
const
|
|
80
|
+
const dim = (s) => (0, ansi_1.faint)(s, output.formatter);
|
|
46
81
|
const rReason = r === 'none' ? ' (no R interpreter available)'
|
|
47
82
|
: r === 'unknown' ? (engine === 'tree-sitter' ? ' (not queried, using the tree-sitter engine)' : ' (could not be determined)')
|
|
48
83
|
: '';
|
|
49
84
|
const flowrValue = versionRegex.test(flowr) ? output.formatter.hyperlink(flowr, `https://github.com/flowr-analysis/flowr/releases/tag/v${flowr}`) : flowr;
|
|
50
85
|
const rows = [];
|
|
86
|
+
const pluginLines = [];
|
|
51
87
|
if (!engineOnly) {
|
|
52
|
-
rows.push(['flowR', `${flowrValue} ${
|
|
88
|
+
rows.push(['flowR', `${flowrValue} ${dim(`(${versionDate})`)}`]);
|
|
53
89
|
}
|
|
54
90
|
rows.push(['engine', engine], ['R', `${r}${rReason}`, r === 'none' || r === 'unknown']);
|
|
55
91
|
if (typeof input !== 'function' && 'inspectContext' in input) {
|
|
56
92
|
// reads the current analyzer, so it reflects the databases in use (and adapts to config changes)
|
|
57
93
|
const ctx = input.inspectContext();
|
|
58
94
|
const setting = ctx.config.solver.sigdb.assumedRVersion ?? 'auto';
|
|
59
|
-
rows.push(['assumed R', `${ctx.resolvedRVersion} ${
|
|
60
|
-
const dbs = ctx.deps.
|
|
95
|
+
rows.push(['assumed R', `${ctx.resolvedRVersion} ${dim(`(solver.sigdb.assumedRVersion = "${setting}")`)}`]);
|
|
96
|
+
const dbs = ctx.deps.loadedSignatureDatabases();
|
|
61
97
|
const sigDbUrl = (0, sigdb_download_1.sigDbRemoteRelease)()?.url;
|
|
62
98
|
const describe = (d) => {
|
|
63
99
|
const entry = `${d.scope} (v${d.version}, ${d.date}${d.format ? `, ${d.format}` : ''})`;
|
|
64
100
|
return sigDbUrl ? output.formatter.hyperlink(entry, sigDbUrl) : entry;
|
|
65
101
|
};
|
|
66
102
|
rows.push(['databases', dbs.length === 0 ? 'none' : dbs.map(describe).join(', '), dbs.length === 0]);
|
|
103
|
+
// the registered plugins, grouped by prefix; collected here and printed after the table (below) so the
|
|
104
|
+
// longer labels do not widen the version rows. The header links (once) to the plugin wiki section
|
|
105
|
+
const wiki = `${doc_files_1.FlowrWikiBaseRef}/Analyzer#plugins`;
|
|
106
|
+
const osc8 = (0, ansi_1.supportsHyperlinks)();
|
|
107
|
+
const names = ctx.config.defaultPlugins.map(x => typeof x === 'string' ? x : x[0]);
|
|
108
|
+
const byPrefix = new Map();
|
|
109
|
+
for (const p of names) {
|
|
110
|
+
const at = p.indexOf(':');
|
|
111
|
+
const [prefix, suffix] = at < 0 ? [p, ''] : [p.slice(0, at), p.slice(at + 1)];
|
|
112
|
+
byPrefix.set(prefix, [...(byPrefix.get(prefix) ?? []), suffix]);
|
|
113
|
+
}
|
|
114
|
+
const trace = ctx.config.repl.showPlugins;
|
|
115
|
+
// loaded lazily so this presentation util does not statically pull the plugin registry (and the whole
|
|
116
|
+
// plugin/dataflow graph) into `util/version`, which `util/assert` depends on
|
|
117
|
+
const { BuiltInPlugins } = await Promise.resolve().then(() => __importStar(require('../project/plugins/plugin-registry')));
|
|
118
|
+
const keyByClass = new Map(BuiltInPlugins.map(([key, producer]) => [producer.name, key]));
|
|
119
|
+
const activated = new Set();
|
|
120
|
+
for (const cls of ctx.activatedPlugins) {
|
|
121
|
+
const key = keyByClass.get(cls);
|
|
122
|
+
if (key !== undefined) {
|
|
123
|
+
activated.add(key);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const render = (full, suffix) => trace && !activated.has(full) ? dim(suffix) : suffix;
|
|
127
|
+
const labelWidth = Math.max(...[...byPrefix.keys()].map(p => p.length));
|
|
128
|
+
const header = `registered plugins (${names.length})`;
|
|
129
|
+
const hint = trace ? ' (faint = did not activate)' : ' (set +repl.showPlugins=true to track activation)';
|
|
130
|
+
pluginLines.push(`${(0, ansi_1.bold)(osc8 ? output.formatter.hyperlink(header, wiki) : header, output.formatter)}:${dim(hint)}`);
|
|
131
|
+
for (const [prefix, suffixes] of [...byPrefix].sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
132
|
+
pluginLines.push(` ${(0, ansi_1.bold)(prefix, output.formatter)}:${' '.repeat(labelWidth - prefix.length)} ${[...suffixes].sort((a, b) => a.localeCompare(b)).map(s => render(`${prefix}:${s}`, s)).join(', ')}`);
|
|
133
|
+
}
|
|
134
|
+
if (!osc8) {
|
|
135
|
+
pluginLines.push(` ${dim('docs: ' + wiki)}`);
|
|
136
|
+
}
|
|
67
137
|
}
|
|
68
138
|
const width = Math.max(...rows.map(([label]) => label.length));
|
|
69
139
|
for (const [label, value, faded] of rows) {
|
|
70
140
|
const padding = ' '.repeat(width - label.length);
|
|
71
141
|
const line = `${label}:${padding} ${value}`;
|
|
72
|
-
output.stdout(faded ?
|
|
142
|
+
output.stdout(faded ? dim(line) : line);
|
|
143
|
+
}
|
|
144
|
+
for (const line of pluginLines) {
|
|
145
|
+
output.stdout(line);
|
|
73
146
|
}
|
|
74
147
|
}
|
|
75
148
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Ternary } from '../../util/logic';
|
|
2
|
-
/**
|
|
3
|
-
* An abstract domain with satisfiability checks for concrete values.
|
|
4
|
-
*/
|
|
5
|
-
export interface SatisfiableDomain<T> {
|
|
6
|
-
/**
|
|
7
|
-
* Checks whether the current abstract value satisfies a concrete value (i.e. includes a concrete value).
|
|
8
|
-
* @see {@link Ternary} for the returned satisfiability result
|
|
9
|
-
*/
|
|
10
|
-
satisfies(value: T): Ternary;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Represents the different types of numerical comparators for satisfiability checks for an abstract domain.
|
|
14
|
-
*/
|
|
15
|
-
export declare enum NumericalComparator {
|
|
16
|
-
Equal = 0,
|
|
17
|
-
Less = 1,
|
|
18
|
-
LessOrEqual = 2,
|
|
19
|
-
Greater = 3,
|
|
20
|
-
GreaterOrEqual = 4
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Represents the different types of set comparators for satisfiability checks for an abstract domain.
|
|
24
|
-
*/
|
|
25
|
-
export declare enum SetComparator {
|
|
26
|
-
Equal = 0,
|
|
27
|
-
Subset = 1,
|
|
28
|
-
SubsetOrEqual = 2
|
|
29
|
-
}
|
package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FlowrAnalyzerProjectDiscoveryPlugin } from './flowr-analyzer-project-discovery-plugin';
|
|
2
|
-
import { SemVer } from 'semver';
|
|
3
|
-
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
4
|
-
import type { RProjectAnalysisRequest } from '../../context/flowr-analyzer-files-context';
|
|
5
|
-
import type { RParseRequest } from '../../../r-bridge/retriever';
|
|
6
|
-
import type { FlowrFile } from '../../context/flowr-file';
|
|
7
|
-
/**
|
|
8
|
-
* Decorator around any {@link FlowrAnalyzerProjectDiscoveryPlugin} that filters discovered files
|
|
9
|
-
* by the rules in a `.gitignore` file found at the project root.
|
|
10
|
-
* If no `.gitignore` exists, the inner plugin's results are returned unchanged.
|
|
11
|
-
*
|
|
12
|
-
* Register as `'project-discovery:gitignore'` (see {@link BuiltInPlugins}) to replace the
|
|
13
|
-
* default discovery plugin with a gitignore-aware variant.
|
|
14
|
-
*/
|
|
15
|
-
export declare class FlowrAnalyzerGitignoreProjectDiscoveryPlugin extends FlowrAnalyzerProjectDiscoveryPlugin {
|
|
16
|
-
readonly name = "flowr-analyzer-gitignore-project-discovery-plugin";
|
|
17
|
-
readonly description = "Wraps a project discovery plugin and filters results by .gitignore rules.";
|
|
18
|
-
readonly version: SemVer;
|
|
19
|
-
private readonly inner;
|
|
20
|
-
constructor(inner?: FlowrAnalyzerProjectDiscoveryPlugin);
|
|
21
|
-
protected process(context: FlowrAnalyzerContext, args: RProjectAnalysisRequest): (RParseRequest | FlowrFile<string>)[];
|
|
22
|
-
}
|
package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FlowrAnalyzerGitignoreProjectDiscoveryPlugin = void 0;
|
|
7
|
-
const flowr_analyzer_project_discovery_plugin_1 = require("./flowr-analyzer-project-discovery-plugin");
|
|
8
|
-
const semver_1 = require("semver");
|
|
9
|
-
const retriever_1 = require("../../../r-bridge/retriever");
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const fs_1 = __importDefault(require("fs"));
|
|
12
|
-
/** Lazily loaded on first use so `ignore` is only required when the gitignore plugin actually runs. */
|
|
13
|
-
let ignoreFactory;
|
|
14
|
-
function loadIgnore() {
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports -- loaded on demand, see above
|
|
16
|
-
return ignoreFactory ??= require('ignore');
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Decorator around any {@link FlowrAnalyzerProjectDiscoveryPlugin} that filters discovered files
|
|
20
|
-
* by the rules in a `.gitignore` file found at the project root.
|
|
21
|
-
* If no `.gitignore` exists, the inner plugin's results are returned unchanged.
|
|
22
|
-
*
|
|
23
|
-
* Register as `'project-discovery:gitignore'` (see {@link BuiltInPlugins}) to replace the
|
|
24
|
-
* default discovery plugin with a gitignore-aware variant.
|
|
25
|
-
*/
|
|
26
|
-
class FlowrAnalyzerGitignoreProjectDiscoveryPlugin extends flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin {
|
|
27
|
-
name = 'flowr-analyzer-gitignore-project-discovery-plugin';
|
|
28
|
-
description = 'Wraps a project discovery plugin and filters results by .gitignore rules.';
|
|
29
|
-
version = new semver_1.SemVer('0.1.0');
|
|
30
|
-
inner;
|
|
31
|
-
constructor(inner = flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin()) {
|
|
32
|
-
super();
|
|
33
|
-
this.inner = inner;
|
|
34
|
-
}
|
|
35
|
-
process(context, args) {
|
|
36
|
-
const ig = loadIgnore()();
|
|
37
|
-
const gitignorePath = path_1.default.join(args.content, '.gitignore');
|
|
38
|
-
if (fs_1.default.existsSync(gitignorePath)) {
|
|
39
|
-
ig.add(fs_1.default.readFileSync(gitignorePath, 'utf-8'));
|
|
40
|
-
}
|
|
41
|
-
return this.inner.processor(context, args).filter(r => {
|
|
42
|
-
const filePath = (0, retriever_1.isParseRequest)(r) && r.request === 'file' ? r.content : !(0, retriever_1.isParseRequest)(r) ? r.path() : undefined;
|
|
43
|
-
if (filePath === undefined) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
const relative = path_1.default.relative(args.content, filePath);
|
|
47
|
-
return relative === '' || !ig.ignores(relative);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.FlowrAnalyzerGitignoreProjectDiscoveryPlugin = FlowrAnalyzerGitignoreProjectDiscoveryPlugin;
|
|
52
|
-
//# sourceMappingURL=flowr-analyzer-gitignore-project-discovery-plugin.js.map
|