@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
113 lines • 2.85 kB
TypeScript
/**
* Create a new stx project
*/
export declare function createProject(projectName: string, options?: CreateProjectOptions): Promise<ScaffoldResult>;
/**
* Add a component
*/
export declare function addComponent(name: string, options?: AddComponentOptions): Promise<ScaffoldResult>;
/**
* Add a page
*/
export declare function addPage(name: string, options?: AddPageOptions): Promise<ScaffoldResult>;
/**
* Add a store
*/
export declare function addStore(name: string, options?: AddStoreOptions): Promise<ScaffoldResult>;
/**
* Add a layout
*/
export declare function addLayout(name: string, options?: AddLayoutOptions): Promise<ScaffoldResult>;
/**
* Project template definitions
*/
export declare const PROJECT_TEMPLATES: {
default: {
description: 'Standard stx project with pages, components, and stores';
features: readonly ['Pages', 'Components', 'Layouts', 'Stores', 'Dev server']
};
minimal: {
description: 'Minimal setup with just the essentials';
features: readonly ['Single page', 'Basic styles']
};
full: {
description: 'Full-featured project with all stx capabilities';
features: readonly ['Pages', 'Components', 'Layouts', 'Stores', 'API routes', 'PWA', 'i18n', 'Testing']
};
blog: {
description: 'Blog template with markdown support';
features: readonly ['Blog layout', 'Post pages', 'Tags', 'RSS feed', 'Markdown']
};
dashboard: {
description: 'Admin dashboard template';
features: readonly ['Sidebar', 'Charts', 'Tables', 'Forms', 'Auth pages']
};
landing: {
description: 'Marketing landing page template';
features: readonly ['Hero section', 'Features', 'Pricing', 'CTA', 'Contact form']
}
};
/**
* Project creation options
*/
export declare interface CreateProjectOptions {
template?: ProjectTemplate
skipGit?: boolean
skipInstall?: boolean
packageManager?: 'bun' | 'npm' | 'pnpm' | 'yarn'
typescript?: boolean
examples?: boolean
pwa?: boolean
tailwind?: boolean
}
/**
* Add component options
*/
export declare interface AddComponentOptions {
dir?: string
props?: boolean
styles?: boolean
script?: boolean
force?: boolean
}
/**
* Add page options
*/
export declare interface AddPageOptions {
dir?: string
layout?: string
dynamic?: boolean
loader?: boolean
force?: boolean
}
/**
* Add store options
*/
export declare interface AddStoreOptions {
dir?: string
persist?: boolean
actions?: boolean
force?: boolean
}
/**
* Add layout options
*/
export declare interface AddLayoutOptions {
dir?: string
nav?: boolean
footer?: boolean
force?: boolean
}
/**
* Scaffolding result
*/
export declare interface ScaffoldResult {
success: boolean
message: string
files: string[]
errors: string[]
}
/**
* Project template options
*/
export type ProjectTemplate = 'default' | 'minimal' | 'full' | 'blog' | 'dashboard' | 'landing'