Extract cli config type to types.ts
Signed-off-by: Min Kim <minkimcello@gmail.com>
This commit is contained in:
@@ -19,19 +19,11 @@ import { parse } from 'yaml';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import { paths } from '../paths';
|
||||
import { Template, TemplateLocation } from './types';
|
||||
import { Template, TemplateLocation, CliConfig } from './types';
|
||||
|
||||
import defaultTemplates from '../../../templates/all-default-templates';
|
||||
|
||||
export function readCliConfig(
|
||||
cliConfig:
|
||||
| {
|
||||
defaults?: boolean;
|
||||
templates?: TemplateLocation[];
|
||||
globals?: Record<string, string>;
|
||||
}
|
||||
| undefined,
|
||||
) {
|
||||
export function readCliConfig(cliConfig: CliConfig) {
|
||||
let templates: TemplateLocation[] = [];
|
||||
|
||||
if (!cliConfig || cliConfig?.defaults) {
|
||||
|
||||
@@ -16,6 +16,17 @@
|
||||
|
||||
import { Answers, DistinctQuestion } from 'inquirer';
|
||||
|
||||
export type CliConfig =
|
||||
| {
|
||||
/** Setting this to false will omit default backstage-cli new templates */
|
||||
defaults?: boolean;
|
||||
/** Where you can explicitly declare templates */
|
||||
templates?: TemplateLocation[];
|
||||
/** For configuring global values that applies to all new plugins/packages */
|
||||
globals?: Record<string, string>;
|
||||
}
|
||||
| undefined;
|
||||
|
||||
export interface CreateContext {
|
||||
/** Whether we are creating something in a monorepo or not */
|
||||
isMonoRepo: boolean;
|
||||
|
||||
Reference in New Issue
Block a user