Skip to content

Commit

Permalink
update /dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay-Karia committed Aug 8, 2024
1 parent 03e1339 commit 9219a4a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
14 changes: 12 additions & 2 deletions dist/npm-to-yarn.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ var yarnCLICommands = [
'workspace',
'workspaces'
];
var executorCommands = {
"npm": "npx",
"yarn": "yarn dlx",
"pnpm": "pnpm dlx",
"bun": "bun x"
};

function parse(command) {
var args = [];
Expand Down Expand Up @@ -618,8 +624,12 @@ function npmToBun(_m, command) {
/**
* Converts between npm and yarn command
*/
function convert(str, to) {
if (to === 'npm') {
function convert(str, to, executor) {
if (executor === void 0) { executor = false; }
if (executor) {
return str.replace("npx", executorCommands[to]);
}
else if (to === 'npm') {
return str.replace(/yarn(?: +([^&\n\r]*))?/gm, yarnToNPM);
}
else if (to === 'pnpm') {
Expand Down
2 changes: 1 addition & 1 deletion dist/npm-to-yarn.mjs.map

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions dist/npm-to-yarn.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/npm-to-yarn.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
* Converts between npm and yarn command
*/
export default function convert(str: string, to: 'npm' | 'yarn' | 'pnpm' | 'bun'): string;
export default function convert(str: string, to: 'npm' | 'yarn' | 'pnpm' | 'bun', executor?: boolean): string;
6 changes: 6 additions & 0 deletions dist/types/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export declare const unchangedCLICommands: string[];
export declare const yarnCLICommands: string[];
export declare const npmCLICommands: string[];
export declare const executorCommands: {
npm: string;
yarn: string;
pnpm: string;
bun: string;
};

0 comments on commit 9219a4a

Please sign in to comment.