Skip to content

Commit

Permalink
Update remark-npm2yarn.js
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun authored Mar 24, 2020
1 parent b6005d8 commit 7a44aae
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions website/src/plugins/remark-npm2yarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +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 npmToYarn = require('npm-to-yarn');

var n2y = require('npm-to-yarn');

const convertNpmToYarn = npmCode => {
// global install: 'npm i' -> 'yarn'
return n2y(npmCode, 'yarn');
};
// E.g. global install: 'npm i' -> 'yarn'
const convertNpmToYarn = npmCode => npmToYarn(npmCode, 'yarn');

const transformNode = node => {
const npmCode = node.value;
Expand Down

0 comments on commit 7a44aae

Please sign in to comment.