Skip to content

Commit

Permalink
chore: shuffle things around to use svelte files
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Jan 10, 2025
1 parent a105341 commit 3bd7f33
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
20 changes: 20 additions & 0 deletions packages/svelte-form/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Svelte</title>
</head>
<body>
<div id="app"></div>
<script type="module">
import * as ts from './src/index.ts';
import { mount } from 'svelte';
import App from './tests/simple.svelte';

const app = mount(App, {
target: document.getElementById('app')
});
</script>
</body>
</html>
5 changes: 3 additions & 2 deletions packages/svelte-form/src/Field.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
">
import type { Snippet } from 'svelte';
// TODO (43081j): somehow remove this circular reference
import { createField } from './createField';
import { createField } from './createField.svelte.js';
type Props = {
children: Snippet<[
Expand All @@ -33,7 +33,8 @@
>;
let {
children
children,
...fieldOptions
}: Props = $props();
const fieldApi = createField<
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FormApi } from '@tanstack/form-core'
import { onMount } from 'svelte'
import { createField } from './createField.js'
import { createField } from './createField.svelte.js'
import Field from './Field.svelte';
import type { FormOptions, Validator } from '@tanstack/form-core'
import type { CreateField } from './createField.js';
import type { CreateField } from './createField.svelte.js';

export interface SvelteFormApi<
TFormData,
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte-form/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from '@tanstack/form-core'

export { createForm, type SvelteFormApi } from './createForm.js'
export { createForm, type SvelteFormApi } from './createForm.svelte.js'

export type { Field } from './Field.svelte'
export { createField } from './createField.js'
export { createField } from './createField.svelte.js'

0 comments on commit 3bd7f33

Please sign in to comment.