Skip to content

Commit 5c0dc7d

Browse files
authored
fix Nightly Program detection for few specific cases (#2147)
1 parent 4be9854 commit 5c0dc7d

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

debug-github-repos.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,25 @@
6161
{
6262
"githubUrl": "https://github.com/kazimshah39/react-native-feather-toast",
6363
"expoGo": true
64+
},
65+
{
66+
"githubUrl": "https://github.com/lottie-react-native/lottie-react-native/tree/master/packages/core",
67+
"images": [
68+
"https://raw.githubusercontent.com/lottie-react-native/lottie-react-native/master/docs/gifs/Example1.gif",
69+
"https://raw.githubusercontent.com/lottie-react-native/lottie-react-native/master/docs/gifs/Example2.gif",
70+
"https://raw.githubusercontent.com/lottie-react-native/lottie-react-native/master/docs/gifs/Example3.gif",
71+
"https://raw.githubusercontent.com/lottie-react-native/lottie-react-native/master/docs/gifs/Example4.gif"
72+
],
73+
"examples": [
74+
"https://github.com/lottie-react-native/lottie-react-native/tree/master/example",
75+
"https://snack.expo.dev/SJdIbHe4b"
76+
],
77+
"ios": true,
78+
"android": true,
79+
"windows": true,
80+
"fireos": true,
81+
"expoGo": true,
82+
"vegaos": "@amazon-devices/lottie-react-native",
83+
"npmPkg": "lottie-react-native"
6484
}
6585
]

scripts/fetch-nightly-program-data.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import { makeGraphqlQuery } from '~/scripts/helpers';
22
import GitHubNightlyProgramQuery from '~/scripts/queries/GitHubNightlyProgramQuery';
3-
import { type LibraryType } from '~/types';
3+
import { type LibraryType, type NightlyProgramData } from '~/types';
44

55
export default async function fetchNightlyProgrammeData(list: LibraryType[]) {
66
const result = await makeGraphqlQuery(GitHubNightlyProgramQuery);
77

8-
const nightlyData = JSON.parse(result.data.repository.librariesJson.text);
9-
const nightlyLibraries = Object.keys(nightlyData);
8+
const nightlyData = JSON.parse(result.data.repository.librariesJson.text) as Record<
9+
string,
10+
NightlyProgramData
11+
>;
12+
13+
const nightlyLibraries = [
14+
...new Set([
15+
...Object.keys(nightlyData),
16+
...Object.values(nightlyData).flatMap(entry => entry.installCommand.split(' ')),
17+
]),
18+
];
1019

1120
list.map(library => {
1221
if (nightlyLibraries.includes(library.npmPkg)) {

types/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,12 @@ export type NpmUser = {
293293
oidcConfigId: string;
294294
};
295295
};
296+
297+
export type NightlyProgramData = {
298+
description: string;
299+
installCommand: string;
300+
android: boolean;
301+
ios: boolean;
302+
maintainersUsernames: string[];
303+
notes: string;
304+
};

0 commit comments

Comments
 (0)