How to use the shipjs-lib.expandPackageList function in shipjs-lib

To help you get started, we’ve selected a few shipjs-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / shipjs / packages / shipjs / src / step / prepare / createPullRequest.js View on Github external
function getPublishCommandInStr({
  isYarn,
  tag,
  monorepo,
  publishCommand,
  dir,
}) {
  if (monorepo) {
    const { packagesToPublish } = monorepo;
    const packageList = expandPackageList(packagesToPublish, dir);
    return packageList
      .map(
        packageDir =>
          `- ${packageDir} -> ${getPublishCommand({
            isYarn,
            publishCommand,
            tag,
            dir: packageDir,
          })}`
      )
      .join('\n');
  } else {
    return getPublishCommand({ isYarn, publishCommand, tag, dir });
  }
}
github algolia / shipjs / packages / shipjs / src / step / release / runPublish.js View on Github external
runStep({ title: 'Publishing.' }, () => {
    const { publishCommand, monorepo } = config;

    if (monorepo) {
      const { packagesToPublish } = monorepo;
      const packageList = expandPackageList(packagesToPublish, dir);
      packageList.forEach(packageDir => {
        const command = getPublishCommand({
          isYarn,
          publishCommand,
          tag,
          dir: packageDir,
        });
        print(`Running the following at ${info(packageDir)}`);
        run({ command, dir: packageDir, dryRun });
      });
    } else {
      const command = getPublishCommand({ isYarn, publishCommand, tag, dir });
      run({ command, dir, dryRun });
    }
  });
github algolia / shipjs / packages / shipjs / src / step / prepare / updateVersionMonorepo.js View on Github external
async () => {
      const {
        versionUpdated,
        monorepo: { mainVersionFile, packagesToBump },
      } = config;
      const packageList = expandPackageList(packagesToBump, dir);
      if (dryRun) {
        print(`Your configuration: ${JSON.stringify(packagesToBump)}`);
        print(`Main version file: ${mainVersionFile}`);
        print(`Actual packages to bump:`);
        packageList.forEach(packageDir =>
          print(`-> ${info(`${packageDir}/package.json`)}`)
        );
        if (versionUpdated) {
          print(`-> execute ${info('versionUpdated()')} callback.`);
        }
        return;
      }

      updateVersion({ nextVersion, dir, fileName: mainVersionFile });
      packageList.forEach(packageDir => {
        print(`-> ${info(`${packageDir}/package.json`)}`);