Skip to content

Commit

Permalink
refactor(v2): TS config update: reduce the size of npm modules (#4375)
Browse files Browse the repository at this point in the history
* feat(v2): Reduce the size of the npm modules

Signed-off-by: Reece Dunham <[email protected]>

* Fix conflicts

* Update search.js

Co-authored-by: slorber <[email protected]>
  • Loading branch information
RDIL and slorber authored Mar 17, 2021
1 parent b99a403 commit 76c0b11
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 22 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"rimraf": "^3.0.2",
"serve": "^11.3.2",
"stylelint": "^13.10.0",
"typescript": "^3.9.5"
"tslib": "^2.1.0",
"typescript": "^4.1.5"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-mdx-loader/src/remark/toc/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-client-redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-ideal-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-theme-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-utils-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/src/client/prefetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 8 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"target": "es2017",
"target": "ES2019",
"module": "commonjs",
"lib": ["es2017","es2019.array", "DOM"],
"lib": ["ESNext", "DOM"],
"declaration": true,
"declarationMap": true,
"declarationMap": false,
"jsx": "react",

/* Strict Type-Checking Options */
Expand All @@ -30,7 +30,11 @@
"esModuleInterop": true,

/* Advanced Options */
"resolveJsonModule": true
"resolveJsonModule": true,

/* Use tslib */
"importHelpers": true,
"noEmitHelpers": true,
},
"exclude": ["node_modules", "**/__tests__/**/*", "**/lib/**/*"]
}
12 changes: 6 additions & 6 deletions website/docs/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

``` bash
quant init
```
```bash
quant init
```

4. Deploy your site

``` bash
quant deploy
```
```bash
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.
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19834,11 +19834,16 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^3.8.3, typescript@^3.9.5:
typescript@^3.8.3:
version "3.9.7"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
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:
version "0.7.21"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"
Expand Down

0 comments on commit 76c0b11

Please sign in to comment.