Skip to content

Commit

Permalink
feat: Remove standalone mode from the public doc
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianCourvoisier committed Jul 18, 2024
1 parent d8bbed2 commit 1b3e9e9
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions packages/cozy-konnector-libs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,11 @@

`cozy-jobs-cli` is a npm package providing CLI tools allowing to run your connector in different modes.

- standalone
- development
- or in dedicated REPL

You can install it in your connector as a dev dependency.

#### cozy-run-standalone

It can be handy to run a konnector without inserting the data in a cozy. This mode is called "standalone".
You can run your connector in standalone mode with :

```sh
$ cozy-run-standalone
```

If you want, you can add the following code in the `scripts` section of your package.json file:

```json
"scripts": {
"standalone": "cozy-run-standalone"
}
```

It will then possible to do:

```sh
yarn standalone
```

The requests to the cozy-stack will be stubbed using the [./fixture.json] file as source of data
and when cozy-client-js is asked to create or update data, the data will be output to the console.
The bills (or any file) will be saved in the ./data directory.

It is possible to add an argument to this command which tells which file to run. Default is
defined in `package.json` `main` section or ./src/index.js

It is possible to record and replay the requests done by the standalone command using the
[replay](https://github.com/assaf/node-replay) module.

When your connector is run with this command, a global function is available in your connector :
`global.openInBrowser`, which can take an html string or a cheerio object as input and will show
the corresponding html page in your default browser.

##### Arguments

```
Usage: cozy-run-standalone [options] <file>
Options:
--record Record all the requests in the ./fixtures directory using the replay module
--replay Replay all the recorded requests
--persist Do not empty ./data/importedData.json at each run
-h, --help output usage information
```


#### cozy-run-dev

If you want to run your connector linked to a cozy-stack, even remotely, the "dev" mode is for you.
Expand Down

0 comments on commit 1b3e9e9

Please sign in to comment.