0.0.2 • Published 9 months ago

@assylman/riverpod-cli v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Riverpod CLI

The Riverpod Command Line Interface (CLI) Tools is created for skipping the boilerplate files generation when using riverpod plugin - https://riverpod.dev.

  • You can easily create services
  • You can easily create repositories
  • You can easily create managers
  • You can easily create features, which includes all of the above

Installation

Node Package

You can install the Riverpod CLI using npm (the Node Package Manager). Note that you will need to install:

To download and install the Riverpod CLI run the following command:

npm install -g @assylman/riverpod-cli

Commands

The command riverpod-cli --help lists the available commands and riverpod-cli <command> --help shows more details for an individual command.

Use this cli inside you flutter projects directory!!!

Configuration Commands

First four commands need a required parameter, which is a feature name.

CommandDescription
serviceCreate a service with a given name.
repositoryCreate a repository with a given name.
managerCreate a manager with a given name.
featureCreate a whole feature with a given name, this includes services, repositories and managers.
helpDisplay help information about.

Common args

Parameter
-tDefault features directory is `/lib/features, but with this flag you can set the different directory
-iWith this flag the CLI generates index barrel files.
--use-importsBy default, CLI uses absolute imports. Set this parameter to relative, in order to use relatice imports.

Specific args per command type

ParameterDescription
service
-lCreates a local service class.
-rCreates a remote service class.
featureCreate a whole feature with a given name, this includes services, repositories and managers.
-pThis parameter creates a providers file inside the feature folder.

Folders structure

/lib 
    /features/
        /managers/
            -> example_manager.dart
            -> managers.dart (index barrel file)
        /services/
            -> example_service.dart (abstract interface)
            -> example_local_service.dart
            -> example_remote_service.dart
            -> services.dart (index barrel file)
        /repostiories/
            -> example_repository.dart (abstract interface)
            -> example_repository_impl.dart
            -> repositories.dart (index barrel file)
        -> example.dart (feature index barrel file)
        -> providers.dart (feature provider file)

You can create mentioned files and folders with riverpod-cli feature command.

0.0.2

9 months ago

0.0.1

9 months ago