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

@xelberasw/clgen

v0.1.14

Published

Toolset for generating standalone libraries and NgRx states for Angular

Downloads

2

Readme

ClGen by XelberaSW

This tool was created to simplify some kind of everyday operation like:

  • creating UI modules in a separate library for Angular 14+ using Nx.

  • creating feature states using NgRx as state manager

Installation

Prerequisite

You need Nx installed and set up before using this tool.

Via NPM:

 npm i nx -D

Via Yarn:

yarn add nx -D

Then you need to initialise Nx workspace by running following command:

npx nx init

If you have Nx installed globally, please run nx command without npx prefix.

Tool installation

Via npm

npm i @xelberasw/clgen -D

If you want this tool to be installed globally, append -g key to command

Via yarn

yarn add @xelberasw/clgen -D

If you want this tool to be installed globally, append -g key to command

Usage

This tool is installed as binary. You could use npx clgen command on projects root for generating stuff.

Use following command to get usage help information:

npx clgen help

Commands available:

state

This command generates set of state-related files. State manager is NgRx. Set of files created at directory specified by --directory:

  • <name>.actions.ts
  • <name>.effects.ts (if not switched of by --skip-effects)
  • <name>.reducer.ts
  • <name>.selectors.ts
  • <name>.state.ts

If no --same-directory is specified, subfolder called state is created and all files are placed there.

These files contain minimal set of code could be used out of the box.

page

Create set of libraries to be used as a single page.

This command will create multiple libraries under {libsDir}/<name> according to best practices. They are:

  • models. This library must be used for storing models any. Could be referenced by data, feature and ui modules.
  • data. This library contains all data management code including state if flag --skip-state was not specified. Could be referenced by app and feature module.
  • feature. This library must be used for storing container components, having almost no layout and css, but has all the logic. Could be referenced by data module only
  • ui. This library must be used for storing components supposed to have rendering features and no logic.

Support

Please feel free to create pull requests with new features and/or bugfixes if any. Please feel free to create feature requests.