docs: address review feedback on code style in examples

Replace `Promise.resolve(...)` with `async` functions in scaffolder
FormFieldBlueprint.make examples, and switch the TechDocs custom home
page example to use the `plugin.withOverrides` pattern instead of
`createFrontendModule`.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-04-04 12:34:50 +02:00
parent 561f555fb1
commit 18fde07e06
2 changed files with 37 additions and 46 deletions
@@ -100,14 +100,12 @@ import {
export const ValidateKebabCaseFieldExtension = FormFieldBlueprint.make({
name: 'validate-kebab-case',
params: {
field: () =>
Promise.resolve(
createFormField({
name: 'ValidateKebabCase',
component: ValidateKebabCase,
validation: validateKebabCaseValidation,
}),
),
field: async () =>
createFormField({
name: 'ValidateKebabCase',
component: ValidateKebabCase,
validation: validateKebabCaseValidation,
}),
},
});
```
@@ -210,14 +208,12 @@ const CustomFieldExtensionComponent = (props: FieldExtensionComponentProps<strin
const CustomFieldExtension = FormFieldBlueprint.make({
name: 'custom-field',
params: {
field: () =>
Promise.resolve(
createFormField({
name: 'custom-field',
component: CustomFieldExtensionComponent,
validation: ...,
}),
),
field: async () =>
createFormField({
name: 'custom-field',
component: CustomFieldExtensionComponent,
validation: ...,
}),
},
});
```
@@ -285,14 +281,12 @@ import {
export const MyCustomFieldWithOptionsExtension = FormFieldBlueprint.make({
name: 'MyCustomExtensionWithOptions',
params: {
field: () =>
Promise.resolve(
createFormField({
name: 'MyCustomExtensionWithOptions',
component: MyCustomExtensionWithOptions,
schema: MyCustomExtensionWithOptionsSchema,
}),
),
field: async () =>
createFormField({
name: 'MyCustomExtensionWithOptions',
component: MyCustomExtensionWithOptions,
schema: MyCustomExtensionWithOptionsSchema,
}),
},
});
```