Skip to content

Commit

Permalink
Merge pull request #764 from Accenture/hotfix
Browse files Browse the repository at this point in the history
Hotfix 4.3.4
  • Loading branch information
JoernBerkefeld authored Feb 21, 2023
2 parents 2cc2900 + bda0788 commit 09f6939
Show file tree
Hide file tree
Showing 16 changed files with 350 additions and 56 deletions.
6 changes: 6 additions & 0 deletions .fork/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 40,
"trailingComma": "none"
}
14 changes: 13 additions & 1 deletion .fork/custom-commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,17 @@
"type": "url",
"url": "https://github.com/Accenture/sfmc-devtools/compare/develop...$shortname?expand=1"
}
},
{
"name": "Create PR to hotfix branch",
"target": "ref",
"refTargets": [
"localbranch",
"remotebranch"
],
"action": {
"type": "url",
"url": "https://github.com/Accenture/sfmc-devtools/compare/hotfix...$shortname?expand=1"
}
}
]
]
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ body:
label: Version
description: What version of our software are you running? (mcdev --version)
options:
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
Expand Down
1 change: 1 addition & 0 deletions boilerplate/files/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"*-meta.ssjs": "${capture}-meta.json",
"*.asset-asset-meta.html": "${dirname}.asset-asset-meta.json",
"*.asset-message-meta.html": "${dirname}.asset-message-meta.json",
"*.asset-template-meta.html": "${dirname}.asset-template-meta.json",
"*.css": "${capture}.asset-code-meta.json",
"*.docx": "${capture}.asset-document-meta.json",
"*.eps": "${capture}.asset-image-meta.json",
Expand Down
4 changes: 4 additions & 0 deletions boilerplate/forcedUpdates.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
{
"version": "4.3.4",
"files": [".vscode/settings.json"]
},
{
"version": "4.1.12",
"files": [".vscode/settings.json"]
Expand Down
68 changes: 65 additions & 3 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5096,6 +5096,7 @@ CLI entry for SFMC DevTools
* [.logSubtypes(subTypeArr)](#Util.logSubtypes) ⇒ <code>void</code>
* [.getKeysString(keyArr, [isId])](#Util.getKeysString) ⇒ <code>string</code>
* [.sleep(ms)](#Util.sleep) ⇒ <code>Promise.&lt;void&gt;</code>
* [.getSsjs(code)](#Util.getSsjs) ⇒ <code>string</code>

<a name="Util.skipInteraction"></a>

Expand Down Expand Up @@ -5402,6 +5403,33 @@ pause execution of code; useful when multiple server calls are dependent on each
| --- | --- | --- |
| ms | <code>number</code> | time in miliseconds to wait |

<a name="Util.getSsjs"></a>

### Util.getSsjs(code) ⇒ <code>string</code>
helper for [_extractCode](#Asset._extractCode) and [prepExtractedCode](#Script.prepExtractedCode) to determine if a code block is a valid SSJS block

**Kind**: static method of [<code>Util</code>](#Util)
**Returns**: <code>string</code> - the SSJS code if code block is a valid SSJS block, otherwise null

| Param | Type | Description |
| --- | --- | --- |
| code | <code>string</code> | code block to check |

**Example**
```js
the following is invalid:
<script runat="server">
// 1
</script>
<script runat="server">
// 2
</script>

the following is valid:
<script runat="server">
// 3
</script>
```
<a name="MetadataTypeDefinitions"></a>

## MetadataTypeDefinitions
Expand Down Expand Up @@ -5665,7 +5693,8 @@ DevOps helper class
* [DevOps](#DevOps)
* [.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths])](#DevOps.getDeltaList) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [~delta](#DevOps.getDeltaList..delta) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>TYPE.DeltaPkgItem</code>
* [~buObjects](#DevOps.getDeltaList..buObjects) : <code>Object.&lt;string, TYPE.BuObject&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [.buildDeltaDefinitions(properties, range, [diffArr])](#DevOps.buildDeltaDefinitions) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [~deltaDeployAll](#DevOps.buildDeltaDefinitions..deltaDeployAll) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [.document(directory, jsonReport)](#DevOps.document) ⇒ <code>void</code>
Expand All @@ -5690,15 +5719,20 @@ Interactive commit selection if no commits are passed.

* [.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths])](#DevOps.getDeltaList) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [~delta](#DevOps.getDeltaList..delta) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>TYPE.DeltaPkgItem</code>
* [~buObjects](#DevOps.getDeltaList..buObjects) : <code>Object.&lt;string, TYPE.BuObject&gt;</code>
* [~copied](#DevOps.getDeltaList..copied) : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>

<a name="DevOps.getDeltaList..delta"></a>

#### getDeltaList~delta : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
**Kind**: inner constant of [<code>getDeltaList</code>](#DevOps.getDeltaList)
<a name="DevOps.getDeltaList..buObjects"></a>

#### getDeltaList~buObjects : <code>Object.&lt;string, TYPE.BuObject&gt;</code>
**Kind**: inner constant of [<code>getDeltaList</code>](#DevOps.getDeltaList)
<a name="DevOps.getDeltaList..copied"></a>

#### getDeltaList~copied : <code>TYPE.DeltaPkgItem</code>
#### getDeltaList~copied : <code>Array.&lt;TYPE.DeltaPkgItem&gt;</code>
**Kind**: inner constant of [<code>getDeltaList</code>](#DevOps.getDeltaList)
<a name="DevOps.buildDeltaDefinitions"></a>

Expand Down Expand Up @@ -6911,6 +6945,7 @@ Util that contains logger and simple util methods
* [.logSubtypes(subTypeArr)](#Util.logSubtypes) ⇒ <code>void</code>
* [.getKeysString(keyArr, [isId])](#Util.getKeysString) ⇒ <code>string</code>
* [.sleep(ms)](#Util.sleep) ⇒ <code>Promise.&lt;void&gt;</code>
* [.getSsjs(code)](#Util.getSsjs) ⇒ <code>string</code>

<a name="Util.skipInteraction"></a>

Expand Down Expand Up @@ -7217,6 +7252,33 @@ pause execution of code; useful when multiple server calls are dependent on each
| --- | --- | --- |
| ms | <code>number</code> | time in miliseconds to wait |

<a name="Util.getSsjs"></a>

### Util.getSsjs(code) ⇒ <code>string</code>
helper for [_extractCode](#Asset._extractCode) and [prepExtractedCode](#Script.prepExtractedCode) to determine if a code block is a valid SSJS block

**Kind**: static method of [<code>Util</code>](#Util)
**Returns**: <code>string</code> - the SSJS code if code block is a valid SSJS block, otherwise null

| Param | Type | Description |
| --- | --- | --- |
| code | <code>string</code> | code block to check |

**Example**
```js
the following is invalid:
<script runat="server">
// 1
</script>
<script runat="server">
// 2
</script>

the following is valid:
<script runat="server">
// 3
</script>
```
<a name="csvToArray"></a>

## csvToArray(csv) ⇒ <code>Array.&lt;string&gt;</code>
Expand Down
9 changes: 4 additions & 5 deletions lib/Deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class Deployer {
// prep folders for auto-creation
MetadataTypeInfo.folder.client = auth.getSDK(buObject);
MetadataTypeInfo.folder.properties = this.properties;
// Remove tmp folder of previous deploys
File.removeSync('tmp');
}
/**
* Deploys all metadata located in the 'deploy' directory to the specified business unit
Expand Down Expand Up @@ -239,13 +237,14 @@ class Deployer {
);
}
const foundDeployTypes = Object.keys(this.metadata)
// remove empty types
.filter((type) => Object.keys(this.metadata[type]).length)
// make sure we keep the subtype in this list if that's what the user defined
.map((type) =>
type === 'asset' && Util.includesStartsWith(typeArr, type)
? typeArr[Util.includesStartsWithIndex(typeArr, type)]
: type
)
// remove empty types
.filter((type) => Object.keys(this.metadata[type]).length);
);
if (!foundDeployTypes.length) {
throw new Error('No metadata found for deployment');
}
Expand Down
5 changes: 4 additions & 1 deletion lib/Retriever.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ class Retriever {
for (const type in deployOrder) {
const subTypeArr = deployOrder[type];
// if types were added by getMetadataHierachy() for caching, make sure the key-list is set to [null] for them which will retrieve all
typeKeyMap[type] = typeKeyMap[type] || [null];
// if we have a subtype, we need to find the correct key-list for it
typeKeyMap[type] = typeKeyMap[type] ||
typeKeyMap[Object.keys(typeKeyMap).find((k) => k.startsWith(type + '-'))] || [null];

// add client to metadata process class instead of passing every time
MetadataTypeInfo[type].client = auth.getSDK(this.buObject);
MetadataTypeInfo[type].properties = this.properties;
Expand Down
Loading

0 comments on commit 09f6939

Please sign in to comment.