datagrok-tools 4.13.40 → 4.13.43

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,7 +1,19 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
3
 
4
- ## 4.13.40 (2024-11-29)
4
+ ## 4.13.43 (2024-12-02)
5
+
6
+ ### Features
7
+
8
+ * Publish visual updates
9
+
10
+ ## 4.13.42 (2024-11-29)
11
+
12
+ ### Features
13
+
14
+ * Publish refresh orientates on debug versions of packages
15
+
16
+ ## 4.13.41 (2024-11-29)
5
17
 
6
18
  ### Features
7
19
 
@@ -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
  };
@@ -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 = 27;
314
314
  break;
315
315
  }
316
316
  if (_path["default"].basename(curDir) !== 'packages') curDir = _path["default"].dirname(curDir);
@@ -318,46 +318,58 @@ 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
- console.log(url);
324
331
  if (!args.refresh) {
325
- _context3.next = 18;
332
+ _context3.next = 22;
326
333
  break;
327
334
  }
328
- _context3.t0 = Object;
329
- _context3.next = 14;
330
- return (0, _nodeFetch["default"])(url);
331
- case 14:
332
- _context3.next = 16;
335
+ _context3.next = 19;
336
+ return (0, _nodeFetch["default"])(url, {
337
+ method: 'GET',
338
+ headers: {
339
+ 'Authorization': token // Attach cookies here
340
+ }
341
+ });
342
+ case 19:
343
+ _context3.next = 21;
333
344
  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:
345
+ case 21:
346
+ packagesToLoad = _context3.sent.map(function (item) {
347
+ return item.name;
348
+ });
349
+ case 22:
338
350
  console.log('Loading packages:');
339
- _context3.next = 21;
351
+ _context3.next = 25;
340
352
  return (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, args.link, args.release);
341
- case 21:
342
- _context3.next = 32;
353
+ case 25:
354
+ _context3.next = 36;
343
355
  break;
344
- case 23:
356
+ case 27:
345
357
  if (!args.link) {
346
- _context3.next = 30;
358
+ _context3.next = 34;
347
359
  break;
348
360
  }
349
- _context3.next = 26;
350
- return utils.runScript("npm install", curDir);
351
- case 26:
352
- _context3.next = 28;
353
- return utils.runScript("grok link", curDir);
354
- case 28:
355
361
  _context3.next = 30;
356
- return utils.runScript("npm run build", curDir);
362
+ return utils.runScript("npm install", curDir);
357
363
  case 30:
358
364
  _context3.next = 32;
359
- return publishPackage(args);
365
+ return utils.runScript("grok link", curDir);
360
366
  case 32:
367
+ _context3.next = 34;
368
+ return utils.runScript("npm run build", curDir);
369
+ case 34:
370
+ _context3.next = 36;
371
+ return publishPackage(args);
372
+ case 36:
361
373
  case "end":
362
374
  return _context3.stop();
363
375
  }
@@ -368,7 +368,7 @@ function _loadPackages() {
368
368
  break;
369
369
  }
370
370
  _context6.prev = 14;
371
- console.log("Loading package ".concat(dirName));
371
+ process.stdout.write("Building and publishing ".concat(dirName, "..."));
372
372
  if (!(skipPublish != true)) {
373
373
  _context6.next = 27;
374
374
  break;
@@ -394,13 +394,13 @@ function _loadPackages() {
394
394
  return utils.runScript("grok publish ".concat(hostString).concat(release ? ' --release' : ''), packageDir);
395
395
  case 27:
396
396
  packagesToRun.set(dirName, true);
397
- console.log("Package published ".concat(dirName));
397
+ process.stdout.write(" success!\n");
398
398
  _context6.next = 34;
399
399
  break;
400
400
  case 31:
401
401
  _context6.prev = 31;
402
402
  _context6.t0 = _context6["catch"](14);
403
- console.log("Package wasn't published ".concat(dirName));
403
+ process.stdout.write(" fail!\n");
404
404
  case 34:
405
405
  _context6.next = 39;
406
406
  break;
@@ -334,7 +334,7 @@ function _runScript() {
334
334
  _context2.prev = 11;
335
335
  _context2.t0 = _context2["catch"](1);
336
336
  console.error("Execution failed: ".concat(_context2.t0.message));
337
- throw new Error("Cant run script");
337
+ throw new Error("Cant run script ".concat(script));
338
338
  case 15:
339
339
  case "end":
340
340
  return _context2.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.13.40",
3
+ "version": "4.13.43",
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": {