Skip to content

Commit 602b212

Browse files
authored
doc: mark "output" option to-be-duplicated for core plugins (#372)
* docs: v2.6.0 release * doc: mark "output" option to-be-duplicated for core plugins
1 parent 27a9a03 commit 602b212

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

docs/reference/plugins/enhancer.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,19 @@ This plugin is built-in to ZenStack and does not need to be installed separately
3131

3232
| Name | Type | Description | Required | Default |
3333
| ------ | ------ | ---------------- | -------- | -------------------------- |
34-
| output | String | Output directory (relative to the path of ZModel) | No | node_modules/.zenstack |
35-
| compile | Boolean | If the generated TS code should be compiled to JS | No | true |
36-
| preserveTsFiles | Boolean | If the generated TS files should be preserved (after compiled to JS) | No | true if `compile` is set to false, otherwise false |
37-
38-
### Example
39-
40-
```zmodel title='/schema.zmodel'
41-
plugin enhancer {
42-
provider = '@core/enhancer'
43-
output = 'src/lib/zenstack'
44-
compile = false
45-
}
34+
| output | String | Output directory (relative to the path of ZModel). This option will be deprecated in future releases in favor of the "--output" CLI option of `zenstack generate`. | No | node_modules/.zenstack |
35+
| preserveTsFiles | Boolean | If the generated TS files should be preserved (after compiled to JS) | No | false |
36+
37+
### Custom output directory and compilation options
38+
39+
You can use the "--output" option of the `zenstack generate` CLI to specify a custom output location for the generated enhancer code:
40+
41+
```bash
42+
zenstack generate --output src/lib/zenstack
43+
```
44+
45+
If you want to have the code generated as TypeScript (instead of compiled to JavaScript), you can add the "--no-compile" option:
46+
47+
```bash
48+
zenstack generate --no-compile --output src/lib/zenstack
4649
```

docs/reference/plugins/zod.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ This plugin is built-in to ZenStack and does not need to be installed separately
151151
152152
| Name | Type | Description | Required | Default |
153153
| ------ | ------ | ---------------- | -------- | -------------------------- |
154-
| output | String | Output directory (relative to the path of ZModel) | No | node_modules/.zenstack/zod |
154+
| output | String | Output directory (relative to the path of ZModel). This option will be deprecated in future releases in favor of the "--output" CLI option of `zenstack generate`. | No | node_modules/.zenstack/zod |
155155
| modelOnly | Boolean | Only generate schemas for the models, but not for the Prisma CRUD input arguments | No | false |
156156
| generateModels | String, String[] | Array or comma separated string for the models to generate routers for. | No | All models |
157157
| compile | Boolean | If the generated TS code should be compiled to JS | No | true |
158-
| preserveTsFiles | Boolean | If the generated TS files should be preserved (after compiled to JS) | No | true if `compile` is set to false, otherwise false |
158+
| preserveTsFiles | Boolean | If the generated TS files should be preserved (after compiled to JS) | No | false |
159159
| noUncheckedInput | Boolean | Disables schema generation for Prisma's ["Unchecked"](https://github.com/prisma/prisma/discussions/10121#discussioncomment-1621254) input types | No | false |
160160
| mode | String | Controls if the generated schemas should reject, strict, or passthrough unknown fields. Possible values: "strict", "strip", "passthrough" | No | "strict" |
161161
@@ -181,12 +181,14 @@ import { PostCreateSchema } from '@zenstackhq/runtime/zod/models';
181181
PostCreateSchema.parse(data);
182182
```
183183

184-
You can turn off the `compile` option and use a custom `output` location if you want the generated Zod schema to be compiled along with your own Typescript project:
184+
You can use the "--output" option of the `zenstack generate` CLI to specify a custom output location for the generated Zod schemas:
185185

186-
```zmodel title='/schema.zmodel'
187-
plugin zod {
188-
provider = '@core/zod'
189-
output = 'src/lib/zod'
190-
compile = false
191-
}
186+
```bash
187+
zenstack generate --output src/lib/zenstack
188+
```
189+
190+
If you want to have the code generated as TypeScript (instead of compiled to JavaScript), you can add the "--no-compile" option:
191+
192+
```bash
193+
zenstack generate --no-compile --output src/lib/zenstack
192194
```

0 commit comments

Comments
 (0)