Angular builder
npm install @danils/angular-builderng add @danils/angular-builder or npm install -g @danils/angular-builder
ng g @danils/angular-builder:scan
ng g @danils/angular-builder:build
ng g @danils/angular-builder:scan or ng g @danils/angular-builder:s
ng g @danils/angular-builder:build or ng g @danils/angular-builder:b
ng g component;
"settings":{
"[COLLECTION-NAME]": {
"[SCHEMATIC-NAME]": {
"alias": "[ALIAS]",
"[PROPERTY-NAME]": [VALUE]
}
}
}
`
For example:
`json
{
"settings": {
"@schematics/angular": {
"component": {
"alias": "components",
"standalone": true
}
}
}
}
`
##### Projects
Projects have all the projects created, but if you define someone that is not created, the schematic will create it.
All the settings of every project are read from the angular.json
Project structure
`
{
"[PROJECT-NAME]":{
"type": "library | application",
"settings": "something like global settings",
...project structures like folders or schematics.
}
}
`
`json
{
"projects": {
"project-demo": {
"type": "application",
"settings": {
"@schematics/angular": {
"component": {
"style": "scss"
}
}
},
"src": {
"type": "folder",
"app": {
"type": "folder"
},
"assets": {
"type": "folder"
}
}
}
}
}
`
#### Level 3
##### Folder or Schematic?
Inside every project, you will have two types of objects:
1. Schematic
2. Folder
To differentiate between folders and schematics, you need to define the type.
For example,
`json
{
"components": {
"type": "schematic"
},
"assets": {
"type": "folder"
}
}
`
Schematics
The properties that schematic object has are:
The object is a key/value pair. You have two options for the key:
1. Use an alias declare on global settings or project settings.
2. Define the schematic with this pattern: [COLLECTION-NAME]:[SCHEMATIC-NAME].
| Property name | Description | optional |
| ------------- | ------------------------------------------------------- | -------- |
| type | | false |
| settings | All the setting of this schematic | true |
| instances | Execute many times with the same schematic base on name | true |
`json
{
"components": {
"type": "schematic",
"settings": {
"prefix": "core"
},
"instances": {
"home": {},
"footer": {},
"header": {}
}
},
"@danils/schematicskit:prettier": {
"type": "schematic"
}
}
`
Folders
Inside folder objects yoy can have another folder or schematics object.
`json
{
"assets": {
"type": "folder",
"scss": {
"type": "folder"
}
}
}
``
instances > schematic > project > global