mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-06 04:21:38 +00:00
adds static adapter, removes some links to non-existing files
This commit is contained in:
21
.svelte/dev/components/error.svelte
Normal file
21
.svelte/dev/components/error.svelte
Normal file
@@ -0,0 +1,21 @@
|
||||
<script context="module">
|
||||
export function load({ error, status }) {
|
||||
return {
|
||||
props: { error, status }
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let status;
|
||||
export let error;
|
||||
</script>
|
||||
|
||||
<h1>{status}</h1>
|
||||
|
||||
<p>{error.message}</p>
|
||||
|
||||
<!-- TODO figure out what to do with stacktraces in prod -->
|
||||
{#if error.stack}
|
||||
<pre>{error.stack}</pre>
|
||||
{/if}
|
||||
1
.svelte/dev/components/layout.svelte
Normal file
1
.svelte/dev/components/layout.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<slot></slot>
|
||||
27
.svelte/dev/generated/manifest.js
Normal file
27
.svelte/dev/generated/manifest.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const c = [
|
||||
() => import("../../../src/routes/$layout.svelte"),
|
||||
() => import("../components/error.svelte"),
|
||||
() => import("../../../src/routes/index.svelte"),
|
||||
() => import("../../../src/routes/cheatsheet/index.svelte")
|
||||
];
|
||||
|
||||
const d = decodeURIComponent;
|
||||
|
||||
export const routes = [
|
||||
// src/routes/index.svelte
|
||||
[/^\/$/, [c[0], c[2]], [c[1]]],
|
||||
|
||||
// src/routes/cheatsheet/index.svelte
|
||||
[/^\/cheatsheet\/?$/, [c[0], c[3]], [c[1]]],
|
||||
|
||||
// src/routes/cheatsheet/cheat-sheet.js
|
||||
[/^\/cheatsheet\/cheat-sheet\/?$/],
|
||||
|
||||
// src/routes/cheatsheet/highlight.css
|
||||
[/^\/cheatsheet\/highlight\/?$/],
|
||||
|
||||
// src/routes/metatag.png
|
||||
[/^\/metatag\/?$/]
|
||||
];
|
||||
|
||||
export const fallback = [c[0](), c[1]()];
|
||||
66
.svelte/dev/generated/root.svelte
Normal file
66
.svelte/dev/generated/root.svelte
Normal file
@@ -0,0 +1,66 @@
|
||||
<!-- This file is generated by @sveltejs/kit — do not edit it! -->
|
||||
<script>
|
||||
import { setContext, afterUpdate, onMount } from 'svelte';
|
||||
|
||||
// stores
|
||||
export let stores;
|
||||
export let page;
|
||||
|
||||
export let components;
|
||||
export let props_0 = null;
|
||||
export let props_1 = null;
|
||||
export let props_2 = null;
|
||||
|
||||
setContext('__svelte__', stores);
|
||||
|
||||
$: stores.page.set(page);
|
||||
afterUpdate(stores.page.notify);
|
||||
|
||||
let mounted = false;
|
||||
let navigated = false;
|
||||
let title = null;
|
||||
|
||||
onMount(() => {
|
||||
const unsubscribe = stores.page.subscribe(() => {
|
||||
if (mounted) {
|
||||
navigated = true;
|
||||
title = document.title || 'untitled page';
|
||||
}
|
||||
});
|
||||
|
||||
mounted = true;
|
||||
return unsubscribe;
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:component this={components[0]} {...(props_0 || {})}>
|
||||
{#if components[1]}
|
||||
<svelte:component this={components[1]} {...(props_1 || {})}>
|
||||
{#if components[2]}
|
||||
<svelte:component this={components[2]} {...(props_2 || {})}/>
|
||||
{/if}
|
||||
</svelte:component>
|
||||
{/if}
|
||||
</svelte:component>
|
||||
|
||||
{#if mounted}
|
||||
<div id="svelte-announcer" aria-live="assertive" aria-atomic="true">
|
||||
{#if navigated}
|
||||
{title}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
#svelte-announcer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
clip-path: inset(50%);
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
</style>
|
||||
16
.svelte/dev/runtime/app/env.js
Normal file
16
.svelte/dev/runtime/app/env.js
Normal file
@@ -0,0 +1,16 @@
|
||||
export { prerendering } from '../env.js';
|
||||
|
||||
/**
|
||||
* @type {import('$app/env').browser}
|
||||
*/
|
||||
const browser = !import.meta.env.SSR;
|
||||
/**
|
||||
* @type {import('$app/env').dev}
|
||||
*/
|
||||
const dev = !!import.meta.env.DEV;
|
||||
/**
|
||||
* @type {import('$app/env').amp}
|
||||
*/
|
||||
const amp = !!import.meta.env.VITE_SVELTEKIT_AMP;
|
||||
|
||||
export { amp, browser, dev };
|
||||
44
.svelte/dev/runtime/app/navigation.js
Normal file
44
.svelte/dev/runtime/app/navigation.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import { router } from '../internal/singletons.js';
|
||||
import { g as get_base_uri } from '../chunks/utils.js';
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
*/
|
||||
function guard(name) {
|
||||
return () => {
|
||||
throw new Error(`Cannot call ${name}(...) on the server`);
|
||||
};
|
||||
}
|
||||
|
||||
const goto = import.meta.env.SSR ? guard('goto') : goto_;
|
||||
const prefetch = import.meta.env.SSR ? guard('prefetch') : prefetch_;
|
||||
const prefetchRoutes = import.meta.env.SSR ? guard('prefetchRoutes') : prefetchRoutes_;
|
||||
|
||||
/**
|
||||
* @type {import('$app/navigation').goto}
|
||||
*/
|
||||
async function goto_(href, opts) {
|
||||
return router.goto(href, opts, []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import('$app/navigation').prefetch}
|
||||
*/
|
||||
function prefetch_(href) {
|
||||
return router.prefetch(new URL(href, get_base_uri(document)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import('$app/navigation').prefetchRoutes}
|
||||
*/
|
||||
async function prefetchRoutes_(pathnames) {
|
||||
const matching = pathnames
|
||||
? router.routes.filter((route) => pathnames.some((pathname) => route[0].test(pathname)))
|
||||
: router.routes;
|
||||
|
||||
const promises = matching.map((r) => r.length !== 1 && Promise.all(r[1].map((load) => load())));
|
||||
|
||||
await Promise.all(promises);
|
||||
}
|
||||
|
||||
export { goto, prefetch, prefetchRoutes };
|
||||
1
.svelte/dev/runtime/app/paths.js
Normal file
1
.svelte/dev/runtime/app/paths.js
Normal file
@@ -0,0 +1 @@
|
||||
export { assets, base } from '../paths.js';
|
||||
87
.svelte/dev/runtime/app/stores.js
Normal file
87
.svelte/dev/runtime/app/stores.js
Normal file
@@ -0,0 +1,87 @@
|
||||
import { getContext } from 'svelte';
|
||||
|
||||
// const ssr = (import.meta as any).env.SSR;
|
||||
const ssr = typeof window === 'undefined'; // TODO why doesn't previous line work in build?
|
||||
|
||||
// TODO remove this (for 1.0? after 1.0?)
|
||||
let warned = false;
|
||||
function stores() {
|
||||
if (!warned) {
|
||||
console.error('stores() is deprecated; use getStores() instead');
|
||||
warned = true;
|
||||
}
|
||||
return getStores();
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import('$app/stores').getStores}
|
||||
*/
|
||||
const getStores = () => {
|
||||
const stores = getContext('__svelte__');
|
||||
|
||||
return {
|
||||
page: {
|
||||
subscribe: stores.page.subscribe
|
||||
},
|
||||
navigating: {
|
||||
subscribe: stores.navigating.subscribe
|
||||
},
|
||||
// @ts-ignore - deprecated, not part of type definitions, but still callable
|
||||
get preloading() {
|
||||
console.error('stores.preloading is deprecated; use stores.navigating instead');
|
||||
return {
|
||||
subscribe: stores.navigating.subscribe
|
||||
};
|
||||
},
|
||||
session: stores.session
|
||||
};
|
||||
};
|
||||
|
||||
/** @type {typeof import('$app/stores').page} */
|
||||
const page = {
|
||||
/** @param {(value: any) => void} fn */
|
||||
subscribe(fn) {
|
||||
const store = getStores().page;
|
||||
return store.subscribe(fn);
|
||||
}
|
||||
};
|
||||
|
||||
/** @type {typeof import('$app/stores').navigating} */
|
||||
const navigating = {
|
||||
/** @param {(value: any) => void} fn */
|
||||
subscribe(fn) {
|
||||
const store = getStores().navigating;
|
||||
return store.subscribe(fn);
|
||||
}
|
||||
};
|
||||
|
||||
/** @param {string} verb */
|
||||
const error = (verb) => {
|
||||
throw new Error(
|
||||
ssr
|
||||
? `Can only ${verb} session store in browser`
|
||||
: `Cannot ${verb} session store before subscribing`
|
||||
);
|
||||
};
|
||||
|
||||
/** @type {typeof import('$app/stores').session} */
|
||||
const session = {
|
||||
subscribe(fn) {
|
||||
const store = getStores().session;
|
||||
|
||||
if (!ssr) {
|
||||
session.set = store.set;
|
||||
session.update = store.update;
|
||||
}
|
||||
|
||||
return store.subscribe(fn);
|
||||
},
|
||||
set: (value) => {
|
||||
error('set');
|
||||
},
|
||||
update: (updater) => {
|
||||
error('update');
|
||||
}
|
||||
};
|
||||
|
||||
export { getStores, navigating, page, session, stores };
|
||||
13
.svelte/dev/runtime/chunks/utils.js
Normal file
13
.svelte/dev/runtime/chunks/utils.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/** @param {HTMLDocument} doc */
|
||||
function get_base_uri(doc) {
|
||||
let baseURI = doc.baseURI;
|
||||
|
||||
if (!baseURI) {
|
||||
const baseTags = doc.getElementsByTagName('base');
|
||||
baseURI = baseTags.length ? baseTags[0].href : doc.URL;
|
||||
}
|
||||
|
||||
return baseURI;
|
||||
}
|
||||
|
||||
export { get_base_uri as g };
|
||||
8
.svelte/dev/runtime/env.js
Normal file
8
.svelte/dev/runtime/env.js
Normal file
@@ -0,0 +1,8 @@
|
||||
let prerendering = false;
|
||||
|
||||
/** @param {boolean} value */
|
||||
function set_prerendering(value) {
|
||||
prerendering = value;
|
||||
}
|
||||
|
||||
export { prerendering, set_prerendering };
|
||||
20
.svelte/dev/runtime/internal/singletons.js
Normal file
20
.svelte/dev/runtime/internal/singletons.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/** @type {import('./router').Router} */
|
||||
let router;
|
||||
|
||||
/** @type {string} */
|
||||
let base = '';
|
||||
|
||||
/** @type {string} */
|
||||
let assets = '/.';
|
||||
|
||||
/** @param {import('./router').Router} _ */
|
||||
function init(_) {
|
||||
router = _;
|
||||
}
|
||||
|
||||
/** @param {{ base: string, assets: string }} paths */
|
||||
function set_paths(paths) {
|
||||
({ base, assets } = paths);
|
||||
}
|
||||
|
||||
export { assets, base, init, router, set_paths };
|
||||
1021
.svelte/dev/runtime/internal/start.js
Normal file
1021
.svelte/dev/runtime/internal/start.js
Normal file
File diff suppressed because it is too large
Load Diff
12
.svelte/dev/runtime/paths.js
Normal file
12
.svelte/dev/runtime/paths.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/** @type {string} */
|
||||
let base = '';
|
||||
|
||||
/** @type {string} */
|
||||
let assets = '/.';
|
||||
|
||||
/** @param {{ base: string, assets: string }} paths */
|
||||
function set_paths(paths) {
|
||||
({ base, assets } = paths);
|
||||
}
|
||||
|
||||
export { assets, base, set_paths };
|
||||
5856
package-lock.json
generated
Normal file
5856
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-static": "^1.0.0-next.13",
|
||||
"@sveltejs/kit": "next",
|
||||
"@typescript-eslint/eslint-plugin": "^4.19.0",
|
||||
"@typescript-eslint/parser": "^4.19.0",
|
||||
|
||||
2161
pnpm-lock.yaml
generated
2161
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,6 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
%svelte.head%
|
||||
</head>
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
<svelte:head>
|
||||
<title>Svelte Recipes</title>
|
||||
<link rel="stylesheet" href="/prism.css" />
|
||||
</svelte:head>
|
||||
|
||||
<div class="container">
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
import preprocess from 'svelte-preprocess';
|
||||
import { mdsvex } from 'mdsvex';
|
||||
|
||||
@@ -18,6 +19,7 @@ const config = {
|
||||
],
|
||||
extensions: extensions,
|
||||
kit: {
|
||||
adapter: adapter(),
|
||||
// hydrate the <div id="svelte"> element in src/app.html
|
||||
target: '#svelte'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user