@rws-framework/client 2.5.1 → 2.5.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/_tools.js CHANGED
@@ -3,7 +3,9 @@ const fs = require('fs');
3
3
  const ts = require('typescript');
4
4
  const { spawn } = require('child_process');
5
5
  const JSON5 = require('json5');
6
+ const md5 = require('md5');
6
7
  const chalk = require('chalk');
8
+ const { rwsPath } = require('@rws-framework/console');
7
9
 
8
10
  function findRootWorkspacePath(currentPath) {
9
11
  const parentPackageJsonPath = path.join(currentPath + '/..', 'package.json');
@@ -330,7 +332,7 @@ function getAllFilesInFolder(folderPath, ignoreFilenames = [], recursive = false
330
332
  return files;
331
333
  }
332
334
 
333
- function setupTsConfig(tsConfigPath)
335
+ function setupTsConfig(tsConfigPath, executionDir)
334
336
  {
335
337
 
336
338
  if(!fs.existsSync(tsConfigPath)){
@@ -344,26 +346,36 @@ function setupTsConfig(tsConfigPath)
344
346
 
345
347
  const declarationsPath = path.resolve(__dirname, 'types') + '/declarations.d.ts';
346
348
  const testsPath = path.resolve(__dirname, 'tests');
349
+ const declarationsPathMD5 = md5(fs.readFileSync(declarationsPath, 'utf-8'));
350
+ const testsPathMD5 = md5(fs.readFileSync(testsPath, 'utf-8'));
347
351
 
352
+ const included = [];
353
+
348
354
  let changed = false;
349
355
 
350
356
  if(!Object.keys(tsConfig).includes('include')){
351
357
  tsConfig['include'] = [];
358
+ }else{
359
+ tsConfig['include'] = tsConfig['include'].map((inc) => fs.existsSync(rwsPath.relativize(tsConfig['include'], executionDir)))
352
360
  }
353
361
 
354
362
  if(!Object.keys(tsConfig).includes('exclude')){
355
363
  tsConfig['exclude'] = [];
356
364
  }
357
365
 
358
- if(!tsConfig['include'].includes(declarationsPath)){
366
+ if(!tsConfig['include'].includes(declarationsPath) && !included.includes(declarationsPathMD5)){
359
367
  console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding RWS typescript declarations to project tsconfig.json');
360
368
  tsConfig['include'].push(declarationsPath);
369
+ included.push(md5(fs.readFileSync(declarationsPath, 'utf-8')));
361
370
  changed = true;
362
371
  }
372
+
363
373
 
364
- if(!tsConfig['exclude'].includes(testsPath)){
374
+ if(!tsConfig['exclude'].includes(testsPath) && !included.includes(testsPathMD5)){
365
375
  console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding RWS typescript exclusions to project tsconfig.json');
366
376
  tsConfig['exclude'].push(testsPath);
377
+ included.push();
378
+
367
379
  changed = true;
368
380
  }
369
381
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.5.1",
4
+ "version": "2.5.3",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -52,16 +52,16 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/dragula": "^3.7.4",
55
+ "@types/eslint": "^6.0.0",
55
56
  "@types/express-fileupload": "^1.4.4",
56
57
  "@types/glob": "^8.1.0",
57
- "@types/he": "^1.2.3",
58
- "@types/sanitize-html": "^2.11.0",
58
+ "@types/he": "^1.2.3",
59
+ "@types/sanitize-html": "^2.11.0",
59
60
  "@types/uuid": "^9.0.7",
60
- "@types/eslint": "^6.0.0",
61
61
  "@typescript-eslint/parser": "^5.0.0",
62
62
  "clean-webpack-plugin": "^4.0.0",
63
63
  "css-loader": "^6.8.1",
64
- "css-minimizer-webpack-plugin": "^5.0.1",
64
+ "css-minimizer-webpack-plugin": "^5.0.1",
65
65
  "eslint": "^6.0.0",
66
66
  "file-loader": "^6.2.0",
67
67
  "html-webpack-plugin": "^5.5.3",
@@ -218,7 +218,7 @@ const RWSWebpackWrapper = (config) => {
218
218
  }
219
219
  }
220
220
 
221
- const tsValidated = tools.setupTsConfig(path.resolve(config.tsConfigPath));
221
+ const tsValidated = tools.setupTsConfig(path.resolve(config.tsConfigPath, executionDir));
222
222
 
223
223
  if(!tsValidated){
224
224
  throw new Error('RWS Webpack build failed.');
package/bun.lockb DELETED
Binary file