Skip to content

Commit

Permalink
Merge pull request #1193 from Accenture/develop
Browse files Browse the repository at this point in the history
release v7.0.0
  • Loading branch information
JoernBerkefeld authored Jun 7, 2024
2 parents 50be615 + 5733acc commit feb1b74
Show file tree
Hide file tree
Showing 599 changed files with 48,397 additions and 18,518 deletions.
13 changes: 13 additions & 0 deletions .beautyamp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"ampscript": {
"capitalizeAndOrNot": true,
"capitalizeIfFor": true,
"capitalizeSet": true,
"capitalizeVar": true,
"maxParametersPerLine": 4
},
"editor": {
"insertSpaces": true,
"tabSize": 4
}
}
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"root": true,
"settings": {
"jsdoc": {
"mode": "jsdoc",
"mode": "typescript",
"preferredTypes": {
"array": "Array",
"array.<>": "[]",
Expand All @@ -33,6 +33,10 @@
"object.<>": "Object.<>",
"object<>": "Object.<>",
"Object<>": "Object.<>",
"set": "Set",
"set.<>": "Set.<>",
"set<>": "Set.<>",
"Set<>": "Set.<>",
"promise": "Promise",
"promise.<>": "Promise.<>",
"promise<>": "Promise.<>",
Expand Down Expand Up @@ -84,6 +88,8 @@
],
"jsdoc/require-param-type": "error",
"jsdoc/tag-lines": ["warn", "any", { "startLines": 1 }],
"jsdoc/no-undefined-types": "error",
"valid-jsdoc": "off",
"spaced-comment": ["warn", "always", { "block": { "exceptions": ["*"], "balanced": true } }]
},
"overrides": [
Expand Down
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:
- 7.0.0
- 6.0.2
- 6.0.1
- 6.0.0
Expand Down
8 changes: 7 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE/pr_template_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

## Checklist

### Before merge

- [ ] Wiki updated with info in ticket listed under **Documentation**
- [ ] ran `npm audit fix`
- [ ] ran `npm run lint:fix`
- [ ] ran `npm run version:major/minor/patch`
- [ ] updated [bug template](/.github/ISSUE_TEMPLATE/bug.yml) to include the new version
- [ ] updated [.mcdevrc](/test/mockRoot/.mcdevrc.json) for tests to the new version
- [ ] (after merge) moved version tag to merge commit & pushed to remote

### After merge

- [ ] merged all dependabot PRs to main branch
- [ ] moved version tag to merge commit & pushed to remote
- [ ] closed GitHub milestone
- [ ] created [new GitHub Release](https://github.com/Accenture/sfmc-devtools/releases/new)

Expand Down
54 changes: 51 additions & 3 deletions .github/workflows/code-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
branches: [main, develop, hotfix]

jobs:
testAndCoverage:
name: lint & test
lintandTest18:
name: lint & test w/ node v18
runs-on: ubuntu-latest
permissions:
actions: read
Expand All @@ -24,7 +24,55 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18.18.2
registry-url: https://registry.npmjs.org/

- run: npm ci --ignore-scripts

- run: npm run lint

# Assuming code passes, run tests
- name: Run mcdev-tests
run: npm run test
lintandTest19:
name: lint & test w/ node v19
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 19
registry-url: https://registry.npmjs.org/

- run: npm ci --ignore-scripts

- run: npm run lint

# Assuming code passes, run tests
- name: Run mcdev-tests
run: npm run test
lintandTest20:
name: lint & test w/ node v20
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- run: npm ci --ignore-scripts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage-develop-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: ./package.json

- run: npm ci --ignore-scripts

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: ./package.json

- run: npm ci --ignore-scripts

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: ./package.json

- run: npm ci --ignore-scripts

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: ./package.json

- run: npm ci
- run: npm test

Expand All @@ -25,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version-file: ./package.json
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
Expand Down
2 changes: 0 additions & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
INPUT_FILE=$1
START_LINE=`head -n1 $INPUT_FILE`
PATTERN="^(#[[:digit:]]|Merge|Revert)"
Expand Down
3 changes: 0 additions & 3 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# ### git commit message template ###
git config commit.template .git/templatemessage
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '^((feature|bug|bugfix|fix|hotfix|task|chore)\/)?\K\d{1,7}' || true`
Expand Down
9 changes: 2 additions & 7 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#!/bin/sh
# ### run npm install ###
. "$(dirname "$0")/_/husky.sh"


echo "[POST-MERGE] 📦 Checking for changes to dependencies"

IFS=$'\n'
# extract all paths to package-lock.json files
# extract all paths to package-lock.json files
PACKAGE_LOCK_REGEX="(^package-lock\.json)"
PACKAGES=$(git diff --name-only HEAD^1 HEAD | grep -E $PACKAGE_LOCK_REGEX || true)

Expand All @@ -19,4 +14,4 @@ if [[ ${PACKAGES[@]} ]]; then
npm run lint:fix
else
echo "📦 All packages up-to-date. No need to run npm install."
fi
fi
10 changes: 5 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run docs
git update-index --add docs/dist/documentation.md
# run lint-staged hooks
npx --no lint-staged

# update typescript type declarations
npx tsc
git add @types
8 changes: 0 additions & 8 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
"options": {
"tabWidth": 2
}
},
{
"files": "*.sql",
"options": {
"formatter": "sql-formatter",
"language": "tsql",
"keywordCase": "upper"
}
}
]
}
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
// Formatting & colors
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"xnerd.ampscript-language",
"FiB.beautyAmp",

// mcdev tests
"hbenl.vscode-mocha-test-adapter",
Expand Down
18 changes: 15 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
},
"editor.formatOnSave": true,
"files.associations": {
"*.ssjs": "javascript"
"*.ssjs": "javascript",
"*.html": "ampscript"
},
"files.eol": "\n",
"js/ts.implicitProjectConfig.checkJs": true,
"javascript.validate.enable": false,
"javascript.validate.enable": true,
"markdown.extension.italic.indicator": "_",
"markdown.extension.list.indentationSize": "adaptive",
"markdown.extension.toc.levels": "2..6",
Expand All @@ -19,7 +20,7 @@
"sql-formatter.indent": " ",
"sql-formatter.uppercase": true,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "FiB.beautyAmp"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down Expand Up @@ -56,5 +57,16 @@
"label": "Created By Me",
"query": "author:${user} state:open repo:${owner}/${repository} sort:created-desc"
}
],
"vsicons.associations.files": [
{
"icon": "apex",
"languages": [
{ "ids": "ampscript", "defaultExtension": "amp" },
{ "ids": "AMPscript", "defaultExtension": "amp" }
],
"light": true,
"format": "FileFormat.svg"
}
]
}
97 changes: 97 additions & 0 deletions @types/lib/Builder.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
export default Builder;
export type BuObject = import('../types/mcdev.d.js').BuObject;
export type CodeExtract = import('../types/mcdev.d.js').CodeExtract;
export type CodeExtractItem = import('../types/mcdev.d.js').CodeExtractItem;
export type Mcdevrc = import('../types/mcdev.d.js').Mcdevrc;
export type MetadataTypeItem = import('../types/mcdev.d.js').MetadataTypeItem;
export type MetadataTypeItemDiff = import('../types/mcdev.d.js').MetadataTypeItemDiff;
export type MetadataTypeItemObj = import('../types/mcdev.d.js').MetadataTypeItemObj;
export type MetadataTypeMap = import('../types/mcdev.d.js').MetadataTypeMap;
export type MetadataTypeMapObj = import('../types/mcdev.d.js').MetadataTypeMapObj;
export type MultiMetadataTypeList = import('../types/mcdev.d.js').MultiMetadataTypeList;
export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams;
export type TemplateMap = import('../types/mcdev.d.js').TemplateMap;
/**
* @typedef {import('../types/mcdev.d.js').BuObject} BuObject
* @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract
* @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem
* @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc
* @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem
* @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff
* @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj
* @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap
* @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj
* @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList
* @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams
* @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap
*/
/**
* Builds metadata from a template using market specific customisation
*/
declare class Builder {
/**
* Build a template based on a list of metadata files in the retrieve folder.
*
* @param {string} businessUnit references credentials from properties.json
* @param {string} selectedType supported metadata type
* @param {string[]} keyArr customerkey of the metadata
* @param {string} market market localizations
* @returns {Promise.<MultiMetadataTypeList>} -
*/
static buildTemplate(businessUnit: string, selectedType: string, keyArr: string[], market: string): Promise<MultiMetadataTypeList>;
/**
* Build a specific metadata file based on a template.
*
* @param {string} businessUnit references credentials from properties.json
* @param {string} selectedType supported metadata type
* @param {string[]} nameArr name of the metadata
* @param {string} market market localizations
* @returns {Promise.<MultiMetadataTypeList>} -
*/
static buildDefinition(businessUnit: string, selectedType: string, nameArr: string[], market: string): Promise<MultiMetadataTypeList>;
/**
* Build a specific metadata file based on a template using a list of bu-market combos
*
* @param {string} listName name of list of BU-market combos
* @param {string} type supported metadata type
* @param {string[]} nameArr name of the metadata
* @returns {Promise.<object>} -
*/
static buildDefinitionBulk(listName: string, type: string, nameArr: string[]): Promise<object>;
/**
* Creates a Builder, uses v2 auth if v2AuthOptions are passed.
*
* @param {Mcdevrc} properties properties for auth
saved
* @param {BuObject} buObject properties for auth
*/
constructor(properties: Mcdevrc, buObject: BuObject);
properties: import("../types/mcdev.d.js").Mcdevrc;
templateDir: string;
retrieveDir: any;
buObject: import("../types/mcdev.d.js").BuObject;
targetDir: string[];
/**
* @type {MultiMetadataTypeList}
*/
metadata: MultiMetadataTypeList;
/**
* Builds a specific metadata file by name
*
* @param {string} metadataType metadata type to build
* @param {string[]} nameArr name of metadata to build
* @param {TemplateMap} templateVariables variables to be replaced in the metadata
* @returns {Promise.<MultiMetadataTypeList>} Promise
*/
_buildDefinition(metadataType: string, nameArr: string[], templateVariables: TemplateMap): Promise<MultiMetadataTypeList>;
/**
* Build a template based on a list of metadata files in the retrieve folder.
*
* @param {string} metadataType metadata type to create a template of
* @param {string[]} keyArr customerkey of metadata to create a template of
* @param {TemplateMap} templateVariables variables to be replaced in the metadata
* @returns {Promise.<MultiMetadataTypeList>} Promise
*/
_buildTemplate(metadataType: string, keyArr: string[], templateVariables: TemplateMap): Promise<MultiMetadataTypeList>;
}
//# sourceMappingURL=Builder.d.ts.map
1 change: 1 addition & 0 deletions @types/lib/Builder.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit feb1b74

Please sign in to comment.