mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 02:37:59 +02:00
chore: upgrade docsearch-react to v3 stable, bump dependencies (#6752)
* chore: upgrade dependencies * revert * validation * fix blog * reformat
This commit is contained in:
parent
a70514205d
commit
dcbf9f644e
29 changed files with 687 additions and 496 deletions
4
.github/workflows/tests-e2e.yml
vendored
4
.github/workflows/tests-e2e.yml
vendored
|
@ -83,10 +83,6 @@ jobs:
|
||||||
# https://yarnpkg.com/features/pnp#fallback-mode
|
# https://yarnpkg.com/features/pnp#fallback-mode
|
||||||
yarn config set pnpFallbackMode none
|
yarn config set pnpFallbackMode none
|
||||||
|
|
||||||
# Patch package so that peer deps are provided. This has been fixed in terser by making acorn a direct dependency
|
|
||||||
# TODO watch out for the next terser release. Commit: https://github.com/terser/terser/commit/05b23eeb682d732484ad51b19bf528258fd5dc2a
|
|
||||||
yarn config set packageExtensions --json '{"terser-webpack-plugin@*": {"dependencies": {"acorn": "^8.6.0"}}, "html-minifier-terser@*": {"dependencies": {"acorn": "^8.6.0"}}}'
|
|
||||||
|
|
||||||
yarn install
|
yarn install
|
||||||
working-directory: ../test-website
|
working-directory: ../test-website
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
"@netlify/functions": "^1.0.0"
|
"@netlify/functions": "^1.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"netlify-cli": "^9.4.0"
|
"netlify-cli": "^9.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
package.json
16
package.json
|
@ -58,28 +58,28 @@
|
||||||
"lock:update": "npx yarn-deduplicate"
|
"lock:update": "npx yarn-deduplicate"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.17.3",
|
"@babel/cli": "^7.17.6",
|
||||||
"@babel/core": "^7.17.5",
|
"@babel/core": "^7.17.5",
|
||||||
"@babel/preset-typescript": "^7.16.7",
|
"@babel/preset-typescript": "^7.16.7",
|
||||||
"@crowdin/cli": "^3.7.8",
|
"@crowdin/cli": "^3.7.8",
|
||||||
"@types/fs-extra": "^9.0.13",
|
"@types/fs-extra": "^9.0.13",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.1",
|
||||||
"@types/lodash": "^4.14.178",
|
"@types/lodash": "^4.14.178",
|
||||||
"@types/node": "^17.0.18",
|
"@types/node": "^17.0.21",
|
||||||
"@types/prompts": "^2.0.14",
|
"@types/prompts": "^2.0.14",
|
||||||
"@types/react": "^17.0.39",
|
"@types/react": "^17.0.39",
|
||||||
"@types/react-dev-utils": "^9.0.10",
|
"@types/react-dev-utils": "^9.0.10",
|
||||||
"@types/react-test-renderer": "^17.0.1",
|
"@types/react-test-renderer": "^17.0.1",
|
||||||
"@types/semver": "^7.3.9",
|
"@types/semver": "^7.3.9",
|
||||||
"@types/shelljs": "^0.8.11",
|
"@types/shelljs": "^0.8.11",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.12.0",
|
"@typescript-eslint/eslint-plugin": "^5.12.1",
|
||||||
"@typescript-eslint/parser": "^5.12.0",
|
"@typescript-eslint/parser": "^5.12.1",
|
||||||
"concurrently": "^7.0.0",
|
"concurrently": "^7.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cspell": "^5.18.5",
|
"cspell": "^5.18.5",
|
||||||
"eslint": "^8.9.0",
|
"eslint": "^8.9.0",
|
||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.4.0",
|
||||||
"eslint-plugin-header": "^3.1.1",
|
"eslint-plugin-header": "^3.1.1",
|
||||||
"eslint-plugin-import": "^2.25.4",
|
"eslint-plugin-import": "^2.25.4",
|
||||||
"eslint-plugin-jest": "^26.1.1",
|
"eslint-plugin-jest": "^26.1.1",
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
"lerna": "^4.0.0",
|
"lerna": "^4.0.0",
|
||||||
"lerna-changelog": "^2.2.0",
|
"lerna-changelog": "^2.2.0",
|
||||||
"lint-staged": "^12.3.4",
|
"lint-staged": "^12.3.4",
|
||||||
"netlify-cli": "^9.6.5",
|
"netlify-cli": "^9.8.0",
|
||||||
"nodemon": "^2.0.15",
|
"nodemon": "^2.0.15",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
"remark-parse": "^8.0.2",
|
"remark-parse": "^8.0.2",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sharp": "^0.30.1",
|
"sharp": "^0.30.1",
|
||||||
"stylelint": "^14.5.1",
|
"stylelint": "^14.5.3",
|
||||||
"stylelint-config-prettier": "^9.0.3",
|
"stylelint-config-prettier": "^9.0.3",
|
||||||
"stylelint-config-standard": "^25.0.0",
|
"stylelint-config-standard": "^25.0.0",
|
||||||
"typescript": "^4.5.5",
|
"typescript": "^4.5.5",
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/logger": "2.0.0-beta.15",
|
"@docusaurus/logger": "2.0.0-beta.15",
|
||||||
"commander": "^5.1.0",
|
"commander": "^5.1.0",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
|
|
|
@ -29,14 +29,14 @@
|
||||||
"@babel/eslint-parser": "^7.16.3",
|
"@babel/eslint-parser": "^7.16.3",
|
||||||
"eslint": "^8.8.0",
|
"eslint": "^8.8.0",
|
||||||
"eslint-config-airbnb": "^19.0.0",
|
"eslint-config-airbnb": "^19.0.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.4.0",
|
||||||
"eslint-plugin-header": "^3.1.1",
|
"eslint-plugin-header": "^3.1.1",
|
||||||
"eslint-plugin-import": "^2.25.3",
|
"eslint-plugin-import": "^2.25.3",
|
||||||
"eslint-plugin-jsx-a11y": "^6.5.1",
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
||||||
"eslint-plugin-react": "^7.27.0",
|
"eslint-plugin-react": "^7.27.0",
|
||||||
"eslint-plugin-react-hooks": "^4.3.0",
|
"eslint-plugin-react-hooks": "^4.3.0",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"stylelint": "^14.3.0"
|
"stylelint": "^14.5.3"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"@mdx-js/mdx": "^1.6.22",
|
"@mdx-js/mdx": "^1.6.22",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"image-size": "^1.0.1",
|
"image-size": "^1.0.1",
|
||||||
"mdast-util-to-string": "^2.0.0",
|
"mdast-util-to-string": "^2.0.0",
|
||||||
"remark-emoji": "^2.1.0",
|
"remark-emoji": "^2.1.0",
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"@mapbox/hast-util-to-jsx": "^2.0.0",
|
"@mapbox/hast-util-to-jsx": "^2.0.0",
|
||||||
"color": "^4.0.1",
|
"color": "^4.0.1",
|
||||||
"commander": "^5.1.0",
|
"commander": "^5.1.0",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"hast-util-to-string": "^1.0.4",
|
"hast-util-to-string": "^1.0.4",
|
||||||
"html-tags": "^3.1.0",
|
"html-tags": "^3.1.0",
|
||||||
"import-fresh": "^3.3.0",
|
"import-fresh": "^3.3.0",
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"@docusaurus/utils-common": "2.0.0-beta.15",
|
"@docusaurus/utils-common": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
||||||
"eta": "^1.12.3",
|
"eta": "^1.12.3",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
||||||
"cheerio": "^1.0.0-rc.10",
|
"cheerio": "^1.0.0-rc.10",
|
||||||
"feed": "^4.2.2",
|
"feed": "^4.2.2",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
"remark-admonitions": "^1.2.1",
|
"remark-admonitions": "^1.2.1",
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"@docusaurus/utils": "2.0.0-beta.15",
|
"@docusaurus/utils": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
||||||
"combine-promises": "^1.1.0",
|
"combine-promises": "^1.1.0",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"import-fresh": "^3.3.0",
|
"import-fresh": "^3.3.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"@docusaurus/mdx-loader": "2.0.0-beta.15",
|
"@docusaurus/mdx-loader": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils": "2.0.0-beta.15",
|
"@docusaurus/utils": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"remark-admonitions": "^1.2.1",
|
"remark-admonitions": "^1.2.1",
|
||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"webpack": "^5.69.1"
|
"webpack": "^5.69.1"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "2.0.0-beta.15",
|
"@docusaurus/core": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils": "2.0.0-beta.15",
|
"@docusaurus/utils": "2.0.0-beta.15",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"react-json-view": "^1.21.3",
|
"react-json-view": "^1.21.3",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
|
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
|
||||||
"@docusaurus/types": "2.0.0-beta.15",
|
"@docusaurus/types": "2.0.0-beta.15",
|
||||||
"fs-extra": "^10.0.0"
|
"fs-extra": "^10.0.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"jimp": "*",
|
"jimp": "*",
|
||||||
|
|
|
@ -34,13 +34,13 @@
|
||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"webpack": "^5.69.1",
|
"webpack": "^5.69.1",
|
||||||
"webpack-merge": "^5.8.0",
|
"webpack-merge": "^5.8.0",
|
||||||
"workbox-build": "^6.4.2",
|
"workbox-build": "^6.5.0",
|
||||||
"workbox-precaching": "^6.1.1",
|
"workbox-precaching": "^6.5.0",
|
||||||
"workbox-window": "^6.4.2"
|
"workbox-window": "^6.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
|
"@docusaurus/module-type-aliases": "2.0.0-beta.15",
|
||||||
"fs-extra": "^10.0.0"
|
"fs-extra": "^10.0.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^16.8.4 || ^17.0.0",
|
"react": "^16.8.4 || ^17.0.0",
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"@docusaurus/utils": "2.0.0-beta.15",
|
"@docusaurus/utils": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils-common": "2.0.0-beta.15",
|
"@docusaurus/utils-common": "2.0.0-beta.15",
|
||||||
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"sitemap": "^7.1.1",
|
"sitemap": "^7.1.1",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
"@types/prismjs": "^1.26.0",
|
"@types/prismjs": "^1.26.0",
|
||||||
"@types/rtlcss": "^3.1.2",
|
"@types/rtlcss": "^3.1.2",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"react-test-renderer": "^17.0.2",
|
"react-test-renderer": "^17.0.2",
|
||||||
"utility-types": "^3.10.0"
|
"utility-types": "^3.10.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
"@docusaurus/core": "2.0.0-beta.15",
|
"@docusaurus/core": "2.0.0-beta.15",
|
||||||
"@docusaurus/types": "2.0.0-beta.15",
|
"@docusaurus/types": "2.0.0-beta.15",
|
||||||
"@testing-library/react-hooks": "^7.0.2",
|
"@testing-library/react-hooks": "^7.0.2",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
"@docusaurus/utils-validation": "2.0.0-beta.15",
|
||||||
"@philpl/buble": "^0.19.7",
|
"@philpl/buble": "^0.19.7",
|
||||||
"clsx": "^1.1.1",
|
"clsx": "^1.1.1",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"react-live": "2.2.3",
|
"react-live": "2.2.3",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"build:format": "prettier --config ../../.prettierrc --write \"lib/**/*.js\""
|
"build:format": "prettier --config ../../.prettierrc --write \"lib/**/*.js\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docsearch/react": "^3.0.0-alpha.50",
|
"@docsearch/react": "^3.0.0",
|
||||||
"@docusaurus/core": "2.0.0-beta.15",
|
"@docusaurus/core": "2.0.0-beta.15",
|
||||||
"@docusaurus/logger": "2.0.0-beta.15",
|
"@docusaurus/logger": "2.0.0-beta.15",
|
||||||
"@docusaurus/theme-common": "2.0.0-beta.15",
|
"@docusaurus/theme-common": "2.0.0-beta.15",
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
"algoliasearch-helper": "^3.7.0",
|
"algoliasearch-helper": "^3.7.0",
|
||||||
"clsx": "^1.1.1",
|
"clsx": "^1.1.1",
|
||||||
"eta": "^1.12.3",
|
"eta": "^1.12.3",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"tslib": "^2.3.1",
|
"tslib": "^2.3.1",
|
||||||
"utility-types": "^3.10.0"
|
"utility-types": "^3.10.0"
|
||||||
|
|
|
@ -27,6 +27,7 @@ describe('validateThemeConfig', () => {
|
||||||
const algolia = {
|
const algolia = {
|
||||||
indexName: 'index',
|
indexName: 'index',
|
||||||
apiKey: 'apiKey',
|
apiKey: 'apiKey',
|
||||||
|
appId: 'BH4D9OD16A',
|
||||||
};
|
};
|
||||||
expect(testValidateThemeConfig({algolia})).toEqual({
|
expect(testValidateThemeConfig({algolia})).toEqual({
|
||||||
algolia: {
|
algolia: {
|
||||||
|
@ -41,6 +42,7 @@ describe('validateThemeConfig', () => {
|
||||||
indexName: 'index',
|
indexName: 'index',
|
||||||
apiKey: 'apiKey',
|
apiKey: 'apiKey',
|
||||||
unknownKey: 'unknownKey',
|
unknownKey: 'unknownKey',
|
||||||
|
appId: 'BH4D9OD16A',
|
||||||
};
|
};
|
||||||
expect(testValidateThemeConfig({algolia})).toEqual({
|
expect(testValidateThemeConfig({algolia})).toEqual({
|
||||||
algolia: {
|
algolia: {
|
||||||
|
@ -67,15 +69,8 @@ describe('validateThemeConfig', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('empty config', () => {
|
|
||||||
const algolia = {};
|
|
||||||
expect(() =>
|
|
||||||
testValidateThemeConfig({algolia}),
|
|
||||||
).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('missing indexName config', () => {
|
test('missing indexName config', () => {
|
||||||
const algolia = {apiKey: 'apiKey'};
|
const algolia = {apiKey: 'apiKey', appId: 'BH4D9OD16A'};
|
||||||
expect(() =>
|
expect(() =>
|
||||||
testValidateThemeConfig({algolia}),
|
testValidateThemeConfig({algolia}),
|
||||||
).toThrowErrorMatchingInlineSnapshot(
|
).toThrowErrorMatchingInlineSnapshot(
|
||||||
|
@ -84,14 +79,24 @@ describe('validateThemeConfig', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('missing apiKey config', () => {
|
test('missing apiKey config', () => {
|
||||||
const algolia = {indexName: 'indexName'};
|
const algolia = {indexName: 'indexName', appId: 'BH4D9OD16A'};
|
||||||
expect(() =>
|
expect(() =>
|
||||||
testValidateThemeConfig({algolia}),
|
testValidateThemeConfig({algolia}),
|
||||||
).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
|
).toThrowErrorMatchingInlineSnapshot(`"\\"algolia.apiKey\\" is required"`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('missing appId config', () => {
|
||||||
|
const algolia = {indexName: 'indexName', apiKey: 'apiKey'};
|
||||||
|
expect(() =>
|
||||||
|
testValidateThemeConfig({algolia}),
|
||||||
|
).toThrowErrorMatchingInlineSnapshot(
|
||||||
|
`"\\"algolia.appId\\" is required. If you haven't migrated to the new DocSearch infra, please refer to the blog post for instructions: https://docusaurus.io/blog/2021/11/21/algolia-docsearch-migration"`,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
test('contextualSearch config', () => {
|
test('contextualSearch config', () => {
|
||||||
const algolia = {
|
const algolia = {
|
||||||
|
appId: 'BH4D9OD16A',
|
||||||
indexName: 'index',
|
indexName: 'index',
|
||||||
apiKey: 'apiKey',
|
apiKey: 'apiKey',
|
||||||
contextualSearch: true,
|
contextualSearch: true,
|
||||||
|
@ -106,6 +111,7 @@ describe('validateThemeConfig', () => {
|
||||||
|
|
||||||
test('externalUrlRegex config', () => {
|
test('externalUrlRegex config', () => {
|
||||||
const algolia = {
|
const algolia = {
|
||||||
|
appId: 'BH4D9OD16A',
|
||||||
indexName: 'index',
|
indexName: 'index',
|
||||||
apiKey: 'apiKey',
|
apiKey: 'apiKey',
|
||||||
externalUrlRegex: 'http://external-domain.com',
|
externalUrlRegex: 'http://external-domain.com',
|
||||||
|
@ -120,6 +126,7 @@ describe('validateThemeConfig', () => {
|
||||||
|
|
||||||
test('searchParameters.facetFilters search config', () => {
|
test('searchParameters.facetFilters search config', () => {
|
||||||
const algolia = {
|
const algolia = {
|
||||||
|
appId: 'BH4D9OD16A',
|
||||||
indexName: 'index',
|
indexName: 'index',
|
||||||
apiKey: 'apiKey',
|
apiKey: 'apiKey',
|
||||||
searchParameters: {
|
searchParameters: {
|
||||||
|
|
|
@ -13,10 +13,6 @@ export const DEFAULT_CONFIG = {
|
||||||
// see also https://github.com/facebook/docusaurus/issues/5880
|
// see also https://github.com/facebook/docusaurus/issues/5880
|
||||||
contextualSearch: true,
|
contextualSearch: true,
|
||||||
|
|
||||||
// By default, all Docusaurus sites are using the same AppId
|
|
||||||
// This has been designed on purpose with Algolia.
|
|
||||||
appId: 'BH4D9OD16A',
|
|
||||||
|
|
||||||
searchParameters: {},
|
searchParameters: {},
|
||||||
searchPagePath: 'search',
|
searchPagePath: 'search',
|
||||||
};
|
};
|
||||||
|
@ -27,7 +23,10 @@ export const Schema = Joi.object({
|
||||||
contextualSearch: Joi.boolean().default(DEFAULT_CONFIG.contextualSearch),
|
contextualSearch: Joi.boolean().default(DEFAULT_CONFIG.contextualSearch),
|
||||||
externalUrlRegex: Joi.string().optional(),
|
externalUrlRegex: Joi.string().optional(),
|
||||||
// Algolia attributes
|
// Algolia attributes
|
||||||
appId: Joi.string().default(DEFAULT_CONFIG.appId),
|
appId: Joi.string().required().messages({
|
||||||
|
'any.required':
|
||||||
|
'"algolia.appId" is required. If you haven\'t migrated to the new DocSearch infra, please refer to the blog post for instructions: https://docusaurus.io/blog/2021/11/21/algolia-docsearch-migration',
|
||||||
|
}),
|
||||||
apiKey: Joi.string().required(),
|
apiKey: Joi.string().required(),
|
||||||
indexName: Joi.string().required(),
|
indexName: Joi.string().required(),
|
||||||
searchParameters: Joi.object()
|
searchParameters: Joi.object()
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"update": "node ./update.js"
|
"update": "node ./update.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"@docusaurus/logger": "2.0.0-beta.15",
|
"@docusaurus/logger": "2.0.0-beta.15",
|
||||||
"@svgr/webpack": "^6.0.0",
|
"@svgr/webpack": "^6.0.0",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"github-slugger": "^1.4.0",
|
"github-slugger": "^1.4.0",
|
||||||
"globby": "^11.0.4",
|
"globby": "^11.0.4",
|
||||||
"gray-matter": "^4.0.3",
|
"gray-matter": "^4.0.3",
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
"autoprefixer": "^10.4.2",
|
"autoprefixer": "^10.4.2",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-plugin-dynamic-import-node": "2.3.0",
|
"babel-plugin-dynamic-import-node": "2.3.0",
|
||||||
"boxen": "^5.1.2",
|
"boxen": "^6.2.1",
|
||||||
"chokidar": "^3.5.3",
|
"chokidar": "^3.5.3",
|
||||||
"clean-css": "^5.2.4",
|
"clean-css": "^5.2.4",
|
||||||
"combine-promises": "^1.1.0",
|
"combine-promises": "^1.1.0",
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"eta": "^1.12.3",
|
"eta": "^1.12.3",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.1",
|
||||||
"html-minifier-terser": "^6.1.0",
|
"html-minifier-terser": "^6.1.0",
|
||||||
"html-tags": "^3.1.0",
|
"html-tags": "^3.1.0",
|
||||||
"html-webpack-plugin": "^5.5.0",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"directory": "packages/stylelint-copyright"
|
"directory": "packages/stylelint-copyright"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"stylelint": "^14.5.0"
|
"stylelint": "^14.5.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,8 @@ module.exports = {
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
image: 'img/docusaurus-soc.png',
|
image: 'img/docusaurus-soc.png',
|
||||||
algolia: {
|
algolia: {
|
||||||
apiKey: '47ecd3b21be71c5822571b9f59e52544',
|
appId: 'X1Z85QJPUV',
|
||||||
|
apiKey: 'bf7211c161e8205da2f933a02534105a',
|
||||||
indexName: 'docusaurus-2',
|
indexName: 'docusaurus-2',
|
||||||
contextualSearch: true,
|
contextualSearch: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -94,7 +94,6 @@ const config = {
|
||||||
loader: require.resolve('esbuild-loader'),
|
loader: require.resolve('esbuild-loader'),
|
||||||
options: {
|
options: {
|
||||||
loader: 'tsx',
|
loader: 'tsx',
|
||||||
format: isServer ? 'cjs' : undefined,
|
|
||||||
target: isServer ? 'node12' : 'es2017',
|
target: isServer ? 'node12' : 'es2017',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
"axios": "^0.26.0",
|
"axios": "^0.26.0",
|
||||||
"clsx": "^1.1.1",
|
"clsx": "^1.1.1",
|
||||||
"color": "^4.2.1",
|
"color": "^4.2.1",
|
||||||
"esbuild-loader": "2.16.0",
|
"esbuild-loader": "2.18.0",
|
||||||
"netlify-plugin-cache": "^1.0.3",
|
"netlify-plugin-cache": "^1.0.3",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
|
@ -56,8 +56,8 @@
|
||||||
"rehype-katex": "^6.0.2",
|
"rehype-katex": "^6.0.2",
|
||||||
"remark-math": "^3.0.1",
|
"remark-math": "^3.0.1",
|
||||||
"unist-util-visit": "^2.0.2",
|
"unist-util-visit": "^2.0.2",
|
||||||
"workbox-routing": "^6.4.2",
|
"workbox-routing": "^6.5.0",
|
||||||
"workbox-strategies": "^6.4.2"
|
"workbox-strategies": "^6.5.0"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
|
@ -73,8 +73,8 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/docusaurus": "^1.0.4",
|
"@tsconfig/docusaurus": "^1.0.4",
|
||||||
"@types/jest": "^27.4.0",
|
"@types/jest": "^27.4.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"fs-extra": "^10.0.0"
|
"fs-extra": "^10.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue