Skip to content

Commit

Permalink
Convert site to SvelteKit
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 20, 2023
1 parent 26591be commit aa346dd
Show file tree
Hide file tree
Showing 15 changed files with 970 additions and 573 deletions.
6 changes: 2 additions & 4 deletions packages/site/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.DS_Store
node_modules
yarn-error.log
/node_modules
/cypress/screenshots/
/__sapper__/
dist
/.svelte-kit
20 changes: 9 additions & 11 deletions packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "sapper dev --ext '.svelte .svx'",
"build:site": "sapper build --legacy --ext '.svelte .svx'",
"export": "sapper export --legacy --ext '.svelte .svx'",
"start": "node __sapper__/build",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"cy:run": "cypress run",
"cy:open": "cypress open",
"test": "run-p --race dev cy:run",
"generate-workers": "rollup -c rollup.workers.js"
},
"private": "true",
"dependencies": {
"compression": "^1.7.1",
"mdsvex": "^0.7.1-beta.3",
"polka": "^0.5.0",
"refractor": "^2.10.0",
"sirv": "^0.4.0",
"yootils": "^0.0.15"
},
"devDependencies": {
Expand All @@ -33,20 +29,22 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"@rollup/plugin-replace": "^3.0.0",
"@sveltejs/kit": "next",
"@sveltejs/adapter-auto": "next",
"codemirror": "^5.49.2",
"npm-run-all": "^4.1.5",
"prism-svelte": "^0.4.4",
"prism-svelte": "^0.5.0",
"rehype-autolink-headings": "^2.0.5",
"rehype-slug": "^2.0.3",
"remark-syntax-highlight": "^0.1.3",
"rollup": "^2.58.0",
"rollup-plugin-svelte": "^7.1.0",
"rollup-plugin-terser": "^7.0.2",
"sapper": "^0.29.3",
"svelte": "^3.7.1",
"svelte": "^3.49.0",
"svelte-json-tree": "^0.0.7",
"typeface-catamaran": "^0.0.72",
"typeface-roboto": "^0.0.75",
"unist-util-visit": "^2.0.1"
"unist-util-visit": "^2.0.1",
"vite": "^3.0.4"
}
}
150 changes: 0 additions & 150 deletions packages/site/rollup.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta charset="utf-8" />

%sapper.base%

<link rel="stylesheet" href="global.css" />
<link rel="manifest" href="manifest.json" />
<link rel="preload" as="image" href="/penguin.gif" />
Expand Down Expand Up @@ -48,14 +46,12 @@
/>
<meta property="twitter:image" content="https://mdsvex.com/og.png" />

%sapper.styles% %sapper.head%
%sveltekit.head%
</head>

<body>
<div id="sapper">%sapper.html%</div>
<div>%sveltekit.body%</div>

%sapper.scripts%

<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "590d70c530b74f41b117351532dd6809"}'></script><!-- End Cloudflare Web Analytics -->
</body>
</html>
5 changes: 0 additions & 5 deletions packages/site/src/client.js

This file was deleted.

4 changes: 1 addition & 3 deletions packages/site/src/components/Nav.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script>
import { stores } from "@sapper/app";
import { page } from "$app/stores";
import GithubIcon from "./GithubIcon.svelte";
const { page } = stores();
let w;
const links = [
["/", "mdsvex"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export let handle_select;
export let funky;
const { components, selected, request_focus, rebundle } = getContext("REPL");
let { components, selected, request_focus, rebundle } = getContext("REPL");
let editing = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import { dev } from '$app/env';
export let status;
export let error;
const dev = process.env.NODE_ENV === 'development';
</script>

<style>
Expand Down Expand Up @@ -33,7 +33,11 @@

<h1>{status}</h1>

<p>{error.message}</p>
{#if error.message}
<p class="error">{status}: {error.message}</p>
{:else}
<p class="error">Encountered a {status} error</p>
{/if}

{#if dev && error.stack}
<pre>{error.stack}</pre>
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions packages/site/src/routes/docs.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { stores } from '@sapper/app';
import { page } from '$app/stores';
import { onMount } from 'svelte';
import { fade } from 'svelte/transition';
import docs from './_docs.svtext';
Expand All @@ -11,8 +11,6 @@
let current;
let position = '';
const { page } = stores();
const nav = [
['Install', 'docs#install-it'],
[
Expand Down
17 changes: 0 additions & 17 deletions packages/site/src/server.js

This file was deleted.

Loading

0 comments on commit aa346dd

Please sign in to comment.