Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore: separate expected output for svelte 4 and 5 #13093

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"**/build/**",
"**/test-results/**",
"documentation/**/*.md",
"packages/package/test/fixtures/**/expected/**/*",
"packages/package/test/watch/expected/**/*",
"packages/package/test/fixtures/**/expected*/**/*",
"packages/package/test/watch/expected*/**/*",
"packages/package/test/watch/package/**/*",
"packages/kit/src/core/postbuild/fixtures/**/*"
],
Expand Down
1 change: 1 addition & 0 deletions packages/package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@types/node": "^18.19.48",
"@types/semver": "^7.5.6",
"prettier": "^3.1.1",
"semver": "^7.6.3",
"svelte": "^5.2.9",
"svelte-preprocess": "^6.0.0",
"typescript": "^5.3.3",
Expand Down
12 changes: 12 additions & 0 deletions packages/package/test/fixtures/javascript/expected ^4/Test.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
import { createEventDispatcher } from 'svelte';
/**
* @type {string}
*/
export const astring = 'potato';

const dispatch = createEventDispatcher();
dispatch('event', true);
</script>

<slot {astring} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @typedef {typeof __propDef.props} TestProps */
/** @typedef {typeof __propDef.events} TestEvents */
/** @typedef {typeof __propDef.slots} TestSlots */
export default class Test extends SvelteComponent<
{
astring?: string;
},
{
event: CustomEvent<any>;
} & {
[evt: string]: CustomEvent<any>;
},
{
default: {
astring: string;
};
}
> {
get astring(): string;
}
export type TestProps = typeof __propDef.props;
export type TestEvents = typeof __propDef.events;
export type TestSlots = typeof __propDef.slots;
import { SvelteComponent } from 'svelte';
declare const __propDef: {
props: {
astring?: string;
};
events: {
event: CustomEvent<any>;
} & {
[evt: string]: CustomEvent<any>;
};
slots: {
default: {
astring: string;
};
};
exports?: {};
bindings?: string;
};
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
/**
* @type {import('./foo').Foo}
*/
export let foo;
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @typedef {typeof __propDef.props} Test2Props */
/** @typedef {typeof __propDef.events} Test2Events */
/** @typedef {typeof __propDef.slots} Test2Slots */
export default class Test2 extends SvelteComponent<
{
foo: import('./foo').Foo;
},
{
[evt: string]: CustomEvent<any>;
},
{}
> {}
export type Test2Props = typeof __propDef.props;
export type Test2Events = typeof __propDef.events;
export type Test2Slots = typeof __propDef.slots;
import { SvelteComponent } from 'svelte';
declare const __propDef: {
props: {
foo: import('./foo').Foo;
};
events: {
[evt: string]: CustomEvent<any>;
};
slots: {};
exports?: {};
bindings?: string;
};
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Foo = boolean;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Test } from './Test.svelte';
export { default as Internal } from './internal/Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Test } from './Test.svelte';
export { default as Internal } from './internal/Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
/**
* @type {import('./foo').Foo}
*/
export let foo;
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @typedef {typeof __propDef.props} TestProps */
/** @typedef {typeof __propDef.events} TestEvents */
/** @typedef {typeof __propDef.slots} TestSlots */
export default class Test extends SvelteComponent<
{
foo: import('./foo').Foo;
},
{
[evt: string]: CustomEvent<any>;
},
{}
> {}
export type TestProps = typeof __propDef.props;
export type TestEvents = typeof __propDef.events;
export type TestSlots = typeof __propDef.slots;
import { SvelteComponent } from 'svelte';
declare const __propDef: {
props: {
foo: import('./foo').Foo;
};
events: {
[evt: string]: CustomEvent<any>;
};
slots: {};
exports?: {};
bindings?: string;
};
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Foo = boolean;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const foo: 'bar';
export { x } from "./runes.svelte.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const foo = 'bar';
export { x } from './runes.svelte.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const x: true;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const x = true;
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import { foo } from './sub/foo';
import { util } from './utils';
export let bar = foo;
util();
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { SvelteComponent } from 'svelte';
declare const __propDef: {
props: {
bar?: import('./sub/foo').Foo;
};
events: {
[evt: string]: CustomEvent<any>;
};
slots: {};
exports?: {};
bindings?: string;
};
export type TestProps = typeof __propDef.props;
export type TestEvents = typeof __propDef.events;
export type TestSlots = typeof __propDef.slots;
export default class Test extends SvelteComponent<TestProps, TestEvents, TestSlots> {}
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Baz {
baz: string;
}
export declare const baz: Baz;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const baz = { baz: 'baz' };
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Test } from './Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Test } from './Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare const bar1: import('./foo').Foo;
export declare const bar2: import('../baz').Baz;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { baz } from '../baz';
import { foo } from './foo';
export const bar1 = foo;
export const bar2 = baz;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Foo {
foo: string;
}
export declare const foo: Foo;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const foo = { foo: 'foo' };
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const util: () => void;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const util = () => { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import { createEventDispatcher } from 'svelte';
export const astring = 'potato';
const dispatch = createEventDispatcher();
dispatch('event', true);
</script>

<slot {astring} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { SvelteComponentTyped } from 'svelte';
declare const __propDef: {
props: {
astring?: string;
};
events: {
event: CustomEvent<boolean>;
} & {
[evt: string]: CustomEvent<any>;
};
slots: {
default: {
astring: string;
};
};
};
export type TestProps = typeof __propDef.props;
export type TestEvents = typeof __propDef.events;
export type TestSlots = typeof __propDef.slots;
export default class Test extends SvelteComponentTyped<TestProps, TestEvents, TestSlots> {
get astring(): string;
}
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Test } from './Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Test } from './Test.svelte';
12 changes: 12 additions & 0 deletions packages/package/test/fixtures/svelte-kit/expected ^4/Test.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
import { createEventDispatcher } from 'svelte';
/**
* @type {string}
*/
export const astring = 'potato';

const dispatch = createEventDispatcher();
dispatch('event', true);
</script>

<slot {astring} />
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @typedef {typeof __propDef.props} TestProps */
/** @typedef {typeof __propDef.events} TestEvents */
/** @typedef {typeof __propDef.slots} TestSlots */
export default class Test extends SvelteComponent<
{
astring?: string;
},
{
event: CustomEvent<any>;
} & {
[evt: string]: CustomEvent<any>;
},
{
default: {
astring: string;
};
}
> {
get astring(): string;
}
export type TestProps = typeof __propDef.props;
export type TestEvents = typeof __propDef.events;
export type TestSlots = typeof __propDef.slots;
import { SvelteComponent } from 'svelte';
declare const __propDef: {
props: {
astring?: string;
};
events: {
event: CustomEvent<any>;
} & {
[evt: string]: CustomEvent<any>;
};
slots: {
default: {
astring: string;
};
};
exports?: {};
bindings?: string;
};
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Foo = boolean;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Test } from './Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Test } from './Test.svelte';
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script>
/** @type {import('./foo').Foo} */
export let foo;
</script>

<svelte:head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Corporation",
"name": "Svelte Corp",
"description": "Svelte will cybernetically enhance you",
"naics": "523910",
"url": "https://svelte.dev"
}
</script>
</svelte:head>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @typedef {typeof __propDef.props} PlainProps */
/** @typedef {typeof __propDef.events} PlainEvents */
/** @typedef {typeof __propDef.slots} PlainSlots */
export default class Plain extends SvelteComponent<
{
foo: import('./foo').Foo;
},
{
[evt: string]: CustomEvent<any>;
},
{}
> {}
export type PlainProps = typeof __propDef.props;
export type PlainEvents = typeof __propDef.events;
export type PlainSlots = typeof __propDef.slots;
import { SvelteComponent } from 'svelte';
declare const __propDef: {
props: {
foo: import('./foo').Foo;
};
events: {
[evt: string]: CustomEvent<any>;
};
slots: {};
exports?: {};
bindings?: string;
};
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import { createEventDispatcher } from 'svelte';
export const astring = 'potato';
const dispatch = createEventDispatcher();
dispatch('event', true);
</script>

<slot {astring} />
Loading
Loading