Comments (5)
Partly as a quality thing, the fact that people can just add a Package.swift file to any repository seemed like a headache I could avoid. There's also the possibility that people will host elsewhere than GitHub, but honestly I think that's more of a theoretical advantage... π
But, I also didn't realise that GitHub could be queried like that with GraphQL. It's interesting. In theory the algorithm should make all the terrible packages that the query may find fade away. I'll have a play with it.
My big hope longer term is that the GitHub Package Registry will have an API, and that people will add their packages there, and I can use that as a definitive source for packages. π€
from packagelist.
I would assume that the Registry API is just the GH API.
You should contact @kiliankoe about that, but i think the GH API has severe limitations on how often and how much you can query, donβt remember the details.
(btw: the above is just extracted from Kilians swift catalog ...)
from packagelist.
Hi π
I used the following GraphQL query in apodidae to query for Swift packages on GitHub.
query ($query: String!) {
search(query: $query, type: REPOSITORY, first: 100) {
repositoryCount
repositories: edges {
node {
... on Repository {
nameWithOwner
description
url
isFork
parent {
nameWithOwner
}
isPrivate
pushedAt
license
openIssues: issues(first: 0, states: OPEN) {
totalCount
}
stargazers(first: 0) {
totalCount
}
packageManifest: object(expression: "master:Package.swift") {
... on Blob {
text
}
}
}
}
}
}
It definitely has a big drawback though. GitHub's GraphQL schema doesn't allow me to specify any filters based on the existence of file types, so the best I can do is query for the existence of a package manifest and filter client-side. This obviously only works (I believe the limit on results was 100 repos) when also specifying Swift as the main repository language in the search query (not shown here), but that assumption doesn't hold up for all SwiftPM packages. Packages in other languages or with lots of bundled documentation will be missing entirely :/
from packagelist.
I would assume that the Registry API is just the GH API.
I think that's possible, but as the GPR is quite a big push for GitHub and that it's so ripe for needing tools built around and on top of it, I'm hoping it gets specific API methods for itself.
from packagelist.
π @kiliankoe!
It definitely has a big drawback though. GitHub's GraphQL schema doesn't allow me to specify any filters based on the existence of file types, so the best I can do is query for the existence of a package manifest and filter client-side. This obviously only works (I believe the limit on results was 100 repos) when also specifying Swift as the main repository language in the search query (not shown here), but that assumption doesn't hold up for all SwiftPM packages. Packages in other languages or with lots of bundled documentation will be missing entirely :/
This is such great information, thank you.
I think what I'd like to do is continue with the current JSON approach for now, at least until the Xcode 11 release in September and see what Apple/GitHub put out alongside that.
I have a hundred things I'd like to do with the actual metadata that will continue to make the search results better, and the JSON approach will work for now. I'm going to put this on ice for a bit until it's clearer what the GPR will be.
from packagelist.
Related Issues (20)
- Add InsuranceCardScan Package HOT 2
- Add DirtyJSONSwift HOT 2
- Add ServiceLocator HOT 2
- Add push-sdk-ios HOT 2
- IP address library HOT 2
- Add `swift-sysctl` HOT 2
- Add Packages HOT 6
- Add swift-chess-neo HOT 2
- Add RakuyoKit packages HOT 1
- Add `SDCALayer` HOT 2
- Add `swift-utilities` (from danthorpe) HOT 2
- Add <Package> HOT 2
- Add `SyncStrem` HOT 2
- Add SnapCore HOT 2
- Add context-sdk-releases HOT 1
- Add Packet HOT 2
- Add SnapSettingsService, SnapMatchingNavigation HOT 1
- Add snap-settings-service HOT 1
- Add SnapSettingsService, SnapMatchingNavigation HOT 5
- Add snap-matching-navigation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packagelist.