Skip to content

Commit 68b3ddf

Browse files
authored
doc: improve plugin development docs (#528)
1 parent f50c9b3 commit 68b3ddf

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

versioned_docs/version-3.x/recipe/plugin-dev.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ You can also package a plugin as an npm package. Make sure to export the "plugin
2020

2121
The following example shows a sample plugin that allows you to mark fields as "password" and specify hashing algorithms to use.
2222

23+
:::info
24+
Custom attributes and functions by themselves don't have any effect. They are commonly combined with other plugin aspects to achieve a meaningful goal, like we'll see in the next sections.
25+
:::
26+
2327
<StackBlitzGithub repoPath="zenstackhq/v3-doc-plugin" openFile="zenstack/password-plugin/plugin.zmodel" />
2428

2529
:::info
@@ -39,6 +43,20 @@ model User {
3943
}
4044
```
4145

46+
### Parameter and return types
47+
48+
The following types can be used for attribute parameters and function parameters and returns:
49+
50+
- String
51+
- Int
52+
- Float
53+
- Boolean
54+
- DateTime
55+
- Object
56+
- Any
57+
58+
A parameter can be set optional by suffixing its type with a `?`.
59+
4260
## Generating custom artifacts
4361

4462
The `zen` CLI is extensible via plugins and allows you to generate custom artifacts from the ZModel schema. To continue the previous example, let's create a very simple CLI plugin that generates a markdown document listing all model fields marked as passwords.

0 commit comments

Comments
 (0)