datagrok-tools 4.12.11 → 4.12.12

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,47 @@
1
+ # Datagrok-tools changelog
2
+
3
+ ## 4.12.12 (WIP)
4
+
5
+ ### Features
6
+
7
+ * Check for datagrok-api dependency
8
+
9
+ ### Bug Fixes
10
+
11
+ * Latest package version in CHANGELOG check fix
12
+
13
+ ## 4.12.11 (2023-08-04)
14
+
15
+ ### Features
16
+
17
+ * GROK-13643 Check improvements:
18
+ * There is no beta property in package.json
19
+ * No datagrok-tools in dependencies (or latest version)
20
+ * Latest version from package.json is in CHANGELOG (warning)
21
+ * Ignore CHANGELOG checks for service packages ("servicePackage" property in package.json)
22
+ * Change supported h2 formats (1.7.9 (2023-07-24) and 1.7.9 (WIP))
23
+ * 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)
24
+ * If an invalid flag/command is specified, output the help and exit with exit code 1
25
+
26
+ ## 4.12.10 (2023-08-01)
27
+
28
+ ### Features
29
+
30
+ * Video recording enhancements
31
+
32
+ ### Bug Fixes
33
+
34
+ * FuncSignatures check fix
35
+
36
+ ## 4.12.7 (2023-07-28)
37
+
38
+ ### Features
39
+
40
+ * Tools: Changelog h2 new format
41
+
42
+ ## 4.12.4 (2023-07-24)
43
+
44
+ ### Features
45
+
46
+ * GROK-13573 Tools: simplify output (add --verbose flag)
47
+ * GROK-13573 Tools: checks for changelog
@@ -73,12 +73,17 @@ function runChecks(packagePath) {
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.');else if (!(api.startsWith('^') || api.startsWith('>'))) warnings.push('File "package.json": Datagrok API version should contain "^" or ">" symbol, otherwise it is locked to the single Datagrok version.');
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,7 @@ 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;
412
421
  var warnings = [];
413
422
  var clf;
414
423
  try {
@@ -435,8 +444,9 @@ function checkChangelog(packagePath, json) {
435
444
  _iterator7.f();
436
445
  }
437
446
  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"));
447
+ var v1 = (_h2$0$match = h2[0].match(regex)) === null || _h2$0$match === void 0 ? void 0 : _h2$0$match[1];
448
+ 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];
449
+ if (v1 !== json.version && v2 !== json.version) warnings.push("Latest package version (".concat(json.version, ") is not in CHANGELOG"));
440
450
  return warnings;
441
451
  }
442
452
  function warn(warnings) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.12.11",
3
+ "version": "4.12.12",
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": {