chore: rename features.openapi to theme.openapi for build docs (#892)

This commit is contained in:
Alex Varchuk
2023-01-23 12:41:37 +02:00
committed by GitHub
parent b87cd5e9f0
commit 8fa9a359f1
6 changed files with 135 additions and 542 deletions

View File

@@ -1,4 +1,4 @@
import * as React from 'react';
import { createElement } from 'react';
import { createStore, Redoc } from 'redoc';
import { Config, isAbsoluteUrl } from '@redocly/openapi-core';
@@ -36,10 +36,10 @@ export function getObjectOrJSON(
}
break;
default: {
if (config) {
process.stderr.write(`Found ${config.configFile} and using features.openapi options`);
if (config.configFile) {
process.stderr.write(`Found ${config.configFile} and using theme.openapi options`);
return config['features.openapi'];
return config['features.openapi']; // FIXME: rename features.openapi to theme.openapi after global renaming inside repo.
}
return {};
}
@@ -66,7 +66,7 @@ export async function getPageHTML(
const store = await createStore(api, apiUrl, redocOptions);
const sheet = new ServerStyleSheet();
const html = renderToString(sheet.collectStyles(React.createElement(Redoc, { store })));
const html = renderToString(sheet.collectStyles(createElement(Redoc, { store })));
const state = await store.toJS();
const css = sheet.getStyleTags();