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

@eggslib/schematics

v0.2.7

Published

EggsNext schematics

Downloads

94

Readme

EggsNext Schematics

Prequisiti

Generali

Nella sezione path di config.json del progetto abilitare l'importazione abbreviata degli shared

"paths": { "@shared/": ["src/app/shared/"] },

in modo che sia possibile fare gli import abbreviati tipo

import {AuthService} from '@shared/services/auth.service';


Nella cartella src/app/shared devono essere presenti le cartelle con i business-services e i dyn-form (cfr. per esempio eggs-giri-ng)

Installazione

npm i -save-dev @eggslib/schematics

Configurazioni

Il package prevede una distribuzione standard delle cartelle

src | - app | - modules | - modulo | - models (cartella deile entità/modelli) | - pages (cartella deile pagine list, edit, etc) | - service (cartella dei servizi)

Schematics

PageService

Creazione di un service che estende AbstractPageService

Help:

Create a service which extends AbstractPageService arguments: path Target folder

options: --immutable If readonly model --model Model name --name Service name. If not set equals model

Utilizzo:

ng g @eggslib/schematics:page-service path --model=nodelname [--name=my-service] [--immutable]

Ex:

ng g @eggslib/schematics:page-service modules/module/services --model=my-model

Crea il file src/app/modules/module/services/my-model.service.ts La classe (MyModelService) estende AbstractPageService

--

ng g @eggslib/schematics:page-service modules/module/services --model=my-model --name=other-service-name

Crea il file src/app/modules/module/services/other-service-name.service.ts. La classe (OtherServiceService) estende AbstractPageService

ListPage

Creazione di una pagina per la gestione della lista di entità

Help: (ng g @eggslib/schematics:list-page --help)

Create a simple list page arguments: path Target folder

options: --model Model name. Required. --exports Add support for csv export. Optional. Default=false --filters Add support for bar filters. Optional. Default=false --name Page name. Optional. If not set it equals model --service-name Service name. Optional. It must be the name of the service component (ie model-service for model-service.service.ts). If not set it equals model. (ie mode.service.ts component)

Utilizzo:

ng g @eggslib/schematics:list-page path --model=nodelname [--service-name=my-service] [--name=my-page] [--filters] [--exports]

Ex:

ng g @eggslib/schematics:list-page modules/module/pages --model=my-model

Crea il file src/app/modules/module/pages/my-model-list.component.ts (less, html)

EditPage

Creazione di una pagina per la gestione dell'edit

Help: (ng g @eggslib/schematics:edit-page --help)

Create a simple edit page arguments: path Target folder

options: --form-data Form-data file path. Required. --model Model name. Required. --name Page name. Optional. If not set it equals model --service-name Service name. Optional. It must be the name of the service component (ie model-service for model-service.service.ts). If not set it equals model. (ie mode.service.ts component)

Utilizzo:

ng g @eggslib/schematics:edit-page path --form-data=form.json --model=my-model [--service-name=my-service] [--name=my-page] [--filters] [--exports]

Ex:

ng g @eggslib/schematics:edit-page modules/module/pages --form-data=temp.form.json --model=my-model

Crea il file src/app/modules/module/pages/my-model-edit.component.ts (less, html) partendo da un file temp.form.json dove vengono descritti i campi da gestire come ad esempio

[ { "name": "codice", "manage": true, "formControlName": "codice", "required": true, "maxlength": 32, "type": "input" }, { "name": "descrizione", "manage": true, "formControlName": "descrizione", "required": true, "maxlength": 128, "type": "input" } ]

Gli elementi devono corrispondere all'interfaccia

export type DynFormFieldDataType = 'input' | 'date' | 'time' | 'textarea' | 'pickhelper' | 'dropdown' | 'number' | 'boolean' | 'manual';

export interface DynFormFieldDataExt { name: string; // Nome elemento field?: string; // Nome property dell'entity, default = name manage: boolean; // formControlName: string; // required: boolean; valueChanges?: boolean; maxlength?: number; // Se 'input' o 'number' definisce il maxlength decimali?: number; // Se 'number' definisce il numero di decimali pickhelperEntity?: string; // Nome entity per i pickerhelper type: DynFormFieldDataType; // }

ViewPage

Creazione di una pagina per la gestione della view

Help: (ng g @eggslib/schematics:view-page --help)

Create a simple view page arguments: path Target folder

options: --form-data Form-data file path. Required. --model Model name. Required. --name Page name. Optional. If not set it equals model --service-name Service name. Optional. It must be the name of the service component (ie model-service for model-service.service.ts). If not set it equals model. (ie mode.service.ts component)

Utilizzo:

ng g @eggslib/schematics:edit-view path --form-data=form.json --model=my-model [--service-name=my-service] [--name=my-page]

Ex:

ng g @eggslib/schematics:view-page modules/module/pages --form-data=temp.form.json --model=my-model

Crea il file src/app/modules/module/pages/my-model-view.component.ts (less, html) partendo da un file temp.form.json (cfr. EditPage)