mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 02:37:59 +02:00
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:
parent
b99a4031c6
commit
76c0b11632
20 changed files with 45 additions and 22 deletions
|
@ -122,7 +122,8 @@
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"serve": "^11.3.2",
|
"serve": "^11.3.2",
|
||||||
"stylelint": "^13.10.0",
|
"stylelint": "^13.10.0",
|
||||||
"typescript": "^3.9.5"
|
"tslib": "^2.1.0",
|
||||||
|
"typescript": "^4.1.5"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{js,jsx,ts,tsx}": [
|
"*.{js,jsx,ts,tsx}": [
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"prompts": "^2.4.0",
|
"prompts": "^2.4.0",
|
||||||
"semver": "^7.3.4",
|
"semver": "^7.3.4",
|
||||||
"shelljs": "^0.8.4"
|
"shelljs": "^0.8.4",
|
||||||
|
"tslib": "^2.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.13.0"
|
"node": ">=12.13.0"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
const toString = require('mdast-util-to-string');
|
const toString = require('mdast-util-to-string');
|
||||||
const visit = require('unist-util-visit');
|
const visit = require('unist-util-visit');
|
||||||
const {toValue} = require('../utils');
|
const toValue = require('../utils').toValue;
|
||||||
|
|
||||||
/** @typedef {import('@docusaurus/types').TOCItem} TOC */
|
/** @typedef {import('@docusaurus/types').TOCItem} TOC */
|
||||||
/** @typedef {import('unist').Node} Node */
|
/** @typedef {import('unist').Node} Node */
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
"remark-parse": "^8.0.2",
|
"remark-parse": "^8.0.2",
|
||||||
"remark-stringify": "^8.1.0",
|
"remark-stringify": "^8.1.0",
|
||||||
"semver": "^7.3.4",
|
"semver": "^7.3.4",
|
||||||
|
"tslib": "^2.1.0",
|
||||||
"unified": "^9.2.0",
|
"unified": "^9.2.0",
|
||||||
"unist-util-visit": "^2.0.2"
|
"unist-util-visit": "^2.0.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
"fs-extra": "^9.1.0",
|
"fs-extra": "^9.1.0",
|
||||||
"globby": "^11.0.2",
|
"globby": "^11.0.2",
|
||||||
"joi": "^17.4.0",
|
"joi": "^17.4.0",
|
||||||
"lodash": "^4.17.20"
|
"lodash": "^4.17.20",
|
||||||
|
"tslib": "^2.1.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^16.8.4 || ^17.0.0",
|
"react": "^16.8.4 || ^17.0.0",
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"reading-time": "^1.3.0",
|
"reading-time": "^1.3.0",
|
||||||
"remark-admonitions": "^1.2.1",
|
"remark-admonitions": "^1.2.1",
|
||||||
|
"tslib": "^2.1.0",
|
||||||
"webpack": "^4.44.1"
|
"webpack": "^4.44.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"remark-admonitions": "^1.2.1",
|
"remark-admonitions": "^1.2.1",
|
||||||
"shelljs": "^0.8.4",
|
"shelljs": "^0.8.4",
|
||||||
|
"tslib": "^2.1.0",
|
||||||
"utility-types": "^3.10.0",
|
"utility-types": "^3.10.0",
|
||||||
"webpack": "^4.44.1"
|
"webpack": "^4.44.1"
|
||||||
},
|
},
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
"minimatch": "^3.0.4",
|
"minimatch": "^3.0.4",
|
||||||
"remark-admonitions": "^1.2.1",
|
"remark-admonitions": "^1.2.1",
|
||||||
"slash": "^3.0.0",
|
"slash": "^3.0.0",
|
||||||
|
"tslib": "^2.1.0",
|
||||||
"webpack": "^4.44.1"
|
"webpack": "^4.44.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
"@docusaurus/core": "2.0.0-alpha.72",
|
"@docusaurus/core": "2.0.0-alpha.72",
|
||||||
"@docusaurus/types": "2.0.0-alpha.72",
|
"@docusaurus/types": "2.0.0-alpha.72",
|
||||||
"@docusaurus/utils": "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": {
|
"peerDependencies": {
|
||||||
"react": "^16.8.4 || ^17.0.0",
|
"react": "^16.8.4 || ^17.0.0",
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"@endiliey/responsive-loader": "^1.3.2",
|
"@endiliey/responsive-loader": "^1.3.2",
|
||||||
"react-waypoint": "^9.0.2",
|
"react-waypoint": "^9.0.2",
|
||||||
"sharp": "^0.27.1",
|
"sharp": "^0.27.1",
|
||||||
|
"tslib": "^2.1.0",
|
||||||
"webpack": "^4.44.1"
|
"webpack": "^4.44.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
"@docusaurus/utils": "2.0.0-alpha.72",
|
"@docusaurus/utils": "2.0.0-alpha.72",
|
||||||
"fs-extra": "^9.1.0",
|
"fs-extra": "^9.1.0",
|
||||||
"joi": "^17.4.0",
|
"joi": "^17.4.0",
|
||||||
"sitemap": "^6.3.6"
|
"sitemap": "^6.3.6",
|
||||||
|
"tslib": "^2.1.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^16.8.4 || ^17.0.0",
|
"react": "^16.8.4 || ^17.0.0",
|
||||||
|
|
|
@ -21,7 +21,7 @@ const prismIncludeLanguages = (PrismObject: typeof PrismNamespace): void => {
|
||||||
require(`prismjs/components/prism-${lang}`); // eslint-disable-line
|
require(`prismjs/components/prism-${lang}`); // eslint-disable-line
|
||||||
});
|
});
|
||||||
|
|
||||||
delete window.Prism;
|
delete (window as Window & {Prism?: typeof PrismNamespace}).Prism;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
"@docusaurus/plugin-content-blog": "2.0.0-alpha.72",
|
"@docusaurus/plugin-content-blog": "2.0.0-alpha.72",
|
||||||
"@docusaurus/plugin-content-docs": "2.0.0-alpha.72",
|
"@docusaurus/plugin-content-docs": "2.0.0-alpha.72",
|
||||||
"@docusaurus/plugin-content-pages": "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": {
|
"devDependencies": {
|
||||||
"@docusaurus/module-type-aliases": "2.0.0-alpha.72"
|
"@docusaurus/module-type-aliases": "2.0.0-alpha.72"
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/utils": "2.0.0-alpha.72",
|
"@docusaurus/utils": "2.0.0-alpha.72",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
"joi": "^17.4.0"
|
"joi": "^17.4.0",
|
||||||
|
"tslib": "^2.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.13.0"
|
"node": ">=12.13.0"
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
"fs-extra": "^9.1.0",
|
"fs-extra": "^9.1.0",
|
||||||
"gray-matter": "^4.0.2",
|
"gray-matter": "^4.0.2",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"resolve-pathname": "^3.0.0"
|
"resolve-pathname": "^3.0.0",
|
||||||
|
"tslib": "^2.1.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.13.0"
|
"node": ">=12.13.0"
|
||||||
|
|
|
@ -107,6 +107,7 @@
|
||||||
"shelljs": "^0.8.4",
|
"shelljs": "^0.8.4",
|
||||||
"std-env": "^2.2.1",
|
"std-env": "^2.2.1",
|
||||||
"terser-webpack-plugin": "^4.1.0",
|
"terser-webpack-plugin": "^4.1.0",
|
||||||
|
"tslib": "^2.1.0",
|
||||||
"update-notifier": "^5.1.0",
|
"update-notifier": "^5.1.0",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"wait-on": "^5.2.1",
|
"wait-on": "^5.2.1",
|
||||||
|
|
|
@ -43,7 +43,7 @@ function linkPrefetchStrategy(url: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function xhrPrefetchStrategy(url: string) {
|
function xhrPrefetchStrategy(url: string): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const req = new XMLHttpRequest();
|
const req = new XMLHttpRequest();
|
||||||
req.open('GET', url, true);
|
req.open('GET', url, true);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2017",
|
"target": "ES2019",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"lib": ["es2017","es2019.array", "DOM"],
|
"lib": ["ESNext", "DOM"],
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"declarationMap": true,
|
"declarationMap": false,
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
|
|
||||||
/* Strict Type-Checking Options */
|
/* Strict Type-Checking Options */
|
||||||
|
@ -30,7 +30,11 @@
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
||||||
/* Advanced Options */
|
/* Advanced Options */
|
||||||
"resolveJsonModule": true
|
"resolveJsonModule": true,
|
||||||
|
|
||||||
|
/* Use tslib */
|
||||||
|
"importHelpers": true,
|
||||||
|
"noEmitHelpers": true,
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "**/__tests__/**/*", "**/lib/**/*"]
|
"exclude": ["node_modules", "**/__tests__/**/*", "**/lib/**/*"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,14 +406,14 @@ You can deploy any other changes in the future with the command `surge`.
|
||||||
|
|
||||||
3. Initialize your project with `quant init` and fill in your credentials:
|
3. Initialize your project with `quant init` and fill in your credentials:
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
quant init
|
quant init
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Deploy your site
|
4. Deploy your site
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
quant deploy
|
quant deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
See [docs](https://docs.quantcdn.io/docs/cli/continuous-integration) and [blog](https://www.quantcdn.io/blog) for more examples and use cases for deploying to QuantCDN.
|
See [docs](https://docs.quantcdn.io/docs/cli/continuous-integration) and [blog](https://www.quantcdn.io/blog) for more examples and use cases for deploying to QuantCDN.
|
||||||
|
|
|
@ -19834,11 +19834,16 @@ typedarray@^0.0.6:
|
||||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||||
|
|
||||||
typescript@^3.8.3, typescript@^3.9.5:
|
typescript@^3.8.3:
|
||||||
version "3.9.7"
|
version "3.9.7"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
|
||||||
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
|
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
|
||||||
|
|
||||||
|
typescript@^4.1.5:
|
||||||
|
version "4.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
|
||||||
|
integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==
|
||||||
|
|
||||||
ua-parser-js@^0.7.18:
|
ua-parser-js@^0.7.18:
|
||||||
version "0.7.21"
|
version "0.7.21"
|
||||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"
|
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"
|
||||||
|
|
Loading…
Add table
Reference in a new issue