Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,043 changes: 7,043 additions & 0 deletions assets/check-data.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"@react-native-picker/picker": "^2.11.4",
"@sentry/react": "^10.22.0",
"es-toolkit": "^1.41.0",
"expo": "54.0.20",
"expo": "54.0.21",
"expo-font": "^14.0.9",
"next": "^16.0.0",
"next": "^16.0.1",
"node-emoji": "^2.2.0",
"react": "19.2.0",
"react-content-loader": "^7.1.1",
Expand All @@ -42,7 +42,7 @@
},
"devDependencies": {
"@expo/next-adapter": "^6.0.0",
"@next/bundle-analyzer": "^16.0.0",
"@next/bundle-analyzer": "^16.0.1",
"@prettier/plugin-oxc": "^0.0.4",
"@types/bun": "^1.3.1",
"@types/react": "^19.2.2",
Expand All @@ -52,7 +52,7 @@
"cheerio": "^1.1.2",
"dotenv": "^17.2.3",
"eslint": "^9.38.0",
"eslint-config-next": "^16.0.0",
"eslint-config-next": "^16.0.1",
"eslint-config-universe": "^15.0.3",
"lint-staged": "^16.2.6",
"next-compose-plugins": "^2.2.1",
Expand Down
25 changes: 4 additions & 21 deletions pages/api/libraries/check.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
import { type NextApiRequest, type NextApiResponse } from 'next';

import data from '~/assets/data.json';
import { type DataAssetType } from '~/types';
import { getNewArchSupportStatus, NewArchSupportStatus } from '~/util/newArchStatus';
import data from '~/assets/check-data.json';
import { type CheckResultsType } from '~/types';

type CheckResultsType = Record<
string,
{
unmaintained?: boolean;
newArchitecture: NewArchSupportStatus;
}
>;

// Copy data into an object that is keyed by npm package name for faster lookup
const dataByNpmPackage: CheckResultsType = {};

(data as DataAssetType).libraries.forEach(library => {
dataByNpmPackage[library.npmPkg] = {
unmaintained: library.unmaintained,
newArchitecture: getNewArchSupportStatus(library),
};
});
const DATASET = data as CheckResultsType;

// Provide library metadata for a list of npm packages
export default function handler(req: NextApiRequest, res: NextApiResponse) {
Expand All @@ -41,7 +24,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
res.statusCode = 200;
const result: CheckResultsType = {};
packages.forEach(pkgName => {
result[pkgName] = dataByNpmPackage[pkgName];
result[pkgName] = DATASET[pkgName];
});

return res.json(result);
Expand Down
Binary file added public/fonts/Optimistic-Display-Bold.woff2
Binary file not shown.
Binary file added public/fonts/Optimistic-Display-Light.woff2
Binary file not shown.
Binary file added public/fonts/Optimistic-Display-Regular.woff2
Binary file not shown.
65 changes: 34 additions & 31 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
{
"name": "React Native Directory",
"short_name": "RND",
"description": "A searchable and filterable directory of React Native libraries",
"lang": "en-US",
"categories": ["education", "utilities"],
"display": "minimal-ui",
"orientation": "any",
"start_url": "/",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+rnd",
"url": "/?search=%s"
}
],
"theme_color": "#20232a",
"background_color": "#20232a",
"icons": [
{
"src": "/icon-192px.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icon-512px.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
"name": "React Native Directory",
"short_name": "RND",
"description": "A searchable and filterable directory of React Native libraries",
"lang": "en-US",
"categories": [
"education",
"utilities"
],
"display": "minimal-ui",
"orientation": "any",
"start_url": "/",
"scope": "/",
"protocol_handlers": [
{
"protocol": "web+rnd",
"url": "/?search=%s"
}
],
"theme_color": "#20232a",
"background_color": "#20232a",
"icons": [
{
"src": "/icon-192px.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icon-512px.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}
28 changes: 7 additions & 21 deletions react-native-libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5870,10 +5870,7 @@
},
{
"githubUrl": "https://github.com/AndreiCalazans/rn-tooltip",
"examples": [
"https://github.com/AndreiCalazans/rn-tooltip",
"rn-tooltip"
],
"examples": ["https://github.com/AndreiCalazans/rn-tooltip", "rn-tooltip"],
"images": [
"https://raw.githubusercontent.com/AndreiCalazans/rn-tooltip/HEAD/tooltipExample.gif"
],
Expand Down Expand Up @@ -17923,42 +17920,31 @@
},
{
"githubUrl": "https://github.com/Daavidaviid/react-native-nitro-udp",
"examples": [
"https://github.com/Daavidaviid/react-native-nitro-udp/tree/main/example"
],
"examples": ["https://github.com/Daavidaviid/react-native-nitro-udp/tree/main/example"],
"ios": true,
"android": true
},
{
"githubUrl": "https://github.com/riteshshukla04/react-native-sports-car",
"npmPkg": "react-native-sportscar",
"examples": [
"https://github.com/riteshshukla04/react-native-sports-car/tree/main/example"
],
"examples": ["https://github.com/riteshshukla04/react-native-sports-car/tree/main/example"],
"android": true
},
{
"githubUrl": "https://github.com/corasan/react-native-mlx/tree/main/package",
"npmPkg": "react-native-mlx",
"examples": [
"https://github.com/corasan/react-native-mlx/tree/main/example"
],
"examples": ["https://github.com/corasan/react-native-mlx/tree/main/example"],
"ios": true
},
},
{
"githubUrl": "https://github.com/ChrisCosentino/expo-iperf",
"examples": [
"https://github.com/ChrisCosentino/expo-iperf/tree/main/example"
],
"examples": ["https://github.com/ChrisCosentino/expo-iperf/tree/main/example"],
"ios": true,
"android": true
},
{
"githubUrl": "https://github.com/l2hyunwoo/react-native-nitro-device-info",
"npmPkg": "react-native-nitro-device-info",
"examples": [
"https://github.com/l2hyunwoo/react-native-nitro-device-info/tree/main/example"
],
"examples": ["https://github.com/l2hyunwoo/react-native-nitro-device-info/tree/main/example"],
"ios": true,
"android": true,
"newArchitecture": true
Expand Down
28 changes: 23 additions & 5 deletions scripts/build-and-score-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { fetchNpmRegistryData } from '~/scripts/fetch-npm-registry-data';
import { fetchNpmStatDataBulk } from '~/scripts/fetch-npm-stat-data';
import { type APIResponseType, type LibraryDataEntryType, type LibraryType } from '~/types';
import { isLaterThan, TimeRange } from '~/util/datetime';
import { getNewArchSupportStatus } from '~/util/newArchStatus';
import { isEmptyOrNull } from '~/util/strings';

import { calculateDirectoryScore, calculatePopularityScore } from './calculate-score';
Expand All @@ -30,6 +31,7 @@ const SCRAPE_GH_IMAGES = false;

const DATASET: LibraryDataEntryType[] = USE_DEBUG_REPOS ? debugGithubRepos : githubRepos;
const DATA_PATH = path.resolve('assets', 'data.json');
const CHECK_DATA_PATH = path.resolve('assets', 'check-data.json');

const CHUNK_SIZE = 25;
const SLEEP_TIME = 250;
Expand Down Expand Up @@ -219,31 +221,47 @@ async function buildAndScoreData() {
}
);

const finalData = dataWithFallback.filter(({ npmPkg }) => existingPackages.includes(npmPkg));
const validEntries = data.map((entry: LibraryDataEntryType) => entry.githubUrl);
const finalData = dataWithFallback
.filter(({ npmPkg }) => existingPackages.includes(npmPkg))
.filter((entry: LibraryType) => validEntries.includes(entry.githubUrl));

const sortedTopicCounts = Object.fromEntries(
Object.entries(topicCounts).sort((a, b) => b[1] - a[1])
);

fileContent = JSON.stringify(
{
libraries: finalData.filter((entry: LibraryType) => {
return validEntries.includes(entry.githubUrl);
}),
libraries: finalData,
topics: sortedTopicCounts,
topicsList: Object.keys(topicCounts).sort(),
},
null,
2
);

createCheckEndpointData(finalData);
}

if (!(USE_DEBUG_REPOS || ONLY_WRITE_LOCAL_DATA_FILE)) {
await uploadToStore(fileContent);
}

return fs.writeFileSync(DATA_PATH, fileContent);
fs.writeFileSync(DATA_PATH, fileContent);
}

export function createCheckEndpointData(libraries: LibraryType[]) {
const checkData = Object.fromEntries(
libraries.map(library => [
library.npmPkg,
{
unmaintained: library.unmaintained,
newArchitecture: getNewArchSupportStatus(library),
},
])
);

fs.writeFileSync(CHECK_DATA_PATH, JSON.stringify(checkData, null, 2));
}

export async function fetchGithubDataThrottled({
Expand Down
6 changes: 3 additions & 3 deletions styles/styles.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@font-face {
font-family: "Optimistic Display";
src: url("https://facebookmicrosites.github.io/design/public/fonts/OptimisticDisplayLight-199be98cf48e5b4c688356b08a02362c.woff2")
src: url("/fonts/Optimistic-Display-Light.woff2")
format("woff2");
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: "Optimistic Display";
src: url("https://facebookmicrosites.github.io/design/public/fonts/OptimisticDisplayRegular-b0e4e99f91efd0021c3ab8e4df0e6e1b.woff2")
src: url("/fonts/Optimistic-Display-Regular.woff2")
format("woff2");
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: "Optimistic Display";
src: url("https://facebookmicrosites.github.io/design/public/fonts/OptimisticDisplayBold-3a50548145f36de582c3b36d9626f4d6.woff2")
src: url("/fonts/Optimistic-Display-Bold.woff2")
format("woff2");
font-weight: 700;
font-style: normal;
Expand Down
10 changes: 10 additions & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { type ReactElement, type ReactNode } from 'react';

import { type NewArchSupportStatus } from '~/util/newArchStatus';

export type QueryOrder =
| 'relevance'
| 'updated'
Expand Down Expand Up @@ -172,3 +174,11 @@ export type RepositoryTreeNode = {
name: string;
type: 'tree' | 'blob';
};

export type CheckResultsType = Record<
string,
{
unmaintained?: boolean;
newArchitecture: NewArchSupportStatus;
}
>;