* Execute a command using the locally installed instance of the lerna CLI. * This has been given a terse name to help with readability in the spec files.
(
args: string,
opts: { silenceError?: true; allowNetworkRequests?: true } = {}
)
| 255 | * This has been given a terse name to help with readability in the spec files. |
| 256 | */ |
| 257 | async lerna( |
| 258 | args: string, |
| 259 | opts: { silenceError?: true; allowNetworkRequests?: true } = {} |
| 260 | ): Promise<RunCommandResult> { |
| 261 | const offlineFlag = opts.allowNetworkRequests ? "" : "--offline "; |
| 262 | switch (this.packageManager) { |
| 263 | case "npm": |
| 264 | return this.exec(`npx ${offlineFlag}--no lerna ${args}`, { silenceError: opts.silenceError }); |
| 265 | case "yarn": |
| 266 | return this.exec(`npx ${offlineFlag}--no lerna ${args}`, { silenceError: opts.silenceError }); |
| 267 | case "pnpm": |
| 268 | return this.exec(`pnpm exec lerna ${args}`, { silenceError: opts.silenceError }); |
| 269 | default: |
| 270 | throw new Error(`Unsupported package manager: ${this.packageManager}`); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | async lernaWatch(inputArgs: string): Promise<(timeoutMs?: number) => Promise<RunCommandResult>> { |
| 275 | return new Promise((resolve, reject) => { |
no test coverage detected