Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mention calling produceBase for options to pass to producePreset #142

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/site/src/content/docs/engine/apis/producers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,23 @@ const preset = base.createPreset({
await producePreset(preset, { options: { title: "My App" } });
```

### Adding Base Options

Although presets are associated with [Bases](../concepts/bases), running `producePreset` does not automatically run [`produceBase`](#producebase).
If you want to include the inferred options from a Preset's Base you'll have to call the `produceBase` API first yourself.

For example, this directly passes produced Options from a Base to a Preset:

```ts
import { base } from "./base";
import { preset } from "./preset";

const options = await produceBase(base);

// { creation: ... }
await producePreset(preset, { options });
```

### `addons` {#preset-addons}

Any additional [Addons](../concepts/blocks#addons) to provide to Blocks.
Expand Down
Loading