@eui/tools 4.15.14 → 4.16.3
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 +48 -0
- package/bin/eui-scripts.js +0 -4
- package/global.test.js +1 -4
- package/package.json +3 -3
- package/sandbox.js +10 -3
- package/scripts/csdr/config/packages.js +28 -0
- package/scripts/csdr/init/init-utils.js +39 -0
- package/scripts/csdr/init/init.js +6 -0
- package/scripts/csdr/init/resources/13.x/resolutions.json +15 -0
- package/scripts/csdr/install/build-package.js +0 -84
- package/scripts/csdr/install/common.js +0 -16
- package/scripts/csdr/metadata/app.js +3 -3
- package/scripts/csdr/release/package/backend.js +26 -0
- package/scripts/csdr/release/package/common.js +1 -1
- package/scripts/csdr/release/package/release-package.js +4 -0
- package/scripts/csdr/release/package/ui.js +84 -1
- package/scripts/csdr/sync/sync-utils.js +7 -4
- package/scripts/csdr/version/package.js +2 -1
- package/scripts/utils/build/app/build-app-utils.js +2 -2
- package/scripts/utils/build/package/element.js +2 -2
- package/scripts/utils/notification/common.js +5 -0
- package/scripts/utils/notification/mail-utils.js +3 -0
- package/scripts/utils/notification/mailstack.js +3 -5
- package/scripts/utils/notification/package.js +0 -2
- package/scripts/utils/notification/slack-utils.js +6 -7
- package/scripts/utils/pre-build/injection/config.js +29 -30
- package/scripts/utils/pre-build/injection/externals.js +6 -0
- package/scripts/utils/serve/app.js +6 -3
- package/scripts/utils/tools.js +362 -304
- package/bin/scripts/csdr-jira-update.js +0 -12
- package/bin/scripts/csdr-migrate-package.js +0 -17
- package/bin/scripts/e2e-app.js +0 -62
- package/scripts/csdr/init/resources/yarn-eui13.lock +0 -15857
- package/scripts/migration/eui8-migration.js +0 -94
- package/scripts/migration/migrate-utils.js +0 -191
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.16.3
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
## 4.16.3 (2021-11-03)
|
|
2
|
+
|
|
3
|
+
##### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* revert jest upgrade - failing app build - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([51a13fcd](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/51a13fcd2b412fbe8620037fd3586f268f8c6cf2))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
10
|
+
## 4.16.2 (2021-11-03)
|
|
11
|
+
|
|
12
|
+
##### Chores
|
|
13
|
+
|
|
14
|
+
* **other:**
|
|
15
|
+
* revert git clone logging - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([c3d02144](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/c3d02144ee3b21103c3f3084b51dff738f88f207))
|
|
16
|
+
* added log for metadata cloning step ([de96e57f](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/de96e57ff8d6062aa07924102fd223b2b0c91610))
|
|
17
|
+
* forced re-build - testing refactoring - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([69f4627b](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/69f4627bdf818d6751ce45dc5496ca657c0540e3))
|
|
18
|
+
|
|
19
|
+
* * *
|
|
20
|
+
* * *
|
|
21
|
+
|
|
22
|
+
## 4.16.1 (2021-11-03)
|
|
23
|
+
|
|
24
|
+
##### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **other:**
|
|
27
|
+
* adapted when no eUI version found in local packages to default resolutions - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([b34365f2](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/b34365f21113717df9fec37daeb33a0be81f4a1e))
|
|
28
|
+
* missing import - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([1706ff54](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/1706ff543f15ea4f711e868512011b9531505386))
|
|
29
|
+
|
|
30
|
+
* * *
|
|
31
|
+
* * *
|
|
32
|
+
## 4.16.0 (2021-11-03)
|
|
33
|
+
|
|
34
|
+
##### Chores
|
|
35
|
+
|
|
36
|
+
* **other:**
|
|
37
|
+
* refactoring ([6bd95ede](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/6bd95ede679710adc95353089c0efe1691cac5f0))
|
|
38
|
+
##### New Features
|
|
39
|
+
|
|
40
|
+
* **other:**
|
|
41
|
+
* refactoring - added timestamp to logger - cleanup - added dynamic resolutions generation on sync and init - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([0ab46918](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/0ab46918dbfd7fc73609c90fc00e901f5e36469f))
|
|
42
|
+
##### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* **other:**
|
|
45
|
+
* wrong declaration of private method ([70ad7ceb](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/70ad7cebf87369f20cdc431fdce95cb14549cbfa))
|
|
46
|
+
|
|
47
|
+
* * *
|
|
48
|
+
* * *
|
|
1
49
|
## 4.15.14 (2021-10-29)
|
|
2
50
|
|
|
3
51
|
##### Bug Fixes
|
package/bin/eui-scripts.js
CHANGED
|
@@ -31,8 +31,6 @@ const scriptIndex = args.findIndex(
|
|
|
31
31
|
x === 'release-app' ||
|
|
32
32
|
x === 'generate-translations' ||
|
|
33
33
|
x === 'csdr-sync' ||
|
|
34
|
-
x === 'csdr-migrate-package' ||
|
|
35
|
-
x === 'csdr-jira-update' ||
|
|
36
34
|
x === 'csdr-cli' ||
|
|
37
35
|
x === 'csdr-stats' ||
|
|
38
36
|
x === 'generate-app-metadata' ||
|
|
@@ -65,11 +63,9 @@ switch (script) {
|
|
|
65
63
|
case 'csdr-init':
|
|
66
64
|
case 'csdr-upgrade-deps':
|
|
67
65
|
case 'csdr-serve-app':
|
|
68
|
-
case 'csdr-migrate-package':
|
|
69
66
|
case 'release-package':
|
|
70
67
|
case 'release-app':
|
|
71
68
|
case 'csdr-sync':
|
|
72
|
-
case 'csdr-jira-update':
|
|
73
69
|
case 'csdr-cli':
|
|
74
70
|
case 'csdr-stats':
|
|
75
71
|
case 'generate-app-metadata':
|
package/global.test.js
CHANGED
|
@@ -96,10 +96,6 @@ describe('eUI tools - test imports', () => {
|
|
|
96
96
|
const csdrInstallUtils = require('./scripts/csdr/install/install-utils');
|
|
97
97
|
const csdrInstallLocalDev = require('./scripts/csdr/install/local-dev');
|
|
98
98
|
|
|
99
|
-
// csdr - jira
|
|
100
|
-
// const csdrJiraUtils = require('./scripts/csdr/jira/jira-utils');
|
|
101
|
-
// const csdrJiraUpdate = require('./scripts/csdr/jira/update');
|
|
102
|
-
|
|
103
99
|
// csdr - metadata
|
|
104
100
|
const csdrMetadataAppEnvs = require('./scripts/csdr/metadata/app-envs');
|
|
105
101
|
const csdrMetadataAppHistory = require('./scripts/csdr/metadata/app-history');
|
|
@@ -117,6 +113,7 @@ describe('eUI tools - test imports', () => {
|
|
|
117
113
|
const csdrReleasePackageCommon = require('./scripts/csdr/release/package/common');
|
|
118
114
|
const csdrReleasePackageRemote = require('./scripts/csdr/release/package/remote');
|
|
119
115
|
const csdrReleasePackageUi = require('./scripts/csdr/release/package/ui');
|
|
116
|
+
const csdrReleasePackageBackend = require('./scripts/csdr/release/package/backend');
|
|
120
117
|
|
|
121
118
|
// csdr - template
|
|
122
119
|
const csdrTemplateUtils = require('./scripts/csdr/templates/template-utils');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eui/tools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.3",
|
|
4
4
|
"tag": "latest",
|
|
5
5
|
"license": "EUPL-1.1",
|
|
6
6
|
"description": "eUI common tools and scripts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"inquirer": "6.5.0",
|
|
14
14
|
"execa": "1.0.0",
|
|
15
|
-
"figlet": "1.
|
|
16
|
-
"chalk": "
|
|
15
|
+
"figlet": "1.5.2",
|
|
16
|
+
"chalk": "4.1.2",
|
|
17
17
|
"fs-extra": "9.0.0",
|
|
18
18
|
"replace-in-file": "4.1.3",
|
|
19
19
|
"semver": "6.0.0",
|
package/sandbox.js
CHANGED
|
@@ -596,8 +596,15 @@ const notificationUtils = require('./scripts/utils/notification/notification-uti
|
|
|
596
596
|
|
|
597
597
|
return Promise.resolve()
|
|
598
598
|
.then(() => {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
599
|
+
tools.logBigTitle('BIG TITLE');
|
|
600
|
+
tools.logTitle('TITLE');
|
|
601
|
+
tools.logInfo('test log info');
|
|
602
|
+
tools.logInfo('test log info');
|
|
603
|
+
tools.logInfo('test log info');
|
|
604
|
+
tools.logSuccess('test log success');
|
|
605
|
+
tools.logError('test log error');
|
|
606
|
+
tools.logWarning('test log warning');
|
|
607
|
+
tools.logAccent('test log accent');
|
|
608
|
+
tools.logBanner('this is the content of the banner');
|
|
602
609
|
})
|
|
603
610
|
|
|
@@ -6,6 +6,7 @@ const fs = require('fs');
|
|
|
6
6
|
|
|
7
7
|
// LOCAL
|
|
8
8
|
const tools = require('../../utils/tools');
|
|
9
|
+
const configUtils = require('./config-utils');
|
|
9
10
|
|
|
10
11
|
// INNER MODULES
|
|
11
12
|
const innerGlobal = require('./global');
|
|
@@ -233,3 +234,30 @@ module.exports.getDepGraph = () => {
|
|
|
233
234
|
|
|
234
235
|
return graph;
|
|
235
236
|
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
module.exports.getLocalPackagesEuiVersion = () => {
|
|
240
|
+
tools.logInfo('getting local installed eUI version...');
|
|
241
|
+
|
|
242
|
+
const pkgs = configUtils.packages.getPackages();
|
|
243
|
+
let versionsFound = [];
|
|
244
|
+
|
|
245
|
+
pkgs.forEach((p) => {
|
|
246
|
+
if (p.parent !== true && p.tsPackage !== false) {
|
|
247
|
+
|
|
248
|
+
let version = 'DEFAULT';
|
|
249
|
+
|
|
250
|
+
if (p.build) {
|
|
251
|
+
if (p.build.euiVersion) {
|
|
252
|
+
version = p.build.euiVersion;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
tools.logInfo(`checking ${p.name} - version found : ${version}`);
|
|
256
|
+
versionsFound.push(version);
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
versionsFound = tools.removeArrayDuplicates(versionsFound);
|
|
261
|
+
|
|
262
|
+
return versionsFound;
|
|
263
|
+
}
|
|
@@ -171,3 +171,42 @@ module.exports.importExtraTsConfig = () => {
|
|
|
171
171
|
throw e;
|
|
172
172
|
})
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
module.exports.processLocalEuiVersions = () => {
|
|
177
|
+
tools.logTitle('Processing injections for local installed eUI versions if needed');
|
|
178
|
+
|
|
179
|
+
return Promise.resolve()
|
|
180
|
+
.then(() => {
|
|
181
|
+
const euiVersionsLocal = configUtils.packages.getLocalPackagesEuiVersion();
|
|
182
|
+
|
|
183
|
+
if (euiVersionsLocal.length > 1) {
|
|
184
|
+
throw new Error('MULTIPLE_LOCAL_EUI_VERSIONS_FOUND');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const euiVersion = euiVersionsLocal[0];
|
|
188
|
+
|
|
189
|
+
if (!euiVersion || euiVersion === 'DEFAULT') {
|
|
190
|
+
tools.logInfo('Default eUI version found or empty, taking default resolutions..skipping');
|
|
191
|
+
|
|
192
|
+
} else {
|
|
193
|
+
tools.logInfo(`Processing resolutions replacement for eUI version found : ${euiVersion}`);
|
|
194
|
+
|
|
195
|
+
const rootPackageJsonFile = path.join(process.cwd(), 'package.json');
|
|
196
|
+
const rootPackageJson = require(rootPackageJsonFile);
|
|
197
|
+
|
|
198
|
+
const resolutionsJsonFile = path.join(__dirname, 'resources', euiVersion, 'resolutions.json');
|
|
199
|
+
const resolutionsJson = require(resolutionsJsonFile);
|
|
200
|
+
|
|
201
|
+
tools.logInfo('Injecting resolutions content');
|
|
202
|
+
console.log(resolutionsJson);
|
|
203
|
+
rootPackageJson.resolutions = resolutionsJson;
|
|
204
|
+
|
|
205
|
+
tools.logInfo('Updating root package.json');
|
|
206
|
+
tools.writeJsonFileSync(rootPackageJsonFile, rootPackageJson);
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
.catch((e) => {
|
|
210
|
+
throw e;
|
|
211
|
+
})
|
|
212
|
+
}
|
|
@@ -77,6 +77,12 @@ module.exports.init = () => {
|
|
|
77
77
|
return initUtils.importPackages(finalResponse);
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
+
// adapt and inject particular root data/config for eUI version detected on project
|
|
81
|
+
// if multiple versions of eUI are detected on the same project, an exception is thrown
|
|
82
|
+
.then(() => {
|
|
83
|
+
return initUtils.processLocalEuiVersions();
|
|
84
|
+
})
|
|
85
|
+
|
|
80
86
|
// Install deps based on current config generated => take last know snapshots
|
|
81
87
|
.then(() => {
|
|
82
88
|
// this is only executed for local dev installation,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lodash": ">=4.17.21",
|
|
3
|
+
"handlebars": ">=4.5.3",
|
|
4
|
+
"mem": ">=4.3.0 <=8.1.1",
|
|
5
|
+
"https-proxy-agent": ">=2.2.3",
|
|
6
|
+
"minimatch": ">=3.0.4",
|
|
7
|
+
"acorn-globals": ">=6.0.0",
|
|
8
|
+
"open": ">=7.0.3",
|
|
9
|
+
"dot-prop": ">=5.2.0",
|
|
10
|
+
"serialize-javascript": ">=3.1.0",
|
|
11
|
+
"socket.io": ">=2.4.0",
|
|
12
|
+
"ssri": ">=8.0.1",
|
|
13
|
+
"@types/node": ">=14.14.10",
|
|
14
|
+
"hosted-git-info": ">=3.0.8"
|
|
15
|
+
}
|
|
@@ -100,87 +100,3 @@ module.exports.install = (prj, pkg, isMaster) => {
|
|
|
100
100
|
throw e;
|
|
101
101
|
})
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
module.exports.checkDeps = (pkg) => {
|
|
110
|
-
tools.logTitle('Checking package internal dependencies');
|
|
111
|
-
|
|
112
|
-
return Promise.resolve()
|
|
113
|
-
.then(() => {
|
|
114
|
-
var depsFound = [];
|
|
115
|
-
var files = glob.sync('**/*.ts', { cwd: pkg.paths.pkgLibFolder, nodir: true, follow: true, dot: true });
|
|
116
|
-
files.forEach(file => {
|
|
117
|
-
const filePath = path.join(pkg.paths.pkgLibFolder, file);
|
|
118
|
-
const fileContent = tools.getFileContent(filePath);
|
|
119
|
-
var regex = /@cc\/|@mywp\/|@opsys\/|@sfc\//gi, result, indices = [];
|
|
120
|
-
while ( (result = regex.exec(fileContent)) ) {
|
|
121
|
-
indices.push(result.index);
|
|
122
|
-
}
|
|
123
|
-
if (indices.length !== 0) {
|
|
124
|
-
// tools.logInfo(`Number of occurences found : ${indices.length}`);
|
|
125
|
-
indices.forEach((i) => {
|
|
126
|
-
const endPos = fileContent.substr(i, 40).indexOf("'");
|
|
127
|
-
const dep = fileContent.substr(i, endPos);
|
|
128
|
-
if (endPos > -1) {
|
|
129
|
-
// tools.logInfo(`dep found on : ${dep}`);
|
|
130
|
-
depsFound.push(dep);
|
|
131
|
-
|
|
132
|
-
} else {
|
|
133
|
-
tools.logInfo(`Potential wrong import detected on file : ${file}`);
|
|
134
|
-
const subContent = fileContent.substr(i, 40);
|
|
135
|
-
const detectMultiSlashes = subContent.match(/\//g);
|
|
136
|
-
if (detectMultiSlashes.length > 0) {
|
|
137
|
-
tools.logError('Multislashes on import : ');
|
|
138
|
-
console.log(subContent);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
depsFound = tools.removeArrayDuplicates(depsFound);
|
|
145
|
-
tools.logWarning(`Dependencies found : ${depsFound.length}`);
|
|
146
|
-
console.log(depsFound);
|
|
147
|
-
|
|
148
|
-
return depsFound;
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
.then((depsFound) => {
|
|
152
|
-
var depsLevel;
|
|
153
|
-
|
|
154
|
-
switch(true) {
|
|
155
|
-
case (depsFound.length === 1):
|
|
156
|
-
depsLevel = 'LOW (1)';
|
|
157
|
-
break;
|
|
158
|
-
case (depsFound.length > 1 && depsFound.length <= 3):
|
|
159
|
-
depsLevel = 'MEDIUM (between 1 and 3)';
|
|
160
|
-
break;
|
|
161
|
-
case (depsFound.length > 3 && depsFound.length <= 5):
|
|
162
|
-
depsLevel = 'HIGH (between 3 and 5)';
|
|
163
|
-
break;
|
|
164
|
-
case (depsFound.length > 5):
|
|
165
|
-
depsLevel = 'VERY HIGH (>5)';
|
|
166
|
-
break;
|
|
167
|
-
default:
|
|
168
|
-
depsLevel = 'NONE';
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
var message = `Internal dependencies detected : ${depsFound.length} - deps level: ${depsLevel}\n`;
|
|
172
|
-
message += depsFound.join('\n');
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return notificationUtils.package.sendPackageMessage({
|
|
176
|
-
package: pkg,
|
|
177
|
-
text: message
|
|
178
|
-
});
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
.catch((e) => {
|
|
182
|
-
console.log(e);
|
|
183
|
-
})
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
@@ -217,22 +217,6 @@ const getLocalPackagesDeps = () => {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
|
|
220
|
-
// const getLocalPackageCompositeDeps = (pkg) => {
|
|
221
|
-
// let pkgJsonFile;
|
|
222
|
-
|
|
223
|
-
// if (pkg.parent) {
|
|
224
|
-
// return {};
|
|
225
|
-
// } else {
|
|
226
|
-
// if (pkg.child) {
|
|
227
|
-
// pkgJsonFile = path.join(process.cwd(), 'packages', pkg.parentPkg, 'packages', pkg.folder || pkg.name, 'dependencies-composite.json');
|
|
228
|
-
// } else {
|
|
229
|
-
// pkgJsonFile = path.join(process.cwd(), 'packages', pkg.name, 'dependencies-composite.json');
|
|
230
|
-
// }
|
|
231
|
-
// }
|
|
232
|
-
|
|
233
|
-
// return tools.getJsonFileContent(pkgJsonFile) || {};
|
|
234
|
-
// }
|
|
235
|
-
|
|
236
220
|
const getLocalPackageCompositeDeps = (pkg) => {
|
|
237
221
|
let pkgJsonFile;
|
|
238
222
|
|
|
@@ -98,7 +98,7 @@ const storeMetadataAssets = (project, newVersion, packagesDeps, historyMetadata,
|
|
|
98
98
|
|
|
99
99
|
const metadataFile = path.join(project.folder, 'src', 'assets', 'app-metadata.json');
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
tools.logInfo(`Creating ${metadataFile}`);
|
|
102
102
|
console.log(appMetadata);
|
|
103
103
|
|
|
104
104
|
if (!dryRun) {
|
|
@@ -112,7 +112,7 @@ const storeMetadataAssets = (project, newVersion, packagesDeps, historyMetadata,
|
|
|
112
112
|
|
|
113
113
|
const metadataFile = path.join(project.folder, 'src', 'assets', 'app-metadata-history.json');
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
tools.logInfo(`Creating ${metadataFile}`);
|
|
116
116
|
|
|
117
117
|
if (!dryRun && envTarget && envTarget !== 'DEV') {
|
|
118
118
|
return tools.writeJsonFileSync(metadataFile, historyMetadata);
|
|
@@ -160,7 +160,7 @@ const storeMetadataAssetsStandAlone = () => {
|
|
|
160
160
|
|
|
161
161
|
const metadataFile = path.join(prj.folder, 'src', 'assets', 'app-metadata.json');
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
tools.logInfo(`Creating ${metadataFile}`);
|
|
164
164
|
console.log(appMetadata);
|
|
165
165
|
|
|
166
166
|
if (!dryRun) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// GLOBAL
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// LOCAL
|
|
7
|
+
const installUtils = require('../../install/install-utils');
|
|
8
|
+
const configUtils = require('../../config/config-utils');
|
|
9
|
+
|
|
10
|
+
module.exports.install = (pkg, isMaster) => {
|
|
11
|
+
return Promise.resolve()
|
|
12
|
+
|
|
13
|
+
// FETCHING CURRENT PACKAGES & INSTALL
|
|
14
|
+
.then(() => {
|
|
15
|
+
// fetch related project if passed as arguments
|
|
16
|
+
const prj = configUtils.projects.getProject();
|
|
17
|
+
|
|
18
|
+
// install the dependencies for current package build
|
|
19
|
+
return installUtils.buildPackage.install(prj, pkg, isMaster);
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
.catch((e) => {
|
|
23
|
+
throw e;
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -381,7 +381,7 @@ module.exports.sendSuccessNotification = (pkg, version, pkgMetadata) => {
|
|
|
381
381
|
|
|
382
382
|
|
|
383
383
|
module.exports.sendErrorNotification = (pkg, exception, pkgMetadata) => {
|
|
384
|
-
console.log(pkgMetadata);
|
|
384
|
+
// console.log(pkgMetadata);
|
|
385
385
|
|
|
386
386
|
return Promise.resolve()
|
|
387
387
|
.then(() => {
|
|
@@ -14,6 +14,7 @@ const metadataUtils = require('../../metadata/metadata-utils');
|
|
|
14
14
|
const innerCommon = require('./common');
|
|
15
15
|
const innerUi = require('./ui');
|
|
16
16
|
const innerRemote = require('./remote');
|
|
17
|
+
const innerBackend = require('./backend');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
module.exports.run = () => {
|
|
@@ -80,6 +81,9 @@ module.exports.run = () => {
|
|
|
80
81
|
if (pkg.remote) {
|
|
81
82
|
return innerRemote.install(pkg, branches.isMaster);
|
|
82
83
|
|
|
84
|
+
} else if (pkg.backend) {
|
|
85
|
+
return innerBackend.install(pkg, branches.isMaster);
|
|
86
|
+
|
|
83
87
|
} else {
|
|
84
88
|
return innerUi.install(pkg, branches.isMaster);
|
|
85
89
|
}
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
// GLOBAL
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const glob = require('glob');
|
|
5
6
|
|
|
6
7
|
// LOCAL
|
|
7
8
|
const installUtils = require('../../install/install-utils');
|
|
8
9
|
const configUtils = require('../../config/config-utils');
|
|
9
10
|
const auditUtils = require('../../audit/audit-utils');
|
|
11
|
+
const notificationUtils = require('../../../utils/notification/notification-utils');
|
|
12
|
+
const tools = require('../../../utils/tools');
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
module.exports.install = (pkg, isMaster) => {
|
|
@@ -24,7 +27,7 @@ module.exports.install = (pkg, isMaster) => {
|
|
|
24
27
|
|
|
25
28
|
// CHECK INTERNAL DEPENDENCIES
|
|
26
29
|
.then(() => {
|
|
27
|
-
return
|
|
30
|
+
return checkDeps(pkg);
|
|
28
31
|
})
|
|
29
32
|
|
|
30
33
|
|
|
@@ -38,3 +41,83 @@ module.exports.install = (pkg, isMaster) => {
|
|
|
38
41
|
throw e;
|
|
39
42
|
})
|
|
40
43
|
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
const checkDeps = (pkg) => {
|
|
47
|
+
tools.logTitle('Checking package internal dependencies');
|
|
48
|
+
|
|
49
|
+
return Promise.resolve()
|
|
50
|
+
.then(() => {
|
|
51
|
+
var depsFound = [];
|
|
52
|
+
var files = glob.sync('**/*.ts', { cwd: pkg.paths.pkgLibFolder, nodir: true, follow: true, dot: true });
|
|
53
|
+
files.forEach(file => {
|
|
54
|
+
const filePath = path.join(pkg.paths.pkgLibFolder, file);
|
|
55
|
+
const fileContent = tools.getFileContent(filePath);
|
|
56
|
+
var regex = /@cc\/|@mywp\/|@opsys\/|@sfc\//gi, result, indices = [];
|
|
57
|
+
while ( (result = regex.exec(fileContent)) ) {
|
|
58
|
+
indices.push(result.index);
|
|
59
|
+
}
|
|
60
|
+
if (indices.length !== 0) {
|
|
61
|
+
// tools.logInfo(`Number of occurences found : ${indices.length}`);
|
|
62
|
+
indices.forEach((i) => {
|
|
63
|
+
const endPos = fileContent.substr(i, 40).indexOf("'");
|
|
64
|
+
const dep = fileContent.substr(i, endPos);
|
|
65
|
+
if (endPos > -1) {
|
|
66
|
+
// tools.logInfo(`dep found on : ${dep}`);
|
|
67
|
+
depsFound.push(dep);
|
|
68
|
+
|
|
69
|
+
} else {
|
|
70
|
+
tools.logInfo(`Potential wrong import detected on file : ${file}`);
|
|
71
|
+
const subContent = fileContent.substr(i, 40);
|
|
72
|
+
const detectMultiSlashes = subContent.match(/\//g);
|
|
73
|
+
if (detectMultiSlashes.length > 0) {
|
|
74
|
+
tools.logError('Multislashes on import : ');
|
|
75
|
+
console.log(subContent);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
depsFound = tools.removeArrayDuplicates(depsFound);
|
|
82
|
+
tools.logWarning(`Dependencies found : ${depsFound.length}`);
|
|
83
|
+
console.log(depsFound);
|
|
84
|
+
|
|
85
|
+
return depsFound;
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
.then((depsFound) => {
|
|
89
|
+
var depsLevel;
|
|
90
|
+
|
|
91
|
+
switch(true) {
|
|
92
|
+
case (depsFound.length === 1):
|
|
93
|
+
depsLevel = 'LOW (1)';
|
|
94
|
+
break;
|
|
95
|
+
case (depsFound.length > 1 && depsFound.length <= 3):
|
|
96
|
+
depsLevel = 'MEDIUM (between 1 and 3)';
|
|
97
|
+
break;
|
|
98
|
+
case (depsFound.length > 3 && depsFound.length <= 5):
|
|
99
|
+
depsLevel = 'HIGH (between 3 and 5)';
|
|
100
|
+
break;
|
|
101
|
+
case (depsFound.length > 5):
|
|
102
|
+
depsLevel = 'VERY HIGH (>5)';
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
depsLevel = 'NONE';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var message = `Internal dependencies detected : ${depsFound.length} - deps level: ${depsLevel}\n`;
|
|
109
|
+
message += depsFound.join('\n');
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
return notificationUtils.package.sendPackageMessage({
|
|
113
|
+
package: pkg,
|
|
114
|
+
text: message
|
|
115
|
+
});
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
.catch((e) => {
|
|
119
|
+
console.log(e);
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
@@ -16,10 +16,10 @@ module.exports.sync = () => {
|
|
|
16
16
|
tools.logInfo('Resetting package.json');
|
|
17
17
|
return tools.copy(path.join(process.cwd(), '.csdr', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
|
|
18
18
|
})
|
|
19
|
-
.then(() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
19
|
+
// .then(() => {
|
|
20
|
+
// tools.logInfo('Removing yarn.lock');
|
|
21
|
+
// return tools.remove(path.join(process.cwd(), 'yarn.lock'));
|
|
22
|
+
// })
|
|
23
23
|
.then(() => {
|
|
24
24
|
tools.logSuccess();
|
|
25
25
|
})
|
|
@@ -53,6 +53,9 @@ module.exports.sync = () => {
|
|
|
53
53
|
.then(() => {
|
|
54
54
|
return initUtils.meta.init();
|
|
55
55
|
})
|
|
56
|
+
.then(() => {
|
|
57
|
+
return initUtils.processLocalEuiVersions();
|
|
58
|
+
})
|
|
56
59
|
.catch((e) => {
|
|
57
60
|
throw e;
|
|
58
61
|
})
|
|
@@ -37,8 +37,9 @@ const getCurrentVersion = (pkg) => {
|
|
|
37
37
|
// by default maven java backend is taken into account
|
|
38
38
|
} else {
|
|
39
39
|
tools.logInfo('Backend => extracting pom.xml');
|
|
40
|
-
|
|
41
40
|
const xmlContent = tools.getXMLJsContent(path.join(pkg.paths.pkgDirectory, 'pom.xml'));
|
|
41
|
+
|
|
42
|
+
tools.logInfo('Content found:');
|
|
42
43
|
console.log(xmlContent);
|
|
43
44
|
|
|
44
45
|
currentVersion = xmlContent.project.version.toString();
|
|
@@ -120,7 +120,7 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
|
|
|
120
120
|
|
|
121
121
|
tools.logInfo(`ng test : watching = ${watch || false}`);
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
tools.logInfo(`running Angular TEST with args: ${args} on :`);
|
|
124
124
|
console.log(currentProject.paths.angularPath);
|
|
125
125
|
|
|
126
126
|
if (!dryRun) {
|
|
@@ -204,7 +204,7 @@ module.exports.angular = (envTarget, isSnapshot, version) => {
|
|
|
204
204
|
|
|
205
205
|
tools.logInfo(`ng build for configuration : ${configuration || 'production'}`);
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
tools.logInfo(`running Angular BUILD with args: ${args} on :`);
|
|
208
208
|
console.log(currentProject.paths.angularPath);
|
|
209
209
|
|
|
210
210
|
if (!dryRun && !skipCompile) {
|
|
@@ -91,7 +91,7 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
91
91
|
|
|
92
92
|
tools.logInfo(`ng test : watching = ${watch || false}`);
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
tools.logInfo(`running Angular TEST with args: ${args} on`);
|
|
95
95
|
console.log(pkg.paths.pkgRootDirectory);
|
|
96
96
|
|
|
97
97
|
if (!dryRun) {
|
|
@@ -140,7 +140,7 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
140
140
|
|
|
141
141
|
tools.logInfo(`ng build for configuration : ${configuration || 'production'}`);
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
tools.logInfo(`running Angular BUILD with args: ${args} on`);
|
|
144
144
|
console.log(pkg.paths.pkgRootDirectory);
|
|
145
145
|
|
|
146
146
|
if (!dryRun) {
|
|
@@ -64,6 +64,11 @@ module.exports.getMessage = (options) => {
|
|
|
64
64
|
message.detailText = 'Another build has been detected for the current package being build\n Retry again this build after 30m, lock will be auto-cleared';
|
|
65
65
|
break;
|
|
66
66
|
|
|
67
|
+
case 'MULTIPLE_LOCAL_EUI_VERSIONS_FOUND':
|
|
68
|
+
message.detailTitle = 'MULTIPLE eUI VERSIONS FOUND IN LOCAL PROJECT - ABORTING!';
|
|
69
|
+
message.detailText = 'Uncompatible version of eUI found installed in the local CSDR project, please adjust and keep same compatible versions of eUI packages and projects';
|
|
70
|
+
break;
|
|
71
|
+
|
|
67
72
|
default:
|
|
68
73
|
message.detailTitle = 'GENERAL ERROR!';
|
|
69
74
|
message.detailText = options.exception;
|
|
@@ -10,6 +10,9 @@ let { dryRun, debug} = tools.getArgs();
|
|
|
10
10
|
|
|
11
11
|
const sendCore = (subject, body, recipient) => {
|
|
12
12
|
tools.logInfo(`Sending mail to : ${recipient}`);
|
|
13
|
+
tools.logInfo('Message subject / body :');
|
|
14
|
+
console.log(subject);
|
|
15
|
+
console.log(body);
|
|
13
16
|
|
|
14
17
|
if (dryRun) {
|
|
15
18
|
console.log('----------------------------------------------');
|