mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 17:07:08 +02:00
chore: upgrade dependencies (#5608)
* chore: upgrade dependencies * Revert github-slugger * Fixes * Update snapshots * Update Babel deps
This commit is contained in:
parent
a52d499218
commit
b62a12bfc6
30 changed files with 783 additions and 882 deletions
18
package.json
18
package.json
|
@ -57,14 +57,14 @@
|
|||
"lock:update": "npx yarn-deduplicate"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.12.16",
|
||||
"@babel/cli": "^7.15.7",
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.13.10",
|
||||
"@babel/eslint-parser": "^7.15.7",
|
||||
"@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.6.4",
|
||||
"@crowdin/cli": "^3.7.0",
|
||||
"@formatjs/intl-datetimeformat": "^3.2.12",
|
||||
"@formatjs/intl-numberformat": "^6.2.2",
|
||||
"@formatjs/intl-pluralrules": "^4.0.11",
|
||||
|
@ -72,7 +72,7 @@
|
|||
"@types/express": "^4.17.2",
|
||||
"@types/fs-extra": "^9.0.6",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/loader-utils": "^2.0.2",
|
||||
"@types/loader-utils": "^2.0.3",
|
||||
"@types/lodash": "^4.14.168",
|
||||
"@types/node": "^14.14.22",
|
||||
"@types/prismjs": "^1.16.2",
|
||||
|
@ -88,7 +88,7 @@
|
|||
"@types/webpack-dev-server": "^3.11.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
||||
"@typescript-eslint/parser": "^4.18.0",
|
||||
"concurrently": "^5.3.0",
|
||||
"concurrently": "^6.2.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^7.20.0",
|
||||
"eslint-config-airbnb": "^18.2.1",
|
||||
|
@ -100,21 +100,21 @@
|
|||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"glob": "^7.1.6",
|
||||
"husky": "^5.0.9",
|
||||
"is-ci": "^2.0.0",
|
||||
"is-ci": "^3.0.0",
|
||||
"jest": "^26.6.3",
|
||||
"lerna": "^3.22.1",
|
||||
"lerna-changelog": "^1.0.1",
|
||||
"lint-staged": "^10.5.4",
|
||||
"netlify-cli": "^2.58.0",
|
||||
"nodemon": "^2.0.7",
|
||||
"nodemon": "^2.0.13",
|
||||
"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",
|
||||
"serve": "^12.0.1",
|
||||
"stylelint": "^13.10.0",
|
||||
"tslib": "^2.1.0",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "^4.1.5"
|
||||
},
|
||||
"lint-staged": {
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
"directory": "packages/docusaurus-cssnano-preset"
|
||||
},
|
||||
"dependencies": {
|
||||
"cssnano-preset-advanced": "^5.1.1",
|
||||
"postcss": "^8.2.15",
|
||||
"postcss-sort-media-queries": "^3.10.11"
|
||||
"cssnano-preset-advanced": "^5.1.4",
|
||||
"postcss": "^8.3.7",
|
||||
"postcss-sort-media-queries": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"to-vfile": "^6.0.0"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.1",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^5.1.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
@ -30,7 +30,7 @@
|
|||
"semver": "^7.3.4",
|
||||
"shelljs": "^0.8.4",
|
||||
"supports-color": "^8.1.1",
|
||||
"tslib": "^2.2.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"url-loader": "^4.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.13.10",
|
||||
"@babel/eslint-parser": "^7.15.7",
|
||||
"eslint": "^7.20.0",
|
||||
"eslint-config-airbnb": "^18.2.1",
|
||||
"eslint-config-prettier": "^6.15.0",
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"@mdx-js/mdx": "^1.6.21",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"chalk": "^4.1.1",
|
||||
"chalk": "^4.1.2",
|
||||
"escape-html": "^1.0.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"github-slugger": "^1.3.0",
|
||||
"github-slugger": "^1.4.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
"mdast-util-to-string": "^2.0.0",
|
||||
"remark-emoji": "^2.1.0",
|
||||
|
|
|
@ -23,28 +23,28 @@
|
|||
"docusaurus-migrate": "bin/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/preset-env": "^7.12.16",
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@mapbox/hast-util-to-jsx": "^1.0.0",
|
||||
"chalk": "^4.1.1",
|
||||
"color": "^3.1.3",
|
||||
"chalk": "^4.1.2",
|
||||
"color": "^4.0.1",
|
||||
"commander": "^5.1.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"glob": "^7.1.6",
|
||||
"glob": "^7.2.0",
|
||||
"hast-util-to-string": "^1.0.4",
|
||||
"hast-util-to-text": "^2.0.1",
|
||||
"html-tags": "^3.1.0",
|
||||
"import-fresh": "^3.2.2",
|
||||
"jscodeshift": "^0.11.0",
|
||||
"jscodeshift": "^0.13.0",
|
||||
"rehype-parse": "^7.0.1",
|
||||
"remark-parse": "^8.0.2",
|
||||
"remark-stringify": "^8.1.0",
|
||||
"semver": "^7.3.4",
|
||||
"tslib": "^2.2.0",
|
||||
"tslib": "^2.3.1",
|
||||
"unified": "^9.2.1",
|
||||
"unist-util-visit": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/color": "^3.0.1",
|
||||
"@types/jscodeshift": "^0.7.1"
|
||||
"@types/jscodeshift": "^0.11.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"@docusaurus/utils-common": "2.0.0-beta.6",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"chalk": "^4.1.1",
|
||||
"eta": "^1.11.0",
|
||||
"chalk": "^4.1.2",
|
||||
"eta": "^1.12.3",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "^11.0.2",
|
||||
"lodash": "^4.17.20",
|
||||
"tslib": "^2.2.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
|
|
|
@ -64,7 +64,7 @@ function validateCollectedRedirects(
|
|||
try {
|
||||
validateRedirect(redirect);
|
||||
return undefined;
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
return e.message;
|
||||
}
|
||||
})
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"chalk": "^4.1.1",
|
||||
"chalk": "^4.1.2",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"feed": "^4.2.2",
|
||||
"fs-extra": "^10.0.0",
|
||||
|
@ -31,9 +31,9 @@
|
|||
"js-yaml": "^4.0.0",
|
||||
"loader-utils": "^2.0.0",
|
||||
"lodash": "^4.17.20",
|
||||
"reading-time": "^1.3.0",
|
||||
"reading-time": "^1.5.0",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"tslib": "^2.2.0",
|
||||
"tslib": "^2.3.1",
|
||||
"webpack": "^5.40.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"chalk": "^4.1.1",
|
||||
"chalk": "^4.1.2",
|
||||
"combine-promises": "^1.1.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"execa": "^5.0.0",
|
||||
|
@ -38,11 +38,11 @@
|
|||
"globby": "^11.0.2",
|
||||
"import-fresh": "^3.2.2",
|
||||
"js-yaml": "^4.0.0",
|
||||
"loader-utils": "^1.2.3",
|
||||
"loader-utils": "^2.0.0",
|
||||
"lodash": "^4.17.20",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"shelljs": "^0.8.4",
|
||||
"tslib": "^2.2.0",
|
||||
"tslib": "^2.3.1",
|
||||
"utility-types": "^3.10.0",
|
||||
"webpack": "^5.40.0"
|
||||
},
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"globby": "^11.0.2",
|
||||
"lodash": "^4.17.20",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"tslib": "^2.1.0",
|
||||
"tslib": "^2.3.1",
|
||||
"webpack": "^5.40.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
"@docusaurus/core": "2.0.0-beta.6",
|
||||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"fs-extra": "^9.1.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"react-json-view": "^1.21.3",
|
||||
"tslib": "^2.1.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"fs-extra": "^9.1.0"
|
||||
"fs-extra": "^10.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-beta.6",
|
||||
|
@ -26,8 +26,8 @@
|
|||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"@endiliey/react-ideal-image": "^0.0.11",
|
||||
"react-waypoint": "^10.1.0",
|
||||
"sharp": "^0.28.2",
|
||||
"tslib": "^2.1.0",
|
||||
"sharp": "^0.29.1",
|
||||
"tslib": "^2.3.1",
|
||||
"webpack": "^5.40.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"dependencies": {
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
|
||||
"@babel/preset-env": "^7.12.16",
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@docusaurus/core": "2.0.0-beta.6",
|
||||
"@docusaurus/theme-common": "2.0.0-beta.6",
|
||||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"fs-extra": "^10.0.0",
|
||||
"sitemap": "^7.0.0",
|
||||
"tslib": "^2.2.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.4 || ^17.0.0",
|
||||
|
|
|
@ -34,20 +34,20 @@
|
|||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"@mdx-js/mdx": "^1.6.21",
|
||||
"@mdx-js/react": "^1.6.21",
|
||||
"chalk": "^4.1.1",
|
||||
"chalk": "^4.1.2",
|
||||
"clsx": "^1.1.1",
|
||||
"copy-text-to-clipboard": "^3.0.1",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "^11.0.2",
|
||||
"infima": "0.2.0-alpha.33",
|
||||
"lodash": "^4.17.20",
|
||||
"parse-numeric-range": "^1.2.0",
|
||||
"postcss": "^8.2.15",
|
||||
"parse-numeric-range": "^1.3.0",
|
||||
"postcss": "^8.3.7",
|
||||
"prism-react-renderer": "^1.2.1",
|
||||
"prismjs": "^1.23.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"rtlcss": "^3.1.2"
|
||||
"rtlcss": "^3.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.6",
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"clsx": "^1.1.1",
|
||||
"fs-extra": "^10.0.0",
|
||||
"tslib": "^2.1.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.0.0-beta.6",
|
||||
|
|
|
@ -26,7 +26,7 @@ function getBrowserStorage(
|
|||
} else {
|
||||
try {
|
||||
return window[storageType];
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
logOnceBrowserStorageNotAvailableWarning(e);
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"@philpl/buble": "^0.19.7",
|
||||
"clsx": "^1.1.1",
|
||||
"parse-numeric-range": "^1.2.0",
|
||||
"parse-numeric-range": "^1.3.0",
|
||||
"prism-react-renderer": "^1.2.1",
|
||||
"react-live": "2.2.3"
|
||||
},
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
"@docusaurus/theme-common": "2.0.0-beta.6",
|
||||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"algoliasearch": "^4.8.4",
|
||||
"algoliasearch-helper": "^3.3.4",
|
||||
"algoliasearch": "^4.10.5",
|
||||
"algoliasearch-helper": "^3.5.5",
|
||||
"clsx": "^1.1.1",
|
||||
"eta": "^1.12.1",
|
||||
"eta": "^1.12.3",
|
||||
"lodash": "^4.17.20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"commander": "^5.1.0",
|
||||
"joi": "^17.4.0",
|
||||
"joi": "^17.4.2",
|
||||
"querystring": "0.2.0",
|
||||
"webpack": "^5.40.0",
|
||||
"webpack-merge": "^5.8.0"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"tslib": "^2.2.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@docusaurus/utils": "2.0.0-beta.6",
|
||||
"chalk": "^4.1.1",
|
||||
"joi": "^17.4.0",
|
||||
"tslib": "^2.1.0"
|
||||
"chalk": "^4.1.2",
|
||||
"joi": "^17.4.2",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"dependencies": {
|
||||
"@docusaurus/types": "2.0.0-beta.6",
|
||||
"@types/github-slugger": "^1.3.0",
|
||||
"chalk": "^4.1.1",
|
||||
"chalk": "^4.1.2",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "^11.0.4",
|
||||
|
@ -28,7 +28,7 @@
|
|||
"lodash": "^4.17.20",
|
||||
"micromatch": "^4.0.4",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tslib": "^2.2.0"
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -183,7 +183,7 @@ export async function parseMarkdownFile(
|
|||
const markdownString = await fs.readFile(source, 'utf-8');
|
||||
try {
|
||||
return parseMarkdownString(markdownString, options);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
throw new Error(
|
||||
`Error while parsing Markdown file ${source}: "${e.message}".`,
|
||||
);
|
||||
|
|
|
@ -49,12 +49,12 @@
|
|||
"@babel/core": "^7.12.16",
|
||||
"@babel/generator": "^7.12.15",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||
"@babel/plugin-transform-runtime": "^7.12.15",
|
||||
"@babel/preset-env": "^7.12.16",
|
||||
"@babel/plugin-transform-runtime": "^7.15.0",
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@babel/preset-react": "^7.12.13",
|
||||
"@babel/preset-typescript": "^7.12.16",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@babel/runtime-corejs3": "^7.12.13",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@babel/runtime-corejs3": "^7.15.4",
|
||||
"@babel/traverse": "^7.12.13",
|
||||
"@docusaurus/cssnano-preset": "2.0.0-beta.6",
|
||||
"@docusaurus/react-loadable": "5.5.0",
|
||||
|
@ -64,27 +64,27 @@
|
|||
"@docusaurus/utils-validation": "2.0.0-beta.6",
|
||||
"@slorber/static-site-generator-webpack-plugin": "^4.0.0",
|
||||
"@svgr/webpack": "^5.5.0",
|
||||
"autoprefixer": "^10.2.5",
|
||||
"autoprefixer": "^10.3.5",
|
||||
"babel-loader": "^8.2.2",
|
||||
"babel-plugin-dynamic-import-node": "2.3.0",
|
||||
"boxen": "^5.0.1",
|
||||
"chalk": "^4.1.1",
|
||||
"chokidar": "^3.5.1",
|
||||
"chalk": "^4.1.2",
|
||||
"chokidar": "^3.5.2",
|
||||
"clean-css": "^5.1.5",
|
||||
"commander": "^5.1.0",
|
||||
"copy-webpack-plugin": "^9.0.0",
|
||||
"core-js": "^3.9.1",
|
||||
"copy-webpack-plugin": "^9.0.1",
|
||||
"core-js": "^3.18.0",
|
||||
"css-loader": "^5.1.1",
|
||||
"css-minimizer-webpack-plugin": "^3.0.1",
|
||||
"cssnano": "^5.0.4",
|
||||
"css-minimizer-webpack-plugin": "^3.0.2",
|
||||
"cssnano": "^5.0.8",
|
||||
"del": "^6.0.0",
|
||||
"detect-port": "^1.3.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"eta": "^1.12.1",
|
||||
"eta": "^1.12.3",
|
||||
"express": "^4.17.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"github-slugger": "^1.3.0",
|
||||
"github-slugger": "^1.4.0",
|
||||
"globby": "^11.0.2",
|
||||
"html-minifier-terser": "^5.1.1",
|
||||
"html-tags": "^3.1.0",
|
||||
|
@ -96,8 +96,8 @@
|
|||
"mini-css-extract-plugin": "^1.6.0",
|
||||
"module-alias": "^2.2.2",
|
||||
"nprogress": "^0.2.0",
|
||||
"postcss": "^8.2.15",
|
||||
"postcss-loader": "^5.3.0",
|
||||
"postcss": "^8.3.7",
|
||||
"postcss-loader": "^6.1.1",
|
||||
"prompts": "^2.4.1",
|
||||
"react-dev-utils": "^11.0.1",
|
||||
"react-error-overlay": "^6.0.9",
|
||||
|
@ -109,17 +109,17 @@
|
|||
"react-router-dom": "^5.2.0",
|
||||
"remark-admonitions": "^1.2.1",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"rtl-detect": "^1.0.3",
|
||||
"rtl-detect": "^1.0.4",
|
||||
"semver": "^7.3.4",
|
||||
"serve-handler": "^6.1.3",
|
||||
"shelljs": "^0.8.4",
|
||||
"std-env": "^2.2.1",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"tslib": "^2.2.0",
|
||||
"tslib": "^2.3.1",
|
||||
"update-notifier": "^5.1.0",
|
||||
"url-loader": "^4.1.1",
|
||||
"wait-on": "^5.3.0",
|
||||
"wait-on": "^6.0.0",
|
||||
"webpack": "^5.40.0",
|
||||
"webpack-bundle-analyzer": "^4.4.2",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
|
|
|
@ -22,39 +22,39 @@ describe('transformMarkdownHeadingLine', () => {
|
|||
|
||||
test('works for simple level-2 heading', () => {
|
||||
expect(transformMarkdownHeadingLine('## ABC', new GithubSlugger())).toEqual(
|
||||
'## ABC {#abc}',
|
||||
'## ABC {#-abc}',
|
||||
);
|
||||
});
|
||||
|
||||
test('works for simple level-3 heading', () => {
|
||||
expect(transformMarkdownHeadingLine('###ABC', new GithubSlugger())).toEqual(
|
||||
'###ABC {#abc}',
|
||||
);
|
||||
expect(
|
||||
transformMarkdownHeadingLine('### ABC', new GithubSlugger()),
|
||||
).toEqual('### ABC {#-abc}');
|
||||
});
|
||||
|
||||
test('works for simple level-4 heading', () => {
|
||||
expect(
|
||||
transformMarkdownHeadingLine('#### ABC', new GithubSlugger()),
|
||||
).toEqual('#### ABC {#abc}');
|
||||
).toEqual('#### ABC {#-abc}');
|
||||
});
|
||||
|
||||
test('works for simple level-2 heading', () => {
|
||||
expect(transformMarkdownHeadingLine('## ABC', new GithubSlugger())).toEqual(
|
||||
'## ABC {#abc}',
|
||||
'## ABC {#-abc}',
|
||||
);
|
||||
});
|
||||
|
||||
test('unwraps markdown links', () => {
|
||||
const input = `## hello [facebook](https://facebook.com) [crowdin](https://crowdin.com/translate/docusaurus-v2/126/en-fr?filter=basic&value=0)`;
|
||||
expect(transformMarkdownHeadingLine(input, new GithubSlugger())).toEqual(
|
||||
`${input} {#hello-facebook-crowdin}`,
|
||||
`${input} {#-hello-facebook-crowdin}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('can slugify complex headings', () => {
|
||||
const input = '## abc [Hello] How are you %Sébastien_-_$)( ## -56756';
|
||||
expect(transformMarkdownHeadingLine(input, new GithubSlugger())).toEqual(
|
||||
`${input} {#abc-hello-how-are-you-sébastien_-_---56756}`,
|
||||
`${input} {#-abc-hello-how-are-you-sébastien_-_---56756}`,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -99,15 +99,15 @@ describe('transformMarkdownContent', () => {
|
|||
|
||||
# Ignorerd title
|
||||
|
||||
## abc {#abc}
|
||||
## abc {#-abc}
|
||||
|
||||
### Hello world {#hello-world}
|
||||
### Hello world {#-hello-world}
|
||||
|
||||
\`\`\`
|
||||
# Heading in code block
|
||||
\`\`\`
|
||||
|
||||
## Hello world {#hello-world-1}
|
||||
## Hello world {#-hello-world-1}
|
||||
|
||||
\`\`\`
|
||||
# Heading in escaped code block
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"file-loader": "^6.2.0",
|
||||
"lodash": "^4.17.20",
|
||||
"node-vibrant": "^3.1.5",
|
||||
"sharp": "^0.28.2"
|
||||
"sharp": "^0.29.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0"
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.6",
|
||||
"@docusaurus/theme-live-codeblock": "2.0.0-beta.6",
|
||||
"clsx": "^1.1.1",
|
||||
"color": "^3.1.3",
|
||||
"color": "^4.0.1",
|
||||
"esbuild-loader": "2.13.1",
|
||||
"hast-util-is-element": "1.1.0",
|
||||
"netlify-plugin-cache": "^1.0.3",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue