Skip to content

Commit

Permalink
Upgrade deps and fix build (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
rohit-gohri and dependabot[bot] authored Nov 13, 2021
1 parent 414f3be commit 2dfb3ba
Show file tree
Hide file tree
Showing 18 changed files with 20,227 additions and 14,450 deletions.
8 changes: 8 additions & 0 deletions .changeset/beige-numbers-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'docusaurus-plugin-redoc': patch
'docusaurus-theme-redoc': patch
'redocusaurus': patch
'redocusaurus-website': patch
---

Upgrade dependencies and fix build
17 changes: 2 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,8 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '12'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: '16'
cache: 'yarn'

- name: Install Dependencies 📦
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@master

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

- name: Install Dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 12.x
uses: actions/setup-node@master
- uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '16'
cache: 'yarn'

- name: Install Dependencies
run: yarn
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,13 @@ yarn-error.log*
static/openapi
.redoc.json
.tsbuild.info
.tsbuild.jsx.info
.tsbuild.jsx.info

# Yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
363 changes: 363 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.0.cjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.1.0.cjs
59 changes: 30 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "redocusaurus-monorepo",
"version": "0.0.0",
"private": "true",
"description": "Redoc for DocusaurusV2",
"scripts": {
"build": "lerna run build --ignore 'redocusaurus-website'",
"build:website": "lerna run build --scope 'redocusaurus-website'",
"clean": "lerna exec -- \"rm -rf dist* .tsbuild*.info\"",
"dev": "lerna run --parallel dev --ignore redocusaurus-website",
"dev:website": "lerna run --parallel dev --scope 'redocusaurus-website'",
"build": "yarn workspaces foreach --exclude 'redocusaurus-website' -t run build",
"build:website": "yarn workspace redocusaurus-website run build",
"clean": "yarn workspaces foreach -A exec \"rm -rf dist* .tsbuild*.info\"",
"dev": "yarn workspaces foreach --exclude redocusaurus-website -p run dev",
"dev:website": "yarn workspace redocusaurus-website run dev",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "yarn lint --fix",
"release": "yarn build && changeset publish",
"start": "yarn build && lerna run start --stream --scope redocusaurus-website",
"test": "echo \"Error: no test specified\" && exit 1"
"start": "yarn build && yarn workspace redocusaurus-website run start",
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand All @@ -37,26 +37,26 @@
"react-dom": "^17.0.0"
},
"devDependencies": {
"@changesets/changelog-github": "^0.2.8",
"@changesets/cli": "^2.16.0",
"@types/node": "^14.14.21",
"@types/react": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"concurrently": "^6.2.0",
"eslint": "^7.23.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^4.2.5",
"@changesets/changelog-github": "^0.4.1",
"@changesets/cli": "^2.18.0",
"@types/node": "^16.9.6",
"@types/react": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"concurrently": "^6.4.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-typescript": "^14.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^7.0.4",
"lerna": "^4.0.0",
"lint-staged": "^10.5.4",
"prettier": "2.2.1",
"typescript": "^4.1.3"
"lint-staged": "^11.2.6",
"prettier": "2.4.1",
"typescript": "^4.4.3"
},
"engines": {
"node": ">=10.15.1"
Expand All @@ -69,7 +69,7 @@
},
"husky": {
"hooks": {
"pre-commit": "npx lint-staged"
"pre-commit": "yarn lint-staged"
}
},
"lint-staged": {
Expand All @@ -81,5 +81,6 @@
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
},
"packageManager": "[email protected]"
}
8 changes: 4 additions & 4 deletions packages/docusaurus-plugin-redoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Redoc Plugin for DocusaurusV2",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"build": "tsc && echo \"built plugin\"",
"dev": "tsc -w",
"prepublish": "rm -rf .tsbuild.info",
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -26,9 +26,9 @@
},
"homepage": "https://github.com/rohit-gohri/redocusaurus#readme",
"dependencies": {
"@docusaurus/types": "^2.0.0-beta.5",
"@docusaurus/utils": "^2.0.0-beta.5",
"joi": "^17.2.1",
"@docusaurus/types": "^2.0.0-beta.9",
"@docusaurus/utils": "^2.0.0-beta.9",
"joi": "^17.4.2",
"yaml": "^1.10.0"
},
"engines": {
Expand Down
9 changes: 9 additions & 0 deletions packages/docusaurus-theme-redoc/copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
echo "copying"

cd src

yarn copyfiles --verbose -e "./**/*.js" -e "./**/*.jsx" -e "./**/*.ts" -e "./**/*.tsx" "./**/*.*" ../dist/
yarn copyfiles --verbose -e "./**/*.js" -e "./**/*.jsx" -e "./**/*.ts" -e "./**/*.tsx" "./**/*.*" ../dist-jsx/

echo "copied"
27 changes: 13 additions & 14 deletions packages/docusaurus-theme-redoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
"description": "Redoc Component for DocusaurusV2",
"main": "dist/index.js",
"scripts": {
"_copy": "npx copyup -e \"./**/*.jsx\" -e \"./**/*.js\" -e \"./**/*.ts\" -e \"./**/*.tsx\" \"./src/**/*.*\"",
"copy": "yarn _copy ./dist && yarn _copy ./dist-jsx",
"copy": "sh copy.sh",
"copy:watch": "nodemon --watch ./src/**/*.css -e css --exec \"yarn copy\"",
"build": "tsc -p tsconfig.jsx.json && tsc",
"postbuild": "yarn copy",
"build": "tsc -p tsconfig.jsx.json && tsc && yarn copy && echo \"built theme\"",
"dev": "concurrently 'tsc -w -p tsconfig.jsx.json' 'tsc -w' 'yarn copy:watch'",
"prepublish": "rm -rf rm .tsbuild.info .tsbuild.jsx.info",
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -30,23 +28,24 @@
},
"homepage": "https://github.com/rohit-gohri/redocusaurus#readme",
"dependencies": {
"@docusaurus/types": "^2.0.0-beta.5",
"@docusaurus/types": "^2.0.0-beta.9",
"clsx": "^1.1.1",
"copyfiles": "^2.4.1",
"lodash": "^4.17.21",
"mobx": "^6.3.0",
"node-polyfill-webpack-plugin": "^1.1.3",
"redoc": "^2.0.0-rc.56",
"styled-components": "^5.3.0",
"mobx": "^6.3.7",
"node-polyfill-webpack-plugin": "^1.1.4",
"redoc": "^2.0.0-rc.57",
"styled-components": "^5.3.3",
"to-arraybuffer": "^1.0.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-beta.5",
"@docusaurus/theme-classic": "^2.0.0-beta.5",
"@types/lodash": "^4.14.169",
"@docusaurus/module-type-aliases": "^2.0.0-beta.9",
"@docusaurus/theme-classic": "^2.0.0-beta.9",
"@types/lodash": "^4.14.174",
"@types/react-dom": "^17.0.5",
"@types/react-router-dom": "^5.1.7",
"@types/styled-components": "^5.1.9"
"@types/react-router-dom": "^5.3.0",
"@types/rtlcss": "^3.1.1",
"@types/styled-components": "^5.1.14"
},
"engines": {
"node": ">=10.15.1"
Expand Down
17 changes: 11 additions & 6 deletions packages/docusaurus-theme-redoc/src/theme/ServerStyle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
/* eslint-disable import/no-extraneous-dependencies */
/**
* @see https://github.com/facebook/docusaurus/issues/3236#issuecomment-788953743
*/
import React from 'react';
import { DocusaurusContextProvider } from '@docusaurus/docusaurusContext';
import { renderToString } from 'react-dom/server';
import { ServerStyleSheet } from 'styled-components';
import { StaticRouter, useLocation } from 'react-router-dom';
import DocusaurusContext from '@docusaurus/context';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';

function ServerStyle({ from: children }: { from: React.Component }) {
let style = null;
interface Props {
from: React.Component;
}

const ServerStyle: React.FC<Props> = ({ from: children }) => {
let style: any = null;

const location = useLocation();
const context = useDocusaurusContext();
const sheet = new ServerStyleSheet();

try {
renderToString(
sheet.collectStyles(
<StaticRouter location={location}>
<DocusaurusContextProvider>{children}</DocusaurusContextProvider>
<DocusaurusContext.Provider>{children}</DocusaurusContext.Provider>
</StaticRouter>,
),
);
Expand All @@ -30,7 +35,7 @@ function ServerStyle({ from: children }: { from: React.Component }) {
}

return style;
}
};

function ClientStyle() {
return null;
Expand Down
4 changes: 2 additions & 2 deletions packages/redocusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"./theme": "./dist/theme.js"
},
"scripts": {
"build": "tsc",
"build": "tsc && echo \"built preset\"",
"dev": "tsc -w",
"prepublish": "rm -rf .tsbuild.info",
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -31,7 +31,7 @@
},
"homepage": "https://github.com/rohit-gohri/redocusaurus#readme",
"dependencies": {
"@docusaurus/types": "^2.0.0-beta.5",
"@docusaurus/types": "^2.0.0-beta.9",
"docusaurus-plugin-redoc": "^0.5.0-next.0",
"docusaurus-theme-redoc": "^0.5.0-next.0"
},
Expand Down
7 changes: 3 additions & 4 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "redocusaurus-website",
"version": "0.0.0",
"private": "true",
"homepage": "https://github.com/rohit-gohri/redocusaurus",
"bugs": {
"url": "https://github.com/rohit-gohri/redocusaurus/issues"
Expand All @@ -21,15 +20,15 @@
"serve": "docusaurus serve"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-beta.5",
"@docusaurus/preset-classic": "^2.0.0-beta.5",
"@docusaurus/core": "^2.0.0-beta.9",
"@docusaurus/preset-classic": "^2.0.0-beta.9",
"clsx": "^1.1.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"redocusaurus": "^0.5.0-next.0"
},
"devDependencies": {
"@types/react": "^17.0.0"
"@types/react": "^17.0.24"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit 2dfb3ba

Please sign in to comment.