Comparing version 1.3.0 to 1.4.0
@@ -27,2 +27,3 @@ #!/usr/bin/env node | ||
const exclude = (yargs_1.argv.exclude && (Array.isArray(yargs_1.argv.exclude) ? yargs_1.argv.exclude : [yargs_1.argv.exclude])) || []; | ||
const excludeMissing = yargs_1.argv.excludeMissing || false; | ||
const cmd = yargs_1.argv._[0]; | ||
@@ -48,2 +49,3 @@ const pkgName = yargs_1.argv._[1]; | ||
exclude, | ||
excludeMissing, | ||
workspacePath: process.cwd() | ||
@@ -50,0 +52,0 @@ }, pkgPaths); |
@@ -9,4 +9,4 @@ /// <reference types="node" /> | ||
export interface CmdOptions { | ||
rejectOnNonZeroExit?: boolean; | ||
collectLogs?: boolean; | ||
rejectOnNonZeroExit: boolean; | ||
collectLogs: boolean; | ||
prefixer?: (basePath: string, pkg: string, line: string) => string; | ||
@@ -28,3 +28,3 @@ doneCriteria?: string; | ||
doneCriteria?: RegExp; | ||
constructor(cmd: string, pkgName: string, opts?: CmdOptions); | ||
constructor(cmd: string, pkgName: string, opts: CmdOptions); | ||
start(): void; | ||
@@ -45,2 +45,3 @@ private autoPrefix(line); | ||
exclude: string[]; | ||
excludeMissing: boolean; | ||
} | ||
@@ -47,0 +48,0 @@ export declare class RunGraph { |
@@ -42,3 +42,3 @@ "use strict"; | ||
class CmdProcess { | ||
constructor(cmd, pkgName, opts = { path: '' }) { | ||
constructor(cmd, pkgName, opts) { | ||
this.cmd = cmd; | ||
@@ -184,5 +184,9 @@ this.pkgName = pkgName; | ||
if (this.opts.exclude.indexOf(pkg) >= 0) { | ||
console.log('Package', pkg, 'in exclude list', this.opts.exclude, ': skipping'); | ||
console.log(chalk_1.default.bold(pkg), 'in exclude list, skipping'); | ||
return Promise.resolve(); | ||
} | ||
if (this.opts.excludeMissing && (!p || !p.scripts || !p.scripts[cmd])) { | ||
console.log(chalk_1.default.bold(pkg), 'has no ', cmd, 'script, skipping missing'); | ||
return Promise.resolve(); | ||
} | ||
let cmdLine = this.makeCmd(cmd, pkg); | ||
@@ -189,0 +193,0 @@ const child = new CmdProcess(cmdLine, pkg, { |
@@ -8,2 +8,5 @@ export declare type Dict<T> = { | ||
devDependencies?: Dict<string>; | ||
scripts?: { | ||
[name: string]: string; | ||
}; | ||
} | ||
@@ -10,0 +13,0 @@ export declare type Packages = Dict<{ |
{ | ||
"name": "wsrun", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "executes commands on packages in parallel, but is aware of the dependencies between them", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -1,4 +0,4 @@ | ||
# Workspace command runner | ||
# Workspace script runner | ||
Run commands in a yarn workspace, like a boss. | ||
Run npm scripts in a yarn workspace, like a boss. | ||
@@ -17,11 +17,12 @@ ### Usage: | ||
Individual package opts: | ||
-r, --recursive execute the same cmd on all of its dependencies, too | ||
-r, --recursive execute the same script on all of its dependencies, too | ||
Misc: | ||
--fast-exit if at least one command exits with code > 0, abort | ||
--fast-exit if at least one script exits with code > 0, abort | ||
--collect-output collect per-package stdout, print everything at the end, grouped | ||
--no-prefix don't prefix output with "package_name |" | ||
--bin=yarn which program should we pass the cmd to | ||
--no-prefix don't prefix output | ||
--bin=yarn which program should we pass the script to (default yarn) | ||
--done-criteria=regex consider the process "done" when output line matches regex | ||
--exclude pkgname skip actually running the command for that package | ||
--exclude pkgname skip actually running the script for that package | ||
--exclude-missing skip packages which lack the specified script | ||
``` | ||
@@ -47,1 +48,3 @@ | ||
`yarn wsrun test` will test every package. | ||
`yarn wsrun test --exclude-missing` will run the test script only on packages that have it |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43214
624
48