@eui/tools 4.15.14 → 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 (36) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/bin/eui-scripts.js +0 -4
  4. package/global.test.js +1 -4
  5. package/package.json +6 -6
  6. package/sandbox.js +10 -3
  7. package/scripts/csdr/config/packages.js +28 -0
  8. package/scripts/csdr/init/init-utils.js +37 -0
  9. package/scripts/csdr/init/init.js +6 -0
  10. package/scripts/csdr/init/resources/13.x/resolutions.json +15 -0
  11. package/scripts/csdr/install/build-package.js +0 -84
  12. package/scripts/csdr/install/common.js +0 -16
  13. package/scripts/csdr/metadata/app.js +3 -3
  14. package/scripts/csdr/release/package/backend.js +26 -0
  15. package/scripts/csdr/release/package/common.js +1 -1
  16. package/scripts/csdr/release/package/release-package.js +4 -0
  17. package/scripts/csdr/release/package/ui.js +83 -1
  18. package/scripts/csdr/sync/sync-utils.js +7 -4
  19. package/scripts/csdr/version/package.js +2 -1
  20. package/scripts/utils/build/app/build-app-utils.js +2 -2
  21. package/scripts/utils/build/package/element.js +2 -2
  22. package/scripts/utils/notification/common.js +5 -0
  23. package/scripts/utils/notification/mail-utils.js +3 -0
  24. package/scripts/utils/notification/mailstack.js +3 -5
  25. package/scripts/utils/notification/package.js +0 -2
  26. package/scripts/utils/notification/slack-utils.js +6 -7
  27. package/scripts/utils/pre-build/injection/config.js +29 -30
  28. package/scripts/utils/pre-build/injection/externals.js +6 -0
  29. package/scripts/utils/serve/app.js +6 -3
  30. package/scripts/utils/tools.js +362 -304
  31. package/bin/scripts/csdr-jira-update.js +0 -12
  32. package/bin/scripts/csdr-migrate-package.js +0 -17
  33. package/bin/scripts/e2e-app.js +0 -62
  34. package/scripts/csdr/init/resources/yarn-eui13.lock +0 -15857
  35. package/scripts/migration/eui8-migration.js +0 -94
  36. package/scripts/migration/migrate-utils.js +0 -191
@@ -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
@@ -15,42 +15,41 @@ const injectConfig = (project) => {
15
15
  return Promise.resolve()
16
16
  .then(() => {
17
17
  if (!project.config.npmPkg) {
18
- return tools.logWarning('No linked config package found in project config');
18
+ tools.logWarning('No linked config package found in project config');
19
+ return;
20
+ }
21
+ // check if package is locally cloned
22
+ const localPackage = configUtils.packages.getPackages().filter((p) => {
23
+ return p.npmPkg === project.config.npmPkg
24
+ })[0];
19
25
 
20
- } else {
21
- // check if package is locally cloned
22
- const localPackage = configUtils.packages.getPackages().filter((p) => {
23
- return p.npmPkg === project.config.npmPkg
24
- })[0];
26
+ var pkgAssetsPath;
27
+ const projectAssetsPath = path.join(process.cwd(), project.folder, 'src', 'assets');
28
+ const projectEnvironmentsPath = path.join(process.cwd(), project.folder, 'src', 'environments');
25
29
 
26
- var pkgAssetsPath;
27
- const projectAssetsPath = path.join(process.cwd(), project.folder, 'src', 'assets');
28
- const projectEnvironmentsPath = path.join(process.cwd(), project.folder, 'src', 'environments');
30
+ // if local package is found
31
+ if (localPackage) {
32
+ pkgAssetsPath = path.join(process.cwd(), 'packages', localPackage.name, 'assets');
29
33
 
30
- // if local package is found
31
- if (localPackage) {
32
- pkgAssetsPath = path.join(process.cwd(), 'packages', localPackage.name, 'assets');
34
+ // if not sources are taken from the npm package def in node_modules
35
+ } else {
36
+ const npmPkgScope = project.config.npmPkg.substr(0, project.config.npmPkg.indexOf('/'));
37
+ const npmPkgName = project.config.npmPkg.substr(project.config.npmPkg.indexOf('/') + 1);
38
+ pkgAssetsPath = path.join(process.cwd(), 'node_modules', npmPkgScope, npmPkgName, 'assets');
39
+ }
33
40
 
34
- // if not sources are taken from the npm package def in node_modules
35
- } else {
36
- const npmPkgScope = project.config.npmPkg.substr(0, project.config.npmPkg.indexOf('/'));
37
- const npmPkgName = project.config.npmPkg.substr(project.config.npmPkg.indexOf('/') + 1);
38
- pkgAssetsPath = path.join(process.cwd(), 'node_modules', npmPkgScope, npmPkgName, 'assets');
39
- }
41
+ if (!tools.isDirExists(pkgAssetsPath)) {
42
+ tools.logWarning(`Linked config pkg : ${project.config.npmPkg} cannot be found in node_modules`);
43
+ return;
44
+ }
40
45
 
41
- if (!tools.isDirExists(pkgAssetsPath)) {
42
- return tools.logWarning(`Linked config pkg : ${project.config.npmPkg} cannot be found in node_modules`);
46
+ tools.logInfo(`${project.config.npmPkg}/assets - injecting in ${projectAssetsPath}`);
47
+ tools.copydir(pkgAssetsPath, projectAssetsPath);
43
48
 
44
- } else {
45
- tools.logInfo(`${project.config.npmPkg}/assets - injecting in ${projectAssetsPath}`);
46
- tools.copydir(pkgAssetsPath, projectAssetsPath);
47
-
48
- const pkgEnvironmentsPath = path.join(pkgAssetsPath, 'environments');
49
- if (tools.isDirExists(pkgEnvironmentsPath)) {
50
- tools.logInfo(`${project.config.npmPkg}/assets/environments - injecting in ${projectEnvironmentsPath}`);
51
- tools.copydir(pkgEnvironmentsPath, projectEnvironmentsPath);
52
- }
53
- }
49
+ const pkgEnvironmentsPath = path.join(pkgAssetsPath, 'environments');
50
+ if (tools.isDirExists(pkgEnvironmentsPath)) {
51
+ tools.logInfo(`${project.config.npmPkg}/assets/environments - injecting in ${projectEnvironmentsPath}`);
52
+ tools.copydir(pkgEnvironmentsPath, projectEnvironmentsPath);
54
53
  }
55
54
  })
56
55
 
@@ -49,6 +49,9 @@ module.exports.injectExternalFeatures = (project) => {
49
49
  throw new Error('External features not found');
50
50
 
51
51
  } else {
52
+ tools.logInfo(`Removing ${projectSrcPath} content`);
53
+ tools.rmdirFull(projectSrcPath, false);
54
+
52
55
  tools.logInfo(`${featuresSrcPath} injecting in ${projectSrcPath}`);
53
56
  return tools.copydir(featuresSrcPath, projectSrcPath, true);
54
57
  }
@@ -103,6 +106,9 @@ module.exports.injectExternalAppSources = (project) => {
103
106
  throw new Error('External features not found');
104
107
 
105
108
  } else {
109
+ tools.logInfo(`Removing ${projectSrcPath} content`);
110
+ tools.rmdirFull(projectSrcPath, false);
111
+
106
112
  tools.logInfo(`${appSourcesSrcPath} injecting in ${projectSrcPath}`);
107
113
  return tools.copydir(appSourcesSrcPath, projectSrcPath, true);
108
114
  }
@@ -10,7 +10,7 @@ const configUtils = require('../../csdr/config/config-utils');
10
10
 
11
11
  module.exports.serve = () => {
12
12
 
13
- let { configuration, baseHref, host, proxyConfig, maxSpaceSize, port, disableHostCheck, open } = tools.getArgs();
13
+ let { configuration, baseHref, host, proxyConfig, maxSpaceSize, port, disableHostCheck, open, debug } = tools.getArgs();
14
14
 
15
15
  const prj = configUtils.projects.getProject();
16
16
 
@@ -24,14 +24,17 @@ module.exports.serve = () => {
24
24
 
25
25
  const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
26
26
 
27
- console.log('Provided arguments:\n');
27
+ tools.logInfo('Provided arguments:\n');
28
28
  console.log(`configuration=${configuration}, baseHref=${baseHref}, host=${host}`);
29
29
 
30
30
 
31
31
  return Promise.resolve()
32
32
  .then(() => {
33
33
  tools.logTitle(`Serving application : ${prj.name}...`);
34
- console.log(prj);
34
+
35
+ if (debug) {
36
+ console.log(prj);
37
+ }
35
38
  })
36
39
 
37
40
  .then(() => {