Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Cethy/nx-loopback-next-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nx-loopback-next-cli (@loopback/cli fork)

Nx friendly @loopback/cli (official CLI for LoopBack 4)

Installation

Run the following command to install the CLI.

yarn add nx-loopback-next-cli

Basic Use

Run yarn nx-lb4 --commands or yarn nx-lb4 -l to list all available commands:

See CLI reference for a detailed documentation.

Usage w/ loopback 4

  1. Generate a loopback app w/ nx-loopback-next ;

  2. 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}}"
              }
            }
          }
        }
      }
    }
  3. Use the new command :

    nx model gateway

Changes from official repo

  • artifact-generator gets a new option appDir (default: process.cwd()) ;
  • Every generators making use of utils.sourceRootDir are updated to prepend appDir ;

"Fixed" commands

  • model
  • datasource
  • controller
  • interceptor
  • observer
  • openapi
  • relation
  • repository
  • rest-crud
  • service

License

MIT

About

Nx friendly @loopback/cli

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published