Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Apollo icon to libs and repos maintained by Apollo #540

Merged
merged 4 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions implementations/apollo-server/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"repository": {
"name": "apollo-server",
"owner": "apollographql",
"maintainer" : "apollographql",
"link": "https://github.com/apollographql/apollo-server"
},
"coreLibrary": {
Expand All @@ -14,6 +15,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer": "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/dgs/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"federationlibrary": {
"name": "federation-jvm",
"owner": "apollographql",
"maintainer" : "apollographql",
"link": "https://github.com/apollographql/federation-jvm"
}
}
1 change: 1 addition & 0 deletions implementations/express-graphql/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/graphql-java-kickstart/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"federationlibrary": {
"name": "federation-jvm",
"owner": "apollographql",
"maintainer": "apollographql",
"link": "https://github.com/apollographql/federation-jvm"
}
}
1 change: 1 addition & 0 deletions implementations/graphql-yoga/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/helix/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/hotchocolate/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"federationlibrary": {
"name": "federation-hotchocolate",
"owner": "apollographql",
"maintainer": "apollographql",
"link": "https://github.com/apollographql/federation-hotchocolate"
}
}
1 change: 1 addition & 0 deletions implementations/mercurius/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/neo4j-graphql/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/nestjs-code-first/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/nestjs/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"federationlibrary": {
"name": "Apollo Subgraph",
"maintainer" : "apollographql",
"link": "https://www.npmjs.com/package/@apollo/subgraph"
}
}
1 change: 1 addition & 0 deletions implementations/spring-graphql/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"federationlibrary": {
"name": "federation-jvm",
"owner": "apollographql",
"maintainer": "apollographql",
"link": "https://github.com/apollographql/federation-jvm"
}
}
2 changes: 1 addition & 1 deletion implementations/strawberry-graphql/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repository": {
"name": "strawberry",
"owner": "strawberry-graphql",
"link": "https://github.com/strawberry-graphql/strawberry"
"link": "https://github.com/strawberry-graphql/strawberry",
},
"coreLibrary": {
"name": "GraphQL-core 3",
Expand Down
1 change: 1 addition & 0 deletions packages/compatibility/src/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export interface TestResultDetails {
export interface RepositoryInformation {
name: string;
owner?: string;
maintainer?: string;
link: string;
}

Expand Down
35 changes: 26 additions & 9 deletions packages/compatibility/src/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { writeFileSync } from 'fs';
import { resolve } from 'path';
import { TestResultDetails, TestResults, TESTS } from '../testRunner';

const apolloIcon: string =
'<img style="display:inline-block; height:1em; width:auto;" alt="Maintained by Apollo" src="https://apollo-server-landing-page.cdn.apollographql.com/_latest/assets/favicon.png"/>';
const apolloName: string = 'apollographql';

export function generateMarkdown(results: TestResultDetails[]) {
const markdownFile = new MarkdownFile(true);

Expand Down Expand Up @@ -60,6 +64,7 @@ class MarkdownFile {

| Icon | Description |
| ---- | ---------------------------------------------------- |
| ${apolloIcon} | Maintained by Apollo |
| 🟢 | Functionality is supported |
| ❌ | Critical functionality is NOT supported |
| 🔲 | Additional federation functionality is NOT supported |
Expand Down Expand Up @@ -123,7 +128,7 @@ class MarkdownFile {
}

renderSubgraphDetailsCell(result: TestResultDetails): String {
let content = `${result.description}</br></br>`;
let content = `${result.description}<br/><br/>`;

if (result.repository?.link) {
const starCount = Number(result.stargazerCount);
Expand All @@ -135,24 +140,36 @@ class MarkdownFile {
}
const lastReleaseDate = result.lastRelease.substring(0, 10);

content += `Github: <a href="${result.repository.link}">${result.repository.owner}/${result.repository.name}</a></br>
Type: ${result.type}</br>
Stars: ${stars} ⭐</br>
Last Release: ${lastReleaseDate}</br></br>`;
let repoName = result.repository.owner
? `${result.repository.owner}/${result.repository.name}`
: result.repository.name;
if (result.repository.maintainer === apolloName) {
repoName += `&nbsp;&nbsp;${apolloIcon}`;
}
content += `Github: <a href="${result.repository.link}">${repoName}</a><br/>
Type: ${result.type}<br/>
Stars: ${stars} ⭐<br/>
Last Release: ${lastReleaseDate}<br/><br/>`;
}

if (result.coreLibrary?.link) {
const coreLibraryName = result.coreLibrary.owner
let coreLibraryName = result.coreLibrary.owner
? `${result.coreLibrary.owner}/${result.coreLibrary.name}`
: result.coreLibrary.name;
content += `Core Library: <a href="${result.coreLibrary.link}">${coreLibraryName}</a></br>`;
if (result.coreLibrary.maintainer === apolloName) {
coreLibraryName += `&nbsp;&nbsp;${apolloIcon}`;
}
content += `Core Library: <a href="${result.coreLibrary.link}">${coreLibraryName}</a><br/>`;
}

if (result.federationlibrary?.link) {
const fedLibraryName = result.federationlibrary.owner
let fedLibraryName = result.federationlibrary.owner
? `${result.federationlibrary.owner}/${result.federationlibrary.name}`
: result.federationlibrary.name;
content += `Federation Library: <a href="${result.federationlibrary.link}">${fedLibraryName}</a></br>`;
if (result.federationlibrary.maintainer === apolloName) {
fedLibraryName += `&nbsp;&nbsp;${apolloIcon}`;
}
content += `Federation Library: <a href="${result.federationlibrary.link}">${fedLibraryName}</a><br/>`;
}

return content;
Expand Down
Loading