@eui/tools 4.15.11 → 4.16.0

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.
Files changed (88) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +45 -0
  3. package/bin/eui-scripts.js +6 -6
  4. package/bin/scripts/build-package-sub.js +20 -0
  5. package/bin/scripts/version.js +12 -0
  6. package/global.test.js +2 -5
  7. package/package.json +16 -20
  8. package/sandbox.js +10 -2
  9. package/scripts/csdr/cli/app.js +30 -3
  10. package/scripts/csdr/cli/skeletons/app-showcase-eui13/angular-config.json +33 -0
  11. package/scripts/csdr/cli/skeletons/app-showcase-eui13/dependencies-composite.json +5 -0
  12. package/scripts/csdr/cli/skeletons/app-showcase-eui13/gitignore_TO_REPLACE +50 -0
  13. package/scripts/csdr/cli/skeletons/app-showcase-eui13/package.json +6 -0
  14. package/scripts/csdr/cli/skeletons/app-showcase-eui13/scripts.json +3 -0
  15. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app-routing.module.ts +21 -0
  16. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.html +26 -0
  17. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.component.ts +19 -0
  18. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/app.routes.ts +7 -0
  19. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home-routing.module.ts +15 -0
  20. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.html +7 -0
  21. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.component.ts +8 -0
  22. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/_home/home.module.ts +17 -0
  23. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/app/features/shared/shared.module.ts +15 -0
  24. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/app-metadata.json +8 -0
  25. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/assets/config/env-json-config.json +41 -0
  26. package/scripts/csdr/cli/skeletons/app-showcase-eui13/src/index.html +22 -0
  27. package/scripts/csdr/config/angular.js +213 -3
  28. package/scripts/csdr/config/global.js +16 -0
  29. package/scripts/csdr/config/packages.js +28 -0
  30. package/scripts/csdr/init/init-utils.js +37 -0
  31. package/scripts/csdr/init/init.js +6 -0
  32. package/scripts/csdr/init/resources/13.x/resolutions.json +15 -0
  33. package/scripts/csdr/install/build-package.js +0 -84
  34. package/scripts/csdr/install/common.js +10 -8
  35. package/scripts/csdr/jira/jira-utils.js +168 -168
  36. package/scripts/csdr/jira/update.js +150 -150
  37. package/scripts/csdr/metadata/app-envs.js +34 -33
  38. package/scripts/csdr/metadata/app-history.js +62 -61
  39. package/scripts/csdr/metadata/app.js +3 -3
  40. package/scripts/csdr/metadata/common.js +2 -2
  41. package/scripts/csdr/metadata/package-history.js +0 -1
  42. package/scripts/csdr/release/app/release-app.js +3 -0
  43. package/scripts/csdr/release/package/backend.js +26 -0
  44. package/scripts/csdr/release/package/common.js +1 -1
  45. package/scripts/csdr/release/package/release-package.js +8 -0
  46. package/scripts/csdr/release/package/ui.js +83 -1
  47. package/scripts/csdr/sync/sync-utils.js +13 -6
  48. package/scripts/csdr/version/package.js +2 -1
  49. package/scripts/utils/build/app/build-app-utils.js +2 -2
  50. package/scripts/utils/build/package/angular.js +4 -4
  51. package/scripts/utils/build/package/build-package-utils.js +50 -1
  52. package/scripts/utils/build/package/element.js +5 -16
  53. package/scripts/utils/build/package/styles.js +100 -7
  54. package/scripts/utils/confluence-utils.js +126 -126
  55. package/scripts/utils/index.js +2 -2
  56. package/scripts/utils/notification/common.js +5 -0
  57. package/scripts/utils/notification/mail-utils.js +3 -0
  58. package/scripts/utils/notification/mailstack.js +3 -5
  59. package/scripts/utils/notification/package.js +0 -2
  60. package/scripts/utils/notification/slack-utils.js +6 -7
  61. package/scripts/utils/pre-build/injection/app-sources-full-skeleton/src/_generated/favicon.ico +0 -0
  62. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/app.module.ts +52 -0
  63. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/app/core/reducers/index.ts +40 -0
  64. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/global.ts +4 -0
  65. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/index.ts +8 -0
  66. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/config/modules.ts +4 -0
  67. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.dev.ts +9 -0
  68. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.prod.ts +9 -0
  69. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/environments/environment.ts +21 -0
  70. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/favicon.ico +0 -0
  71. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/karma.conf.js +7 -0
  72. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/main.ts +21 -0
  73. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/polyfills.ts +86 -0
  74. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/src/_generated/tst.ts +33 -0
  75. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.app.json +19 -0
  76. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tsconfig.spec.json +9 -0
  77. package/scripts/utils/pre-build/injection/app-sources-full-skeleton-eui13/tslint.json +17 -0
  78. package/scripts/utils/pre-build/injection/config.js +29 -30
  79. package/scripts/utils/pre-build/injection/externals.js +6 -0
  80. package/scripts/utils/pre-build/injection/skeletons.js +6 -2
  81. package/scripts/utils/pre-build/projects.js +5 -1
  82. package/scripts/utils/serve/app.js +6 -3
  83. package/scripts/utils/tools.js +370 -283
  84. package/bin/scripts/csdr-jira-update.js +0 -12
  85. package/bin/scripts/csdr-migrate-package.js +0 -17
  86. package/bin/scripts/e2e-app.js +0 -62
  87. package/scripts/migration/eui8-migration.js +0 -94
  88. package/scripts/migration/migrate-utils.js +0 -191
@@ -10,10 +10,11 @@ const tools = require('../../tools');
10
10
  const notificationUtils = require('../../notification/notification-utils');
11
11
 
12
12
  // FETCH ARGS
13
- let { deps, skipClean, skipLint, skipTest, skipCompile, skipDoc } = tools.getArgs();
13
+ let { skipCompile } = tools.getArgs();
14
14
 
15
15
 
16
- const compileSassFile = (folder, filename, isNodeSassTildeImporterActive) => {
16
+ const compileSassFileNodeSass = (folder, filename, isNodeSassTildeImporterActive) => {
17
+
17
18
  const filePath = path.join(folder, 'styles', filename);
18
19
 
19
20
  tools.logInfo(`Compiling ${filePath}.scss...`);
@@ -92,6 +93,96 @@ const compileSassFile = (folder, filename, isNodeSassTildeImporterActive) => {
92
93
 
93
94
 
94
95
 
96
+ const compileSassFileDartSass = (folder, filename) => {
97
+ const filePath = path.join(folder, 'styles', filename);
98
+
99
+ tools.logInfo(`Compiling ${filePath}.scss...`);
100
+
101
+ return Promise.resolve()
102
+ .then(() => {
103
+ tools.logInfo('Compiling SCSS...');
104
+
105
+ const sass = require('sass');
106
+
107
+ return sass.renderSync({
108
+ file: filePath + '.scss',
109
+ outFile: filePath + '.temp.css',
110
+ sourceMap: true,
111
+ sourceMapContents: true,
112
+ sourceMapEmbed: true,
113
+ includePaths: [
114
+ path.resolve(process.cwd(), 'node_modules'),
115
+ ],
116
+ });
117
+ })
118
+
119
+ .then((sassResult) => {
120
+ const finalDest = filePath + '.css';
121
+
122
+ const cssnano = require('cssnano');
123
+ const autoprefixer = require('autoprefixer');
124
+ const postcss = require('postcss');
125
+
126
+ const plugins = [];
127
+
128
+ plugins.push(autoprefixer({
129
+ grid: 'no-autoplace',
130
+ }));
131
+ plugins.push(cssnano({ safe: true }));
132
+
133
+ return postcss(plugins)
134
+ .process(sassResult.css, {
135
+ map: { inline: false, prev: sassResult.map.toString() },
136
+ from: filePath + '.scss',
137
+ to: finalDest,
138
+ })
139
+ .then((postcssResult) => {
140
+ // fs.mkdirSync(path.dirname(dest), { recursive: true });
141
+ fs.writeFileSync(finalDest, postcssResult.css);
142
+
143
+ if (postcssResult.map) {
144
+ fs.writeFileSync(`${finalDest}.map`, postcssResult.map);
145
+ }
146
+ });
147
+ })
148
+
149
+ .then((output) => {
150
+ // console.log(output);
151
+ console.log('Size ::: ' + fs.statSync(filePath + '.css').size);
152
+
153
+ tools.logSuccess(`OK ==> generated ${filePath}.css`);
154
+ })
155
+
156
+ .then(() => {
157
+ tools.remove(filePath + '.temp.css');
158
+ tools.remove(filePath + '.temp.css.map');
159
+ })
160
+
161
+ .catch((e) => {
162
+ console.log(e);
163
+ throw e;
164
+ })
165
+ }
166
+
167
+
168
+
169
+ const compileSassFile = (pkg, folder, filename, isNodeSassTildeImporterActive) => {
170
+ return Promise.resolve()
171
+ .then(() => {
172
+ if (pkg.build && pkg.build.euiVersion === '13.x') {
173
+ return compileSassFileDartSass(folder, filename);
174
+ } else {
175
+ return compileSassFileNodeSass(folder, filename, isNodeSassTildeImporterActive);
176
+ }
177
+ })
178
+
179
+ .catch((e) => {
180
+ console.log(e);
181
+ throw e;
182
+ })
183
+ }
184
+
185
+
95
186
 
96
187
  module.exports.build = (pkg) => {
97
188
  tools.logInfo('Building STYLES package...');
@@ -123,9 +214,12 @@ module.exports.build = (pkg) => {
123
214
  console.log('Sources copy succeeded.')
124
215
  })
125
216
  .then(() => Promise.resolve().then(() => {
217
+ tools.logInfo('Processing stylesheets entries : ');
218
+ console.log(pkg.stylesheets);
219
+
126
220
  return pkg.stylesheets.reduce((promise, file) => {
127
221
  return promise.then(() => (
128
- compileSassFile(tmpFolder, file, pkg.build && pkg.build.isNodeSassTildeImporterActive)
222
+ compileSassFile(pkg, tmpFolder, file, pkg.build && pkg.build.isNodeSassTildeImporterActive)
129
223
  )).catch((e) => {
130
224
  console.log(e);
131
225
  throw e;
@@ -150,6 +244,9 @@ module.exports.build = (pkg) => {
150
244
  tools.copy(path.join(pkg.paths.pkgRootDirectory, 'README.md'), path.join(pkg.paths.pkgBuild, 'README.md'));
151
245
  tools.copy(path.join(pkg.paths.pkgRootDirectory, 'LICENSE'), path.join(pkg.paths.pkgBuild, 'LICENSE'));
152
246
  })
247
+ .then(() => {
248
+ return tools.rimraf(tmpFolder);
249
+ })
153
250
  .then(() => {
154
251
  return notificationUtils.package.sendPackageMessage({
155
252
  package: pkg
@@ -162,7 +259,3 @@ module.exports.build = (pkg) => {
162
259
  }
163
260
  }
164
261
 
165
- // EXPORTS
166
- module.exports.compileSassFile = compileSassFile;
167
-
168
-
@@ -1,126 +1,126 @@
1
- 'use strict';
2
-
3
- var Confluence = require("confluence-api");
4
-
5
- const tools = require('./tools');
6
- const configUtils = require('../csdr/config/config-utils');
7
-
8
- const { jiraUser, jiraPassword, dryRun } = tools.getArgs();
9
-
10
- const updatePageContent = (pageId, pageContent) => {
11
-
12
- const config = configUtils.global.getConfig();
13
-
14
- const confluenceHost = config.confluence && config.confluence.host;
15
- const confluenceProjectName = config.confluence && config.confluence.projectName;
16
-
17
- const confluenceConfig = {
18
- username: jiraUser,
19
- password: jiraPassword,
20
- baseUrl: confluenceHost,
21
- version: 6 // Confluence major version, optional
22
- };
23
-
24
- tools.logTitle('Update confluence DEVOPS page...');
25
-
26
- if (dryRun) {
27
- return Promise.resolve();
28
- }
29
-
30
- var confluence = new Confluence(confluenceConfig);
31
-
32
- return Promise.resolve()
33
- .then(() => {
34
- return new Promise((resolve, reject) => {
35
- confluence.getContentById(
36
- pageId
37
- , function (err, response) {
38
- if (err) {
39
- return reject(err);
40
- } else {
41
- return resolve(response);
42
- }
43
- })
44
- })
45
- })
46
- .then((content) => {
47
- const newVersion = content.version.number + 1;
48
-
49
- return new Promise((resolve, reject) => {
50
- confluence.putContent(
51
- confluenceProjectName,
52
- pageId,
53
- newVersion,
54
- content.title,
55
- pageContent
56
- , function (err, response) {
57
- if (err) {
58
- return reject(err);
59
- } else {
60
- return resolve(response);
61
- }
62
- })
63
- })
64
- })
65
- .then(() => {
66
- tools.logSuccess();
67
- })
68
- .catch((e) => {
69
- // error is not thrown as this failure to update is just a side-effect of the pipeline
70
- tools.logError('ERROR!!! error encountered while trying to publish on Confluence');
71
- console.log(e);
72
- })
73
- }
74
-
75
-
76
- const getContentByPageTitle = (pageTitle) => {
77
-
78
- const config = configUtils.global.getConfig();
79
-
80
- const confluenceHost = config.confluence && config.confluence.host;
81
- const confluenceProjectName = config.confluence && config.confluence.projectName;
82
-
83
- const confluenceConfig = {
84
- username: jiraUser,
85
- password: jiraPassword,
86
- baseUrl: confluenceHost,
87
- version: 6 // Confluence major version, optional
88
- };
89
-
90
- var confluence = new Confluence(confluenceConfig);
91
-
92
- return Promise.resolve()
93
- .then(() => {
94
- return new Promise((resolve, reject) => {
95
- confluence.getContentByPageTitle(
96
- confluenceProjectName,
97
- pageTitle
98
- , function (err, response) {
99
- if (err) {
100
- return reject(err);
101
- } else {
102
- return resolve(response);
103
- }
104
- })
105
- })
106
- })
107
- }
108
-
109
-
110
-
111
- const updatePackagesHistoryPageContent = (tableContent) => {
112
- const config = configUtils.global.getConfig();
113
- const confluencePackagesHistoryPageId = config.confluence && config.confluence.packagesHistoryPageId;
114
-
115
- return updatePageContent(confluencePackagesHistoryPageId, tableContent);
116
- }
117
-
118
-
119
-
120
- // EXPORTS
121
-
122
- module.exports = {
123
- getContentByPageTitle,
124
- updatePageContent,
125
- updatePackagesHistoryPageContent,
126
- }
1
+ // 'use strict';
2
+
3
+ // var Confluence = require("confluence-api");
4
+
5
+ // const tools = require('./tools');
6
+ // const configUtils = require('../csdr/config/config-utils');
7
+
8
+ // const { jiraUser, jiraPassword, dryRun } = tools.getArgs();
9
+
10
+ // const updatePageContent = (pageId, pageContent) => {
11
+
12
+ // const config = configUtils.global.getConfig();
13
+
14
+ // const confluenceHost = config.confluence && config.confluence.host;
15
+ // const confluenceProjectName = config.confluence && config.confluence.projectName;
16
+
17
+ // const confluenceConfig = {
18
+ // username: jiraUser,
19
+ // password: jiraPassword,
20
+ // baseUrl: confluenceHost,
21
+ // version: 6 // Confluence major version, optional
22
+ // };
23
+
24
+ // tools.logTitle('Update confluence DEVOPS page...');
25
+
26
+ // if (dryRun) {
27
+ // return Promise.resolve();
28
+ // }
29
+
30
+ // var confluence = new Confluence(confluenceConfig);
31
+
32
+ // return Promise.resolve()
33
+ // .then(() => {
34
+ // return new Promise((resolve, reject) => {
35
+ // confluence.getContentById(
36
+ // pageId
37
+ // , function (err, response) {
38
+ // if (err) {
39
+ // return reject(err);
40
+ // } else {
41
+ // return resolve(response);
42
+ // }
43
+ // })
44
+ // })
45
+ // })
46
+ // .then((content) => {
47
+ // const newVersion = content.version.number + 1;
48
+
49
+ // return new Promise((resolve, reject) => {
50
+ // confluence.putContent(
51
+ // confluenceProjectName,
52
+ // pageId,
53
+ // newVersion,
54
+ // content.title,
55
+ // pageContent
56
+ // , function (err, response) {
57
+ // if (err) {
58
+ // return reject(err);
59
+ // } else {
60
+ // return resolve(response);
61
+ // }
62
+ // })
63
+ // })
64
+ // })
65
+ // .then(() => {
66
+ // tools.logSuccess();
67
+ // })
68
+ // .catch((e) => {
69
+ // // error is not thrown as this failure to update is just a side-effect of the pipeline
70
+ // tools.logError('ERROR!!! error encountered while trying to publish on Confluence');
71
+ // console.log(e);
72
+ // })
73
+ // }
74
+
75
+
76
+ // const getContentByPageTitle = (pageTitle) => {
77
+
78
+ // const config = configUtils.global.getConfig();
79
+
80
+ // const confluenceHost = config.confluence && config.confluence.host;
81
+ // const confluenceProjectName = config.confluence && config.confluence.projectName;
82
+
83
+ // const confluenceConfig = {
84
+ // username: jiraUser,
85
+ // password: jiraPassword,
86
+ // baseUrl: confluenceHost,
87
+ // version: 6 // Confluence major version, optional
88
+ // };
89
+
90
+ // var confluence = new Confluence(confluenceConfig);
91
+
92
+ // return Promise.resolve()
93
+ // .then(() => {
94
+ // return new Promise((resolve, reject) => {
95
+ // confluence.getContentByPageTitle(
96
+ // confluenceProjectName,
97
+ // pageTitle
98
+ // , function (err, response) {
99
+ // if (err) {
100
+ // return reject(err);
101
+ // } else {
102
+ // return resolve(response);
103
+ // }
104
+ // })
105
+ // })
106
+ // })
107
+ // }
108
+
109
+
110
+
111
+ // const updatePackagesHistoryPageContent = (tableContent) => {
112
+ // const config = configUtils.global.getConfig();
113
+ // const confluencePackagesHistoryPageId = config.confluence && config.confluence.packagesHistoryPageId;
114
+
115
+ // return updatePageContent(confluencePackagesHistoryPageId, tableContent);
116
+ // }
117
+
118
+
119
+
120
+ // // EXPORTS
121
+
122
+ // module.exports = {
123
+ // getContentByPageTitle,
124
+ // updatePageContent,
125
+ // updatePackagesHistoryPageContent,
126
+ // }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const changelogUtils = require('./changelog-utils');
4
- const confluenceUtils = require('./confluence-utils');
4
+ // const confluenceUtils = require('./confluence-utils');
5
5
  const gitUtils = require('./git-utils');
6
6
  const mavenUtils = require('./maven-utils');
7
7
  const pipelineUtils = require('./pipeline-utils');
@@ -19,7 +19,7 @@ const sonarUtils = require('./sonar/sonar-utils');
19
19
 
20
20
  module.exports = {
21
21
  changelog: changelogUtils,
22
- confluence: confluenceUtils,
22
+ // confluence: confluenceUtils,
23
23
  git: gitUtils,
24
24
  maven: mavenUtils,
25
25
  pipeline: pipelineUtils,
@@ -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('----------------------------------------------');
@@ -33,9 +33,6 @@ module.exports.endMailStack = () => {
33
33
  }
34
34
 
35
35
  module.exports.bufferMessage = (message) => {
36
- tools.logInfo('Buffering mail content');
37
- console.log(message);
38
-
39
36
  if (message.text) {
40
37
  mailContent.buffer.push(message.text);
41
38
 
@@ -73,8 +70,9 @@ const sendMailStack = (config, scope, target) => {
73
70
  status = 'ERROR';
74
71
  }
75
72
 
76
- const subject = `RELEASE <b style="color: ${statusColor};">${status}</b> - <b style="color:blue;">${scope}</b> - branch: <b styles="color: blue;">${target}</b>`;
77
- let fullMessage = mailContent.buffer.join('\n');
73
+ // const subject = `RELEASE <b style="color: ${statusColor};">${status}</b> - <b style="color:blue;">${scope}</b> - branch: <b styles="color: blue;">${target}</b>`;
74
+ const subject = `Release of **${scope}** for ${target} ---- status : ${status}`;
75
+ let fullMessage = `<pre>${mailContent.buffer.join('\n')}</pre>`;
78
76
 
79
77
  if (mailContent.exception) {
80
78
  fullMessage += mailContent.exception;
@@ -15,8 +15,6 @@ const innerMailstack = require('./mailstack');
15
15
 
16
16
  module.exports.sendPackageMessage = (options) => {
17
17
 
18
- tools.logInfo('Sending package message');
19
-
20
18
  const message = innerCommon.getMessage(options);
21
19
 
22
20
  // buffer message
@@ -24,10 +24,6 @@ const agent = PROXY ? new HttpsProxyAgent(PROXY) : void 0;
24
24
 
25
25
  const sendMessageCore = (hook, channel, attachments, text = null) => {
26
26
  return new Promise((resolve, reject) => {
27
- tools.logInfo(`Sending message to Slack...`);
28
- tools.logInfo(`Slack hook: ${hook}`);
29
- tools.logInfo(`Slack channel: ${channel}`);
30
-
31
27
  const payload = {
32
28
  username: "eUI bot",
33
29
  channel
@@ -51,6 +47,8 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
51
47
  };
52
48
 
53
49
  if (dryRun || !slackFeedback) {
50
+ tools.logInfo('No notifications config found...skipping');
51
+
54
52
  if (debug) {
55
53
  console.log(JSON.stringify(payload, null, 4));
56
54
  }
@@ -58,6 +56,10 @@ const sendMessageCore = (hook, channel, attachments, text = null) => {
58
56
  resolve();
59
57
 
60
58
  } else {
59
+ tools.logInfo(`Sending message to Slack...`);
60
+ tools.logInfo(`Slack hook: ${hook}`);
61
+ tools.logInfo(`Slack channel: ${channel}`);
62
+
61
63
  if (debug) {
62
64
  console.log(JSON.stringify(payload, null, 4));
63
65
  }
@@ -94,9 +96,6 @@ const sendMessage = (hook, channel, attachments, text = null) => {
94
96
  .then(() => {
95
97
  return sendMessageCore(hook, channel, attachments, text);
96
98
  })
97
- .then(() => {
98
- tools.logSuccess();
99
- })
100
99
  .catch((e) => {
101
100
  tools.logError('Error sending slack message');
102
101
  console.log(e); // do not rethrow
@@ -0,0 +1,52 @@
1
+ // ANGULAR & 3rd PARTIES
2
+ import { NgModule } from '@angular/core';
3
+ import { BrowserModule } from '@angular/platform-browser';
4
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
5
+ import { HttpClientModule } from '@angular/common/http';
6
+ import { StoreModule } from '@ngrx/store';
7
+ import { EffectsModule } from '@ngrx/effects';
8
+ import { StoreDevtoolsModule } from '@ngrx/store-devtools';
9
+ import { TranslateModule } from '@ngx-translate/core';
10
+
11
+ // eUI IMPORTS
12
+ import {
13
+ CoreModule, CoreModuleEffects, translateConfig, EUI_CONFIG_TOKEN,
14
+ } from '@eui/core';
15
+ import { EuiAllModule } from '@eui/components';
16
+
17
+ import { appConfig } from '../config/index';
18
+ import { environment } from '../environments/environment';
19
+
20
+ // APP ROUTES & ROOT COMPONENTS
21
+ import { AppRoutingModule } from '../../app/app-routing.module';
22
+ import { AppComponent } from '../../app/app.component';
23
+
24
+ import { TOKEN, reducerProvider, metaReducers } from './core/reducers/index';
25
+
26
+ // APP ROOT MODULE
27
+ @NgModule({
28
+ imports: [
29
+ BrowserModule,
30
+ BrowserAnimationsModule,
31
+ HttpClientModule,
32
+ StoreModule.forRoot(TOKEN, { metaReducers }),
33
+ StoreDevtoolsModule.instrument({ name: 'CSDR App', maxAge: 150, logOnly: environment.production }),
34
+ EffectsModule.forRoot([...CoreModuleEffects]),
35
+ TranslateModule.forRoot(translateConfig),
36
+ CoreModule.forRoot(),
37
+ AppRoutingModule,
38
+ EuiAllModule,
39
+ ],
40
+ declarations: [
41
+ AppComponent,
42
+ ],
43
+ providers: [
44
+ { provide: EUI_CONFIG_TOKEN, useValue: { appConfig: appConfig, environment: environment } },
45
+ reducerProvider,
46
+ ],
47
+ bootstrap: [
48
+ AppComponent,
49
+ ],
50
+ })
51
+ export class AppModule {
52
+ }
@@ -0,0 +1,40 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ActionReducer, ActionReducerMap, combineReducers, MetaReducer } from '@ngrx/store';
3
+ import * as fromRouter from '@ngrx/router-store';
4
+ import { storeFreeze } from 'ngrx-store-freeze';
5
+ import { reducers as coreReducers, CoreState, localStorageSync } from '@eui/core';
6
+
7
+ export interface AppState extends CoreState {
8
+ router: fromRouter.RouterReducerState<any>;
9
+ }
10
+
11
+ // -----------------
12
+ // ------------ AOT
13
+ export const TOKEN = new InjectionToken<any>('AppReducers');
14
+
15
+ export function getReducers(): ActionReducerMap<AppState, any> {
16
+ return {
17
+ router: fromRouter.routerReducer,
18
+ ...coreReducers,
19
+ };
20
+ }
21
+
22
+ export const reducerProvider = [
23
+ { provide: TOKEN, useFactory: getReducers },
24
+ ];
25
+
26
+ // console.log all actions
27
+ export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
28
+ return (state, action) => {
29
+ const result = reducer(state, action);
30
+ console.groupCollapsed(action.type);
31
+ console.log('prev state', state);
32
+ console.log('action', action);
33
+ console.log('next state', result);
34
+ console.groupEnd();
35
+
36
+ return result;
37
+ };
38
+ }
39
+
40
+ export const metaReducers: MetaReducer<AppState>[] = [logger, localStorageSync, storeFreeze];
@@ -0,0 +1,4 @@
1
+ import { GlobalConfig } from '@eui/core';
2
+
3
+ export const GLOBAL: GlobalConfig = {
4
+ };
@@ -0,0 +1,8 @@
1
+ import { EuiAppConfig } from '@eui/core';
2
+ import { GLOBAL } from './global';
3
+ import { MODULES } from './modules';
4
+
5
+ export const appConfig: EuiAppConfig = {
6
+ global: GLOBAL,
7
+ modules: MODULES,
8
+ };
@@ -0,0 +1,4 @@
1
+ import { ModulesConfig } from '@eui/core';
2
+
3
+ export const MODULES: ModulesConfig = {
4
+ };
@@ -0,0 +1,9 @@
1
+ // activated by running :
2
+ // npm run build -- --configuration=dev
3
+ // OR
4
+ // npm run build-dev
5
+
6
+ export const environment = {
7
+ production: false,
8
+ enableDevToolRedux: true,
9
+ };
@@ -0,0 +1,9 @@
1
+ import { EuiEnvConfig } from '@eui/core';
2
+
3
+ export const environment: EuiEnvConfig = {
4
+ production: true,
5
+ enableDevToolRedux: false,
6
+ envDynamicConfig: {
7
+ uri: 'assets/config/env-json-config.json',
8
+ },
9
+ };
@@ -0,0 +1,21 @@
1
+ // used by serve / when no configuration is provided on the build script
2
+ // run npm run build
3
+
4
+ import { EuiEnvConfig } from '@eui/core';
5
+
6
+ export const environment: EuiEnvConfig = {
7
+ production: false,
8
+ enableDevToolRedux: true,
9
+ envDynamicConfig: {
10
+ uri: 'assets/config/env-json-config.json',
11
+ },
12
+ };
13
+
14
+ /*
15
+ * For easier debugging in development mode, you can import the following file
16
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
17
+ *
18
+ * This import should be commented out in production mode because it will have a negative impact
19
+ * on performance if an error is thrown.
20
+ */
21
+ // import 'zone.js/dist/zone-error'; // Included with Angular CLI.