How to use the @instructure/pkg-utils.getPackages function in @instructure/pkg-utils

To help you get started, we’ve selected a few @instructure/pkg-utils 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 instructure / instructure-ui / packages / cz-lerna-changelog / lib / index.js View on Github external
return function (cz, commit) {
    const scope = '@instructure'
    const allPackages = getPackages()
    const changedPackages = getChangedPackages('--cached', allPackages).map(pkg => pkg.name.replace(`${scope}/`, ''))
    const packageNames = allPackages.map(pkg => pkg.name.replace(`${scope}/`, ''))
    const questions = makeDefaultQuestions(packageNames, changedPackages)

    // eslint-disable-next-line no-console
    console.info('\n\nLine 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.\n')

    cz.registerPrompt('autocomplete', autocomplete)

    cz.prompt(autocompleteQuestions(questions))
      .then((answers) => {
        const {
          body,
          footer,
          ...rest
        } = answers
github instructure / instructure-ui / packages / ui-scripts / lib / deprecate.js View on Github external
async function deprecate (versionToDeprecate, fixVersion, config) {
  const message = fixVersion ? `A critical bug was fixed in ${fixVersion}` : ''
  createNPMRCFile(config)

  info(`📦  Version to deprecate: ${versionToDeprecate}`)
  const reply = await confirm('Continue? [y/n]\n')
  if (!['Y', 'y'].includes(reply.trim())) {
    process.exit(0)
  }

  return Promise.all(getPackages().map(async pkg => {
    if (pkg.private) {
      info(`${pkg.name} is private.`)
    } else {
      const toDeprecate = `${pkg.name}@${versionToDeprecate}`

      info(`📦  Deprecating ${toDeprecate}...`)

      try {
        await runCommandAsync('npm', ['deprecate', toDeprecate, message])
      } catch (err) {
        error(err)
      }
      info(`📦  ${toDeprecate} was successfully deprecated!`)
    }
  }))
}
github instructure / instructure-ui / packages / ui-scripts / lib / tag.js View on Github external
async function distTag (command, versionToTag, tag, config) {
  createNPMRCFile(config)

  info(`📦  Version to tag as ${tag}: ${versionToTag}`)
  const reply = await confirm('Continue? [y/n]\n')
  if (!['Y', 'y'].includes(reply.trim())) {
    process.exit(0)
  }

  return Promise.all(getPackages().map(async pkg => {
    if (pkg.private) {
      info(`${pkg.name} is private.`)
    } else {
      const toTag = `${pkg.name}@${versionToTag}`
      info(`📦  Running 'dist-tag ${command} ${toTag} ${tag}'...`)
      try {
        await runCommandAsync('npm', ['dist-tag', command, toTag, tag])
      } catch (err) {
        error(err)
      }
      info(`📦  ${toTag} tags were successfully updated!`)
    }
  }))
}
github instructure / instructure-ui / packages / ui-scripts / lib / link-packages.js View on Github external
async function getUsedPackages() {
  const usedPackages = (await Promise.all(
    getPackages().map(async pkg => {
      let packageIsUsed = false
      try {
        const { stdout } = await runCommandAsync('yarn', ['why', pkg.name, '--cwd', appDir], [], { stdio: 'pipe'})
        info(stdout)
        packageIsUsed = stdout.includes(' Found')
      } catch (err) {
        info(`${pkg.name} is not used. ${err}`)
      }
      if (packageIsUsed) return pkg
    })
  )).filter(Boolean)
  return usedPackages
}

@instructure/pkg-utils

Utilities for managing node packages in a monorepo.

MIT
Latest version published 2 months ago

Package Health Score

82 / 100
Full package analysis

Similar packages