@zhxiaogg/fluorite-cli 0.2.0 → 0.5.0
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 +12 -11
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @zhxiaogg/fluorite-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generate Rust and TypeScript code from Fluorite IDL (`.fl`) schema definitions.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -13,13 +13,13 @@ npm install -D @zhxiaogg/fluorite-cli
|
|
|
13
13
|
### Generate TypeScript
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx fluorite ts --inputs ./schemas/*.
|
|
16
|
+
npx fluorite ts --inputs ./schemas/*.fl --output ./src/generated
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
### Generate Rust
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npx fluorite rust --inputs ./schemas/*.
|
|
22
|
+
npx fluorite rust --inputs ./schemas/*.fl --output ./src/generated
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Options
|
|
@@ -28,22 +28,23 @@ npx fluorite rust --inputs ./schemas/*.yaml --output ./src/generated
|
|
|
28
28
|
|
|
29
29
|
| Option | Default | Description |
|
|
30
30
|
|--------|---------|-------------|
|
|
31
|
-
| `--inputs` | required | Input
|
|
31
|
+
| `--inputs` | required | Input `.fl` files |
|
|
32
32
|
| `--output` | required | Output directory |
|
|
33
33
|
| `--single-file` | false | Generate all types in a single file |
|
|
34
|
-
| `--any-type` | unknown | Type to use for Any fields |
|
|
34
|
+
| `--any-type` | unknown | Type to use for `Any` fields |
|
|
35
35
|
| `--readonly` | false | Generate readonly properties |
|
|
36
|
+
| `--package-name` | | Override output directory name |
|
|
36
37
|
|
|
37
38
|
### Rust (`rust`)
|
|
38
39
|
|
|
39
40
|
| Option | Default | Description |
|
|
40
41
|
|--------|---------|-------------|
|
|
41
|
-
| `--inputs` | required | Input
|
|
42
|
+
| `--inputs` | required | Input `.fl` files |
|
|
42
43
|
| `--output` | required | Output directory |
|
|
43
44
|
| `--single-file` | true | Generate all types in a single file |
|
|
44
|
-
| `--any-type` | fluorite::Any | Type to use for Any fields |
|
|
45
|
-
| `--derives` | | Custom derives (comma-separated) |
|
|
46
|
-
| `--extra-derives` | | Additional derives |
|
|
45
|
+
| `--any-type` | fluorite::Any | Type to use for `Any` fields |
|
|
46
|
+
| `--derives` | | Custom derives (comma-separated, replaces defaults) |
|
|
47
|
+
| `--extra-derives` | | Additional derives (comma-separated) |
|
|
47
48
|
| `--generate-new` | true | Generate derive_new |
|
|
48
49
|
| `--visibility` | public | Type visibility |
|
|
49
50
|
|
|
@@ -52,11 +53,11 @@ npx fluorite rust --inputs ./schemas/*.yaml --output ./src/generated
|
|
|
52
53
|
```json
|
|
53
54
|
{
|
|
54
55
|
"scripts": {
|
|
55
|
-
"generate": "fluorite ts --inputs ./schemas/*.
|
|
56
|
+
"generate": "fluorite ts --inputs ./schemas/*.fl --output ./src/generated",
|
|
56
57
|
"build": "npm run generate && tsc"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@zhxiaogg/fluorite-cli": "^0.
|
|
60
|
+
"@zhxiaogg/fluorite-cli": "^0.2.0"
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhxiaogg/fluorite-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Code generator from YAML/Fluorite schema definitions - generates Rust and TypeScript",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fluorite": "./bin/fluorite.js"
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"node": ">=16.0.0"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
|
-
"@zhxiaogg/fluorite-darwin-x64": "0.
|
|
30
|
-
"@zhxiaogg/fluorite-darwin-arm64": "0.
|
|
31
|
-
"@zhxiaogg/fluorite-linux-x64": "0.
|
|
32
|
-
"@zhxiaogg/fluorite-linux-arm64": "0.
|
|
33
|
-
"@zhxiaogg/fluorite-win32-x64": "0.
|
|
29
|
+
"@zhxiaogg/fluorite-darwin-x64": "0.5.0",
|
|
30
|
+
"@zhxiaogg/fluorite-darwin-arm64": "0.5.0",
|
|
31
|
+
"@zhxiaogg/fluorite-linux-x64": "0.5.0",
|
|
32
|
+
"@zhxiaogg/fluorite-linux-arm64": "0.5.0",
|
|
33
|
+
"@zhxiaogg/fluorite-win32-x64": "0.5.0"
|
|
34
34
|
}
|
|
35
35
|
}
|