Skip to content

Commit 4d11003

Browse files
authored
migrate repository to Bun (#1546)
1 parent 3bbbd42 commit 4d11003

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3282
-13597
lines changed

.expo-shared/assets.json

-4
This file was deleted.

.github/workflows/code-deploy-preview.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: Use Node.js 22
15-
uses: actions/setup-node@v4
16-
with:
17-
node-version: '22'
14+
- name: Use Bun
15+
uses: oven-sh/setup-bun@v2
1816
- name: Deploy
1917
shell: bash
20-
run: npx vercel --force --token "$VERCEL_TOKEN"
18+
run: bunx vercel --force --token "$VERCEL_TOKEN"
2119
env:
2220
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
2321
# https://spectrum.chat/zeit/now/solved-project-linking-and-ci-cd-pipelines~5e6eb62a-9d56-47ac-9e32-0d973a523787

.github/workflows/code-deploy-production.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ jobs:
1717
url: https://reactnative.directory
1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Use Node.js 22
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: '22'
20+
- name: Use Bun
21+
uses: oven-sh/setup-bun@v2
2422
- name: Deploy
2523
shell: bash
26-
run: npx vercel --force --token "$VERCEL_TOKEN" --prod
24+
run: bunx vercel --force --token "$VERCEL_TOKEN" --prod
2725
env:
2826
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
2927
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}

.github/workflows/code-lint-and-test.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Use Node.js 22
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: '22'
15+
- name: Use Bun
16+
uses: oven-sh/setup-bun@v2
1917
- name: Install dependencies
20-
run: yarn
18+
run: bun install
2119
- name: TSC
22-
run: yarn tsc
20+
run: bun tsc
2321
- name: Lint
24-
run: yarn lint
22+
run: bun lint
2523
- name: Build Next app
26-
run: yarn next build
24+
run: bun next build

.github/workflows/data-test-and-validate.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Use Node.js 22
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: '22'
15+
- name: Use Bun
16+
uses: oven-sh/setup-bun@v2
1917
- name: Install dependencies
20-
run: yarn
18+
run: bun install
2119
- name: Validate react-native-libraries.json
22-
run: yarn data:validate
20+
run: bun data:validate
2321
- name: Test react-native-libraries.json
24-
run: yarn data:test
22+
run: bun data:test
2523
- name: Check new entries in react-native-libraries.json
26-
run: yarn ci:validate
24+
run: bun ci:validate
2725
env:
2826
CI_CHECKS_TOKEN: ${{ github.token }}

.github/workflows/vercel-cleanup-data-blobs.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Use Node.js 22
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: '22'
15+
- name: Use Bun
16+
uses: oven-sh/setup-bun@v2
1917
- name: Install dependencies
20-
run: yarn
18+
run: bun install
2119
- name: Cleanup data blobs
22-
run: yarn ci:cleanup-blobs
20+
run: bun ci:cleanup-blobs
2321
env:
2422
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}

.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ scripts/raw-github-results.json
33
secrets.json
44
.env
55

6-
# Yarn Berry
7-
.yarn/*
8-
!.yarn/releases
9-
!.yarn/plugins
10-
yarn-error.log
11-
126
# Standard stuff
137
node_modules/**/*
148
npm-debug.*

.yarn/releases/yarn-4.5.3.cjs

-934
This file was deleted.

.yarnrc.yml

-3
This file was deleted.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,20 @@
157157
#### Commands
158158

159159
```sh
160-
yarn && yarn start
160+
bun install && bun start
161161
```
162162

163163
You should be able to visit `localhost:3000` in your browser.
164164

165-
## How do I run `yarn data:update` with keys?
165+
## How do I run `bun data:update` with keys?
166166

167167
- Visit https://github.com/settings/developers to get your keys (don't worry about the callback URL, put whatever you want).
168168
- Load the `GITHUB_TOKEN` environment variable into your shell.
169169

170170
This command creates site data in `./assets/data.json`
171171

172172
```sh
173-
GITHUB_TOKEN=<*> yarn data:update
173+
GITHUB_TOKEN=<*> bun data:update
174174
```
175175

176176
## How do I deploy to production?

bun.lock

+2,841
Large diffs are not rendered by default.

components/Button.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { A } from '@expo/html-elements';
22
import { PropsWithChildren, useContext } from 'react';
33
import { StyleSheet, TextStyle, Pressable } from 'react-native';
44

5-
import { colors, darkColors, HoverEffect, P } from '../common/styleguide';
6-
import CustomAppearanceContext from '../context/CustomAppearanceContext';
5+
import { colors, darkColors, HoverEffect, P } from '~/common/styleguide';
6+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
77

88
type Props = PropsWithChildren & {
99
href?: string;

components/CheckBox.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { useContext } from 'react';
22
import { StyleSheet, View, ViewStyle } from 'react-native';
33

4+
import { colors, darkColors } from '~/common/styleguide';
5+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6+
47
import { Check } from './Icons';
5-
import { colors, darkColors } from '../common/styleguide';
6-
import CustomAppearanceContext from '../context/CustomAppearanceContext';
78

89
type Props = {
910
style?: ViewStyle | ViewStyle[];

components/CompatibilityTags.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { useContext } from 'react';
22
import { StyleSheet, View } from 'react-native';
33

4+
import { colors, darkColors } from '~/common/styleguide';
5+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6+
import { Library } from '~/types';
7+
8+
import { Info } from './Icons';
49
import { NewArchitectureTag } from './Library/NewArchitectureTag';
510
import { Tag } from './Tag';
611
import Tooltip from './Tooltip';
7-
import { colors, darkColors } from '../common/styleguide';
8-
import CustomAppearanceContext from '../context/CustomAppearanceContext';
9-
import { Library } from '../types';
10-
import { Info } from './Icons';
1112

1213
type Props = {
1314
library: Library;

components/ContentContainer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { PropsWithChildren } from 'react';
22
import { View, ViewProps, StyleSheet } from 'react-native';
33

4-
import { layout } from '../common/styleguide';
4+
import { layout } from '~/common/styleguide';
55

66
const ContentContainer = ({ children, style }: PropsWithChildren<ViewProps>) => (
77
<View style={[styles.container, style]}>{children}</View>

components/ErrorState.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { Image, StyleSheet, View } from 'react-native';
22

3+
import { H2, A, P } from '~/common/styleguide';
4+
35
import Navigation from './Navigation';
46
import PageMeta from './PageMeta';
5-
import { H2, A, P } from '../common/styleguide';
67

78
const ErrorState = ({ statusCode }) => {
89
return (
910
<>
1011
<PageMeta title="Error" description="Uh oh, something went wrong" />
1112
<Navigation noHeader />
1213
<View style={styles.container}>
13-
<Image style={styles.img} source={require('../assets/notfound.png')} alt="No results" />
14+
<Image style={styles.img} source={require('~/assets/notfound.png')} alt="No results" />
1415
<H2 style={styles.text}>Uh oh, something went wrong ({statusCode})</H2>
1516
<P style={[styles.text, styles.secondLine]}>
1617
Help fix it? Submit a PR to the{' '}

components/Explore/ExploreSection.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import dynamic from 'next/dynamic';
22
import { createElement, useContext } from 'react';
33
import { StyleSheet, View } from 'react-native';
44

5-
import { A, colors, darkColors, H3, P } from '../../common/styleguide';
6-
import CustomAppearanceContext from '../../context/CustomAppearanceContext';
7-
import { Library as LibraryType, Query } from '../../types';
8-
import urlWithQuery from '../../util/urlWithQuery';
9-
import LoadingContent from '../Library/LoadingContent';
5+
import { A, colors, darkColors, H3, P } from '~/common/styleguide';
6+
import LoadingContent from '~/components/Library/LoadingContent';
7+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
8+
import { Library as LibraryType, Query } from '~/types';
9+
import urlWithQuery from '~/util/urlWithQuery';
1010

11-
const LibraryWithLoading = dynamic(() => import('../Library'), {
11+
const LibraryWithLoading = dynamic(() => import('~/components/Library'), {
1212
loading: () => (
1313
<LoadingContent
1414
width="48.25%"

components/Filters/ClearButton.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { useRef } from 'react';
22
import { Pressable } from 'react-native';
33
import { useHover } from 'react-native-web-hooks';
44

5-
import { colors } from '../../common/styleguide';
5+
import { colors } from '~/common/styleguide';
6+
67
import { XIcon } from '../Icons';
78
import Tooltip from '../Tooltip';
89

components/Filters/FilterButton.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { useContext } from 'react';
22
import { StyleSheet, View, ViewStyle } from 'react-native';
33

4+
import { colors, darkColors, P } from '~/common/styleguide';
5+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6+
import { Query } from '~/types';
7+
48
import { ClearButton } from './ClearButton';
59
import { FILTER_PLATFORMS, FILTER_REQUIRES_MAIN_SEARCH, FILTER_STATUS } from './helpers';
6-
import { colors, darkColors, P } from '../../common/styleguide';
7-
import CustomAppearanceContext from '../../context/CustomAppearanceContext';
8-
import { Query } from '../../types';
910
import { Button } from '../Button';
1011
import { Filter as FilterIcon } from '../Icons';
1112

components/Filters/ToggleLink.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import Link from 'next/link';
22
import { Platform, StyleSheet, View } from 'react-native';
33

4-
import { P, colors } from '../../common/styleguide';
5-
import urlWithQuery from '../../util/urlWithQuery';
4+
import { P, colors } from '~/common/styleguide';
5+
import urlWithQuery from '~/util/urlWithQuery';
6+
67
import { CheckBox } from '../CheckBox';
78

89
export const ToggleLink = ({ query, paramName, title, basePath = '/' }) => {

components/Filters/index.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { useContext } from 'react';
22
import { StyleSheet, View, ViewStyle } from 'react-native';
33

4+
import { colors, Headline, layout, darkColors } from '~/common/styleguide';
5+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6+
import { Query } from '~/types';
7+
import { getPageQuery } from '~/util/search';
8+
49
import { ToggleLink } from './ToggleLink';
510
import {
611
FILTER_COMPATIBILITY,
712
FILTER_PLATFORMS,
813
FILTER_REQUIRES_MAIN_SEARCH,
914
FILTER_STATUS,
1015
} from './helpers';
11-
import { colors, Headline, layout, darkColors } from '../../common/styleguide';
12-
import CustomAppearanceContext from '../../context/CustomAppearanceContext';
13-
import { Query } from '../../types';
14-
import { getPageQuery } from '../../util/search';
1516

1617
type FiltersProps = {
1718
query: Query;

components/Footer.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { FunctionComponent, SVGAttributes, createElement, useContext } from 'react';
22
import { StyleSheet, View, ViewStyle } from 'react-native';
33

4+
import { A, P, colors, darkColors, useLayout } from '~/common/styleguide';
5+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
6+
47
import ContentContainer from './ContentContainer';
58
import {
69
Logo,
@@ -13,8 +16,6 @@ import {
1316
PlatformWindows,
1417
} from './Icons';
1518
import VercelBanner from './VercelBanner';
16-
import { A, P, colors, darkColors, useLayout } from '../common/styleguide';
17-
import CustomAppearanceContext from '../context/CustomAppearanceContext';
1819

1920
type PlatformProps = {
2021
name: string;

components/Header.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import { A, Header as HtmlHeader } from '@expo/html-elements';
22
import { useContext } from 'react';
33
import { StyleSheet, View, Text } from 'react-native';
44

5+
import { layout, colors, H5, P, darkColors, useLayout } from '~/common/styleguide';
6+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
7+
58
import { Button } from './Button';
69
import { GitHub, Logo, Plus } from './Icons';
710
import Tooltip from './Tooltip';
8-
import { layout, colors, H5, P, darkColors, useLayout } from '../common/styleguide';
9-
import CustomAppearanceContext from '../context/CustomAppearanceContext';
1011

1112
const Header = () => {
1213
const { isDark, setIsDark } = useContext(CustomAppearanceContext);

components/Icons/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Circle, Path, Rect, Svg } from 'react-native-svg';
22

3-
import { colors } from '../../common/styleguide';
3+
import { colors } from '~/common/styleguide';
44

55
type Props = {
66
fill?: string;

components/Libraries.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import dynamic from 'next/dynamic';
22
import { Image, StyleSheet, View } from 'react-native';
33

4-
import LoadingContent from './Library/LoadingContent';
5-
import { H3, A, P } from '../common/styleguide';
6-
import { Library as LibraryType } from '../types';
4+
import { H3, A, P } from '~/common/styleguide';
5+
import LoadingContent from '~/components/Library/LoadingContent';
6+
import { Library as LibraryType } from '~/types';
77

88
type Props = {
99
libraries: LibraryType[];
1010
};
1111

12-
const LibraryWithLoading = dynamic(() => import('../components/Library'), {
12+
const LibraryWithLoading = dynamic(() => import('~/components/Library'), {
1313
loading: () => <LoadingContent />,
1414
});
1515

1616
const Libraries = ({ libraries }: Props) => {
1717
if (!libraries || !libraries.length) {
1818
return (
1919
<View style={styles.container}>
20-
<Image style={styles.img} source={require('../assets/notfound.png')} alt="No results" />
20+
<Image style={styles.img} source={require('~/assets/notfound.png')} alt="No results" />
2121
<H3 style={styles.text}>Nothing was found! Try another search.</H3>
2222
<View style={{ marginTop: 20 }} />
2323
<P style={styles.text}>

components/Library/DirectoryScore.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { useContext } from 'react';
22
import { View } from 'react-native';
33
import { Svg, Path, Circle } from 'react-native-svg';
44

5-
import { colors, darkColors } from '../../common/styleguide';
6-
import CustomAppearanceContext from '../../context/CustomAppearanceContext';
5+
import { colors, darkColors } from '~/common/styleguide';
6+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
7+
78
import Tooltip from '../Tooltip';
89

910
type Props = {

components/Library/LoadingContent.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useContext } from 'react';
22
import ContentLoader from 'react-content-loader';
33

4-
import { colors, darkColors, useLayout } from '../../common/styleguide';
5-
import CustomAppearanceContext from '../../context/CustomAppearanceContext';
4+
import { colors, darkColors, useLayout } from '~/common/styleguide';
5+
import CustomAppearanceContext from '~/context/CustomAppearanceContext';
66

77
const LoadingContent = ({ width = '100%', height = 232, wrapperStyle = {} }) => {
88
const { isDark } = useContext(CustomAppearanceContext);

0 commit comments

Comments
 (0)