forked from cotyhamilton/deno-sveltekit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a5bcb1d
Showing
32 changed files
with
33,680 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# deno sveltekit | ||
|
||
## create project | ||
|
||
```bash | ||
deno run -A npm:create-svelte@latest my-app | ||
cd my-app | ||
deno types > src/deno.d.ts | ||
``` | ||
|
||
## replace adapter | ||
|
||
I like [sveltekit-adapter-deno](https://github.com/dbushell/sveltekit-adapter-deno) | ||
|
||
The rest of the instructions are tailored to using this adapter, adjust as needed if you choose differently. | ||
|
||
```bash | ||
deno remove @sveltejs/adapter-auto | ||
deno add npm:sveltekit-adapter-deno | ||
``` | ||
|
||
Update `svelte.config.js` | ||
|
||
```diff | ||
- import adapter from '@sveltejs/adapter-auto'; | ||
+ import adapter from 'sveltekit-adapter-deno'; | ||
``` | ||
|
||
## develop | ||
|
||
Install dependencies | ||
|
||
```bash | ||
DENO_FUTURE=1 deno install | ||
``` | ||
|
||
Run the dev server | ||
|
||
```bash | ||
DENO_FUTURE=1 deno task dev | ||
``` | ||
|
||
## build | ||
|
||
```bash | ||
DENO_FUTURE=1 deno task build | ||
``` | ||
|
||
Run production server | ||
|
||
> ⚠️ `--no-lock` is required until deno deploy supports latest version of lockfile | ||
```bash | ||
DENO_FUTURE=1 deno run -REN --no-lock build/mod.ts | ||
``` | ||
|
||
## deploy | ||
|
||
```bash | ||
DENO_FUTURE=1 deno task build | ||
cd build | ||
deployctl deploy --entrypoint=mod.ts | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "deno-svelte", | ||
"version": "0.0.1", | ||
"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": { | ||
"@fontsource/fira-mono": "^4.5.10", | ||
"@neoconfetti/svelte": "^1.0.0", | ||
"@sveltejs/kit": "^2.0.0", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.0", | ||
"svelte": "^5.0.0-next.1", | ||
"svelte-check": "^3.6.0", | ||
"typescript": "^5.0.0", | ||
"vite": "^5.0.3" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"sveltekit-adapter-deno": "^0.12.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
@import '@fontsource/fira-mono'; | ||
|
||
:root { | ||
--font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, | ||
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
--font-mono: 'Fira Mono', monospace; | ||
--color-bg-0: rgb(202, 216, 228); | ||
--color-bg-1: hsl(209, 36%, 86%); | ||
--color-bg-2: hsl(224, 44%, 95%); | ||
--color-theme-1: #ff3e00; | ||
--color-theme-2: #4075a6; | ||
--color-text: rgba(0, 0, 0, 0.7); | ||
--column-width: 42rem; | ||
--column-margin-top: 4rem; | ||
font-family: var(--font-body); | ||
color: var(--color-text); | ||
} | ||
|
||
body { | ||
min-height: 100vh; | ||
margin: 0; | ||
background-attachment: fixed; | ||
background-color: var(--color-bg-1); | ||
background-size: 100vw 100vh; | ||
background-image: radial-gradient( | ||
50% 50% at 50% 50%, | ||
rgba(255, 255, 255, 0.75) 0%, | ||
rgba(255, 255, 255, 0) 100% | ||
), | ||
linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 15%, var(--color-bg-2) 50%); | ||
} | ||
|
||
h1, | ||
h2, | ||
p { | ||
font-weight: 400; | ||
} | ||
|
||
p { | ||
line-height: 1.5; | ||
} | ||
|
||
a { | ||
color: var(--color-theme-1); | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
h1 { | ||
font-size: 2rem; | ||
text-align: center; | ||
} | ||
|
||
h2 { | ||
font-size: 1rem; | ||
} | ||
|
||
pre { | ||
font-size: 16px; | ||
font-family: var(--font-mono); | ||
background-color: rgba(255, 255, 255, 0.45); | ||
border-radius: 3px; | ||
box-shadow: 2px 2px 6px rgb(255 255 255 / 25%); | ||
padding: 0.5em; | ||
overflow-x: auto; | ||
color: var(--color-text); | ||
} | ||
|
||
.text-column { | ||
display: flex; | ||
max-width: 48rem; | ||
flex: 0.6; | ||
flex-direction: column; | ||
justify-content: center; | ||
margin: 0 auto; | ||
} | ||
|
||
input, | ||
button { | ||
font-size: inherit; | ||
font-family: inherit; | ||
} | ||
|
||
button:focus:not(:focus-visible) { | ||
outline: none; | ||
} | ||
|
||
@media (min-width: 720px) { | ||
h1 { | ||
font-size: 2.4rem; | ||
} | ||
} | ||
|
||
.visually-hidden { | ||
border: 0; | ||
clip: rect(0 0 0 0); | ||
height: auto; | ||
margin: 0; | ||
overflow: hidden; | ||
padding: 0; | ||
position: absolute; | ||
width: 1px; | ||
white-space: nowrap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// See https://kit.svelte.dev/docs/types#app | ||
// for information about these interfaces | ||
declare global { | ||
namespace App { | ||
// interface Error {} | ||
// interface Locals {} | ||
// interface PageData {} | ||
// interface PageState {} | ||
// interface Platform {} | ||
} | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
</html> |
Oops, something went wrong.