diff --git a/apps/frontpage/redirects/docs-common-redirects.ts b/apps/frontpage/redirects/docs-common-redirects.ts new file mode 100644 index 00000000..e7a50a90 --- /dev/null +++ b/apps/frontpage/redirects/docs-common-redirects.ts @@ -0,0 +1,298 @@ +import { RedirectData } from './types'; + +export const docsCommonRedirects: RedirectData[] = [ + { + source: '/versions.json', + destination: '/versions', + permanent: true, + }, + { + source: '/docs/get-started', + destination: '/docs', + permanent: true, + }, + { + source: '/addons/addon-gallery', + destination: '/addons', + permanent: true, + }, + { + source: '/integrations', + destination: '/addons', + permanent: true, + }, + { + source: '/integrations/tag/:path', + destination: '/addons/tag/:path', + permanent: true, + }, + { + source: '/recipes', + destination: '/addons', + permanent: true, + }, + { + source: '/telemetry', + destination: '/docs/configure/telemetry', + permanent: true, + }, + { + source: '/status', + destination: 'https://github.com/storybookjs/storybook/issues/23279', + permanent: false, + }, + { + source: '/design-system', + destination: 'https://master--5ccbc373887ca40020446347.chromatic.com', + permanent: true, + }, + { + source: '/migration-guides/7.0', + destination: '/docs/7/migration-guide', + permanent: true, + }, + // TODO: Make sure this one works after 9.0 + { + source: '/migration-guides/8.0', + destination: '/docs/migration-guide', + permanent: true, + }, + /* Supporting old docs URLs */ + { + source: '/basics/slow-start-guide', + destination: '/docs/configure', + permanent: true, + }, + { + source: '/docs/basics/slow-start-guide', + destination: '/docs/configure', + permanent: true, + }, + { + source: '/docs/guides/slow-start-guide', + destination: '/docs/configure', + permanent: true, + }, + { + source: '/basics/guide-react-native', + destination: + 'https://github.com/storybookjs/react-native#storybook-for-react-native', + permanent: true, + }, + { + source: '/docs/basics/guide-react-native', + destination: + 'https://github.com/storybookjs/react-native#storybook-for-react-native', + permanent: true, + }, + { + source: '/docs/guides/guide-react-native', + destination: + 'https://github.com/storybookjs/react-native#storybook-for-react-native', + permanent: true, + }, + { + source: '/docs/basics/writing-stories', + destination: '/docs/get-started/whats-a-story', + permanent: true, + }, + { + source: '/docs/basics/exporting-storybook', + destination: '/docs/sharing/publish-storybook', + permanent: true, + }, + { + source: '/docs/basics/faq', + destination: '/docs/faq', + permanent: true, + }, + { + source: '/docs/basics/live-examples', + destination: 'https://github.com/storybookjs/sandboxes', + permanent: true, + }, + { + source: '/docs/configurations/options-parameter', + destination: '/docs/configure/features-and-behavior', + permanent: true, + }, + { + source: '/docs/configurations/custom-webpack-config', + destination: '/docs/builders/webpack', + permanent: true, + }, + { + source: '/docs/configurations/custom-babel-config', + destination: '/docs/configure/compilers', + permanent: true, + }, + { + source: '/docs/configurations/typescript-config', + destination: '/docs/configure/typescript', + permanent: true, + }, + { + source: '/docs/configurations/add-custom-head-tags', + destination: '/docs/configure/story-rendering#adding-to-head', + permanent: true, + }, + { + source: '/docs/configurations/add-custom-body', + destination: '/docs/configure/story-rendering#adding-to-body', + permanent: true, + }, + { + source: '/docs/configurations/serving-static-files', + destination: + '/docs/configure/images-and-assets#serving-static-files-via-storybook', + permanent: true, + }, + { + source: '/docs/configurations/env-vars', + destination: '/docs/configure/environment-variables', + permanent: true, + }, + { + source: '/docs/configurations/theming', + destination: '/docs/configure/theming', + permanent: true, + }, + { + source: '/docs/configurations/cli-options', + destination: '/docs/api/cli-options', + permanent: true, + }, + { + source: '/docs/configurations/standalone-options', + destination: + 'https://github.com/storybookjs/storybook/blob/next/lib/core/docs/standalone.md', + permanent: true, + }, + { + source: '/docs/formats/component-story-format', + destination: '/docs/api/csf', + permanent: true, + }, + { + source: '/docs/formats/storiesof-api', + destination: + 'https://github.com/storybookjs/storybook/blob/next/lib/core/docs/storiesOf.md', + permanent: true, + }, + { + source: '/docs/formats/mdx-syntax', + destination: '/docs/writing-docs/mdx', + permanent: true, + }, + { + source: '/docs/testing/react-ui-testing', + destination: '/docs/writing-tests', + permanent: true, + }, + { + source: '/docs/testing/structural-testing', + destination: '/docs/writing-tests/snapshot-testing', + permanent: true, + }, + { + source: '/docs/testing/interaction-testing', + destination: '/docs/writing-tests/interaction-testing', + permanent: true, + }, + { + source: '/docs/testing/automated-visual-testing', + destination: '/docs/writing-tests/visual-testing', + permanent: true, + }, + { + source: '/docs/testing/manual-testing', + destination: '/docs/writing-tests', + permanent: true, + }, + { + source: '/docs/addons/using-addons', + destination: '/docs/addons/install-addons', + permanent: true, + }, + { + source: '/addons/writing-addons', + destination: '/docs/addons/writing-addons', + permanent: true, + }, + { + source: '/docs/addons/api', + destination: '/docs/addons/addons-api', + permanent: true, + }, + { + source: '/docs/presets/introduction', + destination: '/docs/addons/writing-presets', + permanent: true, + }, + { + source: '/docs/presets/preset-gallery', + destination: 'https://github.com/storybookjs/presets', + permanent: true, + }, + { + source: '/docs/presets/writing-presets', + destination: '/docs/addons/writing-presets', + permanent: true, + }, + /* 🐺 Wild Cards */ + { + source: '/basics/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/docs/basics/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/configurations/:path*', + destination: '/docs/configure', + permanent: true, + }, + { + source: '/docs/configurations/:path*', + destination: '/docs/configure', + permanent: true, + }, + { + source: '/examples/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/docs/examples/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/logos/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/docs/logos/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/testing/:path*', + destination: '/docs', + permanent: true, + }, + { + source: '/docs/testing/:path*', + destination: '/docs/writing-tests', + permanent: true, + }, + { + source: '/docs/guides/:path*', + destination: '/docs', + permanent: true, + }, +]; diff --git a/apps/frontpage/redirects/redirects_docs_$r.ts b/apps/frontpage/redirects/docs-renderers-redirects.ts similarity index 64% rename from apps/frontpage/redirects/redirects_docs_$r.ts rename to apps/frontpage/redirects/docs-renderers-redirects.ts index 531b58d7..575eb7b3 100644 --- a/apps/frontpage/redirects/redirects_docs_$r.ts +++ b/apps/frontpage/redirects/docs-renderers-redirects.ts @@ -1,9 +1,10 @@ import { renderers } from './constants'; +import { RedirectData } from './types'; -export default [ +export const docsRenderersRedirects: RedirectData[] = [ ...renderers.map((r) => ({ source: `/docs/${r}/get-started/examples`, destination: '/showcase', permanent: true, })), -] as RedirectData[]; +]; diff --git a/apps/frontpage/redirects/redirects_docs_workflows.ts b/apps/frontpage/redirects/docs-version-6-redirects.ts similarity index 58% rename from apps/frontpage/redirects/redirects_docs_workflows.ts rename to apps/frontpage/redirects/docs-version-6-redirects.ts index a0f9ff4b..55efe617 100644 --- a/apps/frontpage/redirects/redirects_docs_workflows.ts +++ b/apps/frontpage/redirects/docs-version-6-redirects.ts @@ -1,4 +1,12 @@ -export default [ +import { RedirectData } from './types'; + +export const docsVersion6Redirects: RedirectData[] = [ + { + source: '/docs/6/get-started', + destination: '/docs/6', + permanent: true, + }, + // Version 6.4 { source: '/docs/workflows/testing-with-storybook', destination: '/docs/writing-tests', @@ -55,4 +63,41 @@ export default [ destination: '/docs/faq', permanent: true, }, -] as RedirectData[]; + // Version 6.5 + { + source: '/docs/configure/webpack', + destination: '/docs/builders/webpack', + permanent: true, + }, + { source: '/docs/api/addons', destination: '/docs/addons', permanent: true }, + { + source: '/docs/api/addons-api', + destination: '/docs/addons/addons-api', + permanent: true, + }, + { + source: '/docs/api/presets', + destination: '/docs/addons/writing-presets', + permanent: true, + }, + { + source: '/docs/addons/addon-catalog', + destination: '/docs/addons/integration-catalog', + permanent: true, + }, + { + source: '/docs/api/mdx', + destination: '/docs/writing-docs/mdx', + permanent: true, + }, + { + source: '/docs/why-storybook', + destination: '/docs/get-started/why-storybook', + permanent: true, + }, + { + source: '/docs/get-started/introduction', + destination: '/docs/get-started/install', + permanent: true, + }, +]; diff --git a/apps/frontpage/redirects/docs-version-7-redirects.ts b/apps/frontpage/redirects/docs-version-7-redirects.ts new file mode 100644 index 00000000..439cdbb6 --- /dev/null +++ b/apps/frontpage/redirects/docs-version-7-redirects.ts @@ -0,0 +1,119 @@ +import { RedirectData } from './types'; + +export const docsVersion7Redirects: RedirectData[] = [ + { + source: '/docs/7/get-started', + destination: '/docs/7', + permanent: true, + }, + // Version 7.0 + { + source: '/docs/writing-docs/docs-page', + destination: '/docs/writing-docs/autodocs', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-argstable', + destination: '/docs/api/doc-blocks/doc-block-controls', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-canvas', + destination: '/docs/api/doc-blocks/doc-block-canvas', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-colorpalette', + destination: '/docs/api/doc-blocks/doc-block-colorpalette', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-description', + destination: '/docs/api/doc-blocks/doc-block-description', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-icongallery', + destination: '/docs/api/doc-blocks/doc-block-icongallery', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-source', + destination: '/docs/api/doc-blocks/doc-block-source', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-story', + destination: '/docs/api/doc-blocks/doc-block-story', + permanent: true, + }, + { + source: '/docs/writing-docs/doc-block-typeset', + destination: '/docs/api/doc-blocks/doc-block-typeset', + permanent: true, + }, + { + source: '/docs/api/frameworks-feature-support', + destination: '/docs/configure/integration/frameworks-feature-support', + permanent: true, + }, + { + source: '/docs/api/argtypes', + destination: '/docs/api/arg-types', + permanent: true, + }, + + //Version7.1 + { + source: '/docs/writing-tests/importing-stories-in-tests', + destination: '/docs/writing-tests/stories-in-unit-tests', + permanent: true, + }, + + //Version7.6 + { + source: '/docs/writing-stories/introduction', + destination: '/docs/writing-stories', + permanent: true, + }, + { + source: '/docs/writing-docs/introduction', + destination: '/docs/writing-docs', + permanent: true, + }, + { + source: '/docs/writing-tests/introduction', + destination: '/docs/writing-tests', + permanent: true, + }, + { + source: '/docs/essentials/introduction', + destination: '/docs/essentials', + permanent: true, + }, + { + source: '/docs/addons/introduction', + destination: '/docs/addons', + permanent: true, + }, + { + source: '/docs/configure/overview', + destination: '/docs/configure', + permanent: true, + }, + { + source: '/docs/builders/overview', + destination: '/docs/builders', + permanent: true, + }, + { + source: '/docs/contribute/how-to-contribute', + destination: '/docs/contribute', + permanent: true, + }, + { + source: '/docs/configure/babel', + destination: '/docs/configure/integration/compilers', + permanent: true, + }, +]; diff --git a/apps/frontpage/redirects/redirects_docs_api.ts b/apps/frontpage/redirects/docs-version-8-redirects.ts similarity index 57% rename from apps/frontpage/redirects/redirects_docs_api.ts rename to apps/frontpage/redirects/docs-version-8-redirects.ts index f15513e3..cd941100 100644 --- a/apps/frontpage/redirects/redirects_docs_api.ts +++ b/apps/frontpage/redirects/docs-version-8-redirects.ts @@ -1,28 +1,146 @@ -export default [ - { source: '/docs/api/addons', destination: '/docs/addons', permanent: true }, +import { RedirectData } from './types'; + +export const docsVersion8Redirects: RedirectData[] = [ + // Version 8.1 { - source: '/docs/api/addons-api', - destination: '/docs/addons/addons-api', + source: '/docs/get-started/angular', + destination: '/docs/get-started/frameworks/angular', permanent: true, }, { - source: '/docs/api/presets', - destination: '/docs/addons/writing-presets', + source: '/docs/get-started/nextjs', + destination: '/docs/get-started/frameworks/nextjs', permanent: true, }, { - source: '/docs/api/mdx', - destination: '/docs/writing-docs/mdx', + source: '/docs/get-started/react-vite', + destination: '/docs/get-started/frameworks/react-vite', permanent: true, }, { - source: '/docs/api/frameworks-feature-support', + source: '/docs/get-started/react-webpack5', + destination: '/docs/get-started/frameworks/react-webpack5', + permanent: true, + }, + { + source: '/docs/get-started/sveltekit', + destination: '/docs/get-started/frameworks/sveltekit', + permanent: true, + }, + { + source: '/docs/get-started/svelte-vite', + destination: '/docs/get-started/frameworks/svelte-vite', + permanent: true, + }, + { + source: '/docs/get-started/svelte-webpack5', + destination: '/docs/get-started/frameworks/svelte-webpack5', + permanent: true, + }, + { + source: '/docs/get-started/vue3-vite', + destination: '/docs/get-started/frameworks/vue3-vite', + permanent: true, + }, + { + source: '/docs/get-started/vue3-webpack5', + destination: '/docs/get-started/frameworks/vue3-webpack5', + permanent: true, + }, + { + source: '/docs/get-started/web-components-vite', + destination: '/docs/get-started/frameworks/web-components-vite', + permanent: true, + }, + { + source: '/docs/get-started/web-components-webpack5', + destination: '/docs/get-started/frameworks/web-components-webpack5', + permanent: true, + }, + { + source: '/docs/writing-stories/mocking-modules', + destination: + '/docs/writing-stories/mocking-data-and-modules/mocking-modules', + permanent: true, + }, + { + source: '/docs/writing-stories/mocking-network-requests', + destination: + '/docs/writing-stories/mocking-data-and-modules/mocking-network-requests', + permanent: true, + }, + { + source: '/docs/writing-stories/mocking-providers', + destination: + '/docs/writing-stories/mocking-data-and-modules/mocking-providers', + permanent: true, + }, + { + source: '/docs/writing-tests/snapshot-testing', + destination: '/docs/writing-tests/snapshot-testing/snapshot-testing', + permanent: true, + }, + { + source: '/docs/writing-tests/storyshots-migration-guide', + destination: + '/docs/writing-tests/snapshot-testing/storyshots-migration-guide', + permanent: true, + }, + { + source: '/docs/writing-tests/stories-in-end-to-end-tests', + destination: + '/docs/writing-tests/import-stories-in-tests/stories-in-end-to-end-tests', + permanent: true, + }, + { + source: '/docs/writing-tests/stories-in-unit-tests', + destination: + '/docs/writing-tests/import-stories-in-tests/stories-in-unit-tests', + permanent: true, + }, + { + source: '/docs/configure/frameworks', + destination: '/docs/configure/integration/frameworks', + permanent: true, + }, + { + source: '/docs/configure/frameworks-feature-support', destination: '/docs/configure/integration/frameworks-feature-support', permanent: true, }, { - source: '/docs/api/argtypes', - destination: '/docs/api/arg-types', + source: '/docs/configure/compilers', + destination: '/docs/configure/integration/compilers', + permanent: true, + }, + { + source: '/docs/configure/typescript', + destination: '/docs/configure/integration/typescript', + permanent: true, + }, + { + source: '/docs/configure/images-and-assets', + destination: '/docs/configure/integration/images-and-assets', + permanent: true, + }, + { + source: '/docs/configure/features-and-behavior', + destination: '/docs/configure/user-interface/features-and-behavior', + permanent: true, + }, + { + source: '/docs/configure/theming', + destination: '/docs/configure/user-interface/theming', + permanent: true, + }, + { + source: '/docs/configure/sidebar-and-urls', + destination: '/docs/configure/user-interface/sidebar-and-urls', + permanent: true, + }, + { + source: '/docs/configure/storybook-addons', + destination: '/docs/configure/user-interface/storybook-addons', permanent: true, }, { @@ -230,4 +348,14 @@ export default [ destination: '/docs/api/portable-stories/portable-stories-playwright', permanent: true, }, -] as RedirectData[]; + { + source: '/docs/contribute/documentation-updates', + destination: '/docs/contribute/documentation/documentation-updates', + permanent: true, + }, + { + source: '/docs/contribute/new-snippets', + destination: '/docs/contribute/documentation/new-snippets', + permanent: true, + }, +]; diff --git a/apps/frontpage/redirects/redirects_docs_$v.ts b/apps/frontpage/redirects/docs-versions-redirects.ts similarity index 69% rename from apps/frontpage/redirects/redirects_docs_$v.ts rename to apps/frontpage/redirects/docs-versions-redirects.ts index ad3e90c5..90949100 100644 --- a/apps/frontpage/redirects/redirects_docs_$v.ts +++ b/apps/frontpage/redirects/docs-versions-redirects.ts @@ -5,18 +5,15 @@ import { versions7, versions8, } from './constants'; +import { RedirectData } from './types'; +import { docsVersion6Redirects } from './docs-version-6-redirects'; +import { docsVersion7Redirects } from './docs-version-7-redirects'; +import { docsVersion8Redirects } from './docs-version-8-redirects'; -export default [ - { - source: '/docs/6/get-started', - destination: '/docs/6', - permanent: true, - }, - { - source: '/docs/7/get-started', - destination: '/docs/7', - permanent: true, - }, +export const docsVersionsRedirects: RedirectData[] = [ + ...docsVersion6Redirects, + ...docsVersion7Redirects, + ...docsVersion8Redirects, ...[...versions6, ...versions7].map((v) => ({ source: `/docs/${v}`, destination: `/docs/${v.split('.')[0]}`, @@ -42,4 +39,4 @@ export default [ } return acc; }, []), -] as RedirectData[]; +]; diff --git a/apps/frontpage/redirects/redirects.ts b/apps/frontpage/redirects/redirects.ts index 59e366a4..2b98fcef 100644 --- a/apps/frontpage/redirects/redirects.ts +++ b/apps/frontpage/redirects/redirects.ts @@ -1,79 +1,16 @@ -import redirects_addons from './redirects_addons'; -import redirects_basics from './redirects_basics'; -import redirects_configurations from './redirects_configurations'; -import redirects_designSystem from './redirects_design-system'; -import redirects_docs_$r from './redirects_docs_$r'; -import redirects_docs_$v from './redirects_docs_$v'; -import redirects_docs_addons from './redirects_docs_addons'; -import redirects_docs_api from './redirects_docs_api'; -import redirects_docs_basics from './redirects_basics'; -import redirects_docs_builders from './redirects_docs_builders'; -import redirects_docs_configurations from './redirects_docs_configurations'; -import redirects_docs_configure from './redirects_docs_configure'; -import redirects_docs_contribute from './redirects_docs_contribute'; -import redirects_docs_essentials from './redirects_docs_essentials'; -import redirects_docs_examples from './redirects_docs_examples'; -import redirects_docs_formats from './redirects_docs_formats'; -import redirects_docs_getStarted from './redirects_docs_get-started'; -import redirects_docs_logos from './redirects_docs_logos'; -import redirects_docs_presets from './redirects_docs_presets'; -import redirects_docs_testing from './redirects_docs_testing'; -import redirects_docs_whyStorybook from './redirects_docs_why-storybook'; -import redirects_docs_workflows from './redirects_docs_workflows'; -import redirects_docs_writtingDocs from './redirects_docs_writting-docs'; -import redirects_docs_writtingStories from './redirects_docs_writting-stories'; -import redirects_docs_writtingTests from './redirects_docs_writting-tests'; -import redirects_examples from './redirects_examples'; -import redirects_guides from './redirects_guides'; -import redirects_integrations from './redirects_integrations'; -import redirects_logos from './redirects_logos'; -import redirects_migrationGuides from './redirects_migration-guides'; -import redirects_recipes from './redirects_recipes'; -import redirects_status from './redirects_status'; -import redirects_tags from './redirects_tags'; -import redirects_telemetry from './redirects_telemetry'; -import redirects_testing from './redirects_testing'; -import redirects_versions from './redirects_versions'; +import { docsCommonRedirects } from './docs-common-redirects'; +import { docsRenderersRedirects } from './docs-renderers-redirects'; +import { docsVersionsRedirects } from './docs-versions-redirects'; +import { redirectsTags } from './redirects_tags'; +import { RedirectData } from './types'; // Merge all redirects into a single list // The order of the list is important // The first matching redirect will be used export const listOfRedirects: RedirectData[] = [ - ...redirects_addons, - ...redirects_basics, - ...redirects_configurations, - ...redirects_designSystem, - ...redirects_docs_$r, - ...redirects_docs_$v, - ...redirects_docs_addons, - ...redirects_docs_api, - ...redirects_docs_basics, - ...redirects_docs_builders, - ...redirects_docs_configurations, - ...redirects_docs_configure, - ...redirects_docs_contribute, - ...redirects_docs_essentials, - ...redirects_docs_examples, - ...redirects_docs_formats, - ...redirects_docs_getStarted, - ...redirects_docs_logos, - ...redirects_docs_presets, - ...redirects_docs_testing, - ...redirects_docs_whyStorybook, - ...redirects_docs_workflows, - ...redirects_docs_writtingDocs, - ...redirects_docs_writtingStories, - ...redirects_docs_writtingTests, - ...redirects_examples, - ...redirects_guides, - ...redirects_integrations, - ...redirects_logos, - ...redirects_migrationGuides, - ...redirects_recipes, - ...redirects_status, - ...redirects_tags, - ...redirects_telemetry, - ...redirects_testing, - ...redirects_versions, + ...docsVersionsRedirects, + ...docsRenderersRedirects, + ...docsCommonRedirects, + ...redirectsTags, ]; diff --git a/apps/frontpage/redirects/redirects_addons.ts b/apps/frontpage/redirects/redirects_addons.ts deleted file mode 100644 index 5ae7e833..00000000 --- a/apps/frontpage/redirects/redirects_addons.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default [ - { - source: '/addons/addon-gallery', - destination: '/addons', - permanent: true, - }, - { - source: '/addons/writing-addons', - destination: '/docs/addons/writing-addons', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_basics.ts b/apps/frontpage/redirects/redirects_basics.ts deleted file mode 100644 index 14edc623..00000000 --- a/apps/frontpage/redirects/redirects_basics.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default [ - { - source: '/basics/slow-start-guide', - destination: '/docs/configure', - permanent: true, - }, - { - source: '/basics/guide-react-native', - destination: - 'https://github.com/storybookjs/react-native#storybook-for-react-native', - permanent: true, - }, - { - source: '/basics/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_configurations.ts b/apps/frontpage/redirects/redirects_configurations.ts deleted file mode 100644 index 162fdf71..00000000 --- a/apps/frontpage/redirects/redirects_configurations.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/configurations/:path*', - destination: '/docs/configure', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_design-system.ts b/apps/frontpage/redirects/redirects_design-system.ts deleted file mode 100644 index 4bb8c572..00000000 --- a/apps/frontpage/redirects/redirects_design-system.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/design-system', - destination: 'https://master--5ccbc373887ca40020446347.chromatic.com', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_addons.ts b/apps/frontpage/redirects/redirects_docs_addons.ts deleted file mode 100644 index d945afb8..00000000 --- a/apps/frontpage/redirects/redirects_docs_addons.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default [ - { - source: '/docs/addons/using-addons', - destination: '/docs/addons/install-addons', - permanent: true, - }, - { - source: '/docs/addons/api', - destination: '/docs/addons/addons-api', - permanent: true, - }, - { - source: '/docs/addons/addon-catalog', - destination: '/docs/addons/integration-catalog', - permanent: true, - }, - { - source: '/docs/addons/introduction', - destination: '/docs/addons', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_basics.ts b/apps/frontpage/redirects/redirects_docs_basics.ts deleted file mode 100644 index 62c8c4fc..00000000 --- a/apps/frontpage/redirects/redirects_docs_basics.ts +++ /dev/null @@ -1,38 +0,0 @@ -export default [ - { - source: '/docs/basics/slow-start-guide', - destination: '/docs/configure', - permanent: true, - }, - { - source: '/docs/basics/guide-react-native', - destination: - 'https://github.com/storybookjs/react-native#storybook-for-react-native', - permanent: true, - }, - { - source: '/docs/basics/writing-stories', - destination: '/docs/get-started/whats-a-story', - permanent: true, - }, - { - source: '/docs/basics/exporting-storybook', - destination: '/docs/sharing/publish-storybook', - permanent: true, - }, - { - source: '/docs/basics/faq', - destination: '/docs/faq', - permanent: true, - }, - { - source: '/docs/basics/live-examples', - destination: 'https://github.com/storybookjs/sandboxes', - permanent: true, - }, - { - source: '/docs/basics/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_builders.ts b/apps/frontpage/redirects/redirects_docs_builders.ts deleted file mode 100644 index 21eb2b9f..00000000 --- a/apps/frontpage/redirects/redirects_docs_builders.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/docs/builders/overview', - destination: '/docs/builders', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_configurations.ts b/apps/frontpage/redirects/redirects_docs_configurations.ts deleted file mode 100644 index e5076e9f..00000000 --- a/apps/frontpage/redirects/redirects_docs_configurations.ts +++ /dev/null @@ -1,64 +0,0 @@ -export default [ - { - source: '/docs/configurations/options-parameter', - destination: '/docs/configure/features-and-behavior', - permanent: true, - }, - { - source: '/docs/configurations/custom-webpack-config', - destination: '/docs/builders/webpack', - permanent: true, - }, - { - source: '/docs/configurations/custom-babel-config', - destination: '/docs/configure/compilers', - permanent: true, - }, - { - source: '/docs/configurations/typescript-config', - destination: '/docs/configure/typescript', - permanent: true, - }, - { - source: '/docs/configurations/add-custom-head-tags', - destination: '/docs/configure/story-rendering#adding-to-head', - permanent: true, - }, - { - source: '/docs/configurations/add-custom-body', - destination: '/docs/configure/story-rendering#adding-to-body', - permanent: true, - }, - { - source: '/docs/configurations/serving-static-files', - destination: - '/docs/configure/images-and-assets#serving-static-files-via-storybook', - permanent: true, - }, - { - source: '/docs/configurations/env-vars', - destination: '/docs/configure/environment-variables', - permanent: true, - }, - { - source: '/docs/configurations/theming', - destination: '/docs/configure/theming', - permanent: true, - }, - { - source: '/docs/configurations/cli-options', - destination: '/docs/api/cli-options', - permanent: true, - }, - { - source: '/docs/configurations/standalone-options', - destination: - 'https://github.com/storybookjs/storybook/blob/next/lib/core/docs/standalone.md', - permanent: true, - }, - { - source: '/docs/configurations/:path*', - destination: '/docs/configure', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_configure.ts b/apps/frontpage/redirects/redirects_docs_configure.ts deleted file mode 100644 index 8ef1ec24..00000000 --- a/apps/frontpage/redirects/redirects_docs_configure.ts +++ /dev/null @@ -1,62 +0,0 @@ -export default [ - { - source: '/docs/configure/webpack', - destination: '/docs/builders/webpack', - permanent: true, - }, - { - source: '/docs/configure/overview', - destination: '/docs/configure', - permanent: true, - }, - { - source: '/docs/configure/babel', - destination: '/docs/configure/integration/compilers', - permanent: true, - }, - { - source: '/docs/configure/frameworks', - destination: '/docs/configure/integration/frameworks', - permanent: true, - }, - { - source: '/docs/configure/frameworks-feature-support', - destination: '/docs/configure/integration/frameworks-feature-support', - permanent: true, - }, - { - source: '/docs/configure/compilers', - destination: '/docs/configure/integration/compilers', - permanent: true, - }, - { - source: '/docs/configure/typescript', - destination: '/docs/configure/integration/typescript', - permanent: true, - }, - { - source: '/docs/configure/images-and-assets', - destination: '/docs/configure/integration/images-and-assets', - permanent: true, - }, - { - source: '/docs/configure/features-and-behavior', - destination: '/docs/configure/user-interface/features-and-behavior', - permanent: true, - }, - { - source: '/docs/configure/theming', - destination: '/docs/configure/user-interface/theming', - permanent: true, - }, - { - source: '/docs/configure/sidebar-and-urls', - destination: '/docs/configure/user-interface/sidebar-and-urls', - permanent: true, - }, - { - source: '/docs/configure/storybook-addons', - destination: '/docs/configure/user-interface/storybook-addons', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_contribute.ts b/apps/frontpage/redirects/redirects_docs_contribute.ts deleted file mode 100644 index ec41da0d..00000000 --- a/apps/frontpage/redirects/redirects_docs_contribute.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default [ - { - source: '/docs/contribute/how-to-contribute', - destination: '/docs/contribute', - permanent: true, - }, - { - source: '/docs/contribute/documentation-updates', - destination: '/docs/contribute/documentation/documentation-updates', - permanent: true, - }, - { - source: '/docs/contribute/new-snippets', - destination: '/docs/contribute/documentation/new-snippets', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_essentials.ts b/apps/frontpage/redirects/redirects_docs_essentials.ts deleted file mode 100644 index b4daed22..00000000 --- a/apps/frontpage/redirects/redirects_docs_essentials.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/docs/essentials/introduction', - destination: '/docs/essentials', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_examples.ts b/apps/frontpage/redirects/redirects_docs_examples.ts deleted file mode 100644 index 01a12a7d..00000000 --- a/apps/frontpage/redirects/redirects_docs_examples.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/docs/examples/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_formats.ts b/apps/frontpage/redirects/redirects_docs_formats.ts deleted file mode 100644 index dfa2110c..00000000 --- a/apps/frontpage/redirects/redirects_docs_formats.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default [ - { - source: '/docs/formats/component-story-format', - destination: '/docs/api/csf', - permanent: true, - }, - { - source: '/docs/formats/storiesof-api', - destination: - 'https://github.com/storybookjs/storybook/blob/next/lib/core/docs/storiesOf.md', - permanent: true, - }, - { - source: '/docs/formats/mdx-syntax', - destination: '/docs/writing-docs/mdx', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_get-started.ts b/apps/frontpage/redirects/redirects_docs_get-started.ts deleted file mode 100644 index c00fd5ad..00000000 --- a/apps/frontpage/redirects/redirects_docs_get-started.ts +++ /dev/null @@ -1,67 +0,0 @@ -export default [ - { - source: '/docs/get-started', - destination: '/docs', - permanent: true, - }, - { - source: '/docs/get-started/introduction', - destination: '/docs/get-started/install', - permanent: true, - }, - { - source: '/docs/get-started/angular', - destination: '/docs/get-started/frameworks/angular', - permanent: true, - }, - { - source: '/docs/get-started/nextjs', - destination: '/docs/get-started/frameworks/nextjs', - permanent: true, - }, - { - source: '/docs/get-started/react-vite', - destination: '/docs/get-started/frameworks/react-vite', - permanent: true, - }, - { - source: '/docs/get-started/react-webpack5', - destination: '/docs/get-started/frameworks/react-webpack5', - permanent: true, - }, - { - source: '/docs/get-started/sveltekit', - destination: '/docs/get-started/frameworks/sveltekit', - permanent: true, - }, - { - source: '/docs/get-started/svelte-vite', - destination: '/docs/get-started/frameworks/svelte-vite', - permanent: true, - }, - { - source: '/docs/get-started/svelte-webpack5', - destination: '/docs/get-started/frameworks/svelte-webpack5', - permanent: true, - }, - { - source: '/docs/get-started/vue3-vite', - destination: '/docs/get-started/frameworks/vue3-vite', - permanent: true, - }, - { - source: '/docs/get-started/vue3-webpack5', - destination: '/docs/get-started/frameworks/vue3-webpack5', - permanent: true, - }, - { - source: '/docs/get-started/web-components-vite', - destination: '/docs/get-started/frameworks/web-components-vite', - permanent: true, - }, - { - source: '/docs/get-started/web-components-webpack5', - destination: '/docs/get-started/frameworks/web-components-webpack5', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_logos.ts b/apps/frontpage/redirects/redirects_docs_logos.ts deleted file mode 100644 index 927dcb89..00000000 --- a/apps/frontpage/redirects/redirects_docs_logos.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/docs/logos/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_presets.ts b/apps/frontpage/redirects/redirects_docs_presets.ts deleted file mode 100644 index 7edf27df..00000000 --- a/apps/frontpage/redirects/redirects_docs_presets.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default [ - { - source: '/docs/presets/introduction', - destination: '/docs/addons/writing-presets', - permanent: true, - }, - { - source: '/docs/presets/preset-gallery', - destination: 'https://github.com/storybookjs/presets', - permanent: true, - }, - { - source: '/docs/presets/writing-presets', - destination: '/docs/addons/writing-presets', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_testing.ts b/apps/frontpage/redirects/redirects_docs_testing.ts deleted file mode 100644 index e7f53426..00000000 --- a/apps/frontpage/redirects/redirects_docs_testing.ts +++ /dev/null @@ -1,32 +0,0 @@ -export default [ - { - source: '/docs/testing/react-ui-testing', - destination: '/docs/writing-tests', - permanent: true, - }, - { - source: '/docs/testing/structural-testing', - destination: '/docs/writing-tests/snapshot-testing', - permanent: true, - }, - { - source: '/docs/testing/interaction-testing', - destination: '/docs/writing-tests/interaction-testing', - permanent: true, - }, - { - source: '/docs/testing/automated-visual-testing', - destination: '/docs/writing-tests/visual-testing', - permanent: true, - }, - { - source: '/docs/testing/manual-testing', - destination: '/docs/writing-tests', - permanent: true, - }, - { - source: '/docs/testing/:path*', - destination: '/docs/writing-tests', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_why-storybook.ts b/apps/frontpage/redirects/redirects_docs_why-storybook.ts deleted file mode 100644 index ce8bc4c2..00000000 --- a/apps/frontpage/redirects/redirects_docs_why-storybook.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/docs/why-storybook', - destination: '/docs/get-started/why-storybook', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_writting-docs.ts b/apps/frontpage/redirects/redirects_docs_writting-docs.ts deleted file mode 100644 index 16eac12b..00000000 --- a/apps/frontpage/redirects/redirects_docs_writting-docs.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default [ - { - source: '/docs/writing-docs/docs-page', - destination: '/docs/writing-docs/autodocs', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-argstable', - destination: '/docs/api/doc-blocks/doc-block-controls', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-canvas', - destination: '/docs/api/doc-blocks/doc-block-canvas', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-colorpalette', - destination: '/docs/api/doc-blocks/doc-block-colorpalette', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-description', - destination: '/docs/api/doc-blocks/doc-block-description', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-icongallery', - destination: '/docs/api/doc-blocks/doc-block-icongallery', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-source', - destination: '/docs/api/doc-blocks/doc-block-source', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-story', - destination: '/docs/api/doc-blocks/doc-block-story', - permanent: true, - }, - { - source: '/docs/writing-docs/doc-block-typeset', - destination: '/docs/api/doc-blocks/doc-block-typeset', - permanent: true, - }, - { - source: '/docs/writing-docs/introduction', - destination: '/docs/writing-docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_writting-stories.ts b/apps/frontpage/redirects/redirects_docs_writting-stories.ts deleted file mode 100644 index 75ba8ba1..00000000 --- a/apps/frontpage/redirects/redirects_docs_writting-stories.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default [ - { - source: '/docs/writing-stories/introduction', - destination: '/docs/writing-stories', - permanent: true, - }, - { - source: '/docs/writing-stories/mocking-modules', - destination: - '/docs/writing-stories/mocking-data-and-modules/mocking-modules', - permanent: true, - }, - { - source: '/docs/writing-stories/mocking-network-requests', - destination: - '/docs/writing-stories/mocking-data-and-modules/mocking-network-requests', - permanent: true, - }, - { - source: '/docs/writing-stories/mocking-providers', - destination: - '/docs/writing-stories/mocking-data-and-modules/mocking-providers', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_docs_writting-tests.ts b/apps/frontpage/redirects/redirects_docs_writting-tests.ts deleted file mode 100644 index eadcc40a..00000000 --- a/apps/frontpage/redirects/redirects_docs_writting-tests.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default [ - { - source: '/docs/writing-tests/importing-stories-in-tests', - destination: '/docs/writing-tests/stories-in-unit-tests', - permanent: true, - }, - { - source: '/docs/writing-tests/introduction', - destination: '/docs/writing-tests', - permanent: true, - }, - { - source: '/docs/writing-tests/snapshot-testing', - destination: '/docs/writing-tests/snapshot-testing/snapshot-testing', - permanent: true, - }, - { - source: '/docs/writing-tests/storyshots-migration-guide', - destination: - '/docs/writing-tests/snapshot-testing/storyshots-migration-guide', - permanent: true, - }, - { - source: '/docs/writing-tests/stories-in-end-to-end-tests', - destination: - '/docs/writing-tests/import-stories-in-tests/stories-in-end-to-end-tests', - permanent: true, - }, - { - source: '/docs/writing-tests/stories-in-unit-tests', - destination: - '/docs/writing-tests/import-stories-in-tests/stories-in-unit-tests', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_examples.ts b/apps/frontpage/redirects/redirects_examples.ts deleted file mode 100644 index 9398dded..00000000 --- a/apps/frontpage/redirects/redirects_examples.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/examples/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_guides.ts b/apps/frontpage/redirects/redirects_guides.ts deleted file mode 100644 index 34ecf78a..00000000 --- a/apps/frontpage/redirects/redirects_guides.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default [ - { - source: '/docs/guides/slow-start-guide', - destination: '/docs/configure', - permanent: true, - }, - { - source: '/docs/guides/guide-react-native', - destination: - 'https://github.com/storybookjs/react-native#storybook-for-react-native', - permanent: true, - }, - { - source: '/docs/guides/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_integrations.ts b/apps/frontpage/redirects/redirects_integrations.ts deleted file mode 100644 index 4363a629..00000000 --- a/apps/frontpage/redirects/redirects_integrations.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default [ - { - source: '/integrations', - destination: '/addons', - permanent: true, - }, - { - source: '/integrations/tag/:path', - destination: '/addons/tag/:path', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_logos.ts b/apps/frontpage/redirects/redirects_logos.ts deleted file mode 100644 index 86870023..00000000 --- a/apps/frontpage/redirects/redirects_logos.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/logos/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_migration-guides.ts b/apps/frontpage/redirects/redirects_migration-guides.ts deleted file mode 100644 index 734a67c6..00000000 --- a/apps/frontpage/redirects/redirects_migration-guides.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default [ - { - source: '/migration-guides/7.0', - destination: '/docs/7/migration-guide', - permanent: true, - }, - // TODO: Make sure this one works after 9.0 - { - source: '/migration-guides/8.0', - destination: '/docs/migration-guide', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_recipes.ts b/apps/frontpage/redirects/redirects_recipes.ts deleted file mode 100644 index 5b15ad8b..00000000 --- a/apps/frontpage/redirects/redirects_recipes.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/recipes', - destination: '/addons', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_status.ts b/apps/frontpage/redirects/redirects_status.ts deleted file mode 100644 index bee2f051..00000000 --- a/apps/frontpage/redirects/redirects_status.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/status', - destination: 'https://github.com/storybookjs/storybook/issues/23279', - permanent: false, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_tags.ts b/apps/frontpage/redirects/redirects_tags.ts index c3c81dad..786fc35c 100644 --- a/apps/frontpage/redirects/redirects_tags.ts +++ b/apps/frontpage/redirects/redirects_tags.ts @@ -1,7 +1,9 @@ -export default [ +import { RedirectData } from './types'; + +export const redirectsTags: RedirectData[] = [ { source: '/tag/:path', destination: '/addons/tag/:path', permanent: true, }, -] as RedirectData[]; +]; diff --git a/apps/frontpage/redirects/redirects_telemetry.ts b/apps/frontpage/redirects/redirects_telemetry.ts deleted file mode 100644 index b1d4e878..00000000 --- a/apps/frontpage/redirects/redirects_telemetry.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/telemetry', - destination: '/docs/configure/telemetry', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_testing.ts b/apps/frontpage/redirects/redirects_testing.ts deleted file mode 100644 index b5313ed2..00000000 --- a/apps/frontpage/redirects/redirects_testing.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/testing/:path*', - destination: '/docs', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/redirects_versions.ts b/apps/frontpage/redirects/redirects_versions.ts deleted file mode 100644 index d2288d6c..00000000 --- a/apps/frontpage/redirects/redirects_versions.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default [ - { - source: '/versions.json', - destination: '/versions', - permanent: true, - }, -] as RedirectData[]; diff --git a/apps/frontpage/redirects/types.ts b/apps/frontpage/redirects/types.ts new file mode 100644 index 00000000..8fc59cc8 --- /dev/null +++ b/apps/frontpage/redirects/types.ts @@ -0,0 +1,12 @@ +export interface RedirectList { + [key: string]: { + destination: string; + permanent: boolean; + }; +} + +export type RedirectData = { + source: string; + destination: string; + permanent: boolean; +}; diff --git a/apps/frontpage/types.ts b/apps/frontpage/types.ts index 3daad4c5..d6492029 100644 --- a/apps/frontpage/types.ts +++ b/apps/frontpage/types.ts @@ -79,16 +79,3 @@ interface TagLinkType { link: string; name: string; } - -interface RedirectList { - [key: string]: { - destination: string; - permanent: boolean; - }; -} - -type RedirectData = { - source: string; - destination: string; - permanent: boolean; -};