mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 02:12:36 +02:00
Merge branch 'master' of github.com:facebook/docusaurus
This commit is contained in:
commit
c56ec347f2
4 changed files with 7 additions and 16 deletions
|
@ -0,0 +1 @@
|
||||||
|
{}
|
|
@ -19,8 +19,7 @@ const addAdmonitions = pluginOptions => {
|
||||||
|
|
||||||
const admonitionsOptions = {
|
const admonitionsOptions = {
|
||||||
remarkPlugins: (pluginOptions.remarkPlugins || []).concat([
|
remarkPlugins: (pluginOptions.remarkPlugins || []).concat([
|
||||||
admonitions,
|
[admonitions, pluginOptions.admonitions || {}],
|
||||||
pluginOptions.admonitions || {},
|
|
||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"@docusaurus/preset-classic": "^2.0.0-alpha.48",
|
"@docusaurus/preset-classic": "^2.0.0-alpha.48",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"color": "^3.1.2",
|
"color": "^3.1.2",
|
||||||
|
"npm-to-yarn": "^1.0.0-2",
|
||||||
"react": "^16.8.4",
|
"react": "^16.8.4",
|
||||||
"react-dom": "^16.8.4"
|
"react-dom": "^16.8.4"
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,20 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This is a very naive implementation of converting npm commands to yarn commands
|
const npmToYarn = require('npm-to-yarn');
|
||||||
// Works well for our use case since we only use either 'npm install', or 'npm run <something>'
|
|
||||||
// Its impossible to convert it right since some commands at npm are not available in yarn and vice/versa
|
// E.g. global install: 'npm i' -> 'yarn'
|
||||||
const convertNpmToYarn = npmCode => {
|
const convertNpmToYarn = npmCode => npmToYarn(npmCode, 'yarn');
|
||||||
// global install: 'npm i' -> 'yarn'
|
|
||||||
return (
|
|
||||||
npmCode
|
|
||||||
.replace(/^npm i$/gm, 'yarn')
|
|
||||||
// install: 'npm install --save foo' -> 'yarn add foo'
|
|
||||||
.replace(/npm install --save/gm, 'yarn add')
|
|
||||||
// run command: 'npm run start' -> 'yarn run start'
|
|
||||||
.replace(/npm run/gm, 'yarn run')
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const transformNode = node => {
|
const transformNode = node => {
|
||||||
const npmCode = node.value;
|
const npmCode = node.value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue