Module: CodeOwnership::Private::ParseJsPackages

Extended by:
T::Sig
Defined in:
lib/code_ownership/private/parse_js_packages.rb

Overview

Modeled off of ParsePackwerk

Defined Under Namespace

Classes: Package

Constant Summary collapse

ROOT_PACKAGE_NAME =
'root'
PACKAGE_JSON_NAME =
T.let('package.json', String)
METADATA =
'metadata'

Class Method Summary collapse

Class Method Details

.allObject



57
58
59
60
61
62
63
64
65
66
# File 'lib/code_ownership/private/parse_js_packages.rb', line 57

def self.all
  package_glob_patterns = Private.configuration.js_package_paths.map do |pathspec|
    File.join(pathspec, PACKAGE_JSON_NAME)
  end

  # The T.unsafe is because the upstream RBI is wrong for Pathname.glob
  T.unsafe(Pathname).glob(package_glob_patterns).map(&:cleanpath).map do |path|
    Package.from(path)
  end
end