datagrok-tools 4.13.52 → 4.13.54
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 +14 -0
- package/bin/commands/check.js +6 -1
- package/bin/commands/test-all.js +50 -2
- package/bin/utils/utils.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Datagrok-tools changelog
|
|
2
2
|
|
|
3
|
+
## 4.13.54 (2025-01-06)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* Grok check regex update
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 4.13.53 (2025-01-06)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* Updated csv output for test all(added workes id)
|
|
15
|
+
|
|
16
|
+
|
|
3
17
|
## 4.13.52 (2024-12-30)
|
|
4
18
|
|
|
5
19
|
### Features
|
package/bin/commands/check.js
CHANGED
|
@@ -247,6 +247,7 @@ function checkFuncSignatures(packagePath, files) {
|
|
|
247
247
|
var message = '';
|
|
248
248
|
if (inputs.length !== 0) {
|
|
249
249
|
value = false;
|
|
250
|
+
console.log(inputs);
|
|
250
251
|
message += 'Viewer functions should take no arguments\n';
|
|
251
252
|
}
|
|
252
253
|
if (outputs.length > 1 || outputs.length === 1 && outputs[0].type !== 'viewer') {
|
|
@@ -369,7 +370,9 @@ function checkFuncSignatures(packagePath, files) {
|
|
|
369
370
|
});
|
|
370
371
|
if (roles.length > 1) warnings.push("File ".concat(file, ", function ").concat(f.name, ": several function roles are used (").concat(roles.join(', '), ")"));else if (roles.length === 1) {
|
|
371
372
|
var vr = checkFunctions[roles[0]](f);
|
|
372
|
-
if (!vr.value)
|
|
373
|
+
if (!vr.value) {
|
|
374
|
+
warnings.push("File ".concat(file, ", function ").concat(f.name, ":\n").concat(vr.message));
|
|
375
|
+
}
|
|
373
376
|
}
|
|
374
377
|
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
378
|
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));
|
|
@@ -630,6 +633,7 @@ function getFuncMetadata(script, fileExtention) {
|
|
|
630
633
|
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
631
634
|
var line = _step11.value;
|
|
632
635
|
if (!line) continue;
|
|
636
|
+
if (data.name === 'MCL' || data.name === 'MCLClustering') console.log(line);
|
|
633
637
|
//@ts-ignore
|
|
634
638
|
var match = line.match(utils.fileParamRegex[fileExtention]);
|
|
635
639
|
if (match) {
|
|
@@ -661,6 +665,7 @@ function getFuncMetadata(script, fileExtention) {
|
|
|
661
665
|
if (isHeader) {
|
|
662
666
|
var nm = line.match(utils.nameRegex);
|
|
663
667
|
if (nm && !match) {
|
|
668
|
+
if (data.name === 'MCL' || data.name === 'MCLClustering') console.log(data);
|
|
664
669
|
data.name = data.name || nm[1];
|
|
665
670
|
funcData.push(data);
|
|
666
671
|
data = {
|
package/bin/commands/test-all.js
CHANGED
|
@@ -16,6 +16,7 @@ var utils = _interopRequireWildcard(require("../utils/utils"));
|
|
|
16
16
|
var _testUtils = _interopRequireWildcard(require("../utils/test-utils"));
|
|
17
17
|
var testUtils = _testUtils;
|
|
18
18
|
var _orderFunctions = require("../utils/order-functions");
|
|
19
|
+
var Papa = _interopRequireWildcard(require("papaparse"));
|
|
19
20
|
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); }
|
|
20
21
|
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; }
|
|
21
22
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
@@ -271,7 +272,7 @@ function runTests(_x5, _x6) {
|
|
|
271
272
|
}
|
|
272
273
|
function _runTests() {
|
|
273
274
|
_runTests = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(browsersOrder, browserOptions) {
|
|
274
|
-
var browsersCommands, _iterator3, _step3, browserOrder, browsersPromises, _i, _browsersCommands, browserCommands, resultObjects;
|
|
275
|
+
var browsersCommands, _iterator3, _step3, browserOrder, browsersPromises, _i, _browsersCommands, browserCommands, resultObjects, i;
|
|
275
276
|
return _regenerator["default"].wrap(function _callee4$(_context5) {
|
|
276
277
|
while (1) switch (_context5.prev = _context5.next) {
|
|
277
278
|
case 0:
|
|
@@ -308,12 +309,59 @@ function _runTests() {
|
|
|
308
309
|
return Promise.all(browsersPromises);
|
|
309
310
|
case 7:
|
|
310
311
|
resultObjects = _context5.sent;
|
|
311
|
-
|
|
312
|
+
i = 0;
|
|
312
313
|
case 9:
|
|
314
|
+
if (!(i < resultObjects.length)) {
|
|
315
|
+
_context5.next = 16;
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
_context5.next = 12;
|
|
319
|
+
return addBrowserColumn(resultObjects[i].csv, i);
|
|
320
|
+
case 12:
|
|
321
|
+
resultObjects[i].csv = _context5.sent;
|
|
322
|
+
case 13:
|
|
323
|
+
i++;
|
|
324
|
+
_context5.next = 9;
|
|
325
|
+
break;
|
|
326
|
+
case 16:
|
|
327
|
+
return _context5.abrupt("return", resultObjects);
|
|
328
|
+
case 17:
|
|
313
329
|
case "end":
|
|
314
330
|
return _context5.stop();
|
|
315
331
|
}
|
|
316
332
|
}, _callee4);
|
|
317
333
|
}));
|
|
318
334
|
return _runTests.apply(this, arguments);
|
|
335
|
+
}
|
|
336
|
+
function addBrowserColumn(_x7, _x8) {
|
|
337
|
+
return _addBrowserColumn.apply(this, arguments);
|
|
338
|
+
}
|
|
339
|
+
function _addBrowserColumn() {
|
|
340
|
+
_addBrowserColumn = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(csv, workerNumber) {
|
|
341
|
+
var result;
|
|
342
|
+
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
|
343
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
344
|
+
case 0:
|
|
345
|
+
result = "";
|
|
346
|
+
Papa.parse(csv, {
|
|
347
|
+
header: true,
|
|
348
|
+
skipEmptyLines: true,
|
|
349
|
+
complete: function complete(results) {
|
|
350
|
+
var dataWithDefaultColumn = results.data.map(function (row) {
|
|
351
|
+
row["worker"] = workerNumber;
|
|
352
|
+
return row;
|
|
353
|
+
});
|
|
354
|
+
result = Papa.unparse(dataWithDefaultColumn, {
|
|
355
|
+
header: true
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
return _context6.abrupt("return", result);
|
|
360
|
+
case 3:
|
|
361
|
+
case "end":
|
|
362
|
+
return _context6.stop();
|
|
363
|
+
}
|
|
364
|
+
}, _callee5);
|
|
365
|
+
}));
|
|
366
|
+
return _addBrowserColumn.apply(this, arguments);
|
|
319
367
|
}
|
package/bin/utils/utils.js
CHANGED
|
@@ -261,7 +261,7 @@ var fileParamRegex = exports.fileParamRegex = {
|
|
|
261
261
|
sql: new RegExp("^--\\s*((?:".concat(headerTags.join('|'), ")[^:]*): *([^\\s\\[\\{]+) ?([^\\s\\[\\{]+)?[^\\n]*$"))
|
|
262
262
|
};
|
|
263
263
|
var nameAnnRegex = exports.nameAnnRegex = /\/\/\s*(name[^:]*): ([^\n\r\[\{]+)/;
|
|
264
|
-
var nameRegex = exports.nameRegex = /(?:|static
|
|
264
|
+
var nameRegex = exports.nameRegex = /(?:|(?:static)(?:export )(?:async )function )\s+([a-zA-Z_][a-zA-Z0-9_$]*)\s*\((.*?).*/;
|
|
265
265
|
var absUrlRegex = exports.absUrlRegex = new RegExp('^(?:[a-z+]+:)?//', 'i');
|
|
266
266
|
function getScriptOutputType(script) {
|
|
267
267
|
var comment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';
|
package/package.json
CHANGED