@eui/tools 5.3.25 → 5.3.28

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.25
1
+ 5.3.28
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 5.3.28 (2022-07-11)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * migrate to tslint - EUI-3809 [EUI-3809](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-3809) ([c830f8d4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/c830f8d4c2a403cd60d743f78924349a4f278edb))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.3.27 (2022-06-29)
11
+
12
+ ##### Bug Fixes
13
+
14
+ * **other:**
15
+ * removed packages injection config injection for MWP - adapted default config injection for MWP - MWP-7700 [MWP-7700](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-7700) ([a9ae69f4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/a9ae69f49558b66afbf6e3ce9395148c924023c0))
16
+
17
+ * * *
18
+ * * *
19
+ ## 5.3.26 (2022-06-23)
20
+
21
+ ##### Chores
22
+
23
+ * **other:**
24
+ * adapted for MWP v14 setup and migration - MWP-8474 [MWP-8474](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-8474) ([4fc90eca](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/4fc90eca36fe64366397bded27818675f17485f4))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 5.3.25 (2022-06-22)
2
29
 
3
30
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.3.25",
3
+ "version": "5.3.28",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -6,6 +6,7 @@ const path = require('path');
6
6
  // LOCAL
7
7
  const tools = require('../../utils/tools');
8
8
 
9
+ const innerPackages = require('./packages');
9
10
 
10
11
 
11
12
  const angularConfigDef = {
@@ -237,6 +238,16 @@ const angularProjectDefV13 = {
237
238
  }
238
239
  },
239
240
  "architect": {
241
+ "lint": {
242
+ "builder": "@angular-eslint/builder:lint",
243
+ "options": {
244
+ "lintFilePatterns": [
245
+ "apps/@project.name@/**/*.ts",
246
+ "apps/@project.name@/**/*.html"
247
+ ],
248
+ "eslintConfig": "apps/@project.name@/.eslintrc.json"
249
+ }
250
+ },
240
251
  "build": {
241
252
  "builder": "@angular-devkit/build-angular:browser",
242
253
  "options": {
@@ -389,6 +400,16 @@ const angularProjectDefV14 = {
389
400
  }
390
401
  },
391
402
  "architect": {
403
+ "lint": {
404
+ "builder": "@angular-eslint/builder:lint",
405
+ "options": {
406
+ "lintFilePatterns": [
407
+ "apps/@project.name@/**/*.ts",
408
+ "apps/@project.name@/**/*.html"
409
+ ],
410
+ "eslintConfig": "apps/@project.name@/.eslintrc.json"
411
+ }
412
+ },
392
413
  "build": {
393
414
  "builder": "@angular-devkit/build-angular:browser",
394
415
  "options": {
@@ -1101,6 +1122,14 @@ const angularPackageSubEntryDef = {
1101
1122
  "tsConfig": "packages/eui/packages/components/tsconfig.lib.json"
1102
1123
  }
1103
1124
  }
1125
+ },
1126
+ "test": {
1127
+ "builder": "@angular-devkit/build-angular:karma",
1128
+ "options": {
1129
+ "main": "packages/eui/packages/components/@subEntry.path@/test.ts",
1130
+ "tsConfig": "packages/eui/packages/components/@subEntry.path@/tsconfig.spec.json",
1131
+ "karmaConfig": "packages/eui/packages/components/@subEntry.path@/karma.conf.js"
1132
+ }
1104
1133
  }
1105
1134
  }
1106
1135
  };
@@ -1112,6 +1141,16 @@ const angularPackageDefV13 = {
1112
1141
  "projectType": "library",
1113
1142
  "prefix": "lib",
1114
1143
  "architect": {
1144
+ "lint": {
1145
+ "builder": "@angular-eslint/builder:lint",
1146
+ "options": {
1147
+ "lintFilePatterns": [
1148
+ "@path@/@module.name@/**/*.ts",
1149
+ "@path@/@module.name@/**/*.html"
1150
+ ],
1151
+ "eslintConfig": "@path@/@module.name@/.eslintrc.json"
1152
+ }
1153
+ },
1115
1154
  "build": {
1116
1155
  "builder": "@angular-devkit/build-angular:ng-packagr",
1117
1156
  "options": {
@@ -1142,6 +1181,16 @@ const angularPackageDefV14 = {
1142
1181
  "projectType": "library",
1143
1182
  "prefix": "lib",
1144
1183
  "architect": {
1184
+ "lint": {
1185
+ "builder": "@angular-eslint/builder:lint",
1186
+ "options": {
1187
+ "lintFilePatterns": [
1188
+ "@path@/@module.name@/**/*.ts",
1189
+ "@path@/@module.name@/**/*.html"
1190
+ ],
1191
+ "eslintConfig": "@path@/@module.name@/.eslintrc.json"
1192
+ }
1193
+ },
1145
1194
  "build": {
1146
1195
  "builder": "@angular-devkit/build-angular:ng-packagr",
1147
1196
  "options": {
@@ -1307,12 +1356,21 @@ module.exports.registerAngularPackage = (pkg, isReset) => {
1307
1356
  pathBase = 'packages/' + pkg.parentPkg + '/packages';
1308
1357
  }
1309
1358
 
1359
+ let packageEuiVersion;
1360
+
1361
+ if (pkg.build && pkg.build.euiVersion) {
1362
+ packageEuiVersion = pkg.build.euiVersion;
1363
+
1364
+ } else {
1365
+ packageEuiVersion = innerPackages.getPackageEuiVerison(pkg);
1366
+ }
1367
+
1310
1368
  let projectDef = JSON.stringify(angularPackageDef);
1311
1369
 
1312
- if (pkg.build && pkg.build.euiVersion === '13.x') {
1370
+ if (packageEuiVersion === '13.x') {
1313
1371
  projectDef = JSON.stringify(angularPackageDefV13);
1314
1372
  }
1315
- if (pkg.build && pkg.build.euiVersion === '14.x') {
1373
+ if (packageEuiVersion === '14.x') {
1316
1374
  projectDef = JSON.stringify(angularPackageDefV14);
1317
1375
  }
1318
1376
 
@@ -243,52 +243,63 @@ module.exports.getDepGraph = () => {
243
243
  }
244
244
 
245
245
 
246
- module.exports.getLocalPackagesEuiVersion = () => {
247
- tools.logTitle('getting local packages installed eUI version...');
248
-
249
- const pkgs = getPackages();
250
- let versionsFound = [];
251
-
252
- pkgs.forEach((p) => {
253
- if (p.parent !== true && p.tsPackage !== false) {
254
- tools.logInfo(`checking ${p.name}`);
246
+ const getPackageEuiVersion = module.exports.getPackageEuiVerison = (pkg) => {
247
+ if (pkg.parent !== true && pkg.tsPackage !== false) {
248
+ tools.logInfo(`checking ${pkg.name}`);
255
249
 
256
- let version;
250
+ let version;
257
251
 
258
- if (p.build && p.build.euiVersion) {
259
- version = p.build.euiVersion;
252
+ if (pkg.build && pkg.build.euiVersion) {
253
+ version = pkg.build.euiVersion;
260
254
 
261
- } else if (!p.remote) {
262
- const depsCompositeFile = path.join(p.paths.pkgRootDirectory, 'dependencies-composite.json');
263
- tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
255
+ } else if (!pkg.remote) {
256
+ const depsCompositeFile = path.join(pkg.paths.pkgRootDirectory, 'dependencies-composite.json');
257
+ tools.logInfo(`Try fetching version from ${depsCompositeFile}`);
264
258
 
265
- if (!tools.isFileExists(depsCompositeFile)) {
266
- tools.logInfo('---- no dependencies-composite.json file found');
267
- } else {
268
- const deps = tools.getJsonFileContent(depsCompositeFile);
269
- const euiDepsBase = deps['@eui/deps-base'];
259
+ if (!tools.isFileExists(depsCompositeFile)) {
260
+ tools.logInfo('---- no dependencies-composite.json file found');
261
+ } else {
262
+ const deps = tools.getJsonFileContent(depsCompositeFile);
263
+ const euiDepsBase = deps['@eui/deps-base'];
270
264
 
271
- if (euiDepsBase) {
272
- let euiVersion = euiDepsBase.split('.')[0];
265
+ if (euiDepsBase) {
266
+ let euiVersion = euiDepsBase.split('.')[0];
273
267
 
274
- if (euiVersion.substr(0,1) === '^') {
275
- euiVersion = euiVersion.substr(1);
276
- }
277
- version = `${euiVersion}.x`;
268
+ if (euiVersion.substr(0,1) === '^') {
269
+ euiVersion = euiVersion.substr(1);
270
+ }
271
+ version = `${euiVersion}.x`;
278
272
 
279
- if (version === '7.x') {
280
- version = 'DEFAULT';
281
- }
273
+ if (version === '7.x') {
274
+ version = 'DEFAULT';
282
275
  }
283
276
  }
284
277
  }
278
+ }
285
279
 
286
- if (version) {
287
- tools.logInfo(`---- version found : ${version}\n`);
288
- versionsFound.push(version);
289
- } else {
290
- tools.logInfo('---- version detection skipped');
291
- }
280
+ if (version) {
281
+ tools.logInfo(`---- version found : ${version}\n`);
282
+ } else {
283
+ tools.logInfo('---- version detection skipped');
284
+ }
285
+
286
+ return version;
287
+ }
288
+ }
289
+
290
+
291
+
292
+ module.exports.getLocalPackagesEuiVersion = () => {
293
+ tools.logTitle('getting local packages installed eUI version...');
294
+
295
+ const pkgs = getPackages();
296
+ let versionsFound = [];
297
+
298
+ pkgs.forEach((p) => {
299
+ const version = getPackageEuiVersion(p);
300
+
301
+ if (version) {
302
+ versionsFound.push(version);
292
303
  }
293
304
  })
294
305
 
@@ -10,7 +10,7 @@ const configUtils = require('../config/config-utils');
10
10
  const metadataUtils = require('../metadata/metadata-utils');
11
11
 
12
12
  // FETCH ARGS
13
- const { dryRun, skipInstall, registry, remotesImport } = tools.getArgs();
13
+ const { dryRun, skipInstall, registry, remotesImport, skipLocalPackagesDeps } = tools.getArgs();
14
14
 
15
15
 
16
16
 
@@ -227,17 +227,24 @@ const getLocalPackagesDeps = () => {
227
227
  const getLocalPackageCompositeDeps = (pkg) => {
228
228
  let pkgJsonFile;
229
229
 
230
- if (pkg.child) {
231
- pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-composite.json');
230
+ if (!skipLocalPackagesDeps) {
231
+ if (pkg.child) {
232
+ pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-composite.json');
233
+ } else {
234
+ pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-composite.json');
235
+ }
236
+
237
+ if (tools.isFileExists(pkgJsonFile)) {
238
+ tools.logInfo(`found ${pkgJsonFile}, parsing...`);
239
+ }
240
+
241
+ return tools.getJsonFileContent(pkgJsonFile) || {};
242
+
232
243
  } else {
233
- pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-composite.json');
234
- }
244
+ tools.logInfo('Skipping gathering local packages composite deps');
235
245
 
236
- if (tools.isFileExists(pkgJsonFile)) {
237
- tools.logInfo(`found ${pkgJsonFile}, parsing...`);
246
+ return {};
238
247
  }
239
-
240
- return tools.getJsonFileContent(pkgJsonFile) || {};
241
248
  }
242
249
 
243
250
 
@@ -46,9 +46,21 @@ module.exports.build = (pkg, isMaster) => {
46
46
  if (!skipLint) {
47
47
  tools.logInfo('Linting...');
48
48
  const tsLintPath = path.join(pkg.paths.pkgRootDirectory, 'tslint.json');
49
- const tsConfigPath = path.join(pkg.paths.pkgRootDirectory, 'tsconfig.lib.json');
50
- tools.logInfo(`running tslint -c ${tsLintPath} -p ${tsConfigPath}`);
51
- return tools.runScript(`tslint -c ${tsLintPath} -p ${tsConfigPath} -t verbose`);
49
+ const esLintPath = path.join(pkg.paths.pkgRootDirectory, '.eslintrc.json');
50
+
51
+ if (tools.isFileExists(tsLintPath)) {
52
+ // TODO: remove TSLint since it's deprecated and should not be used by projects in the future
53
+ tools.logWarning('TSLint is deprecated and will be removed in the future. Consider migrating to ESLint')
54
+ const tsConfigPath = path.join(pkg.paths.pkgRootDirectory, 'tsconfig.lib.json');
55
+ tools.logInfo(`running tslint -c ${tsLintPath} -p ${tsConfigPath}`);
56
+ return tools.runScript(`tslint -c ${tsLintPath} -p ${tsConfigPath} -t verbose`);
57
+ } else if(tools.isFileExists(esLintPath)) {
58
+ // the project path information are located inside the .eslintrc.json
59
+ tools.logInfo(`running ng lint ${pkg.name}`);
60
+ return tools.runScript(`ng lint ${pkg.name}`);
61
+ } else {
62
+ tools.logError(`No ESLint or TSLint configuration found for the project`);
63
+ }
52
64
  }
53
65
  })
54
66
  .then(() => {
@@ -68,9 +68,9 @@ const injectConfig = (project) => {
68
68
  }
69
69
  })
70
70
 
71
- .then(() => {
72
- return injectPackagesConfig(project);
73
- })
71
+ // .then(() => {
72
+ // return injectPackagesConfig(project);
73
+ // })
74
74
 
75
75
  .catch((e) => {
76
76
  throw e;
@@ -78,129 +78,129 @@ const injectConfig = (project) => {
78
78
  }
79
79
 
80
80
 
81
- const injectPackagesConfig = (project) => {
82
- tools.logTitle('Injecting package config');
81
+ // const injectPackagesConfig = (project) => {
82
+ // tools.logTitle('Injecting package config');
83
83
 
84
- return Promise.resolve()
84
+ // return Promise.resolve()
85
85
 
86
- // fetching current project linked composite packages dependencies
87
- .then(() => {
88
- return installUtils.common.getLocalProjectDeps(project);
89
- })
86
+ // // fetching current project linked composite packages dependencies
87
+ // .then(() => {
88
+ // return installUtils.common.getLocalProjectDeps(project);
89
+ // })
90
90
 
91
91
 
92
- // remapping dependencies with package names
93
- .then((prjDeps) => {
92
+ // // remapping dependencies with package names
93
+ // .then((prjDeps) => {
94
94
 
95
- // gather only the locally installed projects,
96
- const localPackagesConfig = configUtils.packages.getPackages();
95
+ // // gather only the locally installed projects,
96
+ // const localPackagesConfig = configUtils.packages.getPackages();
97
97
 
98
- let localPackagesArray = [];
98
+ // let localPackagesArray = [];
99
99
 
100
- Object.keys(prjDeps).forEach((p) => {
101
- const filteredPackage = localPackagesConfig.filter((fp) => {
102
- // filtering from the current deps pkg
103
- return fp.npmPkg === p;
104
- })[0];
100
+ // Object.keys(prjDeps).forEach((p) => {
101
+ // const filteredPackage = localPackagesConfig.filter((fp) => {
102
+ // // filtering from the current deps pkg
103
+ // return fp.npmPkg === p;
104
+ // })[0];
105
105
 
106
- if (filteredPackage) localPackagesArray.push(filteredPackage.name);
107
- });
106
+ // if (filteredPackage) localPackagesArray.push(filteredPackage.name);
107
+ // });
108
108
 
109
109
 
110
110
 
111
- // gather the full CSDR packages from project dependencies
112
- const csdrPackagesConfig = configUtils.packages.getCsdrPackagesFull();
111
+ // // gather the full CSDR packages from project dependencies
112
+ // const csdrPackagesConfig = configUtils.packages.getCsdrPackagesFull();
113
113
 
114
- let csdrPackagesArray = [];
114
+ // let csdrPackagesArray = [];
115
115
 
116
- Object.keys(prjDeps).forEach((p) => {
117
- const filteredPackage = csdrPackagesConfig.filter((fp) => {
118
- // filtering from the current deps pkg; excluding the ones found locally
119
- return fp.npmPkg === p && !localPackagesArray.includes(fp.name);
120
- })[0];
116
+ // Object.keys(prjDeps).forEach((p) => {
117
+ // const filteredPackage = csdrPackagesConfig.filter((fp) => {
118
+ // // filtering from the current deps pkg; excluding the ones found locally
119
+ // return fp.npmPkg === p && !localPackagesArray.includes(fp.name);
120
+ // })[0];
121
121
 
122
- if (filteredPackage) csdrPackagesArray.push(filteredPackage.npmPkg);
123
- });
122
+ // if (filteredPackage) csdrPackagesArray.push(filteredPackage.npmPkg);
123
+ // });
124
124
 
125
125
 
126
- return {
127
- csdrPackages: csdrPackagesArray,
128
- localPackages: localPackagesArray,
129
- };
130
- })
126
+ // return {
127
+ // csdrPackages: csdrPackagesArray,
128
+ // localPackages: localPackagesArray,
129
+ // };
130
+ // })
131
131
 
132
132
 
133
- // checking filtered packages if config overrides is provided
134
- .then((filteredPackages) => {
133
+ // // checking filtered packages if config overrides is provided
134
+ // .then((filteredPackages) => {
135
135
 
136
- // checking installed packages
137
- filteredPackages.csdrPackages.forEach((p) => {
138
- const pkgPath = path.join(process.cwd(), 'node_modules', p);
139
- processPackageConfig(project, pkgPath);
140
- })
136
+ // // checking installed packages
137
+ // filteredPackages.csdrPackages.forEach((p) => {
138
+ // const pkgPath = path.join(process.cwd(), 'node_modules', p);
139
+ // processPackageConfig(project, pkgPath);
140
+ // })
141
141
 
142
- // checking local packages
143
- filteredPackages.localPackages.forEach((p) => {
144
- const pkgPath = path.join(process.cwd(), 'packages', p);
145
- processPackageConfig(project, pkgPath);
146
- })
142
+ // // checking local packages
143
+ // filteredPackages.localPackages.forEach((p) => {
144
+ // const pkgPath = path.join(process.cwd(), 'packages', p);
145
+ // processPackageConfig(project, pkgPath);
146
+ // })
147
147
 
148
- })
148
+ // })
149
149
 
150
150
 
151
- .catch((e) => {
152
- throw e;
153
- })
154
- }
151
+ // .catch((e) => {
152
+ // throw e;
153
+ // })
154
+ // }
155
155
 
156
- const processPackageConfig = (project, folder) => {
157
- const configPath = path.join(folder, 'assets', 'config');
158
- tools.logInfo(`checking ${configPath}`);
156
+ // const processPackageConfig = (project, folder) => {
157
+ // const configPath = path.join(folder, 'assets', 'config');
158
+ // tools.logInfo(`checking ${configPath}`);
159
159
 
160
- // checking if pkg contains overriden config
161
- if (!tools.isDirExists(configPath)) {
162
- tools.logWarning('not found...skipping');
160
+ // // checking if pkg contains overriden config
161
+ // if (!tools.isDirExists(configPath)) {
162
+ // tools.logWarning('not found...skipping');
163
163
 
164
- // processing the files found and mapping them to base config files
165
- } else {
166
- const configFiles = tools.getFiles(configPath);
167
- tools.logSuccess('OK, found config files : ');
168
- console.log(configFiles);
164
+ // // processing the files found and mapping them to base config files
165
+ // } else {
166
+ // const configFiles = tools.getFiles(configPath);
167
+ // tools.logSuccess('OK, found config files : ');
168
+ // console.log(configFiles);
169
169
 
170
- // checking if files maps the base config file
171
- const projectAssetsPath = path.join(process.cwd(), project.folder, 'src', 'assets');
172
- const baseConfigFiles = tools.getFiles(projectAssetsPath);
170
+ // // checking if files maps the base config file
171
+ // const projectAssetsPath = path.join(process.cwd(), project.folder, 'src', 'assets');
172
+ // const baseConfigFiles = tools.getFiles(projectAssetsPath);
173
173
 
174
- configFiles.forEach((f) => {
175
- if (!baseConfigFiles.includes(f)) {
176
- tools.logWarning(`${f} is not matching base config files`);
174
+ // configFiles.forEach((f) => {
175
+ // if (!baseConfigFiles.includes(f)) {
176
+ // tools.logWarning(`${f} is not matching base config files`);
177
177
 
178
- } else {
179
- tools.logSuccess(`${f} matched in base config files...processing`);
178
+ // } else {
179
+ // tools.logSuccess(`${f} matched in base config files...processing`);
180
180
 
181
- // fetching files content
182
- const configFileContent = tools.getJsonFileContent(path.join(configPath, f));
183
- const baseConfigFileContent = tools.getJsonFileContent(path.join(projectAssetsPath, f));
181
+ // // fetching files content
182
+ // const configFileContent = tools.getJsonFileContent(path.join(configPath, f));
183
+ // const baseConfigFileContent = tools.getJsonFileContent(path.join(projectAssetsPath, f));
184
184
 
185
- baseConfigFileContent.openIdConnect.apiGatewayServices = {
186
- ...baseConfigFileContent.openIdConnect.apiGatewayServices,
187
- ...configFileContent.apiGatewayServices
188
- };
185
+ // baseConfigFileContent.openIdConnect.apiGatewayServices = {
186
+ // ...baseConfigFileContent.openIdConnect.apiGatewayServices,
187
+ // ...configFileContent.apiGatewayServices
188
+ // };
189
189
 
190
- baseConfigFileContent.modules = {
191
- ...baseConfigFileContent.modules,
192
- ...configFileContent.modules
193
- };
190
+ // baseConfigFileContent.modules = {
191
+ // ...baseConfigFileContent.modules,
192
+ // ...configFileContent.modules
193
+ // };
194
194
 
195
- tools.writeJsonFileSync(path.join(projectAssetsPath, f), baseConfigFileContent);
195
+ // tools.writeJsonFileSync(path.join(projectAssetsPath, f), baseConfigFileContent);
196
196
 
197
- tools.logSuccess('OK => file processed');
198
- }
197
+ // tools.logSuccess('OK => file processed');
198
+ // }
199
199
 
200
- })
201
- }
202
- }
200
+ // })
201
+ // }
202
+ // }
203
203
 
204
204
 
205
205
  module.exports.injectConfig = injectConfig;
206
- module.exports.injectPackagesConfig = injectPackagesConfig;
206
+ // module.exports.injectPackagesConfig = injectPackagesConfig;
@@ -160,6 +160,9 @@ module.exports.injectAppConfig = (project, configEnvTarget) => {
160
160
  envFilePath = path.join(project.paths.angularPath, 'src/assets/config', `env-json-config-${configEnvTarget}.json`);
161
161
  }
162
162
 
163
+ if (project.build && project.build.customEnvJsonConfigInjection) {
164
+ return;
165
+ }
163
166
  if (!tools.isFileExists(envFilePath)) {
164
167
  tools.logError(`Cannot find environment config to inject : `);
165
168
  tools.logError(`${envFilePath} missing...`);