datagrok-tools 4.13.39 → 4.13.41

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 CHANGED
@@ -1,6 +1,18 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
3
 
4
+ ## 4.13.41 (2024-11-29)
5
+
6
+ ### Features
7
+
8
+ * Publish refresh orientates on debug versions of packages
9
+
10
+ ## 4.13.41 (2024-11-29)
11
+
12
+ ### Features
13
+
14
+ * Added ability to run auto tests by core variable
15
+
4
16
  ## 4.13.39 (2024-11-26)
5
17
 
6
18
  ### Features
@@ -371,7 +371,7 @@ function checkFuncSignatures(packagePath, files) {
371
371
  var vr = checkFunctions[roles[0]](f);
372
372
  if (!vr.value) warnings.push("File ".concat(file, ", function ").concat(f.name, ":\n").concat(vr.message));
373
373
  }
374
- if (f.isInvalidateOnWithoutCache) warnings.push("File ".concat(file, ", function ").concat(f.name, ": Cant use invalidateOn without cache, please follow this example: 'meta.cache.invalidateOn'"));
374
+ if (f.isInvalidateOnWithoutCache) warnings.push("File ".concat(file, ", function ").concat(f.name, ": Can't use invalidateOn without cache, please follow this example: 'meta.cache.invalidateOn'"));
375
375
  if (f.cache) if (!utils.cahceValues.includes(f.cache)) warnings.push("File ".concat(file, ", function ").concat(f.name, ": unsupposed variable for cache : ").concat(f.cache));
376
376
  if (f.invalidateOn) if (!utils.isValidCron(f.invalidateOn)) warnings.push("File ".concat(file, ", function ").concat(f.name, ": unsupposed variable for invalidateOn : ").concat(f.invalidateOn));
377
377
  };
@@ -12,7 +12,7 @@ var HELP_CONFIG = "\nUsage: grok config\n\nCreate or update a configuration file
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
13
  var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [-k | --key] [--suffix] [--all] [--refresh] [--link]\n\n--all Publish all available packages \n--refresh Publish all available already loaded packages \n--link \t Link the package to local utils\n\nRunning `grok publish` is the same as running `grok publish defaultHost --build --debug`\n";
14
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
- 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";
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 & auto tests & core tests (core tests run only from DevTools package)\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";
18
18
 
@@ -17,9 +17,9 @@ var _os = _interopRequireDefault(require("os"));
17
17
  var _path = _interopRequireDefault(require("path"));
18
18
  var _ignoreWalk = _interopRequireDefault(require("ignore-walk"));
19
19
  var _jsYaml = _interopRequireDefault(require("js-yaml"));
20
+ var _testUtils = require("../utils/test-utils");
20
21
  var _check = require("./check");
21
22
  var utils = _interopRequireWildcard(require("../utils/utils"));
22
- var _testUtils = require("../utils/test-utils");
23
23
  var color = _interopRequireWildcard(require("../utils/color-utils"));
24
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -302,7 +302,7 @@ function publish(_x7) {
302
302
  }
303
303
  function _publish() {
304
304
  _publish = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(args) {
305
- var host, baseUrl, url, packagesToLoad;
305
+ var _process$env$HOST, host, baseUrl, url, cfg, key, token, packagesToLoad;
306
306
  return _regenerator["default"].wrap(function _callee3$(_context3) {
307
307
  while (1) switch (_context3.prev = _context3.next) {
308
308
  case 0:
@@ -310,7 +310,7 @@ function _publish() {
310
310
  encoding: 'utf-8'
311
311
  }));
312
312
  if (!(args.refresh || args.all)) {
313
- _context3.next = 23;
313
+ _context3.next = 28;
314
314
  break;
315
315
  }
316
316
  if (_path["default"].basename(curDir) !== 'packages') curDir = _path["default"].dirname(curDir);
@@ -318,46 +318,59 @@ function _publish() {
318
318
  if (args['_'].length === 2) host = args['_'][1];
319
319
  utils.setHost(host, config);
320
320
  baseUrl = config['servers'][host]['url'];
321
- url = "".concat(baseUrl, "/info/packages");
321
+ url = (_process$env$HOST = process.env.HOST) !== null && _process$env$HOST !== void 0 ? _process$env$HOST : '';
322
+ cfg = (0, _testUtils.getDevKey)(url);
323
+ url = cfg.url;
324
+ key = cfg.key;
325
+ _context3.next = 13;
326
+ return (0, _testUtils.getToken)(url, key);
327
+ case 13:
328
+ token = _context3.sent;
329
+ url = "".concat(baseUrl, "/packages/published/current");
322
330
  packagesToLoad = ['all'];
323
331
  console.log(url);
324
332
  if (!args.refresh) {
325
- _context3.next = 18;
333
+ _context3.next = 23;
326
334
  break;
327
335
  }
328
- _context3.t0 = Object;
329
- _context3.next = 14;
330
- return (0, _nodeFetch["default"])(url);
331
- case 14:
332
- _context3.next = 16;
336
+ _context3.next = 20;
337
+ return (0, _nodeFetch["default"])(url, {
338
+ method: 'GET',
339
+ headers: {
340
+ 'Authorization': token // Attach cookies here
341
+ }
342
+ });
343
+ case 20:
344
+ _context3.next = 22;
333
345
  return _context3.sent.json();
334
- case 16:
335
- _context3.t1 = _context3.sent;
336
- packagesToLoad = _context3.t0.keys.call(_context3.t0, _context3.t1);
337
- case 18:
346
+ case 22:
347
+ packagesToLoad = _context3.sent.map(function (item) {
348
+ return item.name;
349
+ });
350
+ case 23:
338
351
  console.log('Loading packages:');
339
- _context3.next = 21;
352
+ _context3.next = 26;
340
353
  return (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, args.link, args.release);
341
- case 21:
342
- _context3.next = 32;
354
+ case 26:
355
+ _context3.next = 37;
343
356
  break;
344
- case 23:
357
+ case 28:
345
358
  if (!args.link) {
346
- _context3.next = 30;
359
+ _context3.next = 35;
347
360
  break;
348
361
  }
349
- _context3.next = 26;
362
+ _context3.next = 31;
350
363
  return utils.runScript("npm install", curDir);
351
- case 26:
352
- _context3.next = 28;
364
+ case 31:
365
+ _context3.next = 33;
353
366
  return utils.runScript("grok link", curDir);
354
- case 28:
355
- _context3.next = 30;
367
+ case 33:
368
+ _context3.next = 35;
356
369
  return utils.runScript("npm run build", curDir);
357
- case 30:
358
- _context3.next = 32;
370
+ case 35:
371
+ _context3.next = 37;
359
372
  return publishPackage(args);
360
- case 32:
373
+ case 37:
361
374
  case "end":
362
375
  return _context3.stop();
363
376
  }
@@ -52,24 +52,25 @@ function _test() {
52
52
  packagesDir = _path["default"].basename(curDir) === "packages" ? curDir : _path["default"].dirname(curDir);
53
53
  console.log('Environment variable `TARGET_PACKAGE` is set to', packageName);
54
54
  if (args.platform && packageName !== 'ApiTests') color.warn('--platform flag can only be used in the ApiTests package');
55
- if (args.core && packageName !== 'DevTools') color.warn('--core flag can only be used in the DevTools package');
55
+ // if (args.core && packageName !== 'DevTools')
56
+ // color.warn('--core flag can only be used in the DevTools package');
56
57
  if (args["package"]) {
57
- _context.next = 13;
58
+ _context.next = 12;
58
59
  break;
59
60
  }
60
- _context.next = 13;
61
+ _context.next = 12;
61
62
  return testUtils.loadPackages(packagesDir, packageName, args.host, args['skip-publish'], args['skip-build'], args.link);
62
- case 13:
63
+ case 12:
63
64
  process.env.TARGET_PACKAGE = packageName;
64
- _context.next = 16;
65
+ _context.next = 15;
65
66
  return runTesting(args);
66
- case 16:
67
+ case 15:
67
68
  res = _context.sent;
68
69
  if (args.csv) (0, _testUtils.saveCsvResults)([res.csv], csvReportDir);
69
70
  (0, _testUtils.printWorkersResult)(res, args.verbose);
70
71
  if (!res) testUtils.exitWithCode(1);else testUtils.exitWithCode(0);
71
72
  return _context.abrupt("return", true);
72
- case 21:
73
+ case 20:
73
74
  case "end":
74
75
  return _context.stop();
75
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.13.39",
3
+ "version": "4.13.41",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {