file copyright author Vivek M. Chawla <@VivekMChawla>
 *  summary description version license import * as path from 'path' ; import * as iq from '../modules/sfdx-falcon-util/interview-questions' ; import * as listrTasks from '../modules/sfdx-falcon-util/listr-tasks' ; import { SfdxFalconDebug } from '../modules/sfdx-falcon-debug' ; import { SfdxFalconError } from '../modules/sfdx-falcon-error' ; import { SfdxFalconInterview } from '../modules/sfdx-falcon-interview' ; import { SfdxFalconResult } from '../modules/sfdx-falcon-result' ; import { SfdxFalconKeyValueTableDataRow } from '../modules/sfdx-falcon-util/ux' ; import { SfdxFalconTableData } from '../modules/sfdx-falcon-util/ux' ; import { GeneratorOptions } from '../modules/sfdx-falcon-yeoman-command' ; import { SfdxFalconYeomanGenerator } from '../modules/sfdx-falcon-yeoman-generator' ; import { YeomanChoice } from '../modules/sfdx-falcon-types' ; import { SfdxOrgInfoMap } from '../modules/sfdx-falcon-types' ; const chalk = require ( 'chalk' ) ; const dbgNs = 'GENERATOR:create-appx-package:' ; interface description interface InterviewAnswers { projectFamily : 'APK' | 'ADK' ; projectType : '1GP:managed' | '1GP:unmanaged' | '2GP:managed' | '2GP:unlocked' ; projectVersion : string ; targetDirectory : string ; developerName : string ; developerAlias : string ; projectName : string ; projectAlias : string ; packageDirectory : string ; defaultRecipe : string ; devHubAlias : string ; envHubAlias : string ; pkgOrgAlias : string ; devHubUsername : string ; envHubUsername : string ; pkgOrgUsername : string ; scratchDefOrgName : string ; scratchDefDescription : string ; isInitializingGit : boolean ; hasGitRemote : boolean ; isGitRemoteReachable : boolean ; ackGitRemoteUnreachable : boolean ; gitRemoteUri : string ; gitHubUrl : string ; schemaVersion : string ; pluginVersion : string ; sfdcApiVersion : string ; pkgOrgExists : boolean ; packageName : string ; namespacePrefix : string ; metadataPackageId : string ; packageVersionIdBeta : string ; packageVersionIdRelease : string ; } class extends SfdxFalconYeomanGenerator summary description public export default class CreateAppxPackageProject extends SfdxFalconYeomanGenerator < InterviewAnswers > { protected devHubAliasChoices : YeomanChoice [ ] ; protected envHubAliasChoices : YeomanChoice [ ] ; protected pkgOrgAliasChoices : YeomanChoice [ ] ; protected managedPkgOrgAliasChoices : YeomanChoice [ ] ; protected unmanagedPkgOrgAliasChoices : YeomanChoice [ ] ; protected sourceDirectory : string ; constructs param { string | string [ ] } args param { GeneratorOptions } opts description public constructor ( args , opts ) { super ( args , opts ) ; this . confirmationQuestion = 'Create a new AppExchange Package Kit (APK) project using the above settings?' ; this . sourceDirectory = require . resolve ( 'sfdx-falcon-appx-package-kit' ) ; this . devHubAliasChoices = new Array < YeomanChoice > ( ) ; this . envHubAliasChoices = new Array < YeomanChoice > ( ) ; this . pkgOrgAliasChoices = new Array < YeomanChoice > ( ) ; this . managedPkgOrgAliasChoices = new Array < YeomanChoice > ( ) ; this . unmanagedPkgOrgAliasChoices = new Array < YeomanChoice > ( ) ; this . defaultAnswers . projectFamily = 'APK' ; this . defaultAnswers . projectType = '1GP:managed' ; this . defaultAnswers . projectVersion = '0.0.1' ; this . defaultAnswers . targetDirectory = path . resolve ( opts . outputDir as string ) ; this . defaultAnswers . developerName = 'Universal Containers' ; this . defaultAnswers . developerAlias = 'univ-ctrs' ; this . defaultAnswers . projectName = 'Universal Containers Packaged App' ; this . defaultAnswers . projectAlias = 'uc-pkgd-app' ; this . defaultAnswers . packageDirectory = 'force-app' ; this . defaultAnswers . defaultRecipe = 'build-scratch-org.json' ; this . defaultAnswers . devHubAlias = 'NOT_SPECIFIED' ; this . defaultAnswers . envHubAlias = 'NOT_SPECIFIED' ; this . defaultAnswers . pkgOrgAlias = 'NOT_SPECIFIED' ; this . defaultAnswers . devHubUsername = 'NOT_SPECIFIED' ; this . defaultAnswers . envHubUsername = 'NOT_SPECIFIED' ; this . defaultAnswers . pkgOrgUsername = 'NOT_SPECIFIED' ; this . defaultAnswers . scratchDefOrgName = 'APK Build Org' ; this . defaultAnswers . scratchDefDescription = 'APK Build Org' ; this . defaultAnswers . isInitializingGit = true ; this . defaultAnswers . hasGitRemote = true ; this . defaultAnswers . isGitRemoteReachable = false ; this . defaultAnswers . ackGitRemoteUnreachable = false ; this . defaultAnswers . gitRemoteUri = 'https://github.com/my-org/my-repo.git' ; this . defaultAnswers . gitHubUrl = 'https://github.com/my-org/my-repo' ; this . defaultAnswers . schemaVersion = '0.0.1' ; this . defaultAnswers . sfdcApiVersion = this . sfdcApiVersion ; this . defaultAnswers . pluginVersion = this . pluginVersion ; this . defaultAnswers . pkgOrgExists = false ; this . defaultAnswers . packageName = 'My Managed Package' ; this . defaultAnswers . namespacePrefix = 'my_ns_prefix' ; this . defaultAnswers . metadataPackageId = '033000000000000' ; this . defaultAnswers . packageVersionIdBeta = '04t000000000000' ; this . defaultAnswers . packageVersionIdRelease = '04t000000000000' ; this . metaAnswers . devHubAlias = `<%-finalAnswers.devHubAlias%>` ; this . metaAnswers . envHubAlias = `<%-finalAnswers.envHubAlias%>` ; this . metaAnswers . pkgOrgAlias = `<%-finalAnswers.pkgOrgAlias%>` ; this . sharedData [ 'devHubAliasChoices' ] = this . devHubAliasChoices ; this . sharedData [ 'envHubAliasChoices' ] = this . envHubAliasChoices ; this . sharedData [ 'pkgOrgAliasChoices' ] = this . pkgOrgAliasChoices ; this . sharedData [ 'managedPkgOrgAliasChoices' ] = this . managedPkgOrgAliasChoices ; this . sharedData [ 'unmanagedPkgOrgAliasChoices' ] = this . unmanagedPkgOrgAliasChoices ; this . sharedData [ 'cliCommandName' ] = this . cliCommandName ; } method returns { SfdxFalconInterview < InterviewAnswers > } description protected protected _buildInterview ( ) { const interview = new SfdxFalconInterview < InterviewAnswers > ( { defaultAnswers : this . defaultAnswers , confirmation : iq . confirmProceedRestart , confirmationHeader : chalk . yellow ( 'Review Your Settings:' ) , display : this . _buildInterviewAnswersTableData , context : this , sharedData : this . sharedData } ) ; interview . createGroup ( { title : chalk . yellow ( '\nTarget Directory:' ) , questions : iq . provideTargetDirectory } ) ; interview . createGroup ( { title : chalk . yellow ( '\nProject Type Selection:' ) , questions : iq . choosePkgProjectType , confirmation : iq . confirmNoPkgOrg , abort : groupAnswers => { if ( String ( groupAnswers . projectType ) . startsWith ( '1GP:' ) && groupAnswers . pkgOrgExists === false ) { return 'A Packaging Org is required for 1GP projects' ; } else { return false ; } } } ) ; interview . createGroup ( { title : chalk . yellow ( '\nPackaging Org Selection:' ) , questions : iq . choosePkgOrg , confirmation : iq . confirmNoPkgOrgConnection , when : userAnswers => { return String ( userAnswers . projectType ) . startsWith ( '1GP:' ) ; } , abort : groupAnswers => { if ( groupAnswers . pkgOrgUsername === 'NOT_SPECIFIED' ) { return 'A connection to your packaging org is required for 1GP package projects.' ; } else { return false ; } } } ) ; interview . createGroup ( { title : chalk . yellow ( '\nDevHub Selection:' ) , questions : iq . chooseDevHub , confirmation : iq . confirmNoDevHub , abort : groupAnswers => { if ( groupAnswers . devHubUsername === 'NOT_SPECIFIED' ) { return 'A connection to your DevHub is required to continue.' ; } else { return false ; } } } ) ; interview . createGroup ( { title : chalk . yellow ( '\nEnvironment Hub Selection:' ) , questions : iq . chooseEnvHub , confirmation : iq . confirmNoEnvHub } ) ; interview . createGroup ( { title : chalk . yellow ( '\nDeveloper Info:' ) , questions : iq . provideDeveloperInfo } ) ; interview . createGroup ( { title : chalk . yellow ( '\nProject Info:' ) , questions : iq . provideProjectInfo } ) ; interview . createGroup ( { title : chalk . yellow ( '\nGit Configuration:' ) , questions : iq . provideGitRemote , confirmation : iq . confirmNoGitHubRepo , invertConfirmation : true } ) ; return interview ; } method param { InterviewAnswers } userAnswers returns { Promise < SfdxFalconTableData > } description protected async protected async _buildInterviewAnswersTableData ( interviewAnswers ) { const tableData = new Array < SfdxFalconKeyValueTableDataRow > ( ) ; const sfdxOrgInfoMap = this . sharedData [ 'sfdxOrgInfoMap' ] as SfdxOrgInfoMap ; tableData . push ( { option : 'Target Directory:' , value : `${ interviewAnswers . targetDirectory }` } ) ; tableData . push ( { option : 'Project Type:' , value : `${ interviewAnswers . projectType }` } ) ; switch ( interviewAnswers . projectType ) { case '1GP:managed' : const latestManagedReleasedPkgVersion = sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) . latestManagedReleasedPkgVersion ; const latestManagedBetaPkgVersion = sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) . latestManagedBetaPkgVersion ; const latestManagedReleasedPkgVersionId = latestManagedReleasedPkgVersion ? latestManagedReleasedPkgVersion . Id : 'UNAVAILABLE' ; const latestManagedBetaPkgVersionId = latestManagedBetaPkgVersion ? latestManagedBetaPkgVersion . Id : 'UNAVAILABLE' ; tableData . push ( { option : 'Namespace Prefix:' , value : `${ sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) . nsPrefix }` } ) ; tableData . push ( { option : 'Package Name:' , value : `${ sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) . managedPkgName }` } ) ; tableData . push ( { option : 'Metadata Package ID:' , value : `${ sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) . managedPkgId }` } ) ; tableData . push ( { option : 'Latest Release Pkg ID:' , value : `${ latestManagedReleasedPkgVersionId }` } ) ; tableData . push ( { option : 'Latest Beta Pkg ID:' , value : `${ latestManagedBetaPkgVersionId }` } ) ; break ; case '1GP:unmanaged' : tableData . push ( { option : 'Package Name:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Metadata Package ID:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Package Version ID:' , value : `NOT_IMPLEMENTED` } ) ; break ; case '2GP:managed' : tableData . push ( { option : 'Namespace Prefix:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Package Name:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Metadata Package ID:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Package Version ID:' , value : `NOT_IMPLEMENTED` } ) ; break ; case '2GP:unlocked' : tableData . push ( { option : 'Namespace Prefix:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Package Name:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Metadata Package ID:' , value : `NOT_IMPLEMENTED` } ) ; tableData . push ( { option : 'Package Version ID:' , value : `NOT_IMPLEMENTED` } ) ; break ; } const pkgOrgAlias = sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) ? sfdxOrgInfoMap . get ( interviewAnswers . pkgOrgUsername ) . alias : 'NOT_SPECIFIED' ; tableData . push ( { option : 'Pkg Org Alias:' , value : `${ pkgOrgAlias }` } ) ; const devHubAlias = sfdxOrgInfoMap . get ( interviewAnswers . devHubUsername ) ? sfdxOrgInfoMap . get ( interviewAnswers . devHubUsername ) . alias : 'NOT_SPECIFIED' ; tableData . push ( { option : 'Dev Hub Alias:' , value : `${ devHubAlias }` } ) ; const envHubAlias = sfdxOrgInfoMap . get ( interviewAnswers . envHubUsername ) ? sfdxOrgInfoMap . get ( interviewAnswers . envHubUsername ) . alias : 'NOT_SPECIFIED' ; tableData . push ( { option : 'Env Hub Alias:' , value : `${ envHubAlias }` } ) ; tableData . push ( { option : 'Developer Name:' , value : `${ interviewAnswers . developerName }` } ) ; tableData . push ( { option : 'Developer Alias:' , value : `${ interviewAnswers . developerAlias }` } ) ; tableData . push ( { option : 'Project Name:' , value : `${ interviewAnswers . projectName }` } ) ; tableData . push ( { option : 'Project Alias:' , value : `${ interviewAnswers . projectAlias }` } ) ; tableData . push ( { option : 'Initialize Git:' , value : `${ interviewAnswers . isInitializingGit ? 'Yes' : 'No' }` } ) ; if ( interviewAnswers . hasGitRemote && interviewAnswers . isInitializingGit ) { tableData . push ( { option : 'Git Remote URI:' , value : `${ interviewAnswers . gitRemoteUri }` } ) ; if ( interviewAnswers . isGitRemoteReachable ) { tableData . push ( { option : 'Git Remote Status:' , value : `${ chalk . blue ( 'AVAILABLE' ) }` } ) ; } else { tableData . push ( { option : 'Git Remote Status:' , value : `${ chalk . red ( 'UNREACHABLE' ) }` } ) ; } } return tableData ; } method returns { Promise < boolean > } description protected async protected async _fetchAndConvertManagedPackage ( ) { const fetchAndConvertManagedPackage = listrTasks . fetchAndConvertManagedPackage . call ( this , this . finalAnswers . pkgOrgAlias , new Array ( [ this . finalAnswers . packageName ] ) , this . destinationRoot ( ) , this . finalAnswers . packageDirectory ) ; console . log ( chalk `{yellow Fetching managed package and converting LOCAL source to SFDX format...}` ) ; const pkgConversionResults = await fetchAndConvertManagedPackage . run ( ) . catch ( utilityResult => { SfdxFalconDebug . obj ( `${ dbgNs }_fetchPackagedMetadata:utilityResult:` , utilityResult , `utilityResult: ` ) ; if ( utilityResult instanceof Error ) { throw utilityResult ; } if ( utilityResult instanceof SfdxFalconResult ) { throw new SfdxFalconError ( `Conversion of "classic" packaging project to SFDX packaging project failed.` , `PackageConversionError` , `${ dbgNs }:_fetchPackagedMetadata` , utilityResult . errObj ) ; } throw SfdxFalconError . wrap ( utilityResult ) ; } ) ; SfdxFalconDebug . obj ( `${ dbgNs }_fetchPackagedMetadata:pkgConversionResults:` , pkgConversionResults , `pkgConversionResults: ` ) ; this . generatorStatus . addMessage ( { type : 'success' , title : `Package Conversion` , message : `Success - Package successfully retrieved from Salesforce and converted` } ) ; console . log ( '' ) ; return true ; } method returns { Promise < void > } description protected async protected async initializing ( ) { return this . _default_initializing ( ) ; } method returns { Promise < void > } description protected async protected async prompting ( ) { console . log ( chalk `{yellow Starting APK project creation interview...}` ) ; return this . _default_prompting ( ) ; } method returns { void } description protected protected configuring ( ) { return this . _default_configuring ( ) ; } method returns { void } description protected protected writing ( ) { if ( this . generatorStatus . aborted ) { SfdxFalconDebug . msg ( `${ dbgNs }writing:` , `generatorStatus.aborted found as TRUE inside writing()` ) ; return ; } const sfdxOrgInfoMap = this . sharedData [ 'sfdxOrgInfoMap' ] as SfdxOrgInfoMap ; const selectedPackage = sfdxOrgInfoMap . get ( this . finalAnswers . pkgOrgUsername ) ; this . finalAnswers . scratchDefOrgName = `${ this . finalAnswers . projectName } - Developer Build` ; this . finalAnswers . scratchDefDescription = `API Developer Build Org` ; this . finalAnswers . devHubAlias = sfdxOrgInfoMap . get ( this . finalAnswers . devHubUsername ) ? sfdxOrgInfoMap . get ( this . finalAnswers . devHubUsername ) . alias : 'NOT_SPECIFIED' ; this . finalAnswers . envHubAlias = sfdxOrgInfoMap . get ( this . finalAnswers . envHubUsername ) ? sfdxOrgInfoMap . get ( this . finalAnswers . envHubUsername ) . alias : 'NOT_SPECIFIED' ; this . finalAnswers . pkgOrgAlias = sfdxOrgInfoMap . get ( this . finalAnswers . pkgOrgUsername ) ? sfdxOrgInfoMap . get ( this . finalAnswers . pkgOrgUsername ) . alias : 'NOT_SPECIFIED' ; switch ( this . finalAnswers . projectType ) { case '1GP:managed' : const latestManagedReleasedPkgVersionId = selectedPackage . latestManagedReleasedPkgVersion ? selectedPackage . latestManagedReleasedPkgVersion . Id : 'UNAVAILABLE' ; const latestManagedBetaPkgVersionId = selectedPackage . latestManagedBetaPkgVersion ? selectedPackage . latestManagedBetaPkgVersion . Id : 'UNAVAILABLE' ; this . finalAnswers . namespacePrefix = selectedPackage . nsPrefix ; this . finalAnswers . packageName = selectedPackage . managedPkgName ; this . finalAnswers . metadataPackageId = selectedPackage . managedPkgId ; this . finalAnswers . packageVersionIdRelease = latestManagedReleasedPkgVersionId ; this . finalAnswers . packageVersionIdBeta = latestManagedBetaPkgVersionId ; this . finalAnswers . packageDirectory = this . finalAnswers . namespacePrefix ; break ; case '1GP:unmanaged' : this . finalAnswers . packageDirectory = 'NOT_YET_IMPLENTED' ; break ; case '2GP:managed' : this . finalAnswers . packageDirectory = 'NOT_YET_IMPLENTED' ; break ; case '2GP:unlocked' : this . finalAnswers . packageDirectory = 'NOT_YET_IMPLENTED' ; break ; default : throw new SfdxFalconError ( `Invalid Project Type: '${ this . finalAnswers . projectType }'. ` , `InvalidProjectType` , `${ dbgNs }writing` ) ; } this . sourceRoot ( path . dirname ( this . sourceDirectory ) ) ; this . destinationRoot ( path . resolve ( this . finalAnswers . targetDirectory , this . finalAnswers . projectAlias ) ) ; SfdxFalconDebug . str ( `${ dbgNs }writing:sourceRoot:` , this . sourceRoot ( ) , `this.sourceRoot(): ` ) ; SfdxFalconDebug . str ( `${ dbgNs }writing:destinationRoot:` , this . destinationRoot ( ) , `this.destinationRoot(): ` ) ; this . log ( chalk `{yellow Writing project files to ${ this . destinationRoot ( ) }...}` ) ; this . fs . copyTpl ( this . templatePath ( '.circleci' ) , this . destinationPath ( '.circleci' ) , this ) ; this . fs . copyTpl ( this . templatePath ( '.templates' ) , this . destinationPath ( '.templates' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'config' ) , this . destinationPath ( 'config' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'data' ) , this . destinationPath ( 'data' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'docs' ) , this . destinationPath ( 'docs' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'mdapi-source' ) , this . destinationPath ( 'mdapi-source' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'temp' ) , this . destinationPath ( 'temp' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'tools' ) , this . destinationPath ( 'tools' ) , this ) ; this . fs . copyTpl ( this . templatePath ( '.forceignore' ) , this . destinationPath ( '.forceignore' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'README.md' ) , this . destinationPath ( 'README.md' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'LICENSE' ) , this . destinationPath ( 'LICENSE' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'sfdx-project.json' ) , this . destinationPath ( 'sfdx-project.json' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'sfdx-source/my_ns_prefix' ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }` ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'sfdx-source/unpackaged' ) , this . destinationPath ( 'sfdx-source/unpackaged' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'sfdx-source/untracked' ) , this . destinationPath ( 'sfdx-source/untracked' ) , this ) ; let ignoreFile = '.gitignore' ; try { this . fs . read ( this . templatePath ( '.gitignore' ) ) ; } catch { ignoreFile = '.npmignore' ; } this . fs . copyTpl ( this . templatePath ( `${ ignoreFile }` ) , this . destinationPath ( '.gitignore' ) , this ) ; this . fs . copyTpl ( this . templatePath ( `tools/${ ignoreFile }` ) , this . destinationPath ( 'tools/.gitignore' ) , this ) ; this . fs . copyTpl ( this . templatePath ( `mdapi-source/${ ignoreFile }` ) , this . destinationPath ( 'mdapi-source/.gitignore' ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/aura/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/aura/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/classes/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/classes/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/layouts/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/layouts/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/objects/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/objects/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/permissionsets/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/permissionsets/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/profiles/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/profiles/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/remoteSiteSettings/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/remoteSiteSettings/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/tabs/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/tabs/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `sfdx-source/my_ns_prefix/main/default/triggers/${ ignoreFile }` ) , this . destinationPath ( `sfdx-source/${ this . finalAnswers . packageDirectory }/main/default/triggers/.gitignore` ) , this ) ; this . fs . copyTpl ( this . templatePath ( `temp/${ ignoreFile }` ) , this . destinationPath ( 'temp/.gitignore' ) , this ) ; this . metaAnswers . devHubAlias = this . finalAnswers . devHubAlias ; this . metaAnswers . envHubAlias = this . finalAnswers . envHubAlias ; this . metaAnswers . pkgOrgAlias = this . finalAnswers . pkgOrgAlias ; this . fs . copyTpl ( this . templatePath ( '.templates/sfdx-falcon-config.json.ejs' ) , this . destinationPath ( '.sfdx-falcon/sfdx-falcon-config.json' ) , this ) ; this . fs . copyTpl ( this . templatePath ( 'tools/templates/local-config-template.sh.ejs' ) , this . destinationPath ( 'tools/lib/local-config.sh' ) , this ) ; return ; } method returns { void } description protected async protected async install ( ) { if ( this . _finalizeProjectCreation ( ) !== true ) { return ; } switch ( this . finalAnswers . projectType ) { case '1GP:managed' : if ( await this . _fetchAndConvertManagedPackage ( ) ) { await this . _finalizeGitActions ( this . destinationRoot ( ) , this . finalAnswers . isInitializingGit , this . finalAnswers . hasGitRemote ? this . finalAnswers . gitRemoteUri : '' , this . finalAnswers . projectAlias ) ; } else { this . installComplete = false ; this . generatorStatus . addMessage ( { type : 'warning' , title : `Fetch/Convert Project` , message : `Warning - Could not fetch/convert your managed package` } ) ; this . generatorStatus . addMessage ( { type : 'warning' , title : `Git Initialzation` , message : `Warning - Git initialization skipped since managed package was not fetched/converted` } ) ; } return ; case '1GP:unmanaged' : console . log ( `NOT_YET_IMPLENTED: ${ this . finalAnswers . projectType }` ) ; return ; case '2GP:managed' : console . log ( `NOT_YET_IMPLENTED: ${ this . finalAnswers . projectType }` ) ; return ; case '2GP:unlocked' : console . log ( `NOT_YET_IMPLENTED: ${ this . finalAnswers . projectType }` ) ; return ; default : throw new SfdxFalconError ( `Invalid Project Type: '${ this . finalAnswers . projectType }'. ` , `InvalidProjectType` , `${ dbgNs }install` ) ; } } method returns { void } description protected protected end ( ) { return this . _default_end ( ) ; } }