Skip to content

Commit

Permalink
Merge branch 'main' into jc/remark-parse-markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Jan 28, 2022
2 parents 8eae7ac + bcb1533 commit ae9de69
Show file tree
Hide file tree
Showing 1,007 changed files with 28,130 additions and 18,654 deletions.
37 changes: 37 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.2",
"gitignoreRoot": ".",
"useGitignore": true,
"dictionaries": [
"css",
"html",
"fonts",
"typescript",
"softwareTerms",
"companies",
"lorem-ipsum",
"project-words"
],
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./project-words.txt",
"noSuggest": true
}
],
"ignorePaths": [
"CHANGELOG.md",
"examples",
"packages/docusaurus-theme-translations/locales",
"__tests__",
"package.json",
"yarn.lock",
"project-words.txt",
"website/src/data/users.tsx",
"*.xyz",
"*.docx",
"versioned_docs",
"*.min.*"
],
"ignoreRegExpList": ["Email", "Urls", "#[\\w-]*"]
}
6 changes: 2 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ build
coverage
jest.config.js
jest.transform.js
scripts
examples/

packages/lqip-loader/lib/
packages/docusaurus/lib/
packages/docusaurus-*/lib/*
packages/docusaurus-*/lib-next/
packages/docusaurus-plugin-pwa/copyUntypedFiles.js
packages/docusaurus-plugin-ideal-image/copyUntypedFiles.js
packages/docusaurus-theme-search-algolia/copyUntypedFiles.js
packages/stylelint-copyright/lib/
copyUntypedFiles.mjs

packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/facebook/.eslintrc.js
22 changes: 17 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:jest/recommended',
'airbnb',
'prettier',
],
Expand All @@ -39,7 +40,8 @@ module.exports = {
},
},
},
plugins: ['react-hooks', 'header'],
reportUnusedDisableDirectives: true,
plugins: ['react-hooks', 'header', 'jest'],
rules: {
'react-hooks/rules-of-hooks': ERROR,
'react-hooks/exhaustive-deps': ERROR,
Expand Down Expand Up @@ -74,9 +76,7 @@ module.exports = {
'no-param-reassign': [WARNING, {props: false}],
'no-underscore-dangle': OFF,
curly: [WARNING, 'all'],
'react/jsx-closing-bracket-location': OFF, // Conflicts with Prettier.
'react/jsx-filename-extension': OFF,
'react/jsx-one-expression-per-line': OFF,
'react/no-array-index-key': OFF, // Sometimes its ok, e.g. non-changing data.
'react/prop-types': OFF,
'react/destructuring-assignment': OFF, // Too many lines.
Expand All @@ -96,7 +96,6 @@ module.exports = {
WARNING,
{disallowTypeAnnotations: false},
],
'import/first': OFF,
'import/order': OFF,
'import/prefer-default-export': OFF,
'lines-between-class-members': OFF,
Expand Down Expand Up @@ -171,8 +170,21 @@ module.exports = {
],
},
],
'jest/prefer-expect-resolves': WARNING,
'jest/expect-expect': OFF,
'jest/valid-title': OFF,
},
overrides: [
{
files: [
'packages/docusaurus-theme-*/src/theme/**/*.js',
'packages/docusaurus-theme-*/src/theme/**/*.ts',
'packages/docusaurus-theme-*/src/theme/**/*.tsx',
],
rules: {
'import/no-named-export': ERROR,
},
},
{
files: [
'packages/create-docusaurus/templates/**/*.js',
Expand All @@ -198,7 +210,7 @@ module.exports = {
},
},
{
files: ['*.js'],
files: ['*.js', '*.mjs', '.cjs'],
rules: {
// Make JS code directly runnable in Node.
'@typescript-eslint/no-var-requires': OFF,
Expand Down
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 99
- package-ecosystem: npm
directory: '/'
schedule:
interval: monthly
open-pull-requests-limit: 99
1 change: 1 addition & 0 deletions .github/workflows/build-blog-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: yarn
- name: Installation
run: yarn
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: yarn
- uses: preactjs/compressed-size-action@v2
with:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Needed to get the commit number with "git rev-list --count HEAD"
- name: Use Node.js ${{ matrix.node-version }}
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: '16'
cache: yarn
- name: Prepare git
run: |
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/cspell-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "cspell",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+)\\s+\\-\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}
8 changes: 4 additions & 4 deletions .github/workflows/lighthouse-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ jobs:
max_timeout: 600
- name: Audit URLs using Lighthouse
id: lighthouse_audit
uses: treosh/lighthouse-ci-action@v3
uses: treosh/lighthouse-ci-action@8.2.0
with:
urls: |
https://deploy-preview-$PR_NUMBER--docusaurus-2.netlify.app/
configPath: ./.github/workflows/lighthousesrc.json
configPath: ./.github/workflows/lighthouserc.json
uploadArtifacts: true
temporaryPublicStorage: true
env:
PR_NUMBER: ${{ github.event.pull_request.number}}
- name: Format lighthouse score
id: format_lighthouse_score
uses: actions/github-script@v3
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Add Lighthouse stats as comment
id: comment_to_pr
uses: marocchino/sticky-pull-request-comment@v2.0.0
uses: marocchino/sticky-pull-request-comment@v2.2.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.pull_request.number }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"ci": {
"assert": {
"assertions": {
"categories:accessibility": ["error", {"minScore": 1}]
}
},
"collect": {
"settings": {
"skipAudits": [
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: yarn
- name: Installation
run: yarn
# run: yarn install --immutable # Fails if yarn.lock is modified (unfortunately only works for Yarn 2, and --frozen-lockfile is not the same!)
- name: Check immutable yarn.lock
run: git diff --exit-code
- name: Lint
run: yarn lint:ci
run: |
echo "::add-matcher::.github/workflows/cspell-problem-matcher.json"
yarn lint:ci
- name: Prettier Code
run: yarn format:diff
- name: Prettier Docs
run: yarn format-docs:diff
5 changes: 2 additions & 3 deletions .github/workflows/showcase-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: '16'
cache: yarn
- name: Installation
run: yarn
- name: Test
run: yarn test website/src/data/__tests__/user.test.ts
# TODO another job to optimize the images, see https://github.com/facebook/docusaurus/issues/5980
11 changes: 3 additions & 8 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ jobs:
- name: Build test-website project
run: yarn build
working-directory: ../test-website
env:
CI: true

yarn-berry:
name: E2E — Yarn Berry
Expand All @@ -72,6 +70,9 @@ jobs:
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
run: |
yarn set version berry
# https://github.com/facebook/docusaurus/pull/6350#issuecomment-1013214763
# Remove this after Yarn 3.2
yarn set version canary
yarn config set nodeLinker ${{ matrix.nodeLinker }}
yarn config set npmRegistryServer http://localhost:4873
Expand All @@ -98,8 +99,6 @@ jobs:
- name: Build test-website project
run: yarn build
working-directory: ../test-website
env:
CI: true

npm:
name: E2E — NPM
Expand Down Expand Up @@ -131,8 +130,6 @@ jobs:
- name: Build test-website project
run: npm run build
working-directory: ../test-website
env:
CI: true

pnpm:
name: E2E — PNPM
Expand Down Expand Up @@ -166,5 +163,3 @@ jobs:
- name: Build test-website project
run: pnpm run build
working-directory: ../test-website
env:
CI: true
2 changes: 0 additions & 2 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ jobs:
echo "# hello" > test-file.md
- name: Docusaurus Build
run: yarn build:website --locale en
env:
CI: true
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Test
run: yarn test
- name: TypeCheck website
run: yarn workspace website tsc
run: yarn workspace website typecheck
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ packages/create-docusaurus/lib/
packages/lqip-loader/lib/
packages/docusaurus/lib/
packages/docusaurus-*/lib/*
packages/stylelint-copyright/lib/
packages/docusaurus-*/lib-next/

website/netlifyDeployPreview/*
website/changelog
!website/netlifyDeployPreview/index.html
!website/netlifyDeployPreview/_redirects

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16.0
14.17.0
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ packages/docusaurus-*/lib/*
packages/docusaurus-*/lib-next/
packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/*/docusaurus.config.js
packages/stylelint-copyright/lib/
__fixtures__

website/i18n
Expand All @@ -18,3 +19,4 @@ website/docusaurus.config.js
website/versioned_sidebars/*.json

examples/
website/static/katex/katex.min.css
15 changes: 14 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# Stylelint runs on everything by default; we only lint CSS files.
*
!*/
!*.css
build
coverage
examples/

packages/lqip-loader/lib/
packages/docusaurus/lib/
packages/docusaurus-*/lib/*
packages/docusaurus-*/lib-next/
packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/
examples
website/static/katex/katex.min.css
Loading

0 comments on commit ae9de69

Please sign in to comment.