datagrok-tools 4.13.40 → 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,7 +1,13 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
3
 
4
- ## 4.13.40 (2024-11-29)
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)
5
11
 
6
12
  ### Features
7
13
 
@@ -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 = 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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.13.40",
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": {