@eagleoutice/flowr 1.3.12 → 1.3.14

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.
@@ -1,19 +1,17 @@
1
1
  /// <reference types="node" />
2
- /// <reference types="node" />
3
2
  /**
4
3
  * Basically a helper file to allow the main 'flowr' script (located in the source root) to provide its repl
5
4
  *
6
5
  * @module
7
6
  */
8
7
  import { RShell } from '../../r-bridge';
9
- import readline from 'readline/promises';
10
8
  import { ReplOutput } from './commands';
11
- import { ReadLineOptions } from 'node:readline';
9
+ import * as readline from 'node:readline';
12
10
  /**
13
11
  * Used by the repl to provide automatic completions for a given (partial) input line
14
12
  */
15
13
  export declare function replCompleter(line: string): [string[], string];
16
- export declare const DEFAULT_REPL_READLINE_CONFIGURATION: ReadLineOptions;
14
+ export declare const DEFAULT_REPL_READLINE_CONFIGURATION: readline.ReadLineOptions;
17
15
  /**
18
16
  * This function interprets the given `expr` as a REPL command (see {@link repl} for more on the semantics).
19
17
  *
package/cli/repl/core.js CHANGED
@@ -1,6 +1,26 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.repl = exports.replProcessAnswer = exports.DEFAULT_REPL_READLINE_CONFIGURATION = exports.replCompleter = void 0;
@@ -10,10 +30,10 @@ exports.repl = exports.replProcessAnswer = exports.DEFAULT_REPL_READLINE_CONFIGU
10
30
  * @module
11
31
  */
12
32
  const r_bridge_1 = require("../../r-bridge");
13
- const promises_1 = __importDefault(require("readline/promises"));
14
33
  const statistics_1 = require("../../statistics");
15
34
  const prompt_1 = require("./prompt");
16
35
  const commands_1 = require("./commands");
36
+ const readline = __importStar(require("node:readline"));
17
37
  const args_1 = require("../../util/args");
18
38
  const execute_1 = require("./commands/execute");
19
39
  const replCompleterKeywords = Array.from(commands_1.commandNames, s => `:${s}`);
@@ -77,12 +97,19 @@ exports.replProcessAnswer = replProcessAnswer;
77
97
  * For the execution, this function makes use of {@link replProcessAnswer}
78
98
  *
79
99
  */
80
- async function repl(shell = new r_bridge_1.RShell({ revive: 'always' }), rl = promises_1.default.createInterface(exports.DEFAULT_REPL_READLINE_CONFIGURATION), output = commands_1.standardReplOutput) {
100
+ async function repl(shell = new r_bridge_1.RShell({ revive: 'always' }), rl = readline.createInterface(exports.DEFAULT_REPL_READLINE_CONFIGURATION), output = commands_1.standardReplOutput) {
81
101
  // the incredible repl :D, we kill it with ':quit'
82
102
  // eslint-disable-next-line no-constant-condition,@typescript-eslint/no-unnecessary-condition
83
103
  while (true) {
84
- const answer = await rl.question((0, prompt_1.prompt)());
85
- await replProcessAnswer(output, answer, shell);
104
+ await new Promise((resolve, reject) => {
105
+ rl.question((0, prompt_1.prompt)(), answer => {
106
+ rl.pause();
107
+ replProcessAnswer(output, answer, shell).then(() => {
108
+ rl.resume();
109
+ resolve();
110
+ }).catch(reject);
111
+ });
112
+ });
86
113
  }
87
114
  }
88
115
  exports.repl = repl;
@@ -1,21 +1,41 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.requestAnalysisMessage = void 0;
7
- const joi_1 = __importDefault(require("joi"));
27
+ const Joi = __importStar(require("joi"));
8
28
  exports.requestAnalysisMessage = {
9
29
  type: 'request-file-analysis',
10
- schema: joi_1.default.object({
11
- type: joi_1.default.string().valid('request-file-analysis').required(),
12
- id: joi_1.default.string().optional(),
13
- filetoken: joi_1.default.string().optional(),
14
- filename: joi_1.default.string().optional(),
15
- content: joi_1.default.string().optional(),
16
- filepath: joi_1.default.string().optional(),
17
- cfg: joi_1.default.boolean().optional(),
18
- format: joi_1.default.string().valid('json', 'n-quads').optional()
30
+ schema: Joi.object({
31
+ type: Joi.string().valid('request-file-analysis').required(),
32
+ id: Joi.string().optional(),
33
+ filetoken: Joi.string().optional(),
34
+ filename: Joi.string().optional(),
35
+ content: Joi.string().optional(),
36
+ filepath: Joi.string().optional(),
37
+ cfg: Joi.boolean().optional(),
38
+ format: Joi.string().valid('json', 'n-quads').optional()
19
39
  }).xor('content', 'filepath')
20
40
  };
21
41
  //# sourceMappingURL=analysis.js.map
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import Joi from 'joi';
6
+ import * as Joi from 'joi';
7
7
  import { FlowrHelloResponseMessage } from './hello';
8
8
  import { FileAnalysisRequestMessage, FileAnalysisResponseMessageJson } from './analysis';
9
9
  import { ExecuteEndMessage, ExecuteIntermediateResponseMessage, ExecuteRequestMessage } from './repl';
@@ -1,6 +1,26 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.baseMessage = void 0;
@@ -9,12 +29,12 @@ exports.baseMessage = void 0;
9
29
  *
10
30
  * @module
11
31
  */
12
- const joi_1 = __importDefault(require("joi"));
32
+ const Joi = __importStar(require("joi"));
13
33
  exports.baseMessage = {
14
34
  type: '**base**',
15
- schema: joi_1.default.object({
16
- type: joi_1.default.string().required(),
17
- id: joi_1.default.string().optional()
35
+ schema: Joi.object({
36
+ type: Joi.string().required(),
37
+ id: Joi.string().optional()
18
38
  }).unknown(true)
19
39
  };
20
40
  //# sourceMappingURL=messages.js.map
@@ -1,17 +1,37 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.requestExecuteReplExpressionMessage = void 0;
7
- const joi_1 = __importDefault(require("joi"));
27
+ const Joi = __importStar(require("joi"));
8
28
  exports.requestExecuteReplExpressionMessage = {
9
29
  type: 'request-repl-execution',
10
- schema: joi_1.default.object({
11
- type: joi_1.default.string().valid('request-repl-execution').required(),
12
- id: joi_1.default.string().optional(),
13
- ansi: joi_1.default.boolean().optional(),
14
- expression: joi_1.default.string().required(),
30
+ schema: Joi.object({
31
+ type: Joi.string().valid('request-repl-execution').required(),
32
+ id: Joi.string().optional(),
33
+ ansi: Joi.boolean().optional(),
34
+ expression: Joi.string().required(),
15
35
  })
16
36
  };
17
37
  //# sourceMappingURL=repl.js.map
@@ -1,17 +1,37 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.requestSliceMessage = void 0;
7
- const joi_1 = __importDefault(require("joi"));
27
+ const Joi = __importStar(require("joi"));
8
28
  exports.requestSliceMessage = {
9
29
  type: 'request-slice',
10
- schema: joi_1.default.object({
11
- type: joi_1.default.string().valid('request-slice').required(),
12
- id: joi_1.default.string().optional(),
13
- filetoken: joi_1.default.string().required(),
14
- criterion: joi_1.default.array().items(joi_1.default.string().regex(/\d+:\d+|\d+@.*|\$\d+/)).min(0).required()
30
+ schema: Joi.object({
31
+ type: Joi.string().valid('request-slice').required(),
32
+ id: Joi.string().optional(),
33
+ filetoken: Joi.string().required(),
34
+ criterion: Joi.array().items(Joi.string().regex(/\d+:\d+|\d+@.*|\$\d+/)).min(0).required()
15
35
  })
16
36
  };
17
37
  //# sourceMappingURL=slice.js.map
@@ -1,4 +1,4 @@
1
- import Joi from 'joi';
1
+ import * as Joi from 'joi';
2
2
  import { FlowrMessage, IdMessageBase, MessageDefinition } from './messages/messages';
3
3
  import { Socket } from './net';
4
4
  export interface ValidationErrorResult {
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
- "main": "dist/src/flowr.js",
6
5
  "types": "dist/src/index.d.ts",
7
6
  "repository": {
8
7
  "type": "git",
@@ -337,7 +336,6 @@
337
336
  "@types/n-readlines": "^1.0.6",
338
337
  "@types/n3": "^1.16.4",
339
338
  "@types/object-hash": "^3.0.6",
340
- "@types/semver": "^7.5.6",
341
339
  "@types/tmp": "^0.2.6",
342
340
  "@types/xml2js": "^0.4.14",
343
341
  "@typescript-eslint/eslint-plugin": "^6.13.2",
@@ -355,7 +353,6 @@
355
353
  "mocha-multi-reporters": "^1.5.1",
356
354
  "nyc": "^15.1.0",
357
355
  "release-it": "^17.0.1",
358
- "ts-essentials": "^9.4.1",
359
356
  "ts-node": "^10.9.2",
360
357
  "typedoc": "^0.25.4",
361
358
  "typedoc-plugin-missing-exports": "^2.1.0",
@@ -364,6 +361,7 @@
364
361
  "typescript": "^5.3.3"
365
362
  },
366
363
  "dependencies": {
364
+ "@types/semver": "^7.5.6",
367
365
  "@types/tar": "^6.1.10",
368
366
  "@xmldom/xmldom": "^0.8.10",
369
367
  "command-line-args": "^5.2.1",
@@ -377,6 +375,7 @@
377
375
  "semver": "^7.5.4",
378
376
  "tar": "^6.2.0",
379
377
  "tmp": "^0.2.1",
378
+ "ts-essentials": "^9.4.1",
380
379
  "tslog": "^4.9.2",
381
380
  "xml2js": "^0.6.2",
382
381
  "xpath-ts2": "^1.4.2"