Skip to content

Commit 2dfb3ba

Browse files
Upgrade deps and fix build (#99)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 414f3be commit 2dfb3ba

File tree

18 files changed

+20227
-14450
lines changed

18 files changed

+20227
-14450
lines changed

.changeset/beige-numbers-flow.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'docusaurus-plugin-redoc': patch
3+
'docusaurus-theme-redoc': patch
4+
'redocusaurus': patch
5+
'redocusaurus-website': patch
6+
---
7+
8+
Upgrade dependencies and fix build

.github/workflows/build.yml

+2-15
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,8 @@ jobs:
1616

1717
- uses: actions/setup-node@v2
1818
with:
19-
node-version: '12'
20-
21-
- name: Get yarn cache directory path
22-
id: yarn-cache-dir-path
23-
run: echo "::set-output name=dir::$(yarn cache dir)"
24-
25-
- name: Cache node_modules
26-
uses: actions/cache@v2
27-
env:
28-
cache-name: cache-node-modules
29-
with:
30-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
31-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-yarn-
19+
node-version: '16'
20+
cache: 'yarn'
3421

3522
- name: Install Dependencies 📦
3623
run: |

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
- name: Checkout Repo
1414
uses: actions/checkout@master
1515

16-
- name: Setup Node.js 12.x
17-
uses: actions/setup-node@master
16+
- uses: actions/setup-node@v2
1817
with:
19-
node-version: 12.x
18+
node-version: '16'
19+
cache: 'yarn'
2020
registry-url: https://registry.npmjs.org/
2121

2222
- name: Install Dependencies

.github/workflows/version.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1717
fetch-depth: 0
1818

19-
- name: Setup Node.js 12.x
20-
uses: actions/setup-node@master
19+
- uses: actions/setup-node@v2
2120
with:
22-
node-version: 12.x
21+
node-version: '16'
22+
cache: 'yarn'
2323

2424
- name: Install Dependencies
2525
run: yarn

.gitignore

+10-1
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,13 @@ yarn-error.log*
127127
static/openapi
128128
.redoc.json
129129
.tsbuild.info
130-
.tsbuild.jsx.info
130+
.tsbuild.jsx.info
131+
132+
# Yarn
133+
.yarn/*
134+
!.yarn/patches
135+
!.yarn/releases
136+
!.yarn/plugins
137+
!.yarn/sdks
138+
!.yarn/versions
139+
.pnp.*

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

+363
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

+9
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+28
Large diffs are not rendered by default.

.yarn/releases/yarn-3.1.0.cjs

+768
Large diffs are not rendered by default.

.yarnrc.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
5+
spec: "@yarnpkg/plugin-workspace-tools"
6+
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
7+
spec: "@yarnpkg/plugin-typescript"
8+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
9+
spec: "@yarnpkg/plugin-interactive-tools"
10+
11+
yarnPath: .yarn/releases/yarn-3.1.0.cjs

package.json

+30-29
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"name": "redocusaurus-monorepo",
33
"version": "0.0.0",
4-
"private": "true",
54
"description": "Redoc for DocusaurusV2",
65
"scripts": {
7-
"build": "lerna run build --ignore 'redocusaurus-website'",
8-
"build:website": "lerna run build --scope 'redocusaurus-website'",
9-
"clean": "lerna exec -- \"rm -rf dist* .tsbuild*.info\"",
10-
"dev": "lerna run --parallel dev --ignore redocusaurus-website",
11-
"dev:website": "lerna run --parallel dev --scope 'redocusaurus-website'",
6+
"build": "yarn workspaces foreach --exclude 'redocusaurus-website' -t run build",
7+
"build:website": "yarn workspace redocusaurus-website run build",
8+
"clean": "yarn workspaces foreach -A exec \"rm -rf dist* .tsbuild*.info\"",
9+
"dev": "yarn workspaces foreach --exclude redocusaurus-website -p run dev",
10+
"dev:website": "yarn workspace redocusaurus-website run dev",
1211
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
1312
"lint:fix": "yarn lint --fix",
1413
"release": "yarn build && changeset publish",
15-
"start": "yarn build && lerna run start --stream --scope redocusaurus-website",
16-
"test": "echo \"Error: no test specified\" && exit 1"
14+
"start": "yarn build && yarn workspace redocusaurus-website run start",
15+
"test": "echo \"Error: no test specified\" && exit 1",
16+
"prepare": "husky install"
1717
},
1818
"repository": {
1919
"type": "git",
@@ -37,26 +37,26 @@
3737
"react-dom": "^17.0.0"
3838
},
3939
"devDependencies": {
40-
"@changesets/changelog-github": "^0.2.8",
41-
"@changesets/cli": "^2.16.0",
42-
"@types/node": "^14.14.21",
43-
"@types/react": "^17.0.0",
44-
"@typescript-eslint/eslint-plugin": "^4.16.1",
45-
"@typescript-eslint/parser": "^4.16.1",
46-
"concurrently": "^6.2.0",
47-
"eslint": "^7.23.0",
48-
"eslint-config-airbnb-typescript": "^12.3.1",
49-
"eslint-config-prettier": "^8.1.0",
50-
"eslint-plugin-import": "^2.22.1",
51-
"eslint-plugin-jsx-a11y": "^6.4.1",
52-
"eslint-plugin-prettier": "^3.3.1",
53-
"eslint-plugin-react": "^7.23.1",
54-
"eslint-plugin-react-hooks": "^4.2.0",
55-
"husky": "^4.2.5",
40+
"@changesets/changelog-github": "^0.4.1",
41+
"@changesets/cli": "^2.18.0",
42+
"@types/node": "^16.9.6",
43+
"@types/react": "^17.0.24",
44+
"@typescript-eslint/eslint-plugin": "^4.31.2",
45+
"@typescript-eslint/parser": "^4.31.2",
46+
"concurrently": "^6.4.0",
47+
"eslint": "^7.32.0",
48+
"eslint-config-airbnb-typescript": "^14.0.0",
49+
"eslint-config-prettier": "^8.3.0",
50+
"eslint-plugin-import": "^2.25.3",
51+
"eslint-plugin-jsx-a11y": "^6.5.1",
52+
"eslint-plugin-prettier": "^4.0.0",
53+
"eslint-plugin-react": "^7.27.0",
54+
"eslint-plugin-react-hooks": "^4.3.0",
55+
"husky": "^7.0.4",
5656
"lerna": "^4.0.0",
57-
"lint-staged": "^10.5.4",
58-
"prettier": "2.2.1",
59-
"typescript": "^4.1.3"
57+
"lint-staged": "^11.2.6",
58+
"prettier": "2.4.1",
59+
"typescript": "^4.4.3"
6060
},
6161
"engines": {
6262
"node": ">=10.15.1"
@@ -69,7 +69,7 @@
6969
},
7070
"husky": {
7171
"hooks": {
72-
"pre-commit": "npx lint-staged"
72+
"pre-commit": "yarn lint-staged"
7373
}
7474
},
7575
"lint-staged": {
@@ -81,5 +81,6 @@
8181
"singleQuote": true,
8282
"printWidth": 80,
8383
"tabWidth": 2
84-
}
84+
},
85+
"packageManager": "yarn@3.1.0"
8586
}

packages/docusaurus-plugin-redoc/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Redoc Plugin for DocusaurusV2",
55
"main": "dist/index.js",
66
"scripts": {
7-
"build": "tsc",
7+
"build": "tsc && echo \"built plugin\"",
88
"dev": "tsc -w",
99
"prepublish": "rm -rf .tsbuild.info",
1010
"test": "echo \"Error: no test specified\" && exit 1"
@@ -26,9 +26,9 @@
2626
},
2727
"homepage": "https://github.com/rohit-gohri/redocusaurus#readme",
2828
"dependencies": {
29-
"@docusaurus/types": "^2.0.0-beta.5",
30-
"@docusaurus/utils": "^2.0.0-beta.5",
31-
"joi": "^17.2.1",
29+
"@docusaurus/types": "^2.0.0-beta.9",
30+
"@docusaurus/utils": "^2.0.0-beta.9",
31+
"joi": "^17.4.2",
3232
"yaml": "^1.10.0"
3333
},
3434
"engines": {
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
echo "copying"
3+
4+
cd src
5+
6+
yarn copyfiles --verbose -e "./**/*.js" -e "./**/*.jsx" -e "./**/*.ts" -e "./**/*.tsx" "./**/*.*" ../dist/
7+
yarn copyfiles --verbose -e "./**/*.js" -e "./**/*.jsx" -e "./**/*.ts" -e "./**/*.tsx" "./**/*.*" ../dist-jsx/
8+
9+
echo "copied"

packages/docusaurus-theme-redoc/package.json

+13-14
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
"description": "Redoc Component for DocusaurusV2",
55
"main": "dist/index.js",
66
"scripts": {
7-
"_copy": "npx copyup -e \"./**/*.jsx\" -e \"./**/*.js\" -e \"./**/*.ts\" -e \"./**/*.tsx\" \"./src/**/*.*\"",
8-
"copy": "yarn _copy ./dist && yarn _copy ./dist-jsx",
7+
"copy": "sh copy.sh",
98
"copy:watch": "nodemon --watch ./src/**/*.css -e css --exec \"yarn copy\"",
10-
"build": "tsc -p tsconfig.jsx.json && tsc",
11-
"postbuild": "yarn copy",
9+
"build": "tsc -p tsconfig.jsx.json && tsc && yarn copy && echo \"built theme\"",
1210
"dev": "concurrently 'tsc -w -p tsconfig.jsx.json' 'tsc -w' 'yarn copy:watch'",
1311
"prepublish": "rm -rf rm .tsbuild.info .tsbuild.jsx.info",
1412
"test": "echo \"Error: no test specified\" && exit 1"
@@ -30,23 +28,24 @@
3028
},
3129
"homepage": "https://github.com/rohit-gohri/redocusaurus#readme",
3230
"dependencies": {
33-
"@docusaurus/types": "^2.0.0-beta.5",
31+
"@docusaurus/types": "^2.0.0-beta.9",
3432
"clsx": "^1.1.1",
3533
"copyfiles": "^2.4.1",
3634
"lodash": "^4.17.21",
37-
"mobx": "^6.3.0",
38-
"node-polyfill-webpack-plugin": "^1.1.3",
39-
"redoc": "^2.0.0-rc.56",
40-
"styled-components": "^5.3.0",
35+
"mobx": "^6.3.7",
36+
"node-polyfill-webpack-plugin": "^1.1.4",
37+
"redoc": "^2.0.0-rc.57",
38+
"styled-components": "^5.3.3",
4139
"to-arraybuffer": "^1.0.1"
4240
},
4341
"devDependencies": {
44-
"@docusaurus/module-type-aliases": "^2.0.0-beta.5",
45-
"@docusaurus/theme-classic": "^2.0.0-beta.5",
46-
"@types/lodash": "^4.14.169",
42+
"@docusaurus/module-type-aliases": "^2.0.0-beta.9",
43+
"@docusaurus/theme-classic": "^2.0.0-beta.9",
44+
"@types/lodash": "^4.14.174",
4745
"@types/react-dom": "^17.0.5",
48-
"@types/react-router-dom": "^5.1.7",
49-
"@types/styled-components": "^5.1.9"
46+
"@types/react-router-dom": "^5.3.0",
47+
"@types/rtlcss": "^3.1.1",
48+
"@types/styled-components": "^5.1.14"
5049
},
5150
"engines": {
5251
"node": ">=10.15.1"

packages/docusaurus-theme-redoc/src/theme/ServerStyle/index.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
21
/**
32
* @see https://github.com/facebook/docusaurus/issues/3236#issuecomment-788953743
43
*/
54
import React from 'react';
6-
import { DocusaurusContextProvider } from '@docusaurus/docusaurusContext';
75
import { renderToString } from 'react-dom/server';
86
import { ServerStyleSheet } from 'styled-components';
97
import { StaticRouter, useLocation } from 'react-router-dom';
8+
import DocusaurusContext from '@docusaurus/context';
9+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
1010

11-
function ServerStyle({ from: children }: { from: React.Component }) {
12-
let style = null;
11+
interface Props {
12+
from: React.Component;
13+
}
14+
15+
const ServerStyle: React.FC<Props> = ({ from: children }) => {
16+
let style: any = null;
1317

1418
const location = useLocation();
19+
const context = useDocusaurusContext();
1520
const sheet = new ServerStyleSheet();
1621

1722
try {
1823
renderToString(
1924
sheet.collectStyles(
2025
<StaticRouter location={location}>
21-
<DocusaurusContextProvider>{children}</DocusaurusContextProvider>
26+
<DocusaurusContext.Provider>{children}</DocusaurusContext.Provider>
2227
</StaticRouter>,
2328
),
2429
);
@@ -30,7 +35,7 @@ function ServerStyle({ from: children }: { from: React.Component }) {
3035
}
3136

3237
return style;
33-
}
38+
};
3439

3540
function ClientStyle() {
3641
return null;

packages/redocusaurus/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"./theme": "./dist/theme.js"
1010
},
1111
"scripts": {
12-
"build": "tsc",
12+
"build": "tsc && echo \"built preset\"",
1313
"dev": "tsc -w",
1414
"prepublish": "rm -rf .tsbuild.info",
1515
"test": "echo \"Error: no test specified\" && exit 1"
@@ -31,7 +31,7 @@
3131
},
3232
"homepage": "https://github.com/rohit-gohri/redocusaurus#readme",
3333
"dependencies": {
34-
"@docusaurus/types": "^2.0.0-beta.5",
34+
"@docusaurus/types": "^2.0.0-beta.9",
3535
"docusaurus-plugin-redoc": "^0.5.0-next.0",
3636
"docusaurus-theme-redoc": "^0.5.0-next.0"
3737
},

website/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "redocusaurus-website",
33
"version": "0.0.0",
4-
"private": "true",
54
"homepage": "https://github.com/rohit-gohri/redocusaurus",
65
"bugs": {
76
"url": "https://github.com/rohit-gohri/redocusaurus/issues"
@@ -21,15 +20,15 @@
2120
"serve": "docusaurus serve"
2221
},
2322
"dependencies": {
24-
"@docusaurus/core": "^2.0.0-beta.5",
25-
"@docusaurus/preset-classic": "^2.0.0-beta.5",
23+
"@docusaurus/core": "^2.0.0-beta.9",
24+
"@docusaurus/preset-classic": "^2.0.0-beta.9",
2625
"clsx": "^1.1.1",
2726
"react": "^17.0.1",
2827
"react-dom": "^17.0.1",
2928
"redocusaurus": "^0.5.0-next.0"
3029
},
3130
"devDependencies": {
32-
"@types/react": "^17.0.0"
31+
"@types/react": "^17.0.24"
3332
},
3433
"browserslist": {
3534
"production": [

0 commit comments

Comments
 (0)