@soda-gql/cli 0.11.26 → 0.12.1
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 +27 -0
- package/dist/index.cjs +7242 -235
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -82,6 +82,33 @@ bun run soda-gql codegen graphql --input "src/**/*.graphql"
|
|
|
82
82
|
bun run soda-gql codegen graphql --input "src/**/*.graphql" --suffix ".generated.ts"
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
#### Generate Prebuilt Types
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
bun run soda-gql typegen
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Analyzes your TypeScript source files and generates prebuilt type definitions for all soda-gql operations and fragments. Run this after `codegen schema` to get compile-time type safety.
|
|
92
|
+
|
|
93
|
+
**Options:**
|
|
94
|
+
|
|
95
|
+
| Option | Description |
|
|
96
|
+
|--------|-------------|
|
|
97
|
+
| `--config <path>` | Path to config file |
|
|
98
|
+
| `--watch`, `-w` | Watch for file changes and regenerate automatically |
|
|
99
|
+
|
|
100
|
+
**Watch mode** (`--watch` / `-w`) monitors your source files for changes and regenerates types automatically. It uses 150ms debounce to batch rapid changes, automatic rebuilds on each change, and automatic error recovery — a failed build does not stop the watcher.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# One-time generation
|
|
104
|
+
bun run soda-gql typegen
|
|
105
|
+
|
|
106
|
+
# Watch mode for development
|
|
107
|
+
bun run soda-gql typegen --watch
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
> **Note:** Schema codegen always generates a CommonJS bundle (`.cjs`) alongside TypeScript source files for runtime module loading. No `--bundle` flag is needed.
|
|
111
|
+
|
|
85
112
|
### CLI Options
|
|
86
113
|
|
|
87
114
|
| Option | Description |
|