Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dithizac000 committed May 27, 2023
2 parents 8523746 + 9af32ae commit b8636bf
Show file tree
Hide file tree
Showing 336 changed files with 8,839 additions and 6,537 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"website/docusaurus.config.localized.json",
"*.xyz",
"*.docx",
"*.gitignore",
"versioned_docs",
"*.min.*",
"jest/vendor"
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/argos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Argos CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
take-screenshots:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
# A minimal fetch-depth of 2 is required
# to automatically detect branch in @argos-ci/cli
fetch-depth: 2

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Build website fast
run: yarn build:website:fast

- name: Take Argos screenshots
run: yarn argos:screenshot

- name: Upload Argos screenshots
continue-on-error: true
run: yarn argos:upload
2 changes: 1 addition & 1 deletion .github/workflows/build-blog-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand All @@ -57,7 +57,7 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
with:
fetch-depth: 0 # Needed to get the commit number with "git rev-list --count HEAD"
- name: Set up Node
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3

- name: Initialize CodeQL
uses: github/codeql-action/init@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2
uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # 2.3.3
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@d186a2a36cc67bfa1b860e6170d37fb9634742c7 # v2
uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # 2.3.3
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 #v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #v3
- name: Dependency Review
uses: actions/dependency-review-action@f46c48ed6d4f1227fb2d9ea62bf6bcbed315589e # v2
6 changes: 3 additions & 3 deletions .github/workflows/lighthouse-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Wait for the Netlify Preview
uses: jakepartusch/wait-for-netlify-action@f1e137043864b9ab9034ae3a5adc1c108e3f1a48 # v1
id: netlify
Expand All @@ -30,7 +30,7 @@ jobs:
max_timeout: 600
- name: Audit URLs using Lighthouse
id: lighthouse_audit
uses: treosh/lighthouse-ci-action@2e159d989f91bb9e399801b3e1ad90bcd4749f75 # 9.6.8
uses: treosh/lighthouse-ci-action@03becbfc543944dd6e7534f7ff768abb8a296826 # 10.1.0
with:
urls: |
https://deploy-preview-$PR_NUMBER--docusaurus-2.netlify.app/
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Add Lighthouse stats as comment
id: comment_to_pr
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd # v2.2.0
uses: marocchino/sticky-pull-request-comment@f61b6cf21ef2fcc468f4345cdfcc9bda741d2343 # 2.6.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/showcase-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
node: ['16.14', '16', '18']
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
variant: [-s, -st]
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Use Node.js 16
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Use Node.js 16
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Use Node.js 16
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-swizzle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
variant: ['js', 'ts']
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Support longpaths
run: git config --system core.longpaths true
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
node: ['16.14', '16', '18']
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ packages/docusaurus-*/lib/*
packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/
website/static/katex/katex.min.css

jest/vendor
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Docusaurus 2 Changelog

## 2.4.1 (2023-05-15)

#### :bug: Bug Fix

- `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#8971](https://github.com/facebook/docusaurus/pull/8971) fix(theme): fix collapsible sidebar behavior when prefers-reduced-motion ([@slorber](https://github.com/slorber))
- `docusaurus-theme-translations`
- [#8933](https://github.com/facebook/docusaurus/pull/8933) fix(theme-translations): fix Turkish translation for aria label "Enter key" ([@LiberaTeMetuMortis](https://github.com/LiberaTeMetuMortis))
- `docusaurus`
- [#8908](https://github.com/facebook/docusaurus/pull/8908) fix(core): Correct yarn upgrade command for yarn 2.x ([@andrewnicols](https://github.com/andrewnicols))
- `docusaurus-plugin-content-blog`, `docusaurus-theme-common`, `docusaurus-utils-common`, `docusaurus`
- [#8909](https://github.com/facebook/docusaurus/pull/8909) fix(theme): add \_\_ prefix to technical anchors, search crawlers (Algolia) should ignore them ([@slorber](https://github.com/slorber))
- `docusaurus-theme-common`
- [#8906](https://github.com/facebook/docusaurus/pull/8906) fix(theme-common): fix collapsible component with prefers-reduced-motion ([@slorber](https://github.com/slorber))
- [#8873](https://github.com/facebook/docusaurus/pull/8873) fix(theme-common): fix confusing theme error message: bad sidebar id suggestions ([@slorber](https://github.com/slorber))
- `docusaurus-utils`
- [#8874](https://github.com/facebook/docusaurus/pull/8874) fix(utils): handle Markdown links with spaces to route correctly ([@morsko1](https://github.com/morsko1))
- `docusaurus-theme-classic`, `docusaurus-theme-translations`
- [#8842](https://github.com/facebook/docusaurus/pull/8842) fix(theme-translations): remove redundant navigation text in aria label ([@tarunrajput](https://github.com/tarunrajput))
- `create-docusaurus`
- [#8831](https://github.com/facebook/docusaurus/pull/8831) fix(create): add missing await ([@SACHINnANYAKKARA](https://github.com/SACHINnANYAKKARA))

#### :nail_care: Polish

- `docusaurus-theme-classic`
- [#8862](https://github.com/facebook/docusaurus/pull/8862) refactor(theme): expose copy, success and word-wrap icons as standalone components ([@armano2](https://github.com/armano2))

#### Committers: 7

- Aleksandr Vladykin ([@morsko1](https://github.com/morsko1))
- Andrew Lyons ([@andrewnicols](https://github.com/andrewnicols))
- Armano ([@armano2](https://github.com/armano2))
- MetuMortis ([@LiberaTeMetuMortis](https://github.com/LiberaTeMetuMortis))
- Sachin Nanayakkara ([@SACHINnANYAKKARA](https://github.com/SACHINnANYAKKARA))
- Sébastien Lorber ([@slorber](https://github.com/slorber))
- Tarun Chauhan ([@tarunrajput](https://github.com/tarunrajput))

## 2.4.0 (2023-03-23)

#### :rocket: New Feature
Expand Down
5 changes: 5 additions & 0 deletions argos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

/screenshots/
/test-results/
/playwright-report/
/playwright/.cache/
21 changes: 21 additions & 0 deletions argos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Argos visual regression tests

We use [Argos CI](https://argos-ci.com) to detect visual regressions on Docusaurus.

This workspace can be run manually, but is generally run through the [Argos GitHub Action](../.github/workflows/argos.yml).

The workflow execute those following steps:

- Build the website locally with `yarn build:website:fast`
- Start the website server with `yarn serve:website` on [http://localhost:3000](http://localhost:3000)
- Take screenshots of all pages found in `sitemap.xml` with Playwright
- Upload all screenshots to [Argos CI](https://argos-ci.com)

This workflow runs for `main` and PR branches, and add a commit status to each PR with a visual diff that we can easily inspect.

---

Some additional capabilities:

- Use [./tests/screenshot.spec.ts](./tests/screenshot.spec.ts) to customize the screenshots we take, eventually filter out some useless sitemap pages like versioned docs
- Use [./tests/screenshot.css](./tests/screenshot.css) to hide flaky CSS elements: iframe, video, gif...
18 changes: 18 additions & 0 deletions argos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "argos",
"version": "3.0.0-alpha.0",
"description": "Argos visual diff tests",
"license": "MIT",
"private": true,
"scripts": {
"screenshot": "playwright test",
"upload": "npx @argos-ci/cli upload ./screenshots",
"report": "playwright show-report"
},
"dependencies": {
"@argos-ci/cli": "^0.4.4",
"@argos-ci/playwright": "^0.0.4",
"@playwright/test": "^1.30.0",
"cheerio": "^1.0.0-rc.12"
}
}
36 changes: 36 additions & 0 deletions argos/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import {devices} from '@playwright/test';
import type {PlaywrightTestConfig} from '@playwright/test';

/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
testDir: './tests',

// Run website production built
// Need to run "yarn website:build:fast" before
webServer: {
cwd: '..',
port: 3000,
command: 'yarn serve:website',
},

// Browsers: only Chrome for now
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
};

export default config;
19 changes: 19 additions & 0 deletions argos/tests/screenshot.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/*
Things to hide in Argos screenshots because it's source of flakiness
*/
iframe,
article.yt-lite,
.theme-last-updated,
.avatar__photo,
img[src$='.gif'],
h2#using-jsx-markup ~ div > div[class*='browserWindowBody']:has(b),
[class*='playgroundPreview'] {
visibility: hidden;
}
Loading

0 comments on commit b8636bf

Please sign in to comment.