Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lex111/iss3728
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Feb 18, 2021
2 parents 05d9947 + 094b513 commit 4252a17
Show file tree
Hide file tree
Showing 141 changed files with 3,610 additions and 2,266 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ aliases:
defaults: &defaults
working_directory: ~/docusaurus
docker:
- image: circleci/node:10
- image: circleci/node:12
resource_class: large

version: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/canary-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10']
node: ['12']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/migration-cli-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10']
node: ['12']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node: ['10']
node: ['12']
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged --allow-empty
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.15.1
12.13.0
2 changes: 1 addition & 1 deletion examples/classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
]
},
"description": "Docusaurus example project"
}
}
2 changes: 1 addition & 1 deletion examples/facebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
]
},
"description": "Docusaurus example project (facebook template)"
}
}
49 changes: 23 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"canary:bumpVersion": "yarn lerna version 2.0.0-alpha.`git rev-parse --short HEAD` --exact --no-push --yes",
"canary:publish": "yarn lerna publish from-package --dist-tag canary --yes --no-verify-access",
"changelog": "lerna-changelog",
"postinstall": "yarn lock:update && yarn build:packages",
"postinstall": "run-p postinstall:**",
"postinstall:main": "yarn lock:update && yarn build:packages",
"postinstall:dev": "is-ci || husky install",
"prettier": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx}\"",
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx}\"",
"prettier-docs": "prettier --config .prettierrc --write \"**/*.md\"",
Expand All @@ -62,16 +64,16 @@
"lock:update": "npx yarn-deduplicate"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@crowdin/cli": "^3.5.2",
"@babel/cli": "^7.12.16",
"@babel/core": "^7.12.16",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
"@babel/plugin-transform-modules-commonjs": "^7.12.13",
"@babel/preset-typescript": "^7.12.16",
"@crowdin/cli": "^3.5.3",
"@types/express": "^4.17.2",
"@types/fs-extra": "^9.0.6",
"@types/jest": "^25.2.1",
"@types/jest": "^26.0.20",
"@types/loader-utils": "^1.1.3",
"@types/lodash.camelcase": "^4.3.6",
"@types/lodash.flatmap": "^4.5.6",
Expand All @@ -86,7 +88,7 @@
"@types/node": "^14.14.22",
"@types/prismjs": "^1.16.2",
"@types/prompts": "^2.0.9",
"@types/react": "^16.9.52",
"@types/react": "^17.0.2",
"@types/react-dev-utils": "^9.0.1",
"@types/react-helmet": "^6.0.0",
"@types/react-loadable": "^5.5.3",
Expand All @@ -102,9 +104,7 @@
"babel-eslint": "^10.0.3",
"concurrently": "^5.3.0",
"cross-env": "^7.0.3",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^7.13.0",
"eslint": "^7.20.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-header": "^3.0.0",
Expand All @@ -113,19 +113,21 @@
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"glob": "^7.1.6",
"husky": "^4.2.3",
"jest": "^25.2.7",
"husky": "^5.0.9",
"is-ci": "^2.0.0",
"jest": "^26.6.3",
"lerna": "^3.22.1",
"lerna-changelog": "^1.0.1",
"lint-staged": "^10.1.2",
"lint-staged": "^10.5.4",
"netlify-cli": "^2.58.0",
"nodemon": "^2.0.7",
"prettier": "^2.0.2",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^3.0.2",
"serve": "^11.3.2",
"stylelint": "^13.2.1",
"stylelint": "^13.10.0",
"typescript": "^3.9.5"
},
"lint-staged": {
Expand All @@ -137,12 +139,7 @@
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"engines": {
"node": ">=10.15.1"
"node": ">=12.13.0"
}
}
1 change: 1 addition & 0 deletions packages/docusaurus-1.x/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
'react/forbid-prop-types': OFF, // 1
'react/require-default-props': OFF, // 1
'jsx-a11y/control-has-associated-label': OFF, // 1
'react/jsx-no-target-blank': OFF, // 1
'react/jsx-props-no-spreading': OFF, // 2
'max-classes-per-file': OFF, // 2
'prefer-object-spread': OFF, // 5
Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-1.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"commander": "^4.0.1",
"crowdin-cli": "^0.3.0",
"cssnano": "^4.1.10",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"escape-string-regexp": "^2.0.0",
"express": "^4.17.1",
"feed": "^4.2.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/docusaurus-cssnano-preset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
*/

const advancedBasePreset = require('cssnano-preset-advanced');
const postCssCombineDuplicatedSelectors = require('postcss-combine-duplicated-selectors');
const postCssSortMediaQueries = require('postcss-sort-media-queries');
const postCssRemoveOverriddenCustomProperties = require('./src/remove-overridden-custom-properties');

const preset = advancedBasePreset({autoprefixer: {add: true}});

preset.plugins.unshift(
[postCssCombineDuplicatedSelectors, {removeDuplicatedValues: true}],
[postCssSortMediaQueries],
[postCssRemoveOverriddenCustomProperties],
);
Expand Down
1 change: 0 additions & 1 deletion packages/docusaurus-cssnano-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dependencies": {
"cssnano-preset-advanced": "^4.0.7",
"postcss": "^7.0.2",
"postcss-combine-duplicated-selectors": "^9.1.0",
"postcss-sort-media-queries": "^1.7.26"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"shelljs": "^0.8.4"
},
"engines": {
"node": ">=10.15.1"
"node": ">=12.13.0"
}
}
4 changes: 2 additions & 2 deletions packages/docusaurus-init/templates/bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@docusaurus/preset-bootstrap": "2.0.0-alpha.70",
"@mdx-js/react": "^1.5.8",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"browserslist": {
"production": [
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-init/templates/classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@docusaurus/preset-classic": "2.0.0-alpha.70",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"browserslist": {
"production": [
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-init/templates/facebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@docusaurus/preset-classic": "2.0.0-alpha.70",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"babel-eslint": "^10.0.3",
Expand Down
12 changes: 6 additions & 6 deletions packages/docusaurus-mdx-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.12.5",
"@babel/traverse": "^7.12.5",
"@babel/parser": "^7.12.16",
"@babel/traverse": "^7.12.13",
"@docusaurus/core": "2.0.0-alpha.70",
"@docusaurus/utils": "2.0.0-alpha.70",
"@mdx-js/mdx": "^1.6.21",
Expand All @@ -41,13 +41,13 @@
"remark-mdx": "^1.6.21",
"to-vfile": "^6.0.0",
"unist-builder": "^2.0.3",
"unist-util-remove-position": "^2.0.1"
"unist-util-remove-position": "^3.0.0"
},
"peerDependencies": {
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
},
"engines": {
"node": ">=10.15.1"
"node": ">=12.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/docusaurus-migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"docusaurus-migrate": "bin/index.js"
},
"dependencies": {
"@babel/preset-env": "^7.1.6",
"@babel/preset-env": "^7.12.16",
"@mapbox/hast-util-to-jsx": "^1.0.0",
"chalk": "^4.1.0",
"color": "^3.1.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/docusaurus-migrate/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export async function migrateDocusaurusProject(
'@docusaurus/core': DOCUSAURUS_VERSION,
'@docusaurus/preset-classic': DOCUSAURUS_VERSION,
clsx: '^1.1.1',
react: '^16.10.2',
'react-dom': '^16.10.2',
react: '^17.0.1',
'react-dom': '^17.0.1',
};
try {
createClientRedirects(siteConfig, deps, config);
Expand Down Expand Up @@ -592,9 +592,9 @@ function migrateVersionedSidebar(
acc: {[key: string]: Array<Record<string, unknown> | string>},
val,
) => {
acc[val[0].replace(versionRegex, '')] = (val[1] as Array<
any
>).map((item) => {
acc[
val[0].replace(versionRegex, '')
] = (val[1] as Array<any>).map((item) => {
if (typeof item === 'string') {
return item.replace(versionRegex, '');
}
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-module-type-aliases/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ declare module '@generated/i18n' {
defaultLocale: string;
locales: [string, ...string[]];
currentLocale: string;
localeConfigs: Record<string, {label: string}>;
localeConfigs: Record<string, {label: string; direction: string}>;
};
export default i18n;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-plugin-client-redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"eta": "^1.11.0",
"fs-extra": "^9.0.1",
"globby": "^11.0.2",
"joi": "^17.2.1",
"joi": "^17.4.0",
"lodash": "^4.17.20"
},
"peerDependencies": {
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
},
"engines": {
"node": ">=10.9.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/docusaurus-plugin-content-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
"feed": "^4.2.2",
"fs-extra": "^9.1.0",
"globby": "^11.0.2",
"joi": "^17.2.1",
"joi": "^17.4.0",
"loader-utils": "^1.2.3",
"lodash": "^4.17.20",
"reading-time": "^1.3.0",
"remark-admonitions": "^1.2.1",
"webpack": "^4.44.1"
},
"peerDependencies": {
"react": "^16.8.4",
"react-dom": "^16.8.4"
"react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4 || ^17.0.0"
},
"engines": {
"node": ">=10.15.1"
"node": ">=12.13.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,26 +184,31 @@ describe('loadBlog', () => {
expect(editUrlFunction).toHaveBeenCalledWith({
blogDirPath: 'blog',
blogPath: 'date-matter.md',
permalink: '/blog/date-matter',
locale: 'en',
});
expect(editUrlFunction).toHaveBeenCalledWith({
blogDirPath: 'blog',
blogPath: 'draft.md',
permalink: '/blog/draft',
locale: 'en',
});
expect(editUrlFunction).toHaveBeenCalledWith({
blogDirPath: 'blog',
blogPath: 'complex-slug.md',
permalink: '/blog/hey/my super path/héllô',
locale: 'en',
});
expect(editUrlFunction).toHaveBeenCalledWith({
blogDirPath: 'blog',
blogPath: 'simple-slug.md',
permalink: '/blog/simple/slug',
locale: 'en',
});
expect(editUrlFunction).toHaveBeenCalledWith({
blogDirPath: 'i18n/en/docusaurus-plugin-content-blog',
blogPath: '2018-12-14-Happy-First-Birthday-Slash.md',
permalink: '/blog/2018/12/14/Happy-First-Birthday-Slash',
locale: 'en',
});
});
Expand Down
Loading

0 comments on commit 4252a17

Please sign in to comment.