From 610a906754b627013afb8b9b9018ab99df1e640d Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 8 Aug 2024 12:18:09 -0400 Subject: [PATCH] Update throughout --- contrib/example-schema.json | 50 +++++++++------------------------ src/content/config.ts | 4 +-- src/content/members/sentry.json | 6 ++-- src/member_util.ts | 10 ++----- src/pages/members/[id].astro | 35 +++++------------------ 5 files changed, 27 insertions(+), 78 deletions(-) diff --git a/contrib/example-schema.json b/contrib/example-schema.json index ce4aea03..330a8563 100644 --- a/contrib/example-schema.json +++ b/contrib/example-schema.json @@ -1,50 +1,26 @@ { - "domain": "sentry.io", + "domain": "example.com", "datetimeModified": "2024-08-05T01:00:00Z", - "description": "People sometimes ask why Sentry is an open source company. However, they are typically asking about our business model: conversion funnel, product roadmap, monetization strategy. In our experience as engineers and as professionals, there is no other choice but open source for building a viable software company serving modern development cycles. As a mantra, Sentry is an open source company because the right to learn and to share what is learned with others is fundamental to product growth and relevance.", - "name": "Sentry", + "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", + "name": "Acme Widgets", "urlSquareLogoWithBackground": "https://avatars.githubusercontent.com/u/1396951?s=200&v=4", - "urlLearnMore": "https://open.sentry.io/osspledge/", + "urlLearnMore": "https://example.com/osspledge/", "annualReports": [ { - "dateYearEnding": "2023-01-31", + "url": "https://example.com/blog/2", + "dateYearEnding": "2023-12-31", "averageNumberOfDevs": 135, - "monetaryPayments": [ - { - "amount": 435000, - "urlDetails": "https://thanks.dev/d/gh/getsentry/dependencies" - }, - { - "amount": 50000, - "urlDetails": "https://github.com/orgs/getsentry/sponsoring" - }, - { - "amount": 15000, - "urlDetails": "https://blog.sentry.io/we-just-gave-500-000-dollars-to-open-source-maintainers/" - } - ], + "paymentsToProjects": 500000, "monetaryValueOfTime": 100000, "monetaryValueOfMaterials": 500000 }, { - "dateYearEnding": "2023-01-31", - "averageNumberOfDevs": 135, - "monetaryPayments": [ - { - "amount": 435000, - "urlDetails": "https://thanks.dev/d/gh/getsentry/dependencies" - }, - { - "amount": 50000, - "urlDetails": "https://github.com/orgs/getsentry/sponsoring" - }, - { - "amount": 15000, - "urlDetails": "https://blog.sentry.io/we-just-gave-500-000-dollars-to-open-source-maintainers/" - } - ], - "monetaryValueOfTime": 100000, - "monetaryValueOfMaterials": 500000 + "url": "https://example.com/blog/1", + "dateYearEnding": "2022-12-31", + "averageNumberOfDevs": 100, + "paymentsToProjects": 400000, + "monetaryValueOfTime": 10000, + "monetaryValueOfMaterials": 50000 } ] } diff --git a/src/content/config.ts b/src/content/config.ts index ba9827e1..9cf4df20 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -6,7 +6,7 @@ import { z, defineCollection } from "astro:content"; * need to understand how to format it, you've found the source of truth. If * you have questions or run into limitations, please open an issue: * - * https://github.com/getsentry/osspledge.com/issues/new + * https://github.com/opensourcepledge/osspledge.com/issues/new * */ @@ -18,7 +18,7 @@ const monetaryPayment = z.object({ const memberReport = z.object({ dateYearEnding: z.string().date(), averageNumberOfDevs: z.number().nonnegative(), - monetaryPayments: monetaryPayment.array().nonempty(), + paymentsToProjects: z.number().nonnegative(), monetaryValueOfTime: z.number().nonnegative(), monetaryValueOfMaterials: z.number().nonnegative(), }); diff --git a/src/content/members/sentry.json b/src/content/members/sentry.json index 334ad2d4..5e478141 100644 --- a/src/content/members/sentry.json +++ b/src/content/members/sentry.json @@ -10,19 +10,19 @@ "url": "https://blog.sentry.io/we-just-gave-500-000-dollars-to-open-source-maintainers/", "dateYearEnding": "2024-01-31", "averageNumberOfDevs": 135, - "moneyToIndependentMaintainers": 500000 + "paymentsToProjects": 500000 }, { "url": "https://blog.sentry.io/we-just-gave-260-028-dollars-to-open-source-maintainers/", "dateYearEnding": "2023-01-31", "averageNumberOfDevs": 130, - "moneyToIndependentMaintainers": 260280 + "paymentsToProjects": 260280 }, { "url": "https://blog.sentry.io/we-just-gave-154-999-dollars-and-89-cents-to-open-source-maintainers/", "dateYearEnding": "2022-01-31", "averageNumberOfDevs": 75, - "moneyToIndependentMaintainers": 155000 + "paymentsToProjects": 155000 } ] } diff --git a/src/member_util.ts b/src/member_util.ts index 172e66ac..31211687 100644 --- a/src/member_util.ts +++ b/src/member_util.ts @@ -33,18 +33,12 @@ export async function getMembers(): Promise { } } -export function getReportCashTotal(report: MemberReport) { - return report.monetaryPayments - .map((d) => d.amount) - .reduce((acc, d) => acc + d, 0); -} - export function getReportFullTotal(report: MemberReport) { - return getReportCashTotal(report) + report.monetaryValueOfTime + report.monetaryValueOfMaterials; + return report.paymentsToProjects + report.monetaryValueOfTime + report.monetaryValueOfMaterials; } export function getDollarsPerDev(report: MemberReport) { - return getReportCashTotal(report) / report.averageNumberOfDevs; + return report.paymentsToProjects / report.averageNumberOfDevs; } export function fmtCurrency(num: number) { diff --git a/src/pages/members/[id].astro b/src/pages/members/[id].astro index 252e71a3..956c95bf 100644 --- a/src/pages/members/[id].astro +++ b/src/pages/members/[id].astro @@ -55,48 +55,27 @@ function getPlatformName(url: string) { {fmtCurrency(getDollarsPerDev(report))} / dev -

Payments to Independent Maintainers

- + - {report.monetaryPayments.map(entry => - - - )} - - - - - - + + - - + + -
PlatformItem Amount ($)
{entry.urlDetails && {getPlatformName(entry.urlDetails)}}{fmtCurrency(entry.amount)}
Total{fmtCurrency(getReportCashTotal(report))}
Average number of devs{report.averageNumberOfDevs}Payments to Projects{fmtCurrency(report.paymentsToProjects)}
$ / dev{fmtCurrency(getDollarsPerDev(report))}= {fmtCurrency(getDollarsPerDev(report))} / dev
- -

Other Contributions

- - - - - - + - + - - - -
ItemAmount ($)
Value of timeValue of Time {fmtCurrency(report.monetaryValueOfTime)}
Value of materialsValue of Materials {fmtCurrency(report.monetaryValueOfMaterials)}
Payments to independent maintainers{fmtCurrency(getReportCashTotal(report))}
Total {fmtCurrency(getReportFullTotal(report))}