datagrok-tools 4.12.11 → 4.12.13

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 ADDED
@@ -0,0 +1,55 @@
1
+ # Datagrok-tools changelog
2
+
3
+ ## 4.12.13 (2023-08-17)
4
+
5
+ ### Bug Fixes
6
+
7
+ * Datagrok API version check fix
8
+ * Check Changelog fix
9
+ * Sync --csv and --verbose flags
10
+
11
+ ## 4.12.12 (2023-08-07)
12
+
13
+ ### Features
14
+
15
+ * Check for datagrok-api dependency
16
+
17
+ ### Bug Fixes
18
+
19
+ * Latest package version in CHANGELOG check fix
20
+
21
+ ## 4.12.11 (2023-08-04)
22
+
23
+ ### Features
24
+
25
+ * GROK-13643 Check improvements:
26
+ * There is no beta property in package.json
27
+ * No datagrok-tools in dependencies (or latest version)
28
+ * Latest version from package.json is in CHANGELOG (warning)
29
+ * Ignore CHANGELOG checks for service packages ("servicePackage" property in package.json)
30
+ * Change supported h2 formats (1.7.9 (2023-07-24) and 1.7.9 (WIP))
31
+ * For packages < 1.0.0 exit with exit code 0, and only show warnings. And for packages >= 1.0.0, exit with a non-zero code (only for check command)
32
+ * If an invalid flag/command is specified, output the help and exit with exit code 1
33
+
34
+ ## 4.12.10 (2023-08-01)
35
+
36
+ ### Features
37
+
38
+ * Video recording enhancements
39
+
40
+ ### Bug Fixes
41
+
42
+ * FuncSignatures check fix
43
+
44
+ ## 4.12.7 (2023-07-28)
45
+
46
+ ### Features
47
+
48
+ * Tools: Changelog h2 new format
49
+
50
+ ## 4.12.4 (2023-07-24)
51
+
52
+ ### Features
53
+
54
+ * GROK-13573 Tools: simplify output (add --verbose flag)
55
+ * GROK-13573 Tools: checks for changelog
@@ -69,16 +69,21 @@ function runChecks(packagePath) {
69
69
  isWebpack: isWebpack,
70
70
  externals: externals
71
71
  })));
72
- if (!json.servicePackage) warnings.push.apply(warnings, (0, _toConsumableArray2["default"])(checkChangelog(packagePath, json)));
72
+ warnings.push.apply(warnings, (0, _toConsumableArray2["default"])(checkChangelog(packagePath, json)));
73
73
  if (warnings.length) {
74
74
  console.log("Checking package ".concat(_path["default"].basename(packagePath), "..."));
75
75
  warn(warnings);
76
- if (json.version.startsWith('0') || warnings.length === 1 && warnings[0].startsWith('Latest package version')) return true;
76
+ if (json.version.startsWith('0') || warnings.every(function (w) {
77
+ return warns.some(function (ww) {
78
+ return w.includes(ww);
79
+ });
80
+ })) return true;
77
81
  testUtils.exitWithCode(1);
78
82
  }
79
83
  console.log("Checking package ".concat(_path["default"].basename(packagePath), "...\t\t\t\u2713 OK"));
80
84
  return true;
81
85
  }
86
+ var warns = ['Latest package version', 'Datagrok API version should contain'];
82
87
  function runChecksRec(dir) {
83
88
  var files = _fs["default"].readdirSync(dir);
84
89
  var _iterator = _createForOfIteratorHelper(files),
@@ -346,7 +351,7 @@ var sharedLibExternals = {
346
351
  }
347
352
  };
348
353
  function checkPackageFile(packagePath, json, options) {
349
- var _json$devDependencies, _json$devDependencies2, _json$dependencies;
354
+ var _json$dependencies, _json$devDependencies, _json$devDependencies2, _json$dependencies2;
350
355
  var warnings = [];
351
356
  var isPublicPackage = _path["default"].basename(_path["default"].dirname(packagePath)) === 'packages' && _path["default"].basename(_path["default"].dirname(_path["default"].dirname(packagePath))) === 'public';
352
357
  if (!json.description) warnings.push('File "package.json": "description" field is empty. Provide a package description.');
@@ -367,7 +372,11 @@ function checkPackageFile(packagePath, json, options) {
367
372
  if (json.repository == null && isPublicPackage) warnings.push('File "package.json": add the "repository" field.');
368
373
  if (json.author == null && isPublicPackage) warnings.push('File "package.json": add the "author" field.');
369
374
  if (json.version.includes('beta') && isPublicPackage) warnings.push('File "package.json": public package cannot be beta version.');
370
- var dt = (_json$devDependencies = (_json$devDependencies2 = json.devDependencies) === null || _json$devDependencies2 === void 0 ? void 0 : _json$devDependencies2['datagrok-tools']) !== null && _json$devDependencies !== void 0 ? _json$devDependencies : (_json$dependencies = json.dependencies) === null || _json$dependencies === void 0 ? void 0 : _json$dependencies['datagrok-tools'];
375
+ var api = (_json$dependencies = json.dependencies) === null || _json$dependencies === void 0 ? void 0 : _json$dependencies['datagrok-api'];
376
+ if (api) {
377
+ if (api === '../../js-api') {} else if (api === 'latest') warnings.push('File "package.json": you should specify Datagrok API version constraint (for example ^1.16.0, >=1.16.0).');else if (!/^(\^|>|<|~).+/.test(api)) warnings.push('File "package.json": Datagrok API version should starts with > | >= | ~ | ^ | < | <=');
378
+ }
379
+ var dt = (_json$devDependencies = (_json$devDependencies2 = json.devDependencies) === null || _json$devDependencies2 === void 0 ? void 0 : _json$devDependencies2['datagrok-tools']) !== null && _json$devDependencies !== void 0 ? _json$devDependencies : (_json$dependencies2 = json.dependencies) === null || _json$dependencies2 === void 0 ? void 0 : _json$dependencies2['datagrok-tools'];
371
380
  if (dt && dt !== 'latest') warnings.push('File "package.json": "datagrok-tools" dependency must be "latest" version.');
372
381
  if (Array.isArray(json.sources) && json.sources.length > 0) {
373
382
  var _iterator6 = _createForOfIteratorHelper(json.sources),
@@ -408,7 +417,8 @@ function checkPackageFile(packagePath, json, options) {
408
417
  return warnings;
409
418
  }
410
419
  function checkChangelog(packagePath, json) {
411
- var _h2$0$match;
420
+ var _h2$0$match, _h2$, _h2$$match;
421
+ if (json.servicePackage) return [];
412
422
  var warnings = [];
413
423
  var clf;
414
424
  try {
@@ -435,8 +445,9 @@ function checkChangelog(packagePath, json) {
435
445
  _iterator7.f();
436
446
  }
437
447
  regex = /^## (\d+\.\d+\.\d+)/;
438
- var v = (_h2$0$match = h2[0].match(regex)) === null || _h2$0$match === void 0 ? void 0 : _h2$0$match[1];
439
- if (v && v !== json.version) warnings.push("Latest package version (".concat(json.version, ") is not in CHANGELOG"));
448
+ var v1 = (_h2$0$match = h2[0].match(regex)) === null || _h2$0$match === void 0 ? void 0 : _h2$0$match[1];
449
+ var v2 = (_h2$ = h2[1]) === null || _h2$ === void 0 ? void 0 : (_h2$$match = _h2$.match(regex)) === null || _h2$$match === void 0 ? void 0 : _h2$$match[1];
450
+ if (v1 !== json.version && v2 !== json.version) warnings.push("Latest package version (".concat(json.version, ") is not in CHANGELOG"));
440
451
  return warnings;
441
452
  }
442
453
  function warn(warnings) {
@@ -205,6 +205,9 @@ function test(args) {
205
205
  failReport += "Test result : Failed : ".concat(cTime.get(i), " : ").concat(targetPackage, ".").concat(cCat.get(i), ".").concat(cName.get(i), " : ").concat(cMessage.get(i), "\n");
206
206
  }
207
207
  }
208
+ if (!options.verbose) df.rows.removeWhere(function (r) {
209
+ return r.get('success');
210
+ });
208
211
  var csv = df.toCsv();
209
212
  resolve({
210
213
  failReport: failReport,
@@ -261,6 +264,7 @@ function test(args) {
261
264
  _context3.next = 12;
262
265
  return runTest(7200000, {
263
266
  category: args.category,
267
+ verbose: args.verbose,
264
268
  catchUnhandled: args.catchUnhandled,
265
269
  report: args.report,
266
270
  record: args.record
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.12.11",
3
+ "version": "4.12.13",
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": {