@eui/tools 6.9.3 → 6.9.4
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 +10 -0
- package/package.json +1 -1
- package/scripts/csdr/audit/yarn.js +0 -2
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/dependencies-composite.json +2 -1
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/components/main.component.html +1 -16
- package/scripts/csdr/cli/skeletons/package/frontend/15.x/default/src/lib/module.ts +6 -5
- package/scripts/csdr/config/packages.js +9 -0
- package/scripts/csdr/metadata/package.js +6 -1
- package/scripts/csdr/release/package/build-pr-scan.js +1 -1
- package/scripts/csdr/release/package/release-package.js +1 -1
- package/scripts/csdr/release/package/release-ui.js +30 -6
- package/scripts/csdr/release/package/ui.js +0 -38
- package/scripts/utils/build/package/angular.js +27 -4
- package/scripts/utils/git-utils.js +7 -1
- package/scripts/utils/notification/common.js +12 -3
- package/scripts/utils/notification/package.js +2 -2
- package/scripts/utils/notification/project.js +2 -2
- package/scripts/utils/notification/slack-utils.js +4 -4
- package/scripts/utils/notification/teams-utils.js +62 -22
- package/scripts/utils/tools.js +9 -0
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.9.
|
|
1
|
+
6.9.4
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 6.9.4 (2023-03-16)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* adapted default frontend package skeleton sources - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([19ca8394](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/19ca839438396da824803dd7538fbedd71279784))
|
|
7
|
+
* adapted ms-teams notifications payload and format - EUI-7146 [EUI-7146](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7146) ([c99a6094](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/c99a6094414366a4ef098c9841780618d2956331))
|
|
8
|
+
|
|
9
|
+
* * *
|
|
10
|
+
* * *
|
|
1
11
|
## 6.9.3 (2023-03-15)
|
|
2
12
|
|
|
3
13
|
##### Bug Fixes
|
package/package.json
CHANGED
|
@@ -26,22 +26,7 @@
|
|
|
26
26
|
</eui-page-column-body>
|
|
27
27
|
</eui-page-column>
|
|
28
28
|
|
|
29
|
-
<eui-page-column>
|
|
30
|
-
|
|
31
|
-
<eui-page-column-header-left-content>
|
|
32
|
-
<div class="eui-page-column__header-left-content-label">{{ '@module.scope-name@.SEARCH_RESULT' | translate }}</div>
|
|
33
|
-
</eui-page-column-header-left-content>
|
|
34
|
-
|
|
35
|
-
<eui-page-column-header-right-content>
|
|
36
|
-
<div class="eui-u-flex">
|
|
37
|
-
<button
|
|
38
|
-
euiButton
|
|
39
|
-
euiSecondary>
|
|
40
|
-
<span euiIcon iconClass="eui-icon-refresh"></span>
|
|
41
|
-
<span euiLabel>{{ '@module.scope-name@.CREATE_DOSSIER' | translate }}</span>
|
|
42
|
-
</button>
|
|
43
|
-
</div>
|
|
44
|
-
</eui-page-column-header-right-content>
|
|
29
|
+
<eui-page-column label="{{ '@module.scope-name@.SEARCH_RESULT' | translate }}">
|
|
45
30
|
|
|
46
31
|
<eui-page-column-header-body>
|
|
47
32
|
</eui-page-column-header-body>
|
|
@@ -8,7 +8,11 @@ import { TranslateModule } from '@ngx-translate/core';
|
|
|
8
8
|
import { EuiButtonModule } from '@eui/components/eui-button';
|
|
9
9
|
import { EuiPageModule } from '@eui/components/eui-page';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// -- eUI module imports specific (recommended for treeshakability)
|
|
12
|
+
const EUI_MODULES = [
|
|
13
|
+
EuiButtonModule,
|
|
14
|
+
EuiPageModule,
|
|
15
|
+
];
|
|
12
16
|
|
|
13
17
|
// -- Components --
|
|
14
18
|
import { @module.class.name@Component } from './components/main.component';
|
|
@@ -48,10 +52,7 @@ import { RoutingModule } from './routing-module';
|
|
|
48
52
|
// EffectsModule.forFeature(EFFECTS),
|
|
49
53
|
TranslateModule,
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
EuiPageModule,
|
|
53
|
-
|
|
54
|
-
CcSharedModule,
|
|
55
|
+
...EUI_MODULES,
|
|
55
56
|
],
|
|
56
57
|
declarations: [
|
|
57
58
|
...COMPONENTS,
|
|
@@ -133,6 +133,15 @@ module.exports.getPackage = (pkgName, fromCsdrConfig, optional) => {
|
|
|
133
133
|
pkg.npmPkgName = pkg.npmPkg.substr(pkg.npmPkg.indexOf('/') + 1);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
// check notification method
|
|
137
|
+
if (pkg.notification) {
|
|
138
|
+
if (pkg.notification.client === 'MSTEAMS') {
|
|
139
|
+
pkg.msteamsActive = true;
|
|
140
|
+
} else {
|
|
141
|
+
pkg.msteamsActive = false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
136
145
|
return pkg;
|
|
137
146
|
}
|
|
138
147
|
|
|
@@ -83,7 +83,12 @@ const storeBuildMetadata = (pkg, pkgVersion, pkgMetadata, envTarget) => {
|
|
|
83
83
|
generatedMetadata.versions = versions;
|
|
84
84
|
|
|
85
85
|
tools.logInfo(`Write metadata on ${pkgMetadataFile}`);
|
|
86
|
-
|
|
86
|
+
if (dryRun) {
|
|
87
|
+
tools.logInfo('DRY-RUN...');
|
|
88
|
+
console.log(generatedMetadata);
|
|
89
|
+
} else {
|
|
90
|
+
tools.writeJsonFileSync(pkgMetadataFile, generatedMetadata);
|
|
91
|
+
}
|
|
87
92
|
})
|
|
88
93
|
|
|
89
94
|
.catch((e) => {
|
|
@@ -15,7 +15,7 @@ module.exports.run = () => {
|
|
|
15
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
|
-
// npm run pkg:release eui-tools -- --dryRun --branch develop --
|
|
18
|
+
// npm run pkg:release eui-tools -- --dryRun --branch develop --skipLint --skipInstall --skipTest --skipDoc --skipClone --debug --build
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
return Promise.resolve()
|
|
@@ -9,6 +9,7 @@ const utils = require('../../../utils');
|
|
|
9
9
|
// CSDR RELATED
|
|
10
10
|
const configUtils = require('../../config/config-utils');
|
|
11
11
|
const metadataUtils = require('../../metadata/metadata-utils');
|
|
12
|
+
const auditUtils = require('../../audit/audit-utils');
|
|
12
13
|
|
|
13
14
|
// INNER MODULES
|
|
14
15
|
const innerCommon = require('./common');
|
|
@@ -85,16 +86,39 @@ module.exports.run = () => {
|
|
|
85
86
|
// INSTALL dependencies by type
|
|
86
87
|
.then(() => {
|
|
87
88
|
if (pkg.remote) {
|
|
88
|
-
return
|
|
89
|
+
return Promise.resolve()
|
|
90
|
+
.then(() => {
|
|
91
|
+
return innerRemote.install(pkg, envTarget, compositeType);
|
|
92
|
+
})
|
|
93
|
+
.then((compositeDeps) => {
|
|
94
|
+
// storing for later use
|
|
95
|
+
pkgCompositeDeps = compositeDeps;
|
|
96
|
+
})
|
|
97
|
+
.catch((e) => {
|
|
98
|
+
throw e;
|
|
99
|
+
})
|
|
89
100
|
|
|
90
101
|
} else {
|
|
91
|
-
return
|
|
102
|
+
return Promise.resolve()
|
|
103
|
+
.then(() => {
|
|
104
|
+
return innerUi.install(pkg, branches.isMaster);
|
|
105
|
+
})
|
|
106
|
+
// CHECK STYLES USAGE
|
|
107
|
+
.then(() => {
|
|
108
|
+
if (!pkg.build || (pkg.build && !pkg.build.skipAudit)) {
|
|
109
|
+
return auditUtils.styles.audit(pkg);
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
// AUDIT DEPENDENCIES
|
|
114
|
+
.then(() => {
|
|
115
|
+
return auditUtils.yarn.audit(pkg);
|
|
116
|
+
})
|
|
117
|
+
.catch((e) => {
|
|
118
|
+
throw e;
|
|
119
|
+
})
|
|
92
120
|
}
|
|
93
121
|
})
|
|
94
|
-
.then((compositeDeps) => {
|
|
95
|
-
// storing for later use
|
|
96
|
-
pkgCompositeDeps = compositeDeps;
|
|
97
|
-
})
|
|
98
122
|
|
|
99
123
|
|
|
100
124
|
// BUILD PACKAGE
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// GLOBAL
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const glob = require('glob');
|
|
6
|
-
|
|
7
3
|
// LOCAL
|
|
8
4
|
const installUtils = require('../../install/install-utils');
|
|
9
5
|
const configUtils = require('../../config/config-utils');
|
|
10
|
-
const auditUtils = require('../../audit/audit-utils');
|
|
11
6
|
const tools = require('../../../utils/tools');
|
|
12
7
|
|
|
13
8
|
// ARGS
|
|
@@ -32,39 +27,6 @@ module.exports.install = (pkg, isMaster) => {
|
|
|
32
27
|
return installUtils.buildPackage.installPackage(prj, pkg, isMaster);
|
|
33
28
|
})
|
|
34
29
|
|
|
35
|
-
// CHECK STYLES USAGE
|
|
36
|
-
.then(() => {
|
|
37
|
-
if (!pkg.build || (pkg.build && !pkg.build.skipAudit)) {
|
|
38
|
-
return auditUtils.styles.audit(pkg);
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
// AUDIT DEPENDENCIES
|
|
43
|
-
.then(() => {
|
|
44
|
-
return auditUtils.yarn.audit(pkg);
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.catch((e) => {
|
|
49
|
-
throw e;
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
module.exports.installOnly = (pkg) => {
|
|
55
|
-
tools.logBanner('INSTALL');
|
|
56
|
-
|
|
57
|
-
return Promise.resolve()
|
|
58
|
-
|
|
59
|
-
// FETCHING CURRENT PACKAGES & INSTALL
|
|
60
|
-
.then(() => {
|
|
61
|
-
// fetch related project if passed as arguments
|
|
62
|
-
const prj = configUtils.projects.getProject();
|
|
63
|
-
|
|
64
|
-
// install the dependencies for current package build
|
|
65
|
-
return installUtils.buildPackage.installPackage(prj, pkg, false);
|
|
66
|
-
})
|
|
67
|
-
|
|
68
30
|
.catch((e) => {
|
|
69
31
|
throw e;
|
|
70
32
|
})
|
|
@@ -16,7 +16,7 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
16
16
|
const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
|
|
17
17
|
|
|
18
18
|
// FETCH ARGS
|
|
19
|
-
let { deps, skipClean, skipLint, skipTest, skipCompile, skipDoc } = pkg.build? {...pkg.build, ...tools.getArgs()} : tools.getArgs();
|
|
19
|
+
let { deps, skipClean, skipLint, skipTest, skipCompile, skipDoc, build } = pkg.build? {...pkg.build, ...tools.getArgs()} : tools.getArgs();
|
|
20
20
|
|
|
21
21
|
return Promise.resolve()
|
|
22
22
|
.then(() => {
|
|
@@ -34,6 +34,7 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
34
34
|
.then(() => {
|
|
35
35
|
if (!skipLint) {
|
|
36
36
|
tools.logInfo('Linting...');
|
|
37
|
+
|
|
37
38
|
const tsLintPath = path.join(pkg.paths.root, 'tslint.json');
|
|
38
39
|
const esLintPath = path.join(pkg.paths.root, '.eslintrc.json');
|
|
39
40
|
|
|
@@ -43,10 +44,19 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
43
44
|
const script = `tslint -c ${tsLintPath} -p ${pkg.paths.tsConfig} -t verbose`
|
|
44
45
|
tools.logInfo(`running ${script}`);
|
|
45
46
|
return tools.runScript(script);
|
|
47
|
+
|
|
46
48
|
} else if(tools.isFileExists(esLintPath)) {
|
|
47
49
|
// the project path information are located inside the .eslintrc.json
|
|
48
50
|
tools.logInfo(`running ng lint ${pkg.name}`);
|
|
49
|
-
|
|
51
|
+
|
|
52
|
+
if (build && pkg.msteamsActive) {
|
|
53
|
+
let args = ['--max_old_space_size=8096', ng, 'lint', pkg.name];
|
|
54
|
+
return tools.runNodeScriptProcessOutput(args, pkg.paths.root);
|
|
55
|
+
|
|
56
|
+
} else {
|
|
57
|
+
return tools.runScript(`ng lint ${pkg.name}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
50
60
|
} else {
|
|
51
61
|
tools.logError(`No ESLint or TSLint configuration found for the project`);
|
|
52
62
|
}
|
|
@@ -59,10 +69,17 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
59
69
|
|
|
60
70
|
if (!skipTest) {
|
|
61
71
|
tools.logInfo('Testing...');
|
|
72
|
+
|
|
62
73
|
let args = ['--max_old_space_size=8096', ng, 'test', pkg.name];
|
|
63
74
|
args.push('--code-coverage');
|
|
64
75
|
tools.logInfo(`running ng test : with args: ${args} on folder : ${pkg.paths.root}`);
|
|
65
|
-
|
|
76
|
+
|
|
77
|
+
if (build && pkg.msteamsActive) {
|
|
78
|
+
return tools.runNodeScriptProcessOutput(args, pkg.paths.root);
|
|
79
|
+
|
|
80
|
+
} else {
|
|
81
|
+
return execa('node', args, { cwd: pkg.paths.root, stdio: 'inherit' });
|
|
82
|
+
}
|
|
66
83
|
}
|
|
67
84
|
})
|
|
68
85
|
.then(() => {
|
|
@@ -74,7 +91,13 @@ module.exports.build = (pkg, isMaster) => {
|
|
|
74
91
|
let args = ['--max_old_space_size=8096', ng, 'build', pkg.name];
|
|
75
92
|
|
|
76
93
|
tools.logInfo(`running ng build : with args: ${args} on folder : ${pkg.paths.root}`);
|
|
77
|
-
|
|
94
|
+
|
|
95
|
+
if (build && pkg.msteamsActive) {
|
|
96
|
+
return tools.runNodeScriptProcessOutput(args, pkg.paths.root);
|
|
97
|
+
|
|
98
|
+
} else {
|
|
99
|
+
return execa('node', args, { cwd: pkg.paths.root, stdio: 'inherit' });
|
|
100
|
+
}
|
|
78
101
|
}
|
|
79
102
|
})
|
|
80
103
|
.then(() => {
|
|
@@ -11,7 +11,7 @@ const { getPackageConfig } = require('./notification/config');
|
|
|
11
11
|
// const versionUtils = require('./version-utils');
|
|
12
12
|
|
|
13
13
|
// FETCH ARGS
|
|
14
|
-
const { dryRun, git, debug } = tools.getArgs();
|
|
14
|
+
const { dryRun, git, debug, build } = tools.getArgs();
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
const getLastTag = (folder) => {
|
|
@@ -298,6 +298,9 @@ const cloneRepo = (repoUri, folder, forced = false, shallow = false, externalRep
|
|
|
298
298
|
tools.logSuccess();
|
|
299
299
|
})
|
|
300
300
|
.catch((e) => {
|
|
301
|
+
if (!build) {
|
|
302
|
+
console.log(e);
|
|
303
|
+
}
|
|
301
304
|
throw new Error(`Error trying to clone ${repoUri} into ${folder}`);
|
|
302
305
|
})
|
|
303
306
|
}
|
|
@@ -334,6 +337,9 @@ const checkout = (branch, folder, shallow = false) => {
|
|
|
334
337
|
});
|
|
335
338
|
})
|
|
336
339
|
.catch((e) => {
|
|
340
|
+
if (!build) {
|
|
341
|
+
console.log(e);
|
|
342
|
+
}
|
|
337
343
|
throw new Error(`Error trying to checkout ${branch} on ${folder}`);
|
|
338
344
|
})
|
|
339
345
|
}
|
|
@@ -89,9 +89,18 @@ module.exports.getMessage = (options) => {
|
|
|
89
89
|
|
|
90
90
|
default:
|
|
91
91
|
message.detailTitle = 'GENERAL ERROR!';
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
if (options.exception.stderr) {
|
|
93
|
+
try {
|
|
94
|
+
message.detailTextArray = options.exception.stderr.split('\n');
|
|
95
|
+
if (options.exception.stdout) {
|
|
96
|
+
message.detailTextArray = [...message.detailTextArray, ...options.exception.stdout.split('\n')];
|
|
97
|
+
}
|
|
98
|
+
} catch (e) {}
|
|
99
|
+
} else {
|
|
100
|
+
try {
|
|
101
|
+
message.detailTextArray = options.exception.stack.split('\n');
|
|
102
|
+
} catch (e) {};
|
|
103
|
+
}
|
|
95
104
|
};
|
|
96
105
|
|
|
97
106
|
message.detailText = message.detailTextArray.join('\n');
|
|
@@ -12,7 +12,7 @@ const innerConfig = require('./config');
|
|
|
12
12
|
const innerMessageStack = require('./message-stack');
|
|
13
13
|
|
|
14
14
|
// ARGS
|
|
15
|
-
const { debug } = tools.getArgs();
|
|
15
|
+
const { debug, debugNotification} = tools.getArgs();
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
module.exports.sendPackageMessage = (options) => {
|
|
@@ -20,7 +20,7 @@ module.exports.sendPackageMessage = (options) => {
|
|
|
20
20
|
|
|
21
21
|
const message = innerCommon.getMessage(options);
|
|
22
22
|
|
|
23
|
-
if (debug) {
|
|
23
|
+
if (debug && debugNotification) {
|
|
24
24
|
tools.logInfo('Message content :');
|
|
25
25
|
console.log(message);
|
|
26
26
|
}
|
|
@@ -12,7 +12,7 @@ const innerConfig = require('./config');
|
|
|
12
12
|
const innerMessageStack = require('./message-stack');
|
|
13
13
|
|
|
14
14
|
// ARGS
|
|
15
|
-
const { debug } = tools.getArgs();
|
|
15
|
+
const { debug, debugNotification } = tools.getArgs();
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
module.exports.sendProjectMessage = (options) => {
|
|
@@ -21,7 +21,7 @@ module.exports.sendProjectMessage = (options) => {
|
|
|
21
21
|
|
|
22
22
|
const message = innerCommon.getMessage(options);
|
|
23
23
|
|
|
24
|
-
if (debug) {
|
|
24
|
+
if (debug && debugNotification) {
|
|
25
25
|
tools.logInfo('Message content :');
|
|
26
26
|
console.log(message);
|
|
27
27
|
}
|
|
@@ -9,7 +9,7 @@ const HttpsProxyAgent = require('https-proxy-agent');
|
|
|
9
9
|
const tools = require('../tools');
|
|
10
10
|
|
|
11
11
|
// FETCH COMMAND-LINE ARGS
|
|
12
|
-
let { dryRun, slackFeedback, debug } = tools.getArgs();
|
|
12
|
+
let { dryRun, slackFeedback, debug, debugNotification } = tools.getArgs();
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
const PROXY = process.env.http_proxy;
|
|
@@ -46,7 +46,7 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
|
|
|
46
46
|
if (dryRun || !slackFeedback) {
|
|
47
47
|
tools.logInfo('No notifications config found...skipping');
|
|
48
48
|
|
|
49
|
-
if (debug) {
|
|
49
|
+
if (debug && debugNotification) {
|
|
50
50
|
console.log(JSON.stringify(payload, null, 4));
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -57,7 +57,7 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
|
|
|
57
57
|
tools.logInfo(`Slack hook: ${hook}`);
|
|
58
58
|
tools.logInfo(`Slack channel: ${channel}`);
|
|
59
59
|
|
|
60
|
-
if (debug) {
|
|
60
|
+
if (debug && debugNotification) {
|
|
61
61
|
console.log(JSON.stringify(payload, null, 4));
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -71,7 +71,7 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
|
|
|
71
71
|
tools.logInfo('statusCode: ' + res.statusCode);
|
|
72
72
|
tools.logInfo('statusMessage: ' + res.statusMessage);
|
|
73
73
|
|
|
74
|
-
if (debug) {
|
|
74
|
+
if (debug && debugNotification) {
|
|
75
75
|
console.log(util.inspect(res));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -6,7 +6,7 @@ const apiUtils = require('../api-utils');
|
|
|
6
6
|
const configUtils = require('../../csdr/config/config-utils');
|
|
7
7
|
|
|
8
8
|
// ARGS
|
|
9
|
-
const { dryRun, debug} = tools.getArgs();
|
|
9
|
+
const { dryRun, debug, debugNotification } = tools.getArgs();
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
const getChannelHook = module.exports.getChannelHook = (channelName) => {
|
|
@@ -31,8 +31,9 @@ const getChannelHook = module.exports.getChannelHook = (channelName) => {
|
|
|
31
31
|
const createPayload = (messageContent) => {
|
|
32
32
|
const emojis = {
|
|
33
33
|
rocket: "🚀",
|
|
34
|
+
warning: "⚠",
|
|
34
35
|
sucess: "✅",
|
|
35
|
-
failure: "❌"
|
|
36
|
+
failure: "❌",
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
const statuses = {
|
|
@@ -70,37 +71,76 @@ const createPayload = (messageContent) => {
|
|
|
70
71
|
|
|
71
72
|
// set release sections
|
|
72
73
|
const publications = messageContent.buffer.filter(m => m.text !== null && m.text.indexOf(':rocket:') > -1);
|
|
74
|
+
const stylesReport = messageContent.buffer.filter(m => m.text !== null && m.text.indexOf('STYLES AUDIT REPORT') > -1)[0];
|
|
75
|
+
const dependenciesReport = messageContent.buffer.filter(m => m.text !== null && m.text.indexOf('Dependencies audit') > -1)[0];
|
|
73
76
|
|
|
74
|
-
let sections =
|
|
75
|
-
return {
|
|
76
|
-
"activityTitle": version,
|
|
77
|
-
"facts": [],
|
|
78
|
-
"activityText": p.text.replace(':rocket:', emojis.rocket).replace('- *VERSION*', '')
|
|
79
|
-
}
|
|
80
|
-
});
|
|
77
|
+
let sections = [];
|
|
81
78
|
|
|
82
|
-
if (
|
|
79
|
+
if (status === statuses.success) {
|
|
83
80
|
sections.push({
|
|
84
81
|
"startGroup": true,
|
|
85
|
-
"activityTitle":
|
|
82
|
+
"activityTitle": `${emojis.sucess} PACKAGE BUILD SUCCESS !! ${emojis.sucess}`
|
|
86
83
|
});
|
|
87
|
-
|
|
84
|
+
|
|
85
|
+
publications.forEach((p) => {
|
|
88
86
|
sections.push({
|
|
89
|
-
"
|
|
87
|
+
"activityTitle": `package published : ${version}`,
|
|
88
|
+
"facts": [],
|
|
89
|
+
"activityText": p.text.replace(':rocket:', emojis.rocket).replace('- *VERSION*', '')
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
|
-
}
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
if (dependenciesReport && dependenciesReport.text) {
|
|
94
|
+
sections.push({
|
|
95
|
+
"startGroup": true,
|
|
96
|
+
"activityTitle": "Dependencies vulnerabilities audit",
|
|
97
|
+
"activityText": dependenciesReport.text.replace('"Dependencies audit detected vulnerabilities :', ''),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (stylesReport && stylesReport.text) {
|
|
102
|
+
let stylesReportCleanup;
|
|
103
|
+
stylesReportCleanup = tools.replaceAll(stylesReport.text, ':no_entry:', `${emojis.failure} - INVALID : `);
|
|
104
|
+
stylesReportCleanup = tools.replaceAll(stylesReportCleanup, ':large_green_circle:', `${emojis.sucess} - OK : `);
|
|
105
|
+
stylesReportCleanup = tools.replaceAll(stylesReportCleanup, ':warning:', `${emojis.warning} - WARNING : `);
|
|
106
|
+
stylesReportCleanup = tools.replaceAll(stylesReportCleanup, '\n', '\n\n');
|
|
107
|
+
|
|
100
108
|
sections.push({
|
|
101
|
-
"
|
|
109
|
+
"startGroup": true,
|
|
110
|
+
"activityTitle": "Styles report",
|
|
111
|
+
"activityText": stylesReportCleanup
|
|
102
112
|
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (commitHistory.length > 0) {
|
|
116
|
+
sections.push({
|
|
117
|
+
"activityTitle": "Commit history since last release tag",
|
|
118
|
+
"activityText": commitHistory.slice(0, 25).join(' --- ').substr(0, 7500)
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
} else {
|
|
125
|
+
sections.push({
|
|
126
|
+
"startGroup": true,
|
|
127
|
+
"activityTitle": `${emojis.failure} PACKAGE BUILD ERROR !! ${emojis.failure}`,
|
|
103
128
|
});
|
|
129
|
+
|
|
130
|
+
if (exceptionDetails.length > 0) {
|
|
131
|
+
if (finalMessage.detailText) {
|
|
132
|
+
let exceptionCleanup;
|
|
133
|
+
exceptionCleanup = tools.replaceAll(finalMessage.detailText.substr(0, 7500), '\r', '');
|
|
134
|
+
exceptionCleanup = tools.replaceAll(exceptionCleanup, '\n', ' ---- ');
|
|
135
|
+
exceptionCleanup = tools.replaceAll(exceptionCleanup, '~', '');
|
|
136
|
+
exceptionCleanup = tools.replaceAll(exceptionCleanup, '--', '');
|
|
137
|
+
|
|
138
|
+
sections.push({
|
|
139
|
+
"activityTitle": `${finalMessage.detailTitle}`,
|
|
140
|
+
"activityText": exceptionCleanup,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
104
144
|
}
|
|
105
145
|
|
|
106
146
|
sections.push({
|
|
@@ -136,7 +176,7 @@ module.exports.sendMessage = (config, messageContent) => {
|
|
|
136
176
|
|
|
137
177
|
const payload = createPayload(messageContent);
|
|
138
178
|
|
|
139
|
-
if (debug) {
|
|
179
|
+
if (debug && debugNotification) {
|
|
140
180
|
console.log(JSON.stringify(messageContent, null, 2));
|
|
141
181
|
console.log(JSON.parse(JSON.stringify(payload, null, 2)));
|
|
142
182
|
}
|
package/scripts/utils/tools.js
CHANGED
|
@@ -39,6 +39,14 @@ function runScript(_args, cwdFolder) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
async function runNodeScriptProcessOutput(_args, cwdFolder) {
|
|
43
|
+
const { error, stdout, stderr } = await execa('node', _args, { cwd: cwdFolder });
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
error, stdout, stderr
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
function getPackages(rootFolder) {
|
|
43
51
|
if (!rootFolder) {
|
|
44
52
|
rootFolder = 'src/packages';
|
|
@@ -817,6 +825,7 @@ module.exports.remove = remove;
|
|
|
817
825
|
module.exports.move = move;
|
|
818
826
|
module.exports.getPackages = getPackages;
|
|
819
827
|
module.exports.runScript = runScript;
|
|
828
|
+
module.exports.runNodeScriptProcessOutput = runNodeScriptProcessOutput;
|
|
820
829
|
module.exports.writeJsonFile = writeJsonFile;
|
|
821
830
|
module.exports.writeJsonFileSync = writeJsonFileSync;
|
|
822
831
|
module.exports.getJsonFileContent = getJsonFileContent;
|