Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .changeset/drop-fixtures-from-npm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@formhaus/core": patch
---

Fixtures are no longer published to npm. They were demo data for the docs/playground, not part of the public API, and the only way to import them (`@formhaus/core/fixtures/*.json`) was already broken under strict ESM resolution because they were never in the `exports` map.

The Quick Start guide now shows a literal definition object instead of an import. The fixtures themselves stay in the repo for the playground and tests.
16 changes: 14 additions & 2 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ Or use `@formhaus/core` directly with any framework. See the [Svelte example in

## Quick start

```ts
const definition = {
id: 'contact',
title: 'Contact Us',
submit: { label: 'Send' },
fields: [
{ key: 'name', type: 'text', label: 'Name', validation: { required: true } },
{ key: 'email', type: 'email', label: 'Email', validation: { required: true } },
],
};
```

::: code-group
```vue [Vue]
<script setup>
import { FormRenderer } from '@formhaus/vue';
import definition from '@formhaus/core/fixtures/basic-form.json';
import definition from './contact-form.json';

function onSubmit(values) {
console.log(values);
Expand All @@ -38,7 +50,7 @@ function onSubmit(values) {

```tsx [React]
import { FormRenderer } from '@formhaus/react';
import definition from '@formhaus/core/fixtures/basic-form.json';
import definition from './contact-form.json';

function MyForm() {
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
}
},
"files": [
"dist",
"fixtures"
"dist"
],
"scripts": {
"build": "tsup",
Expand Down
Loading