From 34c13259c6fb5212f76fd28ebcb68854178cbb13 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Wed, 13 Dec 2023 21:37:06 +0100 Subject: [PATCH] Merge pull request #25132 from paoloricciuti/fix-sveltekit-other-app-modules SvelteKit: Fix missing `$app` modules (cherry picked from commit a9824bc35a4e58c77f8e837a56b0f62b59d964a0) --- .../sveltekit/src/plugins/mock-sveltekit-stores.ts | 4 +++- .../stories_svelte-kit-skeleton-js/Environment.svelte | 8 ++++++++ .../stories_svelte-kit-skeleton-js/Paths.svelte | 6 ++++++ .../environment.stories.js | 10 ++++++++++ .../stories_svelte-kit-skeleton-js/paths.stories.js | 10 ++++++++++ .../stories_svelte-kit-skeleton-ts/Environment.svelte | 8 ++++++++ .../stories_svelte-kit-skeleton-ts/Paths.svelte | 6 ++++++ .../environment.stories.js | 10 ++++++++++ .../stories_svelte-kit-skeleton-ts/paths.stories.js | 10 ++++++++++ 9 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Environment.svelte create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Paths.svelte create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Environment.svelte create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Paths.svelte create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js create mode 100644 code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js diff --git a/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts b/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts index b5e63f8591e2..f338760c3908 100644 --- a/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts +++ b/code/frameworks/sveltekit/src/plugins/mock-sveltekit-stores.ts @@ -7,7 +7,9 @@ export function mockSveltekitStores() { config: () => ({ resolve: { alias: { - $app: resolve(__dirname, '../src/mocks/app/'), + '$app/forms': resolve(__dirname, '../src/mocks/app/forms.ts'), + '$app/navigation': resolve(__dirname, '../src/mocks/app/navigation.ts'), + '$app/stores': resolve(__dirname, '../src/mocks/app/stores.ts'), }, }, }), diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Environment.svelte b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Environment.svelte new file mode 100644 index 000000000000..aef1c05011f8 --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Environment.svelte @@ -0,0 +1,8 @@ + + +
{browser}
+
{dev}
+
{building}
+
{version}
diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Paths.svelte b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Paths.svelte new file mode 100644 index 000000000000..f4c1e81b53fe --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/Paths.svelte @@ -0,0 +1,6 @@ + + +
{assets}
+
{base}
diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js new file mode 100644 index 000000000000..a8baaabbf5be --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js @@ -0,0 +1,10 @@ +import { expect, fn, within } from '@storybook/test'; +import Environment from './Environment.svelte'; + +export default { + title: 'stories/sveltekit/modules/environment', + component: Environment, + tags: ['autodocs'], +}; + +export const Default = {}; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js new file mode 100644 index 000000000000..5d87296483a5 --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js @@ -0,0 +1,10 @@ +import { expect, fn, within } from '@storybook/test'; +import Paths from './Paths.svelte'; + +export default { + title: 'stories/sveltekit/modules/paths', + component: Paths, + tags: ['autodocs'], +}; + +export const Default = {}; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Environment.svelte b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Environment.svelte new file mode 100644 index 000000000000..aef1c05011f8 --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Environment.svelte @@ -0,0 +1,8 @@ + + +
{browser}
+
{dev}
+
{building}
+
{version}
diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Paths.svelte b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Paths.svelte new file mode 100644 index 000000000000..f4c1e81b53fe --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/Paths.svelte @@ -0,0 +1,6 @@ + + +
{assets}
+
{base}
diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js new file mode 100644 index 000000000000..a8baaabbf5be --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js @@ -0,0 +1,10 @@ +import { expect, fn, within } from '@storybook/test'; +import Environment from './Environment.svelte'; + +export default { + title: 'stories/sveltekit/modules/environment', + component: Environment, + tags: ['autodocs'], +}; + +export const Default = {}; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js new file mode 100644 index 000000000000..5d87296483a5 --- /dev/null +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js @@ -0,0 +1,10 @@ +import { expect, fn, within } from '@storybook/test'; +import Paths from './Paths.svelte'; + +export default { + title: 'stories/sveltekit/modules/paths', + component: Paths, + tags: ['autodocs'], +}; + +export const Default = {};