@eagleoutice/flowr 2.10.9 → 2.11.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 +116 -38
- package/abstract-interpretation/absint-visitor.js +6 -3
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/interval-domain.js +1 -1
- package/abstract-interpretation/domains/lattice.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
- package/abstract-interpretation/domains/singleton-domain.d.ts +1 -1
- package/abstract-interpretation/domains/singleton-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.js +2 -2
- package/abstract-interpretation/unsupported-functions.d.ts +3 -2
- package/abstract-interpretation/unsupported-functions.js +38 -28
- package/cli/benchmark-app.js +2 -1
- package/cli/common/options.d.ts +2 -108
- package/cli/common/options.js +3 -27
- package/cli/common/script.js +3 -2
- package/cli/common/scripts-info.d.ts +2 -123
- package/cli/common/scripts-info.js +0 -17
- package/cli/flowr-main-options.d.ts +5 -0
- package/cli/flowr-main-options.js +10 -0
- package/cli/flowr.js +48 -11
- package/cli/repl/commands/repl-cfg.js +9 -9
- package/cli/repl/commands/repl-commands.js +5 -0
- package/cli/repl/commands/repl-dataflow.js +31 -24
- package/cli/repl/commands/repl-main.d.ts +6 -0
- package/cli/repl/commands/repl-normalize.js +15 -12
- package/cli/repl/commands/repl-parse.js +1 -1
- package/cli/repl/commands/repl-query.js +4 -5
- package/cli/repl/commands/repl-quit.js +2 -1
- package/cli/repl/core.d.ts +11 -0
- package/cli/repl/core.js +101 -3
- package/cli/repl/execute.js +3 -2
- package/cli/repl/parser/slice-query-parser.d.ts +16 -0
- package/cli/repl/parser/slice-query-parser.js +52 -0
- package/cli/repl/print-version.d.ts +3 -1
- package/cli/repl/print-version.js +21 -2
- package/cli/repl/server/connection.d.ts +3 -0
- package/cli/repl/server/connection.js +65 -31
- package/cli/repl/server/messages/message-analysis.d.ts +10 -0
- package/cli/repl/server/messages/message-analysis.js +6 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/script-core/summarizer-core.js +13 -32
- package/cli/wiki.d.ts +3 -1
- package/cli/wiki.js +6 -1
- package/config.d.ts +22 -10
- package/config.js +33 -7
- package/control-flow/diff-cfg.d.ts +1 -1
- package/control-flow/diff-cfg.js +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +2 -0
- package/control-flow/simple-visitor.js +6 -5
- package/control-flow/useless-loop.js +2 -2
- package/core/print/dataflow-printer.d.ts +2 -2
- package/core/print/dataflow-printer.js +2 -2
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/data/pkgdb/pkgdb-latest.json.br +0 -0
- package/data/pkgdb/pkgdb-tiny.json.br +0 -0
- package/dataflow/environments/append.d.ts +2 -2
- package/dataflow/environments/append.js +4 -10
- package/dataflow/environments/apply-kill.d.ts +21 -0
- package/dataflow/environments/apply-kill.js +155 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in.d.ts +4 -0
- package/dataflow/environments/built-in.js +4 -0
- package/dataflow/environments/default-builtin-config.d.ts +183 -67
- package/dataflow/environments/default-builtin-config.js +358 -147
- package/dataflow/environments/environment.d.ts +49 -31
- package/dataflow/environments/environment.js +144 -25
- package/dataflow/environments/identifier.d.ts +65 -2
- package/dataflow/environments/identifier.js +37 -2
- package/dataflow/environments/overwrite.js +2 -10
- package/dataflow/environments/reference-to-maybe.d.ts +2 -0
- package/dataflow/environments/reference-to-maybe.js +56 -11
- package/dataflow/environments/resolve-by-name.d.ts +1 -1
- package/dataflow/environments/resolve-by-name.js +23 -9
- package/dataflow/environments/scoping.d.ts +9 -2
- package/dataflow/environments/scoping.js +15 -2
- package/dataflow/eval/values/general.js +4 -0
- package/dataflow/extractor.js +35 -4
- package/dataflow/graph/df-helper.d.ts +14 -0
- package/dataflow/graph/df-helper.js +41 -0
- package/dataflow/graph/graph.d.ts +4 -1
- package/dataflow/graph/graph.js +6 -2
- package/dataflow/info.d.ts +27 -1
- package/dataflow/internal/linker.d.ts +5 -1
- package/dataflow/internal/linker.js +34 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +7 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +9 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -47
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +17 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +61 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +9 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +37 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +391 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +58 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +132 -25
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +9 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +25 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +94 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +11 -4
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +30 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +279 -0
- package/dataflow/internal/process/functions/call/known-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +23 -0
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +1 -1
- package/dataflow/processor.d.ts +6 -0
- package/documentation/data/faq/faqs.d.ts +2 -1
- package/documentation/data/faq/faqs.js +78 -57
- package/documentation/data/interface/doc-writing-code.js +4 -80
- package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
- package/documentation/data/server/doc-data-server-messages.js +15 -7
- package/documentation/doc-readme.js +15 -15
- package/documentation/doc-util/doc-cfg.d.ts +3 -1
- package/documentation/doc-util/doc-cfg.js +3 -3
- package/documentation/doc-util/doc-dfg.d.ts +3 -1
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-files.d.ts +3 -1
- package/documentation/doc-util/doc-files.js +9 -6
- package/documentation/doc-util/doc-normalized-ast.d.ts +3 -1
- package/documentation/doc-util/doc-normalized-ast.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +2 -1
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -0
- package/documentation/doc-util/doc-structure.js +1 -2
- package/documentation/doc-util/doc-types.d.ts +6 -6
- package/documentation/doc-util/doc-types.js +11 -9
- package/documentation/issue-linting-rule.js +1 -2
- package/documentation/wiki-analyzer.js +9 -9
- package/documentation/wiki-cfg.js +40 -41
- package/documentation/wiki-core.js +121 -32
- package/documentation/wiki-create-linting-rules.d.ts +6 -0
- package/documentation/wiki-create-linting-rules.js +95 -0
- package/documentation/wiki-dataflow-graph.js +112 -77
- package/documentation/wiki-engine.js +1 -2
- package/documentation/wiki-faq.d.ts +2 -1
- package/documentation/wiki-faq.js +4 -4
- package/documentation/wiki-interface.js +22 -8
- package/documentation/wiki-linter.d.ts +1 -1
- package/documentation/wiki-linter.js +16 -6
- package/documentation/wiki-linting-and-testing.js +2 -2
- package/documentation/wiki-mk/doc-context.d.ts +3 -3
- package/documentation/wiki-mk/doc-maker.d.ts +2 -0
- package/documentation/wiki-mk/doc-maker.js +7 -1
- package/documentation/wiki-normalized-ast.js +5 -5
- package/documentation/wiki-onboarding.d.ts +2 -1
- package/documentation/wiki-onboarding.js +5 -5
- package/documentation/wiki-overview.js +4 -17
- package/documentation/wiki-package-database.d.ts +9 -0
- package/documentation/wiki-package-database.js +63 -0
- package/documentation/wiki-query.js +86 -84
- package/documentation/wiki-search.js +4 -5
- package/documentation/wiki-setup.js +6 -7
- package/gas.d.ts +74 -0
- package/gas.js +18 -0
- package/linter/linter-executor.js +2 -8
- package/linter/linter-format.d.ts +4 -11
- package/linter/linter-rules.d.ts +111 -86
- package/linter/linter-rules.js +9 -1
- package/linter/rules/absolute-path.d.ts +2 -7
- package/linter/rules/absolute-path.js +8 -5
- package/linter/rules/dataframe-access-validation.d.ts +1 -6
- package/linter/rules/dataframe-access-validation.js +8 -6
- package/linter/rules/dead-code.d.ts +2 -11
- package/linter/rules/dead-code.js +16 -11
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/file-path-validity.d.ts +1 -6
- package/linter/rules/file-path-validity.js +5 -5
- package/linter/rules/function-finder-util.d.ts +7 -11
- package/linter/rules/function-finder-util.js +9 -6
- package/linter/rules/naming-convention.d.ts +2 -7
- package/linter/rules/naming-convention.js +3 -2
- package/linter/rules/network-functions.d.ts +2 -7
- package/linter/rules/network-functions.js +14 -12
- package/linter/rules/no-leaked-credentials.d.ts +36 -0
- package/linter/rules/no-leaked-credentials.js +75 -0
- package/linter/rules/problematic-inputs.d.ts +1 -8
- package/linter/rules/problematic-inputs.js +5 -4
- package/linter/rules/roxygen-arguments.d.ts +2 -7
- package/linter/rules/roxygen-arguments.js +13 -20
- package/linter/rules/seeded-randomness.d.ts +2 -7
- package/linter/rules/seeded-randomness.js +7 -4
- package/linter/rules/software-has-license.d.ts +31 -0
- package/linter/rules/software-has-license.js +46 -0
- package/linter/rules/software-has-tests.d.ts +38 -0
- package/linter/rules/software-has-tests.js +48 -0
- package/linter/rules/stop-with-call-arg.d.ts +2 -7
- package/linter/rules/stop-with-call-arg.js +3 -2
- package/linter/rules/undefined-symbol.d.ts +39 -0
- package/linter/rules/undefined-symbol.js +80 -0
- package/linter/rules/unused-definition.d.ts +3 -8
- package/linter/rules/unused-definition.js +7 -5
- package/linter/rules/useless-loop.d.ts +2 -7
- package/linter/rules/useless-loop.js +5 -2
- package/package.json +5 -5
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +9 -1
- package/project/context/flowr-analyzer-context.d.ts +13 -14
- package/project/context/flowr-analyzer-context.js +4 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +16 -8
- package/project/context/flowr-analyzer-dependencies-context.js +36 -4
- package/project/context/flowr-analyzer-environment-context.d.ts +2 -4
- package/project/context/flowr-analyzer-environment-context.js +3 -4
- package/project/context/flowr-analyzer-files-context.d.ts +13 -0
- package/project/context/flowr-analyzer-files-context.js +12 -2
- package/project/context/flowr-analyzer-gas-context.d.ts +28 -0
- package/project/context/flowr-analyzer-gas-context.js +101 -0
- package/project/context/flowr-file.d.ts +2 -0
- package/project/context/flowr-file.js +2 -0
- package/project/flowr-analyzer-builder.js +3 -0
- package/project/flowr-analyzer.d.ts +2 -1
- package/project/flowr-analyzer.js +3 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +13 -15
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +36 -13
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +13 -7
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +56 -11
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +27 -0
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +41 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +2 -2
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +5 -5
- package/project/plugins/flowr-analyzer-plugin.d.ts +15 -8
- package/project/plugins/flowr-analyzer-plugin.js +14 -7
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.d.ts +19 -0
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.js +35 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +63 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +174 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +6 -0
- package/project/plugins/package-version-plugins/package.d.ts +3 -0
- package/project/plugins/package-version-plugins/package.js +12 -0
- package/project/plugins/package-version-plugins/pkgdb.d.ts +133 -0
- package/project/plugins/package-version-plugins/pkgdb.js +370 -0
- package/project/plugins/plugin-registry.d.ts +5 -1
- package/project/plugins/plugin-registry.js +10 -1
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +22 -0
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +47 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +62 -8
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +4 -2
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +8 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +31 -3
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/other-path-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/other-path-functions.js +27 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +5 -4
- package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.js +18 -177
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +3 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- package/queries/catalog/dice-query/dice-query-executor.d.ts +8 -0
- package/queries/catalog/dice-query/dice-query-executor.js +52 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +53 -0
- package/queries/catalog/dice-query/dice-query-format.js +102 -0
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- 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 +1 -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 +1 -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 +1 -0
- package/queries/catalog/linter-query/linter-query-executor.js +8 -0
- 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 +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +1 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -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 +1 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/queries/query.d.ts +18 -1
- package/queries/query.js +3 -1
- package/r-bridge/data/data.d.ts +7 -2
- package/r-bridge/data/data.js +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +13 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +55 -44
- package/r-bridge/parser.js +2 -9
- package/r-bridge/shell.d.ts +8 -1
- package/r-bridge/shell.js +26 -7
- package/search/flowr-search-builder.d.ts +2 -2
- package/search/flowr-search-builder.js +1 -1
- package/search/flowr-search-filters.d.ts +30 -9
- package/search/flowr-search-filters.js +26 -21
- package/search/search-executor/search-enrichers.d.ts +601 -1
- package/search/search-executor/search-enrichers.js +30 -6
- package/slicing/static/static-slicer.d.ts +39 -11
- package/slicing/static/static-slicer.js +44 -14
- package/util/collections/queue.d.ts +16 -0
- package/util/collections/queue.js +38 -0
- package/util/log.d.ts +1 -1
- package/util/log.js +1 -1
- package/util/mermaid/dfg.d.ts +2 -2
- package/util/mermaid/dfg.js +2 -2
- package/util/mermaid/mermaid.d.ts +4 -0
- package/util/mermaid/mermaid.js +8 -1
- package/util/objects.d.ts +9 -0
- package/util/objects.js +54 -0
- package/util/proc.d.ts +6 -0
- package/util/proc.js +20 -0
- package/util/version.js +10 -2
- package/cli/common/features.d.ts +0 -9
- package/cli/common/features.js +0 -35
- package/cli/script-core/statistics-core.d.ts +0 -6
- package/cli/script-core/statistics-core.js +0 -103
- package/cli/script-core/statistics-helper-core.d.ts +0 -6
- package/cli/script-core/statistics-helper-core.js +0 -85
- package/cli/statistics-app.d.ts +0 -11
- package/cli/statistics-app.js +0 -16
- package/cli/statistics-helper-app.d.ts +0 -11
- package/cli/statistics-helper-app.js +0 -14
- package/statistics/features/common-syntax-probability.d.ts +0 -38
- package/statistics/features/common-syntax-probability.js +0 -169
- package/statistics/features/feature.d.ts +0 -179
- package/statistics/features/feature.js +0 -38
- package/statistics/features/post-processing.d.ts +0 -18
- package/statistics/features/post-processing.js +0 -26
- package/statistics/features/supported/assignments/assignments.d.ts +0 -12
- package/statistics/features/supported/assignments/assignments.js +0 -56
- package/statistics/features/supported/assignments/post-process.d.ts +0 -6
- package/statistics/features/supported/assignments/post-process.js +0 -126
- package/statistics/features/supported/comments/comments.d.ts +0 -18
- package/statistics/features/supported/comments/comments.js +0 -143
- package/statistics/features/supported/comments/post-process.d.ts +0 -6
- package/statistics/features/supported/comments/post-process.js +0 -51
- package/statistics/features/supported/control-flow/control-flow.d.ts +0 -17
- package/statistics/features/supported/control-flow/control-flow.js +0 -69
- package/statistics/features/supported/control-flow/post-process.d.ts +0 -6
- package/statistics/features/supported/control-flow/post-process.js +0 -66
- package/statistics/features/supported/data-access/data-access.d.ts +0 -15
- package/statistics/features/supported/data-access/data-access.js +0 -122
- package/statistics/features/supported/data-access/post-process.d.ts +0 -6
- package/statistics/features/supported/data-access/post-process.js +0 -108
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +0 -34
- package/statistics/features/supported/defined-functions/defined-functions.js +0 -145
- package/statistics/features/supported/defined-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/defined-functions/post-process.js +0 -168
- package/statistics/features/supported/expression-list/post-process.d.ts +0 -6
- package/statistics/features/supported/expression-list/post-process.js +0 -45
- package/statistics/features/supported/expression-list/statistics-expression-list.d.ts +0 -9
- package/statistics/features/supported/expression-list/statistics-expression-list.js +0 -37
- package/statistics/features/supported/loops/loops.d.ts +0 -20
- package/statistics/features/supported/loops/loops.js +0 -81
- package/statistics/features/supported/loops/post-process.d.ts +0 -6
- package/statistics/features/supported/loops/post-process.js +0 -73
- package/statistics/features/supported/used-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/used-functions/post-process.js +0 -176
- package/statistics/features/supported/used-functions/used-functions.d.ts +0 -24
- package/statistics/features/supported/used-functions/used-functions.js +0 -99
- package/statistics/features/supported/used-packages/post-process.d.ts +0 -6
- package/statistics/features/supported/used-packages/post-process.js +0 -122
- package/statistics/features/supported/used-packages/used-packages.d.ts +0 -16
- package/statistics/features/supported/used-packages/used-packages.js +0 -140
- package/statistics/features/supported/values/post-process.d.ts +0 -6
- package/statistics/features/supported/values/post-process.js +0 -73
- package/statistics/features/supported/values/values.d.ts +0 -14
- package/statistics/features/supported/values/values.js +0 -111
- package/statistics/features/supported/variables/post-process.d.ts +0 -15
- package/statistics/features/supported/variables/post-process.js +0 -126
- package/statistics/features/supported/variables/variables.d.ts +0 -15
- package/statistics/features/supported/variables/variables.js +0 -62
- package/statistics/meta-statistics.d.ts +0 -32
- package/statistics/meta-statistics.js +0 -16
- package/statistics/output/file-provider.d.ts +0 -36
- package/statistics/output/file-provider.js +0 -96
- package/statistics/output/print-stats.d.ts +0 -29
- package/statistics/output/print-stats.js +0 -81
- package/statistics/output/statistics-file.d.ts +0 -36
- package/statistics/output/statistics-file.js +0 -68
- package/statistics/statistics.d.ts +0 -29
- package/statistics/statistics.js +0 -108
- package/statistics/summarizer/auto-detect.d.ts +0 -5
- package/statistics/summarizer/auto-detect.js +0 -34
- package/statistics/summarizer/first-phase/process.d.ts +0 -6
- package/statistics/summarizer/first-phase/process.js +0 -81
- package/statistics/summarizer/post-process/clusterer.d.ts +0 -25
- package/statistics/summarizer/post-process/clusterer.js +0 -40
- package/statistics/summarizer/post-process/file-based-count.d.ts +0 -16
- package/statistics/summarizer/post-process/file-based-count.js +0 -47
- package/statistics/summarizer/post-process/histogram.d.ts +0 -57
- package/statistics/summarizer/post-process/histogram.js +0 -126
- package/statistics/summarizer/post-process/post-process-output.d.ts +0 -14
- package/statistics/summarizer/post-process/post-process-output.js +0 -102
- package/statistics/summarizer/second-phase/process.d.ts +0 -15
- package/statistics/summarizer/second-phase/process.js +0 -118
- package/statistics/summarizer/summarizer.d.ts +0 -34
- package/statistics/summarizer/summarizer.js +0 -141
|
@@ -3,43 +3,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UnsupportedFunctions = void 0;
|
|
4
4
|
const identifier_1 = require("../dataflow/environments/identifier");
|
|
5
5
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
6
|
+
const record_1 = require("../util/record");
|
|
7
|
+
function unsupportedFunctions(functions) {
|
|
8
|
+
return record_1.Record.entries(functions).map(([identifier, info]) => ({ identifier: identifier_1.Identifier.parse(identifier), ...info }));
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* List of known function calls that may change the environment unresolvable/implicitly.
|
|
8
12
|
*/
|
|
9
|
-
const UnsupportedFunctionsList = {
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'eval': {
|
|
18
|
-
'evalq': {
|
|
19
|
-
'eval.parent': {
|
|
20
|
-
'eval_tidy': {
|
|
21
|
-
'eval_bare': {
|
|
22
|
-
'body<-': {
|
|
23
|
-
'formals<-': {
|
|
24
|
-
'environment<-': {
|
|
25
|
-
'load': {
|
|
26
|
-
'attach': {
|
|
27
|
-
'detach': {
|
|
28
|
-
'rm': {
|
|
29
|
-
'remove': {
|
|
30
|
-
'list2env': {
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
}
|
|
13
|
+
const UnsupportedFunctionsList = unsupportedFunctions({
|
|
14
|
+
'base::.Primitive': {},
|
|
15
|
+
'base::.Internal': {},
|
|
16
|
+
'base::.External': {},
|
|
17
|
+
'base::.Call': {},
|
|
18
|
+
'base::.C': {},
|
|
19
|
+
'base::.Fortran': {},
|
|
20
|
+
'base::.dyn.load': {},
|
|
21
|
+
'base::eval': {},
|
|
22
|
+
'base::evalq': {},
|
|
23
|
+
'base::eval.parent': {},
|
|
24
|
+
'rlang::eval_tidy': {},
|
|
25
|
+
'rlang::eval_bare': {},
|
|
26
|
+
'base::body<-': {},
|
|
27
|
+
'base::formals<-': {},
|
|
28
|
+
'base::environment<-': {},
|
|
29
|
+
'base::load': {},
|
|
30
|
+
'base::attach': {},
|
|
31
|
+
'base::detach': {},
|
|
32
|
+
'base::rm': {},
|
|
33
|
+
'base::remove': {},
|
|
34
|
+
'base::list2env': {},
|
|
35
|
+
'base::assign': { condition: (vertex, dfg) => dfg.unknownSideEffects.has(vertex.id) },
|
|
36
|
+
'base::delayedAssign': { condition: (vertex, dfg) => dfg.unknownSideEffects.has(vertex.id) },
|
|
37
|
+
'utils::assignInNamespace': {},
|
|
38
|
+
'utils::assignInMyNamespace': {},
|
|
39
|
+
});
|
|
34
40
|
/**
|
|
35
41
|
* Helper for unsupported functions that may change the environment.
|
|
36
42
|
*/
|
|
37
43
|
exports.UnsupportedFunctions = {
|
|
38
44
|
/**
|
|
39
|
-
* Checks whether a data flow graph vertex represents
|
|
45
|
+
* Checks whether a data flow graph vertex represents an unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...)
|
|
40
46
|
*/
|
|
41
|
-
isUnsupportedCall(vertex) {
|
|
42
|
-
|
|
47
|
+
isUnsupportedCall(vertex, dfg) {
|
|
48
|
+
if (!(0, vertex_1.isFunctionCallVertex)(vertex)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const entry = UnsupportedFunctionsList.find(entry => identifier_1.Identifier.matches(vertex.name, entry.identifier));
|
|
52
|
+
return entry !== undefined && (entry.condition?.(vertex, dfg) ?? true);
|
|
43
53
|
}
|
|
44
54
|
};
|
|
45
55
|
//# sourceMappingURL=unsupported-functions.js.map
|
package/cli/benchmark-app.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const proc_1 = require("../util/proc");
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const seedrandom_1 = __importDefault(require("seedrandom"));
|
|
9
10
|
const assert_1 = require("../util/assert");
|
|
@@ -20,7 +21,7 @@ const options = (0, script_1.processCommandLineArgs)('benchmark', [], {
|
|
|
20
21
|
});
|
|
21
22
|
if (options.input.length === 0) {
|
|
22
23
|
console.error('No input files given. Nothing to do. See \'--help\' if this is an error.');
|
|
23
|
-
|
|
24
|
+
(0, proc_1.exitSafe)(0);
|
|
24
25
|
}
|
|
25
26
|
const numberRegex = /^\d+$/;
|
|
26
27
|
(0, assert_1.guard)(options.slice === 'all' || options.slice === 'no' || numberRegex.test(options.slice), 'slice must be either all, no, or a number');
|
package/cli/common/options.d.ts
CHANGED
|
@@ -282,112 +282,6 @@ export declare const slicerOptions: [{
|
|
|
282
282
|
readonly type: BooleanConstructor;
|
|
283
283
|
readonly description: "Instead of human-readable output, dump a lot of json with the results of all intermediate steps.";
|
|
284
284
|
}];
|
|
285
|
-
export declare const statisticOptions: [{
|
|
286
|
-
readonly name: "verbose";
|
|
287
|
-
readonly alias: "v";
|
|
288
|
-
readonly type: BooleanConstructor;
|
|
289
|
-
readonly description: "Run with verbose logging";
|
|
290
|
-
}, {
|
|
291
|
-
readonly name: "help";
|
|
292
|
-
readonly alias: "h";
|
|
293
|
-
readonly type: BooleanConstructor;
|
|
294
|
-
readonly description: "Print this usage guide";
|
|
295
|
-
}, {
|
|
296
|
-
readonly name: "limit";
|
|
297
|
-
readonly alias: "l";
|
|
298
|
-
readonly type: NumberConstructor;
|
|
299
|
-
readonly description: "Limit the number of files to process";
|
|
300
|
-
}, {
|
|
301
|
-
readonly name: "input";
|
|
302
|
-
readonly alias: "i";
|
|
303
|
-
readonly type: StringConstructor;
|
|
304
|
-
readonly description: "Pass a folder or file as src to read from";
|
|
305
|
-
readonly multiple: true;
|
|
306
|
-
readonly defaultOption: true;
|
|
307
|
-
readonly defaultValue: readonly [];
|
|
308
|
-
readonly typeLabel: "{underline files/folders}";
|
|
309
|
-
}, {
|
|
310
|
-
readonly name: "output-dir";
|
|
311
|
-
readonly alias: "o";
|
|
312
|
-
readonly type: StringConstructor;
|
|
313
|
-
readonly description: "Folder to write the output to";
|
|
314
|
-
readonly defaultValue: `${string}/statistics-out/${string}`;
|
|
315
|
-
readonly typeLabel: "{underline folder}";
|
|
316
|
-
}, {
|
|
317
|
-
readonly name: "dump-json";
|
|
318
|
-
readonly type: BooleanConstructor;
|
|
319
|
-
readonly description: "Write JSON output during the extraction";
|
|
320
|
-
readonly typeLabel: "{underline folder}";
|
|
321
|
-
}, {
|
|
322
|
-
readonly name: "no-ansi";
|
|
323
|
-
readonly type: BooleanConstructor;
|
|
324
|
-
readonly description: "Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.";
|
|
325
|
-
}, {
|
|
326
|
-
readonly name: "parallel";
|
|
327
|
-
readonly alias: "p";
|
|
328
|
-
readonly type: StringConstructor;
|
|
329
|
-
readonly description: "Number of parallel executors (defaults to {italic max(cpu.count-1, 1)})";
|
|
330
|
-
readonly defaultValue: number;
|
|
331
|
-
readonly typeLabel: "{underline number}";
|
|
332
|
-
}, {
|
|
333
|
-
readonly name: "features";
|
|
334
|
-
readonly type: StringConstructor;
|
|
335
|
-
readonly description: `Features to track, supported are "all" or ${string}`;
|
|
336
|
-
readonly multiple: true;
|
|
337
|
-
readonly defaultValue: "all";
|
|
338
|
-
readonly typeLabel: "{underline names}";
|
|
339
|
-
}];
|
|
340
|
-
export declare const statisticHelperOptions: [{
|
|
341
|
-
readonly name: "verbose";
|
|
342
|
-
readonly alias: "v";
|
|
343
|
-
readonly type: BooleanConstructor;
|
|
344
|
-
readonly description: "Run with verbose logging";
|
|
345
|
-
}, {
|
|
346
|
-
readonly name: "help";
|
|
347
|
-
readonly alias: "h";
|
|
348
|
-
readonly type: BooleanConstructor;
|
|
349
|
-
readonly description: "Print this usage guide";
|
|
350
|
-
}, {
|
|
351
|
-
readonly name: "input";
|
|
352
|
-
readonly alias: "i";
|
|
353
|
-
readonly type: StringConstructor;
|
|
354
|
-
readonly description: "Pass single file as src to read from";
|
|
355
|
-
readonly multiple: false;
|
|
356
|
-
readonly defaultOption: true;
|
|
357
|
-
readonly typeLabel: "{underline file}";
|
|
358
|
-
}, {
|
|
359
|
-
readonly name: "output-dir";
|
|
360
|
-
readonly alias: "o";
|
|
361
|
-
readonly type: StringConstructor;
|
|
362
|
-
readonly description: "Folder to write the output to";
|
|
363
|
-
readonly typeLabel: "{underline folder}";
|
|
364
|
-
}, {
|
|
365
|
-
readonly name: "root-dir";
|
|
366
|
-
readonly type: StringConstructor;
|
|
367
|
-
readonly description: "Root dir for the statistics files";
|
|
368
|
-
readonly defaultValue: "";
|
|
369
|
-
}, {
|
|
370
|
-
readonly name: "compress";
|
|
371
|
-
readonly type: BooleanConstructor;
|
|
372
|
-
readonly description: "Compress the output folder to a single file";
|
|
373
|
-
readonly defaultValue: false;
|
|
374
|
-
}, {
|
|
375
|
-
readonly name: "dump-json";
|
|
376
|
-
readonly type: BooleanConstructor;
|
|
377
|
-
readonly description: "Write JSON output during the extraction";
|
|
378
|
-
readonly typeLabel: "{underline folder}";
|
|
379
|
-
}, {
|
|
380
|
-
readonly name: "no-ansi";
|
|
381
|
-
readonly type: BooleanConstructor;
|
|
382
|
-
readonly description: "Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.";
|
|
383
|
-
}, {
|
|
384
|
-
readonly name: "features";
|
|
385
|
-
readonly type: StringConstructor;
|
|
386
|
-
readonly description: `Features to track, supported are "all" or ${string}`;
|
|
387
|
-
readonly multiple: true;
|
|
388
|
-
readonly defaultValue: "all";
|
|
389
|
-
readonly typeLabel: "{underline names}";
|
|
390
|
-
}];
|
|
391
285
|
export declare const summarizerOptions: [{
|
|
392
286
|
readonly name: "verbose";
|
|
393
287
|
readonly alias: "v";
|
|
@@ -402,7 +296,7 @@ export declare const summarizerOptions: [{
|
|
|
402
296
|
readonly name: "type";
|
|
403
297
|
readonly alias: "t";
|
|
404
298
|
readonly type: StringConstructor;
|
|
405
|
-
readonly description: "Manually specify if you want to post-process benchmark results
|
|
299
|
+
readonly description: "Manually specify if you want to post-process benchmark results (defaults to auto).";
|
|
406
300
|
readonly defaultValue: "auto";
|
|
407
301
|
}, {
|
|
408
302
|
readonly name: "graph";
|
|
@@ -428,7 +322,7 @@ export declare const summarizerOptions: [{
|
|
|
428
322
|
readonly name: "input";
|
|
429
323
|
readonly alias: "i";
|
|
430
324
|
readonly type: StringConstructor;
|
|
431
|
-
readonly description: "The {italic output} produced by the benchmark
|
|
325
|
+
readonly description: "The {italic output} produced by the benchmark";
|
|
432
326
|
readonly defaultOption: true;
|
|
433
327
|
readonly multiple: false;
|
|
434
328
|
readonly typeLabel: "{underline file.json/output}";
|
package/cli/common/options.js
CHANGED
|
@@ -3,10 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.summarizerOptions = exports.
|
|
6
|
+
exports.summarizerOptions = exports.slicerOptions = exports.exportQuadsOptions = exports.benchmarkHelperOptions = exports.benchmarkOptions = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const time_1 = require("../../util/text/time");
|
|
9
|
-
const feature_1 = require("../../statistics/features/feature");
|
|
10
9
|
/**
|
|
11
10
|
* This string contains a string representation of the time this module was loaded.
|
|
12
11
|
*/
|
|
@@ -66,38 +65,15 @@ exports.slicerOptions = [
|
|
|
66
65
|
{ name: 'no-magic-comments', alias: 'm', type: Boolean, description: 'Disable the effects of magic comments which force lines to be included.' },
|
|
67
66
|
{ name: 'api', type: Boolean, description: 'Instead of human-readable output, dump a lot of json with the results of all intermediate steps.' },
|
|
68
67
|
];
|
|
69
|
-
const featureNameList = Array.from(feature_1.allFeatureNames).map(s => `"${s}"`).join(', ');
|
|
70
|
-
exports.statisticOptions = [
|
|
71
|
-
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging' },
|
|
72
|
-
{ name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide' },
|
|
73
|
-
{ name: 'limit', alias: 'l', type: Number, description: 'Limit the number of files to process' },
|
|
74
|
-
{ name: 'input', alias: 'i', type: String, description: 'Pass a folder or file as src to read from', multiple: true, defaultOption: true, defaultValue: [], typeLabel: '{underline files/folders}' },
|
|
75
|
-
{ name: 'output-dir', alias: 'o', type: String, description: 'Folder to write the output to', defaultValue: `${process.cwd()}/statistics-out/${(0, time_1.date2string)(new Date())}`, typeLabel: '{underline folder}' },
|
|
76
|
-
{ name: 'dump-json', type: Boolean, description: 'Write JSON output during the extraction', typeLabel: '{underline folder}' },
|
|
77
|
-
{ name: 'no-ansi', type: Boolean, description: 'Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.' },
|
|
78
|
-
{ name: 'parallel', alias: 'p', type: String, description: 'Number of parallel executors (defaults to {italic max(cpu.count-1, 1)})', defaultValue: Math.max(os_1.default.cpus().length - 1, 1), typeLabel: '{underline number}' },
|
|
79
|
-
{ name: 'features', type: String, description: `Features to track, supported are "all" or ${featureNameList}`, multiple: true, defaultValue: 'all', typeLabel: '{underline names}' },
|
|
80
|
-
];
|
|
81
|
-
exports.statisticHelperOptions = [
|
|
82
|
-
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging' },
|
|
83
|
-
{ name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide' },
|
|
84
|
-
{ name: 'input', alias: 'i', type: String, description: 'Pass single file as src to read from', multiple: false, defaultOption: true, typeLabel: '{underline file}' },
|
|
85
|
-
{ name: 'output-dir', alias: 'o', type: String, description: 'Folder to write the output to', typeLabel: '{underline folder}' },
|
|
86
|
-
{ name: 'root-dir', type: String, description: 'Root dir for the statistics files', defaultValue: '' },
|
|
87
|
-
{ name: 'compress', type: Boolean, description: 'Compress the output folder to a single file', defaultValue: false },
|
|
88
|
-
{ name: 'dump-json', type: Boolean, description: 'Write JSON output during the extraction', typeLabel: '{underline folder}' },
|
|
89
|
-
{ name: 'no-ansi', type: Boolean, description: 'Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.' },
|
|
90
|
-
{ name: 'features', type: String, description: `Features to track, supported are "all" or ${featureNameList}`, multiple: true, defaultValue: 'all', typeLabel: '{underline names}' },
|
|
91
|
-
];
|
|
92
68
|
exports.summarizerOptions = [
|
|
93
69
|
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging' },
|
|
94
70
|
{ name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide' },
|
|
95
|
-
{ name: 'type', alias: 't', type: String, description: 'Manually specify if you want to post-process benchmark results
|
|
71
|
+
{ name: 'type', alias: 't', type: String, description: 'Manually specify if you want to post-process benchmark results (defaults to auto).', defaultValue: 'auto' },
|
|
96
72
|
{ name: 'graph', alias: 'g', type: Boolean, description: 'Produce data to be used for visualizing benchmarks over time' },
|
|
97
73
|
{ name: 'categorize', type: Boolean, description: 'Categorize the results (e.g., "test", "example", ...)', defaultValue: false },
|
|
98
74
|
{ name: 'project-skip', type: Number, description: 'Skip the first n folders to find the location of projects', defaultValue: 0 },
|
|
99
75
|
{ name: 'ultimate-only', alias: 'u', type: Boolean, description: 'Only perform the second summary-stage, with this, the input is used to find the summary-output.' },
|
|
100
|
-
{ name: 'input', alias: 'i', type: String, description: 'The {italic output} produced by the benchmark
|
|
76
|
+
{ name: 'input', alias: 'i', type: String, description: 'The {italic output} produced by the benchmark', defaultOption: true, multiple: false, typeLabel: '{underline file.json/output}' },
|
|
101
77
|
{ name: 'output', alias: 'o', type: String, description: 'Basename of the summaries (defaults to {italic <input>-summary})', typeLabel: '{underline file}' },
|
|
102
78
|
];
|
|
103
79
|
//# sourceMappingURL=options.js.map
|
package/cli/common/script.js
CHANGED
|
@@ -14,6 +14,7 @@ const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
|
14
14
|
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
15
15
|
const ansi_1 = require("../../util/text/ansi");
|
|
16
16
|
const log_1 = require("../../util/log");
|
|
17
|
+
const proc_1 = require("../../util/proc");
|
|
17
18
|
/**
|
|
18
19
|
* Automatically generates a uniform help from a given script (see {@link scripts}).
|
|
19
20
|
* Additionally, you can pass usage examples that may make use of the formatting instructions `{italic x}` and `{bold x}`.
|
|
@@ -41,7 +42,7 @@ function processCommandLineArgs(script, requireAdditionally, help) {
|
|
|
41
42
|
const options = (0, command_line_args_1.default)(scripts_info_1.scripts[script].options);
|
|
42
43
|
if (options.help) {
|
|
43
44
|
console.log(helpForOptions(script, help));
|
|
44
|
-
|
|
45
|
+
(0, proc_1.exitSafe)(0);
|
|
45
46
|
}
|
|
46
47
|
else if (requireAdditionally.length > 0) {
|
|
47
48
|
const keys = new Set(Object.keys(options));
|
|
@@ -49,7 +50,7 @@ function processCommandLineArgs(script, requireAdditionally, help) {
|
|
|
49
50
|
if (missing.length > 0) {
|
|
50
51
|
console.error((0, ansi_1.italic)(`Missing required arguments: ${missing.join(', ')}. Showing help.`));
|
|
51
52
|
console.log(helpForOptions(script, help));
|
|
52
|
-
|
|
53
|
+
(0, proc_1.exitSafe)(0);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
log_1.log.updateSettings(l => l.settings.minLevel = options.verbose ? 1 /* LogLevel.Trace */ : 5 /* LogLevel.Error */);
|
|
@@ -309,7 +309,7 @@ declare const _scripts: {
|
|
|
309
309
|
readonly name: "type";
|
|
310
310
|
readonly alias: "t";
|
|
311
311
|
readonly type: StringConstructor;
|
|
312
|
-
readonly description: "Manually specify if you want to post-process benchmark results
|
|
312
|
+
readonly description: "Manually specify if you want to post-process benchmark results (defaults to auto).";
|
|
313
313
|
readonly defaultValue: "auto";
|
|
314
314
|
}, {
|
|
315
315
|
readonly name: "graph";
|
|
@@ -335,7 +335,7 @@ declare const _scripts: {
|
|
|
335
335
|
readonly name: "input";
|
|
336
336
|
readonly alias: "i";
|
|
337
337
|
readonly type: StringConstructor;
|
|
338
|
-
readonly description: "The {italic output} produced by the benchmark
|
|
338
|
+
readonly description: "The {italic output} produced by the benchmark";
|
|
339
339
|
readonly defaultOption: true;
|
|
340
340
|
readonly multiple: false;
|
|
341
341
|
readonly typeLabel: "{underline file.json/output}";
|
|
@@ -387,127 +387,6 @@ declare const _scripts: {
|
|
|
387
387
|
}];
|
|
388
388
|
type: string;
|
|
389
389
|
};
|
|
390
|
-
stats: {
|
|
391
|
-
toolName: string;
|
|
392
|
-
target: string;
|
|
393
|
-
description: string;
|
|
394
|
-
options: [{
|
|
395
|
-
readonly name: "verbose";
|
|
396
|
-
readonly alias: "v";
|
|
397
|
-
readonly type: BooleanConstructor;
|
|
398
|
-
readonly description: "Run with verbose logging";
|
|
399
|
-
}, {
|
|
400
|
-
readonly name: "help";
|
|
401
|
-
readonly alias: "h";
|
|
402
|
-
readonly type: BooleanConstructor;
|
|
403
|
-
readonly description: "Print this usage guide";
|
|
404
|
-
}, {
|
|
405
|
-
readonly name: "limit";
|
|
406
|
-
readonly alias: "l";
|
|
407
|
-
readonly type: NumberConstructor;
|
|
408
|
-
readonly description: "Limit the number of files to process";
|
|
409
|
-
}, {
|
|
410
|
-
readonly name: "input";
|
|
411
|
-
readonly alias: "i";
|
|
412
|
-
readonly type: StringConstructor;
|
|
413
|
-
readonly description: "Pass a folder or file as src to read from";
|
|
414
|
-
readonly multiple: true;
|
|
415
|
-
readonly defaultOption: true;
|
|
416
|
-
readonly defaultValue: readonly [];
|
|
417
|
-
readonly typeLabel: "{underline files/folders}";
|
|
418
|
-
}, {
|
|
419
|
-
readonly name: "output-dir";
|
|
420
|
-
readonly alias: "o";
|
|
421
|
-
readonly type: StringConstructor;
|
|
422
|
-
readonly description: "Folder to write the output to";
|
|
423
|
-
readonly defaultValue: `${string}/statistics-out/${string}`;
|
|
424
|
-
readonly typeLabel: "{underline folder}";
|
|
425
|
-
}, {
|
|
426
|
-
readonly name: "dump-json";
|
|
427
|
-
readonly type: BooleanConstructor;
|
|
428
|
-
readonly description: "Write JSON output during the extraction";
|
|
429
|
-
readonly typeLabel: "{underline folder}";
|
|
430
|
-
}, {
|
|
431
|
-
readonly name: "no-ansi";
|
|
432
|
-
readonly type: BooleanConstructor;
|
|
433
|
-
readonly description: "Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.";
|
|
434
|
-
}, {
|
|
435
|
-
readonly name: "parallel";
|
|
436
|
-
readonly alias: "p";
|
|
437
|
-
readonly type: StringConstructor;
|
|
438
|
-
readonly description: "Number of parallel executors (defaults to {italic max(cpu.count-1, 1)})";
|
|
439
|
-
readonly defaultValue: number;
|
|
440
|
-
readonly typeLabel: "{underline number}";
|
|
441
|
-
}, {
|
|
442
|
-
readonly name: "features";
|
|
443
|
-
readonly type: StringConstructor;
|
|
444
|
-
readonly description: `Features to track, supported are "all" or ${string}`;
|
|
445
|
-
readonly multiple: true;
|
|
446
|
-
readonly defaultValue: "all";
|
|
447
|
-
readonly typeLabel: "{underline names}";
|
|
448
|
-
}];
|
|
449
|
-
usageExample: string;
|
|
450
|
-
type: string;
|
|
451
|
-
};
|
|
452
|
-
'stats-helper': {
|
|
453
|
-
toolName: string;
|
|
454
|
-
target: string;
|
|
455
|
-
description: string;
|
|
456
|
-
options: [{
|
|
457
|
-
readonly name: "verbose";
|
|
458
|
-
readonly alias: "v";
|
|
459
|
-
readonly type: BooleanConstructor;
|
|
460
|
-
readonly description: "Run with verbose logging";
|
|
461
|
-
}, {
|
|
462
|
-
readonly name: "help";
|
|
463
|
-
readonly alias: "h";
|
|
464
|
-
readonly type: BooleanConstructor;
|
|
465
|
-
readonly description: "Print this usage guide";
|
|
466
|
-
}, {
|
|
467
|
-
readonly name: "input";
|
|
468
|
-
readonly alias: "i";
|
|
469
|
-
readonly type: StringConstructor;
|
|
470
|
-
readonly description: "Pass single file as src to read from";
|
|
471
|
-
readonly multiple: false;
|
|
472
|
-
readonly defaultOption: true;
|
|
473
|
-
readonly typeLabel: "{underline file}";
|
|
474
|
-
}, {
|
|
475
|
-
readonly name: "output-dir";
|
|
476
|
-
readonly alias: "o";
|
|
477
|
-
readonly type: StringConstructor;
|
|
478
|
-
readonly description: "Folder to write the output to";
|
|
479
|
-
readonly typeLabel: "{underline folder}";
|
|
480
|
-
}, {
|
|
481
|
-
readonly name: "root-dir";
|
|
482
|
-
readonly type: StringConstructor;
|
|
483
|
-
readonly description: "Root dir for the statistics files";
|
|
484
|
-
readonly defaultValue: "";
|
|
485
|
-
}, {
|
|
486
|
-
readonly name: "compress";
|
|
487
|
-
readonly type: BooleanConstructor;
|
|
488
|
-
readonly description: "Compress the output folder to a single file";
|
|
489
|
-
readonly defaultValue: false;
|
|
490
|
-
}, {
|
|
491
|
-
readonly name: "dump-json";
|
|
492
|
-
readonly type: BooleanConstructor;
|
|
493
|
-
readonly description: "Write JSON output during the extraction";
|
|
494
|
-
readonly typeLabel: "{underline folder}";
|
|
495
|
-
}, {
|
|
496
|
-
readonly name: "no-ansi";
|
|
497
|
-
readonly type: BooleanConstructor;
|
|
498
|
-
readonly description: "Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.";
|
|
499
|
-
}, {
|
|
500
|
-
readonly name: "features";
|
|
501
|
-
readonly type: StringConstructor;
|
|
502
|
-
readonly description: `Features to track, supported are "all" or ${string}`;
|
|
503
|
-
readonly multiple: true;
|
|
504
|
-
readonly defaultValue: "all";
|
|
505
|
-
readonly typeLabel: "{underline names}";
|
|
506
|
-
}];
|
|
507
|
-
usageExample: string;
|
|
508
|
-
type: string;
|
|
509
|
-
masterScripts: string[];
|
|
510
|
-
};
|
|
511
390
|
};
|
|
512
391
|
export declare const scripts: Record<keyof typeof _scripts, ScriptInformation>;
|
|
513
392
|
/**
|
|
@@ -48,23 +48,6 @@ const _scripts = {
|
|
|
48
48
|
usageExample: 'export-quads "example.R" --output "example.quads"',
|
|
49
49
|
options: options_1.exportQuadsOptions,
|
|
50
50
|
type: 'master script',
|
|
51
|
-
},
|
|
52
|
-
'stats': {
|
|
53
|
-
toolName: 'stats',
|
|
54
|
-
target: 'statistics-app',
|
|
55
|
-
description: 'Generate usage Statistics for R scripts',
|
|
56
|
-
options: options_1.statisticOptions,
|
|
57
|
-
usageExample: 'stats -i example.R --output-dir "output-folder/"',
|
|
58
|
-
type: 'master script',
|
|
59
|
-
},
|
|
60
|
-
'stats-helper': {
|
|
61
|
-
toolName: 'stats-helper',
|
|
62
|
-
target: 'statistics-helper-app',
|
|
63
|
-
description: 'Generate usage Statistics for a single R script (parallel helper for stats)',
|
|
64
|
-
options: options_1.statisticHelperOptions,
|
|
65
|
-
usageExample: 'stats-helper -i example.R --output-dir "output-folder/"',
|
|
66
|
-
type: 'helper script',
|
|
67
|
-
masterScripts: ['stats']
|
|
68
51
|
}
|
|
69
52
|
};
|
|
70
53
|
exports.scripts = _scripts;
|
|
@@ -105,3 +105,8 @@ export declare const flowrMainOptionDefinitions: [{
|
|
|
105
105
|
readonly multiple: false;
|
|
106
106
|
}];
|
|
107
107
|
export declare const defaultConfigFile = "flowr.json";
|
|
108
|
+
/**
|
|
109
|
+
* Arguments to forward to a sub-script: everything the user passed except the script name token,
|
|
110
|
+
* which (being the default option) may appear before or after the main flowR options.
|
|
111
|
+
*/
|
|
112
|
+
export declare function getScriptArguments(script: string, argv?: readonly string[]): string[];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultConfigFile = exports.flowrMainOptionDefinitions = void 0;
|
|
4
4
|
exports.getScriptsText = getScriptsText;
|
|
5
|
+
exports.getScriptArguments = getScriptArguments;
|
|
5
6
|
const scripts_info_1 = require("./common/scripts-info");
|
|
6
7
|
let _scriptsText;
|
|
7
8
|
/**
|
|
@@ -128,4 +129,13 @@ exports.flowrMainOptionDefinitions = [
|
|
|
128
129
|
}
|
|
129
130
|
];
|
|
130
131
|
exports.defaultConfigFile = 'flowr.json';
|
|
132
|
+
/**
|
|
133
|
+
* Arguments to forward to a sub-script: everything the user passed except the script name token,
|
|
134
|
+
* which (being the default option) may appear before or after the main flowR options.
|
|
135
|
+
*/
|
|
136
|
+
function getScriptArguments(script, argv = process.argv) {
|
|
137
|
+
const passedArgs = argv.slice(2);
|
|
138
|
+
const scriptIndex = passedArgs.indexOf(script);
|
|
139
|
+
return scriptIndex < 0 ? [...passedArgs] : [...passedArgs.slice(0, scriptIndex), ...passedArgs.slice(scriptIndex + 1)];
|
|
140
|
+
}
|
|
131
141
|
//# sourceMappingURL=flowr-main-options.js.map
|
package/cli/flowr.js
CHANGED
|
@@ -1,11 +1,42 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.optionHelp = exports.toolName = void 0;
|
|
7
|
-
const server_1 = require("./repl/server/server");
|
|
8
|
-
const net_1 = require("./repl/server/net");
|
|
9
40
|
const version_1 = require("../util/version");
|
|
10
41
|
const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
11
42
|
const log_1 = require("../util/log");
|
|
@@ -17,6 +48,7 @@ const scripts_info_1 = require("./common/scripts-info");
|
|
|
17
48
|
const execute_1 = require("./repl/execute");
|
|
18
49
|
const repl_main_1 = require("./repl/commands/repl-main");
|
|
19
50
|
const core_1 = require("./repl/core");
|
|
51
|
+
const proc_1 = require("../util/proc");
|
|
20
52
|
const print_version_1 = require("./repl/print-version");
|
|
21
53
|
const flowr_main_options_1 = require("./flowr-main-options");
|
|
22
54
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -97,7 +129,7 @@ function hookSignalHandlers(engines) {
|
|
|
97
129
|
console.log(`\n${(0, ansi_1.italic)('Exiting...')}`);
|
|
98
130
|
}
|
|
99
131
|
Object.values(engines.engines).forEach(e => e?.close());
|
|
100
|
-
|
|
132
|
+
(0, proc_1.exitSafe)(0);
|
|
101
133
|
};
|
|
102
134
|
process.on('SIGINT', end);
|
|
103
135
|
process.on('SIGTERM', end);
|
|
@@ -120,12 +152,12 @@ async function mainRepl() {
|
|
|
120
152
|
(0, assert_1.guard)(target !== undefined, `Unknown script target "${options.script}", pick one of ${(0, flowr_main_options_1.getScriptsText)()}.`);
|
|
121
153
|
console.log(`Running script '${ansi_1.formatter.format(options.script, { style: 1 /* FontStyles.Bold */ })}'`);
|
|
122
154
|
log_1.log.debug(`Script maps to "${target}"`);
|
|
123
|
-
await (0, execute_1.waitOnScript)(`${__dirname}/${target}`, process.argv
|
|
124
|
-
|
|
155
|
+
await (0, execute_1.waitOnScript)(`${__dirname}/${target}`, (0, flowr_main_options_1.getScriptArguments)(options.script, process.argv), undefined, true);
|
|
156
|
+
return (0, proc_1.exitSafe)(0);
|
|
125
157
|
}
|
|
126
158
|
if (options.help) {
|
|
127
159
|
console.log((0, command_line_usage_1.default)(exports.optionHelp));
|
|
128
|
-
|
|
160
|
+
return (0, proc_1.exitSafe)(0);
|
|
129
161
|
}
|
|
130
162
|
const engines = await (0, engines_1.retrieveEngineInstances)(config);
|
|
131
163
|
const defaultEngine = engines.engines[engines.default];
|
|
@@ -134,7 +166,7 @@ async function mainRepl() {
|
|
|
134
166
|
await (0, version_1.printVersionInformation)(repl_main_1.standardReplOutput, engine);
|
|
135
167
|
engine?.close();
|
|
136
168
|
}
|
|
137
|
-
|
|
169
|
+
return (0, proc_1.exitSafe)(0);
|
|
138
170
|
}
|
|
139
171
|
hookSignalHandlers(engines);
|
|
140
172
|
const analyzer = new flowr_analyzer_builder_1.FlowrAnalyzerBuilder(false)
|
|
@@ -152,16 +184,21 @@ async function mainRepl() {
|
|
|
152
184
|
console.log(w('use ') + ansi_1.ansiFormatter.format(':help', { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }) + w(' to get a list of available commands.'));
|
|
153
185
|
await (0, core_1.repl)({ analyzer, allowRSessionAccess });
|
|
154
186
|
}
|
|
155
|
-
|
|
187
|
+
(0, proc_1.exitSafe)(0);
|
|
156
188
|
}
|
|
157
|
-
async function mainServer(
|
|
189
|
+
async function mainServer(useWebSocket) {
|
|
158
190
|
const config = createConfig();
|
|
159
191
|
const engines = await (0, engines_1.retrieveEngineInstances)(config);
|
|
160
192
|
hookSignalHandlers(engines);
|
|
161
|
-
|
|
193
|
+
// the server stack (incl. the `ws` websocket library) is only loaded when actually running a server,
|
|
194
|
+
// so the common one-shot analysis path does not pay for evaluating it
|
|
195
|
+
const { FlowRServer } = await Promise.resolve().then(() => __importStar(require('./repl/server/server')));
|
|
196
|
+
const { NetServer, WebSocketServerWrapper } = await Promise.resolve().then(() => __importStar(require('./repl/server/net')));
|
|
197
|
+
const backend = useWebSocket ? new WebSocketServerWrapper() : new NetServer();
|
|
198
|
+
await new FlowRServer(engines.engines, engines.default, options['r-session-access'], config, backend).start(options.port);
|
|
162
199
|
}
|
|
163
200
|
if (options.server) {
|
|
164
|
-
void mainServer(options.ws
|
|
201
|
+
void mainServer(options.ws);
|
|
165
202
|
}
|
|
166
203
|
else {
|
|
167
204
|
void mainRepl();
|