@eui/tools 6.3.24 → 6.3.26

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.3.24
1
+ 6.3.26
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.3.26 (2023-02-09)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * skeleton cleanup for the modules config part MWP-9235 [MWP-9235](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9235) ([d1d8f81c](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/d1d8f81c3f130b574d52796909dd4660c9602a87))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.3.25 (2023-02-09)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * adapted cli for generation of full virtual remotes v15 - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([f5e9e0a2](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/f5e9e0a200d53f2299aad561adba2906a9b9f684))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.3.24 (2023-02-08)
2
20
 
3
21
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.3.24",
3
+ "version": "6.3.26",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -40,6 +40,7 @@ module.exports.DEFAULT_CONFIG = {
40
40
  isCsdrRepo: true,
41
41
  isEnvTargetRemote: false,
42
42
  isVirtualRemote: false,
43
+ isFullVirtualRemote: false,
43
44
  externalRepoName: null,
44
45
  pkgGroupId: 'eu.europa.ec.cc'
45
46
  };
@@ -14,12 +14,12 @@ const constants = require('./constants');
14
14
 
15
15
 
16
16
 
17
- const init = (frontendType, rootPackagePath, targetPath) => {
17
+ const init = (frontendType, rootPackagePath, targetPath, isFullVirtualRemote) => {
18
18
  return Promise.resolve()
19
19
 
20
20
  // CHECKING presence of UI package supporting the remote
21
21
  .then(() => {
22
- if (frontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE && !tools.isDirExists(rootPackagePath)) {
22
+ if (frontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE && !isFullVirtualRemote && !tools.isDirExists(rootPackagePath)) {
23
23
  tools.logError(`${rootPackagePath} NOT FOUND, you must mount the root package ui before creating the remote`);
24
24
  throw new Error('ROOT_PACKAGE_NOT_FOUND');
25
25
  }
@@ -84,40 +84,43 @@ const generateVirtualRemote = ({fullName, targetPath, rootPackagePath, pkg, args
84
84
  return Promise.resolve()
85
85
  // INIT and cleanup
86
86
  .then(() => {
87
- return init(args.pkgFrontendType, rootPackagePath, targetPath);
87
+ return init(args.pkgFrontendType, rootPackagePath, targetPath, args.isFullVirtualRemote);
88
88
  })
89
89
 
90
90
  // COPY FIRST THE REMOTE SKELETON TO TARGET
91
91
  .then(() => {
92
92
  tools.logInfo('Copying skeleton to target');
93
93
 
94
- // for the moment the virtual remotes are only activated for v15+
95
- if (args.pkgFrontendVersion == constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI15) {
96
- tools.copydir(constants.FRONTEND_SKELETON_REMOTE_EUI15_PATH, targetPath, true);
97
- } else if (args.pkgFrontendVersion == constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI10) {
98
- tools.copydir(constants.FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
99
- }
94
+ if (!args.isFullVirtualRemote) {
95
+ // for the moment the virtual remotes are only activated for v15+
96
+ if (args.pkgFrontendVersion == constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI15) {
97
+ tools.copydir(constants.FRONTEND_SKELETON_REMOTE_EUI15_PATH, targetPath, true);
98
+ } else if (args.pkgFrontendVersion == constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI10) {
99
+ tools.copydir(constants.FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
100
+ }
100
101
 
101
- // REPLACING PLACEHOLDERS
102
- tools.logInfo('Replace sources content');
103
- replaceContent(targetPath, args.pkgName, args.pkgScope, fullName);
102
+ // REPLACING PLACEHOLDERS
103
+ tools.logInfo('Replace sources content');
104
+ replaceContent(targetPath, args.pkgName, args.pkgScope, fullName);
105
+
106
+ // REPLACE EXTENSIONS (package.json, .gitignore as the interfere with build of tools if release without name changes)
107
+ replaceExtensions(targetPath);
108
+ }
104
109
 
105
110
  // ADDING CONFIG ENTRY - specific csdr-remotes as of v15+
106
111
  tools.logInfo('Adding CSDR config entry');
107
112
  configUtils.register.registerCsdrPackage(
108
113
  pkg, args.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE,
109
114
  args.pkgScope, args.pkgName, args.pkgFrontendVersion,
110
- args.isVirtualRemote
115
+ args.isVirtualRemote,
116
+ args.isFullVirtualRemote
111
117
  );
112
-
113
- // REPLACE EXTENSIONS (package.json, .gitignore as the interfere with build of tools if release without name changes)
114
- replaceExtensions(targetPath);
115
118
  })
116
119
 
117
120
  // ENV TARGET / a-la-carte specific (always true as of v15+ remotes) - TRANSFER The sources from current remote sources
118
121
  .then(() => {
119
122
  // envTarget remote type specific
120
- if (args.isEnvTargetRemote) {
123
+ if (args.isEnvTargetRemote && !args.isFullVirtualRemote) {
121
124
  tools.logInfo('Moving sources from remote to root package for envTarget remote type');
122
125
  return tools.move(path.join(targetPath, 'src'), path.join(rootPackagePath, 'assets', 'remote-sources'));
123
126
  }
@@ -139,6 +139,18 @@ module.exports.prompt = () => {
139
139
  );
140
140
  }
141
141
  },
142
+ {
143
+ name: 'isFullVirtualRemote',
144
+ type: 'confirm',
145
+ message: 'Is this a virtual remote with full skeleton sources ?',
146
+ default: constants.DEFAULT_CONFIG.isFullVirtualRemote,
147
+ when: function (answers) {
148
+ return (
149
+ answers.pkgType === constants.CONFIG_OPTIONS.pkgType.FRONTEND &&
150
+ answers.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE
151
+ );
152
+ }
153
+ },
142
154
  {
143
155
  name: 'isCsdrRepo',
144
156
  type: 'confirm',
@@ -39,6 +39,7 @@ module.exports.generate = () => {
39
39
  answers.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE
40
40
  ) {
41
41
  answers.isVirtualRemote = true;
42
+ answers.isFullVirtualRemote = true;
42
43
  }
43
44
 
44
45
  if (answers.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE) {
@@ -66,7 +66,7 @@ module.exports.registerCsdrProject = (name, isFullSkeleton) => {
66
66
 
67
67
  // Register newly created package
68
68
 
69
- module.exports.registerCsdrPackage = (pkg, isRemote, rootPkgScope, rootPkgName, euiVersionNumber, isVirtualRemote) => {
69
+ module.exports.registerCsdrPackage = (pkg, isRemote, rootPkgScope, rootPkgName, euiVersionNumber, isVirtualRemote, isFullVirtualRemote) => {
70
70
 
71
71
  const csdrConfigPackage = {
72
72
  "name": "@module.full.name@",
@@ -152,13 +152,47 @@ module.exports.registerCsdrPackage = (pkg, isRemote, rootPkgScope, rootPkgName,
152
152
  }
153
153
  }
154
154
 
155
+ const csdrConfigRemotePackageV15VirtualFull = {
156
+ "npmPkg": "@module.npmPkg.name@",
157
+ "euiVersion": "15.x",
158
+ "build": {
159
+ "compiledTranslations": true,
160
+ "translationScopes": "eui,csdr,cc,mywp",
161
+ "envTargetActive": true,
162
+ "sonarScanner": false
163
+ },
164
+ "release": {
165
+ "team": "cc-ui-rm"
166
+ },
167
+ "slack": {
168
+ "channel": "csdr-timeline-mwp-remotes-cc"
169
+ },
170
+ "fullSkeletonSources": true,
171
+ "skeletonConfig": {
172
+ "rootNpmPkg": "@module.rootPkg.scope@/@module.rootPkg.name@",
173
+ "rootCommonModule": "CommonModule",
174
+ "baseUrl": "@module.rootPkg.name@",
175
+ "elementName": "@module.scope.name@",
176
+ "storeName": "@module.scope.name@",
177
+ "options": {
178
+ "userReducers": false,
179
+ "zipkin": false,
180
+ "dynatrace": false
181
+ }
182
+ }
183
+ }
184
+
155
185
 
156
186
  // inserting package in root config
157
187
  let packageDef;
158
188
 
159
189
  if (isRemote) {
160
190
  if (euiVersionNumber >= 15) {
161
- packageDef = JSON.stringify(csdrConfigRemotePackageV15Virtual);
191
+ if (isFullVirtualRemote) {
192
+ packageDef = JSON.stringify(csdrConfigRemotePackageV15VirtualFull);
193
+ } else {
194
+ packageDef = JSON.stringify(csdrConfigRemotePackageV15Virtual);
195
+ }
162
196
  } else if (euiVersionNumber >= 10 && isVirtualRemote) {
163
197
  packageDef = JSON.stringify(csdrConfigRemotePackageV10Virtual);
164
198
  } else {
@@ -173,6 +207,7 @@ module.exports.registerCsdrPackage = (pkg, isRemote, rootPkgScope, rootPkgName,
173
207
  replaceModule = tools.replaceAll(replaceModule, '@module.npmPkg.name@', pkg.npmPkgName);
174
208
  replaceModule = tools.replaceAll(replaceModule, '@module.rootPkg.scope@', rootPkgScope);
175
209
  replaceModule = tools.replaceAll(replaceModule, '@module.rootPkg.name@', rootPkgName);
210
+ replaceModule = tools.replaceAll(replaceModule, '@module.scope.name@', `${rootPkgScope.substr(1)}-${rootPkgName}`);
176
211
 
177
212
  let file = path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json');
178
213
  if (isRemote && isVirtualRemote) {
@@ -1,3 +1,3 @@
1
1
  import { ModulesConfig } from '@eui/core';
2
2
 
3
- export const MODULES: ModulesConfig = JSON.parse(JSON.stringify(window['PROVIDERS']['CONFIG_TOKEN'].modules));
3
+ export const MODULES: ModulesConfig = {};