frontity
Version:
Frontity cli and entry point to other packages
51 lines (50 loc) • 1.78 kB
TypeScript
/**
* Options for the create-package command.
*/
interface CreatePackageOptions {
/**
* The name of your Frontity package. The create-package command will
* create a folder with this name, under `/packages`. It will also add the
* proper dependency in the package.json of your Frontity project.
*
* It can be also configured using the `FRONTITY_CREATE_PACKAGE_NAME` env
* variable.
*
* The Frontity CLI will prompt to provide a value if both this CLI argument and
* the `FRONTITY_CREATE_PACKAGE_NAME` env variable are missing and `prompt` is false.
*
* @example "my-frontity-package"
*/
name: string;
/**
* The namespace that should be used to create this package.
*
* It can also be configured using the `FRONTITY_CREATE_PACKAGE_NAMESPACE`
* env variable.
*
* The Frontity CLI will prompt to provide a value if both this CLI argument and the
* `FRONTITY_CREATE_PACKAGE_NAMESPACE` env variable are missing and `prompt` is false.
*
* @example "analytics"
*
* @defaultValue "theme"
*/
namespace?: string;
/**
* 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-package`.
*
* 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 CreatePackageOptions}.
*/
declare const createPackage: ({ name, namespace, prompt: promptUser, }: CreatePackageOptions) => Promise<void>;
export default createPackage;