-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ | |
'openmandriva', | ||
'openpkg', | ||
'opensuse', | ||
'openvsx', | ||
'openwrt', | ||
'os4depot', | ||
'pacstall', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (C) 2024 Gavin John <gavinnjohn@gmail.com> | ||
# | ||
# This file is part of repology | ||
# | ||
# repology is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# repology is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with repology. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import json | ||
|
||
from typing import Iterable | ||
|
||
from repology.packagemaker import NameType, PackageFactory, PackageMaker | ||
from repology.parsers import Parser | ||
|
||
|
||
class OpenVSXParser(Parser): | ||
def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMaker]: | ||
with open(path, "r"): | ||
extension_data = json.load() | ||
raw_extensions = extension_data["extensions"] | ||
|
||
for extension in raw_extensions: | ||
with factory.begin() as pkg: | ||
# TODO: More metadata is available, it's just harder to fetch and will require its own fetcher, in all likelihood | ||
pkg.add_name("vscode-extension:{namespace}-{name}".format(**extension), NameType.GENERIC_SRC_NAME) | ||
pkg.set_version(extension["version"]) | ||
pkg.set_summary(extension["description"]) | ||
pkg.add_maintainers("{namespace}@openvsx".format(**extension)) | ||
pkg.add_homepages("https://open-vsx.org/extension/{namespace}/{name}".format(**extension)) | ||
pkg.add_downloads(extension["files"]["download"]) | ||
|
||
yield pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
########################################################################### | ||
# OpenVSX | ||
########################################################################### | ||
- name: openvsx | ||
type: repository | ||
desc: OpenVSX | ||
family: openvsx | ||
ruleset: openvsx | ||
minpackages: 3000 | ||
sources: | ||
- name: packages | ||
fetcher: | ||
class: FileFetcher | ||
url: https://open-vsx.org/api/-/search?size=10000 # TODO: Do proper pagination | ||
allow_zero_size: false | ||
parser: | ||
class: OpenVSXParser | ||
repolinks: | ||
- desc: OpenVSX registry | ||
url: https://open-vsx.org/ | ||
packagelinks: [] | ||
groups: [ all, production ] |