Merge branch 'master' into feat/orama

feat/orama
Puru Vijay 2 years ago
commit 1a87812b31

@ -0,0 +1 @@
playwright_skip_browser_download=1

@ -97,6 +97,8 @@ Test samples are kept in `/test/xxx/samples` folder.
#### Running tests #### Running tests
> PREREQUISITE: Install chromium via playwright by running `pnpm playwright install chromium`
1. To run test, run `pnpm test`. 1. To run test, run `pnpm test`.
1. To run test for a specific feature, you can use the `-g` (aka `--grep`) option. For example, to only run test involving transitions, run `pnpm test -- -g transition`. 1. To run test for a specific feature, you can use the `-g` (aka `--grep`) option. For example, to only run test involving transitions, run `pnpm test -- -g transition`.

@ -521,7 +521,7 @@ Transitions are local by default (in Svelte 3, they were global by default). Loc
{/if} {/if}
``` ```
> By default intro transitions will not play on first render. You can modify this behaviour by setting `intro: true` when you [create a component](/docs#run-time-client-side-component-api) and marking the transition as `global`. > By default intro transitions will not play on first render. You can modify this behaviour by setting `intro: true` when you [create a component](/docs/client-side-component-api) and marking the transition as `global`.
## Transition parameters ## Transition parameters

@ -157,7 +157,76 @@ This makes slot bindings more consistent as the behavior is undefined when for e
## Preprocessors ## Preprocessors
The order in which preprocessors are applied has changed. Now, preprocessors are executed in order, and within one group, the order is markup, script, style. Each preprocessor must also have a name. ([#8618](https://github.com/sveltejs/svelte/issues/8618)) The order in which preprocessors are applied has changed. Now, preprocessors are executed in order, and within one group, the order is markup, script, style.
```js
// @errors: 2304
import { preprocess } from 'svelte/compiler';
const { code } = await preprocess(
source,
[
{
markup: () => {
console.log('markup-1');
},
script: () => {
console.log('script-1');
},
style: () => {
console.log('style-1');
}
},
{
markup: () => {
console.log('markup-2');
},
script: () => {
console.log('script-2');
},
style: () => {
console.log('style-2');
}
}
],
{
filename: 'App.svelte'
}
);
// Svelte 3 logs:
// markup-1
// markup-2
// script-1
// script-2
// style-1
// style-2
// Svelte 4 logs:
// markup-1
// script-1
// style-1
// markup-2
// script-2
// style-2
```
This could affect you for example if you are using `MDsveX` - in which case you should make sure it comes before any script or style preprocessor.
```diff
preprocess: [
- vitePreprocess(),
- mdsvex(mdsvexConfig)
+ mdsvex(mdsvexConfig),
+ vitePreprocess()
]
```
Each preprocessor must also have a name. ([#8618](https://github.com/sveltejs/svelte/issues/8618))
## New eslint package
`eslint-plugin-svelte3` is deprecated. It may still work with Svelte 4 but we make no guarantees about that. We recommend switching to our new package [eslint-plugin-svelte](https://github.com/sveltejs/eslint-plugin-svelte). See [this Github post](https://github.com/sveltejs/kit/issues/10242#issuecomment-1610798405) for an instruction how to migrate. Alternatively, you can create a new project using `npm create svelte@latest`, select the eslint (and possibly TypeScript) option and then copy over the related files into your existing project.
## Other breaking changes ## Other breaking changes

@ -9,6 +9,21 @@
} }
</script> </script>
<h1 style="color: {pin ? '#333' : '#ccc'}">{view}</h1> <h1 class:pin>{view}</h1>
<Keypad bind:value={pin} on:submit={handleSubmit} /> <Keypad bind:value={pin} on:submit={handleSubmit} />
<style>
h1 {
color: #ccc;
}
h1.pin {
color: #333;
}
:global(body.dark) h1 {
color: #444;
}
:global(body.dark) h1.pin {
color: #fff;
}
</style>

@ -86,12 +86,12 @@
} }
.tick line { .tick line {
stroke: #aaa; stroke: #888;
stroke-dasharray: 2; stroke-dasharray: 2;
} }
.tick text { .tick text {
fill: #666; fill: #888;
text-anchor: start; text-anchor: start;
} }

@ -50,8 +50,4 @@
font-size: 12px; font-size: 12px;
margin: 0 0 1em 0; margin: 0 0 1em 0;
} }
main :global(a) {
color: rgb(0, 0, 150);
}
</style> </style>

@ -33,8 +33,4 @@
position: absolute; position: absolute;
left: 0; left: 0;
} }
a {
color: #333;
}
</style> </style>

@ -5,8 +5,10 @@ title: Key blocks
Key blocks destroy and recreate their contents when the value of an expression changes. Key blocks destroy and recreate their contents when the value of an expression changes.
```svelte ```svelte
{#key value} {#key number}
<div transition:fade>{value}</div> <span style="display: inline-block" in:fade>
{number}
</span>
{/key} {/key}
``` ```

@ -16,6 +16,7 @@ sites/svelte.dev/.vercel
/test/**/expected* /test/**/expected*
/test/**/_output /test/**/_output
/test/**/shards/*.test.js /test/**/shards/*.test.js
/test/hydration/samples/raw-repair/_after.html
/types /types
!rollup.config.js !rollup.config.js
!vitest.config.js !vitest.config.js

@ -1,5 +1,19 @@
# svelte # svelte
## 4.0.5
### Patch Changes
- fix: generate type definition with nullable types ([#8924](https://github.com/sveltejs/svelte/pull/8924))
## 4.0.4
### Patch Changes
- fix: claim svg tags in raw mustache tags correctly ([#8910](https://github.com/sveltejs/svelte/pull/8910))
- fix: repair invalid raw html content during hydration ([#8912](https://github.com/sveltejs/svelte/pull/8912))
## 4.0.3 ## 4.0.3
### Patch Changes ### Patch Changes

@ -1,6 +1,6 @@
{ {
"name": "svelte", "name": "svelte",
"version": "4.0.3", "version": "4.0.5",
"description": "Cybernetically enhanced web apps", "description": "Cybernetically enhanced web apps",
"type": "module", "type": "module",
"module": "src/runtime/index.js", "module": "src/runtime/index.js",

@ -16,6 +16,9 @@ fs.writeFileSync('./types/compiler/interfaces.d.ts', `import '../index.js';`);
await createBundle({ await createBundle({
output: 'types/index.d.ts', output: 'types/index.d.ts',
compilerOptions: {
strict: true
},
modules: { modules: {
svelte: 'src/runtime/public.d.ts', svelte: 'src/runtime/public.d.ts',
'svelte/compiler': 'src/compiler/public.d.ts', 'svelte/compiler': 'src/compiler/public.d.ts',

@ -1,2 +1,2 @@
// This file is automatically generated // This file is automatically generated
export default new Set(["HtmlTag","HtmlTagHydration","ResizeObserverSingleton","SvelteComponent","SvelteComponentDev","SvelteComponentTyped","SvelteElement","action_destroyer","add_attribute","add_classes","add_flush_callback","add_iframe_resize_listener","add_location","add_render_callback","add_styles","add_transform","afterUpdate","append","append_dev","append_empty_stylesheet","append_hydration","append_hydration_dev","append_styles","assign","attr","attr_dev","attribute_to_object","beforeUpdate","bind","binding_callbacks","blank_object","bubble","check_outros","children","claim_comment","claim_component","claim_element","claim_html_tag","claim_space","claim_svg_element","claim_text","clear_loops","comment","component_subscribe","compute_rest_props","compute_slots","construct_svelte_component","construct_svelte_component_dev","contenteditable_truthy_values","createEventDispatcher","create_animation","create_bidirectional_transition","create_component","create_custom_element","create_in_transition","create_out_transition","create_slot","create_ssr_component","current_component","custom_event","dataset_dev","debug","destroy_block","destroy_component","destroy_each","detach","detach_after_dev","detach_before_dev","detach_between_dev","detach_dev","dirty_components","dispatch_dev","each","element","element_is","empty","end_hydrating","ensure_array_like","ensure_array_like_dev","escape","escape_attribute_value","escape_object","exclude_internal_props","fix_and_destroy_block","fix_and_outro_and_destroy_block","fix_position","flush","flush_render_callbacks","getAllContexts","getContext","get_all_dirty_from_scope","get_binding_group_value","get_current_component","get_custom_elements_slots","get_root_for_style","get_slot_changes","get_spread_object","get_spread_update","get_store_value","get_svelte_dataset","globals","group_outros","handle_promise","hasContext","has_prop","head_selector","identity","init","init_binding_group","init_binding_group_dynamic","insert","insert_dev","insert_hydration","insert_hydration_dev","intros","invalid_attribute_name_character","is_client","is_crossorigin","is_empty","is_function","is_promise","is_void","listen","listen_dev","loop","loop_guard","merge_ssr_styles","missing_component","mount_component","noop","not_equal","now","null_to_empty","object_without_properties","onDestroy","onMount","once","outro_and_destroy_block","prevent_default","prop_dev","query_selector_all","raf","resize_observer_border_box","resize_observer_content_box","resize_observer_device_pixel_content_box","run","run_all","safe_not_equal","schedule_update","select_multiple_value","select_option","select_options","select_value","self","setContext","set_attributes","set_current_component","set_custom_element_data","set_custom_element_data_map","set_data","set_data_contenteditable","set_data_contenteditable_dev","set_data_dev","set_data_maybe_contenteditable","set_data_maybe_contenteditable_dev","set_dynamic_element_data","set_input_type","set_input_value","set_now","set_raf","set_store_value","set_style","set_svg_attributes","space","split_css_unit","spread","src_url_equal","start_hydrating","stop_immediate_propagation","stop_propagation","subscribe","svg_element","text","tick","time_ranges_to_array","to_number","toggle_class","transition_in","transition_out","trusted","update_await_block_branch","update_keyed_each","update_slot","update_slot_base","validate_component","validate_dynamic_element","validate_each_keys","validate_slots","validate_store","validate_void_dynamic_element","xlink_attr"]); export default new Set(["HtmlTag","HtmlTagHydration","ResizeObserverSingleton","SvelteComponent","SvelteComponentDev","SvelteComponentTyped","SvelteElement","action_destroyer","add_attribute","add_classes","add_flush_callback","add_iframe_resize_listener","add_location","add_render_callback","add_styles","add_transform","afterUpdate","append","append_dev","append_empty_stylesheet","append_hydration","append_hydration_dev","append_styles","assign","attr","attr_dev","attribute_to_object","beforeUpdate","bind","binding_callbacks","blank_object","bubble","check_outros","children","claim_comment","claim_component","claim_element","claim_html_tag","claim_space","claim_svg_element","claim_text","clear_loops","comment","component_subscribe","compute_rest_props","compute_slots","construct_svelte_component","construct_svelte_component_dev","contenteditable_truthy_values","createEventDispatcher","create_animation","create_bidirectional_transition","create_component","create_custom_element","create_in_transition","create_out_transition","create_slot","create_ssr_component","current_component","custom_event","dataset_dev","debug","destroy_block","destroy_component","destroy_each","detach","detach_after_dev","detach_before_dev","detach_between_dev","detach_dev","dirty_components","dispatch_dev","each","element","element_is","empty","end_hydrating","ensure_array_like","ensure_array_like_dev","escape","escape_attribute_value","escape_object","exclude_internal_props","fix_and_destroy_block","fix_and_outro_and_destroy_block","fix_position","flush","flush_render_callbacks","getAllContexts","getContext","get_all_dirty_from_scope","get_binding_group_value","get_current_component","get_custom_elements_slots","get_root_for_style","get_slot_changes","get_spread_object","get_spread_update","get_store_value","get_svelte_dataset","globals","group_outros","handle_promise","hasContext","has_prop","head_selector","identity","init","init_binding_group","init_binding_group_dynamic","insert","insert_dev","insert_hydration","insert_hydration_dev","intros","invalid_attribute_name_character","is_client","is_crossorigin","is_empty","is_function","is_promise","is_void","listen","listen_dev","loop","loop_guard","merge_ssr_styles","missing_component","mount_component","noop","not_equal","now","null_to_empty","object_without_properties","onDestroy","onMount","once","outro_and_destroy_block","prevent_default","prop_dev","query_selector_all","raf","resize_observer_border_box","resize_observer_content_box","resize_observer_device_pixel_content_box","run","run_all","safe_not_equal","schedule_update","select_multiple_value","select_option","select_options","select_value","self","setContext","set_attributes","set_current_component","set_custom_element_data","set_custom_element_data_map","set_data","set_data_contenteditable","set_data_contenteditable_dev","set_data_dev","set_data_maybe_contenteditable","set_data_maybe_contenteditable_dev","set_dynamic_element_data","set_input_type","set_input_value","set_now","set_raf","set_store_value","set_style","set_svg_attributes","space","split_css_unit","spread","src_url_equal","srcset_url_equal","start_hydrating","stop_immediate_propagation","stop_propagation","subscribe","svg_element","text","tick","time_ranges_to_array","to_number","toggle_class","transition_in","transition_out","trusted","update_await_block_branch","update_keyed_each","update_slot","update_slot_base","validate_component","validate_dynamic_element","validate_each_keys","validate_slots","validate_store","validate_void_dynamic_element","xlink_attr"]);

@ -777,14 +777,14 @@ export function claim_comment(nodes, data) {
); );
} }
function find_comment(nodes, text, start) { function get_comment_idx(nodes, text, start) {
for (let i = start; i < nodes.length; i += 1) { for (let i = start; i < nodes.length; i += 1) {
const node = nodes[i]; const node = nodes[i];
if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) { if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {
return i; return i;
} }
} }
return nodes.length; return -1;
} }
/** /**
@ -793,11 +793,12 @@ function find_comment(nodes, text, start) {
*/ */
export function claim_html_tag(nodes, is_svg) { export function claim_html_tag(nodes, is_svg) {
// find html opening tag // find html opening tag
const start_index = find_comment(nodes, 'HTML_TAG_START', 0); const start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);
const end_index = find_comment(nodes, 'HTML_TAG_END', start_index); const end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);
if (start_index === end_index) { if (start_index === -1 || end_index === -1) {
return new HtmlTagHydration(undefined, is_svg); return new HtmlTagHydration(is_svg);
} }
init_claim_info(nodes); init_claim_info(nodes);
const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1); const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);
detach(html_tag_nodes[0]); detach(html_tag_nodes[0]);
@ -807,7 +808,7 @@ export function claim_html_tag(nodes, is_svg) {
n.claim_order = nodes.claim_info.total_claimed; n.claim_order = nodes.claim_info.total_claimed;
nodes.claim_info.total_claimed += 1; nodes.claim_info.total_claimed += 1;
} }
return new HtmlTagHydration(claimed_nodes, is_svg); return new HtmlTagHydration(is_svg, claimed_nodes);
} }
/** /**
@ -1048,17 +1049,13 @@ export class HtmlTag {
* @default false * @default false
*/ */
is_svg = false; is_svg = false;
// parent for creating node /** parent for creating node */
/** */
e = undefined; e = undefined;
// html tag nodes /** html tag nodes */
/** */
n = undefined; n = undefined;
// target /** target */
/** */
t = undefined; t = undefined;
// anchor /** anchor */
/** */
a = undefined; a = undefined;
constructor(is_svg = false) { constructor(is_svg = false) {
this.is_svg = is_svg; this.is_svg = is_svg;
@ -1134,13 +1131,11 @@ export class HtmlTag {
} }
} }
/**
* @extends HtmlTag */
export class HtmlTagHydration extends HtmlTag { export class HtmlTagHydration extends HtmlTag {
// hydration claimed nodes /** @type {Element[]} hydration claimed nodes */
/** */
l = undefined; l = undefined;
constructor(claimed_nodes, is_svg = false) {
constructor(is_svg = false, claimed_nodes) {
super(is_svg); super(is_svg);
this.e = this.n = null; this.e = this.n = null;
this.l = claimed_nodes; this.l = claimed_nodes;

@ -6,5 +6,5 @@
* https://svelte.dev/docs/svelte-compiler#svelte-version * https://svelte.dev/docs/svelte-compiler#svelte-version
* @type {string} * @type {string}
*/ */
export const VERSION = '4.0.3'; export const VERSION = '4.0.5';
export const PUBLIC_VERSION = '4'; export const PUBLIC_VERSION = '4';

@ -0,0 +1,2 @@
<p><p>invalid</p></p>
<p><p>invalid</p></p>

@ -0,0 +1,8 @@
<p><!-- HTML_TAG_START --></p>
<p>invalid</p>
<!-- HTML_TAG_END -->
<p></p>
<p><!-- HTML_TAG_START --></p>
<p>invalid</p>
<!-- HTML_TAG_END -->
<p></p>

@ -0,0 +1,5 @@
<script>
export let content;
</script>
<p>{@html content}</p>

@ -0,0 +1,7 @@
<script>
import Inner from './inner.svelte';
</script>
<Inner content="<p>invalid</p>" />
<p>{@html '<p>invalid</p>'}</p>

@ -0,0 +1,3 @@
<svg>
<circle cx="200" cy="500" r="200"></circle>
</svg>

After

Width:  |  Height:  |  Size: 58 B

@ -0,0 +1,5 @@
<svg>
<!-- HTML_TAG_START -->
<circle cx="200" cy="500" r="200"></circle>
<!-- HTML_TAG_END -->
</svg>

After

Width:  |  Height:  |  Size: 106 B

@ -0,0 +1,14 @@
export default {
snapshot(target) {
const svg = target.querySelector('svg');
return {
svg,
circle: svg.querySelector('circle')
};
},
test(assert, _, snapshot) {
assert.instanceOf(snapshot.svg, SVGElement);
assert.instanceOf(snapshot.circle, SVGElement);
}
};

@ -0,0 +1 @@
<svg>{@html '<circle cx="200" cy="500" r="200"></circle>'}</svg>

After

Width:  |  Height:  |  Size: 64 B

@ -1,4 +1,2 @@
<noscript></noscript>
<p>this is some html</p> <p>this is some html</p>
<p>and so is this</p> <p>and so is this</p>
<noscript></noscript>

@ -1,2 +1,4 @@
<!-- HTML_TAG_START -->
<p>this is some html</p> <p>this is some html</p>
<p>and so is this</p> <p>and so is this</p>
<!-- HTML_TAG_END -->

@ -1,6 +1,4 @@
export default { export default {
skip: true, // existing nodes are blown away
props: { props: {
raw: '<p>this is some html</p> <p>and so is this</p>' raw: '<p>this is some html</p> <p>and so is this</p>'
}, },

@ -1 +1,5 @@
<script>
export let raw;
</script>
{@html raw} {@html raw}

@ -0,0 +1,10 @@
export default {
html: '',
test({ assert, component, target }) {
component.show = true;
assert.equal(target.innerHTML, '<svg><circle cx="200" cy="500" r="200"></circle></svg>');
assert.instanceOf(target.querySelector('svg'), SVGElement);
assert.instanceOf(target.querySelector('circle'), SVGElement);
}
};

@ -0,0 +1,7 @@
<script>
export let show = false;
</script>
{#if show}
<svg>{@html '<circle cx="200" cy="500" r="200"></circle>'}</svg>
{/if}

@ -157,8 +157,8 @@ importers:
specifier: ^2.26.0 specifier: ^2.26.0
version: 2.26.0 version: 2.26.0
'@sveltejs/repl': '@sveltejs/repl':
specifier: 0.5.0-next.10 specifier: 0.5.0-next.11
version: 0.5.0-next.10(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.21.0)(svelte@packages+svelte) version: 0.5.0-next.11(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.22.0)(svelte@packages+svelte)
cookie: cookie:
specifier: ^0.5.0 specifier: ^0.5.0
version: 0.5.0 version: 0.5.0
@ -180,22 +180,25 @@ importers:
version: 2.4.1 version: 2.4.1
'@sveltejs/adapter-vercel': '@sveltejs/adapter-vercel':
specifier: ^3.0.1 specifier: ^3.0.1
version: 3.0.1(@sveltejs/kit@1.21.0) version: 3.0.1(@sveltejs/kit@1.22.0)
'@sveltejs/kit': '@sveltejs/kit':
specifier: ^1.21.0 specifier: ^1.22.0
version: 1.21.0(svelte@packages+svelte)(vite@4.3.9) version: 1.22.0(svelte@packages+svelte)(vite@4.3.9)
'@sveltejs/site-kit': '@sveltejs/site-kit':
specifier: 6.0.0-next.18 specifier: 6.0.0-next.20
version: 6.0.0-next.18(@sveltejs/kit@1.21.0)(svelte@packages+svelte) version: 6.0.0-next.20(@sveltejs/kit@1.22.0)(svelte@packages+svelte)
'@sveltejs/vite-plugin-svelte': '@sveltejs/vite-plugin-svelte':
specifier: ^2.4.2 specifier: ^2.4.2
version: 2.4.2(svelte@packages+svelte)(vite@4.3.9) version: 2.4.2(svelte@packages+svelte)(vite@4.3.9)
'@types/cookie':
specifier: ^0.5.1
version: 0.5.1
'@types/marked': '@types/marked':
specifier: ^5.0.0 specifier: ^5.0.0
version: 5.0.0 version: 5.0.0
'@types/node': '@types/node':
specifier: ^20.3.2 specifier: ^20.3.3
version: 20.3.2 version: 20.3.3
'@types/prettier': '@types/prettier':
specifier: ^2.7.3 specifier: ^2.7.3
version: 2.7.3 version: 2.7.3
@ -209,14 +212,11 @@ importers:
specifier: ^0.22.8 specifier: ^0.22.8
version: 0.22.8 version: 0.22.8
magic-string: magic-string:
specifier: ^0.30.0 specifier: ^0.30.1
version: 0.30.0 version: 0.30.1
marked: marked:
specifier: ^5.1.0 specifier: ^5.1.0
version: 5.1.0 version: 5.1.0
node-fetch:
specifier: ^3.3.1
version: 3.3.1
prettier: prettier:
specifier: ^2.8.8 specifier: ^2.8.8
version: 2.8.8 version: 2.8.8
@ -258,7 +258,7 @@ importers:
version: 5.1.6 version: 5.1.6
vite: vite:
specifier: ^4.3.9 specifier: ^4.3.9
version: 4.3.9(@types/node@20.3.2)(sass@1.63.6) version: 4.3.9(@types/node@20.3.3)(sass@1.63.6)
vite-imagetools: vite-imagetools:
specifier: ^5.0.4 specifier: ^5.0.4
version: 5.0.4 version: 5.0.4
@ -1690,12 +1690,12 @@ packages:
- supports-color - supports-color
dev: false dev: false
/@sveltejs/adapter-vercel@3.0.1(@sveltejs/kit@1.21.0): /@sveltejs/adapter-vercel@3.0.1(@sveltejs/kit@1.22.0):
resolution: {integrity: sha512-PBY3YRm7Q7Prax07mxD/rvcho2CntGkYncAIkz2DtG5NTcVG5JZ1RM627it5zYYtc2/RB3YjMkZuCMBqDCiPkA==} resolution: {integrity: sha512-PBY3YRm7Q7Prax07mxD/rvcho2CntGkYncAIkz2DtG5NTcVG5JZ1RM627it5zYYtc2/RB3YjMkZuCMBqDCiPkA==}
peerDependencies: peerDependencies:
'@sveltejs/kit': ^1.5.0 '@sveltejs/kit': ^1.5.0
dependencies: dependencies:
'@sveltejs/kit': 1.21.0(svelte@packages+svelte)(vite@4.3.9) '@sveltejs/kit': 1.22.0(svelte@packages+svelte)(vite@4.3.9)
'@vercel/nft': 0.22.6 '@vercel/nft': 0.22.6
esbuild: 0.17.19 esbuild: 0.17.19
transitivePeerDependencies: transitivePeerDependencies:
@ -1723,8 +1723,8 @@ packages:
typescript: 5.1.3 typescript: 5.1.3
dev: true dev: true
/@sveltejs/kit@1.21.0(svelte@packages+svelte)(vite@4.3.9): /@sveltejs/kit@1.22.0(svelte@packages+svelte)(vite@4.3.9):
resolution: {integrity: sha512-CBsYoI34SjtOQp0eG85dmVnvTR3Pjs8VgAQhO0CgQja9BIorKl808F1X8EunPhCcyek5r5lKQE1Mmbi0RuzHqA==} resolution: {integrity: sha512-LQhM7CvTaO7OopQffFMuJ2n1lBhfYJKVO2Rujc+/473Yb8jb1mpJm59q5Avbx29kcz8N9lvYUyRP3FXc63VIFA==}
engines: {node: ^16.14 || >=18} engines: {node: ^16.14 || >=18}
hasBin: true hasBin: true
requiresBuild: true requiresBuild: true
@ -1738,19 +1738,19 @@ packages:
devalue: 4.3.2 devalue: 4.3.2
esm-env: 1.0.0 esm-env: 1.0.0
kleur: 4.1.5 kleur: 4.1.5
magic-string: 0.30.0 magic-string: 0.30.1
mime: 3.0.0 mime: 3.0.0
sade: 1.8.1 sade: 1.8.1
set-cookie-parser: 2.6.0 set-cookie-parser: 2.6.0
sirv: 2.0.3 sirv: 2.0.3
svelte: link:packages/svelte svelte: link:packages/svelte
undici: 5.22.1 undici: 5.22.1
vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) vite: 4.3.9(@types/node@20.3.3)(sass@1.63.6)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
/@sveltejs/repl@0.5.0-next.10(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.21.0)(svelte@packages+svelte): /@sveltejs/repl@0.5.0-next.11(@codemirror/lang-html@6.4.5)(@codemirror/search@6.5.0)(@lezer/common@1.0.3)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)(@sveltejs/kit@1.22.0)(svelte@packages+svelte):
resolution: {integrity: sha512-Y167w5wExssjloafIeLeTCzN9Vh22Sg/DgE4ARfw4J/5VVkEkEINVBbHalpjDMHhXnvOejnbNCJEw0TYW2lN4A==} resolution: {integrity: sha512-bZ7WmmwwujhO1b1r7hN5Lt4z/Y4J3Bfx1DHiITOLshHTPgEU9XNOdq2JzSmN4DIWhmU0T/OVZ53XyXpaR1KTWA==}
peerDependencies: peerDependencies:
svelte: ^3.54.0 || ^4.0.0-next.0 || ^4.0.0 svelte: ^3.54.0 || ^4.0.0-next.0 || ^4.0.0
dependencies: dependencies:
@ -1770,7 +1770,7 @@ packages:
'@replit/codemirror-lang-svelte': 6.0.0(@codemirror/autocomplete@6.8.1)(@codemirror/lang-css@6.2.0)(@codemirror/lang-html@6.4.5)(@codemirror/lang-javascript@6.1.9)(@codemirror/language@6.8.0)(@codemirror/state@6.2.1)(@codemirror/view@6.14.0)(@lezer/common@1.0.3)(@lezer/highlight@1.1.6)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7) '@replit/codemirror-lang-svelte': 6.0.0(@codemirror/autocomplete@6.8.1)(@codemirror/lang-css@6.2.0)(@codemirror/lang-html@6.4.5)(@codemirror/lang-javascript@6.1.9)(@codemirror/language@6.8.0)(@codemirror/state@6.2.1)(@codemirror/view@6.14.0)(@lezer/common@1.0.3)(@lezer/highlight@1.1.6)(@lezer/javascript@1.4.3)(@lezer/lr@1.3.7)
'@rich_harris/svelte-split-pane': 1.1.1(svelte@packages+svelte) '@rich_harris/svelte-split-pane': 1.1.1(svelte@packages+svelte)
'@rollup/browser': 3.25.3 '@rollup/browser': 3.25.3
'@sveltejs/site-kit': 5.2.2(@sveltejs/kit@1.21.0)(svelte@packages+svelte) '@sveltejs/site-kit': 5.2.2(@sveltejs/kit@1.22.0)(svelte@packages+svelte)
acorn: 8.9.0 acorn: 8.9.0
codemirror: 6.0.1(@lezer/common@1.0.3) codemirror: 6.0.1(@lezer/common@1.0.3)
esm-env: 1.0.0 esm-env: 1.0.0
@ -1778,7 +1778,7 @@ packages:
marked: 5.1.0 marked: 5.1.0
resolve.exports: 2.0.2 resolve.exports: 2.0.2
svelte: link:packages/svelte svelte: link:packages/svelte
svelte-json-tree: 1.0.0 svelte-json-tree: 2.1.0(svelte@packages+svelte)
transitivePeerDependencies: transitivePeerDependencies:
- '@codemirror/lang-html' - '@codemirror/lang-html'
- '@codemirror/search' - '@codemirror/search'
@ -1788,25 +1788,25 @@ packages:
- '@sveltejs/kit' - '@sveltejs/kit'
dev: false dev: false
/@sveltejs/site-kit@5.2.2(@sveltejs/kit@1.21.0)(svelte@packages+svelte): /@sveltejs/site-kit@5.2.2(@sveltejs/kit@1.22.0)(svelte@packages+svelte):
resolution: {integrity: sha512-XLLxVUV/dYytCsUeODAkjtzlaIBSn1kdcH5U36OuN7gMsPEHDy5L/dsWjf1/vDln3JStH5lqZPEN8Fovm33KhA==} resolution: {integrity: sha512-XLLxVUV/dYytCsUeODAkjtzlaIBSn1kdcH5U36OuN7gMsPEHDy5L/dsWjf1/vDln3JStH5lqZPEN8Fovm33KhA==}
peerDependencies: peerDependencies:
'@sveltejs/kit': ^1.0.0 '@sveltejs/kit': ^1.0.0
svelte: ^3.54.0 svelte: ^3.54.0
dependencies: dependencies:
'@sveltejs/kit': 1.21.0(svelte@packages+svelte)(vite@4.3.9) '@sveltejs/kit': 1.22.0(svelte@packages+svelte)(vite@4.3.9)
esm-env: 1.0.0 esm-env: 1.0.0
svelte: link:packages/svelte svelte: link:packages/svelte
svelte-local-storage-store: 0.4.0(svelte@packages+svelte) svelte-local-storage-store: 0.4.0(svelte@packages+svelte)
dev: false dev: false
/@sveltejs/site-kit@6.0.0-next.18(@sveltejs/kit@1.21.0)(svelte@packages+svelte): /@sveltejs/site-kit@6.0.0-next.20(@sveltejs/kit@1.22.0)(svelte@packages+svelte):
resolution: {integrity: sha512-8uWjP61UAkCqWf9UuQQWSCpyPNk4cqnGaQozjIr3sGbQnauTQDiS4K8AxqyBSyphEIrhxd68iYMEFQDQVAHjcg==} resolution: {integrity: sha512-tWT/pKdCFxY+Wsayoj287AcNOYsm0EW5fiOsSSVseEK+62R1KcWHcioSgm1Fk12HOUgFcYnskaJ9JOo+p7+9/w==}
peerDependencies: peerDependencies:
'@sveltejs/kit': ^1.0.0 '@sveltejs/kit': ^1.20.0
svelte: ^3.54.0 || ^4.0.0-next.1 || ^4.0.0 svelte: ^4.0.0
dependencies: dependencies:
'@sveltejs/kit': 1.21.0(svelte@packages+svelte)(vite@4.3.9) '@sveltejs/kit': 1.22.0(svelte@packages+svelte)(vite@4.3.9)
esm-env: 1.0.0 esm-env: 1.0.0
svelte: link:packages/svelte svelte: link:packages/svelte
svelte-local-storage-store: 0.5.0(svelte@packages+svelte) svelte-local-storage-store: 0.5.0(svelte@packages+svelte)
@ -1823,7 +1823,7 @@ packages:
'@sveltejs/vite-plugin-svelte': 2.4.2(svelte@packages+svelte)(vite@4.3.9) '@sveltejs/vite-plugin-svelte': 2.4.2(svelte@packages+svelte)(vite@4.3.9)
debug: 4.3.4 debug: 4.3.4
svelte: link:packages/svelte svelte: link:packages/svelte
vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) vite: 4.3.9(@types/node@20.3.3)(sass@1.63.6)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -1838,10 +1838,10 @@ packages:
debug: 4.3.4 debug: 4.3.4
deepmerge: 4.3.1 deepmerge: 4.3.1
kleur: 4.1.5 kleur: 4.1.5
magic-string: 0.30.0 magic-string: 0.30.1
svelte: link:packages/svelte svelte: link:packages/svelte
svelte-hmr: 0.15.2(svelte@packages+svelte) svelte-hmr: 0.15.2(svelte@packages+svelte)
vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) vite: 4.3.9(@types/node@20.3.3)(sass@1.63.6)
vitefu: 0.2.4(vite@4.3.9) vitefu: 0.2.4(vite@4.3.9)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -1915,8 +1915,8 @@ packages:
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==} resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
dev: true dev: true
/@types/node@20.3.2: /@types/node@20.3.3:
resolution: {integrity: sha512-vOBLVQeCQfIcF/2Y7eKFTqrMnizK5lRNQ7ykML/5RuwVXVWxYkgwS7xbt4B6fKCUPgbSL5FSsjHQpaGQP/dQmw==} resolution: {integrity: sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==}
/@types/normalize-package-data@2.4.1: /@types/normalize-package-data@2.4.1:
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
@ -1949,7 +1949,7 @@ packages:
/@types/websocket@1.0.5: /@types/websocket@1.0.5:
resolution: {integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==} resolution: {integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==}
dependencies: dependencies:
'@types/node': 20.3.2 '@types/node': 20.3.3
dev: false dev: false
/@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.1)(eslint@8.43.0)(typescript@5.1.6): /@typescript-eslint/eslint-plugin@5.60.0(@typescript-eslint/parser@5.60.1)(eslint@8.43.0)(typescript@5.1.6):
@ -2300,7 +2300,7 @@ packages:
/@vitest/snapshot@0.31.4: /@vitest/snapshot@0.31.4:
resolution: {integrity: sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==} resolution: {integrity: sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==}
dependencies: dependencies:
magic-string: 0.30.0 magic-string: 0.30.1
pathe: 1.1.1 pathe: 1.1.1
pretty-format: 27.5.1 pretty-format: 27.5.1
dev: true dev: true
@ -2947,11 +2947,6 @@ packages:
type: 1.2.0 type: 1.2.0
dev: false dev: false
/data-uri-to-buffer@4.0.1:
resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}
engines: {node: '>= 12'}
dev: true
/data-urls@4.0.0: /data-urls@4.0.0:
resolution: {integrity: sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==} resolution: {integrity: sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==}
engines: {node: '>=14'} engines: {node: '>=14'}
@ -3602,14 +3597,6 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
dev: true dev: true
/fetch-blob@3.2.0:
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
engines: {node: ^12.20 || >= 14.13}
dependencies:
node-domexception: 1.0.0
web-streams-polyfill: 3.2.1
dev: true
/fflate@0.7.4: /fflate@0.7.4:
resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==} resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==}
dev: true dev: true
@ -3699,13 +3686,6 @@ packages:
mime-types: 2.1.35 mime-types: 2.1.35
dev: true dev: true
/formdata-polyfill@4.0.10:
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
engines: {node: '>=12.20.0'}
dependencies:
fetch-blob: 3.2.0
dev: true
/fs-constants@1.0.0: /fs-constants@1.0.0:
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
dev: true dev: true
@ -4561,6 +4541,12 @@ packages:
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/sourcemap-codec': 1.4.15
/magic-string@0.30.1:
resolution: {integrity: sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==}
engines: {node: '>=12'}
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
/make-dir@3.1.0: /make-dir@3.1.0:
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
engines: {node: '>=8'} engines: {node: '>=8'}
@ -4798,11 +4784,6 @@ packages:
resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==}
dev: true dev: true
/node-domexception@1.0.0:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'}
dev: true
/node-fetch@2.6.11: /node-fetch@2.6.11:
resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==} resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==}
engines: {node: 4.x || >=6.0.0} engines: {node: 4.x || >=6.0.0}
@ -4814,15 +4795,6 @@ packages:
dependencies: dependencies:
whatwg-url: 5.0.0 whatwg-url: 5.0.0
/node-fetch@3.3.1:
resolution: {integrity: sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
data-uri-to-buffer: 4.0.1
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
dev: true
/node-gyp-build@4.6.0: /node-gyp-build@4.6.0:
resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}
hasBin: true hasBin: true
@ -5997,8 +5969,12 @@ packages:
dependencies: dependencies:
svelte: link:packages/svelte svelte: link:packages/svelte
/svelte-json-tree@1.0.0: /svelte-json-tree@2.1.0(svelte@packages+svelte):
resolution: {integrity: sha512-scs1OdkC8uFpTN4MX0yKkOzZ1/EG3eP1ARC+xcFthXp2IfcwBaXgab0FqA4Am0vQwffNNB+1Gd1LFkJBlynWTA==} resolution: {integrity: sha512-IAU//hE5bIA0SoM9AuP7xOoD9PUcMh4fio0oI52r0XJ7iNDytW7AnBdkIn1QSYLUyWzvQX3tp59JfLYfhd7lTw==}
peerDependencies:
svelte: ^4.0.0
dependencies:
svelte: link:packages/svelte
dev: false dev: false
/svelte-local-storage-store@0.4.0(svelte@packages+svelte): /svelte-local-storage-store@0.4.0(svelte@packages+svelte):
@ -6469,7 +6445,7 @@ packages:
fsevents: 2.3.2 fsevents: 2.3.2
dev: true dev: true
/vite@4.3.9(@types/node@20.3.2)(sass@1.63.6): /vite@4.3.9(@types/node@20.3.3)(sass@1.63.6):
resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true hasBin: true
@ -6494,7 +6470,7 @@ packages:
terser: terser:
optional: true optional: true
dependencies: dependencies:
'@types/node': 20.3.2 '@types/node': 20.3.3
esbuild: 0.17.19 esbuild: 0.17.19
postcss: 8.4.24 postcss: 8.4.24
rollup: 3.25.1 rollup: 3.25.1
@ -6510,7 +6486,7 @@ packages:
vite: vite:
optional: true optional: true
dependencies: dependencies:
vite: 4.3.9(@types/node@20.3.2)(sass@1.63.6) vite: 4.3.9(@types/node@20.3.3)(sass@1.63.6)
/vitest@0.31.4(happy-dom@9.20.3)(jsdom@21.1.2)(playwright@1.35.1): /vitest@0.31.4(happy-dom@9.20.3)(jsdom@21.1.2)(playwright@1.35.1):
resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==}
@ -6609,11 +6585,6 @@ packages:
defaults: 1.0.4 defaults: 1.0.4
dev: true dev: true
/web-streams-polyfill@3.2.1:
resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==}
engines: {node: '>= 8'}
dev: true
/webidl-conversions@3.0.1: /webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}

@ -19,7 +19,7 @@
"dependencies": { "dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15", "@jridgewell/sourcemap-codec": "^1.4.15",
"@supabase/supabase-js": "^2.26.0", "@supabase/supabase-js": "^2.26.0",
"@sveltejs/repl": "0.5.0-next.10", "@sveltejs/repl": "0.5.0-next.11",
"cookie": "^0.5.0", "cookie": "^0.5.0",
"devalue": "^4.3.2", "devalue": "^4.3.2",
"do-not-zip": "^1.0.0", "do-not-zip": "^1.0.0",
@ -29,18 +29,18 @@
"devDependencies": { "devDependencies": {
"@resvg/resvg-js": "^2.4.1", "@resvg/resvg-js": "^2.4.1",
"@sveltejs/adapter-vercel": "^3.0.1", "@sveltejs/adapter-vercel": "^3.0.1",
"@sveltejs/kit": "^1.21.0", "@sveltejs/kit": "^1.22.0",
"@sveltejs/site-kit": "6.0.0-next.18", "@sveltejs/site-kit": "6.0.0-next.20",
"@sveltejs/vite-plugin-svelte": "^2.4.2", "@sveltejs/vite-plugin-svelte": "^2.4.2",
"@types/cookie": "^0.5.1",
"@types/marked": "^5.0.0", "@types/marked": "^5.0.0",
"@types/node": "^20.3.2", "@types/node": "^20.3.3",
"@types/prettier": "^2.7.3", "@types/prettier": "^2.7.3",
"degit": "^2.8.4", "degit": "^2.8.4",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"jimp": "^0.22.8", "jimp": "^0.22.8",
"magic-string": "^0.30.0", "magic-string": "^0.30.1",
"marked": "^5.1.0", "marked": "^5.1.0",
"node-fetch": "^3.3.1",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1", "prettier-plugin-svelte": "^2.10.1",
"sass": "^1.63.6", "sass": "^1.63.6",

@ -1,16 +1,16 @@
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import { get_examples_data } from '../src/lib/server/examples/index.js'; import { get_examples_data } from '../src/lib/server/examples/index.js';
import fs from 'node:fs'; import { mkdir, writeFile } from 'node:fs/promises';
const examples_data = get_examples_data( const examples_data = await get_examples_data(
fileURLToPath(new URL('../../../documentation/examples', import.meta.url)) fileURLToPath(new URL('../../../documentation/examples', import.meta.url))
); );
try { try {
fs.mkdirSync(new URL('../src/lib/generated/', import.meta.url), { recursive: true }); await mkdir(new URL('../src/lib/generated/', import.meta.url), { recursive: true });
} catch {} } catch {}
fs.writeFileSync( writeFile(
new URL('../src/lib/generated/examples-data.js', import.meta.url), new URL('../src/lib/generated/examples-data.js', import.meta.url),
`export default ${JSON.stringify(examples_data)}` `export default ${JSON.stringify(examples_data)}`
); );

@ -1,28 +1,30 @@
// @ts-check
import 'dotenv/config'; import 'dotenv/config';
import fs from 'fs';
import fetch from 'node-fetch';
import Jimp from 'jimp'; import Jimp from 'jimp';
import { dirname } from 'path'; import { stat, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'url'; import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const force = process.env.FORCE_UPDATE === 'true'; const force = process.env.FORCE_UPDATE === 'true';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(__dirname); process.chdir(__dirname);
const outputFile = `../src/routes/_components/Supporters/contributors.js`; // ../src/routes/_components/Supporters/contributors.js
if (!force && fs.existsSync(outputFile)) { const outputFile = new URL(`../src/routes/_components/Supporters/contributors.js`, import.meta.url);
try {
if (!force && (await stat(outputFile))) {
console.info(`[update/contributors] ${outputFile} exists. Skipping`); console.info(`[update/contributors] ${outputFile} exists. Skipping`);
process.exit(0); process.exit(0);
} }
} catch {
const base = `https://api.github.com/repos/sveltejs/svelte/contributors`; const base = `https://api.github.com/repos/sveltejs/svelte/contributors`;
const { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } = process.env; const { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } = process.env;
const MAX = 24; const MAX = 24;
const SIZE = 128; const SIZE = 128;
async function main() {
const contributors = []; const contributors = [];
let page = 1; let page = 1;
@ -32,6 +34,8 @@ async function main() {
); );
const list = await res.json(); const list = await res.json();
if (!Array.isArray(list)) throw new Error('Expected an array');
if (list.length === 0) break; if (list.length === 0) break;
contributors.push(...list); contributors.push(...list);
@ -51,13 +55,19 @@ async function main() {
const image_data = await fetch(author.avatar_url); const image_data = await fetch(author.avatar_url);
const buffer = await image_data.arrayBuffer(); const buffer = await image_data.arrayBuffer();
// @ts-ignore
const image = await Jimp.read(buffer); const image = await Jimp.read(buffer);
image.resize(SIZE, SIZE); image.resize(SIZE, SIZE);
sprite.composite(image, i * SIZE, 0); sprite.composite(image, i * SIZE, 0);
} }
await sprite.quality(80).write(`../src/routes/_components/Supporters/contributors.jpg`); await sprite
.quality(80)
.writeAsync(
new URL(`../src/routes/_components/Supporters/contributors.jpeg`, import.meta.url).pathname
);
// TODO: Optimizing the static/contributors.jpg image should probably get automated as well // TODO: Optimizing the static/contributors.jpg image should probably get automated as well
console.log( console.log(
'remember to additionally optimize the resulting /static/contributors.jpg image file via e.g. https://squoosh.app ' 'remember to additionally optimize the resulting /static/contributors.jpg image file via e.g. https://squoosh.app '
@ -65,7 +75,5 @@ async function main() {
const str = `[\n\t${authors.map((a) => `'${a.login}'`).join(',\n\t')}\n]`; const str = `[\n\t${authors.map((a) => `'${a.login}'`).join(',\n\t')}\n]`;
fs.writeFileSync(outputFile, `export default ${str};`); writeFile(outputFile, `export default ${str};`);
} }
main();

@ -1,28 +1,31 @@
// @ts-check
import 'dotenv/config'; import 'dotenv/config';
import fs from 'fs';
import fetch from 'node-fetch';
import Jimp from 'jimp'; import Jimp from 'jimp';
import { dirname } from 'path'; import { stat, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'url'; import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const force = process.env.FORCE_UPDATE === 'true'; const force = process.env.FORCE_UPDATE === 'true';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(__dirname); process.chdir(__dirname);
const outputFile = `../src/routes/_components/Supporters/donors.js`; const outputFile = new URL(`../src/routes/_components/Supporters/donors.js`, import.meta.url);
if (!force && fs.existsSync(outputFile)) {
try {
if (!force && (await stat(outputFile))) {
console.info(`[update/donors] ${outputFile} exists. Skipping`); console.info(`[update/donors] ${outputFile} exists. Skipping`);
process.exit(0); process.exit(0);
} }
} catch {
const MAX = 24; const MAX = 24;
const SIZE = 128; const SIZE = 128;
async function main() {
const res = await fetch('https://opencollective.com/svelte/members/all.json'); const res = await fetch('https://opencollective.com/svelte/members/all.json');
const donors = await res.json(); const donors = await res.json();
if (!Array.isArray(donors)) throw new Error('Expected an array');
const unique = new Map(); const unique = new Map();
donors.forEach((d) => unique.set(d.profile, d)); donors.forEach((d) => unique.set(d.profile, d));
@ -39,6 +42,7 @@ async function main() {
try { try {
const image_data = await fetch(backer.image); const image_data = await fetch(backer.image);
const buffer = await image_data.arrayBuffer(); const buffer = await image_data.arrayBuffer();
// @ts-ignore
const image = await Jimp.read(buffer); const image = await Jimp.read(buffer);
image.resize(SIZE, SIZE); image.resize(SIZE, SIZE);
included.push({ backer, image }); included.push({ backer, image });
@ -52,7 +56,11 @@ async function main() {
sprite.composite(included[i].image, i * SIZE, 0); sprite.composite(included[i].image, i * SIZE, 0);
} }
await sprite.quality(80).write(`../src/routes/_components/Supporters/donors.jpg`); await sprite
.quality(80)
.writeAsync(
new URL(`../src/routes/_components/Supporters/donors.jpg`, import.meta.url).pathname
);
// TODO: Optimizing the static/donors.jpg image should probably get automated as well // TODO: Optimizing the static/donors.jpg image should probably get automated as well
console.log( console.log(
'remember to additionally optimize the resulting /static/donors.jpg image file via e.g. https://squoosh.app ' 'remember to additionally optimize the resulting /static/donors.jpg image file via e.g. https://squoosh.app '
@ -60,7 +68,5 @@ async function main() {
const str = `[\n\t${included.map((a) => `${JSON.stringify(a.backer.name)}`).join(',\n\t')}\n]`; const str = `[\n\t${included.map((a) => `${JSON.stringify(a.backer.name)}`).join(',\n\t')}\n]`;
fs.writeFileSync(outputFile, `export default ${str};`); writeFile(outputFile, `export default ${str};`);
} }
main();

@ -1,5 +1,5 @@
// @ts-check // @ts-check
import fs from 'node:fs'; import { mkdir, readFile, writeFile } from 'node:fs/promises';
import path from 'node:path'; import path from 'node:path';
import prettier from 'prettier'; import prettier from 'prettier';
import ts from 'typescript'; import ts from 'typescript';
@ -236,12 +236,12 @@ function strip_origin(str) {
/** /**
* @param {string} file * @param {string} file
*/ */
function read_d_ts_file(file) { async function read_d_ts_file(file) {
const resolved = path.resolve('../../packages/svelte', file); const resolved = path.resolve('../../packages/svelte', file);
// We can't use JSDoc comments inside JSDoc, so we would get ts(7031) errors if // We can't use JSDoc comments inside JSDoc, so we would get ts(7031) errors if
// we didn't ignore this error specifically for `/// file:` code examples // we didn't ignore this error specifically for `/// file:` code examples
const str = fs.readFileSync(resolved, 'utf-8'); const str = await readFile(resolved, 'utf-8');
return str.replace(/(\s*\*\s*)```js([\s\S]+?)```/g, (match, prefix, code) => { return str.replace(/(\s*\*\s*)```js([\s\S]+?)```/g, (match, prefix, code) => {
return `${prefix}\`\`\`js${prefix}// @errors: 7031${code}\`\`\``; return `${prefix}\`\`\`js${prefix}// @errors: 7031${code}\`\`\``;
@ -249,7 +249,7 @@ function read_d_ts_file(file) {
} }
{ {
const code = read_d_ts_file('types/index.d.ts'); const code = await read_d_ts_file('types/index.d.ts');
const node = ts.createSourceFile('index.d.ts', code, ts.ScriptTarget.Latest, true); const node = ts.createSourceFile('index.d.ts', code, ts.ScriptTarget.Latest, true);
for (const statement of node.statements) { for (const statement of node.statements) {
@ -296,10 +296,10 @@ $: {
} }
try { try {
fs.mkdirSync(new URL('../../src/lib/generated', import.meta.url), { recursive: true }); await mkdir(new URL('../../src/lib/generated', import.meta.url), { recursive: true });
} catch {} } catch {}
fs.writeFileSync( writeFile(
new URL('../../src/lib/generated/type-info.js', import.meta.url), new URL('../../src/lib/generated/type-info.js', import.meta.url),
` `
/* This file is generated by running \`pnpm generate\` /* This file is generated by running \`pnpm generate\`

@ -1,7 +1,8 @@
// @ts-check
import { lstat, readFile, stat, writeFile } from 'node:fs/promises';
import path, { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import sh from 'shelljs'; import sh from 'shelljs';
import fs from 'fs';
import path, { dirname } from 'path';
import { fileURLToPath } from 'url';
const force = process.env.FORCE_UPDATE === 'true'; const force = process.env.FORCE_UPDATE === 'true';
@ -9,11 +10,13 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
sh.cd(path.join(__dirname, '..')); sh.cd(path.join(__dirname, '..'));
const outputFile = 'static/svelte-app.json'; const outputFile = 'static/svelte-app.json';
if (!force && fs.existsSync(outputFile)) {
try {
if (!force && (await stat(outputFile))) {
console.info(`[update/template] ${outputFile} exists. Skipping`); console.info(`[update/template] ${outputFile} exists. Skipping`);
process.exit(0); process.exit(0);
} }
} catch {
// fetch svelte app // fetch svelte app
sh.rm('-rf', 'scripts/svelte-app'); sh.rm('-rf', 'scripts/svelte-app');
sh.exec('npx degit sveltejs/template scripts/svelte-app'); sh.exec('npx degit sveltejs/template scripts/svelte-app');
@ -26,11 +29,15 @@ sh.rm('-rf', 'scripts/svelte-app/node_modules');
const appPath = 'scripts/svelte-app'; const appPath = 'scripts/svelte-app';
const files = []; const files = [];
for (const path of sh.find(appPath).filter((p) => fs.lstatSync(p).isFile())) { for (const path of sh.find(appPath)) {
const bytes = fs.readFileSync(path); // Skip directories
if (!(await lstat(path)).isFile()) continue;
const bytes = await readFile(path);
const string = bytes.toString(); const string = bytes.toString();
const data = bytes.compare(Buffer.from(string)) === 0 ? string : [...bytes]; const data = bytes.compare(Buffer.from(string)) === 0 ? string : [...bytes];
files.push({ path: path.slice(appPath.length + 1), data }); files.push({ path: path.slice(appPath.length + 1), data });
} }
fs.writeFileSync(outputFile, JSON.stringify(files)); writeFile(outputFile, JSON.stringify(files));
}

@ -26,7 +26,7 @@
} }
if (gist) { if (gist) {
fetch(`/repl/${gist}.json`) fetch(`/repl/api/${gist}.json`)
.then((r) => r.json()) .then((r) => r.json())
.then((data) => { .then((data) => {
const { description, components } = data; const { description, components } = data;

@ -4,4 +4,7 @@ import { createClient } from '@supabase/supabase-js';
export const client = export const client =
(!dev || (SUPABASE_URL && SUPABASE_KEY)) && (!dev || (SUPABASE_URL && SUPABASE_KEY)) &&
createClient(SUPABASE_URL, SUPABASE_KEY, { global: { fetch } }); createClient(SUPABASE_URL, SUPABASE_KEY, {
global: { fetch },
auth: { persistSession: false }
});

@ -1,6 +1,5 @@
// @ts-check // @ts-check
import { extractFrontmatter } from '@sveltejs/site-kit/markdown'; import { extractFrontmatter } from '@sveltejs/site-kit/markdown';
import fs from 'node:fs';
import { CONTENT_BASE_PATHS } from '../../../constants.js'; import { CONTENT_BASE_PATHS } from '../../../constants.js';
import { render_content } from '../renderer.js'; import { render_content } from '../renderer.js';
@ -23,16 +22,18 @@ export async function get_processed_blog_post(blog_data, slug) {
const BLOG_NAME_REGEX = /^(\d{4}-\d{2}-\d{2})-(.+)\.md$/; const BLOG_NAME_REGEX = /^(\d{4}-\d{2}-\d{2})-(.+)\.md$/;
/** @returns {import('./types').BlogData} */ /** @returns {Promise<import('./types').BlogData>} */
export function get_blog_data(base = CONTENT_BASE_PATHS.BLOG) { export async function get_blog_data(base = CONTENT_BASE_PATHS.BLOG) {
const { readdir, readFile } = await import('node:fs/promises');
/** @type {import('./types').BlogData} */ /** @type {import('./types').BlogData} */
const blog_posts = []; const blog_posts = [];
for (const file of fs.readdirSync(base).reverse()) { for (const file of (await readdir(base)).reverse()) {
if (!BLOG_NAME_REGEX.test(file)) continue; if (!BLOG_NAME_REGEX.test(file)) continue;
const { date, date_formatted, slug } = get_date_and_slug(file); const { date, date_formatted, slug } = get_date_and_slug(file);
const { metadata, body } = extractFrontmatter(fs.readFileSync(`${base}/${file}`, 'utf-8')); const { metadata, body } = extractFrontmatter(await readFile(`${base}/${file}`, 'utf-8'));
blog_posts.push({ blog_posts.push({
date, date,

@ -1,14 +1,11 @@
import { base as app_base } from '$app/paths'; import { base as app_base } from '$app/paths';
import { modules } from '$lib/generated/type-info.js';
import { import {
escape, escape,
extractFrontmatter, extractFrontmatter,
markedTransform, markedTransform,
normalizeSlugify, normalizeSlugify,
removeMarkdown, removeMarkdown
replaceExportTypePlaceholders
} from '@sveltejs/site-kit/markdown'; } from '@sveltejs/site-kit/markdown';
import fs from 'node:fs';
import { CONTENT_BASE_PATHS } from '../../../constants.js'; import { CONTENT_BASE_PATHS } from '../../../constants.js';
import { render_content } from '../renderer'; import { render_content } from '../renderer';
@ -31,12 +28,14 @@ export async function get_parsed_docs(docs_data, slug) {
return null; return null;
} }
/** @return {import('./types').DocsData} */ /** @return {Promise<import('./types').DocsData>} */
export function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) { export async function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
const { readdir, readFile } = await import('node:fs/promises');
/** @type {import('./types').DocsData} */ /** @type {import('./types').DocsData} */
const docs_data = []; const docs_data = [];
for (const category_dir of fs.readdirSync(base)) { for (const category_dir of await readdir(base)) {
const match = /\d{2}-(.+)/.exec(category_dir); const match = /\d{2}-(.+)/.exec(category_dir);
if (!match) continue; if (!match) continue;
@ -44,7 +43,7 @@ export function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
// Read the meta.json // Read the meta.json
const { title: category_title, draft = 'false' } = JSON.parse( const { title: category_title, draft = 'false' } = JSON.parse(
fs.readFileSync(`${base}/${category_dir}/meta.json`, 'utf-8') await readFile(`${base}/${category_dir}/meta.json`, 'utf-8')
); );
if (draft === 'true') continue; if (draft === 'true') continue;
@ -56,7 +55,7 @@ export function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
pages: [] pages: []
}; };
for (const filename of fs.readdirSync(`${base}/${category_dir}`)) { for (const filename of await readdir(`${base}/${category_dir}`)) {
if (filename === 'meta.json') continue; if (filename === 'meta.json') continue;
const match = /\d{2}-(.+)/.exec(filename); const match = /\d{2}-(.+)/.exec(filename);
if (!match) continue; if (!match) continue;
@ -64,7 +63,7 @@ export function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
const page_slug = match[1].replace('.md', ''); const page_slug = match[1].replace('.md', '');
const page_data = extractFrontmatter( const page_data = extractFrontmatter(
fs.readFileSync(`${base}/${category_dir}/${filename}`, 'utf-8') await readFile(`${base}/${category_dir}/${filename}`, 'utf-8')
); );
if (page_data.metadata.draft === 'true') continue; if (page_data.metadata.draft === 'true') continue;

@ -1,5 +1,4 @@
import { CONTENT_BASE_PATHS } from '../../../constants.js'; import { CONTENT_BASE_PATHS } from '../../../constants.js';
import fs from 'node:fs';
/** /**
* @param {import('./types').ExamplesData} examples_data * @param {import('./types').ExamplesData} examples_data
@ -18,25 +17,28 @@ export function get_example(examples_data, slug) {
} }
/** /**
* @returns {import('./types').ExamplesData} * @returns {Promise<import('./types').ExamplesData>}
*/ */
export function get_examples_data(base = CONTENT_BASE_PATHS.EXAMPLES) { export async function get_examples_data(base = CONTENT_BASE_PATHS.EXAMPLES) {
const { readdir, stat, readFile } = await import('node:fs/promises');
const examples = []; const examples = [];
for (const subdir of fs.readdirSync(base)) { for (const subdir of await readdir(base)) {
const section = { const section = {
title: '', // Initialise with empty title: '', // Initialise with empty
slug: subdir.split('-').slice(1).join('-'), slug: subdir.split('-').slice(1).join('-'),
examples: [] examples: []
}; };
if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue; if (!((await stat(`${base}/${subdir}`)).isDirectory() || subdir.endsWith('meta.json')))
continue;
if (!subdir.endsWith('meta.json')) if (!subdir.endsWith('meta.json'))
section.title = section.title =
JSON.parse(fs.readFileSync(`${base}/${subdir}/meta.json`, 'utf-8')).title ?? 'Embeds'; JSON.parse(await readFile(`${base}/${subdir}/meta.json`, 'utf-8')).title ?? 'Embeds';
for (const section_dir of fs.readdirSync(`${base}/${subdir}`)) { for (const section_dir of await readdir(`${base}/${subdir}`)) {
const match = /\d{2}-(.+)/.exec(section_dir); const match = /\d{2}-(.+)/.exec(section_dir);
if (!match) continue; if (!match) continue;
@ -46,17 +48,17 @@ export function get_examples_data(base = CONTENT_BASE_PATHS.EXAMPLES) {
// Get title for // Get title for
const example_title = JSON.parse( const example_title = JSON.parse(
fs.readFileSync(`${example_base_dir}/meta.json`, 'utf-8') await readFile(`${example_base_dir}/meta.json`, 'utf-8')
).title; ).title;
const files = []; const files = [];
for (const file of fs for (const file of (await readdir(example_base_dir)).filter(
.readdirSync(example_base_dir) (file) => !file.endsWith('meta.json')
.filter((file) => !file.endsWith('meta.json'))) { )) {
files.push({ files.push({
name: file, name: file,
type: file.split('.').at(-1), type: file.split('.').at(-1),
content: fs.readFileSync(`${example_base_dir}/${file}`, 'utf-8') content: await readFile(`${example_base_dir}/${file}`, 'utf-8')
}); });
} }

@ -1,5 +1,4 @@
import { extractFrontmatter } from '@sveltejs/site-kit/markdown'; import { extractFrontmatter } from '@sveltejs/site-kit/markdown';
import fs from 'node:fs';
import { CONTENT_BASE_PATHS } from '../../../constants.js'; import { CONTENT_BASE_PATHS } from '../../../constants.js';
import { render_content } from '../renderer.js'; import { render_content } from '../renderer.js';
@ -23,24 +22,27 @@ export async function get_parsed_tutorial(tutorial_data, slug) {
} }
/** /**
* @returns {import('./types').TutorialData} * @returns {Promise<import('./types').TutorialData>}
*/ */
export function get_tutorial_data(base = CONTENT_BASE_PATHS.TUTORIAL) { export async function get_tutorial_data(base = CONTENT_BASE_PATHS.TUTORIAL) {
const { readdir, readFile, stat } = await import('node:fs/promises');
const tutorials = []; const tutorials = [];
for (const subdir of fs.readdirSync(base)) { for (const subdir of await readdir(base)) {
const section = { const section = {
title: '', // Initialise with empty title: '', // Initialise with empty
slug: subdir.split('-').slice(1).join('-'), slug: subdir.split('-').slice(1).join('-'),
tutorials: [] tutorials: []
}; };
if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue; if (!((await stat(`${base}/${subdir}`)).isDirectory() || subdir.endsWith('meta.json')))
continue;
if (!subdir.endsWith('meta.json')) if (!subdir.endsWith('meta.json'))
section.title = JSON.parse(fs.readFileSync(`${base}/${subdir}/meta.json`, 'utf-8')).title; section.title = JSON.parse(await readFile(`${base}/${subdir}/meta.json`, 'utf-8')).title;
for (const section_dir of fs.readdirSync(`${base}/${subdir}`)) { for (const section_dir of await readdir(`${base}/${subdir}`)) {
const match = /\d{2}-(.+)/.exec(section_dir); const match = /\d{2}-(.+)/.exec(section_dir);
if (!match) continue; if (!match) continue;
@ -49,22 +51,22 @@ export function get_tutorial_data(base = CONTENT_BASE_PATHS.TUTORIAL) {
const tutorial_base_dir = `${base}/${subdir}/${section_dir}`; const tutorial_base_dir = `${base}/${subdir}/${section_dir}`;
// Read the file, get frontmatter // Read the file, get frontmatter
const contents = fs.readFileSync(`${tutorial_base_dir}/text.md`, 'utf-8'); const contents = await readFile(`${tutorial_base_dir}/text.md`, 'utf-8');
const { metadata, body } = extractFrontmatter(contents); const { metadata, body } = extractFrontmatter(contents);
// Get the contents of the apps. // Get the contents of the apps.
const completion_states_data = { initial: [], complete: [] }; const completion_states_data = { initial: [], complete: [] };
for (const app_dir of fs.readdirSync(tutorial_base_dir)) { for (const app_dir of await readdir(tutorial_base_dir)) {
if (!app_dir.startsWith('app-')) continue; if (!app_dir.startsWith('app-')) continue;
const app_dir_path = `${tutorial_base_dir}/${app_dir}`; const app_dir_path = `${tutorial_base_dir}/${app_dir}`;
const app_contents = fs.readdirSync(app_dir_path, 'utf-8'); const app_contents = await readdir(app_dir_path, 'utf-8');
for (const file of app_contents) { for (const file of app_contents) {
completion_states_data[app_dir === 'app-a' ? 'initial' : 'complete'].push({ completion_states_data[app_dir === 'app-a' ? 'initial' : 'complete'].push({
name: file, name: file,
type: file.split('.').at(-1), type: file.split('.').at(-1),
content: fs.readFileSync(`${app_dir_path}/${file}`, 'utf-8') content: await readFile(`${app_dir_path}/${file}`, 'utf-8')
}); });
} }
} }

@ -1,5 +1,12 @@
import * as session from '$lib/db/session'; import * as session from '$lib/db/session';
/** @type {import('@sveltejs/adapter-vercel').Config} */
export const config = {
// regions: ['pdx1', 'sfo1', 'cle1', 'iad1'],
regions: 'all',
runtime: 'edge'
};
export async function load({ request }) { export async function load({ request }) {
return { return {
user: session.from_cookie(request.headers.get('cookie')) user: session.from_cookie(request.headers.get('cookie'))

@ -1,7 +1,7 @@
import { error } from '@sveltejs/kit'; import { error } from '@sveltejs/kit';
export async function load({ fetch, params, url }) { export async function load({ fetch, params, url }) {
const res = await fetch(`/repl/${params.id}.json`); const res = await fetch(`/repl/api/${params.id}.json`);
if (!res.ok) { if (!res.ok) {
throw error(res.status); throw error(res.status);

@ -61,7 +61,7 @@ export async function GET({ params }) {
if (dev && !client) { if (dev && !client) {
// in dev with no local Supabase configured, proxy to production // in dev with no local Supabase configured, proxy to production
// this lets us at least load saved REPLs // this lets us at least load saved REPLs
const res = await fetch(`https://svelte.dev/repl/${params.id}.json`); const res = await fetch(`https://svelte.dev/repl/api/${params.id}.json`);
// returning the response directly results in a bizarre // returning the response directly results in a bizarre
// content encoding error, so we create a new one // content encoding error, so we create a new one
@ -95,6 +95,8 @@ export async function GET({ params }) {
} }
export async function entries() { export async function entries() {
const { get_examples_list } = await import('$lib/server/examples/index.js');
return get_examples_list(examples_data) return get_examples_list(examples_data)
.map(({ examples }) => examples) .map(({ examples }) => examples)
.flatMap((val) => val.map(({ slug }) => ({ id: slug }))); .flatMap((val) => val.map(({ slug }) => ({ id: slug })));

@ -1,14 +1,15 @@
import { readFileSync } from 'fs';
import { join } from 'path';
import { env } from '$env/dynamic/private'; import { env } from '$env/dynamic/private';
const local_svelte_path = env.LOCAL_SVELTE_PATH || '../../../svelte'; const local_svelte_path = env.LOCAL_SVELTE_PATH || '../../../svelte';
export function GET({ params: { path } }) { export async function GET({ params: { path } }) {
if (import.meta.env.PROD || ('/' + path).includes('/.')) { if (import.meta.env.PROD || ('/' + path).includes('/.')) {
return new Response(undefined, { status: 403 }); return new Response(undefined, { status: 403 });
} }
return new Response(readFileSync(join(local_svelte_path, path)), {
const { readFile } = await import('node:fs/promises');
return new Response(await readFile(`${local_svelte_path}/${path}`), {
headers: { 'Content-Type': 'text/javascript' } headers: { 'Content-Type': 'text/javascript' }
}); });
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

@ -1,6 +1,5 @@
import { uneval } from 'devalue'; import { uneval } from 'devalue';
import * as cookie from 'cookie'; import * as cookie from 'cookie';
import { stringify } from 'querystring';
import * as session from '$lib/db/session'; import * as session from '$lib/db/session';
import { oauth, client_id, client_secret } from '../_config.js'; import { oauth, client_id, client_secret } from '../_config.js';
@ -9,11 +8,11 @@ export async function GET({ url }) {
// Trade "code" for "access_token" // Trade "code" for "access_token"
const r1 = await fetch( const r1 = await fetch(
`${oauth}/access_token?` + `${oauth}/access_token?` +
stringify({ new URLSearchParams({
code: url.searchParams.get('code'), code: url.searchParams.get('code'),
client_id, client_id,
client_secret client_secret
}) }).toString()
); );
const access_token = new URLSearchParams(await r1.text()).get('access_token'); const access_token = new URLSearchParams(await r1.text()).get('access_token');

@ -1,16 +1,15 @@
import { stringify } from 'querystring';
import { redirect } from '@sveltejs/kit'; import { redirect } from '@sveltejs/kit';
import { oauth, client_id } from '../_config.js'; import { client_id, oauth } from '../_config.js';
export const GET = client_id export const GET = client_id
? ({ url }) => { ? ({ url }) => {
const Location = const Location =
`${oauth}/authorize?` + `${oauth}/authorize?` +
stringify({ new URLSearchParams({
scope: 'read:user', scope: 'read:user',
client_id, client_id,
redirect_uri: `${url.origin}/auth/callback` redirect_uri: `${url.origin}/auth/callback`
}); }).toString();
throw redirect(302, Location); throw redirect(302, Location);
} }

@ -4,6 +4,6 @@ export const prerender = true;
export async function load() { export async function load() {
return { return {
posts: get_blog_list(get_blog_data()) posts: get_blog_list(await get_blog_data())
}; };
} }

@ -4,7 +4,7 @@ import { error } from '@sveltejs/kit';
export const prerender = true; export const prerender = true;
export async function load({ params }) { export async function load({ params }) {
const post = get_processed_blog_post(get_blog_data(), params.slug); const post = get_processed_blog_post(await get_blog_data(), params.slug);
if (!post) throw error(404); if (!post) throw error(404);

@ -11,8 +11,8 @@ const width = 1200;
export const prerender = true; export const prerender = true;
export const GET = async ({ params }) => { export async function GET({ params }) {
const post = await get_processed_blog_post(get_blog_data(), params.slug); const post = await get_processed_blog_post(await get_blog_data(), params.slug);
if (!post) throw error(404); if (!post) throw error(404);
@ -48,4 +48,4 @@ export const GET = async ({ params }) => {
'cache-control': 'public, max-age=600' // cache for 10 minutes 'cache-control': 'public, max-age=600' // cache for 10 minutes
} }
}); });
}; }

@ -58,7 +58,7 @@ const get_rss = (posts) =>
.trim(); .trim();
export async function GET() { export async function GET() {
const posts = get_blog_list(get_blog_data()); const posts = get_blog_list(await get_blog_data());
return new Response(get_rss(posts), { return new Response(get_rss(posts), {
headers: { headers: {

@ -3,8 +3,8 @@ import { json } from '@sveltejs/kit';
export const prerender = true; export const prerender = true;
export function GET() { export async function GET() {
return json({ return json({
blocks: content() blocks: await content()
}); });
} }

@ -6,9 +6,8 @@ import {
removeMarkdown, removeMarkdown,
replaceExportTypePlaceholders replaceExportTypePlaceholders
} from '@sveltejs/site-kit/markdown'; } from '@sveltejs/site-kit/markdown';
import fs from 'node:fs'; import { readFile } from 'node:fs/promises';
import path from 'node:path'; import glob from 'tiny-glob';
import glob from 'tiny-glob/sync.js';
import { CONTENT_BASE } from '../../constants.js'; import { CONTENT_BASE } from '../../constants.js';
const base = CONTENT_BASE; const base = CONTENT_BASE;
@ -18,14 +17,19 @@ function get_href(parts) {
return parts.length > 1 ? `/docs/${parts[0]}#${parts.at(-1)}` : `/docs/${parts[0]}`; return parts.length > 1 ? `/docs/${parts[0]}#${parts.at(-1)}` : `/docs/${parts[0]}`;
} }
export function content() { /** @param {string} path */
function path_basename(path) {
return path.split(/[\\/]/).pop();
}
export async function content() {
/** @type {import('@sveltejs/site-kit/search').Block[]} */ /** @type {import('@sveltejs/site-kit/search').Block[]} */
const blocks = []; const blocks = [];
const breadcrumbs = []; const breadcrumbs = [];
for (const file of glob('**/*.md', { cwd: `${base}/docs` })) { for (const file of await glob('**/*.md', { cwd: `${base}/docs` })) {
const basename = path.basename(file); const basename = path_basename(file);
const match = /\d{2}-(.+)\.md/.exec(basename); const match = /\d{2}-(.+)\.md/.exec(basename);
if (!match) continue; if (!match) continue;
@ -34,7 +38,7 @@ export function content() {
const filepath = `${base}/docs/${file}`; const filepath = `${base}/docs/${file}`;
// const markdown = replace_placeholders(fs.readFileSync(filepath, 'utf-8')); // const markdown = replace_placeholders(fs.readFileSync(filepath, 'utf-8'));
const markdown = replaceExportTypePlaceholders( const markdown = replaceExportTypePlaceholders(
remove_export_snippets(fs.readFileSync(filepath, 'utf-8')), remove_export_snippets(await readFile(filepath, 'utf-8')),
modules modules
); );

@ -1,9 +1,15 @@
import { get_docs_data, get_docs_list } from '$lib/server/docs/index.js';
export const prerender = true; export const prerender = true;
export function load({ url }) { export async function load({ url }) {
if (url.pathname === '/docs') {
return {
sections: []
};
}
const { get_docs_data, get_docs_list } = await import('$lib/server/docs/index.js');
return { return {
sections: url.pathname === '/docs' ? [] : get_docs_list(get_docs_data()) sections: get_docs_list(await get_docs_data())
}; };
} }

@ -32,7 +32,6 @@
} }
.page { .page {
--on-this-page-display: none;
padding: var(--sk-page-padding-top) var(--sk-page-padding-side); padding: var(--sk-page-padding-top) var(--sk-page-padding-side);
min-width: 0 !important; min-width: 0 !important;

@ -1,2 +0,0 @@
// This page now exists solely for redirect, prerendering triggers the `handleMissingID`
export const prerender = false;

@ -4,7 +4,7 @@ import { error } from '@sveltejs/kit';
export const prerender = true; export const prerender = true;
export async function load({ params }) { export async function load({ params }) {
const processed_page = await get_parsed_docs(get_docs_data(), params.slug); const processed_page = await get_parsed_docs(await get_docs_data(), params.slug);
if (!processed_page) throw error(404); if (!processed_page) throw error(404);

@ -29,6 +29,8 @@
<Icon size={50} name="edit" /> Edit this page on GitHub <Icon size={50} name="edit" /> Edit this page on GitHub
</a> </a>
<DocsOnThisPage details={data.page} />
{@html data.page.content} {@html data.page.content}
</div> </div>
@ -49,8 +51,6 @@
</div> </div>
</div> </div>
<DocsOnThisPage details={data.page} />
<style> <style>
.edit { .edit {
position: relative; position: relative;

@ -1,10 +1,9 @@
import { get_example, get_examples_data, get_examples_list } from '$lib/server/examples/index.js'; import { get_example, get_examples_list } from '$lib/server/examples/index.js';
import examples_data from '$lib/generated/examples-data.js';
export const prerender = true; export const prerender = true;
export async function load({ params }) { export async function load({ params }) {
const examples_data = get_examples_data();
const examples_list = get_examples_list(examples_data); const examples_list = get_examples_list(examples_data);
const example = get_example(examples_data, params.slug); const example = get_example(examples_data, params.slug);

@ -1,6 +1,7 @@
import { get_blog_data, get_blog_list } from '$lib/server/blog/index.js'; import { get_blog_data, get_blog_list } from '$lib/server/blog/index.js';
import { get_docs_data, get_docs_list } from '$lib/server/docs/index.js'; import { get_docs_data, get_docs_list } from '$lib/server/docs/index.js';
import { get_examples_data, get_examples_list } from '$lib/server/examples/index.js'; import { get_examples_list } from '$lib/server/examples/index.js';
import examples_data from '$lib/generated/examples-data.js';
import { json } from '@sveltejs/kit'; import { json } from '@sveltejs/kit';
export const prerender = true; export const prerender = true;
@ -13,13 +14,16 @@ export const GET = async () => {
* @returns {Promise<import('@sveltejs/site-kit').NavigationLink[]>} * @returns {Promise<import('@sveltejs/site-kit').NavigationLink[]>}
*/ */
async function get_nav_list() { async function get_nav_list() {
const docs_list = get_docs_list(get_docs_data()); const [docs_list, blog_list] = await Promise.all([
get_docs_list(await get_docs_data()),
get_blog_list(await get_blog_data())
]);
const processed_docs_list = docs_list.map(({ title, pages }) => ({ const processed_docs_list = docs_list.map(({ title, pages }) => ({
title, title,
sections: pages.map(({ title, path }) => ({ title, path })) sections: pages.map(({ title, path }) => ({ title, path }))
})); }));
const blog_list = get_blog_list(get_blog_data());
const processed_blog_list = [ const processed_blog_list = [
{ {
title: 'Blog', title: 'Blog',
@ -32,7 +36,7 @@ async function get_nav_list() {
} }
]; ];
const examples_list = get_examples_list(get_examples_data()); const examples_list = get_examples_list(examples_data);
const processed_examples_list = examples_list const processed_examples_list = examples_list
.map(({ title, examples }) => ({ .map(({ title, examples }) => ({
title, title,

@ -10,7 +10,7 @@ export const prerender = true;
export async function load({ params }) { export async function load({ params }) {
if (params.slug === 'local-transitions') throw redirect(307, '/tutorial/global-transitions'); if (params.slug === 'local-transitions') throw redirect(307, '/tutorial/global-transitions');
const tutorial_data = get_tutorial_data(); const tutorial_data = await get_tutorial_data();
const tutorials_list = get_tutorial_list(tutorial_data); const tutorials_list = get_tutorial_list(tutorial_data);
const tutorial = await get_parsed_tutorial(tutorial_data, params.slug); const tutorial = await get_parsed_tutorial(tutorial_data, params.slug);
@ -25,7 +25,7 @@ export async function load({ params }) {
} }
export async function entries() { export async function entries() {
const tutorials_list = get_tutorial_list(get_tutorial_data()); const tutorials_list = get_tutorial_list(await get_tutorial_data());
const slugs = tutorials_list const slugs = tutorials_list
.map(({ tutorials }) => tutorials) .map(({ tutorials }) => tutorials)
.flatMap((val) => val.map(({ slug }) => ({ slug }))); .flatMap((val) => val.map(({ slug }) => ({ slug })));

@ -0,0 +1,2 @@
User-agent: *
Disallow:

@ -4,7 +4,10 @@ import adapter from '@sveltejs/adapter-vercel';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
export default { export default {
kit: { kit: {
adapter: adapter() adapter: adapter({ runtime: 'edge' }),
prerender: {
concurrency: 10
}
}, },
vitePlugin: { vitePlugin: {

@ -1,5 +1,5 @@
import { sveltekit } from '@sveltejs/kit/vite'; import { sveltekit } from '@sveltejs/kit/vite';
import * as fs from 'fs'; import { readFile } from 'node:fs/promises';
const plugins = [raw(['.ttf']), sveltekit()]; const plugins = [raw(['.ttf']), sveltekit()];
@ -25,9 +25,9 @@ if (!process.versions.webcontainer) {
function raw(ext) { function raw(ext) {
return { return {
name: 'vite-plugin-raw', name: 'vite-plugin-raw',
transform(_, id) { async transform(_, id) {
if (ext.some((e) => id.endsWith(e))) { if (ext.some((e) => id.endsWith(e))) {
const buffer = fs.readFileSync(id); const buffer = await readFile(id);
return { code: `export default ${JSON.stringify(buffer)}`, map: null }; return { code: `export default ${JSON.stringify(buffer)}`, map: null };
} }
} }

Loading…
Cancel
Save