New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dbbs/cli

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbbs/cli

DBBs CLI for code generation

latest
npmnpm
Version
0.0.7
Version published
Maintainers
3
Created
Source

@dbbs/cli

Introduction

@dbbs/cli is a command-line tool inspired by the NestJS CLI, designed to streamline the creation and management of Turborepo monorepos. It automates the setup of project structures, integrates pre-built business solutions from our DBBS Solutions Repository, and ensures best practices across your applications.

Features

  • 🚀 Quick monorepo setup with Turborepo
  • 📦 Pre-built configurations for ESLint and TypeScript
  • 🔧 Automated project structure generation
  • 🛠️ Git hooks setup with Husky
  • 📝 Standardized configuration files
  • 🔌 Easy integration of new packages and applications
  • 🎯 Interactive CLI with guided package and application selection
  • 🌐 Direct integration with DBBS Solutions Repository

Installation

Install @dbbs/cli globally using either yarn or npm:

Using yarn:

yarn global add @dbbs/cli

Using npm:

npm install -g @dbbs/cli

Commands

Initialize Project

Creates a new Turborepo monorepo with all necessary configurations.

dbbs init <projectName>

Parameters

Parameter NameTypeRequiredDescription
projectNamestringYesThe name of the new project to be initialized. This will be used for directory creation and project configuration.

What This Command Does

  • Creates a new Turborepo monorepo structure
  • Sets up essential configuration files:
    • .gitignore
    • .prettierrc.json
    • .vscode/settings.json
    • .yarnrc.yml
    • Makefile
  • Configures Husky for Git hooks
  • Creates a package.json with workspace configuration
  • Fetches and integrates pre-built configurations from DBBS Solutions

Add Package or Application

Adds a new package or application to your monorepo using an interactive menu.

dbbs add
# or
dbbs add package
# or
dbbs add application

Interactive Menu Options

  • Adding Packages

    • Choose from available packages in the DBBS Solutions Repository
    • Select multiple packages to install at once
    • Packages are automatically downloaded and configured
  • Adding Applications

    • Choose from available application templates
    • Application is generated using predefined generators
    • All necessary configurations are automatically set up

Examples

# Start interactive menu for adding packages or applications
dbbs add

# Start interactive menu specifically for packages
dbbs add package

# Start interactive menu specifically for applications
dbbs add application

Project Structure

When initialized, your monorepo will follow this structure:

📂 <app-name>/
│── 📄 package.json
│── 📄 tsconfig.json
│── 📄 .gitignore
│── 📄 .prettierrc.json
│── 📄 .yarnrc.yml
│── 📄 Makefile
│── 📂 .vscode/
│   ├── 📄 settings.json
│── 📂 .husky/
│   ├── 📄 pre-commit
│── 📂 typescript/
│   ├── 📂 apps/
│   ├── 📂 packages/
│       ├── 📂 eslint-config/
│       │   ├── 📄 package.json
│       │   ├── 📄 README.md
│       │   ├── 📄 node.js
│       │   ├── 📄 react.js
│       │   ├── 📄 react-native.js
│       ├── 📂 tsconfig/
│           ├── 📄 package.json
│           ├── 📄 README.md
│           ├── 📄 base.json
│           ├── 📄 react-spa.json
│           ├── 📄 react-native.json

Configuration Files

ESLint Configuration

The CLI sets up ESLint with pre-configured rules for:

  • Node.js applications
  • React applications
  • React Native applications

TypeScript Configuration

Pre-built TypeScript configurations for:

  • Base configuration
  • React SPA
  • React Native

Git Hooks

Husky is configured with pre-commit hooks to ensure code quality.

Best Practices

  • Project Naming

    • Use kebab-case for project names
    • Avoid special characters
    • Use descriptive names that reflect the project's purpose
  • Package Management

    • Use Yarn as the package manager
    • Workspaces are automatically configured for monorepo management
  • Code Quality

    • Pre-commit hooks ensure code quality
    • ESLint and Prettier configurations are pre-set
    • TypeScript configurations are optimized for different project types

Troubleshooting

Common Issues

  • Installation Fails

    # Try clearing yarn cache
    yarn cache clean
    
    # Reinstall the CLI
    yarn global remove @dbbs/cli
    yarn global add @dbbs/cli
    
  • Permission Issues

    # Fix permissions for global installation
    sudo chown -R $USER:$GROUP ~/.config
    sudo chown -R $USER:$GROUP ~/.local
    

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

The DBBS CLI is open-source software licensed under the MIT License.

Authors and Maintainers

  • Andrii Bilous
  • Roman Bobrovskiy

External Dependencies

  • yargs - CLI argument parsing
  • typescript - TypeScript support
  • inquirer - Interactive command line interface

FAQs

Package last updated on 21 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts