@bagubagu/schematics v0.3.30
Bagubagu Schematics
Develop
First thing first
npm install -g schematics-cli
git clone https://github.com/bagubagu/s.git
yarn install
yarn buildModify table component
Modify src/table/files/*
to test:
# Test from an example angular project
cd example
# this will not really create the files
# because it's running in dry-run mode
schematics ..:table
# to see the changes
schematics ..:table --dry-run=falseCreate new component
- Add your new component to
src/collection.json - mkdir
src/newcomponent - create your new component, use
src/tableas example
To test the component
cd example
# this will run in dry-run mode (not changing anything)
schematics ..:mycomponent
# set dry-run to false, to see changes
schematics ..:mycomponent --dry-run=falseTest from an existing angular project
# link our schematics to global
cd s
npm link .
# test from hijrah-admin
cd ../hijrah-admin
npm link @bagubagu/schematics
ng g @bagubagu/schematics:tableHow to use
npm i -g @bagubagu/schematicsCreate .json for @bagubagu/schematics
cd ./angular_project/src/app/
generate-json-schematicsThis will generate <file_name>.json in ./angular_project/src/app
Create new table
ng g @bagubagu/schematics:table <table_name> --project=<project_name>Note: Before creating a new table please make sure that <table_name>.json's path is included (and/or) <table_name>.json does exists
Create new Service
# this will run in dry-run mode (not changing anything)
ng g @bagubagu/schematics:service <service_name> --project=<project_name>Create new Pipe
ng g @bagubagu/schematics:pipe <pipe_name> --project=<project_name>Example
Create Table
cd ./project/hehe/product/
generate-json-schematics ? What do you want to create? (Use arrow keys)
Form
❯ Table ng g @bagubagu/schematics:table product/product-list --dry-run=falseCreate Form
cd example/src/app/product/
generate-json-schematics ? What do you want to create? (Use arrow keys)
❯ Form
Table cd example/
ng g @bagubagu/schematics:form product/product-add --dry-run=falseService
cd example/
ng g @bagubagu/schematics:service product/product --project=example --dry-run=falsePipe
cd example/
ng g @bagubagu/schematics:pipe product --project=example --dry-run=false
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago