@eagleoutice/flowr 2.15.10 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -26
- package/abstract-interpretation/data-frame/arguments.js +11 -7
- package/cli/flowr-main-options.d.ts +15 -0
- package/cli/flowr-main-options.js +18 -0
- package/cli/flowr.d.ts +18 -0
- package/cli/flowr.js +13 -2
- package/cli/repl/commands/repl-clipboard.js +2 -1
- package/cli/repl/commands/repl-commands.js +2 -0
- package/cli/repl/commands/repl-main.d.ts +5 -0
- package/cli/repl/commands/repl-signature.js +2 -0
- package/cli/repl/core.d.ts +7 -1
- package/cli/repl/core.js +17 -8
- package/cli/repl/execute.js +2 -0
- package/cli/repl/server/connection.js +2 -1
- package/cli/repl/server/net.d.ts +10 -0
- package/cli/repl/server/net.js +34 -1
- package/cli/slicer-app.js +2 -1
- package/config.d.ts +12 -2
- package/config.js +91 -14
- package/control-flow/happens-before.d.ts +5 -0
- package/control-flow/happens-before.js +48 -34
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +29 -42
- package/dataflow/environments/built-in-props.d.ts +9 -0
- package/dataflow/environments/built-in-props.js +25 -19
- package/dataflow/environments/built-in.d.ts +2 -2
- package/dataflow/environments/built-in.js +41 -77
- package/dataflow/environments/default-builtin-config.d.ts +181 -29
- package/dataflow/environments/default-builtin-config.js +38 -24
- package/dataflow/environments/environment.d.ts +6 -4
- package/dataflow/environments/environment.js +54 -121
- package/dataflow/environments/identifier.d.ts +4 -2
- package/dataflow/environments/identifier.js +23 -69
- package/dataflow/environments/reference-to-maybe.d.ts +9 -0
- package/dataflow/environments/reference-to-maybe.js +23 -51
- package/dataflow/environments/resolve-by-name.js +37 -76
- package/dataflow/eval/resolve/resolve-argument.d.ts +3 -1
- package/dataflow/eval/resolve/resolve-argument.js +61 -64
- package/dataflow/eval/resolve/resolve-working-directory.d.ts +8 -2
- package/dataflow/eval/resolve/resolve-working-directory.js +12 -20
- package/dataflow/eval/resolve/resolve.d.ts +4 -0
- package/dataflow/eval/resolve/resolve.js +23 -14
- package/dataflow/extractor.js +185 -59
- package/dataflow/fn/class-declaration.d.ts +8 -2
- package/dataflow/fn/class-declaration.js +96 -97
- package/dataflow/fn/exceptions-of-function.js +68 -37
- package/dataflow/fn/frame-reflection.d.ts +12 -4
- package/dataflow/fn/frame-reflection.js +64 -42
- package/dataflow/fn/function-props.js +15 -33
- package/dataflow/fn/function-semantics.d.ts +11 -3
- package/dataflow/fn/function-semantics.js +6 -0
- package/dataflow/fn/higher-order-function.js +13 -17
- package/dataflow/fn/strict-function.d.ts +13 -0
- package/dataflow/fn/strict-function.js +285 -122
- package/dataflow/graph/call-graph.d.ts +7 -6
- package/dataflow/graph/call-graph.js +35 -46
- package/dataflow/graph/graph.d.ts +6 -1
- package/dataflow/graph/graph.js +57 -66
- package/dataflow/info.d.ts +8 -1
- package/dataflow/info.js +24 -30
- package/dataflow/internal/control-flow.d.ts +42 -4
- package/dataflow/internal/control-flow.js +76 -39
- package/dataflow/internal/linker.d.ts +15 -9
- package/dataflow/internal/linker.js +253 -241
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +80 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +441 -79
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +51 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +119 -185
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +7 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +122 -147
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +55 -25
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +290 -252
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +30 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +68 -67
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +72 -126
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +10 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +8 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +12 -28
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +40 -118
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +16 -24
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +93 -102
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +7 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +173 -114
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +22 -27
- package/dataflow/internal/process/functions/call/built-in/built-in-with.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +34 -9
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +120 -93
- package/dataflow/internal/process/functions/call/common.d.ts +1 -3
- package/dataflow/internal/process/functions/call/common.js +36 -76
- package/dataflow/internal/process/functions/call/deferred.d.ts +6 -2
- package/dataflow/internal/process/functions/call/deferred.js +60 -58
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +4 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +65 -68
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +3 -5
- package/dataflow/internal/process/functions/call/named-call-handling.js +44 -21
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -0
- package/dataflow/internal/process/functions/call/quoted.js +162 -172
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +17 -38
- package/dataflow/internal/process/functions/process-parameter.js +25 -32
- package/dataflow/internal/process/process-symbol.js +3 -6
- package/dataflow/internal/program-order.d.ts +26 -0
- package/dataflow/internal/program-order.js +49 -0
- package/documentation/doc-capabilities.js +4 -1
- package/documentation/wiki-interface.js +4 -0
- package/documentation/wiki-setup.js +23 -0
- package/engines.js +11 -3
- package/linter/linter-executor.js +19 -1
- package/linter/linter-rules.d.ts +17 -8
- package/linter/rules/absolute-path.js +63 -87
- package/linter/rules/file-path-validity.d.ts +4 -2
- package/linter/rules/file-path-validity.js +117 -80
- package/linter/rules/namespace-access.js +21 -33
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +60 -48
- package/linter/rules/network-functions.js +11 -7
- package/linter/rules/no-leaked-credentials.js +15 -18
- package/linter/rules/problematic-inputs.d.ts +2 -1
- package/linter/rules/problematic-inputs.js +39 -59
- package/linter/rules/roxygen-arguments.d.ts +9 -4
- package/linter/rules/roxygen-arguments.js +29 -48
- package/linter/rules/seeded-randomness.d.ts +7 -4
- package/linter/rules/seeded-randomness.js +130 -89
- package/linter/rules/stop-with-call-arg.d.ts +4 -2
- package/linter/rules/stop-with-call-arg.js +25 -22
- package/linter/rules/unclosed-connection.js +31 -24
- package/linter/rules/undefined-symbol.d.ts +4 -6
- package/linter/rules/undefined-symbol.js +58 -75
- package/linter/rules/unescaped-arguments.js +18 -44
- package/linter/rules/unused-definition.d.ts +6 -0
- package/linter/rules/unused-definition.js +105 -145
- package/linter/rules/unused-import.d.ts +3 -0
- package/linter/rules/unused-import.js +25 -43
- package/package.json +5 -2
- package/project/flowr-analyzer.js +6 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +8 -12
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +14 -5
- package/project/plugins/file-plugins/files/flowr-rda-file.js +35 -24
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +7 -5
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +34 -56
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +18 -42
- package/project/sigdb/decompress.js +3 -1
- package/project/sigdb/sigdb-download.js +9 -6
- package/queries/base-query-format.js +1 -2
- package/queries/catalog/absint-query/absint-query-format.js +1 -1
- package/queries/catalog/config-query/config-query-executor.js +9 -2
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +2 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +4 -7
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +50 -114
- package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +5 -9
- package/queries/catalog/dependencies-query/function-info/library-functions.js +6 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/write-functions.js +7 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +4 -4
- package/queries/catalog/input-sources-query/simple-input-classifier.js +192 -301
- package/r-bridge/lang-4.x/ast/model/model.d.ts +3 -1
- package/r-bridge/lang-4.x/ast/model/model.js +19 -43
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -12
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/r-bridge/roxygen2/roxygen-parse.js +28 -42
- package/r-bridge/shell-executor.js +2 -0
- package/r-bridge/shell.js +8 -0
- package/search/search-executor/search-enrichers.js +25 -37
- package/slicing/static/slice-call.d.ts +4 -3
- package/slicing/static/slice-call.js +56 -88
- package/slicing/static/static-slicer.js +120 -79
- package/slicing/static/visiting-queue.d.ts +4 -6
- package/slicing/static/visiting-queue.js +9 -13
- package/util/files.d.ts +6 -0
- package/util/files.js +12 -0
- package/util/parallel.js +2 -0
- package/util/proc.js +2 -1
- package/util/r-base-packages.d.ts +2 -0
- package/util/r-base-packages.js +23 -13
- package/util/secure-mode.d.ts +42 -0
- package/util/secure-mode.js +70 -0
- package/util/text/playground-link.d.ts +12 -3
- package/util/text/playground-link.js +18 -27
- package/util/version.js +4 -10
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* flowR's secure mode, for analyzing untrusted code (e.g., on a server that accepts arbitrary projects).
|
|
4
|
+
*
|
|
5
|
+
* Once enabled, it stays enabled for the lifetime of the process: there is deliberately no way to disable it.
|
|
6
|
+
* Instead of trying to find every path that may lead to a dangerous operation, the operations themselves
|
|
7
|
+
* (starting R or any other process, accessing the network, using the clipboard) check {@link SecureMode.guard}, so
|
|
8
|
+
* code added later is covered as well. Configuration is restricted on top (see {@link FlowrConfig.fromFile}).
|
|
9
|
+
*
|
|
10
|
+
* Enable it with `--secure` on the command line, the environment variable {@link SecureMode.EnvVar}, or {@link SecureMode.enable}.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SecureMode = exports.SecureModeError = void 0;
|
|
14
|
+
exports.isTruthyEnvValue = isTruthyEnvValue;
|
|
15
|
+
/** Environment variable that enables {@link SecureMode} when flowR is loaded. */
|
|
16
|
+
const EnvVar = 'FLOWR_SECURE_MODE';
|
|
17
|
+
/** Thrown by {@link SecureMode.guard} if a forbidden operation is attempted in secure mode. */
|
|
18
|
+
class SecureModeError extends Error {
|
|
19
|
+
operation;
|
|
20
|
+
constructor(operation, detail) {
|
|
21
|
+
super(`flowR runs in secure mode, which forbids ${operation}${detail ? ` (${detail})` : ''}`);
|
|
22
|
+
this.operation = operation;
|
|
23
|
+
this.name = 'SecureModeError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.SecureModeError = SecureModeError;
|
|
27
|
+
/** Whether `value` (of an environment variable) switches something on. */
|
|
28
|
+
function isTruthyEnvValue(value) {
|
|
29
|
+
const v = value?.trim().toLowerCase();
|
|
30
|
+
return v !== undefined && v !== '' && v !== '0' && v !== 'false' && v !== 'no' && v !== 'off';
|
|
31
|
+
}
|
|
32
|
+
let enabled = typeof process !== 'undefined' && isTruthyEnvValue(process.env?.[EnvVar]);
|
|
33
|
+
/**
|
|
34
|
+
* The process-wide secure mode, see the module documentation.
|
|
35
|
+
* @helper security
|
|
36
|
+
*/
|
|
37
|
+
exports.SecureMode = {
|
|
38
|
+
EnvVar,
|
|
39
|
+
/** Enables the secure mode for the rest of the process's lifetime (there is no way back). */
|
|
40
|
+
enable() {
|
|
41
|
+
enabled = true;
|
|
42
|
+
if (typeof process !== 'undefined' && process.env) {
|
|
43
|
+
// inherited by every child process flowR may (legitimately) start before, e.g., a worker
|
|
44
|
+
process.env[EnvVar] = '1';
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* In secure mode, decompressing a file of the analyzed project must not yield more than this many bytes,
|
|
49
|
+
* so a decompression bomb cannot exhaust the memory. Use {@link SecureMode.decompressionLimit}.
|
|
50
|
+
*/
|
|
51
|
+
MaxDecompressedBytes: 512 * 1024 * 1024,
|
|
52
|
+
/** The maximum number of bytes decompressing a project file may yield, `undefined` (no limit) outside the secure mode. */
|
|
53
|
+
decompressionLimit() {
|
|
54
|
+
return enabled ? exports.SecureMode.MaxDecompressedBytes : undefined;
|
|
55
|
+
},
|
|
56
|
+
/** Whether the secure mode is enabled. */
|
|
57
|
+
isEnabled() {
|
|
58
|
+
return enabled;
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Call this right before performing the given operation.
|
|
62
|
+
* @throws a {@link SecureModeError} if the secure mode is enabled
|
|
63
|
+
*/
|
|
64
|
+
guard(operation, detail) {
|
|
65
|
+
if (enabled) {
|
|
66
|
+
throw new SecureModeError(operation, detail);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=secure-mode.js.map
|
|
@@ -19,11 +19,18 @@ export declare enum PlaygroundBox {
|
|
|
19
19
|
* - a {@link PlaygroundBox} is one of the boxes of the page itself
|
|
20
20
|
* @see {@link Mark.isValid} to check one, {@link Mark.compress} to shorten a list
|
|
21
21
|
*/
|
|
22
|
-
export type PlaygroundMark = `${number}` | `${number}-${number}` | `${number}:${number}` | `${number}@${string}` | `lint:${string}` | `dep:${string}` | PlaygroundBox;
|
|
22
|
+
export type PlaygroundMark = `${number}` | `${number}-${number}` | `${number}:${number}` | `${number}@${string}` | `${number}(${string})` | `lint:${string}` | `dep:${string}` | PlaygroundBox;
|
|
23
23
|
/** everything a link can say about the page it opens; whatever is left out the page fills in itself */
|
|
24
24
|
export interface PlaygroundLinkParts {
|
|
25
25
|
/** the script the page opens with; left out, the page keeps its own sample */
|
|
26
26
|
readonly code?: string;
|
|
27
|
+
/** the file name of that script, `main.R` when left out */
|
|
28
|
+
readonly name?: string;
|
|
29
|
+
/** the other files of the project, in the order flowR loads them, all before the opened one */
|
|
30
|
+
readonly files?: readonly {
|
|
31
|
+
name: string;
|
|
32
|
+
code: string;
|
|
33
|
+
}[];
|
|
27
34
|
/** what the page marks when it opens, and what alt-click toggles from there on */
|
|
28
35
|
readonly marks?: readonly PlaygroundMark[];
|
|
29
36
|
/** the boxes that open folded away, for whatever the example is not about */
|
|
@@ -59,6 +66,8 @@ export declare const Playground: {
|
|
|
59
66
|
name: string;
|
|
60
67
|
/** where the page these links point at is served from */
|
|
61
68
|
BaseRef: string;
|
|
69
|
+
/** the name of the file a link opens on when it names none */
|
|
70
|
+
MainFile: string;
|
|
62
71
|
/** what a link can point at */
|
|
63
72
|
Mark: {
|
|
64
73
|
/**
|
|
@@ -90,8 +99,8 @@ export declare const Playground: {
|
|
|
90
99
|
/** The keys back out of that field, which older links wrote out plainly and which is read either way. */
|
|
91
100
|
unpackConfig(this: void, field: string | null | undefined): string[];
|
|
92
101
|
/**
|
|
93
|
-
* Everything a fragment does not carry as itself is escaped, so a
|
|
94
|
-
* quotes travel as `%5B`, `%7B` and `%22` rather than as characters a chat client, a markdown reader or
|
|
102
|
+
* The non-empty fields as a fragment. Everything a fragment does not carry as itself is escaped, so a
|
|
103
|
+
* configuration's brackets, braces and quotes travel as `%5B`, `%7B` and `%22` rather than as characters a chat client, a markdown reader or
|
|
95
104
|
* a terminal cuts the address at. What is left is what {@link FragmentSafe} lists: a fragment is not a
|
|
96
105
|
* query, so `,`, `:` and `;` stand in it as they are and keep a link readable. `&` and `+` are escaped
|
|
97
106
|
* beyond that, the first because it separates the fields here and the second because a reader takes it
|
|
@@ -15,8 +15,8 @@ var PlaygroundBox;
|
|
|
15
15
|
/** what the linter found */
|
|
16
16
|
PlaygroundBox["Lints"] = "lints";
|
|
17
17
|
})(PlaygroundBox || (exports.PlaygroundBox = PlaygroundBox = {}));
|
|
18
|
-
/** a mark that stands for a place in the script: a line, a range, a column, or a name on a line */
|
|
19
|
-
const CodeMarkPattern = /^\d+(:\d+|-\d+|@.+)?$/;
|
|
18
|
+
/** a mark that stands for a place in the script: a line, a range, a column, or a name on a line, in another file with a `(file-regex)` */
|
|
19
|
+
const CodeMarkPattern = /^\d+(:\d+|-\d+|@.+)?(\(.+\))?$/;
|
|
20
20
|
/** a mark that stands for what an analysis found: `lint:<rule>[@<line>]`, `dep:<kind>[@<line>]` */
|
|
21
21
|
const FoundMarkPattern = /^(lint|dep):[^@,]+(@\d+)?$/;
|
|
22
22
|
/** how many lines one range may stand for, so a hand-written link cannot ask for a million marks */
|
|
@@ -94,6 +94,8 @@ exports.Playground = {
|
|
|
94
94
|
name: 'Playground',
|
|
95
95
|
/** where the page these links point at is served from */
|
|
96
96
|
BaseRef: 'https://flowr-analysis.github.io/flowr/wiki/playground/',
|
|
97
|
+
/** the name of the file a link opens on when it names none */
|
|
98
|
+
MainFile: 'main.R',
|
|
97
99
|
/** what a link can point at */
|
|
98
100
|
Mark,
|
|
99
101
|
/** the boxes of the page a mark can point at */
|
|
@@ -103,23 +105,8 @@ exports.Playground = {
|
|
|
103
105
|
* sits, and how the page is laid out.
|
|
104
106
|
*/
|
|
105
107
|
link(parts) {
|
|
106
|
-
const { code, marks = [], collapsed = [], at, forward, dim, replOpen, wholeSlice, config = [], split, repl } = parts;
|
|
108
|
+
const { code, name, files = [], marks = [], collapsed = [], at, forward, dim, replOpen, wholeSlice, config = [], split, repl } = parts;
|
|
107
109
|
const base = parts.base ?? exports.Playground.BaseRef;
|
|
108
|
-
const fields = [];
|
|
109
|
-
if (code !== undefined && code.length > 0) {
|
|
110
|
-
fields.push(['c', (0, url_encoding_1.packForUrl)(code)]);
|
|
111
|
-
}
|
|
112
|
-
if (config.length > 0) {
|
|
113
|
-
fields.push(['k', exports.Playground.packConfig(config)]);
|
|
114
|
-
}
|
|
115
|
-
const kept = Mark.compress(marks);
|
|
116
|
-
if (kept.length > 0) {
|
|
117
|
-
fields.push(['h', kept.join(',')]);
|
|
118
|
-
}
|
|
119
|
-
const folded = (0, arrays_1.uniqueArray)(collapsed).filter(box => Object.values(PlaygroundBox).includes(box));
|
|
120
|
-
if (folded.length > 0) {
|
|
121
|
-
fields.push(['f', folded.join(',')]);
|
|
122
|
-
}
|
|
123
110
|
/* one field for everything about the layout, with the trailing empty parts dropped */
|
|
124
111
|
const view = [
|
|
125
112
|
split === undefined ? '' : String(split),
|
|
@@ -129,15 +116,19 @@ exports.Playground = {
|
|
|
129
116
|
while (view.length > 0 && view[view.length - 1].length === 0) {
|
|
130
117
|
view.pop();
|
|
131
118
|
}
|
|
132
|
-
if (view.length > 0) {
|
|
133
|
-
fields.push(['v', view.join(',')]);
|
|
134
|
-
}
|
|
135
119
|
const position = at === undefined ? undefined
|
|
136
120
|
: code === undefined ? (/^\d+:\d+$/.test(at) ? at : undefined) : exports.Playground.positionOf(code, at);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
121
|
+
/* an empty field is left out of the link */
|
|
122
|
+
const hash = exports.Playground.hash([
|
|
123
|
+
['c', code ? (0, url_encoding_1.packForUrl)(code) : ''],
|
|
124
|
+
['n', name !== undefined && name !== exports.Playground.MainFile ? name : ''],
|
|
125
|
+
['o', files.length > 0 ? (0, url_encoding_1.packForUrl)(JSON.stringify(files.map(f => [f.name, f.code]))) : ''],
|
|
126
|
+
['k', config.length > 0 ? exports.Playground.packConfig(config) : ''],
|
|
127
|
+
['h', Mark.compress(marks).join(',')],
|
|
128
|
+
['f', (0, arrays_1.uniqueArray)(collapsed).filter(box => Object.values(PlaygroundBox).includes(box)).join(',')],
|
|
129
|
+
['v', view.join(',')],
|
|
130
|
+
['p', position ?? '']
|
|
131
|
+
]);
|
|
141
132
|
return hash.length > 0 ? `${base}#${hash}` : base;
|
|
142
133
|
},
|
|
143
134
|
/**
|
|
@@ -157,8 +148,8 @@ exports.Playground = {
|
|
|
157
148
|
return text.split(';').filter(key => key.length > 0);
|
|
158
149
|
},
|
|
159
150
|
/**
|
|
160
|
-
* Everything a fragment does not carry as itself is escaped, so a
|
|
161
|
-
* quotes travel as `%5B`, `%7B` and `%22` rather than as characters a chat client, a markdown reader or
|
|
151
|
+
* The non-empty fields as a fragment. Everything a fragment does not carry as itself is escaped, so a
|
|
152
|
+
* configuration's brackets, braces and quotes travel as `%5B`, `%7B` and `%22` rather than as characters a chat client, a markdown reader or
|
|
162
153
|
* a terminal cuts the address at. What is left is what {@link FragmentSafe} lists: a fragment is not a
|
|
163
154
|
* query, so `,`, `:` and `;` stand in it as they are and keep a link readable. `&` and `+` are escaped
|
|
164
155
|
* beyond that, the first because it separates the fields here and the second because a reader takes it
|
package/util/version.js
CHANGED
|
@@ -42,9 +42,9 @@ const assert_1 = require("./assert");
|
|
|
42
42
|
const sigdb_download_1 = require("../project/sigdb/sigdb-download");
|
|
43
43
|
const doc_files_1 = require("../documentation/doc-util/doc-files");
|
|
44
44
|
// this is automatically replaced with the current version by release-it
|
|
45
|
-
const version = '2.
|
|
46
|
-
// this is automatically replaced with the release date by release-it (
|
|
47
|
-
const versionDate = '2026-10-
|
|
45
|
+
const version = '2.16.1';
|
|
46
|
+
// this is automatically replaced with the release date by release-it (scripts/bump-version.ts)
|
|
47
|
+
const versionDate = '2026-10-15T16:13:39Z';
|
|
48
48
|
/**
|
|
49
49
|
* Retrieves the current flowR version as a new {@link SemVer} object.
|
|
50
50
|
*/
|
|
@@ -116,13 +116,7 @@ async function printVersionInformation(output, input, engineOnly = false) {
|
|
|
116
116
|
// plugin/dataflow graph) into `util/version`, which `util/assert` depends on
|
|
117
117
|
const { BuiltInPlugins } = await Promise.resolve().then(() => __importStar(require('../project/plugins/plugin-registry')));
|
|
118
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
|
-
}
|
|
119
|
+
const activated = new Set(ctx.activatedPlugins.values().map(cls => keyByClass.get(cls)));
|
|
126
120
|
const render = (full, suffix) => trace && !activated.has(full) ? dim(suffix) : suffix;
|
|
127
121
|
const labelWidth = Math.max(...[...byPrefix.keys()].map(p => p.length));
|
|
128
122
|
const header = `registered plugins (${names.length})`;
|