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

alloy-cli-frontend

v1.0.2

Published

Alloy CLI Frontend is a command-line tool designed to generate frontend components following an **atomic design methodology**. It streamlines the creation of structured and reusable components (Atoms, Molecules, and Organisms) by automating the generation

Downloads

183

Readme

Alloy CLI Frontend

Alloy CLI Frontend is a command-line tool designed to generate frontend components following an atomic design methodology. It streamlines the creation of structured and reusable components (Atoms, Molecules, and Organisms) by automating the generation of scripts, styles, states, types, and other related files.

Table of Contents

Installation

Ensure you have Node.js installed. Install Alloy CLI Frontend globally via npm:

npm install -g alloy-cli-frontend

or

yarn install -g alloy-cli-frontend

or

npx alloy-cli-frontend

Usage

Before running any commands, navigate to the src folder of your frontend project directory.

cd src

Run Alloy CLI Frontend using the following syntax:

alloy-cli-frontend <command> [options]

Example:

alloy-cli-frontend organism

Commands

Organism

Generates an Organism component, optionally creating a page view, template, data file, script, style, and type definition.

alloy-cli-frontend organism [options]

Options

Each command accepts a set of options to configure component generation:

| Option | Description | Default | |------------------------------|----------------------------|------------------| | -cd, --component-directory | Select component directory | organisms | | -pd, --page-directory | Select page directory | pages | | -tpd, --template-directory | Select template directory | templates | | -dd, --data-directory | Select data directory | _data | | -td, --type-directory | Select type directory | _types | | -sd, --script-directory | Select script directory | assets/scripts |

Molecule

Generates a Molecule component with options for script, style, and type definition.

alloy-cli-frontend molecule [options]

Options

Each command accepts a set of options to configure component generation:

| Option | Description | Default | |------------------------------|----------------------------|------------------| | -cd, --component-directory | Select component directory | molecules | | -td, --type-directory | Select type directory | _types | | -sd, --script-directory | Select script directory | assets/scripts |

Atom

Generates an Atom component with options for script, style, and type definition.

alloy-cli-frontend atom [options]

Options

Each command accepts a set of options to configure component generation:

| Option | Description | Default | |------------------------------|----------------------------|------------------| | -cd, --component-directory | Select component directory | atoms | | -td, --type-directory | Select type directory | _types | | -sd, --script-directory | Select script directory | assets/scripts |

Edit Generated Files

Allows you to modify files that will be generated by the CLI using an editor of your choice. You can select from various file types (Page, Component, Style, etc.) and editors (VSCode, IntelliJ IDEA, etc.).

alloy-cli-frontend edit-generated-file

This command allows you to:

  1. Select the file type to modify, such as Page, Component, Style, etc.
  2. Choose an editor like VSCode, Sublime, or Notepad++.
  3. Open the file in the selected editor for easy editing.

Note: For users who want to edit generated files, it is recommended to install this package locally. This ensures that each project can manage its specific generated files independently, avoiding conflicts when working on multiple projects.

Examples

Generate an Organism

alloy-cli-frontend organism

Follow the interactive prompts to:

  • Add state
  • Create a page view
  • Use a story template
  • Generate a new data file

Project Structure

The Alloy CLI Frontend generates files like:

src/
  components/
    atoms/
      Button/
        Button.tsx
        Button.scss
        Button.states.json
    molecules/
      Card/
        Card.tsx
        Card.scss
        Card.states.json
    organisms/
      Header/
        Header.tsx
        Header.scss
        Header.states.json
  pages/
    HeaderPage.tsx
  templates/
    HeaderTemplate.tsx
  _data/
    Header.tsx
  _types/
    organisms.d.ts
    molecules.d.ts
    atoms.d.ts
  assets/
    scripts/
      header.entry.ts

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.