-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26188 from storybookjs/jeppe/svelte-5-prerelease
Svelte: Support `5.0.0-next.65` prerelease
- Loading branch information
Showing
19 changed files
with
280 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
declare module '@storybook/svelte/templates/SlotDecorator.svelte'; | ||
declare module '@storybook/svelte/templates/PreviewRender.svelte'; | ||
declare module '@storybook/svelte/templates/HOC.svelte'; | ||
declare module '@storybook/svelte/internal/SlotDecorator.svelte'; | ||
declare module '@storybook/svelte/internal/PreviewRender.svelte'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { copy } from 'fs-extra'; | ||
import { join } from 'path'; | ||
|
||
const src = join(__dirname, '..', 'src'); | ||
const dist = join(__dirname, '..', 'dist'); | ||
|
||
// relative to src directory | ||
const PATHS_TO_COPY = ['createSvelte5Props.svelte.js', 'components']; | ||
|
||
const run = async () => { | ||
console.log('Copying unbundled files to dist...'); | ||
await Promise.all( | ||
PATHS_TO_COPY.map((pathToCopy) => | ||
copy(join(src, pathToCopy), join(dist, pathToCopy), { overwrite: true }) | ||
) | ||
); | ||
console.log('Done!'); | ||
}; | ||
|
||
run().catch((e) => { | ||
console.error(e); | ||
process.exitCode = 1; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* Turns an object into reactive props in Svelte 5. | ||
* Needs to be in a separate .svelte.js file to ensure Svelte | ||
* compiles it. | ||
* As proposed in https://github.com/sveltejs/svelte/issues/9827#issuecomment-1845589616 | ||
* @template TProps | ||
* @param {TProps} data - The data to create Svelte 5 props from. | ||
* @returns {TProps} - The created Svelte 5 props. | ||
*/ | ||
export const createSvelte5Props = (data) => { | ||
const props = $state(data); | ||
return props; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.