@eui/tools 6.2.4 → 6.2.6

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.2.4
1
+ 6.2.6
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.2.6 (2022-11-10)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * add exclude non compatible routes per environment on dynamic replacement for MWP - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([bdaf38b4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/bdaf38b478b797e454abdc1b73d3cc9ecae071b0))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.2.5 (2022-11-10)
11
+
12
+ ##### Bug Fixes
13
+
14
+ * **other:**
15
+ * check if previous historyMetadata are present for first build on environment - EUI-6448 [EUI-6448](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-6448) ([e1491afd](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/e1491afd94652e56697a6680b9bcbaf54d170c6d))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.2.4 (2022-11-10)
2
20
 
3
21
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.2.4",
3
+ "version": "6.2.6",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -934,12 +934,12 @@ const versionUtils = require('./scripts/csdr/version/version-utils');
934
934
 
935
935
  // STYLES AUDIT TESTS
936
936
 
937
- Promise.resolve()
938
- .then(() => {
939
- const { pkg } = tools.getArgs();
940
- const p = configUtils.packages.getPackage(pkg, true);
941
- return auditUtils.styles.audit(p);
942
- })
937
+ // Promise.resolve()
938
+ // .then(() => {
939
+ // const { pkg } = tools.getArgs();
940
+ // const p = configUtils.packages.getPackage(pkg, true);
941
+ // return auditUtils.styles.audit(p);
942
+ // })
943
943
 
944
944
  // const installPackages = async packages => {
945
945
  // const promises = packages.map(async p => {
@@ -1027,3 +1027,32 @@ Promise.resolve()
1027
1027
  // // })
1028
1028
 
1029
1029
  // })
1030
+
1031
+ // Promise.resolve()
1032
+ // .then(() => {
1033
+ // const dev = tools.getJsonFileContent(path.join(process.cwd(), 'packages', 'mywp-routes-config', 'assets', 'route-defs.dev.json'));
1034
+ // const tst = tools.getJsonFileContent(path.join(process.cwd(), 'packages', 'mywp-routes-config', 'assets', 'route-defs.test.json'));
1035
+
1036
+ // const devPaths = dev.map((p) => {
1037
+ // return p.path;
1038
+ // })
1039
+ // const tstPaths = tst.map((p) => {
1040
+ // return p.path;
1041
+ // })
1042
+
1043
+ // console.log(devPaths);
1044
+ // console.log(tstPaths);
1045
+
1046
+
1047
+ // console.log(devPaths.filter(n => !tstPaths.includes(n)))
1048
+ // console.log(tstPaths.filter(n => !devPaths.includes(n)))
1049
+ // })
1050
+
1051
+
1052
+ Promise.resolve()
1053
+ .then(() => {
1054
+ const prjName = 'my-workplace-host';
1055
+ const project = configUtils.projects.getCsdrProject(prjName);
1056
+
1057
+ return injectionUtils.routesReplacement.buildRoutes(project, 'TST', true);
1058
+ })
@@ -86,26 +86,8 @@ const storeMetadataAssets = (project, newVersion, packagesDeps, historyMetadata,
86
86
  tools.logTitle('Storing app assets metadata');
87
87
 
88
88
  return Promise.resolve()
89
- // getting remotes entries
90
- .then(() => {
91
- let remotes = [];
92
-
93
- if (project.hasRemotes) {
94
- remotes = configUtils.packages.getCsdrRemotePackages().filter((p) => {
95
- return p.hostAppName = project.name
96
- }).map((p) => {
97
- return { name: p.name, npmPkg: p.npmPkg }
98
- });
99
- if (remotes) {
100
- remotes = tools.sortArray(remotes, 'name');
101
- }
102
- }
103
-
104
- return remotes;
105
- })
106
-
107
89
  // storing metadata file
108
- .then((remotes) => {
90
+ .then(() => {
109
91
  tools.logInfo('Storing app metadata into project assets');
110
92
 
111
93
  const appMetadata = {
@@ -113,7 +95,6 @@ const storeMetadataAssets = (project, newVersion, packagesDeps, historyMetadata,
113
95
  appReleaseDate: appReleaseDate,
114
96
  appInfos: appInfos,
115
97
  metadata: packagesDeps,
116
- remotes: remotes,
117
98
  };
118
99
 
119
100
  const metadataFile = path.join(project.folder, 'src', 'assets', 'app-metadata.json');
@@ -130,12 +111,17 @@ const storeMetadataAssets = (project, newVersion, packagesDeps, historyMetadata,
130
111
  .then(() => {
131
112
  tools.logInfo('Storing app env delta metadata into project assets');
132
113
 
133
- const metadataFile = path.join(project.folder, 'src', 'assets', 'app-metadata-history.json');
114
+ if (!historyMetadata) {
115
+ tools.logInfo('no history metadata found...skipping');
134
116
 
135
- tools.logInfo(`Creating ${metadataFile}`);
117
+ } else {
118
+ const metadataFile = path.join(project.folder, 'src', 'assets', 'app-metadata-history.json');
136
119
 
137
- if (!dryRun && envTarget && envTarget !== 'DEV') {
138
- return tools.writeJsonFileSync(metadataFile, historyMetadata);
120
+ tools.logInfo(`Creating ${metadataFile}`);
121
+
122
+ if (!dryRun && envTarget && envTarget !== 'DEV') {
123
+ return tools.writeJsonFileSync(metadataFile, historyMetadata);
124
+ }
139
125
  }
140
126
  })
141
127
 
@@ -304,16 +304,23 @@ const replaceRoutes = (project, envTarget, build, routesFileContent, euiVersion)
304
304
  finalRouteDefs.forEach((route) => {
305
305
  if (debug) tools.logInfo(`====> route : ${route.path}`);
306
306
 
307
- if (euiVersion === 'DEFAULT' || euiVersion === '10.x') {
308
- tools.logInfo(`Legacy routes replacement for v7 and v10 => replacing ${route.path}`);
309
- placeHolderContent += replaceRouteLegacy(route);
307
+ if (!route.loadChildren) {
308
+ tools.logInfo('Loadchildren does not exist for route...skipping');
309
+ tools.logInfo('Route excluded:');
310
+ console.log(route);
310
311
 
311
312
  } else {
312
- tools.logInfo(`New route replacement for v14+ => replacing ${route.path}`);
313
- placeHolderContent += replaceRoute(route);
314
- }
313
+ if (euiVersion === 'DEFAULT' || euiVersion === '10.x') {
314
+ tools.logInfo(`Legacy routes replacement for v7 and v10 => replacing ${route.path}`);
315
+ placeHolderContent += replaceRouteLegacy(route);
316
+
317
+ } else {
318
+ tools.logInfo(`New route replacement for v14+ => replacing ${route.path}`);
319
+ placeHolderContent += replaceRoute(route);
320
+ }
315
321
 
316
- if (debug) tools.logSuccess('======> OK replaced');
322
+ if (debug) tools.logSuccess('======> OK replaced');
323
+ }
317
324
  })
318
325
 
319
326
  const placeHolderToken = '// routes-placeholder';