chore: upgrade dependencies (#1634)

This commit is contained in:
Roman Hotsiy 2021-06-02 15:53:36 +03:00 committed by GitHub
parent 823be24b31
commit 92387bc653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 29586 additions and 2396 deletions

View File

@ -92,8 +92,6 @@ YargsParser.command(
redocOptions: getObjectOrJSON(argv.options), redocOptions: getObjectOrJSON(argv.options),
}; };
console.log(config);
try { try {
await serve(argv.port as number, argv.spec as string, config); await serve(argv.port as number, argv.spec as string, config);
} catch (e) { } catch (e) {

2889
cli/npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,18 +11,18 @@
"node": ">=12.0.0" "node": ">=12.0.0"
}, },
"dependencies": { "dependencies": {
"chokidar": "^3.4.1", "chokidar": "^3.5.1",
"handlebars": "^4.7.6", "handlebars": "^4.7.7",
"isarray": "^2.0.5", "isarray": "^2.0.5",
"mkdirp": "^1.0.4", "mkdirp": "^1.0.4",
"mobx": "^6.0.4", "mobx": "^6.3.2",
"node-libs-browser": "^2.2.1", "node-libs-browser": "^2.2.1",
"react": "^16.13.1", "react": "^17.0.2",
"react-dom": "^16.13.1", "react-dom": "^17.0.2",
"redoc": "2.0.0-rc.53", "redoc": "2.0.0-rc.53",
"styled-components": "^5.1.1", "styled-components": "^5.3.0",
"tslib": "^2.0.0", "tslib": "^2.2.0",
"yargs": "^15.4.1" "yargs": "^17.0.1"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

View File

@ -1,14 +1,12 @@
import { renderToString } from 'react-dom/server'; import { renderToString } from 'react-dom/server';
import * as React from 'react'; import * as React from 'react';
import { ServerStyleSheet } from 'styled-components'; import { ServerStyleSheet } from 'styled-components';
// @ts-ignore
import { Redoc, createStore } from '../../'; import { Redoc, createStore } from '../../';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
const yaml = require('yaml-js'); const yaml = require('js-yaml');
const http = require('http'); const http = require('http');
const url = require('url');
const fs = require('fs'); const fs = require('fs');
const PORT = 9999; const PORT = 9999;
@ -18,8 +16,8 @@ const server = http.createServer(async (request, response) => {
if (request.url === '/redoc.standalone.js') { if (request.url === '/redoc.standalone.js') {
fs.createReadStream('bundles/redoc.standalone.js', 'utf8').pipe(response); fs.createReadStream('bundles/redoc.standalone.js', 'utf8').pipe(response);
} else if (request.url === '/') { } else if (request.url === '/') {
const spec = yaml.load(readFileSync(resolve(__dirname, '../openapi.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../openapi.yaml'), 'utf-8'));
let store = await createStore(spec, 'path/to/spec.yaml'); const store = await createStore(spec, 'path/to/spec.yaml');
const sheet = new ServerStyleSheet(); const sheet = new ServerStyleSheet();

View File

@ -1,5 +1,5 @@
// tslint:disable:no-implicit-dependencies // tslint:disable:no-implicit-dependencies
import * as yaml from 'yaml-js'; import * as yaml from 'js-yaml';
async function loadSpec(url: string): Promise<any> { async function loadSpec(url: string): Promise<any> {
const spec = await (await fetch(url)).text(); const spec = await (await fetch(url)).text();

28913
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,7 @@
"e2e": "cypress run", "e2e": "cypress run",
"e2e-ci": "cypress run --record", "e2e-ci": "cypress run --record",
"bundlesize": "bundlesize", "bundlesize": "bundlesize",
"ts-check": "tsc --noEmit --skipLibCheck",
"cy:open": "cypress open", "cy:open": "cypress open",
"bundle:clean": "rimraf bundles", "bundle:clean": "rimraf bundles",
"bundle:standalone": "webpack --env.standalone --mode=production", "bundle:standalone": "webpack --env.standalone --mode=production",
@ -52,111 +53,112 @@
"docker:build": "docker build -f config/docker/Dockerfile -t redoc ." "docker:build": "docker build -f config/docker/Dockerfile -t redoc ."
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.10.5", "@babel/core": "^7.14.3",
"@babel/plugin-syntax-decorators": "^7.10.4", "@babel/plugin-syntax-decorators": "^7.12.13",
"@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-jsx": "^7.10.4", "@babel/plugin-syntax-jsx": "^7.10.4",
"@babel/plugin-syntax-typescript": "^7.10.4", "@babel/plugin-syntax-typescript": "^7.10.4",
"@cypress/webpack-preprocessor": "^5.4.2", "@cypress/webpack-preprocessor": "^5.9.0",
"@hot-loader/react-dom": "^16.12.0", "@hot-loader/react-dom": "^17.0.1",
"@types/chai": "^4.2.12", "@types/chai": "^4.2.18",
"@types/dompurify": "^2.0.2", "@types/dompurify": "^2.2.2",
"@types/enzyme": "^3.10.5", "@types/enzyme": "^3.10.5",
"@types/enzyme-to-json": "^1.5.3", "@types/enzyme-to-json": "^1.5.3",
"@types/jest": "^26.0.7", "@types/jest": "^26.0.23",
"@types/json-pointer": "^1.0.30", "@types/json-pointer": "^1.0.30",
"@types/lodash": "^4.14.158", "@types/lodash": "^4.14.170",
"@types/lunr": "^2.3.3", "@types/lunr": "^2.3.3",
"@types/mark.js": "^8.11.5", "@types/mark.js": "^8.11.5",
"@types/marked": "^1.1.0", "@types/marked": "^1.1.0",
"@types/prismjs": "^1.16.1", "@types/prismjs": "^1.16.5",
"@types/prop-types": "^15.7.3", "@types/prop-types": "^15.7.3",
"@types/react": "^16.9.43", "@types/react": "^17.0.8",
"@types/react-dom": "^16.9.8", "@types/react-dom": "^17.0.5",
"@types/react-tabs": "^2.3.2", "@types/react-tabs": "^2.3.2",
"@types/styled-components": "^5.1.1", "@types/styled-components": "^5.1.1",
"@types/tapable": "^1.0.6", "@types/tapable": "^2.2.2",
"@types/webpack": "^4.41.21", "@types/webpack": "^4.41.21",
"@types/webpack-env": "^1.15.2", "@types/webpack-env": "^1.15.2",
"@types/yargs": "^15.0.5", "@types/yargs": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^3.7.0", "@typescript-eslint/parser": "^4.26.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"babel-plugin-styled-components": "^1.10.7", "babel-plugin-styled-components": "^1.12.0",
"beautify-benchmark": "^0.2.4", "beautify-benchmark": "^0.2.4",
"bundlesize": "^0.18.0", "bundlesize": "^0.18.1",
"conventional-changelog-cli": "^2.0.34", "conventional-changelog-cli": "^2.0.34",
"copy-webpack-plugin": "^6.0.3", "copy-webpack-plugin": "^6.0.3",
"core-js": "^3.6.5", "core-js": "^3.13.1",
"coveralls": "^3.1.0", "coveralls": "^3.1.0",
"css-loader": "^3.6.0", "css-loader": "^5.2.6",
"cypress": "^4.11.0", "cypress": "^7.4.0",
"enzyme": "^3.11.0", "enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2", "enzyme-to-json": "^3.6.2",
"enzyme-to-json": "^3.5.0", "eslint": "^7.27.0",
"eslint": "^7.5.0", "eslint-plugin-import": "^2.23.4",
"eslint-plugin-import": "^2.22.0", "eslint-plugin-react": "^7.24.0",
"eslint-plugin-react": "^7.20.3", "fork-ts-checker-webpack-plugin": "^6.2.10",
"fork-ts-checker-webpack-plugin": "^5.0.11",
"html-webpack-plugin": "^4.3.0", "html-webpack-plugin": "^4.3.0",
"jest": "^26.1.0", "jest": "^27.0.3",
"js-yaml": "^4.1.0",
"license-checker": "^25.0.1", "license-checker": "^25.0.1",
"lodash": "^4.17.19", "lodash": "^4.17.21",
"mobx": "^6.0.4", "mobx": "^6.3.2",
"prettier": "^2.0.5", "prettier": "^2.3.0",
"raf": "^3.4.1", "raf": "^3.4.1",
"react": "^16.13.1", "react": "^17.0.2",
"react-dom": "^16.13.1", "react-dom": "^17.0.2",
"react-hot-loader": "^4.12.21", "react-hot-loader": "^4.13.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"shelljs": "^0.8.4", "shelljs": "^0.8.4",
"source-map-loader": "^1.0.1", "source-map-loader": "^1.0.0",
"style-loader": "^1.2.1", "style-loader": "^2.0.0",
"styled-components": "^5.1.1", "styled-components": "^5.3.0",
"ts-jest": "^26.1.3", "ts-jest": "^27.0.2",
"ts-loader": "^8.0.1", "ts-loader": "^8.0.1",
"ts-node": "^8.10.2", "ts-node": "^10.0.0",
"typescript": "^3.9.7", "tslib": "^2.2.0",
"unfetch": "^4.1.0", "typescript": "~4.1.0",
"url-polyfill": "^1.1.10", "unfetch": "^4.2.0",
"url-polyfill": "^1.1.12",
"webpack": "^4.44.0", "webpack": "^4.44.0",
"webpack-cli": "^3.3.12", "webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0", "webpack-dev-server": "^3.11.2",
"webpack-node-externals": "^2.5.0", "webpack-node-externals": "^2.5.0",
"workerize-loader": "^1.3.0", "workerize-loader": "^1.3.0"
"yaml-js": "^0.2.3"
}, },
"peerDependencies": { "peerDependencies": {
"core-js": "^3.1.4", "core-js": "^3.1.4",
"mobx": "^6.0.4", "mobx": "^6.0.4",
"react": "^16.8.4", "react": "^16.8.4 || ^17.0.0",
"react-dom": "^16.8.4", "react-dom": "^16.8.4 || ^17.0.0",
"styled-components": "^4.1.1 || ^5.1.1" "styled-components": "^4.1.1 || ^5.1.1"
}, },
"dependencies": { "dependencies": {
"@redocly/openapi-core": "^1.0.0-beta.48", "@redocly/openapi-core": "^1.0.0-beta.48",
"@redocly/react-dropdown-aria": "^2.0.11", "@redocly/react-dropdown-aria": "^2.0.11",
"@types/node": "^13.11.1", "@types/node": "^15.6.1",
"classnames": "^2.2.6", "classnames": "^2.3.1",
"decko": "^1.2.0", "decko": "^1.2.0",
"dompurify": "^2.0.12", "dompurify": "^2.2.8",
"eventemitter3": "^4.0.4", "eventemitter3": "^4.0.7",
"json-pointer": "^0.6.0", "json-pointer": "^0.6.1",
"lunr": "2.3.8", "lunr": "^2.3.9",
"mark.js": "^8.11.1", "mark.js": "^8.11.1",
"marked": "^0.7.0", "marked": "^0.7.0",
"memoize-one": "~5.1.1", "memoize-one": "^5.2.1",
"mobx-react": "^7.0.5", "mobx-react": "^7.2.0",
"openapi-sampler": "^1.0.0", "openapi-sampler": "^1.0.1",
"perfect-scrollbar": "^1.4.0", "perfect-scrollbar": "^1.5.1",
"polished": "^3.6.5", "polished": "^4.1.3",
"prismjs": "^1.22.0", "prismjs": "^1.23.0",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react-tabs": "^3.1.1", "react-tabs": "^3.2.2",
"slugify": "^1.4.4", "slugify": "^1.5.3",
"stickyfill": "^1.1.1", "stickyfill": "^1.1.1",
"swagger2openapi": "^6.2.1", "swagger2openapi": "^7.0.6",
"tslib": "^2.0.0", "tslib": "^2.2.0",
"url-template": "^2.0.8" "url-template": "^2.0.8"
}, },
"bundlesize": [ "bundlesize": [
@ -166,6 +168,7 @@
} }
], ],
"jest": { "jest": {
"testEnvironment": "jsdom",
"setupFilesAfterEnv": [ "setupFilesAfterEnv": [
"<rootDir>/src/setupTests.ts" "<rootDir>/src/setupTests.ts"
], ],

View File

@ -2,7 +2,7 @@
import * as React from 'react'; import * as React from 'react';
import { renderToString } from 'react-dom/server'; import { renderToString } from 'react-dom/server';
import * as yaml from 'yaml-js'; import * as yaml from 'js-yaml';
import { createStore, Redoc } from '../'; import { createStore, Redoc } from '../';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
@ -10,7 +10,7 @@ import { resolve } from 'path';
describe('SSR', () => { describe('SSR', () => {
it('should render in SSR mode', async () => { it('should render in SSR mode', async () => {
const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'), 'utf-8'));
const store = await createStore(spec, ''); const store = await createStore(spec, '');
expect(() => { expect(() => {
renderToString(<Redoc store={store} />); renderToString(<Redoc store={store} />);

View File

@ -1,7 +1,7 @@
/* tslint:disable:no-implicit-dependencies */ /* tslint:disable:no-implicit-dependencies */
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import * as React from 'react'; import * as React from 'react';
import * as yaml from 'yaml-js'; import * as yaml from 'js-yaml';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
@ -11,7 +11,7 @@ import { Loading, RedocStandalone } from '../components/';
describe('Components', () => { describe('Components', () => {
describe('RedocStandalone', () => { describe('RedocStandalone', () => {
test('should show loading first', () => { test('should show loading first', () => {
const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'), 'utf-8'));
const inst = mount(<RedocStandalone spec={spec} options={{}} />); const inst = mount(<RedocStandalone spec={spec} options={{}} />);
expect(inst.find(Loading)).toHaveLength(1); expect(inst.find(Loading)).toHaveLength(1);

View File

@ -58,7 +58,7 @@ export class MediaTypeModel {
if (this.schema && this.schema.oneOf) { if (this.schema && this.schema.oneOf) {
this.examples = {}; this.examples = {};
for (const subSchema of this.schema.oneOf) { for (const subSchema of this.schema.oneOf) {
const sample = Sampler.sample(subSchema.rawSchema, samplerOptions, parser.spec); const sample = Sampler.sample(subSchema.rawSchema as any, samplerOptions, parser.spec);
if (this.schema.discriminatorProp && typeof sample === 'object' && sample) { if (this.schema.discriminatorProp && typeof sample === 'object' && sample) {
sample[this.schema.discriminatorProp] = subSchema.title; sample[this.schema.discriminatorProp] = subSchema.title;
@ -78,7 +78,7 @@ export class MediaTypeModel {
default: new ExampleModel( default: new ExampleModel(
parser, parser,
{ {
value: Sampler.sample(info.schema, samplerOptions, parser.spec), value: Sampler.sample(info.schema as any, samplerOptions, parser.spec),
}, },
this.name, this.name,
info.encoding, info.encoding,

View File

@ -1,5 +1,6 @@
import * as Enzyme from 'enzyme'; import * as Enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16'; import * as Adapter from '@wojtekmaj/enzyme-adapter-react-17';
import 'raf/polyfill'; import 'raf/polyfill';
Enzyme.configure({ adapter: new Adapter() }); Enzyme.configure({ adapter: new Adapter() });

View File

@ -10,7 +10,7 @@ const {
createGlobalStyle, createGlobalStyle,
keyframes, keyframes,
ThemeProvider, ThemeProvider,
} = styledComponents as styledComponents.ThemedStyledComponentsModule<ResolvedThemeInterface>; } = styledComponents as unknown as styledComponents.ThemedStyledComponentsModule<ResolvedThemeInterface>;
export const media = { export const media = {
lessThan(breakpoint, print?: boolean, extra?: string) { lessThan(breakpoint, print?: boolean, extra?: string) {

View File

@ -1,23 +1,23 @@
import * as yaml from 'yaml-js'; import * as yaml from 'js-yaml';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
import { loadAndBundleSpec } from '../loadAndBundleSpec'; import { loadAndBundleSpec } from '../loadAndBundleSpec';
describe('#loadAndBundleSpec', () => { describe('#loadAndBundleSpec', () => {
it('should load And Bundle Spec demo/openapi.yaml', async () => { it('should load And Bundle Spec demo/openapi.yaml', async () => {
const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/openapi.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/openapi.yaml'), 'utf-8'));
const bundledSpec = await loadAndBundleSpec(spec); const bundledSpec = await loadAndBundleSpec(spec);
expect(bundledSpec).toMatchSnapshot(); expect(bundledSpec).toMatchSnapshot();
}); });
it('should load And Bundle Spec demo/openapi-3-1.yaml', async () => { it('should load And Bundle Spec demo/openapi-3-1.yaml', async () => {
const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/openapi-3-1.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/openapi-3-1.yaml'), 'utf-8'));
const bundledSpec = await loadAndBundleSpec(spec); const bundledSpec = await loadAndBundleSpec(spec);
expect(bundledSpec).toMatchSnapshot(); expect(bundledSpec).toMatchSnapshot();
}); });
it('should load And Bundle Spec demo/swagger.yaml', async () => { it('should load And Bundle Spec demo/swagger.yaml', async () => {
const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/swagger.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../../../demo/swagger.yaml'), 'utf-8'));
const bundledSpec = await loadAndBundleSpec(spec); const bundledSpec = await loadAndBundleSpec(spec);
expect(bundledSpec).toMatchSnapshot(); expect(bundledSpec).toMatchSnapshot();
}); });