@@ -5,14 +5,13 @@ Generates TypeScript helpers from Graplix schema files.
55## CLI
66
77``` bash
8- yarn workspace @graplix/codegen build
9- yarn workspace @graplix/codegen codegen ./schema.graplix
8+ npx @graplix/codegen ./schema.graplix
109```
1110
1211With mapper overrides:
1312
1413``` bash
15- yarn workspace @graplix/codegen codegen ./schema.graplix ./schema.generated.ts --mapper user=./models#User --mapper repository=./models#Repository
14+ npx @graplix/codegen ./schema.graplix ./schema.generated.ts --mapper user=./models#User --mapper repository=./models#Repository
1615```
1716
1817Config files are also supported (` cosmiconfig ` ):
@@ -21,10 +20,15 @@ Config files are also supported (`cosmiconfig`):
2120- ` graplix-codegen.config.json|yaml|yml|js|cjs|mjs|ts|cts|mts `
2221- ` package.json ` with ` "graplix-codegen" ` key
2322
23+ JSON Schema for editor auto-complete/validation:
24+
25+ - ` https://unpkg.com/@graplix/codegen@latest/schema.json `
26+
2427Example (` graplix.codegen.json ` ):
2528
2629``` json
2730{
31+ "$schema" : " https://unpkg.com/@graplix/codegen@latest/schema.json" ,
2832 "schema" : " ./schema.graplix" ,
2933 "output" : " ./schema.generated.ts" ,
3034 "mappers" : {
@@ -35,20 +39,6 @@ Example (`graplix.codegen.json`):
3539
3640CLI args override config values.
3741
38- Typed config helper:
39-
40- ``` ts
41- import { defineConfig } from " @graplix/codegen" ;
42-
43- export default defineConfig ({
44- schema: " ./schema.graplix" ,
45- output: " ./schema.generated.ts" ,
46- mappers: {
47- user: " ./models#User" ,
48- },
49- });
50- ```
51-
5242## Programmatic API
5343
5444``` ts
0 commit comments