refactor(v2): TS config update: reduce the size of npm modules (#4375)

* feat(v2): Reduce the size of the npm modules

Signed-off-by: Reece Dunham <me@rdil.rocks>

* Fix conflicts

* Update search.js

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Reece Dunham 2021-03-17 11:25:42 -04:00 committed by GitHub
parent b99a4031c6
commit 76c0b11632
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 45 additions and 22 deletions

View file

@ -28,7 +28,8 @@
"lodash": "^4.17.20",
"prompts": "^2.4.0",
"semver": "^7.3.4",
"shelljs": "^0.8.4"
"shelljs": "^0.8.4",
"tslib": "^2.1.0"
},
"engines": {
"node": ">=12.13.0"

View file

@ -9,7 +9,7 @@
const toString = require('mdast-util-to-string');
const visit = require('unist-util-visit');
const {toValue} = require('../utils');
const toValue = require('../utils').toValue;
/** @typedef {import('@docusaurus/types').TOCItem} TOC */
/** @typedef {import('unist').Node} Node */

View file

@ -39,6 +39,7 @@
"remark-parse": "^8.0.2",
"remark-stringify": "^8.1.0",
"semver": "^7.3.4",
"tslib": "^2.1.0",
"unified": "^9.2.0",
"unist-util-visit": "^2.0.2"
},

View file

@ -26,7 +26,8 @@
"fs-extra": "^9.1.0",
"globby": "^11.0.2",
"joi": "^17.4.0",
"lodash": "^4.17.20"
"lodash": "^4.17.20",
"tslib": "^2.1.0"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -32,6 +32,7 @@
"lodash": "^4.17.20",
"reading-time": "^1.3.0",
"remark-admonitions": "^1.2.1",
"tslib": "^2.1.0",
"webpack": "^4.44.1"
},
"peerDependencies": {

View file

@ -39,6 +39,7 @@
"lodash": "^4.17.20",
"remark-admonitions": "^1.2.1",
"shelljs": "^0.8.4",
"tslib": "^2.1.0",
"utility-types": "^3.10.0",
"webpack": "^4.44.1"
},

View file

@ -30,6 +30,7 @@
"minimatch": "^3.0.4",
"remark-admonitions": "^1.2.1",
"slash": "^3.0.0",
"tslib": "^2.1.0",
"webpack": "^4.44.1"
},
"peerDependencies": {

View file

@ -20,7 +20,8 @@
"@docusaurus/core": "2.0.0-alpha.72",
"@docusaurus/types": "2.0.0-alpha.72",
"@docusaurus/utils": "2.0.0-alpha.72",
"react-json-view": "^1.21.1"
"react-json-view": "^1.21.1",
"tslib": "^2.1.0"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -27,6 +27,7 @@
"@endiliey/responsive-loader": "^1.3.2",
"react-waypoint": "^9.0.2",
"sharp": "^0.27.1",
"tslib": "^2.1.0",
"webpack": "^4.44.1"
},
"peerDependencies": {

View file

@ -22,7 +22,8 @@
"@docusaurus/utils": "2.0.0-alpha.72",
"fs-extra": "^9.1.0",
"joi": "^17.4.0",
"sitemap": "^6.3.6"
"sitemap": "^6.3.6",
"tslib": "^2.1.0"
},
"peerDependencies": {
"react": "^16.8.4 || ^17.0.0",

View file

@ -21,7 +21,7 @@ const prismIncludeLanguages = (PrismObject: typeof PrismNamespace): void => {
require(`prismjs/components/prism-${lang}`); // eslint-disable-line
});
delete window.Prism;
delete (window as Window & {Prism?: typeof PrismNamespace}).Prism;
}
};

View file

@ -22,7 +22,8 @@
"@docusaurus/plugin-content-blog": "2.0.0-alpha.72",
"@docusaurus/plugin-content-docs": "2.0.0-alpha.72",
"@docusaurus/plugin-content-pages": "2.0.0-alpha.72",
"@docusaurus/types": "2.0.0-alpha.72"
"@docusaurus/types": "2.0.0-alpha.72",
"tslib": "^2.1.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-alpha.72"

View file

@ -20,7 +20,8 @@
"dependencies": {
"@docusaurus/utils": "2.0.0-alpha.72",
"chalk": "^4.1.0",
"joi": "^17.4.0"
"joi": "^17.4.0",
"tslib": "^2.1.0"
},
"engines": {
"node": ">=12.13.0"

View file

@ -25,7 +25,8 @@
"fs-extra": "^9.1.0",
"gray-matter": "^4.0.2",
"lodash": "^4.17.20",
"resolve-pathname": "^3.0.0"
"resolve-pathname": "^3.0.0",
"tslib": "^2.1.0"
},
"engines": {
"node": ">=12.13.0"

View file

@ -107,6 +107,7 @@
"shelljs": "^0.8.4",
"std-env": "^2.2.1",
"terser-webpack-plugin": "^4.1.0",
"tslib": "^2.1.0",
"update-notifier": "^5.1.0",
"url-loader": "^4.1.1",
"wait-on": "^5.2.1",

View file

@ -43,7 +43,7 @@ function linkPrefetchStrategy(url: string) {
});
}
function xhrPrefetchStrategy(url: string) {
function xhrPrefetchStrategy(url: string): Promise<void> {
return new Promise((resolve, reject) => {
const req = new XMLHttpRequest();
req.open('GET', url, true);