tooling/lib/dependencies.js
function listEntryPoints(pkg) {
  debug(`listing entrypoints for ${pkg.name}`);
  if (!pkg.name) {
    throw new Error('cannot read dependencies for unnamed package');
  }
  let paths = [];

  if (pkg.main) {
    debug(`found main path for ${pkg.name}`);
    paths.push(pkg.main);
  }

  if (pkg.bin) {
    debug(`found bin entry(s) for ${pkg.name}`);
    paths = paths.concat(values(pkg.bin));
  }

  if (pkg.browser) {
    debug(`found browser entry(s) for ${pkg.name}`);
    paths = paths.concat(values(pkg.browser).filter((p) => p && !p.startsWith('@')));
  }

  debug(paths);

  return paths
    .map((p) => path.resolve('packages', 'node_modules', pkg.name, p));
}
function listEntryPoints(pkg) {
  debug(`listing entrypoints for ${pkg.name}`);
  if (!pkg.name) {
    throw new Error('cannot read dependencies for unnamed package');
  }
  let paths = [];

  if (pkg.main) {
    debug(`found main path for ${pkg.name}`);
    paths.push(pkg.main);
  }

  if (pkg.bin) {
    debug(`found bin entry(s) for ${pkg.name}`);
    paths = paths.concat(values(pkg.bin));
  }

  if (pkg.browser) {
    debug(`found browser entry(s) for ${pkg.name}`);
    paths = paths.concat(values(pkg.browser).filter((p) => p && !p.startsWith('@')));
  }

  debug(paths);

  return paths
    .map((p) => path.resolve('packages', 'node_modules', pkg.name, p));
}
function listEntryPoints ( pkg ) { debug ( ` ${ pkg . name } ` ) ; if ( ! pkg . name ) { throw new Error ( 'cannot read dependencies for unnamed package' ) ; } let paths = [ ] ; if ( pkg . main ) { debug ( ` ${ pkg . name } ` ) ; paths . push ( pkg . main ) ; } if ( pkg . bin ) { debug ( ` ${ pkg . name } ` ) ; paths = paths . concat ( values ( pkg . bin ) ) ; } if ( pkg . browser ) { debug ( ` ${ pkg . name } ` ) ; paths = paths . concat ( values ( pkg . browser ) . filter ( ( p ) => p && ! p . startsWith ( '@' ) ) ) ; } debug ( paths ) ; return paths . map ( ( p ) => path . resolve ( 'packages' , 'node_modules' , pkg . name , p ) ) ; }
Finds all the entrypoints for the specified package
@param {Object} pkg
@returns {Array<string>}
Finds all the entrypoints for the specified package