npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yaagoub/cli

v0.1.3

Published

The **YGB CLI Framework** is a custom command-line interface that leverages Angular CLI commands and utilities, organized by functional groups for easier access and execution. This tool allows developers to generate components, test code, create applicati

Downloads

102

Readme

YGB CLI Framework

The YGB CLI Framework is a custom command-line interface that leverages Angular CLI commands and utilities, organized by functional groups for easier access and execution. This tool allows developers to generate components, test code, create applications, and manage Angular configurations using simplified flags and commands.

Table of Contents

Installation

  1. install it by command:

    npm i @yaagoub/cli
  2. Run the CLI:

    ygb [command] [subcommand]

Usage

The ygb CLI provides a simplified way to manage Angular projects, with commands grouped by functionality. To run a command, use the following syntax:

ygb <group> <command> [options]

Available Command Groups

  • Generate: Quickly create components, services, modules, and other Angular entities.
  • Test: Run, watch, and generate code coverage for your Angular tests.

Command Flags

Each command has a unique flag for shorthand access. For example, to generate a component, use the -c flag.

Example Usage

To generate a new component:

ygb g -c MyComponent

To run tests with code coverage:

ygb t -tecov

Commands Overview

Generate Commands

The generate group includes commands for creating a variety of Angular project elements, such as components, services, modules, and more.

| key | Flag | Description | |-----------------|-----------|-------------------------------------------------------| | nativeApp | -native-app | Creates a new Angular native application project. | | app | -app | Creates a new Angular application within the project.| | component | -c | Generates a new Angular component. | | directive | -d | Generates a new Angular directive. | | service | -s | Generates a new Angular service. | | module | -m | Generates a new Angular module. | | pipe | -p | Generates a new Angular pipe. | | guard | -g | Generates a new Angular guard. | | resolver | -res | Generates a new Angular resolver. | | interface | -i | Generates a new TypeScript interface. | | class | -cl | Generates a new TypeScript class. | | enum | -enu | Generates a new TypeScript enum. | | interceptor | -inter | Generates a new Angular interceptor. | | decorator | -dec | Generates a new TypeScript decorator. | | mixin | -mix | Generates a new TypeScript mixin. | | library | -lib | Generates a new Angular library. | | asset | -asset | Adds assets to the Angular project. | | environments | -envs | Sets up environments for the Angular project. | | schematic | -schc | Generates an Angular schematic. | | webWorker | -ww | Generates a new Angular web worker. |

Test Commands

The test group includes commands for running tests, code coverage, and linting.

| key | Flag | Description | |---------------------|--------|-------------------------------------------------------| | lintCode | -li | Runs code linting. | | runTests | -te | Runs all unit tests. | | runTestsWithCoverage| -tecov | Runs tests with code coverage report. | | watchTests | -tew | Runs tests in watch mode. | | runE2E | -e2e | Runs end-to-end tests. |

Advanced Configuration

To add, modify, or customize commands and flags, update the routes object in routes.ts. Each route is structured as follows:

export const routes: { [key: string]: { [key: string]: { flag: string, command: string, func: (command: string) => Promise<void> } }[] }[] = [
  {
    [YgbGroupCommands.generate]: [
      {
        component: {
          flag: '-c',
          command: 'ng generate component ${componentName}',
          func: (command: string) => component(command)
        }
      },
      // More commands...
    ]
  },
  // More groups...
];

In this structure:

  • flag: The shorthand used to execute the command.
  • command: The Angular CLI command template.
  • func: The function executed to run the command.

Notes

  • Ensure command strings use template literals where applicable to inject names or other parameters (e.g., ${componentName}).
  • To implement a custom function, add it to the functions folder and import it into the routes file.

This setup allows for flexibility in configuring commands and functions, ensuring that ygb can adapt to various Angular project requirements.