Skip to content

Commit

Permalink
fix: ACNA-1687 | fixed option skipInstall for appGen, extGen, addActi…
Browse files Browse the repository at this point in the history
…onGen
  • Loading branch information
arjuncooliitr committed Jul 25, 2022
1 parent ac0cd12 commit 341f25d
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 63 deletions.
5 changes: 3 additions & 2 deletions src/commands/app/add/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ class AddActionCommand extends AddCommand {
const supportedOrgServices = aioConfigLoader.get('project.org.details.services') || []

const env = yeoman.createEnv()
env.options = { skipInstall: true }
const addActionGen = env.instantiate(generators['add-action'], {
options: {
'skip-prompt': flags.yes,
'action-folder': actionFolder,
'config-path': configData.file,
'adobe-services': servicesToGeneratorInput(workspaceServices),
'supported-adobe-services': servicesToGeneratorInput(supportedOrgServices),
'full-key-to-manifest': configData.key,
'full-key-to-manifest': configData.key
// force: true,
// by default yeoman runs the install, we control installation from the app plugin
'skip-install': true
// Moving ['skip-install': true] to env.options due to yeoman environment issue https://github.com/yeoman/environment/issues/421
}
})
await env.runGenerator(addActionGen)
Expand Down
10 changes: 6 additions & 4 deletions src/commands/app/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,16 @@ class InitCommand extends AddCommand {

async runCodeGenerators (flags, extensionPoints, projectName) {
let env = yeoman.createEnv()
env.options = { skipInstall: true }
const initialGenerators = ['base-app', 'add-ci']
// first run app generator that will generate the root skeleton + ci
for (const generatorKey of initialGenerators) {
const appGen = env.instantiate(generators[generatorKey], {
options: {
'skip-prompt': flags.yes,
'project-name': projectName,
'project-name': projectName
// by default yeoman runs the install, we control installation from the app plugin
'skip-install': true
// Moving ['skip-install': true] to env.options due to yeoman environment issue https://github.com/yeoman/environment/issues/421
}
})
await env.runGenerator(appGen)
Expand All @@ -289,6 +290,7 @@ class InitCommand extends AddCommand {
// https://github.com/yeoman/environment/issues/324

env = yeoman.createEnv()
env.options = { skipInstall: true }
// try to use appGen.composeWith
for (let i = 0; i < extensionPoints.length; ++i) {
const extGen = env.instantiate(
Expand All @@ -297,9 +299,9 @@ class InitCommand extends AddCommand {
options: {
'skip-prompt': flags.yes,
// do not prompt for overwrites
force: true,
force: true
// by default yeoman runs the install, we control installation from the app plugin
'skip-install': true
// Moving ['skip-install': true] to env.options due to yeoman environment issue https://github.com/yeoman/environment/issues/421
}
})
await env.runGenerator(extGen)
Expand Down
21 changes: 7 additions & 14 deletions test/commands/app/add/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': undefined,
'supported-adobe-services': undefined,
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
expect(mockRunGenerator).toHaveBeenCalledWith('actionGen')
Expand All @@ -120,8 +119,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': undefined,
'supported-adobe-services': undefined,
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
expect(helpers.installPackages).toHaveBeenCalledTimes(0)
Expand All @@ -139,8 +137,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': undefined,
'supported-adobe-services': undefined,
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
})
Expand All @@ -157,8 +154,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': undefined,
'supported-adobe-services': undefined,
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
})
Expand All @@ -174,8 +170,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': undefined,
'supported-adobe-services': undefined,
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
})
Expand Down Expand Up @@ -203,8 +198,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': 'CampaignSDK,AdobeAnalyticsSDK',
'supported-adobe-services': 'CampaignSDK,AdobeAnalyticsSDK,AnotherOneSDK',
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
})
Expand Down Expand Up @@ -232,8 +226,7 @@ describe('good flags', () => {
'config-path': undefined,
'adobe-services': 'CampaignSDK,AdobeAnalyticsSDK',
'supported-adobe-services': 'CampaignSDK,AdobeAnalyticsSDK,AnotherOneSDK',
'full-key-to-manifest': 'undefined.runtimeManifest',
'skip-install': true
'full-key-to-manifest': 'undefined.runtimeManifest'
}
})
})
Expand Down
Loading

0 comments on commit 341f25d

Please sign in to comment.