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
11 changes: 10 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"promise/always-return": "error",
"promise/no-callback-in-promise": "error",
"react-hooks/rules-of-hooks": "error",
"react/button-has-type": "error",
"react/forward-ref-uses-ref": "error",
"react/jsx-boolean-value": ["error"],
"react/jsx-curly-brace-presence": ["error"],
Expand All @@ -125,18 +126,20 @@
"react/no-did-mount-set-state": "error",
"react/no-direct-mutation-state": "error",
"react/no-redundant-should-component-update": "error",
"react/no-string-refs": "error",
"react/no-this-in-sfc": "error",
"react/no-unknown-property": "error",
"react/no-unescaped-entities": "error",
"react/no-will-update-set-state": "error",
"react/self-closing-comp": "error",
"react/style-prop-object": "error",
"typescript/await-thenable": "error",
"typescript/ban-ts-comment": [
"error",
{
"minimumDescriptionLength": 3,
"ts-check": false,
"ts-expect-error": "allow-with-description",
"ts-check": false,
"ts-ignore": true,
"ts-nocheck": true
}
Expand All @@ -148,6 +151,12 @@
}
],
"typescript/no-confusing-non-null-assertion": "error",
"typescript/no-confusing-void-expression": [
"error",
{
"ignoreArrowShorthand": true
}
],
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-promises": [
"error",
Expand Down
86 changes: 43 additions & 43 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/Library/Thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Thumbnail({ url }: Props) {
const maxImgPreviewHeight = maxPreviewHeight - 20;

return (
<HoverCard.Root openDelay={0} closeDelay={0} onOpenChange={open => setShowPreview(open)}>
<HoverCard.Root openDelay={0} closeDelay={0} onOpenChange={setShowPreview}>
<HoverCard.Trigger asChild>
<View
tabIndex={0}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@visx/xychart": "^3.12.0",
"crypto-js": "^4.2.0",
"es-toolkit": "^1.44.0",
"expo": "55.0.0-preview.10",
"expo-font": "^55.0.3",
"expo": "55.0.0-preview.11",
"expo-font": "^55.0.4",
"next": "^16.1.6",
"node-emoji": "^2.2.0",
"postcss": "^8.5.6",
Expand Down Expand Up @@ -75,7 +75,7 @@
"next-images": "^1.8.5",
"oxfmt": "^0.33.0",
"oxlint": "^1.48.0",
"oxlint-tsgolint": "^0.13.0",
"oxlint-tsgolint": "^0.14.1",
"simple-git-hooks": "^2.13.1",
"typescript": "^5.9.3",
"user-agent-data-types": "^0.4.2"
Expand Down
5 changes: 3 additions & 2 deletions pages/api/libraries/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {

if (!packages || !Array.isArray(packages)) {
res.statusCode = 500;
return res.json({ error: 'packages must be an array' });
res.json({ error: 'packages must be an array' });
return;
}

res.statusCode = 200;
Expand All @@ -28,5 +29,5 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
result[pkgName] = DATASET[pkgName];
});

return res.json(result);
res.json(result);
}
2 changes: 1 addition & 1 deletion pages/api/libraries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
res.setHeader('Cache-Control', 'public, s-maxage=600, stale-while-revalidate=300');
}

return res.json({
res.json({
libraries: filteredAndPaginatedLibraries,
total: filteredLibraries.length,
});
Expand Down
2 changes: 1 addition & 1 deletion pages/api/libraries/statistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ export default function handler(_: NextApiRequest, res: NextApiResponse) {
res.setHeader('Cache-Control', 'public, s-maxage=600, stale-while-revalidate=300');
res.statusCode = 200;

return res.json(result);
res.json(result);
}
5 changes: 3 additions & 2 deletions pages/api/library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {

if (!packageNames) {
res.statusCode = 500;
return res.json({
res.json({
error: `Invalid request. You need to specify package names via 'name' query param.`,
});
return;
}

res.statusCode = 200;
return res.json(
res.json(
Object.fromEntries(
packageNames.map(name => [
name,
Expand Down
8 changes: 5 additions & 3 deletions pages/api/proxy/npm-stat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

if (!packageName) {
res.statusCode = 500;
return res.json({
res.json({
error: `Invalid request. You need to specify package name via 'name' query param.`,
});
return;
}

const now = Date.now();
Expand All @@ -29,9 +30,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

if ('status' in result && result.status !== 200) {
res.statusCode = result.status;
return res.json({});
res.json({});
return;
}

res.statusCode = 200;
return res.json(await result.json());
res.json(await result.json());
}
10 changes: 6 additions & 4 deletions scripts/build-and-score-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,18 @@ async function buildAndScoreData() {
console.warn(
'\n 🚨 The following repositories were unable to fetch from GitHub, they may need to be removed from react-native-libraries.json:'
);
invalidRepos.forEach(repoUrl => console.warn(`- ${repoUrl}`));
invalidRepos.forEach(repoUrl => {
console.warn(`- ${repoUrl}`);
});
}

if (mismatchedRepos.length) {
console.warn(
`\n 🚨 The following projects repository URLs (${mismatchedRepos.length}) are misaligned with the package name extracted from package.json:`
);
mismatchedRepos.forEach(project =>
console.warn(`- ${project.githubUrl}: ${project.github.name}`)
);
mismatchedRepos.forEach(project => {
console.warn(`- ${project.githubUrl}: ${project.github.name}`);
});
}

console.log('πŸ“„οΈ Preparing data file');
Expand Down
8 changes: 6 additions & 2 deletions scripts/check-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const GITHUB_URLS_ONLY = false;

async function fetchUrl(url: string) {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 10_000);
const timeout = setTimeout(() => {
controller.abort();
}, 10_000);

try {
const res = await fetch(url, { signal: controller.signal, redirect: 'manual' });
Expand Down Expand Up @@ -65,4 +67,6 @@ async function runFetches(libraries: LibraryDataEntryType[]) {
console.log('βœ… All fetches finished!');
}

runFetches(libraries).catch(err => console.error('❌ Unexpected error:', err));
runFetches(libraries).catch(err => {
console.error('❌ Unexpected error:', err);
});