Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace use of deepmerge with _.merge #1430

Merged
merged 2 commits into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/api-site-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The default version for the site to be shown. If this is not set, the latest ver

#### `docsUrl` [string]

The base url for all docs file. Set this field to `''` to remove the `docs` prefix of the documentation URL.
The base url for all docs file. Set this field to `''` to remove the `docs` prefix of the documentation URL.
If unset, it is defaulted to `docs`.

#### `disableHeaderTitle` [boolean]
Expand Down Expand Up @@ -247,6 +247,10 @@ Hostname of your server. Useful if you are using GitHub Enterprise.

Path to your web app manifest (e.g., `manifest.json`). This will add a `<link>` tag to `<head>` with `rel` as `"manifest"` and `href` as the provided path.

#### `markdownOptions` [object]

Override default [Remarkable options](https://github.com/jonschlinkert/remarkable#options) that will be used to render markdown.

#### `markdownPlugins` [array]

An array of plugins to be loaded by Remarkable, the markdown parser and renderer used by Docusaurus. The plugin will receive a reference to the Remarkable instance, allowing custom parsing and rendering rules to be defined.
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-1.x/lib/core/renderMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/

const _ = require('lodash');
const hljs = require('highlight.js');
const Markdown = require('remarkable');
const prismjs = require('prismjs');
const loadLanguages = require('prismjs/components/index');
const deepmerge = require('deepmerge');
const chalk = require('chalk');
const anchors = require('./anchors.js');

Expand Down Expand Up @@ -88,7 +88,7 @@ class MarkdownRenderer {

// Allow overriding default options
if (siteConfig.markdownOptions) {
markdownOptions = deepmerge(
markdownOptions = _.merge(
{},
markdownOptions,
siteConfig.markdownOptions,
Expand Down
8 changes: 5 additions & 3 deletions packages/docusaurus-1.x/lib/write-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const fs = require('fs-extra');
const glob = require('glob');
const mkdirp = require('mkdirp');
const nodePath = require('path');
const deepmerge = require('deepmerge');
const _ = require('lodash');

const readMetadata = require('./server/readMetadata.js');

Expand All @@ -43,7 +43,8 @@ let customTranslations = {
'pages-strings': {},
};
if (fs.existsSync(`${CWD}/data/custom-translation-strings.json`)) {
customTranslations = deepmerge(
customTranslations = _.merge(
{},
JSON.parse(
fs.readFileSync(`${CWD}/data/custom-translation-strings.json`, 'utf8'),
),
Expand Down Expand Up @@ -187,7 +188,8 @@ function execute() {
translations['pages-strings'],
customTranslations['pages-strings'],
);
translations['localized-strings'] = deepmerge(
translations['localized-strings'] = _.merge(
{},
translations['localized-strings'],
customTranslations['localized-strings'],
);
Expand Down
1 change: 0 additions & 1 deletion packages/docusaurus-1.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"cross-spawn": "^6.0.5",
"crowdin-cli": "^0.3.0",
"cssnano": "^3.10.0",
"deepmerge": "^2.1.1",
"escape-string-regexp": "^1.0.5",
"express": "^4.15.3",
"feed": "^1.1.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4882,6 +4882,11 @@ envify@^4.0.0:
esprima "^4.0.0"
through "~2.3.4"

envinfo@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.2.0.tgz#7e6d7638740d2d43806431403be6dd4bddf15af9"
integrity sha512-hHDGx34o8V0IULC6MnMb+jIMEJ5LBuK/EIbFi8/aw81r6q+wXCvu9QCA9RPbpOaBxtlH/16cYB2HkBnRFTy4SQ==

err-code@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960"
Expand Down