Giter Club home page Giter Club logo

cli's Introduction

@ngxs/cli

@ngxs/cli

CLI Screenshot

Install

The CLI can be installed using NPM:

npm i @ngxs/cli -g

Usage

ngxs

Options

NGXS CLI

  $ ngxs --name name --spec boolean --directory path --folder-name name
  $ ngxs --help
  
Options

  --name name         Store name  
  --directory path    By default, the prompt is set to the current directory
  --folder-name name   Use your own folder name, default: state  
  --spec boolean      Creates a spec file for store, default: true

Custom template generator

  --plopfile path   Path to the plopfile

What is Plop?

Plop is what I like to call a "micro-generator framework." Now, I call it that because it is a small tool that gives you a simple way to generate code or any other type of flat text files in a consistent way. You see, we all create structures and patterns in our code (routes, controllers, components, helpers, etc). These patterns change and improve over time so when you need to create a NEW insert-name-of-pattern-here, it's not always easy to locate the files in your codebase that represent the current "best practice." That's where plop saves you. With plop, you have your "best practice" method of creating any given pattern in CODE. Code that can easily be run from the terminal by typing plop. Not only does this save you from hunting around in your codebase for the right files to copy, but it also turns "the right way" into "the easiest way" to make new files.

Development

Run tests

npm test

Local execute CLI

npm start

cli's People

Contributors

dinbtechit avatar eranshmil avatar kxc0re avatar kyusupov33 avatar mehmet-erim avatar mrs-cp avatar splincode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Install problem

Hi,

when I launch
npm i @ngxs/cli -g

I receive

npm ERR! code E404
npm ERR! 404 Not Found: @ngxs/cli@latest

Release 3.0.0

@splincode We would be very grateful if you could publish the latest changes to npm, since we cannot use the client currently due to a high risk warning re the glob-parent version used by node-plop.

Bildschirmfoto 2023-11-06 um 10 47 13

Thanks in advance. 💐

🐞[BUG]: ngxs-cli - generated code - contains nbsp and the spec uses deprecated code

Affected Package

@ngxs/cli

Is this a regression?

No, this issue has been ever since I started using ngxs cli version

Description

The code generated by ngxs-cli includes non-breaking space characters (nbsp), and the spec utilizes deprecated code.
I'm writing an intellij/webstorm plugin for ngxs. It would be nice to have the ngxs cli working correctly.

🔬 Minimal Reproduction

  1. Follow the steps here -> https://www.ngxs.io/plugins/cli to install @ngxs/cli.

  2. Generate a store using ngxs cli command

ngxs --name mystore --spec true --folder-name mystore
  1. Now examine the generated files.

my-store.state.ts:

The injectable import contains NBSP in it.

image

my-store.state.spec.ts

Uses deprecated code. I would additionally modify the boilerplate test case to simply verify the truthiness of the state. The default test case isn't particularly helpful.

image

Libs:

  • @angular/cli version: 2.0.0
  • @ngxs/store version: 3.8.0

Browser: N/A

For Tooling issues:

  • Node version: v16.17.0
  • npm version - 9.3.1
  • Platform: MacOS Apple M1 Pro - Ventura

glob-parent version leads to security warnings

hi,

in our security checks, the glob-parent version used for ngxs/cli is flagged as highly critical. since the last version of ngxs/cli has been published 4 years ago, is there a change for an update that would fix this issue?

thanks.

Bildschirmfoto 2023-11-06 um 10 47 13

Bildschirmfoto 2023-11-06 um 11 17 19

Generated state model class seems to go against the NGXS style guide / recommendations

Firstly, thanks to all involved on your wonderful work on NGXS!

The generated code (from this CLI) contains a class for the state model, which seems to go against the NGXS style guide / recommendations (ref: https://www.ngxs.io/recipes/style-guide#avoid-saving-class-based-instances-in-your-state) which suggest that interfaces (and thus plain JS objects) should be used.

Just wondering if this is intentional, or just something that needs tweaking in the CLI? Let me know and I'd be happy to submit a PR to make the change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.