Skip to content

Commit cfbdf6f

Browse files
committed
feat(cli): add lb4 datasource command
fix #1127 Signed-off-by: Taranveer Virk <[email protected]>
1 parent 8f13a48 commit cfbdf6f

File tree

9 files changed

+1283
-8
lines changed

9 files changed

+1283
-8
lines changed

packages/cli/README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,23 @@ Arguments:
7676
name # Name for the controller Type: String Required: false
7777
```
7878

79-
4. To download one of LoopBack example projects
79+
4. To scaffold a DataSource into your application
80+
81+
`lb4 datasource`
82+
83+
```sh
84+
Usage:
85+
lb4 datasource [options] [<name>]
86+
87+
Options:
88+
-h, --help # Print the generator's options and usage
89+
--connector # Name of datasource connector
90+
91+
Arguments:
92+
name # Name for the datasource Type: String Required: true
93+
```
94+
95+
5. To download one of LoopBack example projects
8096

8197
`lb4 example`
8298

@@ -90,7 +106,7 @@ Options:
90106
--skip-install # Do not automatically install dependencies Default: false
91107
```
92108

93-
5. To list available commands
109+
6. To list available commands
94110

95111
`lb4 --commands` (or `lb4 -l`)
96112

@@ -104,7 +120,7 @@ Available commands:
104120

105121
Please note `lb4 --help` also prints out available commands.
106122

107-
6. To print out version information
123+
7. To print out version information
108124

109125
`lb4 --version` (or `lb4 -v`)
110126

packages/cli/bin/cli.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ function setupGenerators() {
6161
path.join(__dirname, '../generators/controller'),
6262
PREFIX + 'controller',
6363
);
64+
env.register(
65+
path.join(__dirname, '../generators/datasource'),
66+
PREFIX + 'datasource',
67+
);
6468
env.register(
6569
path.join(__dirname, '../generators/example'),
6670
PREFIX + 'example',

0 commit comments

Comments
 (0)