datagrok-tools 4.13.2 → 4.13.3
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 +6 -0
- package/bin/commands/check.js +14 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/commands/check.js
CHANGED
|
@@ -65,7 +65,7 @@ function runChecks(packagePath) {
|
|
|
65
65
|
externals = extractExternals(content);
|
|
66
66
|
if (externals) warnings.push.apply(warnings, (0, _toConsumableArray2["default"])(checkImportStatements(packagePath, jsTsFiles, externals)));
|
|
67
67
|
}
|
|
68
|
-
checkSourceMap(packagePath);
|
|
68
|
+
warnings.push.apply(warnings, (0, _toConsumableArray2["default"])(checkSourceMap(packagePath)));
|
|
69
69
|
warnings.push.apply(warnings, (0, _toConsumableArray2["default"])(checkFuncSignatures(packagePath, funcFiles)));
|
|
70
70
|
warnings.push.apply(warnings, (0, _toConsumableArray2["default"])(checkPackageFile(packagePath, json, {
|
|
71
71
|
isWebpack: isWebpack,
|
|
@@ -496,19 +496,21 @@ function checkChangelog(packagePath, json) {
|
|
|
496
496
|
function checkSourceMap(packagePath) {
|
|
497
497
|
var warnings = [];
|
|
498
498
|
var tsconfigFilePath = _path["default"].join(packagePath, 'tsconfig.json');
|
|
499
|
-
var
|
|
500
|
-
|
|
501
|
-
|
|
499
|
+
var webpackConfigFilePath = _path["default"].join(packagePath, 'webpack.config.js');
|
|
500
|
+
if (_fs["default"].existsSync(tsconfigFilePath) && _fs["default"].existsSync(webpackConfigFilePath)) {
|
|
501
|
+
var configJson = _fs["default"].readFileSync(tsconfigFilePath, {
|
|
502
|
+
encoding: 'utf-8'
|
|
503
|
+
}); // cant convert to json because file contains comments
|
|
502
504
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}); // cant convert to json because file contains comments
|
|
505
|
+
if (!new RegExp('"sourceMap"\\s*:\\s*true').test(configJson)) warnings.push('ts config doesnt contain source map');
|
|
506
|
+
var webpackConfigJson = _fs["default"].readFileSync(webpackConfigFilePath, {
|
|
507
|
+
encoding: 'utf-8'
|
|
508
|
+
}); // cant convert to json because file contains comments
|
|
508
509
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
510
|
+
if (!new RegExp("devtool\\s*:\\s*'source-map'").test(webpackConfigJson)) warnings.push('webpack config doesnt contain source map');
|
|
511
|
+
if (!_fs["default"].existsSync(packagePath + '/dist/package.js')) warnings.push('dist\\package.js file doesnt exists');
|
|
512
|
+
if (!_fs["default"].existsSync(packagePath + '/dist/package-test.js')) warnings.push('dist\\package-test.js file doesnt exists');
|
|
513
|
+
}
|
|
512
514
|
return warnings;
|
|
513
515
|
}
|
|
514
516
|
function warn(warnings) {
|
package/package.json
CHANGED