@eui/tools 6.2.15 → 6.2.16

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.15
1
+ 6.2.16
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.2.16 (2022-11-12)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * adapted naming conventions compliant to actual remote name format for virtual remotes - MWP-9010 [MWP-9010](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9010) ([ed9b7ffa](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/ed9b7ffad457790d49534ea2f5c8832cd4d59a95))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.2.15 (2022-11-12)
2
11
 
3
12
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.2.15",
3
+ "version": "6.2.16",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -6,53 +6,34 @@ const path = require('path');
6
6
  // LOCAL
7
7
  const tools = require('../../utils/tools');
8
8
 
9
- module.exports.getRemote = (remoteName, euiVersion) => {
9
+
10
+ module.exports.getRemote = (remoteName) => {
10
11
 
11
12
  // if not provided as param, we fetch them from the command line (local operations)
12
13
  if (!remoteName) {
13
14
  remoteName = tools.getArgs().root;
14
15
  }
15
16
 
16
- if (!euiVersion) {
17
- euiVersion = tools.getArgs().euiVersion;
18
- }
19
-
20
-
21
- if (!euiVersion) {
22
- throw new Error('euiVersion should be provided as parameter');
23
- }
24
-
25
- tools.logTitle(`Getting remote config for ${remoteName} version ${euiVersion}`);
17
+ tools.logTitle(`Getting remote config for ${remoteName}`);
26
18
 
27
19
  const remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
28
20
  const remoteConfig = remotesConfig[remoteName];
29
21
 
30
- if (!remoteConfig.supportedVersions && !remoteConfig.supportedVersions.includes(euiVersion)) {
31
- throw new Error(`Version ${euiVersion} cannot be found in the global config of ${remoteName}`);
32
-
33
- } else {
34
- tools.logInfo('Global config found');
35
- console.log(remoteConfig);
36
- }
22
+ tools.logInfo('Global config found');
23
+ console.log(remoteConfig);
37
24
 
38
- const remotePath = path.join(process.cwd(), 'packages', 'csdr-remotes-config', 'assets', remoteName, euiVersion);
25
+ const remotePath = path.join(process.cwd(), 'packages', 'csdr-remotes-config', 'assets', remoteName);
39
26
 
40
27
  tools.logInfo(`Getting remote information from ${remotePath}`);
41
28
 
42
29
  if (!tools.isDirExists(remotePath)) {
43
- throw new Error(`Remote ${remoteName} cannot be found in the remotes config global `);
30
+ throw new Error(`Remote ${remoteName} cannot be found in the remotes global config - check packages/csdr-remotes-config for available remotes`);
44
31
  }
45
32
 
46
-
47
- const euiVersionNumber = euiVersion.split('.')[0];
48
-
49
- const fullName = `${remoteName}-eui${euiVersionNumber}`;
50
- const remoteRootPath = path.join(process.cwd(), 'remotes', fullName);
33
+ const remoteRootPath = path.join(process.cwd(), 'remotes', remoteName);
51
34
 
52
35
  const remote = {
53
36
  name: remoteName,
54
- version: euiVersion,
55
- fullName: fullName,
56
37
  element: true,
57
38
  remote: true,
58
39
  virtual: true,
@@ -62,13 +43,13 @@ module.exports.getRemote = (remoteName, euiVersion) => {
62
43
  root: remoteRootPath,
63
44
  dist: path.join(remoteRootPath, 'dist'),
64
45
  publish: path.join(remoteRootPath, 'dist'), // maintain compat with core publish utils
65
- fromRoot: `remotes/${fullName}`,
46
+ fromRoot: `remotes/${remoteName}`,
66
47
  repoNodeModules: path.join(remoteRootPath, 'node_modules'),
67
48
  },
68
- devopsMetadataFile: `${fullName}-build-metadata.json`,
69
- devopsVersionsMetadataFile: `${fullName}-versions-metadata.json`,
70
- devopsHistoryMetadataFile: `${fullName}-history-metadata.json`,
71
- devopsEnvsMetadataFile: `${fullName}-envs-metadata.json`,
49
+ devopsMetadataFile: `${remoteName}-build-metadata.json`,
50
+ devopsVersionsMetadataFile: `${remoteName}-versions-metadata.json`,
51
+ devopsHistoryMetadataFile: `${remoteName}-history-metadata.json`,
52
+ devopsEnvsMetadataFile: `${remoteName}-envs-metadata.json`,
72
53
  ...remoteConfig,
73
54
  }
74
55
 
@@ -119,11 +119,7 @@ module.exports.init = () => {
119
119
  // Generating virtual remote - experimental
120
120
  .then(() => {
121
121
  if (finalResponse.remote) {
122
- if (finalResponse.euiVersion) {
123
- return initUtils.remotes.generateVirtualRemote(finalResponse.remote, finalResponse.euiVersion);
124
- } else {
125
- throw new Error('When a remote is initialized, an "euiVersion" parameter must be specified');
126
- }
122
+ return initUtils.remotes.generateVirtualRemote(finalResponse.remote);
127
123
  }
128
124
  })
129
125
 
@@ -36,7 +36,7 @@ const cloneRemotesConfig = module.exports.cloneRemotesConfig = () => {
36
36
 
37
37
 
38
38
 
39
- module.exports.generateVirtualRemote = (remoteName, euiVersion) => {
39
+ module.exports.generateVirtualRemote = (remoteName) => {
40
40
  tools.logTitle('Generating virtual remote');
41
41
 
42
42
  return Promise.resolve()
@@ -48,18 +48,18 @@ module.exports.generateVirtualRemote = (remoteName, euiVersion) => {
48
48
 
49
49
  .then(() => {
50
50
  // getting the remote config
51
- const remote = configUtils.remotes.getRemote(remoteName, euiVersion);
51
+ const remote = configUtils.remotes.getRemote(remoteName);
52
52
 
53
53
  if (!remote) {
54
54
  throw new Error(`Remote ${remoteName} can't be found in the remotes CSDR configuration OR the remotes configs of the project`);
55
55
  }
56
56
 
57
- tools.logInfo('Remote config gathered:')
57
+ tools.logInfo('Remote config found: ')
58
58
  console.log(remote);
59
59
 
60
60
  // constructing the remote folder
61
- const remotePath = path.join(process.cwd(), 'remotes', remote.fullName);
62
- const remoteSkeletonPath = path.join(__dirname, 'remotes', euiVersion);
61
+ const remotePath = path.join(process.cwd(), 'remotes', remote.name);
62
+ const remoteSkeletonPath = path.join(__dirname, 'remotes', remote.euiVersion);
63
63
 
64
64
  tools.logInfo(`Copying angular.json => ${remoteSkeletonPath} ==> ${remotePath}`);
65
65
 
@@ -90,14 +90,14 @@ module.exports.generateVirtualRemote = (remoteName, euiVersion) => {
90
90
  let angularJson = tools.getJsonFileContent(angularJsonPath);
91
91
 
92
92
  let angularContent = JSON.stringify(angularJson);
93
- angularContent = angularContent.replace('@remote.name@', remote.fullName);
93
+ angularContent = angularContent.replace('@remote.name@', remote.name);
94
94
 
95
95
  angularJson = JSON.parse(angularContent);
96
- angularJson.projects[remote.fullName].architect.build.options.styles = remote.angularConfig.styles;
96
+ angularJson.projects[remote.name].architect.build.options.styles = remote.angularConfig.styles;
97
97
 
98
98
  if (remote.angularConfig.scripts) {
99
- angularJson.projects[remote.fullName].architect.build.options.scripts = [
100
- ...angularJson.projects[remote.fullName].architect.build.options.scripts,
99
+ angularJson.projects[remote.name].architect.build.options.scripts = [
100
+ ...angularJson.projects[remote.name].architect.build.options.scripts,
101
101
  ...remote.angularConfig.scripts
102
102
  ];
103
103
  }
@@ -13,9 +13,7 @@ const innerPackages = require('./packages');
13
13
 
14
14
  module.exports.installPackage = (pkgName) => {
15
15
 
16
- const { euiVersion } = tools.getArgs();
17
-
18
- const pkg = configUtils.remotes.getRemote(pkgName, euiVersion);
16
+ const pkg = configUtils.remotes.getRemote(pkgName);
19
17
 
20
18
  if (!pkg) {
21
19
  pkg = configUtils.packages.getPackage(pkgName, false, true);
@@ -12,7 +12,7 @@ module.exports.run = () => {
12
12
 
13
13
  // TESTING a release pipeline in DRY-RUN mode :
14
14
  // virtual remotes
15
- // npm run pkg:release mywp-dashboard -- --euiVersion 15.x --dryRun --branch master --remoteBuild true --virtual true --envTarget DEV --skipInstall
15
+ // npm run pkg:release mywp-dashboard-eui15-remote-el-ui -- --dryRun --branch master --remoteBuild true --virtual true --envTarget DEV --skipInstall
16
16
 
17
17
  // normal UI package / old style remote
18
18
  // npm run pkg:release csdr-core-ui -- --dryRun --branch develop --skipInstall