Skip to content

Commit d9451cf

Browse files
moskalakamilSimek
andauthored
feat: add vegaos platform compatibility (#1921)
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
1 parent e9a4c0d commit d9451cf

File tree

8 files changed

+39
-17
lines changed

8 files changed

+39
-17
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
**(boolean)** - works with [Expo Go](https://docs.expo.dev/get-started/expo-go/) — an open-source sandbox app, without using [dev clients](https://docs.expo.dev/develop/development-builds/introduction/) or [prebuild](https://docs.expo.dev/workflow/continuous-native-generation/).
128128
- #### `fireos`
129129
**(boolean)** - works on Amazon Fire OS.
130+
- #### `vegaos`
131+
**(boolean)** - works with [Vega OS](https://developer.amazon.com/docs/react-native-vega/0.72/react_overview.html).
130132

131133
> [!TIP]
132134
> **Any** library can be used with Expo, if you use dev clients or prebuild.
@@ -173,7 +175,7 @@ You should be able to visit `localhost:3000` in your browser.
173175

174176
- Visit https://github.com/settings/developers to get your keys (don't worry about the callback URL, put whatever you want).
175177
- Load the `GITHUB_TOKEN` environment variable into your shell.
176-
- Set `ONLY_WRITE_LOCAL_DATA_FILE` to `true` in *scripts/build-and-score-data.ts* to skip fetching and updating store blob from Vercel and instead use and update the local `assets/data.json` file.
178+
- Set `ONLY_WRITE_LOCAL_DATA_FILE` to `true` in *scripts/build-and-score-data.ts* to skip fetching and updating store blob from Vercel and instead use and update the local `assets/data.json` file.
177179

178180
This command creates site data in `./assets/data.json`
179181

@@ -202,28 +204,28 @@ https://reactnative.directory/api/libraries
202204
```
203205
https://reactnative.directory/api/libraries?search=webgl
204206
```
205-
206-
- Returns a list of all libraries in `JSON` format that have the keyword `webgl`.
207-
207+
208+
- Returns a list of all libraries in `JSON` format that have the keyword `webgl`.
209+
208210
```
209211
https://reactnative.directory/api/libraries?search=webgl&expoGo=true
210212
```
211-
212-
- Returns a list of all libraries in `JSON` format that have the keyword `webgl` and work with Expo Go app.
213-
213+
214+
- Returns a list of all libraries in `JSON` format that have the keyword `webgl` and work with Expo Go app.
215+
214216
```
215217
https://reactnative.directory/api/libraries?search=webgl&expoGo=true&android=true
216218
```
217-
218-
- Returns a list of all libraries in `JSON` format that have the keyword `webgl`, work with Expo Go app and Android.
219-
219+
220+
- Returns a list of all libraries in `JSON` format that have the keyword `webgl`, work with Expo Go app and Android.
221+
220222
```
221223
https://reactnative.directory/api/libraries?search=webgl&expoGo=true&android=true&isPopular=true
222224
```
223-
224-
- Returns a list of all libraries in `JSON` format that have the keyword `webgl`, work with Expo Go app, Android and are popular based on the scoring criterion.
225-
226-
All the possible query parameters represents [`Query` type](https://github.com/react-native-community/directory/blob/main/types/index.ts#L14-L36).
225+
226+
- Returns a list of all libraries in `JSON` format that have the keyword `webgl`, work with Expo Go app, Android and are popular based on the scoring criterion.
227+
228+
All the possible query parameters represents [`Query` type](https://github.com/react-native-community/directory/blob/main/types/index.ts#L14-L36).
227229
</details>
228230

229231
## I don't like how you calculate scores.
@@ -240,4 +242,4 @@ https://reactnative.directory/api/libraries
240242
```sh
241243
# once environment variables are configured, install Vercel and deploy
242244
bunx vercel
243-
```
245+
```

components/CompatibilityTags.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function CompatibilityTags({ library }: Props) {
6464
/>
6565
) : null
6666
)}
67-
{(library.expoGo || library.fireos) && (
67+
{(library.expoGo || library.fireos || library.vegaos) && (
6868
<Tooltip
6969
side="bottom"
7070
trigger={
@@ -77,6 +77,7 @@ export function CompatibilityTags({ library }: Props) {
7777
<ul style={styles.compatibilityList}>
7878
{library.expoGo && <li>Works with Expo Go</li>}
7979
{library.fireos && <li>Works with Fire OS</li>}
80+
{library.vegaos && <li>Works with Vega OS</li>}
8081
</ul>
8182
</Tooltip>
8283
)}

components/Filters/helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ export const FILTER_COMPATIBILITY: FilterParamsType[] = [
8787
param: 'fireos',
8888
title: 'Works with Fire OS',
8989
},
90+
{
91+
param: 'vegaos',
92+
title: 'Works with Vega OS',
93+
},
9094
];
9195

9296
export const FILTER_TYPE: FilterParamsType[] = [

pages/api/libraries/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
7474
fireos: parsedQuery.fireos,
7575
tvos: parsedQuery.tvos,
7676
visionos: parsedQuery.visionos,
77+
vegaos: parsedQuery.vegaos,
7778
},
7879
hasExample: parsedQuery.hasExample,
7980
hasImage: parsedQuery.hasImage,

react-native-libraries.schema.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@
7676
true
7777
]
7878
},
79+
"vegaos": {
80+
"$id": "#/items/properties/vegaos",
81+
"type": "boolean",
82+
"title": "Package is compatible with Vega OS",
83+
"default": false,
84+
"examples": [true]
85+
},
7986
"expoGo": {
8087
"$id": "#/items/properties/expo",
8188
"type": "boolean",
@@ -218,4 +225,4 @@
218225
}
219226
}
220227
}
221-
}
228+
}

types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export type Query = {
2222
fireos?: string;
2323
tvos?: string;
2424
visionos?: string;
25+
vegaos?: string;
2526
web?: string;
2627
windows?: string;
2728
order?: QueryOrder;
@@ -135,6 +136,7 @@ export type LibraryDataEntryType = {
135136
fireos?: boolean;
136137
tvos?: boolean;
137138
visionos?: boolean;
139+
vegaos?: boolean;
138140
unmaintained?: boolean;
139141
dev?: boolean;
140142
template?: boolean;

util/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const VALID_ENTRY_KEYS = new Set([
1111
'fireos',
1212
'tvos',
1313
'visionos',
14+
'vegaos',
1415
'unmaintained',
1516
'dev',
1617
'template',

util/search.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ export function handleFilterLibraries({
153153
return false;
154154
}
155155

156+
if (support.vegaos && !library.vegaos) {
157+
return false;
158+
}
159+
156160
if (support.fireos && !library.fireos) {
157161
return false;
158162
}

0 commit comments

Comments
 (0)