next-porto-cli
Version:
A cli for next.js to scaffold your application using porto architecture
251 lines (250 loc) • 7.83 kB
TypeScript
import { z } from 'zod';
export declare const PKG_ROOT: string;
declare const containerPathsObj: z.ZodObject<{
section: z.ZodString;
container: z.ZodString;
srcPath: z.ZodString;
appContainersPath: z.ZodOptional<z.ZodString>;
sectionPath: z.ZodString;
containerPath: z.ZodString;
pagesPath: z.ZodString;
pagesApiPath: z.ZodString;
assetsPath: z.ZodString;
configsPath: z.ZodString;
componentsPath: z.ZodString;
helpersPath: z.ZodString;
hooksPath: z.ZodString;
actionsPath: z.ZodString;
stylesPath: z.ZodString;
}, "strip", z.ZodTypeAny, {
appContainersPath?: string | undefined;
section: string;
container: string;
srcPath: string;
sectionPath: string;
containerPath: string;
pagesPath: string;
pagesApiPath: string;
assetsPath: string;
configsPath: string;
componentsPath: string;
helpersPath: string;
hooksPath: string;
actionsPath: string;
stylesPath: string;
}, {
appContainersPath?: string | undefined;
section: string;
container: string;
srcPath: string;
sectionPath: string;
containerPath: string;
pagesPath: string;
pagesApiPath: string;
assetsPath: string;
configsPath: string;
componentsPath: string;
helpersPath: string;
hooksPath: string;
actionsPath: string;
stylesPath: string;
}>;
export declare type ContainerPathsType = z.infer<typeof containerPathsObj>;
declare const pagePathObj: z.ZodObject<Pick<{
section: z.ZodOptional<z.ZodString>;
container: z.ZodOptional<z.ZodString>;
srcPath: z.ZodOptional<z.ZodString>;
appContainersPath: z.ZodOptional<z.ZodOptional<z.ZodString>>;
sectionPath: z.ZodOptional<z.ZodString>;
containerPath: z.ZodOptional<z.ZodString>;
pagesPath: z.ZodOptional<z.ZodString>;
pagesApiPath: z.ZodOptional<z.ZodString>;
assetsPath: z.ZodOptional<z.ZodString>;
configsPath: z.ZodOptional<z.ZodString>;
componentsPath: z.ZodOptional<z.ZodString>;
helpersPath: z.ZodOptional<z.ZodString>;
hooksPath: z.ZodOptional<z.ZodString>;
actionsPath: z.ZodOptional<z.ZodString>;
stylesPath: z.ZodOptional<z.ZodString>;
}, "section" | "container" | "pagesPath" | "pagesApiPath">, "strip", z.ZodTypeAny, {
section?: string | undefined;
container?: string | undefined;
pagesPath?: string | undefined;
pagesApiPath?: string | undefined;
}, {
section?: string | undefined;
container?: string | undefined;
pagesPath?: string | undefined;
pagesApiPath?: string | undefined;
}>;
export declare type PagePathType = z.infer<typeof pagePathObj>;
declare const shipPatshObj: z.ZodObject<{
hooks: z.ZodString;
config: z.ZodString;
layouts: z.ZodString;
styles: z.ZodString;
helpers: z.ZodString;
components: z.ZodString;
}, "strip", z.ZodTypeAny, {
config: string;
hooks: string;
layouts: string;
styles: string;
helpers: string;
components: string;
}, {
config: string;
hooks: string;
layouts: string;
styles: string;
helpers: string;
components: string;
}>;
export declare type ShipPathsType = z.infer<typeof shipPatshObj>;
declare const PathObj: z.ZodObject<{
path: z.ZodString;
section: z.ZodOptional<z.ZodString>;
container: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
section?: string | undefined;
container?: string | undefined;
path: string;
}, {
section?: string | undefined;
container?: string | undefined;
path: string;
}>;
export declare type PathType = z.infer<typeof PathObj>;
declare const ParamsObj: z.ZodObject<Pick<{
path: z.ZodString;
section: z.ZodOptional<z.ZodString>;
container: z.ZodOptional<z.ZodString>;
}, "section" | "container">, "strip", z.ZodTypeAny, {
section?: string | undefined;
container?: string | undefined;
}, {
section?: string | undefined;
container?: string | undefined;
}>;
export declare type ParamsType = z.infer<typeof ParamsObj>;
/**
* Scaffold the container paths
*
* @param section section name
* @param container container name
* @returns ContainerPathsType
*/
declare const containerScafffolding: (section: string, container: string) => ContainerPathsType;
/**
* Scaffold the ship paths
* @param _projectDir string value for project directory [optional]
* @returns ShipPathsType
*/
declare const shipScaffolding: (_projectDir?: string) => ShipPathsType;
/**
* Get the path base on the section & container
* @param _funcName function path short name
* @param _params optional parameter for {section, container}
* @returns string
*/
declare const getPath: (_funcName: string, _params?: ParamsType) => string;
/**
* Get base application path, includes relative path if parameter exists
* @param _path relative path from the root directory
* @returns string
*/
declare const getBasePath: (_path?: string) => string;
/**
* Get src path
* @returns string
*/
declare const getSrcPath: () => string;
/**
* Get base container path
* @returns string
*/
declare const getAppContainersPath: () => string;
/**
* Get ship path
* @param _projectDir string value of the project directory [optional]
* @returns string
*/
declare const getShipPath: (_projectDir?: string) => string;
/**
* Get section path by name
* @param _section section name
* @returns string
*/
declare const getSectionPath: (_section: string) => string;
/**
* Get specific container path
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getContainerPath: (_section: string, _container: string) => string;
/**
* Get pages path
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getPagesPath: (_section: string, _container: string) => string;
/**
* Get page api path
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getApiPath: (_section: string, _container: string) => string;
/**
* Get asset path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getAssetsPath: (_section: string, _container: string) => string;
/**
* Get config path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getConfigsPath: (_section: string, _container: string) => string;
/**
* Get components path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getComponentsPath: (_section: string, _container: string) => string;
/**
* Get helpers path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getHelpersPath: (_section: string, _container: string) => string;
/**
* Get hooks path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getHooksPath: (_section: string, _container: string) => string;
/**
* Get actions path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getActionsPath: (_section: string, _container: string) => string;
/**
* Get styles path of the container
* @param _section section name
* @param _container container name
* @returns string
*/
declare const getStylesPath: (_section: string, _container: string) => string;
export declare const APP_ROOT: string;
export { containerScafffolding, shipScaffolding, getPath, getBasePath, getSrcPath, getAppContainersPath, getShipPath, getSectionPath, getContainerPath, getPagesPath, getApiPath, getAssetsPath, getConfigsPath, getComponentsPath, getHelpersPath, getHooksPath, getActionsPath, getStylesPath, };