frontity
Version:
Frontity cli and entry point to other packages
77 lines (76 loc) • 2.43 kB
TypeScript
/**
* Options for the {@link create} command.
*/
interface CreateOptions {
/**
* The name of your Frontity project. It will also be the name of the folder
* that this command will create for you with the files of your Frontity
* project inside.
*
* It can be also configured using the `FRONTITY_CREATE_NAME` env variable.
*
* The Frontity CLI will prompt to provide a value if both this CLI argument and
* the `FRONTITY_CREATE_NAME` env variable are missing and `prompt` is false.
*
* @example "my-frontity-project"
*/
name: string;
/**
* The theme that will be installed. It can be a npm package.
*
* It can be also configured using the `FRONTITY_CREATE_THEME` env variable.
*
* The Frontity CLI will prompt to provide a value if both this CLI argument and
* the `FRONTITY_CREATE_THEME` env variable are missing and `prompt` is false.
*
* @example "my-awesome-theme"
*
* @defaultValue `@frontity/mars-theme`
*/
theme?: string;
/**
* Whether to bootstrap the project with TypeScript files.
*
* It can be also configured using the `FRONTITY_CREATE_TYPESCRIPT` env
* variable.
*
* @defaultValue false
*/
typescript?: boolean;
/**
* Whether to skip creating a git repository for a new project.
*
* It can be also configured using the `FRONTITY_CREATE_NO_GIT` env
* variable.
*
* @defaultValue false
*/
noGit?: boolean;
/**
* Whether to create the files inside the current working directory instead
* of a new folder.
*
* It can be also configured using the `FRONTITY_CREATE_USE_CWD` env
* variable.
*
* @defaultValue false
*/
useCwd?: boolean;
/**
* Whether to prompt the user in the CLI or to run the command silently,
* using only the CLI args and environment variables found.
*
* @defaultValue true
*/
prompt?: boolean;
}
/**
* The create CLI command, usually run with `npx frontity create`.
*
* It takes args from the CLI and checks for the presence of environment
* variables. Then, it runs the create command programatically.
*
* @param options - Defined in {@link CreateOptions}.
*/
declare const create: ({ name, theme, typescript, noGit, useCwd, prompt: promptUser, }: CreateOptions) => Promise<void>;
export default create;