-
Notifications
You must be signed in to change notification settings - Fork 26
/
Schema.svelte
46 lines (41 loc) · 1.32 KB
/
Schema.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<script lang="ts">
import { getSettings } from '$lib/settings';
const settings = getSettings();
</script>
<div class="flex items-center gap-1">
<span>I'm using</span>
<select class="select w-24 max-w-24" bind:value={$settings.pm}>
<option value="npm i -D">npm</option>
<option value="pnpm i -D">pnpm</option>
<option value="yarn add --dev">yarn</option>
</select>
<span>and my validation library is</span>
<select class="select w-28 max-w-28" bind:value={$settings.lib}>
<option value="">Choose:</option>
<option value="ajv">Ajv</option>
<option value="arktype">Arktype</option>
<option value="joi">Joi</option>
<option value="@sinclair/typebox">TypeBox</option>
<option value="valibot">Valibot</option>
<option value="yup">Yup</option>
<option value="zod">Zod</option>
</select>
</div>
{#if $settings.lib == 'ajv'}
<aside class="alert variant-ghost-primary mt-2">
<div class="alert-message">
Ajv is not yet available due to ESM incompatibility.
</div>
</aside>
{:else}
<pre class="installer language-bash copy-visible"><code class="language-bash"
>{$settings.pm} sveltekit-superforms {$settings.lib}</code></pre>
{/if}
<style lang="scss">
select {
max-width: 112px !important;
}
:global(.copy-content) {
visibility: visible !important;
}
</style>