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
2 changes: 1 addition & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"ts-nocheck": true
}
],
"typescript/consistent-indexed-object-style": ["error", "record"],
"typescript/consistent-type-imports": [
"error",
{
Expand Down Expand Up @@ -177,7 +178,6 @@
"typescript/unbound-method": "off",
"unicorn/consistent-date-clone": "error",
"unicorn/consistent-empty-array-spread": "error",
"unicorn/consistent-indexed-object-style": ["error", "record"],
"unicorn/consistent-existence-index-check": "error",
"unicorn/error-message": "error",
"unicorn/no-anonymous-default-export": "error",
Expand Down
170 changes: 106 additions & 64 deletions bun.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@radix-ui/react-hover-card": "^1.1.15",
"@radix-ui/react-tooltip": "^1.2.8",
"@react-native-picker/picker": "^2.11.4",
"@sentry/react": "^10.46.0",
"@sentry/react": "^10.47.0",
"@visx/gradient": "^3.12.0",
"@visx/responsive": "^3.12.0",
"@visx/xychart": "^3.12.0",
Expand Down Expand Up @@ -67,16 +67,16 @@
"@types/semver": "^7.7.1",
"@vercel/blob": "^0.27.3",
"ajv-cli": "^5.0.0",
"browserslist": "^4.28.1",
"browserslist": "^4.28.2",
"cheerio": "^1.2.0",
"dotenv": "^17.3.1",
"lint-staged": "^16.4.0",
"next-compose-plugins": "^2.2.1",
"next-fonts": "^1.5.1",
"next-images": "^1.8.5",
"oxfmt": "^0.42.0",
"oxlint": "^1.57.0",
"oxlint-tsgolint": "^0.17.4",
"oxfmt": "^0.43.0",
"oxlint": "^1.58.0",
"oxlint-tsgolint": "^0.18.1",
"simple-git-hooks": "^2.13.1",
"typescript": "^6.0.2",
"user-agent-data-types": "^0.4.3"
Expand Down
31 changes: 17 additions & 14 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cloneDeep } from 'es-toolkit/object';
import { type NextPageContext } from 'next';
import { type GetServerSidePropsContext } from 'next';

import HomeScene from '~/scenes/HomeScene';
import { type HomePageProps } from '~/types/pages';
Expand All @@ -12,13 +12,14 @@ function Index(props: HomePageProps) {

const LIMIT = 8;

Index.getInitialProps = async (ctx: NextPageContext) => {
if (ctx.res && ctx.query && Object.keys(ctx.query).length > 0) {
ctx.res.writeHead(302, {
Location: urlWithQuery('/packages', ctx.query),
});
ctx.res.end();
return;
export async function getServerSideProps(ctx: GetServerSidePropsContext) {
if (Object.keys(ctx.query).length > 0) {
return {
redirect: {
destination: urlWithQuery('/packages', ctx.query),
permanent: false,
},
};
}

const mostDownloadedResponse = await ssrFetch(
Expand Down Expand Up @@ -56,12 +57,14 @@ Index.getInitialProps = async (ctx: NextPageContext) => {
const statisticResponse = await ssrFetch('/libraries/statistic', {}, ctx);

return {
mostDownloaded: await mostDownloadedResponse.json(),
recentlyAdded: await recentlyAddedResponse.json(),
recentlyUpdated: await recentlyUpdatedResponse.json(),
popular: await popularResponse.json(),
statistic: await statisticResponse.json(),
props: {
mostDownloaded: await mostDownloadedResponse.json(),
recentlyAdded: await recentlyAddedResponse.json(),
recentlyUpdated: await recentlyUpdatedResponse.json(),
popular: await popularResponse.json(),
statistic: await statisticResponse.json(),
},
};
};
}

export default Index;
19 changes: 1 addition & 18 deletions react-native-libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -5217,12 +5217,6 @@
"expoGo": true,
"unmaintained": true
},
{
"githubUrl": "https://github.com/aprock/react-native-os",
"ios": true,
"android": true,
"expoGo": true
},
{
"githubUrl": "https://github.com/tradle/react-native-level-fs",
"ios": true,
Expand Down Expand Up @@ -18088,7 +18082,7 @@
"newArchitecture": true
},
{
"githubUrl": "https://github.com/tristanmanchester/react-native-dotgrid",
"githubUrl": "https://github.com/tristanmanchester/react-native-dotgrid/tree/main/packages/react-native-dotgrid",
"examples": ["https://github.com/tristanmanchester/react-native-dotgrid/tree/main/example"],
"images": [
"https://raw.githubusercontent.com/tristanmanchester/react-native-dotgrid/main/demos/wave.webp",
Expand Down Expand Up @@ -20212,16 +20206,6 @@
"ios": true,
"android": true
},
{
"githubUrl": "https://github.com/mohamed2m2018/react-native-agentic-ai",
"examples": [
"https://github.com/mohamed2m2018/react-native-agentic-ai/tree/main/example-ai-testing",
"https://github.com/mohamed2m2018/react-native-agentic-ai/tree/main/example-expo-router",
"https://github.com/mohamed2m2018/react-native-agentic-ai/tree/main/example-react-navigation"
],
"ios": true,
"android": true
},
{
"githubUrl": "https://github.com/usl-dev/react-intl-phone-username-input",
"examples": [
Expand Down Expand Up @@ -20288,7 +20272,6 @@
},
{
"githubUrl": "https://github.com/alicanov98/react-native-debug-logger",
"npmPkg": "react-native-debug-logger",
"ios": true,
"android": true
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-and-score-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DATASET: LibraryDataEntryType[] = USE_DEBUG_REPOS ? debugGithubRepos : git
const DATA_PATH = path.resolve('assets', 'data.json');
const CHECK_DATA_PATH = path.resolve('assets', 'check-data.json');

const CHUNK_SIZE = 20;
const CHUNK_SIZE = 25;
const NPM_STATS_CHUNK_SIZE = 10;
const SLEEP_TIME = 500;

Expand Down
4 changes: 2 additions & 2 deletions util/SSRFetch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NextPageContext } from 'next';
import { type GetServerSidePropsContext, type NextPageContext } from 'next';

import { type Query } from '~/types';
import { NEXT_1H_CACHE_HEADER } from '~/util/Constants';
Expand All @@ -8,7 +8,7 @@ import urlWithQuery from '~/util/urlWithQuery';
export async function ssrFetch(
url: string,
query: Partial<Query>,
ctx: NextPageContext
ctx: NextPageContext | GetServerSidePropsContext
): Promise<Response> {
return await fetch(getApiUrl(urlWithQuery(url, query), ctx), NEXT_1H_CACHE_HEADER);
}
7 changes: 5 additions & 2 deletions util/getApiUrl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { type NextPageContext } from 'next';
import { type GetServerSidePropsContext, type NextPageContext } from 'next';

export default function getApiUrl(path: string, { req }: NextPageContext) {
export default function getApiUrl(
path: string,
{ req }: NextPageContext | GetServerSidePropsContext
) {
if (!req && typeof window !== 'undefined') {
return `/api${path}`;
}
Expand Down