0.3.5 ⢠Published 8 months ago
fsd-architect v0.3.5
FSD Architect
A professional CLI tool for architecting Feature-Sliced Design (FSD) project structures.
Features
- š Quick project scaffolding with FSD architecture
- āļø Flexible configuration
- šØ Custom templates support
- š¦ TypeScript support out of the box
- š Multiple package managers support (npm, yarn, pnpm)
- š Detailed logging
- š§ Extensible architecture
Installation
# Global installation
npm install -g fsd-architect
# Local installation
npm install --save-dev fsd-architect
Quick Start
You can use either the full command fsd-architect
or the shorter alias fsd
:
# Initialize new FSD project (using short command)
fsd init my-project
# Or using full command
fsd-architect init my-project
# Create new feature (using short command)
fsd create layer --layer features --name auth
# Or using full command
fsd-architect create layer --layer features --name auth
Configuration
Create fsd.config.json
in your project root:
{
"projectName": "my-app",
"typescript": true,
"stack": {
"styling": "scss",
"stateManager": "redux",
"testing": "jest"
},
"layers": {
"features": {
"segments": ["ui", "model", "api"]
}
}
}
CLI Commands
init
Initialize a new FSD project:
fsd-architect init [options]
Options:
-c, --config <path> Path to config file (default: "fsd.config.json")
-f, --force Force initialization even if config exists
-v, --verbose Enable verbose logging
create
Create new layer or segment:
fsd-architect create <type> [options]
Arguments:
type Type of structure to create (layer/segment)
Options:
-c, --config <path> Path to config file (default: "fsd.config.json")
-v, --verbose Enable verbose logging
Project Structure
The generated project follows the Feature-Sliced Design methodology:
src/
āāā app/ # Application initialization layer
āāā processes/ # Complex processes layer
āāā pages/ # Pages/Screens layer
āāā widgets/ # Complex components layer
āāā features/ # User interactions layer
āāā entities/ # Business entities layer
āāā shared/ # Reusable infrastructure
Custom Templates
You can define custom templates in your configuration:
{
"templates": {
"feature": {
"path": "./templates/feature.ts",
"template": "// Custom feature template"
}
}
}
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
For more details, see our Contributing Guide.
Documentation
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Aziz Issapov - GitHub