Skip to content

Commit

Permalink
feat(svelte): add svelte-kit example
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed Nov 27, 2024
1 parent 0a65018 commit 68242f0
Show file tree
Hide file tree
Showing 17 changed files with 1,166 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/svelte/src/lib/components/avatar/avatar-context.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script module lang="ts">
import type { UseAvatarContext } from './use-avatar-context'
import type { UseAvatarContext } from './use-avatar-context'
export interface AvatarContextProps {
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
api?: (avatar: UseAvatarContext) => any
}
export interface AvatarContextProps {
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
api?: (avatar: UseAvatarContext) => any
}
</script>

<script lang="ts">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Avatar } from '@ark-ui/svelte/avatar'
import { Avatar } from '@ark-ui/svelte/avatar'
</script>

<Avatar.Root>
Expand Down
21 changes: 21 additions & 0 deletions templates/svelte/svelte-kit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
node_modules

# Output
.output
.vercel
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions templates/svelte/svelte-kit/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
38 changes: 38 additions & 0 deletions templates/svelte/svelte-kit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# sv

Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npx sv create

# create a new project in my-app
npx sv create my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
24 changes: 24 additions & 0 deletions templates/svelte/svelte-kit/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "svelte-kit",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "3.3.1",
"@sveltejs/kit": "2.8.5",
"@sveltejs/vite-plugin-svelte": "5.0.1",
"svelte": "5.2.9",
"svelte-check": "4.1.0",
"typescript": "5.7.2",
"vite": "6.0.1"
},
"dependencies": {
"@ark-ui/svelte": "^0.1.0"
}
}
Loading

0 comments on commit 68242f0

Please sign in to comment.