diff --git a/.github/workflows/argos.yml b/.github/workflows/argos.yml index 06b142dfbbcd..57fd7b5a9de3 100644 --- a/.github/workflows/argos.yml +++ b/.github/workflows/argos.yml @@ -41,7 +41,7 @@ jobs: run: npx playwright install --with-deps chromium - name: Build website fast - run: yarn build:website:fast --dev + run: yarn argos:build - name: Take Argos screenshots run: yarn argos:screenshot diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index 3fbb4b0d6308..3ab840b92ca5 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -45,6 +45,24 @@ function isBlacklisted(pathname: string) { '/showcase', // Long blog post with many image carousels, often timeouts '/blog/2022/08/01/announcing-docusaurus-2.0', + + // DOGFOOD TESTS + // React key errors: + '/tests/docs/tests/toc-partials', + // Console errors + '/tests/pages/diagrams', + '/tests/pages/markdown-tests-md', + // Flaky because of hydration error + '/tests/blog/archive', + '/tests/docs/tests/custom-props', + '/tests/pages/code-block-tests', + '/tests/pages/embeds', + // Flaky because of hydration error with docusaurus serve + .html + '/tests/blog/x/y/z.html', + '/tests/docs/dummy.html', + // Cause weird docusaurus serve errors: + '/tests/docs/tests/ascii/%C3%A6%C3%B8%C3%A5', + '/tests/docs/tests/ascii/folder/%C3%A6%C3%B8%C3%A5', ]; return ( @@ -52,6 +70,13 @@ function isBlacklisted(pathname: string) { pathname.startsWith('/changelog') || // versioned docs pathname.match(/^\/docs\/((\d\.\d\.\d)|(next))\//) || + // verbose useless dogfooding pages + pathname.startsWith('/tests/docs/toc/') || + pathname.startsWith('/tests/docs/tags/') || + pathname.startsWith('/tests/docs/tests/category-links') || + pathname.startsWith('/tests/docs/tests/visibility') || + pathname.startsWith('/tests/blog/page/') || + pathname.startsWith('/tests/blog/tags/') || // manually excluded urls BlacklistedPathnames.includes(pathname) ); @@ -127,6 +152,9 @@ function throwOnConsole(page: Page) { // on /docs/markdown-features/math-equations 'Failed to decode downloaded font: http://localhost:3000/katex/fonts/', 'OTS parsing error: Failed to convert WOFF 2.0 font to SFNT', + + // Mermaid warning, see https://github.com/mermaid-js/mermaid/issues/6031 + 'Do not assign mappings to elements without corresponding data', ]; page.on('console', (message) => { diff --git a/package.json b/package.json index 8876ca0adeeb..5f5385c56d46 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,8 @@ "crowdin:upload:website": "crowdin upload sources --config ./crowdin-v2.yaml", "crowdin:download": "crowdin download --config ./crowdin-v2.yaml", "crowdin:download:website": "yarn crowdin:download --language fr --language ko --language pt-BR --language zh-CN --language ja", + "argos": "yarn argos:build && yarn argos:screenshot", + "argos:build": "cross-env DOCUSAURUS_ARGOS_BUILD=true yarn build:website:fast --dev", "argos:screenshot": "yarn workspace argos screenshot", "canary": "yarn canary:bumpVersion && yarn canary:publish", "canary:getCoreVersion": "node -p \"require('./packages/docusaurus/package.json').version\"", diff --git a/project-words.txt b/project-words.txt index 7b6622f015be..9cef579226d0 100644 --- a/project-words.txt +++ b/project-words.txt @@ -67,6 +67,7 @@ docusuarus Docz dogfood Dogfood +DOGFOOD dogfooding Dogfooding Dojocat diff --git a/website/_dogfooding/dogfooding.config.ts b/website/_dogfooding/dogfooding.config.ts index 94b142cae275..192cb4a8c20b 100644 --- a/website/_dogfooding/dogfooding.config.ts +++ b/website/_dogfooding/dogfooding.config.ts @@ -12,6 +12,14 @@ import type {Options as DocsOptions} from '@docusaurus/plugin-content-docs'; import type {Options as BlogOptions} from '@docusaurus/plugin-content-blog'; import type {Options as PageOptions} from '@docusaurus/plugin-content-pages'; +export const isArgosBuild = process.env.DOCUSAURUS_ARGOS_BUILD === 'true'; + +if (isArgosBuild) { + console.warn( + 'Building site for Argos CI - additional dogfooding pages will be preserved in sitemap', + ); +} + export function dogfoodingTransformFrontMatter(frontMatter: { [key: string]: unknown; }): {[key: string]: unknown} { @@ -39,7 +47,7 @@ export const dogfoodingPluginInstances: PluginConfig[] = [ sidebarPath: '_dogfooding/docs-tests-sidebars.js', versions: { current: { - noIndex: true, + noIndex: !isArgosBuild, }, }, onInlineTags: 'warn', diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 7ae2a4c9b7a2..b52e5c859a7a 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -17,6 +17,7 @@ import { dogfoodingThemeInstances, dogfoodingRedirects, dogfoodingTransformFrontMatter, + isArgosBuild, } from './_dogfooding/dogfooding.config'; import ConfigLocalized from './docusaurus.config.localized.json'; @@ -538,8 +539,10 @@ export default async function createConfigAsync() { } : undefined, sitemap: { - // Note: /tests/docs already has noIndex: true - ignorePatterns: ['/tests/{blog,pages}/**'], + ignorePatterns: isArgosBuild + ? undefined + : // Note: /tests/docs already has noIndex: true + ['/tests/{blog,pages}/**'], lastmod: 'date', priority: null, changefreq: null,