Create a new built-in prompt for npm registry
Signed-off-by: Min Kim <minkimcello@gmail.com>
This commit is contained in:
@@ -49,6 +49,22 @@ export function moduleIdIdPrompt(): Prompt<{ moduleId: string }> {
|
||||
};
|
||||
}
|
||||
|
||||
export function npmRegistryPrompt(): Prompt<{ npmRegistry: string }> {
|
||||
return {
|
||||
type: 'input',
|
||||
name: 'npmRegistry',
|
||||
message: 'Please specify your NPM registry [optional]',
|
||||
validate: (value: string) => {
|
||||
if (!value) {
|
||||
return 'Please enter the URL of your NPM registry';
|
||||
} else if (!/^http*$/.test(value)) {
|
||||
return 'Invalid URL.';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function ownerPrompt(): Prompt<{
|
||||
owner?: string;
|
||||
codeOwnersPath?: string;
|
||||
|
||||
Reference in New Issue
Block a user