@eui/tools 6.3.23 → 6.3.25
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.
- package/.version.properties +1 -1
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/scripts/csdr/cli/constants.js +1 -0
- package/scripts/csdr/cli/package-build-frontend.js +20 -17
- package/scripts/csdr/cli/package-prompt.js +12 -0
- package/scripts/csdr/cli/package.js +1 -0
- package/scripts/csdr/config/register.js +37 -2
- package/scripts/csdr/init/remotes.js +18 -16
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.3.
|
|
1
|
+
6.3.25
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 6.3.25 (2023-02-09)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* 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))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
10
|
+
## 6.3.24 (2023-02-08)
|
|
11
|
+
|
|
12
|
+
##### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **other:**
|
|
15
|
+
* wrong declaration order for virtual remote generation function - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([16b6590d](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/16b6590ddbe4b6f9cfb5db3f2f8a1c08ea46d4ad))
|
|
16
|
+
|
|
17
|
+
* * *
|
|
18
|
+
* * *
|
|
1
19
|
## 6.3.23 (2023-02-08)
|
|
2
20
|
|
|
3
21
|
##### Chores
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
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) {
|
|
@@ -39,24 +39,9 @@ const cloneRemotesConfig = module.exports.cloneRemotesConfig = () => {
|
|
|
39
39
|
module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
|
|
40
40
|
tools.logTitle('Generating virtual remote');
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
const remote = configUtils.remotes.getRemote(remoteName);
|
|
44
|
-
|
|
45
|
-
if (!remote) {
|
|
46
|
-
throw new Error(`Remote ${remoteName} can't be found in the remotes CSDR configuration OR the remotes configs of the project`);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
tools.logInfo('Remote config found: ')
|
|
50
|
-
console.log(remote);
|
|
51
|
-
|
|
52
|
-
const remotePath = path.join(process.cwd(), 'remotes', remote.name);
|
|
53
|
-
const remoteSrcPath = path.join(remotePath, 'src');
|
|
54
|
-
const remoteSkeletonRootPath = path.join(__dirname, 'remotes', remote.euiVersion);
|
|
55
|
-
const remoteSkeletonPath = path.join(remoteSkeletonRootPath, 'base');
|
|
56
|
-
|
|
42
|
+
let remote, remotePath, remoteSrcPath, remoteSkeletonRootPath, remoteSkeletonPath;
|
|
57
43
|
|
|
58
44
|
return Promise.resolve()
|
|
59
|
-
|
|
60
45
|
// clone remotes config if first init
|
|
61
46
|
.then(() => {
|
|
62
47
|
if (cloneRemote) {
|
|
@@ -64,6 +49,23 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
|
|
|
64
49
|
}
|
|
65
50
|
})
|
|
66
51
|
|
|
52
|
+
// getting remote config
|
|
53
|
+
.then(() => {
|
|
54
|
+
remote = configUtils.remotes.getRemote(remoteName);
|
|
55
|
+
|
|
56
|
+
if (!remote) {
|
|
57
|
+
throw new Error(`Remote ${remoteName} can't be found in the remotes CSDR configuration OR the remotes configs of the project`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
tools.logInfo('Remote config found: ')
|
|
61
|
+
console.log(remote);
|
|
62
|
+
|
|
63
|
+
remotePath = path.join(process.cwd(), 'remotes', remote.name);
|
|
64
|
+
remoteSrcPath = path.join(remotePath, 'src');
|
|
65
|
+
remoteSkeletonRootPath = path.join(__dirname, 'remotes', remote.euiVersion);
|
|
66
|
+
remoteSkeletonPath = path.join(remoteSkeletonRootPath, 'base');
|
|
67
|
+
})
|
|
68
|
+
|
|
67
69
|
.then(() => {
|
|
68
70
|
return tools.rimraf(remoteSrcPath);
|
|
69
71
|
})
|