datagrok-tools 4.13.33 → 4.13.35
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/CHANGELOG.md +12 -0
- package/bin/commands/help.js +3 -3
- package/bin/commands/publish.js +17 -16
- package/bin/utils/test-utils.js +12 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/commands/help.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.help = void 0;
|
|
7
|
-
var HELP = "\nUsage: grok <command>\n\nDatagrok's package management tool\n\nCommands:\n add Add an object template\n api Create wrapper functions\n check Check package content (function signatures, etc.)\n config Create and manage config files\n create Create a package\n init Modify a package template\n link Link `datagrok-api` and libraries for local development\n publish Upload a package\n
|
|
7
|
+
var HELP = "\nUsage: grok <command>\n\nDatagrok's package management tool\n\nCommands:\n add Add an object template\n api Create wrapper functions\n check Check package content (function signatures, etc.)\n config Create and manage config files\n create Create a package\n init Modify a package template\n link Link `datagrok-api` and libraries for local development\n publish Upload a package\n test Run package tests\n testAll Run packages tests\n\nTo get help on a particular command, use:\n grok <command> --help\n\nRead more about the package development workflow:\nhttps://datagrok.ai/help/develop/develop\n";
|
|
8
8
|
var HELP_ADD = "\nUsage: grok add <entity> <name>\n\nAdd an object template to your package:\n\ngrok add app <name>\ngrok add connection <name>\ngrok add detector <semantic-type-name>\ngrok add function [tag] <name>\ngrok add query <name>\ngrok add script [tag] <language> <name>\ngrok add view <name>\ngrok add viewer <name>\ngrok add tests\n\nPlease note that entity names may only include letters and numbers\n\nSupported languages for scripts:\njavascript, julia, node, octave, python, r\n\nAvailable tags:\npanel, init\n";
|
|
9
9
|
var HELP_INIT = "\nUsage: grok init\n\nModify a package template by adding config files for linters, IDE, etc.\n\nOptions:\n[--eslint] [--ide] [--test] [--ts] [--git]\n\n--eslint Add a configuration for eslint\n--ide Add an IDE-specific configuration for debugging (vscode)\n--test Add tests support (TypeScript packages only)\n--ts Convert a JavaScript package to TypeScript\n--git Configure GIT and install commit linting tools.\n Read more: https://datagrok.ai/help/develop/advanced/git-policy\n";
|
|
10
10
|
var HELP_API = "\nUsage: grok api\n\nCreate wrapper functions for package scripts and queries\n";
|
|
11
11
|
var HELP_CONFIG = "\nUsage: grok config\n\nCreate or update a configuration file\n\nOptions:\n[--reset] [--server] [--alias] [-k | --key]\n\n--reset Restore the default config file template\n--server Use to add a server to the config (`grok config add --alias alias --server url --key key`)\n--alias Use in conjunction with the `server` option to set the server name\n--key Use in conjunction with the `server` option to set the developer key\n--default Use in conjunction with the `server` option to set the added server as default\n";
|
|
12
12
|
var HELP_CREATE = "\nUsage: grok create [name]\n\nCreate a package:\n\ngrok create Create a package in the current working directory\ngrok create <name> Create a package in a folder with the specified name\n\nPlease note that the package name may only include letters, numbers, underscores, or hyphens\n\nOptions:\n[--eslint] [--ide] [--js | --ts] [--test]\n\n--eslint Add a configuration for eslint\n--ide Add an IDE-specific configuration for debugging (vscode)\n--js Create a JavaScript package\n--ts Create a TypeScript package (default)\n--test Add tests support (TypeScript packages only)\n";
|
|
13
|
-
var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [-k | --key] [--suffix]\n\nRunning `grok publish` is the same as running `grok publish defaultHost --build --debug`\n";
|
|
14
|
-
var HELP_CHECK = "\nUsage: grok check\n\nOptions:\n[-r | --recursive]\n\n--recursive Check all packages in the current directory\n
|
|
13
|
+
var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [-k | --key] [--suffix] [--all] [--refresh]\n\n--all Publish all available packages \n--refresh Publish all available already loaded packages \n\nRunning `grok publish` is the same as running `grok publish defaultHost --build --debug`\n";
|
|
14
|
+
var HELP_CHECK = "\nUsage: grok check\n\nOptions:\n[-r | --recursive]\n\n--recursive Check all packages in the current directory\n\nCheck package content (function signatures, import statements of external modules, etc.)\n";
|
|
15
15
|
var HELP_TEST = "\nUsage: grok test\n\nOptions:\n[--package] [--category] [--test] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link] [--catchUnhandled] [--report] [--record] [--verbose] [--platform] [--benchmark] [--stress-test]\n\n--package Specify a package name to run tests for\n--category Specify a category name to run tests for\n--test Specify a test name to run \n--host Host alias as in the config file\n--csv Save the test report in a CSV file\n--gui Launch graphical interface (non-headless mode)\n--catchUnhandled Catch unhandled exceptions during test execution (default=true)\n--report Report failed tests to audit, notifies package author (default=false)\n--skip-build Skip the package build step\n--skip-publish Skip the package publication step\n--link \t Link the package to local utils\n--record Records the test execution process in mp4 format\n--verbose Prints detailed information about passed and skipped tests in the console\n--platform Runs only platform tests (applicable for ApiTests package only)\n--core Runs package & core tests (applicable for DevTools package only)\n--benchmark \t Runs tests in benchmark mode\n--stress-test Runs shuffled stress-test only\n \nRun package tests\n\nSee instructions:\nhttps://datagrok.ai/help/develop/how-to/test-packages#local-testing\n";
|
|
16
16
|
var HELP_TESTALL = "\nUsage: grok testall\n\nOptions:\n[--packages] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link-package] [--catchUnhandled] [--report] [--record] [--verbose] [--benchmark] [--stress-test] [--order] [--tags] [--testRepeat] [--workersCount]\n\n--packages Specify a packages names to run tests for\n--host Host alias as in the config file\n--csv Save the test report in a CSV file\n--gui Launch graphical interface (non-headless mode)\n--catchUnhandled Catch unhandled exceptions during test execution (default=true)\n--report Report failed tests to audit, notifies packages author (default=false)\n--skip-build Skip the packages build step\n--skip-publish Skip the packages publication step\n--link-package \t Link the packages to local utils\n--record Records the test execution process in mp4 format\n--verbose Prints detailed information about passed and skipped tests in the console\n--core Runs packages & core tests (applicable for DevTools packages only)\n--benchmark \t Runs tests in benchmark mode\n--stress-test Runs shuffled stress-test only\n--order Specify order for tests invocation\n--tags Filter tests by tag name for run\n--testRepeat Set amount of tests repeats\n--workersCount Set amount of workers for tests run\n\nRun tests of all or specified packages \n\nSee instructions:\nhttps://datagrok.ai/help/develop/how-to/test-packages#local-testing\n";
|
|
17
17
|
var HELP_LINK = "\nUsage: grok link\n\nLink `datagrok-api` and libraries for local development\n";
|
package/bin/commands/publish.js
CHANGED
|
@@ -38,9 +38,7 @@ var confTemplate = _jsYaml["default"].load(_fs["default"].readFileSync(confTempl
|
|
|
38
38
|
var curDir = process.cwd();
|
|
39
39
|
var packDir = _path["default"].join(curDir, 'package.json');
|
|
40
40
|
var packageFiles = ['src/package.ts', 'src/detectors.ts', 'src/package.js', 'src/detectors.js', 'src/package-test.ts', 'src/package-test.js', 'package.js', 'detectors.js'];
|
|
41
|
-
var config
|
|
42
|
-
encoding: 'utf-8'
|
|
43
|
-
}));
|
|
41
|
+
var config;
|
|
44
42
|
function processPackage(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
45
43
|
return _processPackage.apply(this, arguments);
|
|
46
44
|
}
|
|
@@ -309,8 +307,11 @@ function _publish() {
|
|
|
309
307
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
310
308
|
while (1) switch (_context3.prev = _context3.next) {
|
|
311
309
|
case 0:
|
|
310
|
+
config = _jsYaml["default"].load(_fs["default"].readFileSync(confPath, {
|
|
311
|
+
encoding: 'utf-8'
|
|
312
|
+
}));
|
|
312
313
|
if (!(args.refresh || args.all)) {
|
|
313
|
-
_context3.next =
|
|
314
|
+
_context3.next = 23;
|
|
314
315
|
break;
|
|
315
316
|
}
|
|
316
317
|
if (_path["default"].basename(curDir) !== 'packages') curDir = _path["default"].dirname(curDir);
|
|
@@ -322,29 +323,29 @@ function _publish() {
|
|
|
322
323
|
packagesToLoad = ['all'];
|
|
323
324
|
console.log(url);
|
|
324
325
|
if (!args.refresh) {
|
|
325
|
-
_context3.next =
|
|
326
|
+
_context3.next = 18;
|
|
326
327
|
break;
|
|
327
328
|
}
|
|
328
329
|
_context3.t0 = Object;
|
|
329
|
-
_context3.next =
|
|
330
|
+
_context3.next = 14;
|
|
330
331
|
return (0, _nodeFetch["default"])(url);
|
|
331
|
-
case
|
|
332
|
-
_context3.next =
|
|
332
|
+
case 14:
|
|
333
|
+
_context3.next = 16;
|
|
333
334
|
return _context3.sent.json();
|
|
334
|
-
case
|
|
335
|
+
case 16:
|
|
335
336
|
_context3.t1 = _context3.sent;
|
|
336
337
|
packagesToLoad = _context3.t0.keys.call(_context3.t0, _context3.t1);
|
|
337
|
-
case
|
|
338
|
+
case 18:
|
|
338
339
|
console.log('Loading packages:');
|
|
339
|
-
_context3.next =
|
|
340
|
+
_context3.next = 21;
|
|
340
341
|
return (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, false, args.release);
|
|
341
|
-
case
|
|
342
|
-
_context3.next =
|
|
342
|
+
case 21:
|
|
343
|
+
_context3.next = 25;
|
|
343
344
|
break;
|
|
344
|
-
case
|
|
345
|
-
_context3.next =
|
|
345
|
+
case 23:
|
|
346
|
+
_context3.next = 25;
|
|
346
347
|
return publishPackage(args);
|
|
347
|
-
case
|
|
348
|
+
case 25:
|
|
348
349
|
case "end":
|
|
349
350
|
return _context3.stop();
|
|
350
351
|
}
|
package/bin/utils/test-utils.js
CHANGED
|
@@ -303,13 +303,6 @@ function exitWithCode(code) {
|
|
|
303
303
|
console.log("Exiting with code ".concat(code));
|
|
304
304
|
process.exit(code);
|
|
305
305
|
}
|
|
306
|
-
var TestContext = exports.TestContext = /*#__PURE__*/(0, _createClass2["default"])(function TestContext(catchUnhandled, report) {
|
|
307
|
-
(0, _classCallCheck2["default"])(this, TestContext);
|
|
308
|
-
(0, _defineProperty2["default"])(this, "catchUnhandled", true);
|
|
309
|
-
(0, _defineProperty2["default"])(this, "report", false);
|
|
310
|
-
if (catchUnhandled !== undefined) this.catchUnhandled = catchUnhandled;
|
|
311
|
-
if (report !== undefined) this.report = report;
|
|
312
|
-
});
|
|
313
306
|
var recorderConfig = exports.recorderConfig = {
|
|
314
307
|
followNewTab: true,
|
|
315
308
|
fps: 25,
|
|
@@ -459,7 +452,7 @@ function _loadTestsList() {
|
|
|
459
452
|
_iterator3,
|
|
460
453
|
_step3,
|
|
461
454
|
testPackage,
|
|
462
|
-
|
|
455
|
+
_key,
|
|
463
456
|
_iterator4,
|
|
464
457
|
_step4,
|
|
465
458
|
testValue,
|
|
@@ -547,9 +540,9 @@ function _loadTestsList() {
|
|
|
547
540
|
try {
|
|
548
541
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
549
542
|
testPackage = _step3.value;
|
|
550
|
-
for (
|
|
551
|
-
if (testPackage.tests.hasOwnProperty(
|
|
552
|
-
_iterator4 = _createForOfIteratorHelper(testPackage.tests[
|
|
543
|
+
for (_key in testPackage.tests) {
|
|
544
|
+
if (testPackage.tests.hasOwnProperty(_key)) {
|
|
545
|
+
_iterator4 = _createForOfIteratorHelper(testPackage.tests[_key].tests);
|
|
553
546
|
try {
|
|
554
547
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
555
548
|
testValue = _step4.value;
|
|
@@ -788,4 +781,11 @@ function _mergeWorkersResults() {
|
|
|
788
781
|
}, _callee11, null, [[2, 23, 26, 29]]);
|
|
789
782
|
}));
|
|
790
783
|
return _mergeWorkersResults.apply(this, arguments);
|
|
791
|
-
}
|
|
784
|
+
}
|
|
785
|
+
var TestContext = exports.TestContext = /*#__PURE__*/(0, _createClass2["default"])(function TestContext(catchUnhandled, report) {
|
|
786
|
+
(0, _classCallCheck2["default"])(this, TestContext);
|
|
787
|
+
(0, _defineProperty2["default"])(this, "catchUnhandled", true);
|
|
788
|
+
(0, _defineProperty2["default"])(this, "report", false);
|
|
789
|
+
if (catchUnhandled !== undefined) this.catchUnhandled = catchUnhandled;
|
|
790
|
+
if (report !== undefined) this.report = report;
|
|
791
|
+
});
|
package/package.json
CHANGED