Create a new built-in prompt for npm registry

Signed-off-by: Min Kim <minkimcello@gmail.com>
This commit is contained in:
Min Kim
2024-09-29 16:52:38 -04:00
parent d7bc68d8a9
commit d71e11faa2
@@ -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;