datagrok-tools 4.12.12 → 4.12.14
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 +9 -1
- package/bin/commands/check.js +7 -6
- package/bin/commands/test.js +3 -0
- package/bin/utils/utils.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/commands/check.js
CHANGED
|
@@ -69,7 +69,7 @@ function runChecks(packagePath) {
|
|
|
69
69
|
isWebpack: isWebpack,
|
|
70
70
|
externals: externals
|
|
71
71
|
})));
|
|
72
|
-
|
|
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);
|
|
@@ -374,7 +374,7 @@ function checkPackageFile(packagePath, json, options) {
|
|
|
374
374
|
if (json.version.includes('beta') && isPublicPackage) warnings.push('File "package.json": public package cannot be beta version.');
|
|
375
375
|
var api = (_json$dependencies = json.dependencies) === null || _json$dependencies === void 0 ? void 0 : _json$dependencies['datagrok-api'];
|
|
376
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 (
|
|
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
378
|
}
|
|
379
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'];
|
|
380
380
|
if (dt && dt !== 'latest') warnings.push('File "package.json": "datagrok-tools" dependency must be "latest" version.');
|
|
@@ -418,6 +418,7 @@ function checkPackageFile(packagePath, json, options) {
|
|
|
418
418
|
}
|
|
419
419
|
function checkChangelog(packagePath, json) {
|
|
420
420
|
var _h2$0$match, _h2$, _h2$$match;
|
|
421
|
+
if (json.servicePackage) return [];
|
|
421
422
|
var warnings = [];
|
|
422
423
|
var clf;
|
|
423
424
|
try {
|
|
@@ -425,18 +426,18 @@ function checkChangelog(packagePath, json) {
|
|
|
425
426
|
encoding: 'utf-8'
|
|
426
427
|
});
|
|
427
428
|
} catch (e) {
|
|
428
|
-
return ['CHANGELOG.md file does not exist'];
|
|
429
|
+
return ['CHANGELOG.md file does not exist\n'];
|
|
429
430
|
}
|
|
430
431
|
var regex = /^##[^#].*$/gm;
|
|
431
432
|
var h2 = clf.match(regex);
|
|
432
|
-
if (!h2) return ['No versions found in CHANGELOG.md'];
|
|
433
|
+
if (!h2) return ['No versions found in CHANGELOG.md\n'];
|
|
433
434
|
regex = /^## \d+\.\d+\.\d+ \((\d{4}-\d{2}-\d{2}|WIP)\)$/;
|
|
434
435
|
var _iterator7 = _createForOfIteratorHelper(h2),
|
|
435
436
|
_step7;
|
|
436
437
|
try {
|
|
437
438
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
438
439
|
var h = _step7.value;
|
|
439
|
-
if (!regex.test(h)) warnings.push("CHANGELOG: '".concat(h, "' does not match the h2 format, expected: ## <version> (<release date> | WIP)"));
|
|
440
|
+
if (!regex.test(h)) warnings.push("CHANGELOG: '".concat(h, "' does not match the h2 format, expected: ## <version> (<release date> | WIP)\n"));
|
|
440
441
|
}
|
|
441
442
|
} catch (err) {
|
|
442
443
|
_iterator7.e(err);
|
|
@@ -446,7 +447,7 @@ function checkChangelog(packagePath, json) {
|
|
|
446
447
|
regex = /^## (\d+\.\d+\.\d+)/;
|
|
447
448
|
var v1 = (_h2$0$match = h2[0].match(regex)) === null || _h2$0$match === void 0 ? void 0 : _h2$0$match[1];
|
|
448
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];
|
|
449
|
-
if (v1 !== json.version && v2 !== json.version) warnings.push("Latest package version (".concat(json.version, ") is not in CHANGELOG"));
|
|
450
|
+
if (v1 !== json.version && v2 !== json.version) warnings.push("Latest package version (".concat(json.version, ") is not in CHANGELOG\n"));
|
|
450
451
|
return warnings;
|
|
451
452
|
}
|
|
452
453
|
function warn(warnings) {
|
package/bin/commands/test.js
CHANGED
|
@@ -205,6 +205,8 @@ 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)
|
|
209
|
+
// df.rows.removeWhere((r: any) => r.get('success'));
|
|
208
210
|
var csv = df.toCsv();
|
|
209
211
|
resolve({
|
|
210
212
|
failReport: failReport,
|
|
@@ -261,6 +263,7 @@ function test(args) {
|
|
|
261
263
|
_context3.next = 12;
|
|
262
264
|
return runTest(7200000, {
|
|
263
265
|
category: args.category,
|
|
266
|
+
verbose: args.verbose,
|
|
264
267
|
catchUnhandled: args.catchUnhandled,
|
|
265
268
|
report: args.report,
|
|
266
269
|
record: args.record
|
package/bin/utils/utils.js
CHANGED
|
@@ -189,7 +189,7 @@ exports.queryExtension = queryExtension;
|
|
|
189
189
|
var scriptExtensions = ['.jl', '.m', '.py', '.R'];
|
|
190
190
|
exports.scriptExtensions = scriptExtensions;
|
|
191
191
|
function checkScriptLocation(filepath) {
|
|
192
|
-
if (!(filepath.startsWith('scripts/') || filepath.startsWith('projects/')) && scriptExtensions.some(function (ext) {
|
|
192
|
+
if (!(filepath.startsWith('scripts/') || filepath.startsWith('projects/') || filepath.startsWith('dockerfiles/')) && scriptExtensions.some(function (ext) {
|
|
193
193
|
return filepath.endsWith(ext);
|
|
194
194
|
})) {
|
|
195
195
|
return false;
|
package/package.json
CHANGED