Skip to content

Commit

Permalink
Merge pull request #918 from Accenture/task/354-es6Module
Browse files Browse the repository at this point in the history
Task/354 es6 module
  • Loading branch information
JoernBerkefeld authored Sep 19, 2023
2 parents 6eb4373 + 618fec9 commit 51acadb
Show file tree
Hide file tree
Showing 121 changed files with 2,061 additions and 11,964 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage-develop-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Prepare for Report Coverage (mini)
run: |
npx nyc report --reporter json-summary --exclude-after-remap false
npx c8 report --reporter json-summary --exclude-after-remap false
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
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 @@ -31,7 +31,7 @@ jobs:

- name: Prepare for Report Coverage (mini)
run: |
npx nyc report --reporter json-summary --exclude-after-remap false
npx c8 report --reporter json-summary --exclude-after-remap false
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Prepare for Report Coverage
run: |
npx nyc report --reporter json-summary --exclude-after-remap false
npx c8 report --reporter json-summary --exclude-after-remap false
npm i svelte-to-html@1.0.9
git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
Expand Down
482 changes: 0 additions & 482 deletions docs/dist/documentation.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"include": ["lib/**/*.js", "types/**/*.js"]
"include": ["lib/**/*.js", "types/**/*.js", "test/**/*.js"],
"compilerOptions": {
"module": "es6",
"target": "esnext"
}
}
16 changes: 8 additions & 8 deletions lib/Builder.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

const TYPE = require('../types/mcdev.d');
const Util = require('./util/util');
const File = require('./util/file');
const config = require('./util/config');
const Cli = require('./util/cli');
const auth = require('./util/auth');
const MetadataTypeInfo = require('./MetadataTypeInfo');
import TYPE from '../types/mcdev.d.js';
import { Util } from './util/util.js';
import File from './util/file.js';
import config from './util/config.js';
import Cli from './util/cli.js';
import auth from './util/auth.js';
import MetadataTypeInfo from './MetadataTypeInfo.js';
// @ts-ignore

/**
Expand Down Expand Up @@ -249,4 +249,4 @@ saved
}
}

module.exports = Builder;
export default Builder;
20 changes: 10 additions & 10 deletions lib/Deployer.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

const TYPE = require('../types/mcdev.d');
const MetadataTypeInfo = require('./MetadataTypeInfo');
const path = require('node:path');
const Cli = require('./util/cli');
const Util = require('./util/util');
const File = require('./util/file');
const config = require('./util/config');
const cache = require('./util/cache');
const auth = require('./util/auth');
import TYPE from '../types/mcdev.d.js';
import MetadataTypeInfo from './MetadataTypeInfo.js';
import path from 'node:path';
import Cli from './util/cli.js';
import { Util } from './util/util.js';
import File from './util/file.js';
import config from './util/config.js';
import cache from './util/cache.js';
import auth from './util/auth.js';

/**
* Reads metadata from local directory and deploys it to specified target business unit.
Expand Down Expand Up @@ -455,4 +455,4 @@ class Deployer {
}
}

module.exports = Deployer;
export default Deployer;
110 changes: 72 additions & 38 deletions lib/MetadataTypeDefinitions.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,78 @@
'use strict';

import asset from './metadataTypes/definitions/Asset.definition.js';
import attributeGroup from './metadataTypes/definitions/AttributeGroup.definition.js';
import attributeSet from './metadataTypes/definitions/AttributeSet.definition.js';
import automation from './metadataTypes/definitions/Automation.definition.js';
import campaign from './metadataTypes/definitions/Campaign.definition.js';
import contentArea from './metadataTypes/definitions/ContentArea.definition.js';
import dataExtension from './metadataTypes/definitions/DataExtension.definition.js';
import dataExtensionField from './metadataTypes/definitions/DataExtensionField.definition.js';
import dataExtensionTemplate from './metadataTypes/definitions/DataExtensionTemplate.definition.js';
import dataExtract from './metadataTypes/definitions/DataExtract.definition.js';
import dataExtractType from './metadataTypes/definitions/DataExtractType.definition.js';
import discovery from './metadataTypes/definitions/Discovery.definition.js';
import email from './metadataTypes/definitions/Email.definition.js';
import emailSend from './metadataTypes/definitions/EmailSend.definition.js';
import event from './metadataTypes/definitions/Event.definition.js';
import fileLocation from './metadataTypes/definitions/FileLocation.definition.js';
import fileTransfer from './metadataTypes/definitions/FileTransfer.definition.js';
import filter from './metadataTypes/definitions/Filter.definition.js';
import folder from './metadataTypes/definitions/Folder.definition.js';
import importFile from './metadataTypes/definitions/ImportFile.definition.js';
import journey from './metadataTypes/definitions/Journey.definition.js';
import list from './metadataTypes/definitions/List.definition.js';
import mobileCode from './metadataTypes/definitions/MobileCode.definition.js';
import mobileKeyword from './metadataTypes/definitions/MobileKeyword.definition.js';
import mobileMessage from './metadataTypes/definitions/MobileMessage.definition.js';
import query from './metadataTypes/definitions/Query.definition.js';
import role from './metadataTypes/definitions/Role.definition.js';
import script from './metadataTypes/definitions/Script.definition.js';
import sendClassification from './metadataTypes/definitions/SendClassification.definition.js';
import transactionalEmail from './metadataTypes/definitions/TransactionalEmail.definition.js';
import transactionalPush from './metadataTypes/definitions/TransactionalPush.definition.js';
import transactionalSMS from './metadataTypes/definitions/TransactionalSMS.definition.js';
import triggeredSend from './metadataTypes/definitions/TriggeredSend.definition.js';
import user from './metadataTypes/definitions/User.definition.js';
import verification from './metadataTypes/definitions/Verification.definition.js';

/**
* Provides access to all metadataType classes
*/
const MetadataTypeDefinitions = {
asset: require('./metadataTypes/definitions/Asset.definition'),
attributeGroup: require('./metadataTypes/definitions/AttributeGroup.definition'),
attributeSet: require('./metadataTypes/definitions/AttributeSet.definition'),
automation: require('./metadataTypes/definitions/Automation.definition'),
campaign: require('./metadataTypes/definitions/Campaign.definition'),
contentArea: require('./metadataTypes/definitions/ContentArea.definition'),
dataExtension: require('./metadataTypes/definitions/DataExtension.definition'),
dataExtensionField: require('./metadataTypes/definitions/DataExtensionField.definition'),
dataExtensionTemplate: require('./metadataTypes/definitions/DataExtensionTemplate.definition'),
dataExtract: require('./metadataTypes/definitions/DataExtract.definition'),
dataExtractType: require('./metadataTypes/definitions/DataExtractType.definition'),
discovery: require('./metadataTypes/definitions/Discovery.definition'),
email: require('./metadataTypes/definitions/Email.definition'),
emailSend: require('./metadataTypes/definitions/EmailSend.definition'),
event: require('./metadataTypes/definitions/Event.definition'),
fileLocation: require('./metadataTypes/definitions/FileLocation.definition'),
fileTransfer: require('./metadataTypes/definitions/FileTransfer.definition'),
filter: require('./metadataTypes/definitions/Filter.definition'),
folder: require('./metadataTypes/definitions/Folder.definition'),
importFile: require('./metadataTypes/definitions/ImportFile.definition'),
journey: require('./metadataTypes/definitions/Journey.definition'),
list: require('./metadataTypes/definitions/List.definition'),
mobileCode: require('./metadataTypes/definitions/MobileCode.definition'),
mobileKeyword: require('./metadataTypes/definitions/MobileKeyword.definition'),
mobileMessage: require('./metadataTypes/definitions/MobileMessage.definition'),
query: require('./metadataTypes/definitions/Query.definition'),
role: require('./metadataTypes/definitions/Role.definition'),
script: require('./metadataTypes/definitions/Script.definition'),
sendClassification: require('./metadataTypes/definitions/SendClassification.definition'),
transactionalEmail: require('./metadataTypes/definitions/TransactionalEmail.definition'),
transactionalPush: require('./metadataTypes/definitions/TransactionalPush.definition'),
transactionalSMS: require('./metadataTypes/definitions/TransactionalSMS.definition'),
triggeredSend: require('./metadataTypes/definitions/TriggeredSend.definition'),
user: require('./metadataTypes/definitions/User.definition'),
verification: require('./metadataTypes/definitions/Verification.definition'),
export default {
asset,
attributeGroup,
attributeSet,
automation,
campaign,
contentArea,
dataExtension,
dataExtensionField,
dataExtensionTemplate,
dataExtract,
dataExtractType,
discovery,
email,
emailSend,
event,
fileLocation,
fileTransfer,
filter,
folder,
importFile,
journey,
list,
mobileCode,
mobileKeyword,
mobileMessage,
query,
role,
script,
sendClassification,
transactionalEmail,
transactionalPush,
transactionalSMS,
triggeredSend,
user,
verification,
};

module.exports = MetadataTypeDefinitions;
108 changes: 72 additions & 36 deletions lib/MetadataTypeInfo.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,80 @@
'use strict';

import asset from './metadataTypes/Asset.js';
import attributeGroup from './metadataTypes/AttributeGroup.js';
import attributeSet from './metadataTypes/AttributeSet.js';
import automation from './metadataTypes/Automation.js';
import campaign from './metadataTypes/Campaign.js';
import contentArea from './metadataTypes/ContentArea.js';
import dataExtension from './metadataTypes/DataExtension.js';
import dataExtensionField from './metadataTypes/DataExtensionField.js';
import dataExtensionTemplate from './metadataTypes/DataExtensionTemplate.js';
import dataExtract from './metadataTypes/DataExtract.js';
import dataExtractType from './metadataTypes/DataExtractType.js';
import discovery from './metadataTypes/Discovery.js';
import email from './metadataTypes/Email.js';
import emailSend from './metadataTypes/EmailSend.js';
import event from './metadataTypes/Event.js';
import fileLocation from './metadataTypes/FileLocation.js';
import fileTransfer from './metadataTypes/FileTransfer.js';
import filter from './metadataTypes/Filter.js';
import folder from './metadataTypes/Folder.js';
import importFile from './metadataTypes/ImportFile.js';
import journey from './metadataTypes/Journey.js';
import list from './metadataTypes/List.js';
import mobileCode from './metadataTypes/MobileCode.js';
import mobileKeyword from './metadataTypes/MobileKeyword.js';
import mobileMessage from './metadataTypes/MobileMessage.js';
import query from './metadataTypes/Query.js';
import role from './metadataTypes/Role.js';
import script from './metadataTypes/Script.js';
import sendClassification from './metadataTypes/SendClassification.js';
import transactionalEmail from './metadataTypes/TransactionalEmail.js';
import transactionalPush from './metadataTypes/TransactionalPush.js';
import transactionalSMS from './metadataTypes/TransactionalSMS.js';
import triggeredSend from './metadataTypes/TriggeredSend.js';
import user from './metadataTypes/User.js';
import verification from './metadataTypes/Verification.js';

/**
* Provides access to all metadataType classes
*/
const MetadataTypeInfo = {
asset: require('./metadataTypes/Asset'),
attributeGroup: require('./metadataTypes/AttributeGroup'),
attributeSet: require('./metadataTypes/AttributeSet'),
automation: require('./metadataTypes/Automation'),
campaign: require('./metadataTypes/Campaign'),
contentArea: require('./metadataTypes/ContentArea'),
dataExtension: require('./metadataTypes/DataExtension'),
dataExtensionField: require('./metadataTypes/DataExtensionField'),
dataExtensionTemplate: require('./metadataTypes/DataExtensionTemplate'),
dataExtract: require('./metadataTypes/DataExtract'),
dataExtractType: require('./metadataTypes/DataExtractType'),
discovery: require('./metadataTypes/Discovery'),
email: require('./metadataTypes/Email'),
emailSend: require('./metadataTypes/EmailSend'),
event: require('./metadataTypes/Event'),
fileLocation: require('./metadataTypes/FileLocation'),
fileTransfer: require('./metadataTypes/FileTransfer'),
filter: require('./metadataTypes/Filter'),
folder: require('./metadataTypes/Folder'),
importFile: require('./metadataTypes/ImportFile'),
journey: require('./metadataTypes/Journey'),
list: require('./metadataTypes/List'),
mobileCode: require('./metadataTypes/MobileCode'),
mobileKeyword: require('./metadataTypes/MobileKeyword'),
mobileMessage: require('./metadataTypes/MobileMessage'),
query: require('./metadataTypes/Query'),
role: require('./metadataTypes/Role'),
script: require('./metadataTypes/Script'),
sendClassification: require('./metadataTypes/SendClassification'),
transactionalEmail: require('./metadataTypes/TransactionalEmail'),
transactionalPush: require('./metadataTypes/TransactionalPush'),
transactionalSMS: require('./metadataTypes/TransactionalSMS'),
triggeredSend: require('./metadataTypes/TriggeredSend'),
user: require('./metadataTypes/User'),
verification: require('./metadataTypes/Verification'),
asset,
attributeGroup,
attributeSet,
automation,
campaign,
contentArea,
dataExtension,
dataExtensionField,
dataExtensionTemplate,
dataExtract,
dataExtractType,
discovery,
email,
emailSend,
event,
fileLocation,
fileTransfer,
filter,
folder,
importFile,
journey,
list,
mobileCode,
mobileKeyword,
mobileMessage,
query,
role,
script,
sendClassification,
transactionalEmail,
transactionalPush,
transactionalSMS,
triggeredSend,
user,
verification,
};

module.exports = MetadataTypeInfo;
export default MetadataTypeInfo;
16 changes: 8 additions & 8 deletions lib/Retriever.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

const TYPE = require('../types/mcdev.d');
const MetadataTypeInfo = require('./MetadataTypeInfo');
const MetadataDefinitions = require('./MetadataTypeDefinitions');
const Util = require('./util/util');
const File = require('./util/file');
const cache = require('./util/cache');
const auth = require('./util/auth');
import TYPE from '../types/mcdev.d.js';
import MetadataTypeInfo from './MetadataTypeInfo.js';
import MetadataDefinitions from './MetadataTypeDefinitions.js';
import { Util } from './util/util.js';
import File from './util/file.js';
import cache from './util/cache.js';
import auth from './util/auth.js';
/**
* Retrieves metadata from a business unit and saves it to the local filesystem.
*/
Expand Down Expand Up @@ -210,4 +210,4 @@ class Retriever {
}
}

module.exports = Retriever;
export default Retriever;
12 changes: 6 additions & 6 deletions lib/cli.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env node
'use strict';

/**
* CLI entry for SFMC DevTools
*/

const Util = require('./util/util');
const yargs = require('yargs');
const Mcdev = require('./index');
import { Util } from './util/util.js';

yargs
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import Mcdev from './index.js';
yargs(hideBin(process.argv))
.scriptName('mcdev')
.usage('$0 <command> [options]')
.command({
Expand Down Expand Up @@ -600,7 +600,7 @@ yargs
.demandCommand(1, 'Please enter a valid command')
.strict()
.recommendCommands()
.wrap(yargs.terminalWidth())
.wrap(yargs(hideBin(process.argv)).terminalWidth())
.epilog(
'Copyright 2023. Accenture. Get support at https://github.com/Accenture/sfmc-devtools/issues'
)
Expand Down
Loading

0 comments on commit 51acadb

Please sign in to comment.