mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 17:37:09 +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 = {
|
||||
remarkPlugins: (pluginOptions.remarkPlugins || []).concat([
|
||||
admonitions,
|
||||
pluginOptions.admonitions || {},
|
||||
[admonitions, pluginOptions.admonitions || {}],
|
||||
]),
|
||||
};
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"@docusaurus/preset-classic": "^2.0.0-alpha.48",
|
||||
"classnames": "^2.2.6",
|
||||
"color": "^3.1.2",
|
||||
"npm-to-yarn": "^1.0.0-2",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4"
|
||||
},
|
||||
|
|
|
@ -5,20 +5,10 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// This is a very naive implementation of converting npm commands to yarn commands
|
||||
// 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
|
||||
const convertNpmToYarn = npmCode => {
|
||||
// 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 npmToYarn = require('npm-to-yarn');
|
||||
|
||||
// E.g. global install: 'npm i' -> 'yarn'
|
||||
const convertNpmToYarn = npmCode => npmToYarn(npmCode, 'yarn');
|
||||
|
||||
const transformNode = node => {
|
||||
const npmCode = node.value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue