How to use the @lerna/prompt.input function in @lerna/prompt

To help you get started, we’ve selected a few @lerna/prompt 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 lerna / lerna / core / otplease / otplease.js View on Github external
function getOneTimePassword(message = "This operation requires a one-time password:") {
  // Logic taken from npm internals: https://git.io/fNoMe
  return prompt.input(message, {
    filter: otp => otp.replace(/\s+/g, ""),
    validate: otp =>
      (otp && /^[\d ]+$|^[A-Fa-f0-9]{64,64}$/.test(otp)) ||
      "Must be a valid one-time-password. " +
        "See https://docs.npmjs.com/getting-started/using-two-factor-authentication",
  });
}
github lerna / lerna / commands / version / lib / prompt-version.js View on Github external
}).then(choice => {
    if (choice === "CUSTOM") {
      return PromptUtilities.input("Enter a custom version", {
        filter: semver.valid,
        // semver.valid() always returns null with invalid input
        validate: v => v !== null || "Must be a valid semver version",
      });
    }

    if (choice === "PRERELEASE") {
      const defaultVersion = semver.inc(currentVersion, "prerelease", prereleaseId);
      const prompt = `(default: "${prereleaseId}", yielding ${defaultVersion})`;

      return PromptUtilities.input(`Enter a prerelease identifier ${prompt}`, {
        filter: v => semver.inc(currentVersion, "prerelease", v || prereleaseId),
      });
    }

    return choice;
github cssinjs / jss / scripts / create-github-release.js View on Github external
.then(username =>
    input('Github password:').then(password => ({
      username,
      password
    }))
  )
github cssinjs / jss / scripts / create-github-release.js View on Github external
}

      if (hasStarted) {
        hasFinished = line.startsWith('## ')

        return !hasFinished
      }

      hasStarted = line.startsWith(`## ${lerna.version}`)

      return false
    })
    .join('\n')
}

input('Github Username:')
  .then(username =>
    input('Github password:').then(password => ({
      username,
      password
    }))
  )
  .then(auth =>
    axios.request({
      method: 'POST',
      url: `/repos/cssinjs/jss/releases`,
      baseURL: `https://api.github.com`,
      data: {
        tag_name: `v${lerna.version}`,
        name: `v${lerna.version}`,
        body: getChangelog(),
        prerelease: lerna.version.includes('alpha')

@lerna/prompt

An internal Lerna tool

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis