generator-zionapps
Version:
Angular 9 Code Generator
299 lines (270 loc) • 6.58 kB
JavaScript
const { ANGULAR_APP_TYPE, IONIC_APP_TYPE } = require('../constants');
exports.getAddRoutingModuleOptionPrompt = () => ({
type: 'list',
name: 'routingModule',
message: 'Do you want this component to have a routing module?',
default: true,
choices: [
{
name: 'Yes',
value: true
},
{
name: 'No',
value: false
}
]
});
exports.getAfterAdalOptionPrompt = () => ({
type: 'list',
name: 'afterAdal',
message: 'Do you want this component to chain login after ADAL login?',
default: true,
choices: [
{
name: 'Yes',
value: true
},
{
name: 'No',
value: false
}
]
});
exports.getApplicationType = () => ({
type: 'list',
name: 'applicationType',
message: 'What kind of application are you developing?',
choices: [
{
name: 'Angular',
value: ANGULAR_APP_TYPE
},
{
name: 'Ionic',
value: IONIC_APP_TYPE
}
],
store: true
});
exports.getAppName = () => ({
type: 'input',
name: 'appName',
message: 'What is the name of your application?',
default: 'My New App'
});
exports.getBuildForAngularLibrary = () => ({
type: 'list',
name: 'buildForAngularLibrary',
message: 'Are you building this for an Angular library?',
default: false,
choices: [
{
name: 'No',
value: false
},
{
name: 'Yes',
value: true
}
]
});
exports.getEndpointBaseUriPrompt = () => ({
type: 'input',
name: 'baseUri',
message: 'What is the property name of the base URI in your environments variable?',
default: 'baseUri',
store: true
});
exports.getDatabaseNamePrompt = () => ({
type: 'input',
name: 'databaseName',
message: 'What is the name of the database?',
default: 'Management',
store: true
});
exports.getExtendDomainCode = () => ({
type: 'list',
name: 'extendDomainCode',
message: 'Do you want to extend the default code?',
default: false,
choices: [
{
name: 'No',
value: false
},
{
name: 'Yes',
value: true
}
]
});
exports.getFrameworkOptionsPrompt = () => ({
type: 'list',
name: 'framework',
message: 'Which framework are you using?',
default: 'angular',
choices: [
{
name: 'Angular (Only)',
value: 'angular'
},
{
name: 'Ionic Angular',
value: 'ionic'
}
]
});
exports.getComponentNamePrompt = () => ({
type: 'input',
name: 'componentName',
message: 'What is the NAME of your component?',
default: 'MyComponent'
});
exports.getIdPropertyDataType = () => ({
type: 'list',
name: 'idPropertyDataType',
message: 'What is the data type of the id property?',
default: 'number',
choices: [
{
name: 'Number',
value: 'number'
},
{
name: 'String',
value: 'string'
}
]
});
exports.getAvatarImageUrl = () => ({
type: 'input',
name: 'avatarImageUrl',
message: 'What is the avatar image url (Leave blank if none)?',
default: ''
});
exports.getFallbackAvatarUrl = () => ({
type: 'input',
name: 'fallbackAvatarUrl',
message: 'What is the fallback image url (Leave blank if none)?',
default: ''
});
exports.getIdPropertyName = () => ({
type: 'input',
name: 'idPropertyName',
message: 'What is the name of the id property?',
default: 'id'
});
exports.getListTitlePropertyName = () => ({
type: 'input',
name: 'listTitlePropertyName',
message: 'What should the title of the item be in list view?',
default: 'title',
store: true
});
exports.getListSubTitlePropertyName = () => ({
type: 'input',
name: 'listSubTitlePropertyName',
message: 'What should the subtitle of the item be in list view?',
default: 'subtitle',
store: true
});
exports.getPluralLoginSubStoreNamePrompt = customDefault => ({
type: 'input',
name: 'loginSubStorePluralName',
message: 'What is the PLURAL name of the login sub store?',
default: customDefault || 'Users',
store: true
});
exports.getPluralSubStoreNamePrompt = customDefault => ({
type: 'input',
name: 'pluralDomainName',
message: 'What is the PLURAL name of the sub store?',
default: customDefault || 'MyItems'
});
exports.getSingularLoginSubStoreNamePrompt = customDefault => ({
type: 'input',
name: 'loginSubStoreName',
message: 'What is the SINGULAR name of the login sub store?',
default: customDefault || 'User',
store: true
});
exports.getSingularSubStoreNamePrompt = customDefault => ({
type: 'input',
name: 'singularDomainName',
message: 'What is the SINGULAR name of the sub store?',
default: customDefault || 'MyItem'
});
exports.getRoutingComponentFolderPathPrompt = () => ({
type: 'input',
name: 'path',
message: 'What is the PATH to the folder of your routing components?',
default: 'src/app/pages',
store: true
});
exports.getNgRxStoreName = () => ({
type: 'input',
name: 'storeName',
message: 'What would you like to name your NgRx Store?',
default: 'App Store',
store: true
});
exports.getNgRxStorePath = () => ({
type: 'input',
name: 'storePath',
message: 'What is the PATH to your NgRx Store?',
default: 'src/app/store',
store: true
});
exports.getNgRxSubStoreLocation = () => ({
type: 'list',
name: 'ngRxSubStoreLocation',
message: 'Where is this store located??',
default: '',
choices: [
{
name: 'Current Project',
value: ''
},
{
name: '@zionapps/ngrx-management',
value: '@zionapps/ngrx-management'
}
],
store: true
});
exports.getNotFoundUrl = () => ({
type: 'input',
name: 'notFoundUrl',
message: 'What url should the page load if the item is not found (e.g /home)?',
default: '/'
});
exports.getPageNamePrompt = () => ({
type: 'input',
name: 'pageName',
message: 'What is the page name?',
default: 'TestPage'
});
exports.getIonicPagesPathPrompt = () => ({
type: 'input',
name: 'ionicPagesPath',
message: 'What is the PATH to the Ionic pages folder?',
default: 'src/pages',
store: true
});
exports.getSignaturePadPrompt = () => ({
type: 'list',
name: 'npmInstallSignaturePad',
message: 'Do you need to install angular2-signaturepad?',
default: false,
choices: [
{
name: 'No',
value: false
},
{
name: 'Yes',
value: true
}
]
});