@livon/cli 0.27.0-rc.3 → 0.27.0-rc.5
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/LICENCE.md +21 -0
- package/README.md +71 -5
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/dist/index.cjs +1017 -1
- package/dist/index.js +981 -1
- package/dist/mini/index.cjs +5 -0
- package/dist/mini/index.d.ts +1 -0
- package/dist/mini/index.js +5 -0
- package/package.json +22 -5
package/LICENCE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LIVON contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,8 +1,74 @@
|
|
|
1
1
|
# @livon/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- https://live-input-vector-output-node.github.io/livon-ts/docs/packages/cli
|
|
3
|
+
## Install
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add -D @livon/cli
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
CLI for syncing [schema AST](https://live-input-vector-output-node.github.io/livon-ts/docs/schema) from a running server and generating/updating client outputs.
|
|
12
|
+
|
|
13
|
+
## Basic command
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
livon --endpoint ws://127.0.0.1:3002/ws --out src/generated/api.ts --poll 2000
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Generated output mode
|
|
20
|
+
|
|
21
|
+
`livon` always runs in `rslib` mode after sync.
|
|
22
|
+
|
|
23
|
+
- default output: `esm + cjs + d.ts`
|
|
24
|
+
- use `--esm` or `--cjs` to build only the selected format
|
|
25
|
+
- use `--js` when you only need `esm + cjs` and want to skip declaration files
|
|
26
|
+
|
|
27
|
+
With `--out src/generated/api.ts`, compiled files are written to `src/generated/dist`.
|
|
28
|
+
`livon` also writes `src/generated/package.json` with conditional exports, so `import { api } from './generated'` resolves to the matching build output.
|
|
29
|
+
|
|
30
|
+
## Run sync and app command in one process
|
|
31
|
+
|
|
32
|
+
You can append a command directly (without `&&`):
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
livon --endpoint ws://127.0.0.1:3002/ws --out src/generated/api.ts --poll 2000 pnpm dev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If the linked command exits, `livon` exits too.
|
|
39
|
+
If `livon` exits, it terminates the linked command.
|
|
40
|
+
|
|
41
|
+
If your linked command starts with flags, use `--` before it:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
livon --endpoint ws://127.0.0.1:3002/ws --out src/generated/api.ts -- --some-command --flag
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Parameters
|
|
48
|
+
|
|
49
|
+
- `--endpoint <ws-url>` (`string`): websocket endpoint used to fetch [schema explain data](https://live-input-vector-output-node.github.io/livon-ts/docs/packages/schema) (required unless `--port` is used).
|
|
50
|
+
- `--port <number>` (`number`): overrides endpoint port when endpoint host/path stay unchanged.
|
|
51
|
+
- `--out <file>` (`string`): output file path for generated API module.
|
|
52
|
+
- `--poll <ms>` (`number`): polling interval for repeated sync runs.
|
|
53
|
+
- `--timeout <ms>` (`number`): request timeout per sync call.
|
|
54
|
+
- `--event <name>` (`string`): [schema explain](https://live-input-vector-output-node.github.io/livon-ts/docs/packages/schema) event name (default: `$explain`).
|
|
55
|
+
- `--method <GET|POST>` (`string`): request method for explain fetch.
|
|
56
|
+
- `--header key:value` (`string`, repeatable): additional request header.
|
|
57
|
+
- `--payload <json>` (`string`): raw JSON payload body for explain request.
|
|
58
|
+
- `--esm` (`boolean`): build only ESM output (`dist/index.js`).
|
|
59
|
+
- `--cjs` (`boolean`): build only CJS output (`dist/index.cjs`).
|
|
60
|
+
- `--js` (`boolean`): builds only `esm + cjs` (skips `.d.ts` output).
|
|
61
|
+
- `--no-event` (`boolean`): disables event wrapping behavior for transports expecting plain request mode.
|
|
62
|
+
- `--` (delimiter): separates livon flags from linked command arguments.
|
|
63
|
+
|
|
64
|
+
## Typical workflow
|
|
65
|
+
|
|
66
|
+
1. Start server with [`schemaModule(..., { explain: true })`](https://live-input-vector-output-node.github.io/livon-ts/docs/packages/schema).
|
|
67
|
+
2. Run CLI in watch/poll mode during client development.
|
|
68
|
+
3. Use generated API module in the client runtime.
|
|
69
|
+
|
|
70
|
+
## Related pages
|
|
71
|
+
|
|
72
|
+
- [@livon/schema](https://live-input-vector-output-node.github.io/livon-ts/docs/packages/schema)
|
|
73
|
+
- [@livon/client](https://live-input-vector-output-node.github.io/livon-ts/docs/packages/client)
|
|
74
|
+
- [Getting Started](https://live-input-vector-output-node.github.io/livon-ts/docs/core/getting-started)
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2,6 +2,31 @@ Third-Party Notices
|
|
|
2
2
|
|
|
3
3
|
This package includes third-party software. The following licenses apply:
|
|
4
4
|
|
|
5
|
+
------------------------------------------------------------------------------
|
|
6
|
+
@rslib/core
|
|
7
|
+
------------------------------------------------------------------------------
|
|
8
|
+
License: MIT
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2024-present Bytedance, Inc. and its affiliates.
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
5
30
|
------------------------------------------------------------------------------
|
|
6
31
|
msgpackr
|
|
7
32
|
------------------------------------------------------------------------------
|