Skip to content

Commit

Permalink
chore(deps): update package.json adobe dependencies, remove audience …
Browse files Browse the repository at this point in the history
…manager usage
  • Loading branch information
shazron committed Jan 12, 2024
1 parent b0a1685 commit 3aa188c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 51 deletions.
7 changes: 2 additions & 5 deletions generators/add-action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const target = require('@adobe/generator-add-action-target')
const analytics = require('@adobe/generator-add-action-analytics')
const campaign = require('@adobe/generator-add-action-campaign-standard')
const customerProfile = require('@adobe/generator-add-action-customer-profile')
const audienceManagerCD = require('@adobe/generator-add-action-audience-manager-cd')

const inquirer = require('inquirer')

Expand All @@ -31,17 +30,15 @@ const sdkCodeToActionGenerator = {
[sdkCodes.analytics]: analytics,
[sdkCodes.campaign]: campaign,
[sdkCodes.assetCompute]: assetCompute,
[sdkCodes.customerProfile]: customerProfile,
[sdkCodes.audienceManagerCD]: audienceManagerCD
[sdkCodes.customerProfile]: customerProfile
}

const sdkCodeToTitle = {
[sdkCodes.target]: 'Adobe Target',
[sdkCodes.analytics]: 'Adobe Analytics',
[sdkCodes.campaign]: 'Adobe Campaign Standard',
[sdkCodes.assetCompute]: 'Adobe Asset Compute Worker',
[sdkCodes.customerProfile]: 'Adobe Experience Platform: Realtime Customer Profile',
[sdkCodes.audienceManagerCD]: 'Adobe Audience Manager: Customer Data'
[sdkCodes.customerProfile]: 'Adobe Experience Platform: Realtime Customer Profile'
}

/*
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,18 @@
"yeoman-test": "^6.0.0"
},
"dependencies": {
"@adobe/aio-lib-env": "^2.0.0",
"@adobe/generator-add-action-analytics": "^0.1.1",
"@adobe/generator-add-action-asset-compute": "^1.0.0",
"@adobe/generator-add-action-audience-manager-cd": "^0.1.1",
"@adobe/generator-add-action-campaign-standard": "^0.1.1",
"@adobe/generator-add-action-customer-profile": "^0.1.1",
"@adobe/generator-add-action-generic": "^0.2.2",
"@adobe/generator-add-action-target": "^0.1.1",
"@adobe/generator-add-web-assets-exc-raw-html": "^0.2.1",
"@adobe/generator-add-web-assets-exc-react": "^0.2.1",
"@adobe/generator-app-asset-compute": "^1.0.0",
"@adobe/generator-app-common-lib": "^1.0.0",
"@adobe/generator-app-excshell": "^0.2.0",
"@adobe/aio-lib-env": "^3",
"@adobe/generator-add-action-analytics": "^1",
"@adobe/generator-add-action-campaign-standard": "^1",
"@adobe/generator-add-action-customer-profile": "^1",
"@adobe/generator-add-action-target": "^1",
"@adobe/generator-add-action-generic": "^1",
"@adobe/generator-add-action-asset-compute": "^2",
"@adobe/generator-add-web-assets-exc-raw-html": "^1",
"@adobe/generator-add-web-assets-exc-react": "^1",
"@adobe/generator-app-asset-compute": "^2",
"@adobe/generator-app-common-lib": "^2",
"@adobe/generator-app-excshell": "^1",
"fs-extra": "^11.1.1",
"inquirer": "^8",
"js-yaml": "^4",
Expand Down
50 changes: 17 additions & 33 deletions test/generators/add-action/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ governing permissions and limitations under the License.
*/
const helpers = require('yeoman-test')

const { utils } = require('@adobe/generator-app-common-lib')
const { utils, constants } = require('@adobe/generator-app-common-lib')
const AddActions = require('../../../generators/add-action')
const Generator = require('yeoman-generator')
const { constants } = require('@adobe/generator-app-common-lib')
const { sdkCodes } = constants
const cloneDeep = require('lodash.clonedeep')

Expand All @@ -23,7 +22,6 @@ const target = require('@adobe/generator-add-action-target')
const analytics = require('@adobe/generator-add-action-analytics')
const campaign = require('@adobe/generator-add-action-campaign-standard')
const customerProfile = require('@adobe/generator-add-action-customer-profile')
const audienceManagerCD = require('@adobe/generator-add-action-audience-manager-cd')

const expectedSeparator = expect.objectContaining({
type: 'separator',
Expand Down Expand Up @@ -53,10 +51,6 @@ const expectedChoices = {
[sdkCodes.customerProfile]: {
name: 'Adobe Experience Platform: Realtime Customer Profile',
value: customerProfile
},
[sdkCodes.audienceManagerCD]: {
name: 'Adobe Audience Manager: Customer Data',
value: audienceManagerCD
}
}

Expand Down Expand Up @@ -113,8 +107,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.customerProfile], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.target], checked: false }
]
})
])
Expand All @@ -140,8 +133,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.customerProfile], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.target], checked: false }
]
})
])
Expand Down Expand Up @@ -171,8 +163,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.customerProfile], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.target], checked: false }
]
})
])
Expand Down Expand Up @@ -202,8 +193,7 @@ describe('run', () => {
expectedSeparator,
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.target], checked: false }
]
})
])
Expand Down Expand Up @@ -235,8 +225,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
expectedSeparator,
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.campaign], checked: false }
]
})
])
Expand All @@ -249,7 +238,7 @@ describe('run', () => {
test('--adobe-services="analytics,customerProfile", supported-adobe-services=ALL', async () => {
const options = cloneDeep(global.basicGeneratorOptions)
options['adobe-services'] = `${sdkCodes.analytics},${sdkCodes.customerProfile}`
options['supported-adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target},${sdkCodes.audienceManagerCD}`
options['supported-adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target}`
await helpers.run(AddActions)
.withOptions(options)
.withPrompts({ actionGenerators: ['a', 'b', 'c'] })
Expand All @@ -268,8 +257,7 @@ describe('run', () => {
expectedSeparator,
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.target], checked: false }
]
})
])
Expand All @@ -281,8 +269,8 @@ describe('run', () => {

test('--adobe-services=ALL, supported-adobe-services=ALL', async () => {
const options = cloneDeep(global.basicGeneratorOptions)
options['adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target},${sdkCodes.audienceManagerCD}`
options['supported-adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target},${sdkCodes.audienceManagerCD}`
options['adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target}`
options['supported-adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target}`
await helpers.run(AddActions)
.withOptions(options)
.withPrompts({ actionGenerators: ['a', 'b', 'c'] })
Expand All @@ -300,8 +288,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: true },
{ ...expectedChoices[sdkCodes.customerProfile], checked: true },
{ ...expectedChoices[sdkCodes.campaign], checked: true },
{ ...expectedChoices[sdkCodes.target], checked: true },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: true }
{ ...expectedChoices[sdkCodes.target], checked: true }
]
})
])
Expand All @@ -313,10 +300,10 @@ describe('run', () => {

test('--adobe-services=ALL', async () => {
const options = cloneDeep(global.basicGeneratorOptions)
options['adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target},${sdkCodes.audienceManagerCD}`
options['adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target}`
await helpers.run(AddActions)
.withOptions({
'adobe-services': `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target},${sdkCodes.audienceManagerCD}`
'adobe-services': `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target}`
})
.withPrompts({ actionGenerators: ['a', 'b', 'c'] })

Expand All @@ -333,8 +320,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: true },
{ ...expectedChoices[sdkCodes.customerProfile], checked: true },
{ ...expectedChoices[sdkCodes.campaign], checked: true },
{ ...expectedChoices[sdkCodes.target], checked: true },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: true }
{ ...expectedChoices[sdkCodes.target], checked: true }
]
})
])
Expand Down Expand Up @@ -367,8 +353,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.customerProfile], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
expectedSeparator,
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.campaign], checked: false }
]
})
])
Expand All @@ -381,7 +366,7 @@ describe('run', () => {
test('--adobe-services="", supported-adobe-services=ALL', async () => {
const options = cloneDeep(global.basicGeneratorOptions)
options['adobe-services'] = ''
options['supported-adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target},${sdkCodes.audienceManagerCD}`
options['supported-adobe-services'] = `${sdkCodes.analytics},${sdkCodes.assetCompute},${sdkCodes.customerProfile},${sdkCodes.campaign},${sdkCodes.target}`
await helpers.run(AddActions)
.withOptions(options)
.withPrompts({ actionGenerators: ['a', 'b', 'c'] })
Expand All @@ -400,8 +385,7 @@ describe('run', () => {
{ ...expectedChoices[sdkCodes.assetCompute], checked: false },
{ ...expectedChoices[sdkCodes.customerProfile], checked: false },
{ ...expectedChoices[sdkCodes.campaign], checked: false },
{ ...expectedChoices[sdkCodes.target], checked: false },
{ ...expectedChoices[sdkCodes.audienceManagerCD], checked: false }
{ ...expectedChoices[sdkCodes.target], checked: false }
]
})
])
Expand Down

0 comments on commit 3aa188c

Please sign in to comment.