1.0.84 • Published 11 months ago
@webage/gen v1.0.84
gen
Backend and frontend resource generators
Initialize
npx nx run @webage/gen:init
The command will create the projects and schemas directory in the project root. These documents will allow you to configure models and schemas based on your project requirements.
Config.yaml
The config file under the project directories is required. Project package-name and target directory for the generation must be provided.
Sample Configuration
# yaml-language-server: $schema=./../../schemas/config/config.json
model:
target: libs/model/src/lib # where to generate the model
alias: '@webage/model' # from where to import the generated model
entity:
target: libs/entity/src/lib
alias: '@webage/entity'
controller:
target: libs/resource/src/lib
alias: '@webage/resource'
resolver:
target: libs/resource/src/lib
alias: '@webage/resource'
client:
target: libs/client/src/lib
alias: '@webage/graph'
graph:
target: libs/graph/src/lib
alias: '@webage/graph'
module:
target: libs/resource/src/lib
alias: '@webage/module'
Commands
npx nx g @webage/gen:model model-name project-name
npx nx g @webage/gen:entity entity-name project-name
npx nx g @webage/gen:service service-name project-name
npx nx g @webage/gen:graph graph-name project-name
npx nx g @webage/gen:rest-module rest-module-name project-name
npx nx g @webage/gen:graph-module graph-module-name project-name