ecosystems-bibliothecary 15.3.0 → 15.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +5 -1
- data/lib/bibliothecary/parsers/bazel.rb +65 -0
- data/lib/bibliothecary/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9b737a0f2ae5bf0446ef878a8f50074dff5b40eaaff1fbf487e35a4dc61dab7
|
|
4
|
+
data.tar.gz: bd98a9d57a7fab6169b011b9782bdc403dafda174505184564745963dda8c5a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4a8176935149d241d23abe6be2ed8566ff33ef16fb8ca4b08a2a053e4965fee3714f941b4da9adbf287e0ee87cc068c181e4b15f8197263c8988489e1acf39b
|
|
7
|
+
data.tar.gz: 63fd2a8f0c168af999f2ff785e3e34189b6afe09d8c66dc4974f365461b233ca52d396667647362b23cb17aea9c3bad7c48b0778dc731b4ce4162e290fd028c8
|
data/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
13
|
|
|
14
14
|
### Removed
|
|
15
15
|
|
|
16
|
+
## [15.4.0]
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Parser for MODULE.bazel manifests
|
|
21
|
+
|
|
16
22
|
## [15.3.0]
|
|
17
23
|
|
|
18
24
|
### Added
|
|
@@ -158,7 +164,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
158
164
|
|
|
159
165
|
### Added
|
|
160
166
|
|
|
161
|
-
- Added Bibliothecary::ParserResult class, which wraps the parsed dependencies along with the project name, if it was found in the manifest.
|
|
167
|
+
- Added Bibliothecary::ParserResult class, which wraps the parsed dependencies along with the project name, if it was found in the manifest.
|
|
162
168
|
|
|
163
169
|
### Changed
|
|
164
170
|
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bibliothecary
|
|
2
2
|
|
|
3
|
-
Dependency manifest parsing library for https://github.com/ecosyste-ms
|
|
3
|
+
Dependency manifest parsing library for https://github.com/ecosyste-ms
|
|
4
4
|
|
|
5
5
|
This is a maintained fork of the original [Bibliothecary](https://github.com/librariesio/bibliothecary) gem, with support for additional manifest formats and bug fixes.
|
|
6
6
|
|
|
@@ -98,6 +98,8 @@ The `integrity` field is populated for lockfiles that include per-dependency has
|
|
|
98
98
|
- environment.yaml
|
|
99
99
|
- Apk
|
|
100
100
|
- APKBUILD
|
|
101
|
+
- Bazel
|
|
102
|
+
- MODULE.bazel
|
|
101
103
|
- BentoML
|
|
102
104
|
- bentofile.yaml
|
|
103
105
|
- Bower
|
|
@@ -274,6 +276,8 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
|
274
276
|
|
|
275
277
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
276
278
|
|
|
279
|
+
To regenerate the supported file formats list in this README, run `bundle exec rake readme:update`.
|
|
280
|
+
|
|
277
281
|
To release a new version:
|
|
278
282
|
* in `CHANGELOG.md`, move the changes under `"Unreleased"` into a new section with your version number
|
|
279
283
|
* bump and commit the version number in `version.rb` in the `main` branch
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bibliothecary
|
|
4
|
+
module Parsers
|
|
5
|
+
class Bazel
|
|
6
|
+
include Bibliothecary::Analyser
|
|
7
|
+
|
|
8
|
+
BAZEL_DEP_STATEMENT = %r{
|
|
9
|
+
^\s*bazel_dep\s*
|
|
10
|
+
(?<bal>
|
|
11
|
+
\(
|
|
12
|
+
(?:
|
|
13
|
+
[^()"'\\]+
|
|
14
|
+
| "(?:\\.|[^"\\])*"
|
|
15
|
+
| '(?:\\.|[^'\\])*'
|
|
16
|
+
| \\ .
|
|
17
|
+
| \g<bal>
|
|
18
|
+
)*
|
|
19
|
+
\)
|
|
20
|
+
)
|
|
21
|
+
}mx
|
|
22
|
+
|
|
23
|
+
# key/value extraction inside the call
|
|
24
|
+
DEPENDENCY_NAME = /(?:^|[,(]\s*)name\s*=\s*(?<quote>["'])(?<value>(?:\\.|(?!\k<quote>).)*)\k<quote>/m
|
|
25
|
+
DEPENDENCY_VERSION = /(?:^|[,(]\s*)version\s*=\s*(?<quote>["'])(?<value>(?:\\.|(?!\k<quote>).)*)\k<quote>/m
|
|
26
|
+
DEPENDENCY_TYPE = /(?:^|[,(]\s*)dev_dependency\s*=\s*(?<value>True|False)\b/m
|
|
27
|
+
|
|
28
|
+
def self.file_patterns
|
|
29
|
+
["MODULE.bazel"]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.mapping
|
|
33
|
+
{
|
|
34
|
+
match_filename("MODULE.bazel") => {
|
|
35
|
+
kind: "manifest",
|
|
36
|
+
parser: :parse_module_bazel,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.parse_module_bazel(file_contents, options: {})
|
|
42
|
+
source = options.fetch(:filename, nil)
|
|
43
|
+
|
|
44
|
+
dependencies = file_contents.scan(BAZEL_DEP_STATEMENT).filter_map do |(statement)|
|
|
45
|
+
name_match = statement.match(DEPENDENCY_NAME)
|
|
46
|
+
next unless name_match
|
|
47
|
+
|
|
48
|
+
parsed_version = statement.match(DEPENDENCY_VERSION)
|
|
49
|
+
parsed_type = statement.match(DEPENDENCY_TYPE)
|
|
50
|
+
version = parsed_version ? parsed_version[:value] : "*"
|
|
51
|
+
type = parsed_type && parsed_type[:value] == "True" ? "development" : "runtime"
|
|
52
|
+
|
|
53
|
+
Dependency.new(
|
|
54
|
+
platform: platform_name,
|
|
55
|
+
name: name_match[:value],
|
|
56
|
+
requirement: version,
|
|
57
|
+
type: type,
|
|
58
|
+
source: source
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
ParserResult.new(dependencies: dependencies)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecosystems-bibliothecary
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 15.
|
|
4
|
+
version: 15.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Nesbitt
|
|
@@ -119,6 +119,7 @@ files:
|
|
|
119
119
|
- lib/bibliothecary/parsers/actions.rb
|
|
120
120
|
- lib/bibliothecary/parsers/alpm.rb
|
|
121
121
|
- lib/bibliothecary/parsers/apk.rb
|
|
122
|
+
- lib/bibliothecary/parsers/bazel.rb
|
|
122
123
|
- lib/bibliothecary/parsers/bentoml.rb
|
|
123
124
|
- lib/bibliothecary/parsers/bower.rb
|
|
124
125
|
- lib/bibliothecary/parsers/cargo.rb
|