Skip to content

Commit 40b872c

Browse files
committed
feat: add new cmd in the Playground sv create --from-playground
1 parent 65c0da5 commit 40b872c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/repl/src/lib/Input/ComponentSelector.svelte

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import type { Workspace, File } from '../Workspace.svelte';
44
import { tick } from 'svelte';
55
import { Checkbox, Toolbox } from '@sveltejs/site-kit/components';
6+
import { page } from '$app/state';
7+
import { SvelteURL, SvelteURLSearchParams } from 'svelte/reactivity';
68
79
interface Props {
810
runes: boolean;
@@ -189,6 +191,17 @@
189191
{#if download}
190192
<button onclick={download}>Download app</button>
191193
{/if}
194+
195+
<button
196+
onclick={() => {
197+
navigator.clipboard.writeText(
198+
`npx sv create --from-playground="${window.location.href}"`
199+
);
200+
alert('Copied to clipboard! You can now paste it into your terminal.');
201+
}}
202+
>
203+
Copy <code>sv create --from-playground</code>
204+
</button>
192205
</Toolbox>
193206
</div>
194207
</div>

0 commit comments

Comments
 (0)