Skip to content

Commit 9470e1a

Browse files
feat: add OFREP API section to Ecosystem page (#1049)
## This PR - Adds a section to the Ecosystems page for listing the OFREP API compatible vendors/projects. --------- Signed-off-by: Jonathan Norris <[email protected]>
1 parent e01b522 commit 9470e1a

File tree

8 files changed

+97
-13
lines changed

8 files changed

+97
-13
lines changed

src/datasets/index.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
import { ECOSYSTEM_HOOKS } from './hooks';
2+
import { ECOSYSTEM_OFREP_APIS, OFREPElement } from './ofrep-api';
23
import { ECOSYSTEM_PROVIDERS } from './providers';
34
import { ECOSYSTEM_SDKS } from './sdks/ecosystem';
45
import { EcosystemElement, Technology, Type } from './types';
56

6-
export const ECOSYSTEM: EcosystemElement[] = [...ECOSYSTEM_SDKS, ...ECOSYSTEM_PROVIDERS, ...ECOSYSTEM_HOOKS].map(
7-
(s) => ({
8-
// Creates a unique id per item for the search index
9-
id: `${s.type}/${s.category}/${s.technology}/${s.vendor}/${s.href}`,
10-
...s,
11-
}),
12-
);
7+
export const ECOSYSTEM: (EcosystemElement | OFREPElement)[] = [
8+
...ECOSYSTEM_SDKS,
9+
...ECOSYSTEM_PROVIDERS,
10+
...ECOSYSTEM_HOOKS,
11+
...ECOSYSTEM_OFREP_APIS,
12+
].map((s) => ({
13+
// Creates a unique id per item for the search index
14+
id:
15+
'technology' in s && 'category' in s
16+
? `${s.type}/${s.category}/${s.technology}/${s.vendor}/${s.href}`
17+
: `${s.type}/${s.vendor}/${s.href}`,
18+
...s,
19+
}));
1320

1421
export const TECHNOLOGY_COLOR_MAP: Record<Technology, string> = {
1522
JavaScript: 'bg-yellow-50 text-yellow-600 ring-yellow-500/10',
@@ -33,4 +40,5 @@ export const TYPE_COLOR_MAP: Record<Type, string> = {
3340
Hook: 'bg-green-50 text-green-600 ring-green-500/10',
3441
Provider: 'bg-blue-50 text-blue-600 ring-blue-500/10',
3542
SDK: 'bg-violet-50 text-violet-600 ring-violet-500/10',
43+
'OFREP API': 'bg-orange-50 text-orange-600 ring-orange-500/10',
3644
};

src/datasets/ofrep-api/devcycle.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import DevCycleSvg from '@site/static/img/devcycle-no-fill.svg';
2+
import { OFREP_API } from '.';
3+
4+
export const DevCycle: OFREP_API = {
5+
name: 'DevCycle',
6+
logo: DevCycleSvg,
7+
description: 'DevCycle Bucketing API implementation of the OFREP API',
8+
href: 'https://docs.devcycle.com/integrations/openfeature#openfeature-remote-evaluation-api',
9+
vendorOfficial: true,
10+
};

src/datasets/ofrep-api/flagd.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import FlagdSvg from '@site/static/img/flagd-no-fill.svg';
2+
import { OFREP_API } from '.';
3+
4+
export const Flagd: OFREP_API = {
5+
name: 'flagd',
6+
logo: FlagdSvg,
7+
href: 'https://flagd.dev/reference/flagd-ofrep/?h=ofrep',
8+
vendorOfficial: true,
9+
};

src/datasets/ofrep-api/flipt.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import FliptSvg from '@site/static/img/flipt-no-fill.svg';
2+
import { OFREP_API } from '.';
3+
4+
export const Flipt: OFREP_API = {
5+
name: 'Flipt',
6+
logo: FliptSvg,
7+
href: 'https://docs.flipt.io/integration/openfeature#remote-evaluation-protocol',
8+
vendorOfficial: true,
9+
};

src/datasets/ofrep-api/goff.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import GoffSvg from '@site/static/img/goff-no-fill.svg';
2+
import { OFREP_API } from '.';
3+
4+
export const Goff: OFREP_API = {
5+
name: 'GO Feature Flag',
6+
logo: GoffSvg,
7+
href: 'https://gofeatureflag.org/docs/sdk/ofrep',
8+
vendorOfficial: true,
9+
};

src/datasets/ofrep-api/index.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { ComponentType, SVGProps } from 'react';
2+
import { DevCycle } from './devcycle';
3+
import { EcosystemElement } from '../types';
4+
import { Goff } from './goff';
5+
import { Flipt } from './flipt';
6+
import { Flagd } from './flagd';
7+
export type OFREPElement = Omit<EcosystemElement, 'allTechnologies' | 'technology' | 'category'>;
8+
9+
export const ECOSYSTEM_OFREP_APIS: OFREPElement[] = [DevCycle, Flipt, Goff, Flagd]
10+
.map(
11+
(api): OFREPElement => ({
12+
vendor: api.name,
13+
title: `${api.name} OFREP API`,
14+
description:
15+
typeof api.description === 'string' ? api.description : createDefaultDescription(api.name, api.vendorOfficial),
16+
type: 'OFREP API',
17+
logo: api.logo,
18+
href: api.href,
19+
vendorOfficial: api.vendorOfficial,
20+
}),
21+
)
22+
.flat();
23+
24+
function createDefaultDescription(vendor: string, official: boolean): string {
25+
return official ? `The official ${vendor} OFREP API` : `A community-maintained ${vendor} OFREP API`;
26+
}
27+
28+
export type OFREP_API = {
29+
name: string;
30+
logo: ComponentType<SVGProps<SVGSVGElement>>;
31+
description?: string;
32+
href: string;
33+
vendorOfficial: boolean;
34+
};

src/datasets/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type Technology =
3333
| 'SvelteKit';
3434

3535
export type Category = 'Server' | 'Client';
36-
export type Type = 'Hook' | 'Provider' | 'SDK';
36+
export type Type = 'Hook' | 'Provider' | 'SDK' | 'OFREP API';
3737

3838
export type SdkCompatibility = {
3939
/**

src/partials/ecosystem/hit.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import Link from '@docusaurus/Link';
66
import Pill from './pill';
77
import { TECHNOLOGY_COLOR_MAP, TYPE_COLOR_MAP } from '../../datasets';
88
import { EcosystemElement } from '../../datasets/types';
9+
import type { OFREPElement } from '../../datasets/ofrep-api';
910

10-
export default function Hit({ hit }: { hit: EcosystemElement }) {
11+
export default function Hit({ hit }: { hit: EcosystemElement | OFREPElement }) {
1112
const external = hit.href.startsWith('http');
1213
const Svg: ComponentType<SVGProps<SVGSVGElement>> = hit.logo;
1314

@@ -25,11 +26,15 @@ export default function Hit({ hit }: { hit: EcosystemElement }) {
2526
<h3>{hit.title}</h3>
2627
<p className="leading-snug line-clamp-3">{hit.description}</p>
2728
<div className="flex gap-2 flex-wrap-reverse mt-auto pt-4">
28-
<Pill color={TECHNOLOGY_COLOR_MAP[hit.technology]}>{hit.technology}</Pill>
29-
{hit.parentTechnology && (
30-
<Pill color={TECHNOLOGY_COLOR_MAP[hit.parentTechnology]}>{hit.parentTechnology}</Pill>
29+
{'technology' in hit && (
30+
<>
31+
<Pill color={TECHNOLOGY_COLOR_MAP[hit.technology]}>{hit.technology}</Pill>
32+
{hit.parentTechnology && (
33+
<Pill color={TECHNOLOGY_COLOR_MAP[hit.parentTechnology]}>{hit.parentTechnology}</Pill>
34+
)}
35+
<Pill>{hit.category}</Pill>
36+
</>
3137
)}
32-
<Pill>{hit.category}</Pill>
3338
<Pill color={TYPE_COLOR_MAP[hit.type]}>{hit.type}</Pill>
3439
</div>
3540
</Link>

0 commit comments

Comments
 (0)