@eagleoutice/flowr 2.8.2 → 2.8.4

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.
Files changed (41) hide show
  1. package/cli/repl/core.js +22 -0
  2. package/config.d.ts +14 -0
  3. package/config.js +10 -2
  4. package/control-flow/extract-cfg.js +35 -14
  5. package/core/print/slice-diff-ansi.js +1 -1
  6. package/dataflow/environments/default-builtin-config.d.ts +2 -2
  7. package/dataflow/environments/default-builtin-config.js +8 -2
  8. package/dataflow/extractor.js +2 -2
  9. package/dataflow/graph/graph.js +0 -4
  10. package/dataflow/instrument/instrument-dataflow-count.d.ts +9 -0
  11. package/dataflow/instrument/instrument-dataflow-count.js +22 -0
  12. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +14 -7
  13. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +4 -2
  14. package/documentation/wiki-interface.js +3 -1
  15. package/documentation/wiki-query.js +1 -1
  16. package/linter/rules/unused-definition.js +6 -5
  17. package/package.json +1 -1
  18. package/project/context/flowr-analyzer-files-context.d.ts +1 -0
  19. package/project/context/flowr-file.d.ts +2 -0
  20. package/project/context/flowr-file.js +2 -0
  21. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +2 -0
  22. package/project/plugins/file-plugins/files/flowr-namespace-file.js +28 -0
  23. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +24 -0
  24. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +37 -0
  25. package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
  26. package/project/plugins/plugin-registry.d.ts +2 -1
  27. package/project/plugins/plugin-registry.js +3 -1
  28. package/queries/catalog/config-query/config-query-format.d.ts +2 -2
  29. package/queries/catalog/config-query/config-query-format.js +40 -2
  30. package/queries/catalog/dependencies-query/function-info/read-functions.js +8 -0
  31. package/queries/catalog/dependencies-query/function-info/write-functions.js +16 -3
  32. package/queries/query.d.ts +1 -1
  33. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +481 -447
  34. package/r-bridge/roxygen2/documentation-provider.d.ts +15 -0
  35. package/r-bridge/roxygen2/documentation-provider.js +115 -0
  36. package/r-bridge/roxygen2/roxygen-parse.d.ts +3 -1
  37. package/r-bridge/roxygen2/roxygen-parse.js +11 -5
  38. package/util/r-version.js +17 -1
  39. package/util/range.d.ts +1 -1
  40. package/util/range.js +1 -1
  41. package/util/version.js +1 -1
@@ -9,10 +9,11 @@ import { FlowrAnalyzerNamespaceFilesPlugin } from './file-plugins/flowr-analyzer
9
9
  import { FlowrAnalyzerNewsFilePlugin } from './file-plugins/flowr-analyzer-news-file-plugin';
10
10
  import { FlowrAnalyzerMetaVignetteFilesPlugin } from './file-plugins/flowr-analyzer-vignette-file-plugin';
11
11
  import { FlowrAnalyzerMetaTestFilesPlugin } from './file-plugins/flowr-analyzer-test-file-plugin';
12
+ import { FlowrAnalyzerLicenseFilePlugin } from './file-plugins/flowr-analyzer-license-file-plugin';
12
13
  /**
13
14
  * The built-in Flowr Analyzer plugins that are always available.
14
15
  */
15
- export declare const BuiltInPlugins: [["file:description", typeof FlowrAnalyzerDescriptionFilePlugin], ["versions:description", typeof FlowrAnalyzerPackageVersionsDescriptionFilePlugin], ["loading-order:description", typeof FlowrAnalyzerLoadingOrderDescriptionFilePlugin], ["files:vignette", typeof FlowrAnalyzerMetaVignetteFilesPlugin], ["files:test", typeof FlowrAnalyzerMetaTestFilesPlugin], ["file:rmd", typeof FlowrAnalyzerRmdFilePlugin], ["file:qmd", typeof FlowrAnalyzerQmdFilePlugin], ["file:ipynb", typeof FlowrAnalyzerJupyterFilePlugin], ["file:namespace", typeof FlowrAnalyzerNamespaceFilesPlugin], ["file:news", typeof FlowrAnalyzerNewsFilePlugin]];
16
+ export declare const BuiltInPlugins: [["file:description", typeof FlowrAnalyzerDescriptionFilePlugin], ["versions:description", typeof FlowrAnalyzerPackageVersionsDescriptionFilePlugin], ["loading-order:description", typeof FlowrAnalyzerLoadingOrderDescriptionFilePlugin], ["files:vignette", typeof FlowrAnalyzerMetaVignetteFilesPlugin], ["files:test", typeof FlowrAnalyzerMetaTestFilesPlugin], ["file:rmd", typeof FlowrAnalyzerRmdFilePlugin], ["file:qmd", typeof FlowrAnalyzerQmdFilePlugin], ["file:ipynb", typeof FlowrAnalyzerJupyterFilePlugin], ["file:namespace", typeof FlowrAnalyzerNamespaceFilesPlugin], ["file:news", typeof FlowrAnalyzerNewsFilePlugin], ["file:license", typeof FlowrAnalyzerLicenseFilePlugin]];
16
17
  export type BuiltInFlowrPluginName = typeof BuiltInPlugins[number][0];
17
18
  export type BuiltInFlowrPluginArgs<N extends BuiltInFlowrPluginName> = N extends typeof BuiltInPlugins[number][0] ? ConstructorParameters<Extract<typeof BuiltInPlugins[number], [N, PluginProducer]>[1]> : never;
18
19
  type PluginProducer = new (...args: never[]) => FlowrAnalyzerPlugin;
@@ -15,6 +15,7 @@ const flowr_analyzer_namespace_files_plugin_1 = require("./file-plugins/flowr-an
15
15
  const flowr_analyzer_news_file_plugin_1 = require("./file-plugins/flowr-analyzer-news-file-plugin");
16
16
  const flowr_analyzer_vignette_file_plugin_1 = require("./file-plugins/flowr-analyzer-vignette-file-plugin");
17
17
  const flowr_analyzer_test_file_plugin_1 = require("./file-plugins/flowr-analyzer-test-file-plugin");
18
+ const flowr_analyzer_license_file_plugin_1 = require("./file-plugins/flowr-analyzer-license-file-plugin");
18
19
  /**
19
20
  * The built-in Flowr Analyzer plugins that are always available.
20
21
  */
@@ -28,7 +29,8 @@ exports.BuiltInPlugins = [
28
29
  ['file:qmd', flowr_analyzer_qmd_file_plugin_1.FlowrAnalyzerQmdFilePlugin],
29
30
  ['file:ipynb', flowr_analyzer_jupyter_file_plugin_1.FlowrAnalyzerJupyterFilePlugin],
30
31
  ['file:namespace', flowr_analyzer_namespace_files_plugin_1.FlowrAnalyzerNamespaceFilesPlugin],
31
- ['file:news', flowr_analyzer_news_file_plugin_1.FlowrAnalyzerNewsFilePlugin]
32
+ ['file:news', flowr_analyzer_news_file_plugin_1.FlowrAnalyzerNewsFilePlugin],
33
+ ['file:license', flowr_analyzer_license_file_plugin_1.FlowrAnalyzerLicenseFilePlugin]
32
34
  ];
33
35
  /**
34
36
  * The registry of built-in and user-registered Flowr Analyzer plugins.
@@ -4,7 +4,7 @@ import { type OutputFormatter } from '../../../util/text/ansi';
4
4
  import Joi from 'joi';
5
5
  import type { FlowrConfigOptions } from '../../../config';
6
6
  import type { DeepPartial } from 'ts-essentials';
7
- import type { ParsedQueryLine } from '../../query';
7
+ import type { ParsedQueryLine, Query } from '../../query';
8
8
  import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
9
9
  import type { CommandCompletions } from '../../../cli/repl/core';
10
10
  export interface ConfigQuery extends BaseQueryFormat {
@@ -18,7 +18,7 @@ declare function configReplCompleter(partialLine: readonly string[], _startingNe
18
18
  declare function configQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions): ParsedQueryLine<'config'>;
19
19
  export declare const ConfigQueryDefinition: {
20
20
  readonly executor: typeof executeConfigQuery;
21
- readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
21
+ readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
22
22
  readonly completer: typeof configReplCompleter;
23
23
  readonly fromLine: typeof configQueryLineParser;
24
24
  readonly schema: Joi.ObjectSchema<any>;
@@ -74,12 +74,50 @@ function configQueryLineParser(output, line, _config) {
74
74
  return { query: [{ type: 'config' }]
75
75
  };
76
76
  }
77
+ function collectKeysFromUpdate(update, prefix = '') {
78
+ // only collect leaf keys
79
+ const keys = [];
80
+ for (const [key, value] of Object.entries(update)) {
81
+ const fullKey = prefix ? `${prefix}.${key}` : key;
82
+ if (value && typeof value === 'object' && !Array.isArray(value)) {
83
+ keys.push(...collectKeysFromUpdate(value, fullKey));
84
+ }
85
+ else {
86
+ keys.push(fullKey);
87
+ }
88
+ }
89
+ return keys;
90
+ }
91
+ function getValueAtPath(obj, path) {
92
+ let current = obj;
93
+ for (const key of path) {
94
+ if (current && typeof current === 'object' && current[key] !== undefined) {
95
+ current = current[key];
96
+ }
97
+ else {
98
+ return undefined;
99
+ }
100
+ }
101
+ return current;
102
+ }
77
103
  exports.ConfigQueryDefinition = {
78
104
  executor: config_query_executor_1.executeConfigQuery,
79
- asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
105
+ asciiSummarizer: (formatter, _analyzer, queryResults, result, queries) => {
80
106
  const out = queryResults;
81
107
  result.push(`Query: ${(0, ansi_1.bold)('config', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
82
- result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
108
+ const configQueries = queries.filter(q => q.type === 'config');
109
+ if (configQueries.some(q => q.update)) {
110
+ const updatedKeys = configQueries.flatMap(q => q.update ? collectKeysFromUpdate(q.update) : []);
111
+ result.push(' ╰ Updated configuration:');
112
+ for (const key of updatedKeys) {
113
+ const path = key.split('.');
114
+ const newValue = getValueAtPath(out.config, path);
115
+ result.push(` - ${key}: ${JSON.stringify(newValue, json_1.jsonReplacer)}`);
116
+ }
117
+ }
118
+ else {
119
+ result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
120
+ }
83
121
  return true;
84
122
  },
85
123
  completer: configReplCompleter,
@@ -100,5 +100,13 @@ exports.ReadFunctions = [
100
100
  { package: 'DBI', name: 'dbReadTable', argIdx: 1, argName: 'name', resolveValue: true },
101
101
  { package: 'DBI', name: 'dbReadTableArrow', argIdx: 1, argName: 'name', resolveValue: true },
102
102
  { package: 'jsonlite', name: 'read_json', argIdx: 0, argName: 'path', resolveValue: true },
103
+ { package: 'rpolars', name: 'pl_read_ipc', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
104
+ { package: 'rpolars', name: 'pl_read_csv', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
105
+ { package: 'rpolars', name: 'pl_read_ndjson', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
106
+ { package: 'rpolars', name: 'pl_read_parquet', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
107
+ { package: 'rpolars', name: 'pl_scan_csv', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
108
+ { package: 'rpolars', name: 'pl_scan_ipc', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
109
+ { package: 'rpolars', name: 'pl_scan_ndjson', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
110
+ { package: 'rpolars', name: 'pl_scan_parquet', argIdx: 0, argName: 'source', resolveValue: true, ignoreIf: 'arg-missing' },
103
111
  ];
104
112
  //# sourceMappingURL=read-functions.js.map
@@ -28,10 +28,14 @@ exports.WriteFunctions = [
28
28
  }
29
29
  },
30
30
  // write functions that don't have argIndex are assumed to write to stdout
31
- { package: 'base', name: 'print', linkTo: OutputRedirects, resolveValue: true },
31
+ { package: 'base', name: 'print', linkTo: OutputRedirects, resolveValue: false },
32
32
  { package: 'base', name: 'cat', linkTo: OutputRedirects, argName: 'file', resolveValue: true },
33
- { package: 'base', name: 'message', linkTo: OutputRedirects, resolveValue: true },
34
- { package: 'base', name: 'warning', linkTo: OutputRedirects, resolveValue: true },
33
+ { package: 'base', name: 'message', linkTo: OutputRedirects, resolveValue: false },
34
+ { package: 'base', name: 'warning', linkTo: OutputRedirects, resolveValue: false },
35
+ { package: 'rlang', name: 'warn', linkTo: OutputRedirects, resolveValue: false },
36
+ { package: 'rlang', name: 'info', linkTo: OutputRedirects, resolveValue: false },
37
+ { package: 'cli', name: 'cli_warn', linkTo: OutputRedirects, resolveValue: false },
38
+ { package: 'cli', name: 'cli_abort', linkTo: OutputRedirects, resolveValue: false },
35
39
  { package: 'base', name: 'writeLines', argIdx: 1, argName: 'con', resolveValue: true },
36
40
  { package: 'base', name: 'writeChar', argIdx: 1, argName: 'con', resolveValue: true },
37
41
  { package: 'base', name: 'writeBin', argIdx: 1, argName: 'con', resolveValue: true },
@@ -102,5 +106,14 @@ exports.WriteFunctions = [
102
106
  { package: 'rasterpdf', name: 'agg_pdf', argIdx: 0, argName: 'filename', resolveValue: true },
103
107
  { package: 'highcharter', name: 'hc_exporting', argName: 'filename', resolveValue: true },
104
108
  { package: 'jsonlite', name: 'write_json', argIdx: 1, argName: 'path', resolveValue: true },
109
+ { package: 'rpolars', name: 'sink_ipc', argIdx: 0, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
110
+ { package: 'rpolars', name: 'sink_csv', argIdx: 0, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
111
+ { package: 'rpolars', name: 'sink_ndjson', argIdx: 0, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
112
+ { package: 'rpolars', name: 'sink_parquet', argIdx: 0, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
113
+ { package: 'rpolars', name: 'lazyframe__lazy_sink_csv', argIdx: 0, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
114
+ { package: 'rpolars', name: 'write_ipc', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
115
+ { package: 'rpolars', name: 'write_csv', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
116
+ { package: 'rpolars', name: 'write_ndjson', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
117
+ { package: 'rpolars', name: 'write_parquet', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
105
118
  ];
106
119
  //# sourceMappingURL=write-functions.js.map
@@ -78,7 +78,7 @@ export declare const SupportedQueries: {
78
78
  };
79
79
  readonly config: {
80
80
  readonly executor: typeof import("./catalog/config-query/config-query-executor").executeConfigQuery;
81
- readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
81
+ readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
82
82
  readonly completer: (partialLine: readonly string[], _startingNewArg: boolean, config: FlowrConfigOptions) => CommandCompletions;
83
83
  readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"config">;
84
84
  readonly schema: Joi.ObjectSchema<any>;