@eui/tools 6.12.38 → 6.12.40

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
- 6.12.38
1
+ 6.12.40
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.12.40 (2023-08-11)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * route-replacement allow static route import - EUO-7860 [EUO-7860](https://webgate.ec.europa.eu/CITnet/jira/browse/EUO-7860) ([45263ee5](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/45263ee59e90a466f7bbf438ac55071109460940))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.12.39 (2023-08-10)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * added capabilities for stand-alone generic portal for CBAM PoC - EUI-7860 [EUI-7860](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7860) ([0453e5bd](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/0453e5bda0ffb6b4b4c42d485b76ba0317d59be0))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.12.38 (2023-08-07)
2
20
 
3
21
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.12.38",
3
+ "version": "6.12.40",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -1306,15 +1306,23 @@ const publishUtils = require('./scripts/utils/publish/publish-utils');
1306
1306
  // })
1307
1307
 
1308
1308
 
1309
+ // Promise.resolve()
1310
+ // .then(() => {
1311
+ // const prjName = 'my-workplace-host-playground-custom';
1312
+ // const project = configUtils.projects.getCsdrProject(prjName);
1313
+ // const envTarget = 'cdn-dev-local';
1309
1314
 
1315
+ // return preBuildUtils.routesReplacement.buildRoutes(project, envTarget);
1316
+ // })
1317
+
1318
+ // .catch((e) => {
1319
+ // console.log(e);
1320
+ // })
1310
1321
 
1311
1322
  Promise.resolve()
1312
1323
  .then(() => {
1313
- const prjName = 'my-workplace-host-playground-custom';
1314
- const project = configUtils.projects.getCsdrProject(prjName);
1315
- const envTarget = 'cdn-dev-local';
1316
-
1317
- return preBuildUtils.routesReplacement.buildRoutes(project, envTarget);
1324
+ const pkgs = configUtils.packages.getPackages();
1325
+ console.log(pkgs);
1318
1326
  })
1319
1327
 
1320
1328
  .catch((e) => {
@@ -278,7 +278,7 @@ module.exports.registerAngularProjectDef = (project, build = false, element = fa
278
278
  }
279
279
 
280
280
  tools.logInfo('Processing scripts injection...');
281
- if (angularConfigFile.build.scripts.length > 0) {
281
+ if (angularConfigFile.build.scripts && angularConfigFile.build.scripts.length > 0) {
282
282
  jsonFile['projects'][project.name].architect.build.options.scripts = angularConfigFile.build.scripts;
283
283
  }
284
284
 
@@ -64,7 +64,6 @@ module.exports.init = (args) => {
64
64
 
65
65
 
66
66
  const cloneAndCheckout = (repo, args) => {
67
-
68
67
  if (repo.folder.indexOf('apps/') > -1 && args.skipAppContainers) {
69
68
  return Promise.resolve();
70
69
  }
@@ -268,6 +268,11 @@ const getGitHost = (externalRepo) => {
268
268
 
269
269
 
270
270
  const cloneRepo = (repoUri, folder, forced = false, shallow = false, externalRepo = false) => {
271
+ if (!repoUri) {
272
+ tools.logWarning('Repository not set -- bypassing clone...');
273
+ return;
274
+ }
275
+
271
276
  return Promise.resolve()
272
277
  .then(() => {
273
278
  if (tools.isDirExists(folder) && forced) {
@@ -346,6 +351,11 @@ const checkout = (branch, folder, shallow = false) => {
346
351
 
347
352
 
348
353
  const cloneAndCheckout = (repoUri, folder, branch, forced, shallow) => {
354
+ if (!repoUri) {
355
+ tools.logWarning('Repository set to false -- clone deactivated');
356
+ return;
357
+ }
358
+
349
359
  tools.logInfo(`cloning ${repoUri} in ${folder} on branch ${branch}`);
350
360
 
351
361
  return Promise.resolve()
@@ -6,7 +6,7 @@ const tools = require('../../tools');
6
6
  const gitUtils = require('../../git-utils');
7
7
  const configUtils = require('../../../csdr/config/config-utils');
8
8
 
9
-
9
+ const { skipPull } = tools.getArgs();
10
10
 
11
11
  const injectExternalAppSourcesCore = (project, build = false, injectedNpmPkg, injectedFolder, euiVersion) => {
12
12
 
@@ -379,6 +379,9 @@ module.exports.injectExternalFeatures = (project) => {
379
379
 
380
380
 
381
381
  module.exports.injectExternalMock = (project) => {
382
+ if (skipPull) {
383
+ return;
384
+ }
382
385
 
383
386
  tools.logTitle(`Injecting project external mock for : ${project.name}`);
384
387
 
@@ -112,10 +112,11 @@ const injectRoutesConfig = (project) => {
112
112
  tools.logInfo(`${routesConfigPath} - injecting in ${project.paths.assetsPath}`);
113
113
  tools.copydir(routesConfigPath, project.paths.assetsPath);
114
114
 
115
- const workspacesConfigPath = path.join(pkgAssetsPath, project.externalRoutesSources.workspacesConfigAssetsPath);
116
- tools.logInfo(`${workspacesConfigPath} - injecting in ${project.paths.assetsPath}`);
117
- tools.copydir(workspacesConfigPath, project.paths.assetsPath);
118
-
115
+ if (project.externalRoutesSources.workspacesConfigAssetsPath) {
116
+ const workspacesConfigPath = path.join(pkgAssetsPath, project.externalRoutesSources.workspacesConfigAssetsPath);
117
+ tools.logInfo(`${workspacesConfigPath} - injecting in ${project.paths.assetsPath}`);
118
+ tools.copydir(workspacesConfigPath, project.paths.assetsPath);
119
+ }
119
120
  };
120
121
 
121
122
 
@@ -501,7 +502,11 @@ const generateLinks = (project, routes, envTargetFinal) => {
501
502
  const routeDefsBaseFilename = 'route-defs-base.json';
502
503
  const routeDefsBaseJSON = require(path.join(project.paths.assetsPath, routeDefsBaseFilename));
503
504
  const workspaceDefsBaseFilename = 'workspace-defs-base.json';
504
- const workspaceDefsBaseJSON = require(path.join(project.paths.assetsPath, workspaceDefsBaseFilename));
505
+
506
+ let workspaceDefsBaseJSON;
507
+ if (tools.isFileExists(path.join(project.paths.assetsPath, workspaceDefsBaseFilename))) {
508
+ workspaceDefsBaseJSON = require(path.join(project.paths.assetsPath, workspaceDefsBaseFilename));
509
+ }
505
510
 
506
511
  const getRouteMenuDef = (link) => {
507
512
  let routeDef = null;
@@ -565,18 +570,20 @@ const generateLinks = (project, routes, envTargetFinal) => {
565
570
 
566
571
  // Combining workspaces definitions with base links definitions
567
572
 
568
- workspaceDefsBaseJSON.forEach((wp) => {
569
- if (wp.baseLinkDefs) {
570
- wp.baseLinkDefs.forEach((wpLink) => {
571
- workspaceLinks.push({
572
- ...wpLink,
573
- workspace: wp.id
573
+ if (workspaceDefsBaseJSON) {
574
+ workspaceDefsBaseJSON.forEach((wp) => {
575
+ if (wp.baseLinkDefs) {
576
+ wp.baseLinkDefs.forEach((wpLink) => {
577
+ workspaceLinks.push({
578
+ ...wpLink,
579
+ workspace: wp.id
580
+ });
574
581
  });
575
- });
576
- }
577
- });
582
+ }
583
+ });
578
584
 
579
- tools.logInfo(`Workspaces links generated : ${workspaceLinks.length}`);
585
+ tools.logInfo(`Workspaces links generated : ${workspaceLinks.length}`);
586
+ }
580
587
 
581
588
  const globalLinks = [
582
589
  ...routeDefsBaseLinksJSON,
@@ -624,7 +631,7 @@ const generateLinks = (project, routes, envTargetFinal) => {
624
631
  if (project.name.indexOf('playground') > 0) {
625
632
  const routePathInInputRoutes = routes.filter(r => r.angularRouteDef.path === defRoute.path)[0];
626
633
 
627
- if (!routePathInInputRoutes) {
634
+ if (!routePathInInputRoutes && !link.static) {
628
635
  defRoute.disabled = true;
629
636
  } else {
630
637
  tools.logInfo(`[${defRoute.url}] --> route found in input routes - enabled`);
@@ -763,7 +763,7 @@ const log = (msg, type) => {
763
763
  if (type === 4) {
764
764
  prefix = figures.pointer.repeat(6);
765
765
  msgContent = `\n${currentDateTime} - ${prefix} ${msg}\n`;
766
- console.info(chalk.keyword('orange')(msgContent));
766
+ console.info(chalk.keyword('yellow')(msgContent));
767
767
  }
768
768
  if (type === 5) {
769
769
  prefix = figures.star.repeat(3);