How to use the @s-ui/helpers/packages.getInternalDependencyMap function in @s-ui/helpers

To help you get started, we’ve selected a few @s-ui/helpers 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 SUI-Components / sui / packages / sui-mono / bin / sui-mono-link.js View on Github external
console.log('')
    console.log('  Examples:')
    console.log('')
    console.log('    $ sui-mono link')
    console.log('    $ sui-mono --help')
    console.log('    $ sui-mono -h')
    console.log('')
  })
  .parse(process.argv)

const packages = config.getScopes()
const cwd = path.join(process.cwd(), config.getPackagesFolder())
const packagesPaths = [...getPackagesPaths(cwd)(packages), process.cwd()]
const packagesNames = [...getPackagesNames(cwd)(packages), null]

const dependenciesMap = getInternalDependencyMap(packagesPaths)(packagesNames)
const usedDependenciesPaths = getUsedInternalDependencies(packagesPaths)(
  packagesNames
)
const createCommands = linkingMap => {
  const linkedPackages = []
  const createCommandsForMap = pkg => {
    const {name, path, deps} = pkg
    const commands = []
    if (deps.length) {
      deps.forEach(dep =>
        commands.push(...createCommandsForMap(linkingMap[dep]))
      )
      commands.push(['npm', ['link', ...deps], {cwd: path}])
    }
    if (
      usedDependenciesPaths.includes(path) &&