Skip to content

Commit f13448d

Browse files
lex111slorber
andauthored
chore(v2): upgrade dependencies + require Node 12 (#4223)
* chore(v2): upgrade dependencies * Set minimum Node.js version to 12.13 * Fix test * Upgrade copy-text-to-clipboard * Bump Node versions * Update .nvmrc * mark cacheTime as forbidded field * Downgrade jest to v25.2.7 * Increase Node version for Windows CI * Test fix * Attempt to fix Windows CI * Downgrade execa * fix async test errors * Upgrade execa Co-authored-by: slorber <[email protected]>
1 parent 02f7722 commit f13448d

File tree

49 files changed

+2104
-1847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2104
-1847
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ aliases:
2626
defaults: &defaults
2727
working_directory: ~/docusaurus
2828
docker:
29-
- image: circleci/node:10
29+
- image: circleci/node:12
3030
resource_class: large
3131

3232
version: 2

.github/workflows/canary-releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
node-version: [10.x]
28+
node-version: [12.x]
2929
steps:
3030
- uses: actions/checkout@v2
3131
- name: Use Node.js ${{ matrix.node-version }}

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node: ['10']
16+
node: ['12']
1717
steps:
1818
- uses: actions/checkout@v2
1919
- name: Use Node.js ${{ matrix.node }}

.github/workflows/migration-cli-e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
node: ['10']
26+
node: ['12']
2727
steps:
2828
- uses: actions/checkout@v2
2929
- name: Use Node.js ${{ matrix.node }}

.github/workflows/nodejs-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: windows-latest
1111
strategy:
1212
matrix:
13-
node: ['10']
13+
node: ['12']
1414
steps:
1515
- uses: actions/checkout@v2
1616
- uses: dorny/paths-filter@v2

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged --allow-empty

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.15.1
1+
12.13.0

package.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
"canary:bumpVersion": "yarn lerna version 2.0.0-alpha.`git rev-parse --short HEAD` --exact --no-push --yes",
3737
"canary:publish": "yarn lerna publish from-package --dist-tag canary --yes --no-verify-access",
3838
"changelog": "lerna-changelog",
39-
"postinstall": "yarn lock:update && yarn build:packages",
39+
"postinstall": "run-p postinstall:**",
40+
"postinstall:main": "yarn lock:update && yarn build:packages",
41+
"postinstall:dev": "is-ci || husky install",
4042
"prettier": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx}\"",
4143
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx}\"",
4244
"prettier-docs": "prettier --config .prettierrc --write \"**/*.md\"",
@@ -62,16 +64,16 @@
6264
"lock:update": "npx yarn-deduplicate"
6365
},
6466
"devDependencies": {
65-
"@babel/cli": "^7.12.1",
66-
"@babel/core": "^7.12.3",
67-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
68-
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
69-
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
70-
"@babel/preset-typescript": "^7.12.1",
71-
"@crowdin/cli": "^3.5.2",
67+
"@babel/cli": "^7.12.16",
68+
"@babel/core": "^7.12.16",
69+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
70+
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
71+
"@babel/plugin-transform-modules-commonjs": "^7.12.13",
72+
"@babel/preset-typescript": "^7.12.16",
73+
"@crowdin/cli": "^3.5.3",
7274
"@types/express": "^4.17.2",
7375
"@types/fs-extra": "^9.0.6",
74-
"@types/jest": "^25.2.1",
76+
"@types/jest": "^26.0.20",
7577
"@types/loader-utils": "^1.1.3",
7678
"@types/lodash.camelcase": "^4.3.6",
7779
"@types/lodash.flatmap": "^4.5.6",
@@ -86,7 +88,7 @@
8688
"@types/node": "^14.14.22",
8789
"@types/prismjs": "^1.16.2",
8890
"@types/prompts": "^2.0.9",
89-
"@types/react": "^16.9.52",
91+
"@types/react": "^17.0.2",
9092
"@types/react-dev-utils": "^9.0.1",
9193
"@types/react-helmet": "^6.0.0",
9294
"@types/react-loadable": "^5.5.3",
@@ -102,7 +104,7 @@
102104
"babel-eslint": "^10.0.3",
103105
"concurrently": "^5.3.0",
104106
"cross-env": "^7.0.3",
105-
"eslint": "^7.13.0",
107+
"eslint": "^7.20.0",
106108
"eslint-config-airbnb": "^18.2.1",
107109
"eslint-config-prettier": "^6.15.0",
108110
"eslint-plugin-header": "^3.0.0",
@@ -111,19 +113,21 @@
111113
"eslint-plugin-react": "^7.21.5",
112114
"eslint-plugin-react-hooks": "^4.2.0",
113115
"glob": "^7.1.6",
114-
"husky": "^4.2.3",
115-
"jest": "^25.2.7",
116+
"husky": "^5.0.9",
117+
"is-ci": "^2.0.0",
118+
"jest": "^26.6.3",
116119
"lerna": "^3.22.1",
117120
"lerna-changelog": "^1.0.1",
118-
"lint-staged": "^10.1.2",
121+
"lint-staged": "^10.5.4",
119122
"netlify-cli": "^2.58.0",
120123
"nodemon": "^2.0.7",
121-
"prettier": "^2.0.2",
124+
"npm-run-all": "^4.1.5",
125+
"prettier": "^2.2.1",
122126
"react": "^17.0.1",
123127
"react-dom": "^17.0.1",
124128
"rimraf": "^3.0.2",
125129
"serve": "^11.3.2",
126-
"stylelint": "^13.2.1",
130+
"stylelint": "^13.10.0",
127131
"typescript": "^3.9.5"
128132
},
129133
"lint-staged": {
@@ -135,12 +139,7 @@
135139
"prettier --write"
136140
]
137141
},
138-
"husky": {
139-
"hooks": {
140-
"pre-commit": "lint-staged"
141-
}
142-
},
143142
"engines": {
144-
"node": ">=10.15.1"
143+
"node": ">=12.13.0"
145144
}
146145
}

packages/docusaurus-1.x/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module.exports = {
4242
'react/forbid-prop-types': OFF, // 1
4343
'react/require-default-props': OFF, // 1
4444
'jsx-a11y/control-has-associated-label': OFF, // 1
45+
'react/jsx-no-target-blank': OFF, // 1
4546
'react/jsx-props-no-spreading': OFF, // 2
4647
'max-classes-per-file': OFF, // 2
4748
'prefer-object-spread': OFF, // 5

packages/docusaurus-init/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"shelljs": "^0.8.4"
3232
},
3333
"engines": {
34-
"node": ">=10.15.1"
34+
"node": ">=12.13.0"
3535
}
3636
}

packages/docusaurus-mdx-loader/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
},
1717
"license": "MIT",
1818
"dependencies": {
19-
"@babel/parser": "^7.12.5",
20-
"@babel/traverse": "^7.12.5",
19+
"@babel/parser": "^7.12.16",
20+
"@babel/traverse": "^7.12.13",
2121
"@docusaurus/core": "2.0.0-alpha.70",
2222
"@docusaurus/utils": "2.0.0-alpha.70",
2323
"@mdx-js/mdx": "^1.6.21",
@@ -41,13 +41,13 @@
4141
"remark-mdx": "^1.6.21",
4242
"to-vfile": "^6.0.0",
4343
"unist-builder": "^2.0.3",
44-
"unist-util-remove-position": "^2.0.1"
44+
"unist-util-remove-position": "^3.0.0"
4545
},
4646
"peerDependencies": {
4747
"react": "^16.8.4 || ^17.0.0",
4848
"react-dom": "^16.8.4 || ^17.0.0"
4949
},
5050
"engines": {
51-
"node": ">=10.15.1"
51+
"node": ">=12.13.0"
5252
}
5353
}

packages/docusaurus-migrate/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"docusaurus-migrate": "bin/index.js"
2424
},
2525
"dependencies": {
26-
"@babel/preset-env": "^7.1.6",
26+
"@babel/preset-env": "^7.12.16",
2727
"@mapbox/hast-util-to-jsx": "^1.0.0",
2828
"chalk": "^4.1.0",
2929
"color": "^3.1.3",

packages/docusaurus-migrate/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,9 @@ function migrateVersionedSidebar(
592592
acc: {[key: string]: Array<Record<string, unknown> | string>},
593593
val,
594594
) => {
595-
acc[val[0].replace(versionRegex, '')] = (val[1] as Array<
596-
any
597-
>).map((item) => {
595+
acc[
596+
val[0].replace(versionRegex, '')
597+
] = (val[1] as Array<any>).map((item) => {
598598
if (typeof item === 'string') {
599599
return item.replace(versionRegex, '');
600600
}

packages/docusaurus-plugin-client-redirects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"eta": "^1.11.0",
2626
"fs-extra": "^9.0.1",
2727
"globby": "^11.0.2",
28-
"joi": "^17.2.1",
28+
"joi": "^17.4.0",
2929
"lodash": "^4.17.20"
3030
},
3131
"peerDependencies": {

packages/docusaurus-plugin-content-blog/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"feed": "^4.2.2",
2828
"fs-extra": "^9.1.0",
2929
"globby": "^11.0.2",
30-
"joi": "^17.2.1",
30+
"joi": "^17.4.0",
3131
"loader-utils": "^1.2.3",
3232
"lodash": "^4.17.20",
3333
"reading-time": "^1.3.0",
@@ -39,6 +39,6 @@
3939
"react-dom": "^16.8.4 || ^17.0.0"
4040
},
4141
"engines": {
42-
"node": ">=10.15.1"
42+
"node": ">=12.13.0"
4343
}
4444
}

packages/docusaurus-plugin-content-docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
"@docusaurus/utils": "2.0.0-alpha.70",
3131
"@docusaurus/utils-validation": "2.0.0-alpha.70",
3232
"chalk": "^4.1.0",
33-
"execa": "^3.4.0",
33+
"execa": "^5.0.0",
3434
"fs-extra": "^9.1.0",
3535
"globby": "^11.0.2",
3636
"import-fresh": "^3.2.2",
37-
"joi": "^17.2.1",
37+
"joi": "^17.4.0",
3838
"loader-utils": "^1.2.3",
3939
"lodash": "^4.17.19",
4040
"lodash.flatmap": "^4.5.0",
@@ -52,6 +52,6 @@
5252
"react-dom": "^16.8.4 || ^17.0.0"
5353
},
5454
"engines": {
55-
"node": ">=10.15.1"
55+
"node": ">=12.13.0"
5656
}
5757
}

packages/docusaurus-plugin-content-docs/src/__tests__/lastUpdate.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ describe('lastUpdate', () => {
3838
);
3939
expect(await getFileLastUpdate(nonExistingFilePath)).toBeNull();
4040
expect(consoleMock).toHaveBeenCalledTimes(1);
41-
expect(consoleMock).toHaveBeenCalledWith(
42-
new Error(
43-
`Command failed with exit code 128: git log -1 --format=%ct, %an ${nonExistingFilePath}`,
44-
),
41+
expect(consoleMock.mock.calls[0][0].message).toContain(
42+
`Command failed with exit code 128: git log -1 --format=%ct, %an ${nonExistingFilePath}`,
4543
);
4644
expect(await getFileLastUpdate(null)).toBeNull();
4745
expect(await getFileLastUpdate(undefined)).toBeNull();

packages/docusaurus-plugin-content-pages/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@docusaurus/utils": "2.0.0-alpha.70",
2525
"@docusaurus/utils-validation": "2.0.0-alpha.70",
2626
"globby": "^11.0.2",
27-
"joi": "^17.2.1",
27+
"joi": "^17.4.0",
2828
"loader-utils": "^1.2.3",
2929
"lodash": "^4.17.19",
3030
"minimatch": "^3.0.4",
@@ -37,6 +37,6 @@
3737
"react-dom": "^16.8.4 || ^17.0.0"
3838
},
3939
"engines": {
40-
"node": ">=10.15.1"
40+
"node": ">=12.13.0"
4141
}
4242
}

packages/docusaurus-plugin-debug/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"@docusaurus/core": "2.0.0-alpha.70",
2121
"@docusaurus/types": "2.0.0-alpha.70",
2222
"@docusaurus/utils": "2.0.0-alpha.70",
23-
"react-json-view": "^1.20.4"
23+
"react-json-view": "^1.21.1"
2424
},
2525
"peerDependencies": {
2626
"react": "^16.8.4 || ^17.0.0",
2727
"react-dom": "^16.8.4 || ^17.0.0"
2828
},
2929
"engines": {
30-
"node": ">=10.15.1"
30+
"node": ">=12.13.0"
3131
}
3232
}

packages/docusaurus-plugin-google-analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"react-dom": "^16.8.4 || ^17.0.0"
2121
},
2222
"engines": {
23-
"node": ">=10.15.1"
23+
"node": ">=12.13.0"
2424
}
2525
}

packages/docusaurus-plugin-google-gtag/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"react-dom": "^16.8.4 || ^17.0.0"
2121
},
2222
"engines": {
23-
"node": ">=10.15.1"
23+
"node": ">=12.13.0"
2424
}
2525
}

packages/docusaurus-plugin-ideal-image/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
"react-dom": "^16.8.4 || ^17.0.0"
3535
},
3636
"engines": {
37-
"node": ">=10.15.1"
37+
"node": ">=12.13.0"
3838
}
3939
}

packages/docusaurus-plugin-pwa/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
},
1414
"license": "MIT",
1515
"dependencies": {
16-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
17-
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
18-
"@babel/preset-env": "^7.12.1",
16+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13",
17+
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
18+
"@babel/preset-env": "^7.12.16",
1919
"@docusaurus/core": "2.0.0-alpha.70",
20-
"babel-loader": "^8.2.1",
20+
"babel-loader": "^8.2.2",
2121
"clsx": "^1.1.1",
2222
"core-js": "^2.6.5",
23-
"joi": "^17.2.1",
23+
"joi": "^17.4.0",
2424
"terser-webpack-plugin": "^4.1.0",
2525
"webpack": "^4.44.1",
2626
"webpack-merge": "^4.2.2",
27-
"workbox-build": "^6.0.2",
28-
"workbox-precaching": "^6.0.2",
29-
"workbox-window": "^6.0.2"
27+
"workbox-build": "^6.1.0",
28+
"workbox-precaching": "^6.1.0",
29+
"workbox-window": "^6.1.0"
3030
},
3131
"peerDependencies": {
3232
"react": "^16.8.4 || ^17.0.0",

packages/docusaurus-plugin-sitemap/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"@docusaurus/types": "2.0.0-alpha.70",
2222
"@docusaurus/utils": "2.0.0-alpha.70",
2323
"fs-extra": "^9.1.0",
24-
"joi": "^17.2.1",
25-
"sitemap": "^3.2.2"
24+
"joi": "^17.4.0",
25+
"sitemap": "^6.3.6"
2626
},
2727
"peerDependencies": {
2828
"react": "^16.8.4 || ^17.0.0",
2929
"react-dom": "^16.8.4 || ^17.0.0"
3030
},
3131
"engines": {
32-
"node": ">=10.15.1"
32+
"node": ">=12.13.0"
3333
}
3434
}

0 commit comments

Comments
 (0)