From a9c9e0ec1bb597597669495ec77a12a2daab6f70 Mon Sep 17 00:00:00 2001 From: JC Franco Date: Wed, 20 Nov 2024 00:56:34 -0800 Subject: [PATCH] chore: fix storybook GH pages deployment (#10807) **Related Issue:** N/A ## Summary #10482 caused a break in our GitHub deployment. This fix addresses it by: * Adding a `.nojekyll` file to the pages folder to prevent files with leading underscores in their names from being excluded (see https://github.blog/news-insights/bypassing-jekyll-on-github-pages/). * Moving the internal-testing notice to the preview head to leverage the lazy-loaded components in the preview. * We can revisit restoring this in the manager head after https://github.com/storybookjs/builder-vite/issues/486 is resolved. --- .../calcite-components/.storybook/main.ts | 90 +++++++++---------- .../.storybook/static/.nojekyll | 0 2 files changed, 41 insertions(+), 49 deletions(-) create mode 100644 packages/calcite-components/.storybook/static/.nojekyll diff --git a/packages/calcite-components/.storybook/main.ts b/packages/calcite-components/.storybook/main.ts index 17f009320b4..45ebd5777ec 100644 --- a/packages/calcite-components/.storybook/main.ts +++ b/packages/calcite-components/.storybook/main.ts @@ -1,4 +1,5 @@ import { UserConfig } from "vite"; +import { html } from "../support/formatting"; module.exports = { addons: [ @@ -26,61 +27,52 @@ module.exports = { }); }, stories: ["../src/**/*.mdx", "../src/**/*.stories.ts"], + staticDirs: ["./static"], previewHead: (head: string): string => ` ${head} ${ process.env.STORYBOOK_SCREENSHOT_TEST_BUILD - ? `` + ? html`` : "" } - `, - managerHead: (head: string): string => { - if (process.env.STORYBOOK_SCREENSHOT_TEST_BUILD || process.env.STORYBOOK_SCREENSHOT_LOCAL_BUILD) { - return head; - } - - return ` - - - - - - - + ${ + !process.env.STORYBOOK_SCREENSHOT_TEST_BUILD && !process.env.STORYBOOK_SCREENSHOT_LOCAL_BUILD + ? html` - ${head} - `; - }, + ` + : "" + } + `, }; diff --git a/packages/calcite-components/.storybook/static/.nojekyll b/packages/calcite-components/.storybook/static/.nojekyll new file mode 100644 index 00000000000..e69de29bb2d