datagrok-tools 4.13.2 → 4.13.4

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
+
4
+ ## 4.13.4 (2024-06-25)
5
+
6
+ ### Bug Fixes
7
+
8
+ * Check source maps fixes
9
+
10
+ ## 4.13.3 (2024-06-21)
11
+
12
+ ### Features
13
+
14
+ * Added check on source maps in grock check command
15
+
3
16
  ## 4.13.1 (2024-06-04)
4
17
 
5
18
  ### Features
@@ -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 configJson = _fs["default"].readFileSync(tsconfigFilePath, {
500
- encoding: 'utf-8'
501
- }); // cant convert to json because file contains comments
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
- if (!new RegExp('"sourceMap"\\s*:\\s*true').test(configJson)) warnings.push('ts config doesnt contain source map');
504
- var webpackconfigFilePath = _path["default"].join(packagePath, 'webpack.config.js');
505
- var webpackconfigJson = _fs["default"].readFileSync(webpackconfigFilePath, {
506
- encoding: 'utf-8'
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
- if (!new RegExp("devtools*:s*'source-map'").test(webpackconfigJson)) warnings.push('webpack config doesnt contain source map');
510
- if (!_fs["default"].existsSync(packagePath + 'dist\\package.js')) warnings.push('dist\\package.js file doesnt exists');
511
- if (!_fs["default"].existsSync(packagePath + 'dist\\package-test.js')) warnings.push('dist\\package-test.js file doesnt exists');
510
+ if (!new RegExp("devtool\\s*:\\s*(([^\\n]*\\?[^\\n]*source-map[^\\n]*:[^\\n]*source-map[^\\n]*)|('source-map'))\\n").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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.13.2",
3
+ "version": "4.13.4",
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": {