instance method
packages_with_versions
Ruby on Rails 2.2.3
Since v1.1.6 Last seen in v2.2.3Signature
packages_with_versions()
No documentation comment.
Source
# File lib/importmap/npm.rb, line 51
def packages_with_versions
# We cannot use the name after "pin" because some dependencies are loaded from inside packages
# Eg. pin "buffer", to: "https://ga.jspm.io/npm:@jspm/core@2.0.0-beta.19/nodelibs/browser/buffer.js"
with_versions = importmap.scan(/^pin .*(?<=npm:|npm\/|skypack\.dev\/|unpkg\.com\/)([^@\/]+)@(\d+\.\d+\.\d+(?:[^\/\s"']*))/) |
importmap.scan(/#{PIN_REGEX} #.*@(\d+\.\d+\.\d+(?:[^\s]*)).*$/)
with_versions.map! do |package, version|
[extract_base_package_name(package), version]
end.uniq!
vendored_packages_without_version(with_versions).each do |package, path|
$stdout.puts "Ignoring #{package} (#{path}) since no version is specified in the importmap"
end
with_versions
end
Defined in lib/importmap/npm.rb line 51
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Importmap::Npm