@eui/tools 5.3.73 → 5.3.74

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.
@@ -1 +1 @@
1
- 5.3.73
1
+ 5.3.74
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 5.3.74 (2022-10-20)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **karma:**
6
+ * tests - EUI-6702 [EUI-6702](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6702) ([d7c136d0](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/d7c136d07f5bf3a8090727f7168a2eb4e21ae247))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 5.3.73 (2022-10-11)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.3.73",
3
+ "version": "5.3.74",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -1145,6 +1145,10 @@ const angularPackageDef = {
1145
1145
  "test": {
1146
1146
  "builder": "@angular-devkit/build-angular:karma",
1147
1147
  "options": {
1148
+ "polyfills": [
1149
+ "zone.js",
1150
+ "zone.js/testing"
1151
+ ],
1148
1152
  "main": "@path@/@module.name@/src/test.ts",
1149
1153
  "tsConfig": "@path@/@module.name@/tsconfig.spec.json",
1150
1154
  "karmaConfig": "@path@/@module.name@/karma.conf.js"
@@ -1174,6 +1178,10 @@ const angularPackageSubEntryDef = {
1174
1178
  "test": {
1175
1179
  "builder": "@angular-devkit/build-angular:karma",
1176
1180
  "options": {
1181
+ "polyfills": [
1182
+ "zone.js",
1183
+ "zone.js/testing"
1184
+ ],
1177
1185
  "main": "packages/eui/packages/components/@subEntry.path@/test.ts",
1178
1186
  "tsConfig": "packages/eui/packages/components/@subEntry.path@/tsconfig.spec.json",
1179
1187
  "karmaConfig": "packages/eui/packages/components/@subEntry.path@/karma.conf.js"
@@ -1262,6 +1270,44 @@ const angularPackageDefV14 = {
1262
1270
  }
1263
1271
  };
1264
1272
 
1273
+ const angularPackageDefV15 = {
1274
+ "root": "@path@/@module.name@",
1275
+ "sourceRoot": "@path@/@module.name@@srcRoot@",
1276
+ "projectType": "library",
1277
+ "prefix": "lib",
1278
+ "architect": {
1279
+ "lint": {
1280
+ "builder": "@angular-eslint/builder:lint",
1281
+ "options": {
1282
+ "lintFilePatterns": [
1283
+ "@path@/@module.name@/**/*.ts",
1284
+ "@path@/@module.name@/**/*.html"
1285
+ ],
1286
+ "eslintConfig": "@path@/@module.name@/.eslintrc.json"
1287
+ }
1288
+ },
1289
+ "build": {
1290
+ "builder": "@angular-devkit/build-angular:ng-packagr",
1291
+ "options": {
1292
+ "tsConfig": "@path@/@module.name@/@tsconfig@",
1293
+ "project": "@path@/@module.name@/ng-package.json"
1294
+ },
1295
+ "configurations": {
1296
+ "production": {
1297
+ "tsConfig": "@path@/@module.name@/tsconfig.lib.prod.json"
1298
+ }
1299
+ }
1300
+ },
1301
+ "test": {
1302
+ "builder": "@angular-devkit/build-angular:karma",
1303
+ "options": {
1304
+ "tsConfig": "@path@/@module.name@/tsconfig.spec.json",
1305
+ "karmaConfig": "@path@/@module.name@/karma.conf.js"
1306
+ }
1307
+ }
1308
+ }
1309
+ };
1310
+
1265
1311
 
1266
1312
 
1267
1313
 
@@ -1418,10 +1464,12 @@ module.exports.registerAngularPackage = (pkg, isReset) => {
1418
1464
  if (packageEuiVersion === '13.x') {
1419
1465
  projectDef = JSON.stringify(angularPackageDefV13);
1420
1466
  }
1421
- if (packageEuiVersion === '14.x' || packageEuiVersion === '15.x') {
1467
+ if (packageEuiVersion === '14.x') {
1422
1468
  projectDef = JSON.stringify(angularPackageDefV14);
1423
1469
  }
1424
-
1470
+ if (packageEuiVersion === '15.x') {
1471
+ projectDef = JSON.stringify(angularPackageDefV15);
1472
+ }
1425
1473
 
1426
1474
  let srcRoot = '/src', srcRootTesting = '';
1427
1475
  if (pkg.build && typeof pkg.build.srcRootDefault === 'boolean' && pkg.build.srcRootDefault === false) {
@@ -1445,15 +1493,25 @@ module.exports.registerAngularPackageSubEntry = (subEntryName, subEntryPath, pkg
1445
1493
  const file = path.join(process.cwd(), 'angular.json');
1446
1494
  const jsonFile = require(file);
1447
1495
 
1496
+ let packageEuiVersion;
1497
+ if (pkg.build && pkg.build.euiVersion) {
1498
+ packageEuiVersion = pkg.build.euiVersion;
1499
+ } else {
1500
+ packageEuiVersion = innerPackages.getPackageEuiVerison(pkg);
1501
+ }
1502
+
1448
1503
  let projectDef = JSON.stringify(angularPackageSubEntryDef);
1449
1504
 
1450
- let replacePath = tools.replaceAll(projectDef, '@subEntry.path@', subEntryName)
1451
- replacePath = tools.replaceAll(replacePath, '@subEntry.package.name@', 'ng-package.json');
1452
- replacePath = tools.replaceAll(replacePath, '@tsconfig@', pkg.tsConfigFileName);
1505
+ if (packageEuiVersion === '15.x') {
1506
+ projectDef = projectDef.replace('"main":"packages/eui/packages/components/@subEntry.path@/test.ts",', '');
1507
+ }
1508
+ projectDef = tools.replaceAll(projectDef, '@subEntry.path@', subEntryName)
1509
+ projectDef = tools.replaceAll(projectDef, '@subEntry.package.name@', 'ng-package.json');
1510
+ projectDef = tools.replaceAll(projectDef, '@tsconfig@', pkg.tsConfigFileName);
1453
1511
 
1454
- jsonFile['projects'][subEntryName] = JSON.parse(replacePath);
1512
+ jsonFile['projects'][subEntryName] = JSON.parse(projectDef);
1455
1513
 
1456
- console.log(jsonFile['projects'][subEntryName]);
1514
+ // console.log(jsonFile['projects'][subEntryName]);
1457
1515
 
1458
1516
  tools.writeJsonFileSync(file, jsonFile);
1459
1517
  }
@@ -221,7 +221,13 @@ module.exports.buildSubEntry = (pkg, subEntry) => {
221
221
  };
222
222
  }
223
223
  })
224
-
224
+ .then(() => {
225
+ tools.logInfo('Testing...');
226
+ const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
227
+ let args = ['--max_old_space_size=8096', ng, 'test', subEntry, '--code-coverage', '--watch=false'];
228
+ tools.logInfo(`running ng test : with args: ${args} on folder : ${pkg.paths.pkgRootDirectory}`);
229
+ return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
230
+ })
225
231
  .then(() => {
226
232
  const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
227
233