0.3.5 • Published 8 months ago

fsd-architect v0.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

FSD Architect

CI npm version License: MIT

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

0.3.5

8 months ago

0.3.4

8 months ago

0.3.3

8 months ago