chore: upgrade prettier to 3.1 (#10134)

pull/10171/head
Ben McCann 6 months ago committed by GitHub
parent 2e9e8e8454
commit aecd47e8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,7 @@
? people.filter((person) => { ? people.filter((person) => {
const name = `${person.last}, ${person.first}`; const name = `${person.last}, ${person.first}`;
return name.toLowerCase().startsWith(prefix.toLowerCase()); return name.toLowerCase().startsWith(prefix.toLowerCase());
}) })
: people; : people;
$: selected = filteredPeople[i]; $: selected = filteredPeople[i];

@ -18,8 +18,8 @@
"build:sites": "pnpm -r --filter=./sites/* build", "build:sites": "pnpm -r --filter=./sites/* build",
"preview-site": "npm run build --prefix sites/svelte-5-preview", "preview-site": "npm run build --prefix sites/svelte-5-preview",
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check", "check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
"format": "prettier --write --plugin prettier-plugin-svelte .", "format": "prettier --write .",
"lint": "prettier --check --plugin prettier-plugin-svelte . && eslint ./", "lint": "prettier --check . && eslint ./",
"test": "vitest run --coverage", "test": "vitest run --coverage",
"test-output": "vitest run --reporter=json --outputFile=sites/svelte-5-preview/src/routes/status/results.json", "test-output": "vitest run --reporter=json --outputFile=sites/svelte-5-preview/src/routes/status/results.json",
"changeset:version": "changeset version && pnpm -r generate:version && git add --all", "changeset:version": "changeset version && pnpm -r generate:version && git add --all",
@ -38,8 +38,8 @@
"eslint-plugin-lube": "^0.1.7", "eslint-plugin-lube": "^0.1.7",
"jsdom": "22.0.0", "jsdom": "22.0.0",
"playwright": "^1.35.1", "playwright": "^1.35.1",
"prettier": "^3.0.1", "prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.0.3", "prettier-plugin-svelte": "^3.1.2",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"vitest": "^0.34.6" "vitest": "^0.34.6"
} }

@ -234,8 +234,8 @@ const attributes = {
type === 'no-each' type === 'no-each'
? `An element that uses the animate directive must be the immediate child of a keyed each block` ? `An element that uses the animate directive must be the immediate child of a keyed each block`
: type === 'each-key' : type === 'each-key'
? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?` ? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
: `An element that uses the animate directive must be the sole child of a keyed each block`, : `An element that uses the animate directive must be the sole child of a keyed each block`,
'duplicate-animation': () => `An element can only have one 'animate' directive`, 'duplicate-animation': () => `An element can only have one 'animate' directive`,
/** @param {string[] | undefined} [modifiers] */ /** @param {string[] | undefined} [modifiers] */
'invalid-event-modifier': (modifiers) => 'invalid-event-modifier': (modifiers) =>
@ -262,7 +262,7 @@ const attributes = {
? `An element can only have one '${directive1}' directive` ? `An element can only have one '${directive1}' directive`
: `An element cannot have both ${describe(directive1)} directive and ${describe( : `An element cannot have both ${describe(directive1)} directive and ${describe(
directive2 directive2
)} directive`; )} directive`;
}, },
'invalid-let-directive-placement': () => 'let directive at invalid position' 'invalid-let-directive-placement': () => 'let directive at invalid position'
}; };

@ -108,7 +108,7 @@ export function convert(source, ast) {
// @ts-ignore // @ts-ignore
delete node.parent; delete node.parent;
} }
}) })
: undefined : undefined
}; };
}, },

@ -108,12 +108,12 @@ export default function tag(parser) {
const type = meta_tags.has(name) const type = meta_tags.has(name)
? meta_tags.get(name) ? meta_tags.get(name)
: regex_capital_letter.test(name[0]) || name === 'svelte:self' || name === 'svelte:component' : regex_capital_letter.test(name[0]) || name === 'svelte:self' || name === 'svelte:component'
? 'Component' ? 'Component'
: name === 'title' && parent_is_head(parser.stack) : name === 'title' && parent_is_head(parser.stack)
? 'TitleElement' ? 'TitleElement'
: name === 'slot' : name === 'slot'
? 'SlotElement' ? 'SlotElement'
: 'RegularElement'; : 'RegularElement';
/** @type {import('#compiler').ElementLike} */ /** @type {import('#compiler').ElementLike} */
// @ts-expect-error TODO can't figure out this error // @ts-expect-error TODO can't figure out this error
@ -132,7 +132,7 @@ export default function tag(parser) {
can_delegate_events: null can_delegate_events: null
}, },
parent: null parent: null
} }
: { : {
type: /** @type {import('#compiler').ElementLike['type']} */ (type), type: /** @type {import('#compiler').ElementLike['type']} */ (type),
start, start,
@ -141,7 +141,7 @@ export default function tag(parser) {
attributes: [], attributes: [],
fragment: create_fragment(true), fragment: create_fragment(true),
parent: null parent: null
}; };
parser.allow_whitespace(); parser.allow_whitespace();

@ -275,7 +275,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
sourcemap_list, sourcemap_list,
() => null, () => null,
true // skip optional field `sourcesContent` true // skip optional field `sourcesContent`
) )
: remapping( : remapping(
// use loader interface // use loader interface
sourcemap_list[0], // last map sourcemap_list[0], // last map
@ -291,7 +291,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
} }
), ),
true true
); );
if (!map.file) delete map.file; // skip optional field `file` if (!map.file) delete map.file; // skip optional field `file`

@ -713,12 +713,12 @@ const runes_scope_tweaker = {
rune === '$state' rune === '$state'
? 'state' ? 'state'
: rune === '$state.frozen' : rune === '$state.frozen'
? 'frozen_state' ? 'frozen_state'
: rune === '$derived' : rune === '$derived'
? 'derived' ? 'derived'
: path.is_rest : path.is_rest
? 'rest_prop' ? 'rest_prop'
: 'prop'; : 'prop';
} }
if (rune === '$props') { if (rune === '$props') {

@ -201,7 +201,7 @@ export function client_component(source, analysis, options) {
b.call('$.validate_store', store_reference, b.literal(name.slice(1))), b.call('$.validate_store', store_reference, b.literal(name.slice(1))),
store_get store_get
]) ])
) )
: b.thunk(store_get) : b.thunk(store_get)
) )
); );

@ -20,11 +20,11 @@ export function get_assignment_value(node, { state, visit }) {
return operator === '=' return operator === '='
? /** @type {import('estree').Expression} */ (visit(node.right)) ? /** @type {import('estree').Expression} */ (visit(node.right))
: // turn something like x += 1 into x = x + 1 : // turn something like x += 1 into x = x + 1
b.binary( b.binary(
/** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)), /** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)),
serialize_get_binding(node.left, state), serialize_get_binding(node.left, state),
/** @type {import('estree').Expression} */ (visit(node.right)) /** @type {import('estree').Expression} */ (visit(node.right))
); );
} else if ( } else if (
node.left.type === 'MemberExpression' && node.left.type === 'MemberExpression' &&
node.left.object.type === 'ThisExpression' && node.left.object.type === 'ThisExpression' &&
@ -35,11 +35,11 @@ export function get_assignment_value(node, { state, visit }) {
return operator === '=' return operator === '='
? /** @type {import('estree').Expression} */ (visit(node.right)) ? /** @type {import('estree').Expression} */ (visit(node.right))
: // turn something like x += 1 into x = x + 1 : // turn something like x += 1 into x = x + 1
b.binary( b.binary(
/** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)), /** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)),
/** @type {import('estree').Expression} */ (visit(node.left)), /** @type {import('estree').Expression} */ (visit(node.left)),
/** @type {import('estree').Expression} */ (visit(node.right)) /** @type {import('estree').Expression} */ (visit(node.right))
); );
} else { } else {
return /** @type {import('estree').Expression} */ (visit(node.right)); return /** @type {import('estree').Expression} */ (visit(node.right));
} }

@ -87,8 +87,11 @@ export const javascript_visitors_runes = {
field.kind === 'state' field.kind === 'state'
? b.call('$.source', should_proxy_or_freeze(init) ? b.call('$.proxy', init) : init) ? b.call('$.source', should_proxy_or_freeze(init) ? b.call('$.proxy', init) : init)
: field.kind === 'frozen_state' : field.kind === 'frozen_state'
? b.call('$.source', should_proxy_or_freeze(init) ? b.call('$.freeze', init) : init) ? b.call(
: b.call('$.derived', b.thunk(init)); '$.source',
should_proxy_or_freeze(init) ? b.call('$.freeze', init) : init
)
: b.call('$.derived', b.thunk(init));
} else { } else {
// if no arguments, we know it's state as `$derived()` is a compile error // if no arguments, we know it's state as `$derived()` is a compile error
value = b.call('$.source'); value = b.call('$.source');

@ -655,15 +655,15 @@ function serialize_element_special_value_attribute(element, node_id, attribute,
// This ensures things stay in sync with the select binding // This ensures things stay in sync with the select binding
// in case of updates to the option value or new values appearing // in case of updates to the option value or new values appearing
b.call('$.selected', node_id) b.call('$.selected', node_id)
]) ])
: needs_option_call : needs_option_call
? b.sequence([ ? b.sequence([
inner_assignment, inner_assignment,
// This ensures a one-way street to the DOM in case it's <select {value}> // This ensures a one-way street to the DOM in case it's <select {value}>
// and not <select bind:value> // and not <select bind:value>
b.call('$.select_option', node_id, value) b.call('$.select_option', node_id, value)
]) ])
: inner_assignment : inner_assignment
); );
if (is_reactive) { if (is_reactive) {
@ -953,7 +953,7 @@ function serialize_inline_component(node, component_name, context) {
: b.call( : b.call(
'$.spread_props', '$.spread_props',
...props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p)) ...props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p))
); );
/** @param {import('estree').Identifier} node_id */ /** @param {import('estree').Identifier} node_id */
let fn = (node_id) => let fn = (node_id) =>
b.call( b.call(
@ -2345,7 +2345,7 @@ export const template_visitors = {
? b.arrow( ? b.arrow(
[b.id('$$anchor')], [b.id('$$anchor')],
/** @type {import('estree').BlockStatement} */ (context.visit(node.fallback)) /** @type {import('estree').BlockStatement} */ (context.visit(node.fallback))
) )
: b.literal(null); : b.literal(null);
const key_function = const key_function =
node.key && ((each_type & EACH_ITEM_REACTIVE) !== 0 || context.state.options.dev) node.key && ((each_type & EACH_ITEM_REACTIVE) !== 0 || context.state.options.dev)
@ -2356,7 +2356,7 @@ export const template_visitors = {
b.return(/** @type {import('estree').Expression} */ (context.visit(node.key))) b.return(/** @type {import('estree').Expression} */ (context.visit(node.key)))
) )
) )
) )
: b.literal(null); : b.literal(null);
if (node.index && each_node_meta.contains_group_binding) { if (node.index && each_node_meta.contains_group_binding) {
@ -2418,7 +2418,7 @@ export const template_visitors = {
? b.arrow( ? b.arrow(
[b.id('$$anchor')], [b.id('$$anchor')],
/** @type {import('estree').BlockStatement} */ (context.visit(node.alternate)) /** @type {import('estree').BlockStatement} */ (context.visit(node.alternate))
) )
: b.literal(null) : b.literal(null)
) )
) )
@ -2437,7 +2437,7 @@ export const template_visitors = {
? b.arrow( ? b.arrow(
[b.id('$$anchor')], [b.id('$$anchor')],
/** @type {import('estree').BlockStatement} */ (context.visit(node.pending)) /** @type {import('estree').BlockStatement} */ (context.visit(node.pending))
) )
: b.literal(null), : b.literal(null),
node.then node.then
? b.arrow( ? b.arrow(
@ -2445,10 +2445,10 @@ export const template_visitors = {
? [ ? [
b.id('$$anchor'), b.id('$$anchor'),
/** @type {import('estree').Pattern} */ (context.visit(node.value)) /** @type {import('estree').Pattern} */ (context.visit(node.value))
] ]
: [b.id('$$anchor')], : [b.id('$$anchor')],
/** @type {import('estree').BlockStatement} */ (context.visit(node.then)) /** @type {import('estree').BlockStatement} */ (context.visit(node.then))
) )
: b.literal(null), : b.literal(null),
node.catch node.catch
? b.arrow( ? b.arrow(
@ -2456,10 +2456,10 @@ export const template_visitors = {
? [ ? [
b.id('$$anchor'), b.id('$$anchor'),
/** @type {import('estree').Pattern} */ (context.visit(node.error)) /** @type {import('estree').Pattern} */ (context.visit(node.error))
] ]
: [b.id('$$anchor')], : [b.id('$$anchor')],
/** @type {import('estree').BlockStatement} */ (context.visit(node.catch)) /** @type {import('estree').BlockStatement} */ (context.visit(node.catch))
) )
: b.literal(null) : b.literal(null)
) )
) )
@ -2876,9 +2876,9 @@ export const template_visitors = {
/** @type {import('estree').Expression} */ (node.expression).type === /** @type {import('estree').Expression} */ (node.expression).type ===
'ObjectExpression' 'ObjectExpression'
? // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine ? // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
b.object_pattern(node.expression.properties) b.object_pattern(node.expression.properties)
: // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine : // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
b.array_pattern(node.expression.elements), b.array_pattern(node.expression.elements),
b.member(b.id('$$slotProps'), b.id(node.name)) b.member(b.id('$$slotProps'), b.id(node.name))
), ),
b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node)))) b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node))))
@ -2971,7 +2971,7 @@ export const template_visitors = {
: b.arrow( : b.arrow(
[b.id('$$anchor')], [b.id('$$anchor')],
b.block(create_block(node, 'fallback', node.fragment.nodes, context)) b.block(create_block(node, 'fallback', node.fragment.nodes, context))
); );
const expression = is_default const expression = is_default
? b.member(b.id('$$props'), b.id('children')) ? b.member(b.id('$$props'), b.id('children'))

@ -351,11 +351,11 @@ function get_assignment_value(node, { state, visit }) {
return operator === '=' return operator === '='
? /** @type {import('estree').Expression} */ (visit(node.right)) ? /** @type {import('estree').Expression} */ (visit(node.right))
: // turn something like x += 1 into x = x + 1 : // turn something like x += 1 into x = x + 1
b.binary( b.binary(
/** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)), /** @type {import('estree').BinaryOperator} */ (operator.slice(0, -1)),
serialize_get_binding(node.left, state), serialize_get_binding(node.left, state),
/** @type {import('estree').Expression} */ (visit(node.right)) /** @type {import('estree').Expression} */ (visit(node.right))
); );
} else { } else {
return /** @type {import('estree').Expression} */ (visit(node.right)); return /** @type {import('estree').Expression} */ (visit(node.right));
} }
@ -780,7 +780,7 @@ function serialize_element_spread_attributes(
b.id('join') b.id('join')
), ),
b.literal(' ') b.literal(' ')
) )
: b.literal(''); : b.literal('');
args.push( args.push(
b.object([ b.object([
@ -933,7 +933,7 @@ function serialize_inline_component(node, component_name, context) {
: b.call( : b.call(
'$.spread_props', '$.spread_props',
b.array(props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p))) b.array(props_and_spreads.map((p) => (Array.isArray(p) ? b.object(p) : p)))
); );
/** @type {import('estree').Statement} */ /** @type {import('estree').Statement} */
let statement = b.stmt( let statement = b.stmt(
@ -942,7 +942,7 @@ function serialize_inline_component(node, component_name, context) {
? b.call( ? b.call(
'$.validate_component', '$.validate_component',
typeof component_name === 'string' ? b.id(component_name) : component_name typeof component_name === 'string' ? b.id(component_name) : component_name
) )
: component_name, : component_name,
b.id('$$payload'), b.id('$$payload'),
props_expression props_expression
@ -1034,7 +1034,7 @@ const javascript_visitors_legacy = {
'$.value_or_fallback', '$.value_or_fallback',
prop, prop,
/** @type {import('estree').Expression} */ (visit(declarator.init)) /** @type {import('estree').Expression} */ (visit(declarator.init))
) )
: prop; : prop;
declarations.push(b.declarator(declarator.id, init)); declarations.push(b.declarator(declarator.id, init));
@ -1179,7 +1179,7 @@ const template_visitors = {
template: [], template: [],
init: [] init: []
} }
} }
: { ...context, state }; : { ...context, state };
const { hoisted, trimmed } = clean_nodes( const { hoisted, trimmed } = clean_nodes(
@ -1503,9 +1503,9 @@ const template_visitors = {
b.let( b.let(
node.expression.type === 'ObjectExpression' node.expression.type === 'ObjectExpression'
? // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine ? // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
b.object_pattern(node.expression.properties) b.object_pattern(node.expression.properties)
: // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine : // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
b.array_pattern(node.expression.elements), b.array_pattern(node.expression.elements),
b.member(b.id('$$slotProps'), b.id(node.name)) b.member(b.id('$$slotProps'), b.id(node.name))
), ),
b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node)))) b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node))))
@ -1721,12 +1721,12 @@ function serialize_element_attributes(node, context) {
? b.call( ? b.call(
b.member(attribute.expression, b.id('includes')), b.member(attribute.expression, b.id('includes')),
serialize_attribute_value(value_attribute.value, context) serialize_attribute_value(value_attribute.value, context)
) )
: b.binary( : b.binary(
'===', '===',
attribute.expression, attribute.expression,
serialize_attribute_value(value_attribute.value, context) serialize_attribute_value(value_attribute.value, context)
), ),
metadata: { metadata: {
contains_call_expression: false, contains_call_expression: false,
dynamic: false dynamic: false

@ -198,7 +198,7 @@ export function infer_namespace(namespace, parent, nodes, path) {
const parent_node = const parent_node =
parent.type === 'Fragment' parent.type === 'Fragment'
? // Messy: We know that Fragment calls create_block directly, so we can do this here ? // Messy: We know that Fragment calls create_block directly, so we can do this here
path.at(-1) path.at(-1)
: parent; : parent;
if ( if (

@ -318,7 +318,7 @@ async function process_markup(process, source) {
string: processed.code, string: processed.code,
map: processed.map map: processed.map
? // TODO: can we use decode_sourcemap? ? // TODO: can we use decode_sourcemap?
typeof processed.map === 'string' typeof processed.map === 'string'
? JSON.parse(processed.map) ? JSON.parse(processed.map)
: processed.map : processed.map
: undefined, : undefined,

@ -258,7 +258,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
sourcemap_list, sourcemap_list,
() => null, () => null,
true // skip optional field `sourcesContent` true // skip optional field `sourcesContent`
) )
: remapping( : remapping(
// use loader interface // use loader interface
sourcemap_list[0], // last map sourcemap_list[0], // last map
@ -271,7 +271,7 @@ export function combine_sourcemaps(filename, sourcemap_list) {
} }
}, },
true true
); );
if (!map.file) delete map.file; // skip optional field `file` if (!map.file) delete map.file; // skip optional field `file`
// When source maps are combined and the leading map is empty, sources is not set. // When source maps are combined and the leading map is empty, sources is not set.
// Add the filename to the empty array in this case. // Add the filename to the empty array in this case.

@ -59,10 +59,10 @@ export function bounceOut(t) {
return t < a return t < a
? 7.5625 * t2 ? 7.5625 * t2
: t < b : t < b
? 9.075 * t2 - 9.9 * t + 3.4 ? 9.075 * t2 - 9.9 * t + 3.4
: t < c : t < c
? ca * t2 - cb * t + cc ? ca * t2 - cb * t + cc
: 10.8 * t * t - 20.52 * t + 10.72; : 10.8 * t * t - 20.52 * t + 10.72;
} }
/** /**
@ -180,8 +180,8 @@ export function expoInOut(t) {
return t === 0.0 || t === 1.0 return t === 0.0 || t === 1.0
? t ? t
: t < 0.5 : t < 0.5
? +0.5 * Math.pow(2.0, 20.0 * t - 10.0) ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)
: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0; : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;
} }
/** /**

@ -133,8 +133,8 @@ function each(anchor_node, collection, flags, key_fn, render_fn, fallback_fn, re
array = is_array(maybe_array) array = is_array(maybe_array)
? maybe_array ? maybe_array
: maybe_array == null : maybe_array == null
? [] ? []
: Array.from(maybe_array); : Array.from(maybe_array);
if (key_fn !== null) { if (key_fn !== null) {
keys = array.map(key_fn); keys = array.map(key_fn);
} else if ((flags & EACH_KEYED) === 0) { } else if ((flags & EACH_KEYED) === 0) {
@ -777,8 +777,8 @@ function each_item_block(item, key, index, render_fn, flags) {
const item_value = each_item_not_reactive const item_value = each_item_not_reactive
? item ? item
: (flags & EACH_IS_IMMUTABLE) === 0 : (flags & EACH_IS_IMMUTABLE) === 0
? mutable_source(item) ? mutable_source(item)
: source(item); : source(item);
const index_value = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index); const index_value = (flags & EACH_INDEX_REACTIVE) === 0 ? index : source(index);
const block = create_each_item_block(item_value, index_value, key); const block = create_each_item_block(item_value, index_value, key);

@ -873,8 +873,8 @@ export function bind_resize_observer(dom, type, update) {
type === 'contentRect' || type === 'contentBoxSize' type === 'contentRect' || type === 'contentBoxSize'
? resize_observer_content_box ? resize_observer_content_box
: type === 'borderBoxSize' : type === 'borderBoxSize'
? resize_observer_border_box ? resize_observer_border_box
: resize_observer_device_pixel_content_box; : resize_observer_device_pixel_content_box;
const unsub = observer.observe(dom, /** @param {any} entry */ (entry) => update(entry[type])); const unsub = observer.observe(dom, /** @param {any} entry */ (entry) => update(entry[type]));
render_effect(() => unsub); render_effect(() => unsub);
} }
@ -1587,8 +1587,8 @@ export function element(anchor_node, tag_fn, render_fn, is_svg = false) {
? current_hydration_fragment !== null ? current_hydration_fragment !== null
? /** @type {HTMLElement | SVGElement} */ (current_hydration_fragment[0]) ? /** @type {HTMLElement | SVGElement} */ (current_hydration_fragment[0])
: is_svg : is_svg
? document.createElementNS('http://www.w3.org/2000/svg', tag) ? document.createElementNS('http://www.w3.org/2000/svg', tag)
: document.createElement(tag) : document.createElement(tag)
: null; : null;
const prev_element = element; const prev_element = element;
if (prev_element !== null) { if (prev_element !== null) {
@ -2850,7 +2850,7 @@ export function mount(component, options) {
PassiveDelegatedEvents.includes(event_name) PassiveDelegatedEvents.includes(event_name)
? { ? {
passive: true passive: true
} }
: undefined : undefined
); );
// The document listener ensures we catch events that originate from elements that were // The document listener ensures we catch events that originate from elements that were
@ -2861,7 +2861,7 @@ export function mount(component, options) {
PassiveDelegatedEvents.includes(event_name) PassiveDelegatedEvents.includes(event_name)
? { ? {
passive: true passive: true
} }
: undefined : undefined
); );
} }

@ -553,7 +553,7 @@ function infinite_loop_guard() {
'ERR_SVELTE_TOO_MANY_UPDATES' + 'ERR_SVELTE_TOO_MANY_UPDATES' +
(DEV (DEV
? ': Maximum update depth exceeded. This can happen when a reactive block or effect ' + ? ': Maximum update depth exceeded. This can happen when a reactive block or effect ' +
'repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops.' 'repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops.'
: '') : '')
); );
} }
@ -1117,8 +1117,8 @@ export function set_signal_value(signal, value) {
'ERR_SVELTE_UNSAFE_MUTATION' + 'ERR_SVELTE_UNSAFE_MUTATION' +
(DEV (DEV
? ": Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. " + ? ": Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. " +
'This can lead to unexpected errors and possibly cause infinite loops.\n\nIf this mutation is not meant ' + 'This can lead to unexpected errors and possibly cause infinite loops.\n\nIf this mutation is not meant ' +
'to be reactive do not use the "$state" rune for that declaration.' 'to be reactive do not use the "$state" rune for that declaration.'
: '') : '')
); );
} }
@ -1629,7 +1629,7 @@ export function safe_not_equal(a, b) {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
return a != a return a != a
? // eslint-disable-next-line eqeqeq ? // eslint-disable-next-line eqeqeq
b == b b == b
: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function'; : a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';
} }

@ -547,10 +547,10 @@ export function bind_transition(dom, get_transition_fn, props_fn, direction, glo
{ from: /** @type {DOMRect} */ (from), to: dom.getBoundingClientRect() }, { from: /** @type {DOMRect} */ (from), to: dom.getBoundingClientRect() },
props, props,
{} {}
) )
: /** @type {import('./types.js').TransitionFn<any>} */ (transition_fn)(dom, props, { : /** @type {import('./types.js').TransitionFn<any>} */ (transition_fn)(dom, props, {
direction direction
}); });
}); });
transition = create_transition(dom, init, direction, transition_effect); transition = create_transition(dom, init, direction, transition_effect);

@ -75,8 +75,8 @@ export function validate_each_keys(collection, key_fn) {
const array = is_array(maybe_array) const array = is_array(maybe_array)
? maybe_array ? maybe_array
: maybe_array == null : maybe_array == null
? [] ? []
: Array.from(maybe_array); : Array.from(maybe_array);
const length = array.length; const length = array.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
const key = key_fn(array[i], i); const key = key_fn(array[i], i);

@ -23,8 +23,8 @@ type PropsWithChildren<Props, Slots> = Props &
(Props extends { children?: any } (Props extends { children?: any }
? {} ? {}
: Slots extends { default: any } : Slots extends { default: any }
? { children?: Snippet } ? { children?: Snippet }
: {}); : {});
/** /**
* Can be used to create strongly typed Svelte components. * Can be used to create strongly typed Svelte components.
@ -213,8 +213,8 @@ export interface EventDispatcher<EventMap extends Record<string, any>> {
...args: null extends EventMap[Type] ...args: null extends EventMap[Type]
? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions] ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
: undefined extends EventMap[Type] : undefined extends EventMap[Type]
? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions] ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
: [type: Type, parameter: EventMap[Type], options?: DispatchOptions] : [type: Type, parameter: EventMap[Type], options?: DispatchOptions]
): boolean; ): boolean;
} }

@ -33,7 +33,7 @@ export function safe_not_equal(a, b) {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
return a != a return a != a
? // eslint-disable-next-line eqeqeq ? // eslint-disable-next-line eqeqeq
b == b b == b
: a !== b || (a && typeof a === 'object') || typeof a === 'function'; : a !== b || (a && typeof a === 'object') || typeof a === 'function';
} }

@ -37,8 +37,8 @@ declare global {
): Key extends keyof ElementTagNameMap ): Key extends keyof ElementTagNameMap
? ElementTagNameMap[Key] ? ElementTagNameMap[Key]
: Key extends keyof SVGElementTagNameMap : Key extends keyof SVGElementTagNameMap
? SVGElementTagNameMap[Key] ? SVGElementTagNameMap[Key]
: any; : any;
function createElement<Elements extends IntrinsicElements, Key extends keyof Elements, T>( function createElement<Elements extends IntrinsicElements, Key extends keyof Elements, T>(
// "undefined | null" because of <svelte:element> // "undefined | null" because of <svelte:element>
element: Key | undefined | null, element: Key | undefined | null,
@ -47,8 +47,8 @@ declare global {
): Key extends keyof ElementTagNameMap ): Key extends keyof ElementTagNameMap
? ElementTagNameMap[Key] ? ElementTagNameMap[Key]
: Key extends keyof SVGElementTagNameMap : Key extends keyof SVGElementTagNameMap
? SVGElementTagNameMap[Key] ? SVGElementTagNameMap[Key]
: any; : any;
// For backwards-compatibility and ease-of-use, in case someone enhanced the typings from import('svelte/elements').HTMLAttributes/SVGAttributes // For backwards-compatibility and ease-of-use, in case someone enhanced the typings from import('svelte/elements').HTMLAttributes/SVGAttributes
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars

@ -17,7 +17,7 @@ const filter = process.env.FILTER
process.env.FILTER.startsWith('/') process.env.FILTER.startsWith('/')
? process.env.FILTER.slice(1, -1).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') ? process.env.FILTER.slice(1, -1).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
: `^${process.env.FILTER.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}$` : `^${process.env.FILTER.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}$`
) )
: /./; : /./;
export function suite<Test extends BaseTest>(fn: (config: Test, test_dir: string) => void) { export function suite<Test extends BaseTest>(fn: (config: Test, test_dir: string) => void) {

@ -24,8 +24,8 @@ declare module 'svelte' {
(Props extends { children?: any } (Props extends { children?: any }
? {} ? {}
: Slots extends { default: any } : Slots extends { default: any }
? { children?: Snippet } ? { children?: Snippet }
: {}); : {});
/** /**
* Can be used to create strongly typed Svelte components. * Can be used to create strongly typed Svelte components.
@ -214,8 +214,8 @@ declare module 'svelte' {
...args: null extends EventMap[Type] ...args: null extends EventMap[Type]
? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions] ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
: undefined extends EventMap[Type] : undefined extends EventMap[Type]
? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions] ? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
: [type: Type, parameter: EventMap[Type], options?: DispatchOptions] : [type: Type, parameter: EventMap[Type], options?: DispatchOptions]
): boolean; ): boolean;
} }
/** /**
@ -1757,8 +1757,8 @@ declare module 'svelte/legacy' {
(Props extends { children?: any } (Props extends { children?: any }
? {} ? {}
: Slots extends { default: any } : Slots extends { default: any }
? { children?: Snippet } ? { children?: Snippet }
: {}); : {});
/** /**
* Can be used to create strongly typed Svelte components. * Can be used to create strongly typed Svelte components.

@ -45,11 +45,11 @@ importers:
specifier: ^1.35.1 specifier: ^1.35.1
version: 1.39.0 version: 1.39.0
prettier: prettier:
specifier: ^3.0.1 specifier: ^3.1.1
version: 3.0.3 version: 3.1.1
prettier-plugin-svelte: prettier-plugin-svelte:
specifier: ^3.0.3 specifier: ^3.1.2
version: 3.1.0(prettier@3.0.3)(svelte@packages+svelte) version: 3.1.2(prettier@3.1.1)(svelte@packages+svelte)
typescript: typescript:
specifier: ^5.2.2 specifier: ^5.2.2
version: 5.2.2 version: 5.2.2
@ -357,11 +357,11 @@ importers:
specifier: ^9.0.0 specifier: ^9.0.0
version: 9.1.6 version: 9.1.6
prettier: prettier:
specifier: ^3.1.0 specifier: ^3.1.1
version: 3.1.0 version: 3.1.1
prettier-plugin-svelte: prettier-plugin-svelte:
specifier: ^3.1.2 specifier: ^3.1.2
version: 3.1.2(prettier@3.1.0)(svelte@4.2.3) version: 3.1.2(prettier@3.1.1)(svelte@4.2.3)
sass: sass:
specifier: ^1.67.0 specifier: ^1.67.0
version: 1.69.5 version: 1.69.5
@ -6073,24 +6073,24 @@ packages:
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
dev: true dev: true
/prettier-plugin-svelte@3.1.0(prettier@3.0.3)(svelte@packages+svelte): /prettier-plugin-svelte@3.1.2(prettier@3.1.1)(svelte@4.2.3):
resolution: {integrity: sha512-96+AZxs2ESqIFA9j+o+DHqY+BsUglezfl553LQd6VOtTyJq5GPuBEb3ElxF2cerFzKlYKttlH/VcVmRNj5oc3A==} resolution: {integrity: sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==}
peerDependencies: peerDependencies:
prettier: ^3.0.0 prettier: ^3.0.0
svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0 svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0
dependencies: dependencies:
prettier: 3.0.3 prettier: 3.1.1
svelte: link:packages/svelte svelte: 4.2.3
dev: true dev: true
/prettier-plugin-svelte@3.1.2(prettier@3.1.0)(svelte@4.2.3): /prettier-plugin-svelte@3.1.2(prettier@3.1.1)(svelte@packages+svelte):
resolution: {integrity: sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==} resolution: {integrity: sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==}
peerDependencies: peerDependencies:
prettier: ^3.0.0 prettier: ^3.0.0
svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0 svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0
dependencies: dependencies:
prettier: 3.1.0 prettier: 3.1.1
svelte: 4.2.3 svelte: link:packages/svelte
dev: true dev: true
/prettier@2.8.8: /prettier@2.8.8:
@ -6099,14 +6099,8 @@ packages:
hasBin: true hasBin: true
dev: true dev: true
/prettier@3.0.3: /prettier@3.1.1:
resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==}
engines: {node: '>=14'}
hasBin: true
dev: true
/prettier@3.1.0:
resolution: {integrity: sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
dev: true dev: true

@ -298,7 +298,7 @@
status = message; status = message;
} }
}) })
: null; : null;
/** /**

@ -535,7 +535,7 @@ async function bundle({ uid, files }) {
exports: 'named' exports: 'named'
// sourcemap: 'inline' // sourcemap: 'inline'
}) })
)?.output?.[0] )?.output?.[0]
: null; : null;
return { return {

@ -41,7 +41,7 @@
"lightningcss": "^1.21.8", "lightningcss": "^1.21.8",
"magic-string": "^0.30.3", "magic-string": "^0.30.3",
"marked": "^9.0.0", "marked": "^9.0.0",
"prettier": "^3.1.0", "prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2", "prettier-plugin-svelte": "^3.1.2",
"sass": "^1.67.0", "sass": "^1.67.0",
"satori": "^0.10.4", "satori": "^0.10.4",

@ -12,7 +12,7 @@ export const GET = client_id
}).toString(); }).toString();
throw redirect(302, Location); throw redirect(302, Location);
} }
: () => : () =>
new Response( new Response(
` `

Loading…
Cancel
Save