@chkit/plugin-codegen 0.1.0-beta.5 → 0.1.0-beta.6
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 +52 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @chkit/plugin-codegen
|
|
2
|
+
|
|
3
|
+
Plugin to generate TypeScript row types and optional Zod schemas from your chkit schema definitions.
|
|
4
|
+
|
|
5
|
+
Part of the [chkit](https://github.com/obsessiondb/chkit) monorepo.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add -d @chkit/plugin-codegen
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Register the plugin in your config:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// clickhouse.config.ts
|
|
19
|
+
import { defineConfig } from '@chkit/core'
|
|
20
|
+
import { codegen } from '@chkit/plugin-codegen'
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
schema: './src/db/schema/**/*.ts',
|
|
24
|
+
outDir: './chkit',
|
|
25
|
+
plugins: [
|
|
26
|
+
codegen({
|
|
27
|
+
outFile: './src/generated/chkit-types.ts',
|
|
28
|
+
emitZod: false,
|
|
29
|
+
emitIngest: false,
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
clickhouse: {
|
|
33
|
+
url: process.env.CLICKHOUSE_URL ?? 'http://localhost:8123',
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then run:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
bunx chkit codegen
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Codegen also runs automatically after `chkit generate` when `runOnGenerate` is enabled (default).
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
See the [chkit documentation](https://chkit.obsessiondb.com).
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
[MIT](../../LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chkit/plugin-codegen",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"clean": "rm -rf dist"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@chkit/core": "0.1.0-beta.
|
|
26
|
+
"@chkit/core": "0.1.0-beta.6",
|
|
27
27
|
"fast-glob": "^3.3.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|