* Runs NPM publish within a specified package directory. * @throws With the process log output if the publish failed.
(packagePath: string, distTag: NpmDistTag, registryUrl: string | undefined)
| 19 | * @throws With the process log output if the publish failed. |
| 20 | */ |
| 21 | static async publish( |
| 22 | packagePath: string, |
| 23 | distTag: NpmDistTag, |
| 24 | registryUrl: string | undefined, |
| 25 | cwd?: string, |
| 26 | env?: NodeJS.ProcessEnv, |
| 27 | ) { |
| 28 | const args = ['publish', packagePath, '--access', 'public', '--tag', distTag]; |
| 29 | // If a custom registry URL has been specified, add the `--registry` flag. |
| 30 | if (registryUrl !== undefined) { |
| 31 | args.push('--registry', registryUrl); |