Nx friendly @loopback/cli (official CLI for LoopBack 4)
Run the following command to install the CLI.
yarn add nx-loopback-next-cli
Run yarn nx-lb4 --commands
or yarn nx-lb4 -l
to list all available commands:
See CLI reference for a detailed documentation.
-
Generate a loopback app w/ nx-loopback-next ;
-
Update your
workspace.json
file :{ "projects": { "{{YOUR_PROJECT}}": { // ... "architect": { // ... "model": { "builder": "@nrwl/workspace:run-commands", "options": { "command": "nx-lb4 model --appDir={{YOUR_PROJECT}}" } }, "datasource": { "builder": "@nrwl/workspace:run-commands", "options": { "command": "nx-lb4 datasource --appDir={{YOUR_PROJECT}}" } }, "repository": { "builder": "@nrwl/workspace:run-commands", "options": { "command": "nx-lb4 repository --appDir={{YOUR_PROJECT}}" } }, "controller": { "builder": "@nrwl/workspace:run-commands", "options": { "command": "nx-lb4 controller --appDir={{YOUR_PROJECT}}" } } } } } }
-
Use the new command :
nx model gateway
artifact-generator
gets a new optionappDir
(default:process.cwd()
) ;- Every generators making use of
utils.sourceRootDir
are updated to prependappDir
;
- model
- datasource
- controller
- interceptor
- observer
- openapi
- relation
- repository
- rest-crud
- service
MIT