mcdev 4.0.1 → 4.0.2

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.
@@ -1,76 +1,78 @@
1
1
  name: 🐞 Bug
2
2
  description: File a bug/issue
3
- title: "[BUG] <title>"
3
+ title: '[BUG] <title>'
4
4
  labels: [bug, NEW]
5
5
  body:
6
- - type: checkboxes
7
- attributes:
8
- label: Is there an existing issue for this?
9
- description: Please [search here](https://github.com/Accenture/sfmc-devtools/issues) to see if an issue already exists for your problem.
10
- options:
11
- - label: I have searched the existing issues
12
- required: true
13
- - type: textarea
14
- attributes:
15
- label: Current Behavior
16
- description: A clear & concise description of what you're experiencing.
17
- validations:
18
- required: false
19
- - type: textarea
20
- attributes:
21
- label: Expected Behavior
22
- description: A clear & concise description of what you expected to happen.
23
- validations:
24
- required: false
25
- - type: textarea
26
- attributes:
27
- label: Steps To Reproduce
28
- description: Steps to reproduce the behavior.
29
- value: |
30
- 1. Go to '...'
31
- 2. Click on '....'
32
- 3. Run '...'
33
- 4. See error...
34
- validations:
35
- required: false
36
- - type: dropdown
37
- id: version
38
- attributes:
39
- label: Version
40
- description: What version of our software are you running? (mcdev --version)
41
- options:
42
- - 4.0.0
43
- - 3.1.3
44
- - 3.1.2
45
- - 3.1.1
46
- - 3.1.0
47
- - 3.0.3
48
- - 3.0.2
49
- - 3.0.1
50
- - develop-branch
51
- validations:
52
- required: true
53
- - type: textarea
54
- attributes:
55
- label: Environment
56
- description: |
57
- examples:
58
- - **Operating system (Windows/Mac/Linux/...)**: Windows 10
59
- - **Node (node --version)**: 13.14.0
60
- - **npm (npm --version)**: 7.6.3
61
- value: |
62
- - OS:
63
- - Node:
64
- - npm:
65
- validations:
66
- required: false
67
- - type: checkboxes
68
- attributes:
69
- label: Participation
70
- options:
71
- - label: I am willing to submit a pull request for this issue.
72
- required: false
73
- - type: textarea
74
- attributes:
75
- label: Additional comments
76
- description: Is there anything else that's important for the team to know?
6
+ - type: checkboxes
7
+ attributes:
8
+ label: Is there an existing issue for this?
9
+ description: Please [search here](https://github.com/Accenture/sfmc-devtools/issues) to see if an issue already exists for your problem.
10
+ options:
11
+ - label: I have searched the existing issues
12
+ required: true
13
+ - type: textarea
14
+ attributes:
15
+ label: Current Behavior
16
+ description: A clear & concise description of what you're experiencing.
17
+ validations:
18
+ required: false
19
+ - type: textarea
20
+ attributes:
21
+ label: Expected Behavior
22
+ description: A clear & concise description of what you expected to happen.
23
+ validations:
24
+ required: false
25
+ - type: textarea
26
+ attributes:
27
+ label: Steps To Reproduce
28
+ description: Steps to reproduce the behavior.
29
+ value: |
30
+ 1. Go to '...'
31
+ 2. Click on '....'
32
+ 3. Run '...'
33
+ 4. See error...
34
+ validations:
35
+ required: false
36
+ - type: dropdown
37
+ id: version
38
+ attributes:
39
+ label: Version
40
+ description: What version of our software are you running? (mcdev --version)
41
+ options:
42
+ - 4.0.2
43
+ - 4.0.1
44
+ - 4.0.0
45
+ - 3.1.3
46
+ - 3.1.2
47
+ - 3.1.1
48
+ - 3.1.0
49
+ - 3.0.3
50
+ - 3.0.2
51
+ - 3.0.1
52
+ - develop-branch
53
+ validations:
54
+ required: true
55
+ - type: textarea
56
+ attributes:
57
+ label: Environment
58
+ description: |
59
+ examples:
60
+ - **Operating system (Windows/Mac/Linux/...)**: Windows 10
61
+ - **Node (node --version)**: 13.14.0
62
+ - **npm (npm --version)**: 7.6.3
63
+ value: |
64
+ - OS:
65
+ - Node:
66
+ - npm:
67
+ validations:
68
+ required: false
69
+ - type: checkboxes
70
+ attributes:
71
+ label: Participation
72
+ options:
73
+ - label: I am willing to submit a pull request for this issue.
74
+ required: false
75
+ - type: textarea
76
+ attributes:
77
+ label: Additional comments
78
+ description: Is there anything else that's important for the team to know?
package/README.md CHANGED
@@ -123,7 +123,7 @@ If you experience issues installing Accenture SFMC DevTools, please check out th
123
123
  1. Install Accenture SFMC DevTools by running `npm install -g mcdev` (prefix with `sudo` on MacOS)
124
124
  - If you get an error, please see the below troubleshooting section.
125
125
 
126
- When completed you will see `+ mcdev@3.2.0` printed to your screen (or the current version of it respectively).
126
+ When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.0.2`).
127
127
 
128
128
  > **_Side note for proud nerds_:**
129
129
  >
@@ -272,13 +272,15 @@ To work with our **developer-version** or to install a **specific older version*
272
272
  npm install -g accenture/sfmc-devtools#develop
273
273
  ```
274
274
 
275
+ _Note: Regardless of which tag or branch you install_
276
+
275
277
  **Install specific version (using a version tag on npm):**
276
278
 
277
279
  ```bash
278
- npm install -g mcdev@3.2.0
280
+ npm install -g mcdev@4.0.2
279
281
  ```
280
282
 
281
- **Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 3.2.0)!
283
+ **Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 4.0.2)!
282
284
 
283
285
  > **Note**: The version is currently _not_ updated on the developer branch until a new release is published. Hence, you will not see a change if you run `mcdev --version`.
284
286
 
@@ -1509,7 +1511,7 @@ If you use Accenture SFMC DevTools in your team it is recommended to install you
1509
1511
 
1510
1512
  If you do need to install it locally, make sure you don't commit your project's package.json with this change or you might break mcdev for other developers in your team that either didn't clone the Accenture SFMC DevTools repo or stored in a different directory.
1511
1513
 
1512
- To test your new **global** developer setup, run `mcdev --version` in CLI which should return the current version (e.g. `3.2.0`). Then, go into your mcdev repo and update the version with the suffix `-dev`, e.g. to `3.2.0-dev` and then run `mcdev --version` again to verify that your change propagates instantly.
1514
+ To test your new **global** developer setup, run `mcdev --version` in CLI which should return the current version (e.g. `4.0.2`). Then, go into your mcdev repo and update the version with the suffix `-dev`, e.g. to `4.0.2-dev` and then run `mcdev --version` again to verify that your change propagates instantly.
1513
1515
 
1514
1516
  <a name="local-install"></a>
1515
1517
 
@@ -1536,7 +1538,7 @@ The following explains how you _could_ install it locally for certain edge cases
1536
1538
  4. Afterwards, install Accenture SFMC DevTools by running `npm install --save-dev mcdev`
1537
1539
  - If you get an error, please see the below troubleshooting section.
1538
1540
 
1539
- When completed you will see `+ mcdev@3.2.0` printed to your screen (or the current version of it respectively).
1541
+ When completed run `mcdev --version` and it will show you which version you installed (e.g. `4.0.2`).
1540
1542
 
1541
1543
  ### 9.3. NPM Scripts
1542
1544
 
@@ -4448,7 +4448,7 @@ CLI entry for SFMC DevTools
4448
4448
  * [.inverseGet(objs, val)](#Util.inverseGet) ⇒ <code>string</code>
4449
4449
  * [.getMetadataHierachy(metadataTypes)](#Util.getMetadataHierachy) ⇒ <code>Array.&lt;string&gt;</code>
4450
4450
  * [.resolveObjPath(path, obj)](#Util.resolveObjPath) ⇒ <code>any</code>
4451
- * [.execSync(cmd, [args])](#Util.execSync) ⇒ <code>undefined</code>
4451
+ * [.execSync(cmd, [args], [hideOutput])](#Util.execSync) ⇒ <code>undefined</code>
4452
4452
  * [.templateSearchResult(results, keyToSearch, searchValue)](#Util.templateSearchResult) ⇒ <code>TYPE.MetadataTypeItem</code>
4453
4453
  * [.setLoggingLevel(argv)](#Util.setLoggingLevel) ⇒ <code>void</code>
4454
4454
 
@@ -4645,7 +4645,7 @@ let's you dynamically walk down an object and get a value
4645
4645
 
4646
4646
  <a name="Util.execSync"></a>
4647
4647
 
4648
- ### Util.execSync(cmd, [args]) ⇒ <code>undefined</code>
4648
+ ### Util.execSync(cmd, [args], [hideOutput]) ⇒ <code>undefined</code>
4649
4649
  helper to run other commands as if run manually by user
4650
4650
 
4651
4651
  **Kind**: static method of [<code>Util</code>](#Util)
@@ -4654,6 +4654,7 @@ helper to run other commands as if run manually by user
4654
4654
  | --- | --- | --- |
4655
4655
  | cmd | <code>string</code> | to be executed command |
4656
4656
  | [args] | <code>Array.&lt;string&gt;</code> | list of arguments |
4657
+ | [hideOutput] | <code>boolean</code> | if true, output of command will be hidden from CLI |
4657
4658
 
4658
4659
  <a name="Util.templateSearchResult"></a>
4659
4660
 
@@ -6206,7 +6207,7 @@ Util that contains logger and simple util methods
6206
6207
  * [.inverseGet(objs, val)](#Util.inverseGet) ⇒ <code>string</code>
6207
6208
  * [.getMetadataHierachy(metadataTypes)](#Util.getMetadataHierachy) ⇒ <code>Array.&lt;string&gt;</code>
6208
6209
  * [.resolveObjPath(path, obj)](#Util.resolveObjPath) ⇒ <code>any</code>
6209
- * [.execSync(cmd, [args])](#Util.execSync) ⇒ <code>undefined</code>
6210
+ * [.execSync(cmd, [args], [hideOutput])](#Util.execSync) ⇒ <code>undefined</code>
6210
6211
  * [.templateSearchResult(results, keyToSearch, searchValue)](#Util.templateSearchResult) ⇒ <code>TYPE.MetadataTypeItem</code>
6211
6212
  * [.setLoggingLevel(argv)](#Util.setLoggingLevel) ⇒ <code>void</code>
6212
6213
 
@@ -6403,7 +6404,7 @@ let's you dynamically walk down an object and get a value
6403
6404
 
6404
6405
  <a name="Util.execSync"></a>
6405
6406
 
6406
- ### Util.execSync(cmd, [args]) ⇒ <code>undefined</code>
6407
+ ### Util.execSync(cmd, [args], [hideOutput]) ⇒ <code>undefined</code>
6407
6408
  helper to run other commands as if run manually by user
6408
6409
 
6409
6410
  **Kind**: static method of [<code>Util</code>](#Util)
@@ -6412,6 +6413,7 @@ helper to run other commands as if run manually by user
6412
6413
  | --- | --- | --- |
6413
6414
  | cmd | <code>string</code> | to be executed command |
6414
6415
  | [args] | <code>Array.&lt;string&gt;</code> | list of arguments |
6416
+ | [hideOutput] | <code>boolean</code> | if true, output of command will be hidden from CLI |
6415
6417
 
6416
6418
  <a name="Util.templateSearchResult"></a>
6417
6419
 
@@ -792,9 +792,8 @@ class Automation extends MetadataType {
792
792
  output += `* Recurrance: every ${ical.INTERVAL > 1 ? ical.INTERVAL : ''} ${
793
793
  frequency === 'dai' ? 'day' : frequency
794
794
  }${ical.INTERVAL > 1 ? 's' : ''} ${ical.COUNT ? `for ${ical.COUNT} times` : ''}\n`;
795
- output += '\n';
796
795
  } else if (json.schedule) {
797
- output += `**Schedule:** Not defined\n\n`;
796
+ output += `**Schedule:** Not defined\n`;
798
797
  }
799
798
  } else if (json.type === 'triggered' && json.fileTrigger) {
800
799
  output += `**File Trigger:**\n\n`;
@@ -803,12 +802,19 @@ class Automation extends MetadataType {
803
802
  output += `* Pattern: ${json.fileTrigger.fileNamingPattern}\n`;
804
803
  output += `* Folder: ${json.fileTrigger.folderLocationText}\n`;
805
804
  }
805
+ // show table with automation steps
806
806
  if (tabled && tabled.length) {
807
+ // add empty line to ensure the following table is rendered properly
808
+ output += '\n';
807
809
  let tableSeparator = '';
808
810
  const row1 = [];
809
811
  for (const column of tabled[0]) {
810
812
  row1.push(
811
- `| ${column.title}${column.description ? `<br>_${column.description}_` : ''} `
813
+ `| ${column.title}${
814
+ column.description
815
+ ? `<br>_<small>${column.description.replace(/\n/g, '<br>')}</small>_`
816
+ : ''
817
+ } `
812
818
  );
813
819
  tableSeparator += '| --- ';
814
820
  }
package/lib/util/init.js CHANGED
@@ -161,7 +161,7 @@ const Init = {
161
161
  if (initGit.status === 'init') {
162
162
  Util.logger.info(`Committing initial setup to Git:`);
163
163
  Util.execSync('git', ['add', '.']);
164
- Util.execSync('git', ['commit', '-m', '"Initial commit"', '--quiet']);
164
+ Util.execSync('git', ['commit', '-n', '-m', '"Initial commit"', '--quiet']);
165
165
  Util.logger.info(`✔️ Configuration committed`);
166
166
  }
167
167
 
@@ -204,7 +204,7 @@ const Init = {
204
204
  if (gitStatus === 'init') {
205
205
  Util.logger.info(`Committing first backup of your SFMC instance:`);
206
206
  Util.execSync('git', ['add', '.']);
207
- Util.execSync('git', ['commit', '-m', '"First instance backup"', '--quiet']);
207
+ Util.execSync('git', ['commit', '-n', '-m', '"First instance backup"', '--quiet']);
208
208
  Util.logger.info(`✔️ SFMC instance backed up`);
209
209
  } else if (gitStatus === 'update') {
210
210
  Util.logger.warn(
@@ -49,7 +49,7 @@ const Init = {
49
49
  this._getDefaultPackageJson(projectPackageJson);
50
50
  await File.writeToFile('./', 'package', 'json', JSON.stringify(projectPackageJson));
51
51
  // execute "no questions asked" npm init
52
- Util.execSync('npm', ['init', '--yes']);
52
+ Util.execSync('npm', ['init', '--yes'], true);
53
53
  try {
54
54
  fileContent = File.readFileSync('package.json', 'utf8');
55
55
  if (fileContent) {
package/lib/util/util.js CHANGED
@@ -353,15 +353,16 @@ const Util = {
353
353
  *
354
354
  * @param {string} cmd to be executed command
355
355
  * @param {string[]} [args] list of arguments
356
+ * @param {boolean} [hideOutput] if true, output of command will be hidden from CLI
356
357
  * @returns {undefined}
357
358
  */
358
- execSync(cmd, args) {
359
+ execSync(cmd, args, hideOutput) {
359
360
  args = args || [];
360
361
  Util.logger.info('⚡ ' + cmd + ' ' + args.join(' '));
361
362
 
362
363
  // the following options ensure the user sees the same output and
363
364
  // interaction options as if the command was manually run
364
- const options = { stdio: [0, 1, 2] };
365
+ const options = hideOutput ? {} : { stdio: [0, 1, 2] };
365
366
  return child_process.execSync(cmd + ' ' + args.join(' '), options);
366
367
  },
367
368
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcdev",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Accenture Salesforce Marketing Cloud DevTools",
5
5
  "author": "joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
6
6
  "license": "MIT",