Skip to content

Commit

Permalink
project-dashboard: Add Object-C and some other swift/objective-c pack…
Browse files Browse the repository at this point in the history
…age managers, and add square/aardvark and square/valet
  • Loading branch information
finn-block committed Feb 4, 2025
1 parent f65a5e3 commit a35f8da
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 deletions.
1 change: 1 addition & 0 deletions projects-dashboard/src/components/LanguageIcon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const iconMap = {
java: { icon: "java", color: "#b07219" },
python: { icon: "py", color: "#3572A5" },
ruby: { icon: "ruby", color: "#701516" },
"objective-c": { icon: "objective-c", color: "#438eff" },
};
---

Expand Down
11 changes: 9 additions & 2 deletions projects-dashboard/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const languageSchema = z.enum([
"java",
"python",
"ruby",
"objective-c",
]);

export type Language = z.infer<typeof languageSchema>;
Expand All @@ -29,7 +30,10 @@ const artifactTypeSchema = z.enum([
"reference-docs",
"pypi",
"cocoapods",
"rubygems"
"rubygems",
"spi", // Swift Package Index
"cocoapods",
"carthage",
]);

export type ArtifactType = z.infer<typeof artifactTypeSchema>;
Expand Down Expand Up @@ -72,7 +76,10 @@ const badgeTypeSchema = z.enum([
"github-discussions",
"slack",
"link",
"rubygems"
"rubygems",
"spi",
"cocoapods",
"carthage",
]);

export type BadgeType = z.infer<typeof badgeTypeSchema>;
Expand Down
26 changes: 26 additions & 0 deletions projects-dashboard/src/content/project/square_aardvark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
repo:
owner: "square"
name: aardvark
defaultBranch: "master"
title: Aardvark
description: Aardvark is a library that makes it dead simple to create actionable bug reports.
branding: square
lifeCycleStatus: "mature"
ciChecks:
- type: "github-actions"
label: build
value: ci.yml
licenses:
- type: "github-license"
contributing:
- type: "contribution-guidelines"
value: "Contributing.md"
- type: "issues"
packages:
- packageName: aardvark
language: objective-c
artifacts:
- type: cocoapods
value: Aardvark
---
28 changes: 28 additions & 0 deletions projects-dashboard/src/content/project/square_valet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
repo:
owner: "square"
name: valet
defaultBranch: main
title: Valet
description: Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.
branding: square
lifeCycleStatus: mature
ciChecks:
- type: github-actions
label: ci
value: ci.yml
licenses:
- type: "github-license"
contributing:
- type: "contribution-guidelines"
value: "Contributing.md"
- type: "issues"
packages:
- packageName: valet
language: swift
artifacts:
- type: spi
value: square/Valet
- type: cocoapods
value: Valet
---
14 changes: 13 additions & 1 deletion projects-dashboard/src/lib/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,23 @@ function getRubygemsBadge(value?: string): [string, string] {
throw new Error("gem name required for badge");
}


let badgeSrc = `https://img.shields.io/gem/v/${value}`
let href = `https://rubygems.org/gems/${value}`

return [badgeSrc, href];
}

function getSpiBadge(value?: string): [string, string] {
if (!value) {
throw new Error("gem name required for badge");
}

let badgeSrc = `https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2F${encodeURIComponent(value)}%2Fbadge%3Ftype%3Dswift-versions`
let href = `https://swiftpackageindex.com/${value}`

return [badgeSrc, href];
}

export function getBadgeInfo(
repo: Repo,
badge: Badge,
Expand Down Expand Up @@ -320,6 +330,8 @@ export function getBadgeInfo(
return getLinkBadge(label, value);
case "rubygems":
return getRubygemsBadge(value);
case "spi":
return getSpiBadge(value);
default:
throw new Error(`Unknown badge type: ${type}`);
}
Expand Down

0 comments on commit a35f8da

Please sign in to comment.