@rws-framework/client 2.5.3 → 2.5.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/_tools.js +14 -11
- package/cfg/_default.cfg.js +1 -0
- package/package.json +2 -2
- package/rws.webpack.config.js +6 -3
package/_tools.js
CHANGED
|
@@ -339,19 +339,23 @@ function setupTsConfig(tsConfigPath, executionDir)
|
|
|
339
339
|
throw new Error(`Typescript config file "${tsConfigPath}" does not exist`);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
+
console.log('tspath', tsConfigPath);
|
|
343
|
+
|
|
342
344
|
const tsConfigContents = fs.readFileSync(tsConfigPath, 'utf-8');
|
|
343
345
|
|
|
344
346
|
try{
|
|
345
|
-
|
|
347
|
+
let tsConfig = JSON.parse(tsConfigContents);
|
|
346
348
|
|
|
347
349
|
const declarationsPath = path.resolve(__dirname, 'types') + '/declarations.d.ts';
|
|
348
350
|
const testsPath = path.resolve(__dirname, 'tests');
|
|
349
351
|
const declarationsPathMD5 = md5(fs.readFileSync(declarationsPath, 'utf-8'));
|
|
350
|
-
const testsPathMD5 = md5(fs.readFileSync(testsPath, 'utf-8'));
|
|
352
|
+
const testsPathMD5 = fs.existsSync(testsPath) ? md5(fs.readFileSync(testsPath, 'utf-8')) : null;
|
|
351
353
|
|
|
352
|
-
const
|
|
354
|
+
const includedMD5 = [];
|
|
353
355
|
|
|
354
356
|
let changed = false;
|
|
357
|
+
|
|
358
|
+
const included = [];
|
|
355
359
|
|
|
356
360
|
if(!Object.keys(tsConfig).includes('include')){
|
|
357
361
|
tsConfig['include'] = [];
|
|
@@ -363,19 +367,18 @@ function setupTsConfig(tsConfigPath, executionDir)
|
|
|
363
367
|
tsConfig['exclude'] = [];
|
|
364
368
|
}
|
|
365
369
|
|
|
366
|
-
if(!
|
|
370
|
+
if(!included.includes(declarationsPath) && !includedMD5.includes(declarationsPathMD5)){
|
|
367
371
|
console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding RWS typescript declarations to project tsconfig.json');
|
|
368
|
-
|
|
369
|
-
|
|
372
|
+
included.push(declarationsPath);
|
|
373
|
+
includedMD5.push(md5(fs.readFileSync(declarationsPath, 'utf-8')));
|
|
370
374
|
changed = true;
|
|
371
375
|
}
|
|
372
|
-
|
|
373
376
|
|
|
374
|
-
|
|
377
|
+
tsConfig['include'] = included;
|
|
378
|
+
|
|
379
|
+
if(testsPathMD5 && (!tsConfig['exclude'].includes(testsPath) && !included.includes(testsPathMD5))){
|
|
375
380
|
console.log(chalk.blueBright('[RWS TS CONFIG]'), 'adding RWS typescript exclusions to project tsconfig.json');
|
|
376
|
-
tsConfig['exclude'].push(testsPath);
|
|
377
|
-
included.push();
|
|
378
|
-
|
|
381
|
+
tsConfig['exclude'].push(testsPath);
|
|
379
382
|
changed = true;
|
|
380
383
|
}
|
|
381
384
|
|
package/cfg/_default.cfg.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rws-framework/client",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.4",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"docs": "typedoc --tsconfig ./tsconfig.json"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@microsoft/fast-element": "^1.12.0",
|
|
30
30
|
"@microsoft/fast-foundation": "^2.46.2",
|
|
31
|
-
"@rws-framework/console": "^0.3.
|
|
31
|
+
"@rws-framework/console": "^0.3.1",
|
|
32
32
|
"@types/moment": "^2.13.0",
|
|
33
33
|
"dragula": "^3.7.3",
|
|
34
34
|
"he": "^1.2.0",
|
package/rws.webpack.config.js
CHANGED
|
@@ -16,6 +16,7 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
|
16
16
|
const JsMinimizerPlugin = require('terser-webpack-plugin');
|
|
17
17
|
|
|
18
18
|
const json5 = require('json5');
|
|
19
|
+
const { rwsPath } = require('@rws-framework/console');
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
const RWSWebpackWrapper = (config) => {
|
|
@@ -43,7 +44,9 @@ const RWSWebpackWrapper = (config) => {
|
|
|
43
44
|
|
|
44
45
|
const publicIndex = BuildConfigurator.get('publicIndex') || config.publicIndex;
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
|
|
48
|
+
const tsConfigPath = rwsPath.relativize(BuildConfigurator.get('tsConfigPath') || config.tsConfigPath, executionDir);
|
|
49
|
+
|
|
47
50
|
let WEBPACK_PLUGINS = [
|
|
48
51
|
new webpack.DefinePlugin({
|
|
49
52
|
'process.env._RWS_DEFAULTS': JSON.stringify(BuildConfigurator.exportDefaultConfig()),
|
|
@@ -218,7 +221,7 @@ const RWSWebpackWrapper = (config) => {
|
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
|
|
221
|
-
const tsValidated = tools.setupTsConfig(
|
|
224
|
+
const tsValidated = tools.setupTsConfig(tsConfigPath, executionDir);
|
|
222
225
|
|
|
223
226
|
if(!tsValidated){
|
|
224
227
|
throw new Error('RWS Webpack build failed.');
|
|
@@ -276,7 +279,7 @@ const RWSWebpackWrapper = (config) => {
|
|
|
276
279
|
loader: 'ts-loader',
|
|
277
280
|
options: {
|
|
278
281
|
allowTsInNodeModules: true,
|
|
279
|
-
configFile: path.resolve(
|
|
282
|
+
configFile: path.resolve(tsConfigPath)
|
|
280
283
|
}
|
|
281
284
|
},
|
|
282
285
|
{
|