Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert site to SvelteKit #466

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 10 additions & 12 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",
"mdsvex": "^0.11.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": "^1.26.0",
"@sveltejs/adapter-auto": "^2.1.0",
"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": "^4.2.2",
"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": "^4.5.0"
}
}
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 id="main">%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
2 changes: 1 addition & 1 deletion packages/site/src/components/Repl/Repl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

export let workersUrl;
export let packagesUrl = "https://unpkg.com";
export let svelteUrl = `${packagesUrl}/svelte`;
export let svelteUrl = `${packagesUrl}/svelte@3`;
export let orientation = "columns";
export let relaxed = false;
export let fixed = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<script>
export let status;
export let error;

const dev = process.env.NODE_ENV === 'development';
import { page } from '$app/stores';
</script>

<style>
Expand All @@ -28,13 +25,13 @@
</style>

<svelte:head>
<title>{status}</title>
<title>{$page.status}</title>
</svelte:head>

<h1>{status}</h1>

<p>{error.message}</p>

{#if dev && error.stack}
<pre>{error.stack}</pre>
{#if $page.error.message}
<p class="error">{status}: {$page.error.message}</p>
{:else}
<p class="error">Encountered a {$page.status} error</p>
{/if}
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<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';
import Cheatsheet from '../components/Cheatsheet.svx';
import docs from '../_docs.svtext';
import Cheatsheet from '../../components/Cheatsheet.svx';

let root;
let scrollY = 0;
let width = 1100;
let current;
let position = '';

const { page } = stores();

const nav = [
['Install', 'docs#install-it'],
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
import { onMount } from "svelte";
import Repl from "../components/Repl/Repl.svelte";
import { code_1, code_2, code_3, code_4, code_5 } from "./_source.js";
import Repl from "../../components/Repl/Repl.svelte";
import { code_1, code_2, code_3, code_4, code_5 } from "../_source.js";

let repl;
let checked = "input";
Expand Down
17 changes: 0 additions & 17 deletions packages/site/src/server.js

This file was deleted.

Loading