diff --git a/.github/workflows/sync_canon.yml b/.github/workflows/sync_canon.yml index 29a0ae2ce4..e6365bb1dd 100644 --- a/.github/workflows/sync_canon.yml +++ b/.github/workflows/sync_canon.yml @@ -1,4 +1,4 @@ -name: Sync Canon Storybook +name: Sync Canon Docs on: push: branches: [master] @@ -26,31 +26,32 @@ jobs: with: cache-prefix: ${{ runner.os }}-v20.x - - name: Checkout backstage/canon-storybook + - name: Checkout backstage/canon-docs uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - repository: backstage/canon-storybook - path: canon-storybook + repository: backstage/canon-docs + path: canon-docs token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} - name: Configure Git run: | git config --global user.email noreply@backstage.io - git config --global user.name 'Github Canon Storybook workflow' + git config --global user.name 'Github Canon Docs workflow' - - name: Build Canon Storybook + - name: Build Canon Docs + working-directory: canon-docs run: | - yarn workspace @backstage/canon run build-storybook + yarn build - - name: Replace contents of canon-storybook repo with Storybook build output - working-directory: canon-storybook + - name: Replace contents of canon-docs repo with docs build output + working-directory: canon-docs run: | git rm -rf . - cp -R ../packages/canon/storybook-static/. . + cp -R out/. . - - name: Commit to canon-storybook repo - working-directory: canon-storybook + - name: Commit to canon-docs repo + working-directory: canon-docs run: | git add . - git commit -am "Canon Storybook build for backstage/backstage@${{ github.sha }}" + git commit -am "Canon Docs build for backstage/backstage@${{ github.sha }}" git push diff --git a/.prettierignore b/.prettierignore index c7a16065e5..b4e5bfc808 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,8 @@ .yarn dist microsite +canon-docs/.next +canon-docs/public coverage *.hbs templates diff --git a/canon-docs/next.config.mjs b/canon-docs/next.config.mjs index f03bcc8727..9d2e12cefb 100644 --- a/canon-docs/next.config.mjs +++ b/canon-docs/next.config.mjs @@ -2,10 +2,21 @@ import createMDX from '@next/mdx'; const nextConfig = { pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], - // output: 'export', - // images: { - // unoptimized: true, - // }, + /** + * Enable static exports for the App Router. + * + * @see https://nextjs.org/docs/app/building-your-application/deploying/static-exports + */ + output: 'export', + /** + * Disable server-based image optimization. Next.js does not support + * dynamic features with static exports. + * + * @see https://nextjs.org/docs/app/api-reference/components/image#unoptimized + */ + images: { + unoptimized: true, + }, }; const withMDX = createMDX({}); diff --git a/canon-docs/src/components/PropsTable/PropsTable.tsx b/canon-docs/src/components/PropsTable/PropsTable.tsx index 44db223544..6eb1f8cd88 100644 --- a/canon-docs/src/components/PropsTable/PropsTable.tsx +++ b/canon-docs/src/components/PropsTable/PropsTable.tsx @@ -31,7 +31,7 @@ export const PropsTable = >({ {Array.isArray(data[n].type) ? ( - data[n].type.map((t) => {t}) + data[n].type.map(t => {t}) ) : ( {data[n].type} )}