velocious 1.0.188 → 1.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -438,6 +438,31 @@ export default new Configuration({
|
|
|
438
438
|
})
|
|
439
439
|
```
|
|
440
440
|
|
|
441
|
+
## Run CLI commands in the browser
|
|
442
|
+
|
|
443
|
+
Enable the browser CLI and run commands from devtools or app code:
|
|
444
|
+
|
|
445
|
+
```js
|
|
446
|
+
import BrowserCli from "velocious/build/src/cli/browser-cli.js"
|
|
447
|
+
|
|
448
|
+
const browserCli = new BrowserCli({configuration})
|
|
449
|
+
browserCli.enable()
|
|
450
|
+
|
|
451
|
+
await browserCli.run("db:migrate")
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
In React, you can use the hook which sets `globalThis.velociousCLI`:
|
|
455
|
+
|
|
456
|
+
```js
|
|
457
|
+
import useBrowserCli from "velocious/build/src/cli/use-browser-cli.js"
|
|
458
|
+
|
|
459
|
+
export default function App() {
|
|
460
|
+
useBrowserCli({configuration})
|
|
461
|
+
|
|
462
|
+
return null
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
|
|
441
466
|
## Run migrations from anywhere if you want to:
|
|
442
467
|
|
|
443
468
|
```js
|