From 682f1c5e4d4c3d639643fc7179843781f5c04dbd Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Tue, 27 Jan 2026 11:30:51 +0100 Subject: [PATCH 1/2] add `alternatives` field checks for the new entries --- scripts/validate-new-entries.ts | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/scripts/validate-new-entries.ts b/scripts/validate-new-entries.ts index 45172f288..d1f6edaba 100644 --- a/scripts/validate-new-entries.ts +++ b/scripts/validate-new-entries.ts @@ -1,6 +1,7 @@ import { fetch } from 'bun'; import { differenceWith, isEqual } from 'es-toolkit'; +import { type LibraryType } from '~/types'; import { VALID_ENTRY_KEYS } from '~/util/Constants'; import libraries from '../react-native-libraries.json'; @@ -105,6 +106,43 @@ for (let i = 0; i < modifiedEntries.length; i += BATCH_SIZE) { return false; } + if (entryWithGitHubData?.alternatives && entryWithGitHubData.alternatives.length > 0) { + const alternativesDataResponse = await fetch( + `https://reactnative.directory/api/library?name=${entryWithGitHubData.alternatives.join(',')}` + ); + + if (alternativesDataResponse.status !== 200) { + console.error('Cannot check the alternative library existence in the directory.'); + return false; + } + + const alternativesDataJson = (await alternativesDataResponse.json()) as Record< + string, + LibraryType + >; + + const alternativesChecks = entryWithGitHubData.alternatives.map(alternative => { + if (alternative in alternativesDataJson) { + if (!alternativesDataJson[alternative].unmaintained) { + console.error( + `${alternative} is not marked as unmaintained in the directory, so it cannot be defined as an alternative for the package.` + ); + return false; + } + } else { + console.error( + `${alternative} is not listed in the directory, so it cannot be defined as an alternative for the package.` + ); + return false; + } + return true; + }); + + if (alternativesChecks.includes(false)) { + return false; + } + } + return true; })() ) From baad4ab76e6a597760afbbb3208b3c05299a9ca0 Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Tue, 27 Jan 2026 11:37:09 +0100 Subject: [PATCH 2/2] add missing `--check` flag to Oxfmt in workflow, reformat data file --- .github/workflows/data-test-and-validate.yml | 2 +- react-native-libraries.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/data-test-and-validate.yml b/.github/workflows/data-test-and-validate.yml index ee2e2df09..431ca10d5 100644 --- a/.github/workflows/data-test-and-validate.yml +++ b/.github/workflows/data-test-and-validate.yml @@ -25,4 +25,4 @@ jobs: env: CI_CHECKS_TOKEN: ${{ github.token }} - name: Lint data - run: bun oxfmt react-native-libraries.json + run: bun oxfmt react-native-libraries.json --check diff --git a/react-native-libraries.json b/react-native-libraries.json index 46dd41fef..4c49cbe0b 100644 --- a/react-native-libraries.json +++ b/react-native-libraries.json @@ -19284,7 +19284,7 @@ "android": true, "newArchitecture": true }, - { + { "githubUrl": "https://github.com/Gautham495/react-native-nitro-ios-alarm-kit", "examples": [ "https://github.com/Gautham495/react-native-nitro-ios-alarm-kit/tree/main/example"