arri 0.53.0 → 0.53.2
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 +19 -80
- package/dist/cli.cjs +9 -2
- package/dist/cli.mjs +9 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Command line interface for ARRI-RPC
|
|
4
4
|
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Commands](#commands)
|
|
8
|
+
- [Usage with @arrirpc/server](#usage-with-arrirpcserver)
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
Run `arri --help` to get a full list of commands
|
|
13
|
+
|
|
14
|
+
| Cmd | Description |
|
|
15
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| codegen [input-file] | Run generate clients specified in the `arri.config.ts`. See [here](/README.md#creating-schemas-for-custom-server-implementations) for details. |
|
|
17
|
+
| init [dir] | Scaffold an arri app/library |
|
|
18
|
+
| list | List available arri versions |
|
|
19
|
+
| use [version] | Update arri dependencies to a specific version (checks recursively for package.json, pubspec.yaml, cargo.toml, etc) |
|
|
20
|
+
| version | Print current CLI version |
|
|
21
|
+
|
|
5
22
|
## Usage with @arrirpc/server
|
|
6
23
|
|
|
24
|
+
@arrirpc/server will automatically rerun code generators on hot-reload during development, and when building for production.
|
|
25
|
+
|
|
7
26
|
For full details visit the [server docs](https://github.com/modiimedia/arri/blob/master/packages/arri/README.md)
|
|
8
27
|
|
|
9
28
|
#### 1) Create an `arri.config.ts`
|
|
@@ -27,83 +46,3 @@ export default defineConfig({
|
|
|
27
46
|
arri dev
|
|
28
47
|
arri build
|
|
29
48
|
```
|
|
30
|
-
|
|
31
|
-
## Generate Clients Without an Arri Server
|
|
32
|
-
|
|
33
|
-
#### 1) Create an App Definition
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
// app-definition.ts
|
|
37
|
-
import { createAppDefinition } from "arri";
|
|
38
|
-
import { a } from "@arrirpc/schema";
|
|
39
|
-
|
|
40
|
-
export default createAppDefinition({
|
|
41
|
-
procedures: {
|
|
42
|
-
sayHello: {
|
|
43
|
-
transport: "http",
|
|
44
|
-
method: "post",
|
|
45
|
-
path: "/say-hello",
|
|
46
|
-
params: a.object({
|
|
47
|
-
name: a.string(),
|
|
48
|
-
}),
|
|
49
|
-
response: a.object({
|
|
50
|
-
message: a.string(),
|
|
51
|
-
}),
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### 2) Create an `arri.config.ts`
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
// arri.config.ts
|
|
61
|
-
import { defineConfig, generators } from "arri";
|
|
62
|
-
|
|
63
|
-
export default defineConfig({
|
|
64
|
-
generators: [
|
|
65
|
-
generators.typescriptClient({
|
|
66
|
-
// options
|
|
67
|
-
}),
|
|
68
|
-
generators.dartClient({
|
|
69
|
-
// options
|
|
70
|
-
}),
|
|
71
|
-
generators.kotlinClient({
|
|
72
|
-
// options
|
|
73
|
-
}),
|
|
74
|
-
],
|
|
75
|
-
});
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
#### 3) Run codegen command
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
arri codegen ./app-definition.ts
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
#### Now you can use the generated clients in your application code
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
// typescript
|
|
88
|
-
await client.sayHello({
|
|
89
|
-
name: "John Doe",
|
|
90
|
-
});
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
```dart
|
|
94
|
-
// dart
|
|
95
|
-
await client.sayHello(
|
|
96
|
-
SayHelloParams(
|
|
97
|
-
name: "John Doe",
|
|
98
|
-
),
|
|
99
|
-
);
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
```kt
|
|
103
|
-
// kotlin
|
|
104
|
-
client.sayHello(
|
|
105
|
-
SayHelloParams(
|
|
106
|
-
name = "John Doe"
|
|
107
|
-
)
|
|
108
|
-
)
|
|
109
|
-
```
|
package/dist/cli.cjs
CHANGED
|
@@ -34,6 +34,9 @@ const enquirer__default = /*#__PURE__*/_interopDefaultCompat(enquirer);
|
|
|
34
34
|
const consola__default = /*#__PURE__*/_interopDefaultCompat(consola);
|
|
35
35
|
|
|
36
36
|
const build = citty.defineCommand({
|
|
37
|
+
meta: {
|
|
38
|
+
description: "Build the arri TS server"
|
|
39
|
+
},
|
|
37
40
|
args: {
|
|
38
41
|
config: {
|
|
39
42
|
type: "string",
|
|
@@ -219,6 +222,10 @@ async function createCodegenEntryFile(config) {
|
|
|
219
222
|
}
|
|
220
223
|
|
|
221
224
|
const codegen = citty.defineCommand({
|
|
225
|
+
meta: {
|
|
226
|
+
name: "Codegen",
|
|
227
|
+
description: "Run code-generators. (Uses options from your arri config file)"
|
|
228
|
+
},
|
|
222
229
|
args: {
|
|
223
230
|
schema: {
|
|
224
231
|
type: "positional",
|
|
@@ -301,7 +308,7 @@ const codegen = citty.defineCommand({
|
|
|
301
308
|
const init = citty.defineCommand({
|
|
302
309
|
meta: {
|
|
303
310
|
name: "Init",
|
|
304
|
-
description: "Scaffold an
|
|
311
|
+
description: "Scaffold an arri app"
|
|
305
312
|
},
|
|
306
313
|
args: {
|
|
307
314
|
dir: {
|
|
@@ -672,7 +679,7 @@ const __dirname$1 = path__default.dirname(__filename$1);
|
|
|
672
679
|
const version = citty.defineCommand({
|
|
673
680
|
meta: {
|
|
674
681
|
name: "Version",
|
|
675
|
-
description: "Get the current
|
|
682
|
+
description: "Get the current arri CLI version"
|
|
676
683
|
},
|
|
677
684
|
run() {
|
|
678
685
|
const packageJson = JSON.parse(
|
package/dist/cli.mjs
CHANGED
|
@@ -21,6 +21,9 @@ import '@joshmossas/listhen';
|
|
|
21
21
|
import 'h3';
|
|
22
22
|
|
|
23
23
|
const build = defineCommand({
|
|
24
|
+
meta: {
|
|
25
|
+
description: "Build the arri TS server"
|
|
26
|
+
},
|
|
24
27
|
args: {
|
|
25
28
|
config: {
|
|
26
29
|
type: "string",
|
|
@@ -206,6 +209,10 @@ async function createCodegenEntryFile(config) {
|
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
const codegen = defineCommand({
|
|
212
|
+
meta: {
|
|
213
|
+
name: "Codegen",
|
|
214
|
+
description: "Run code-generators. (Uses options from your arri config file)"
|
|
215
|
+
},
|
|
209
216
|
args: {
|
|
210
217
|
schema: {
|
|
211
218
|
type: "positional",
|
|
@@ -288,7 +295,7 @@ const codegen = defineCommand({
|
|
|
288
295
|
const init = defineCommand({
|
|
289
296
|
meta: {
|
|
290
297
|
name: "Init",
|
|
291
|
-
description: "Scaffold an
|
|
298
|
+
description: "Scaffold an arri app"
|
|
292
299
|
},
|
|
293
300
|
args: {
|
|
294
301
|
dir: {
|
|
@@ -659,7 +666,7 @@ const __dirname = path.dirname(__filename);
|
|
|
659
666
|
const version = defineCommand({
|
|
660
667
|
meta: {
|
|
661
668
|
name: "Version",
|
|
662
|
-
description: "Get the current
|
|
669
|
+
description: "Get the current arri CLI version"
|
|
663
670
|
},
|
|
664
671
|
run() {
|
|
665
672
|
const packageJson = JSON.parse(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arri",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"ofetch": "^1.3.4",
|
|
40
40
|
"pathe": "^1.1.2",
|
|
41
41
|
"prettier": "^3.3.2",
|
|
42
|
-
"@arrirpc/codegen-
|
|
43
|
-
"@arrirpc/codegen-
|
|
44
|
-
"@arrirpc/codegen-
|
|
45
|
-
"@arrirpc/
|
|
46
|
-
"@arrirpc/
|
|
47
|
-
"@arrirpc/codegen-
|
|
42
|
+
"@arrirpc/codegen-dart": "0.53.2",
|
|
43
|
+
"@arrirpc/codegen-kotlin": "0.53.2",
|
|
44
|
+
"@arrirpc/codegen-rust": "0.53.2",
|
|
45
|
+
"@arrirpc/codegen-utils": "0.53.2",
|
|
46
|
+
"@arrirpc/schema": "0.53.2",
|
|
47
|
+
"@arrirpc/codegen-ts": "0.53.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/degit": "^2.8.6"
|