0.0.5 • Published 8 months ago

@sap-ux/cf-deploy-config-inquirer v0.0.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

@sap-ux/cf-deploy-config-inquirer

Prompts module that can provide prompts for Cloud Foundry deployment config writer.

Installation

Npm npm install --save @sap-ux/cf-deploy-config-inquirer

Yarn yarn add @sap-ux/cf-deploy-config-inquirer

Pnpm pnpm add @sap-ux/cf-deploy-config-inquirer

Explainer

Prompts may be retrieved using getPrompts and then executed in another prompting module that supports inquirer type prompts.

getPrompts is provided to allow consumers to access cloud foundry prompts. There may be cases where these can be transformed to support other prompting frameworks. Most prompt configuration is possible via CfDeployConfigPromptOptions and calling prompt. This is the recommended approach.

Configurability of prompts is entirely controlled using the CfDeployConfigPromptOptions parameter.

See Inquirer.js for valid default properties.

Cloud Foundry Deploy Config Inquirer usage example:

import type { InquirerAdapter } from '@sap-ux/inquirer-common';
import type { CfDeployConfigAnswers, CfDeployConfigPromptOptions } from '@sap-ux/cf-deploy-config-inquirer';
import { prompt as cfDeployConfigPrompt, promptNames } from '@sap-ux/cf-deploy-config-inquirer';

const promptOptions = {
    [promptNames.destinationName]: {
        defaultValue: 'defaultDestination',
        hint: false
    },
    [promptNames.addManagedAppRouter]: true,
    [promptNames.overwrite]: true
};

/**
 * Pass an Inquirer prompt function https://www.npmjs.com/package/inquirer#methods
 */
const inqAdaptor = {
    prompt: this.prompt.bind(this) // the inquirer prompting function, here we use the generators reference
};

const cfDeployConfigAnswers: CfDeployConfigAnswers = await cfDeployConfigPrompt(
    inqAdaptor as InquirerAdapter,
    promptOpts
);

License

Read License.

Keywords

SAP UI5 Application Inquirer Prompting Generator Deployment

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago